Class: Fastly::LegacyWafFirewallApi

Inherits:
Object
  • Object
show all
Defined in:
lib/fastly/api/legacy_waf_firewall_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LegacyWafFirewallApi

Returns a new instance of LegacyWafFirewallApi.



17
18
19
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 17

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



15
16
17
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 15

def api_client
  @api_client
end

Instance Method Details

#create_legacy_waf_firewall_service(opts = {}) ⇒ Object

Create a firewall Create a firewall object for a particular service and version.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :request_body (Hash<String, Object>)

Returns:

  • (Object)


26
27
28
29
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 26

def create_legacy_waf_firewall_service(opts = {})
  data, _status_code, _headers = create_legacy_waf_firewall_service_with_http_info(opts)
  data
end

#create_legacy_waf_firewall_service_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Create a firewall Create a firewall object for a particular service and version.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :request_body (Hash<String, Object>)

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 37

def create_legacy_waf_firewall_service_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LegacyWafFirewallApi.create_legacy_waf_firewall_service ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafFirewallApi.create_legacy_waf_firewall_service"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling LegacyWafFirewallApi.create_legacy_waf_firewall_service"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/wafs'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"LegacyWafFirewallApi.create_legacy_waf_firewall_service",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LegacyWafFirewallApi#create_legacy_waf_firewall_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#disable_legacy_waf_firewall(opts = {}) ⇒ Object

Disable a firewall Disable a firewall for a particular service and version. This endpoint is intended to be used in an emergency. Disabling a firewall object for a specific service and version replaces your existing WAF ruleset with an empty ruleset. While disabled, your WAF ruleset will not be applied to your origin traffic. This endpoint is only available to users assigned the role of superuser or above. This is an asynchronous action. To check on the completion of this action, use the related link returned in the response to check on the Update Status of the action.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

  • :request_body (Hash<String, Object>)

Returns:

  • (Object)


102
103
104
105
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 102

def disable_legacy_waf_firewall(opts = {})
  data, _status_code, _headers = disable_legacy_waf_firewall_with_http_info(opts)
  data
end

#disable_legacy_waf_firewall_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Disable a firewall Disable a firewall for a particular service and version. This endpoint is intended to be used in an emergency. Disabling a firewall object for a specific service and version replaces your existing WAF ruleset with an empty ruleset. While disabled, your WAF ruleset will not be applied to your origin traffic. This endpoint is only available to users assigned the role of superuser or above. This is an asynchronous action. To check on the completion of this action, use the related link returned in the response to check on the Update Status of the action.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

  • :request_body (Hash<String, Object>)

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 112

def disable_legacy_waf_firewall_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LegacyWafFirewallApi.disable_legacy_waf_firewall ...'
  end
  # unbox the parameters from the hash
  firewall_id = opts[:'firewall_id']
  # verify the required parameter 'firewall_id' is set
  if @api_client.config.client_side_validation && firewall_id.nil?
    fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafFirewallApi.disable_legacy_waf_firewall"
  end
  # resource path
  local_var_path = '/wafs/{firewall_id}/disable'.sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"LegacyWafFirewallApi.disable_legacy_waf_firewall",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LegacyWafFirewallApi#disable_legacy_waf_firewall\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#enable_legacy_waf_firewall(opts = {}) ⇒ Object

Enable a firewall Re-enable a firewall object for a particular service and version after it has been disabled. This endpoint is intended to be used in an emergency. When a firewall object is re-enabled, a newly generated WAF ruleset VCL based on the current WAF configuration is used to replace the empty ruleset. This endpoint is only available to users assigned the role of superuser or above. This is an asynchronous action. To check on the completion of this action, use the related link returned in the response to check on the Update Status of the action.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

  • :request_body (Hash<String, Object>)

Returns:

  • (Object)


172
173
174
175
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 172

def enable_legacy_waf_firewall(opts = {})
  data, _status_code, _headers = enable_legacy_waf_firewall_with_http_info(opts)
  data
end

#enable_legacy_waf_firewall_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Enable a firewall Re-enable a firewall object for a particular service and version after it has been disabled. This endpoint is intended to be used in an emergency. When a firewall object is re-enabled, a newly generated WAF ruleset VCL based on the current WAF configuration is used to replace the empty ruleset. This endpoint is only available to users assigned the role of superuser or above. This is an asynchronous action. To check on the completion of this action, use the related link returned in the response to check on the Update Status of the action.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

  • :request_body (Hash<String, Object>)

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 182

def enable_legacy_waf_firewall_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LegacyWafFirewallApi.enable_legacy_waf_firewall ...'
  end
  # unbox the parameters from the hash
  firewall_id = opts[:'firewall_id']
  # verify the required parameter 'firewall_id' is set
  if @api_client.config.client_side_validation && firewall_id.nil?
    fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafFirewallApi.enable_legacy_waf_firewall"
  end
  # resource path
  local_var_path = '/wafs/{firewall_id}/enable'.sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"LegacyWafFirewallApi.enable_legacy_waf_firewall",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LegacyWafFirewallApi#enable_legacy_waf_firewall\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_legacy_waf_firewall(opts = {}) ⇒ Object

Get a firewall object Get a specific firewall object.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

  • :include (String)

    Include relationships. Optional, comma separated values. Permitted values: &#x60;configuration_set&#x60;, &#x60;owasp&#x60;, &#x60;rules&#x60;, &#x60;rule_statuses&#x60;.

Returns:

  • (Object)


242
243
244
245
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 242

def get_legacy_waf_firewall(opts = {})
  data, _status_code, _headers = get_legacy_waf_firewall_with_http_info(opts)
  data
end

#get_legacy_waf_firewall_service(opts = {}) ⇒ Object

Get a firewall Get a specific firewall object.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

Returns:

  • (Object)


309
310
311
312
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 309

def get_legacy_waf_firewall_service(opts = {})
  data, _status_code, _headers = get_legacy_waf_firewall_service_with_http_info(opts)
  data
end

#get_legacy_waf_firewall_service_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get a firewall Get a specific firewall object.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 320

def get_legacy_waf_firewall_service_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LegacyWafFirewallApi.get_legacy_waf_firewall_service ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  firewall_id = opts[:'firewall_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafFirewallApi.get_legacy_waf_firewall_service"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling LegacyWafFirewallApi.get_legacy_waf_firewall_service"
  end
  # verify the required parameter 'firewall_id' is set
  if @api_client.config.client_side_validation && firewall_id.nil?
    fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafFirewallApi.get_legacy_waf_firewall_service"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/wafs/{firewall_id}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"LegacyWafFirewallApi.get_legacy_waf_firewall_service",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LegacyWafFirewallApi#get_legacy_waf_firewall_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_legacy_waf_firewall_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get a firewall object Get a specific firewall object.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

  • :include (String)

    Include relationships. Optional, comma separated values. Permitted values: &#x60;configuration_set&#x60;, &#x60;owasp&#x60;, &#x60;rules&#x60;, &#x60;rule_statuses&#x60;.

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 252

def get_legacy_waf_firewall_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LegacyWafFirewallApi.get_legacy_waf_firewall ...'
  end
  # unbox the parameters from the hash
  firewall_id = opts[:'firewall_id']
  # verify the required parameter 'firewall_id' is set
  if @api_client.config.client_side_validation && firewall_id.nil?
    fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafFirewallApi.get_legacy_waf_firewall"
  end
  # resource path
  local_var_path = '/wafs/{firewall_id}'.sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"LegacyWafFirewallApi.get_legacy_waf_firewall",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LegacyWafFirewallApi#get_legacy_waf_firewall\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_legacy_waf_firewalls(opts = {}) ⇒ Object

List active firewalls List all active firewall objects.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :filter_rules_rule_id (String)

    Limit the returned firewalls to a specific rule ID.

  • :page_number (Integer)

    Current page.

  • :page_size (Integer)

    Number of records per page. (default to 20)

  • :include (String)

    Include relationships. Optional, comma separated values. Permitted values: &#x60;configuration_set&#x60;, &#x60;owasp&#x60;.

Returns:

  • (Object)


387
388
389
390
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 387

def list_legacy_waf_firewalls(opts = {})
  data, _status_code, _headers = list_legacy_waf_firewalls_with_http_info(opts)
  data
end

#list_legacy_waf_firewalls_service(opts = {}) ⇒ Object

List firewalls List all firewall objects for a particular service and version.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :page_number (Integer)

    Current page.

  • :page_size (Integer)

    Number of records per page. (default to 20)

  • :include (String)

    Include relationships. Optional, comma separated values. Permitted values: &#x60;configuration_set&#x60;, &#x60;owasp&#x60;.

Returns:

  • (Object)


464
465
466
467
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 464

def list_legacy_waf_firewalls_service(opts = {})
  data, _status_code, _headers = list_legacy_waf_firewalls_service_with_http_info(opts)
  data
end

#list_legacy_waf_firewalls_service_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

List firewalls List all firewall objects for a particular service and version.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :page_number (Integer)

    Current page.

  • :page_size (Integer)

    Number of records per page. (default to 20)

  • :include (String)

    Include relationships. Optional, comma separated values. Permitted values: &#x60;configuration_set&#x60;, &#x60;owasp&#x60;.

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 477

def list_legacy_waf_firewalls_service_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LegacyWafFirewallApi.list_legacy_waf_firewalls_service ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafFirewallApi.list_legacy_waf_firewalls_service"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling LegacyWafFirewallApi.list_legacy_waf_firewalls_service"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LegacyWafFirewallApi.list_legacy_waf_firewalls_service, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LegacyWafFirewallApi.list_legacy_waf_firewalls_service, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/wafs'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"LegacyWafFirewallApi.list_legacy_waf_firewalls_service",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LegacyWafFirewallApi#list_legacy_waf_firewalls_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_legacy_waf_firewalls_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

List active firewalls List all active firewall objects.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :filter_rules_rule_id (String)

    Limit the returned firewalls to a specific rule ID.

  • :page_number (Integer)

    Current page.

  • :page_size (Integer)

    Number of records per page. (default to 20)

  • :include (String)

    Include relationships. Optional, comma separated values. Permitted values: &#x60;configuration_set&#x60;, &#x60;owasp&#x60;.

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 399

def list_legacy_waf_firewalls_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LegacyWafFirewallApi.list_legacy_waf_firewalls ...'
  end
  # unbox the parameters from the hash
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LegacyWafFirewallApi.list_legacy_waf_firewalls, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling LegacyWafFirewallApi.list_legacy_waf_firewalls, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/wafs'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'filter[rules][rule_id]'] = opts[:'filter_rules_rule_id'] if !opts[:'filter_rules_rule_id'].nil?
  query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?
  query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"LegacyWafFirewallApi.list_legacy_waf_firewalls",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LegacyWafFirewallApi#list_legacy_waf_firewalls\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_legacy_waf_firewall_service(opts = {}) ⇒ Object

Update a firewall Update a firewall object for a particular service and version.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

  • :request_body (Hash<String, Object>)

Returns:

  • (Object)


550
551
552
553
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 550

def update_legacy_waf_firewall_service(opts = {})
  data, _status_code, _headers = update_legacy_waf_firewall_service_with_http_info(opts)
  data
end

#update_legacy_waf_firewall_service_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Update a firewall Update a firewall object for a particular service and version.

Parameters:

  • opts (Hash) (defaults to: {})

    a customizable set of options

Options Hash (opts):

  • :service_id (String)

    Alphanumeric string identifying the service. (required)

  • :version_id (Integer)

    Integer identifying a service version. (required)

  • :firewall_id (String)

    Alphanumeric string identifying a Firewall. (required)

  • :request_body (Hash<String, Object>)

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# File 'lib/fastly/api/legacy_waf_firewall_api.rb', line 562

def update_legacy_waf_firewall_service_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LegacyWafFirewallApi.update_legacy_waf_firewall_service ...'
  end
  # unbox the parameters from the hash
  service_id = opts[:'service_id']
  version_id = opts[:'version_id']
  firewall_id = opts[:'firewall_id']
  # verify the required parameter 'service_id' is set
  if @api_client.config.client_side_validation && service_id.nil?
    fail ArgumentError, "Missing the required parameter 'service_id' when calling LegacyWafFirewallApi.update_legacy_waf_firewall_service"
  end
  # verify the required parameter 'version_id' is set
  if @api_client.config.client_side_validation && version_id.nil?
    fail ArgumentError, "Missing the required parameter 'version_id' when calling LegacyWafFirewallApi.update_legacy_waf_firewall_service"
  end
  # verify the required parameter 'firewall_id' is set
  if @api_client.config.client_side_validation && firewall_id.nil?
    fail ArgumentError, "Missing the required parameter 'firewall_id' when calling LegacyWafFirewallApi.update_legacy_waf_firewall_service"
  end
  # resource path
  local_var_path = '/service/{service_id}/version/{version_id}/wafs/{firewall_id}'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s)).sub('{' + 'firewall_id' + '}', CGI.escape(firewall_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'request_body'])

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['token']

  new_options = opts.merge(
    :operation => :"LegacyWafFirewallApi.update_legacy_waf_firewall_service",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LegacyWafFirewallApi#update_legacy_waf_firewall_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end