Class: OCI::Waas::WaasClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/waas/waas_client.rb

Overview

OCI Web Application Acceleration and Security Services

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ WaasClient

Creates a new WaasClient. Notes:

If a config is not specified, then the global OCI.config will be used.

This client is not thread-safe

Either a region or an endpoint must be specified.  If an endpoint is specified, it will be used instead of the
  region. A region may be specified in the config or via or the region parameter. If specified in both, then the
  region parameter will be used.

Parameters:

  • config (Config) (defaults to: nil)

    A Config object.

  • region (String) (defaults to: nil)

    A region used to determine the service endpoint. This will usually correspond to a value in Regions::REGION_ENUM, but may be an arbitrary string.

  • endpoint (String) (defaults to: nil)

    The fully qualified endpoint URL

  • signer (OCI::BaseSigner) (defaults to: nil)

    A signer implementation which can be used by this client. If this is not provided then a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication, so that the instance principals signer can be provided to the client

  • proxy_settings (OCI::ApiClientProxySettings) (defaults to: nil)

    If your environment requires you to use a proxy server for outgoing HTTP requests the details for the proxy can be provided in this parameter

  • retry_config (OCI::Retry::RetryConfig) (defaults to: nil)

    The retry configuration for this service client. This represents the default retry configuration to apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is ‘nil`, which means that an operation will not perform any retries



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
# File 'lib/oci/waas/waas_client.rb', line 52

def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
  # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
  # pass it to this constructor.
  #
  # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
  # so try and load the config from the default file.
  config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
  config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
  config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)

  if signer.nil?
    signer = OCI::Signer.new(
      config.user,
      config.fingerprint,
      config.tenancy,
      config.key_file,
      pass_phrase: config.pass_phrase,
      private_key_content: config.key_content
    )
  end

  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
  @retry_config = retry_config

  if endpoint
    @endpoint = endpoint + '/20181116'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "WaasClient endpoint set to '#{@endpoint}'." if logger
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



12
13
14
# File 'lib/oci/waas/waas_client.rb', line 12

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


16
17
18
# File 'lib/oci/waas/waas_client.rb', line 16

def endpoint
  @endpoint
end

#regionString

The region, which will usually correspond to a value in Regions::REGION_ENUM.

Returns:

  • (String)


26
27
28
# File 'lib/oci/waas/waas_client.rb', line 26

def region
  @region
end

#retry_configOCI::Retry::RetryConfig (readonly)

The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is ‘nil`, which means that an operation will not perform any retries



22
23
24
# File 'lib/oci/waas/waas_client.rb', line 22

def retry_config
  @retry_config
end

Instance Method Details

#accept_recommendations(waas_policy_id, protection_rule_keys, opts = {}) ⇒ Response

Accepts a list of recommended Web Application Firewall protection rules. Web Application Firewall protection rule recommendations are sets of rules generated by observed traffic patterns through the Web Application Firewall and are meant to optimize the Web Application Firewall’s security profile. Only the rules specified in the request body will be updated; all other rules will remain unchanged.

Use the ‘GET /waasPolicies/waasPolicyId/wafConfig/recommendations` method to view a list of recommended Web Application Firewall protection rules. For more information, see [WAF Protection Rules](docs.cloud.oracle.com/iaas/Content/WAF/Tasks/wafprotectionrules.htm).

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



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
# File 'lib/oci/waas/waas_client.rb', line 122

def accept_recommendations(waas_policy_id, protection_rule_keys, opts = {})
  logger.debug 'Calling operation WaasClient#accept_recommendations.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling accept_recommendations." if waas_policy_id.nil?
  raise "Missing the required parameter 'protection_rule_keys' when calling accept_recommendations." if protection_rule_keys.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/actions/acceptWafConfigRecommendations'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(protection_rule_keys)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#accept_recommendations') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#cancel_work_request(work_request_id, opts = {}) ⇒ Response

Cancels a specified work request.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



179
180
181
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
# File 'lib/oci/waas/waas_client.rb', line 179

def cancel_work_request(work_request_id, opts = {})
  logger.debug 'Calling operation WaasClient#cancel_work_request.' if logger

  raise "Missing the required parameter 'work_request_id' when calling cancel_work_request." if work_request_id.nil?
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#cancel_work_request') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#change_certificate_compartment(certificate_id, change_certificate_compartment_details, opts = {}) ⇒ Response

Moves certificate into a different compartment. When provided, If-Match is checked against ETag values of the certificate.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

Returns:

  • (Response)

    A Response object with data of type nil



238
239
240
241
242
243
244
245
246
247
248
249
250
251
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
# File 'lib/oci/waas/waas_client.rb', line 238

def change_certificate_compartment(certificate_id, change_certificate_compartment_details, opts = {})
  logger.debug 'Calling operation WaasClient#change_certificate_compartment.' if logger

  raise "Missing the required parameter 'certificate_id' when calling change_certificate_compartment." if certificate_id.nil?
  raise "Missing the required parameter 'change_certificate_compartment_details' when calling change_certificate_compartment." if change_certificate_compartment_details.nil?
  raise "Parameter value for 'certificate_id' must not be blank" if OCI::Internal::Util.blank_string?(certificate_id)

  path = '/certificates/{certificateId}/actions/changeCompartment'.sub('{certificateId}', certificate_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(change_certificate_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#change_certificate_compartment') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#change_waas_policy_compartment(waas_policy_id, change_waas_policy_compartment_details, opts = {}) ⇒ Response

Moves WAAS policy into a different compartment. When provided, If-Match is checked against ETag values of the WAAS policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

Returns:

  • (Response)

    A Response object with data of type nil



298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/oci/waas/waas_client.rb', line 298

def change_waas_policy_compartment(waas_policy_id, change_waas_policy_compartment_details, opts = {})
  logger.debug 'Calling operation WaasClient#change_waas_policy_compartment.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling change_waas_policy_compartment." if waas_policy_id.nil?
  raise "Missing the required parameter 'change_waas_policy_compartment_details' when calling change_waas_policy_compartment." if change_waas_policy_compartment_details.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/actions/changeCompartment'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(change_waas_policy_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#change_waas_policy_compartment') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_certificate(create_certificate_details, opts = {}) ⇒ Response

Allows an SSL certificate to be added to a WAAS policy. The Web Application Firewall terminates SSL connections to inspect requests in runtime, and then re-encrypts requests before sending them to the origin for fulfillment.

For more information, see [WAF Settings](docs.cloud.oracle.com/iaas/Content/WAF/Tasks/wafsettings.htm).

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

Returns:



358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/oci/waas/waas_client.rb', line 358

def create_certificate(create_certificate_details, opts = {})
  logger.debug 'Calling operation WaasClient#create_certificate.' if logger

  raise "Missing the required parameter 'create_certificate_details' when calling create_certificate." if create_certificate_details.nil?

  path = '/certificates'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_certificate_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#create_certificate') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Waas::Models::Certificate'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_waas_policy(create_waas_policy_details, opts = {}) ⇒ Response

Creates a new Web Application Acceleration and Security (WAAS) policy in the specified compartment. A WAAS policy must be established before creating Web Application Firewall (WAF) rules. To use WAF rules, your web application’s origin servers must defined in the ‘WaasPolicy` schema.

A domain name must be specified when creating a WAAS policy. The domain name should be different from the origins specified in your ‘WaasPolicy`. Once domain name is entered and stored, it is unchangeable.

Use the record data returned in the ‘cname` field of the `WaasPolicy` object to create a CNAME record in your DNS configuration that will direct your domain’s traffic through the WAF.

For the purposes of access control, you must provide the OCID of the compartment where you want the service to reside. For information about access control and compartments, see [Overview of the IAM Service](docs.cloud.oracle.com/iaas/Content/Identity/Concepts/overview.htm).

You must specify a display name and domain for the WAAS policy. The display name does not have to be unique and can be changed. The domain name should be different from every origin specified in ‘WaasPolicy`.

All Oracle Cloud Infrastructure resources, including WAAS policies, receive a unique, Oracle-assigned ID called an Oracle Cloud Identifier (OCID). When a resource is created, you can find its OCID in the response. You can also retrieve a resource’s OCID by using a list API operation for that resource type, or by viewing the resource in the Console. Fore more information, see [Resource Identifiers](docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm).

Note: After sending the POST request, the new object’s state will temporarily be ‘CREATING`. Ensure that the resource’s state has changed to ‘ACTIVE` before use.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

Returns:

  • (Response)

    A Response object with data of type nil



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
455
456
457
458
459
460
461
462
# File 'lib/oci/waas/waas_client.rb', line 426

def create_waas_policy(create_waas_policy_details, opts = {})
  logger.debug 'Calling operation WaasClient#create_waas_policy.' if logger

  raise "Missing the required parameter 'create_waas_policy_details' when calling create_waas_policy." if create_waas_policy_details.nil?

  path = '/waasPolicies'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_waas_policy_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#create_waas_policy') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_certificate(certificate_id, opts = {}) ⇒ Response

Deletes an SSL certificate from the WAAS service.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



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
# File 'lib/oci/waas/waas_client.rb', line 482

def delete_certificate(certificate_id, opts = {})
  logger.debug 'Calling operation WaasClient#delete_certificate.' if logger

  raise "Missing the required parameter 'certificate_id' when calling delete_certificate." if certificate_id.nil?
  raise "Parameter value for 'certificate_id' must not be blank" if OCI::Internal::Util.blank_string?(certificate_id)

  path = '/certificates/{certificateId}'.sub('{certificateId}', certificate_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#delete_certificate') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_waas_policy(waas_policy_id, opts = {}) ⇒ Response

Deletes a policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
# File 'lib/oci/waas/waas_client.rb', line 540

def delete_waas_policy(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#delete_waas_policy.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling delete_waas_policy." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#delete_waas_policy') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_certificate(certificate_id, opts = {}) ⇒ Response

Gets the details of an SSL certificate.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



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
626
627
628
629
630
631
# File 'lib/oci/waas/waas_client.rb', line 595

def get_certificate(certificate_id, opts = {})
  logger.debug 'Calling operation WaasClient#get_certificate.' if logger

  raise "Missing the required parameter 'certificate_id' when calling get_certificate." if certificate_id.nil?
  raise "Parameter value for 'certificate_id' must not be blank" if OCI::Internal::Util.blank_string?(certificate_id)

  path = '/certificates/{certificateId}'.sub('{certificateId}', certificate_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#get_certificate') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Waas::Models::Certificate'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_device_fingerprint_challenge(waas_policy_id, opts = {}) ⇒ Response

Gets the device fingerprint challenge settings in the Web Application Firewall configuration for a WAAS policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
# File 'lib/oci/waas/waas_client.rb', line 648

def get_device_fingerprint_challenge(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#get_device_fingerprint_challenge.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling get_device_fingerprint_challenge." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/deviceFingerprintChallenge'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#get_device_fingerprint_challenge') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Waas::Models::DeviceFingerprintChallenge'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_human_interaction_challenge(waas_policy_id, opts = {}) ⇒ Response

Gets the human interaction challenge settings in the Web Application Firewall configuration for a WAAS policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
# File 'lib/oci/waas/waas_client.rb', line 701

def get_human_interaction_challenge(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#get_human_interaction_challenge.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling get_human_interaction_challenge." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/humanInteractionChallenge'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#get_human_interaction_challenge') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Waas::Models::HumanInteractionChallenge'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_js_challenge(waas_policy_id, opts = {}) ⇒ Response

Gets the JavaScript challenge settings in the Web Application Firewall configuration for a WAAS policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
# File 'lib/oci/waas/waas_client.rb', line 754

def get_js_challenge(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#get_js_challenge.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling get_js_challenge." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/jsChallenge'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#get_js_challenge') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Waas::Models::JsChallenge'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_policy_config(waas_policy_id, opts = {}) ⇒ Response

Gets the configuration of a WAAS policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
# File 'lib/oci/waas/waas_client.rb', line 807

def get_policy_config(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#get_policy_config.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling get_policy_config." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/policyConfig'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#get_policy_config') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Waas::Models::PolicyConfig'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_protection_rule(waas_policy_id, protection_rule_key, opts = {}) ⇒ Response

Gets the details of a protection rule in the Web Application Firewall configuration for a WAAS policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
# File 'lib/oci/waas/waas_client.rb', line 861

def get_protection_rule(waas_policy_id, protection_rule_key, opts = {})
  logger.debug 'Calling operation WaasClient#get_protection_rule.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling get_protection_rule." if waas_policy_id.nil?
  raise "Missing the required parameter 'protection_rule_key' when calling get_protection_rule." if protection_rule_key.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)
  raise "Parameter value for 'protection_rule_key' must not be blank" if OCI::Internal::Util.blank_string?(protection_rule_key)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/protectionRules/{protectionRuleKey}'.sub('{waasPolicyId}', waas_policy_id.to_s).sub('{protectionRuleKey}', protection_rule_key.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#get_protection_rule') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Waas::Models::ProtectionRule'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_protection_settings(waas_policy_id, opts = {}) ⇒ Response

Gets the protection settings in the Web Application Firewall configuration for a WAAS policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
# File 'lib/oci/waas/waas_client.rb', line 916

def get_protection_settings(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#get_protection_settings.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling get_protection_settings." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/protectionSettings'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#get_protection_settings') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Waas::Models::ProtectionSettings'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_waas_policy(waas_policy_id, opts = {}) ⇒ Response

Gets the details of a WAAS policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
# File 'lib/oci/waas/waas_client.rb', line 969

def get_waas_policy(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#get_waas_policy.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling get_waas_policy." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#get_waas_policy') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Waas::Models::WaasPolicy'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_waf_address_rate_limiting(waas_policy_id, opts = {}) ⇒ Response

Gets the address rate limiting settings of the Web Application Firewall configuration for a WAAS policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
# File 'lib/oci/waas/waas_client.rb', line 1022

def get_waf_address_rate_limiting(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#get_waf_address_rate_limiting.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling get_waf_address_rate_limiting." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/addressRateLimiting'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#get_waf_address_rate_limiting') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Waas::Models::AddressRateLimiting'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_waf_config(waas_policy_id, opts = {}) ⇒ Response

Gets the Web Application Firewall configuration details for a WAAS policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
# File 'lib/oci/waas/waas_client.rb', line 1075

def get_waf_config(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#get_waf_config.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling get_waf_config." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#get_waf_config') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Waas::Models::WafConfig'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_work_request(work_request_id, opts = {}) ⇒ Response

Gets the details of a specified work request.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

Returns:



1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
# File 'lib/oci/waas/waas_client.rb', line 1128

def get_work_request(work_request_id, opts = {})
  logger.debug 'Calling operation WaasClient#get_work_request.' if logger

  raise "Missing the required parameter 'work_request_id' when calling get_work_request." if work_request_id.nil?
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#get_work_request') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Waas::Models::WorkRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_access_rules(waas_policy_id, opts = {}) ⇒ Response

Gets the currently configured access rules for the Web Application Firewall configration of a specified WAAS policy. The order of the access rules is important. The rules will be checked in the order they are specified and the first matching rule will be used.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

Returns:



1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
# File 'lib/oci/waas/waas_client.rb', line 1184

def list_access_rules(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_access_rules.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling list_access_rules." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/accessRules'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_access_rules') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::AccessRule>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_captchas(waas_policy_id, opts = {}) ⇒ Response

Gets the list of currently configured CAPTCHA challenges in the Web Application Firewall configuration of a WAAS policy.

The order of the CAPTCHA challenges is important. The URL for each CAPTCHA will be checked in the order they are created.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

Returns:



1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
# File 'lib/oci/waas/waas_client.rb', line 1246

def list_captchas(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_captchas.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling list_captchas." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/captchas'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_captchas') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::Captcha>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_certificates(compartment_id, opts = {}) ⇒ Response

Gets a list of SSL certificates that can be used in a WAAS policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

  • :sort_by (String)

    The value by which certificate summaries are sorted in a paginated ‘List’ call. If unspecified, defaults to ‘timeCreated`. Allowed values are: id, compartmentId, displayName, notValidAfter, timeCreated

  • :sort_order (String)

    The value of the sorting direction of resources in a paginated ‘List’ call. If unspecified, defaults to ‘DESC`. Allowed values are: ASC, DESC

  • :id (Array<String>)

    Filter certificates using a list of certificates OCIDs.

  • :display_name (Array<String>)

    Filter certificates using a list of display names.

  • :lifecycle_state (Array<String>)

    Filter certificates using a list of lifecycle states.

  • :time_created_greater_than_or_equal_to (DateTime)

    A filter that matches certificates created on or after the specified date-time.

  • :time_created_less_than (DateTime)

    A filter that matches certificates created before the specified date-time.

Returns:



1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
# File 'lib/oci/waas/waas_client.rb', line 1312

def list_certificates(compartment_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_certificates.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_certificates." if compartment_id.nil?

  if opts[:sort_by] && !%w[id compartmentId displayName notValidAfter timeCreated].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of id, compartmentId, displayName, notValidAfter, timeCreated.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end

  path = '/certificates'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:id] = OCI::ApiClient.build_collection_params(opts[:id], :multi) if opts[:id] && !opts[:id].empty?
  query_params[:displayName] = OCI::ApiClient.build_collection_params(opts[:display_name], :multi) if opts[:display_name] && !opts[:display_name].empty?
  query_params[:lifecycleState] = OCI::ApiClient.build_collection_params(opts[:lifecycle_state], :multi) if opts[:lifecycle_state] && !opts[:lifecycle_state].empty?
  query_params[:timeCreatedGreaterThanOrEqualTo] = opts[:time_created_greater_than_or_equal_to] if opts[:time_created_greater_than_or_equal_to]
  query_params[:timeCreatedLessThan] = opts[:time_created_less_than] if opts[:time_created_less_than]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_certificates') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::CertificateSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_edge_subnets(opts = {}) ⇒ Response

Return the list of the tenant’s edge node subnets. Use these CIDR blocks to restrict incoming traffic to your origin. These subnets are owned by OCI and forward traffic to customer origins. They are not associated with specific regions or compartments.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

  • :sort_by (String)

    The value by which edge node subnets are sorted in a paginated ‘List’ call. If unspecified, defaults to ‘timeModified`. Allowed values are: cidr, region, timeModified

  • :sort_order (String)

    The value of the sorting direction of resources in a paginated ‘List’ call. If unspecified, defaults to ‘DESC`. Allowed values are: ASC, DESC

Returns:



1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
# File 'lib/oci/waas/waas_client.rb', line 1387

def list_edge_subnets(opts = {})
  logger.debug 'Calling operation WaasClient#list_edge_subnets.' if logger


  if opts[:sort_by] && !%w[cidr region timeModified].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of cidr, region, timeModified.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end

  path = '/edgeSubnets'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_edge_subnets') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::EdgeSubnet>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_good_bots(waas_policy_id, opts = {}) ⇒ Response

Gets the list of good bots defined in the Web Application Firewall configuration for a WAAS policy.

The list is sorted by ‘key`, in ascending order.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

Returns:



1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
# File 'lib/oci/waas/waas_client.rb', line 1455

def list_good_bots(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_good_bots.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling list_good_bots." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/goodBots'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_good_bots') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::GoodBot>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_protection_rules(waas_policy_id, opts = {}) ⇒ Response

Gets the list of available protection rules for a WAAS policy. Use the ‘GetWafConfig` operation to view a list of currently configured protection rules for the Web Application Firewall, or use the `ListRecommendations` operation to get a list of recommended protection rules for the Web Application Firewall. The list is sorted by `key`, in ascending order.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

  • :mod_security_rule_id (Array<String>)

    Filter rules using a list of ModSecurity rule IDs.

  • :action (Array<String>)

    Filter rules using a list of actions. Allowed values are: OFF, DETECT, BLOCK

Returns:



1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
# File 'lib/oci/waas/waas_client.rb', line 1516

def list_protection_rules(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_protection_rules.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling list_protection_rules." if waas_policy_id.nil?


  action_allowable_values = %w[OFF DETECT BLOCK]
  if opts[:action] && !opts[:action].empty?
    opts[:action].each do |val_to_check|
      unless action_allowable_values.include?(val_to_check)
        raise 'Invalid value for "action", must be one of OFF, DETECT, BLOCK.'
      end
    end
  end
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/protectionRules'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:modSecurityRuleId] = OCI::ApiClient.build_collection_params(opts[:mod_security_rule_id], :multi) if opts[:mod_security_rule_id] && !opts[:mod_security_rule_id].empty?
  query_params[:action] = OCI::ApiClient.build_collection_params(opts[:action], :multi) if opts[:action] && !opts[:action].empty?

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_protection_rules') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::ProtectionRule>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_recommendations(waas_policy_id, opts = {}) ⇒ Response

Gets the list of recommended Web Application Firewall protection rules.

Use the ‘POST /waasPolicies/waasPolicyId/actions/acceptWafConfigRecommendations` method to accept recommended Web Application Firewall protection rules. For more information, see [WAF Protection Rules](docs.cloud.oracle.com/iaas/Content/WAF/Tasks/wafprotectionrules.htm). The list is sorted by `key`, in ascending order.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :recommended_action (String)

    A filter that matches recommended protection rules based on the selected action. If unspecified, rules with any action type are returned. Allowed values are: DETECT, BLOCK

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

Returns:



1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
# File 'lib/oci/waas/waas_client.rb', line 1590

def list_recommendations(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_recommendations.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling list_recommendations." if waas_policy_id.nil?

  if opts[:recommended_action] && !%w[DETECT BLOCK].include?(opts[:recommended_action])
    raise 'Invalid value for "recommended_action", must be one of DETECT, BLOCK.'
  end
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/recommendations'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:recommendedAction] = opts[:recommended_action] if opts[:recommended_action]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_recommendations') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::Recommendation>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_threat_feeds(waas_policy_id, opts = {}) ⇒ Response

Gets the list of available web application threat intelligence feeds and the actions set for each feed. The list is sorted by ‘key`, in ascending order.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

Returns:



1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
# File 'lib/oci/waas/waas_client.rb', line 1655

def list_threat_feeds(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_threat_feeds.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling list_threat_feeds." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/threatFeeds'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_threat_feeds') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::ThreatFeed>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_waas_policies(compartment_id, opts = {}) ⇒ Response

Gets a list of WAAS policies.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

  • :sort_by (String)

    The value by which policies are sorted in a paginated ‘List’ call. If unspecified, defaults to ‘timeCreated`. Allowed values are: id, displayName, timeCreated

  • :sort_order (String)

    The value of the sorting direction of resources in a paginated ‘List’ call. If unspecified, defaults to ‘DESC`. Allowed values are: ASC, DESC

  • :id (Array<String>)

    Filter policies using a list of policy OCIDs.

  • :display_name (Array<String>)

    Filter policies using a list of display names.

  • :lifecycle_state (Array<String>)

    Filter policies using a list of lifecycle states.

  • :time_created_greater_than_or_equal_to (DateTime)

    A filter that matches policies created on or after the specified date and time.

  • :time_created_less_than (DateTime)

    A filter that matches policies created before the specified date-time.

Returns:



1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
# File 'lib/oci/waas/waas_client.rb', line 1721

def list_waas_policies(compartment_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_waas_policies.' if logger

  raise "Missing the required parameter 'compartment_id' when calling list_waas_policies." if compartment_id.nil?

  if opts[:sort_by] && !%w[id displayName timeCreated].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of id, displayName, timeCreated.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end

  path = '/waasPolicies'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:id] = OCI::ApiClient.build_collection_params(opts[:id], :multi) if opts[:id] && !opts[:id].empty?
  query_params[:displayName] = OCI::ApiClient.build_collection_params(opts[:display_name], :multi) if opts[:display_name] && !opts[:display_name].empty?
  query_params[:lifecycleState] = OCI::ApiClient.build_collection_params(opts[:lifecycle_state], :multi) if opts[:lifecycle_state] && !opts[:lifecycle_state].empty?
  query_params[:timeCreatedGreaterThanOrEqualTo] = opts[:time_created_greater_than_or_equal_to] if opts[:time_created_greater_than_or_equal_to]
  query_params[:timeCreatedLessThan] = opts[:time_created_less_than] if opts[:time_created_less_than]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_waas_policies') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::WaasPolicySummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_waf_blocked_requests(waas_policy_id, opts = {}) ⇒ Response

Gets the number of blocked requests by a Web Application Firewall feature in five minute blocks, sorted by ‘timeObserved` in ascending order (starting from oldest data).

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :time_observed_greater_than_or_equal_to (DateTime)

    A filter that limits returned events to those occurring on or after a date and time, specified in RFC 3339 format. If unspecified, defaults to 30 minutes before receipt of the request.

  • :time_observed_less_than (DateTime)

    A filter that limits returned events to those occurring before a date and time, specified in RFC 3339 format.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

  • :waf_feature (Array<String>)

    Filter stats by the Web Application Firewall feature that triggered the block action. If unspecified, data for all WAF features will be returned. Allowed values are: PROTECTION_RULES, JS_CHALLENGE, ACCESS_RULES, THREAT_FEEDS, HUMAN_INTERACTION_CHALLENGE, DEVICE_FINGERPRINT_CHALLENGE, CAPTCHA, ADDRESS_RATE_LIMITING

Returns:



1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
# File 'lib/oci/waas/waas_client.rb', line 1797

def list_waf_blocked_requests(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_waf_blocked_requests.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling list_waf_blocked_requests." if waas_policy_id.nil?


  waf_feature_allowable_values = %w[PROTECTION_RULES JS_CHALLENGE ACCESS_RULES THREAT_FEEDS HUMAN_INTERACTION_CHALLENGE DEVICE_FINGERPRINT_CHALLENGE CAPTCHA ADDRESS_RATE_LIMITING]
  if opts[:waf_feature] && !opts[:waf_feature].empty?
    opts[:waf_feature].each do |val_to_check|
      unless waf_feature_allowable_values.include?(val_to_check)
        raise 'Invalid value for "waf_feature", must be one of PROTECTION_RULES, JS_CHALLENGE, ACCESS_RULES, THREAT_FEEDS, HUMAN_INTERACTION_CHALLENGE, DEVICE_FINGERPRINT_CHALLENGE, CAPTCHA, ADDRESS_RATE_LIMITING.'
      end
    end
  end
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/reports/waf/blocked'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:timeObservedGreaterThanOrEqualTo] = opts[:time_observed_greater_than_or_equal_to] if opts[:time_observed_greater_than_or_equal_to]
  query_params[:timeObservedLessThan] = opts[:time_observed_less_than] if opts[:time_observed_less_than]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:wafFeature] = OCI::ApiClient.build_collection_params(opts[:waf_feature], :multi) if opts[:waf_feature] && !opts[:waf_feature].empty?

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_waf_blocked_requests') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::WafBlockedRequest>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_waf_logs(waas_policy_id, opts = {}) ⇒ Response

Gets structured Web Application Firewall event logs for a WAAS policy. Sorted by the ‘timeObserved` in ascending order (starting from the oldest recorded event).

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘20`. (default to 20)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

  • :time_observed_greater_than_or_equal_to (DateTime)

    A filter that matches log entries where the observed event occurred on or after a date and time specified in RFC 3339 format. If unspecified, defaults to two hours before receipt of the request.

  • :time_observed_less_than (DateTime)

    A filter that matches log entries where the observed event occurred before a date and time, specified in RFC 3339 format.

  • :text_contains (String)

    A full text search for logs.

  • :access_rule_key (Array<String>)

    Filters logs by access rule key.

  • :action (Array<String>)

    Filters logs by Web Application Firewall action. Allowed values are: BLOCK, DETECT, BYPASS, LOG, REDIRECTED

  • :client_address (Array<String>)

    Filters logs by client IP address.

  • :country_code (Array<String>)

    Filters logs by country code. Country codes are in ISO 3166-1 alpha-2 format. For a list of codes, see [ISO’s website](www.iso.org/obp/ui/#search/code/).

  • :country_name (Array<String>)

    Filter logs by country name.

  • :fingerprint (Array<String>)

    Filter logs by device fingerprint.

  • :http_method (Array<String>)

    Filter logs by HTTP method. Allowed values are: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT

  • :incident_key (Array<String>)

    Filter logs by incident key.

  • :log_type (Array<String>)

    Filter by log type. Allowed values are: ACCESS, PROTECTION_RULES, JS_CHALLENGE, CAPTCHA, ACCESS_RULES, THREAT_FEEDS, HUMAN_INTERACTION_CHALLENGE, DEVICE_FINGERPRINT_CHALLENGE, ADDRESS_RATE_LIMITING

  • :origin_address (Array<String>)

    Filter by origin IP address.

  • :referrer (Array<String>)

    Filter by referrer.

  • :request_url (Array<String>)

    Filter by request URL.

  • :response_code (Array<Integer>)

    Filter by response code.

  • :threat_feed_key (Array<String>)

    Filter by threat feed key.

  • :user_agent (Array<String>)

    Filter by user agent.

  • :protection_rule_key (Array<String>)

    Filter by protection rule key.

Returns:



1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
# File 'lib/oci/waas/waas_client.rb', line 1892

def list_waf_logs(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_waf_logs.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling list_waf_logs." if waas_policy_id.nil?


  action_allowable_values = %w[BLOCK DETECT BYPASS LOG REDIRECTED]
  if opts[:action] && !opts[:action].empty?
    opts[:action].each do |val_to_check|
      unless action_allowable_values.include?(val_to_check)
        raise 'Invalid value for "action", must be one of BLOCK, DETECT, BYPASS, LOG, REDIRECTED.'
      end
    end
  end


  http_method_allowable_values = %w[OPTIONS GET HEAD POST PUT DELETE TRACE CONNECT]
  if opts[:http_method] && !opts[:http_method].empty?
    opts[:http_method].each do |val_to_check|
      unless http_method_allowable_values.include?(val_to_check)
        raise 'Invalid value for "http_method", must be one of OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT.'
      end
    end
  end


  log_type_allowable_values = %w[ACCESS PROTECTION_RULES JS_CHALLENGE CAPTCHA ACCESS_RULES THREAT_FEEDS HUMAN_INTERACTION_CHALLENGE DEVICE_FINGERPRINT_CHALLENGE ADDRESS_RATE_LIMITING]
  if opts[:log_type] && !opts[:log_type].empty?
    opts[:log_type].each do |val_to_check|
      unless log_type_allowable_values.include?(val_to_check)
        raise 'Invalid value for "log_type", must be one of ACCESS, PROTECTION_RULES, JS_CHALLENGE, CAPTCHA, ACCESS_RULES, THREAT_FEEDS, HUMAN_INTERACTION_CHALLENGE, DEVICE_FINGERPRINT_CHALLENGE, ADDRESS_RATE_LIMITING.'
      end
    end
  end
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafLogs'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:timeObservedGreaterThanOrEqualTo] = opts[:time_observed_greater_than_or_equal_to] if opts[:time_observed_greater_than_or_equal_to]
  query_params[:timeObservedLessThan] = opts[:time_observed_less_than] if opts[:time_observed_less_than]
  query_params[:textContains] = opts[:text_contains] if opts[:text_contains]
  query_params[:accessRuleKey] = OCI::ApiClient.build_collection_params(opts[:access_rule_key], :multi) if opts[:access_rule_key] && !opts[:access_rule_key].empty?
  query_params[:action] = OCI::ApiClient.build_collection_params(opts[:action], :multi) if opts[:action] && !opts[:action].empty?
  query_params[:clientAddress] = OCI::ApiClient.build_collection_params(opts[:client_address], :multi) if opts[:client_address] && !opts[:client_address].empty?
  query_params[:countryCode] = OCI::ApiClient.build_collection_params(opts[:country_code], :multi) if opts[:country_code] && !opts[:country_code].empty?
  query_params[:countryName] = OCI::ApiClient.build_collection_params(opts[:country_name], :multi) if opts[:country_name] && !opts[:country_name].empty?
  query_params[:fingerprint] = OCI::ApiClient.build_collection_params(opts[:fingerprint], :multi) if opts[:fingerprint] && !opts[:fingerprint].empty?
  query_params[:httpMethod] = OCI::ApiClient.build_collection_params(opts[:http_method], :multi) if opts[:http_method] && !opts[:http_method].empty?
  query_params[:incidentKey] = OCI::ApiClient.build_collection_params(opts[:incident_key], :multi) if opts[:incident_key] && !opts[:incident_key].empty?
  query_params[:logType] = OCI::ApiClient.build_collection_params(opts[:log_type], :multi) if opts[:log_type] && !opts[:log_type].empty?
  query_params[:originAddress] = OCI::ApiClient.build_collection_params(opts[:origin_address], :multi) if opts[:origin_address] && !opts[:origin_address].empty?
  query_params[:referrer] = OCI::ApiClient.build_collection_params(opts[:referrer], :multi) if opts[:referrer] && !opts[:referrer].empty?
  query_params[:requestUrl] = OCI::ApiClient.build_collection_params(opts[:request_url], :multi) if opts[:request_url] && !opts[:request_url].empty?
  query_params[:responseCode] = OCI::ApiClient.build_collection_params(opts[:response_code], :multi) if opts[:response_code] && !opts[:response_code].empty?
  query_params[:threatFeedKey] = OCI::ApiClient.build_collection_params(opts[:threat_feed_key], :multi) if opts[:threat_feed_key] && !opts[:threat_feed_key].empty?
  query_params[:userAgent] = OCI::ApiClient.build_collection_params(opts[:user_agent], :multi) if opts[:user_agent] && !opts[:user_agent].empty?
  query_params[:protectionRuleKey] = OCI::ApiClient.build_collection_params(opts[:protection_rule_key], :multi) if opts[:protection_rule_key] && !opts[:protection_rule_key].empty?

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_waf_logs') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::WafLog>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_waf_requests(waas_policy_id, opts = {}) ⇒ Response

Gets the number of requests managed by a Web Application Firewall over a specified period of time, including blocked requests. Sorted by ‘timeObserved` in ascending order (starting from oldest requests).

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :time_observed_greater_than_or_equal_to (DateTime)

    A filter that limits returned events to those occurring on or after a date and time, specified in RFC 3339 format. If unspecified, defaults to 30 minutes before receipt of the request.

  • :time_observed_less_than (DateTime)

    A filter that limits returned events to those occurring before a date and time, specified in RFC 3339 format.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

Returns:



2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
# File 'lib/oci/waas/waas_client.rb', line 2003

def list_waf_requests(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_waf_requests.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling list_waf_requests." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/reports/waf/requests'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:timeObservedGreaterThanOrEqualTo] = opts[:time_observed_greater_than_or_equal_to] if opts[:time_observed_greater_than_or_equal_to]
  query_params[:timeObservedLessThan] = opts[:time_observed_less_than] if opts[:time_observed_less_than]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_waf_requests') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::WafRequest>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_waf_traffic(waas_policy_id, opts = {}) ⇒ Response

Gets the Web Application Firewall traffic data for a WAAS policy. Sorted by ‘timeObserved` in ascending order (starting from oldest data).

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :time_observed_greater_than_or_equal_to (DateTime)

    A filter that limits returned events to those occurring on or after a date and time, specified in RFC 3339 format. If unspecified, defaults to 30 minutes before receipt of the request.

  • :time_observed_less_than (DateTime)

    A filter that limits returned events to those occurring before a date and time, specified in RFC 3339 format.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

Returns:



2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
# File 'lib/oci/waas/waas_client.rb', line 2066

def list_waf_traffic(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_waf_traffic.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling list_waf_traffic." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/reports/waf/traffic'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:timeObservedGreaterThanOrEqualTo] = opts[:time_observed_greater_than_or_equal_to] if opts[:time_observed_greater_than_or_equal_to]
  query_params[:timeObservedLessThan] = opts[:time_observed_less_than] if opts[:time_observed_less_than]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_waf_traffic') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::WafTrafficDatum>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_whitelists(waas_policy_id, opts = {}) ⇒ Response

Gets the list of whitelists defined in the Web Application Firewall configuration for a WAAS policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

Returns:



2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
# File 'lib/oci/waas/waas_client.rb', line 2125

def list_whitelists(waas_policy_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_whitelists.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling list_whitelists." if waas_policy_id.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/whitelists'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_whitelists') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::Whitelist>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_work_requests(waas_policy_id, compartment_id, opts = {}) ⇒ Response

Gets a list of subnets (CIDR notation) from which the WAAS EDGE may make requests. The subnets are owned by OCI and forward traffic to your origins. Allow traffic from these subnets to your origins. They are not associated with specific regions or compartments.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :limit (Integer)

    The maximum number of items to return in a paginated call. In unspecified, defaults to ‘10`. (default to 10)

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous paginated call.

  • :sort_by (String)

    The value by which work requests are sorted in a paginated ‘List’ call. If unspecified, defaults to ‘timeAccepted`. Allowed values are: id, status, timeAccepted, timeStarted, timeFinished, operationType

  • :sort_order (String)

    The value of the sorting direction of resources in a paginated ‘List’ call. If unspecified, defaults to ‘DESC`. Allowed values are: ASC, DESC

Returns:



2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
# File 'lib/oci/waas/waas_client.rb', line 2187

def list_work_requests(waas_policy_id, compartment_id, opts = {})
  logger.debug 'Calling operation WaasClient#list_work_requests.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling list_work_requests." if waas_policy_id.nil?
  raise "Missing the required parameter 'compartment_id' when calling list_work_requests." if compartment_id.nil?

  if opts[:sort_by] && !%w[id status timeAccepted timeStarted timeFinished operationType].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of id, status, timeAccepted, timeStarted, timeFinished, operationType.'
  end

  if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
  end

  path = '/workRequests'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:waasPolicyId] = waas_policy_id
  query_params[:compartmentId] = compartment_id
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#list_work_requests') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'Array<OCI::Waas::Models::WorkRequestSummary>'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#loggerLogger

Returns The logger for this client. May be nil.

Returns:

  • (Logger)

    The logger for this client. May be nil.



102
103
104
# File 'lib/oci/waas/waas_client.rb', line 102

def logger
  @api_client.config.logger
end

#update_access_rules(waas_policy_id, access_rules, opts = {}) ⇒ Response

Updates the list of access rules in the Web Application Firewall configuration for a specified WAAS policy. Access rules allow explicit actions to be defined and executed for requests that meet various conditions. A rule action can be set to allow, detect, or block requests. The detect setting allows the request to pass through the Web Application Firewall and is tagged with a ‘DETECT` flag in the Web Application Firewall’s log.

This operation can create, delete, update, and/or reorder access rules depending on the structure of the request body.

Access rules can be updated by changing the properties of the access rule object with the rule’s key specified in the key field. Access rules can be reordered by changing the order of the access rules in the list when updating.

Access rules can be created by adding a new access rule object to the list without a ‘key` property specified. A `key` will be generated for the new access rule upon update.

Any existing access rules that are not specified with a ‘key` in the list of access rules will be deleted upon update.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
# File 'lib/oci/waas/waas_client.rb', line 2266

def update_access_rules(waas_policy_id, access_rules, opts = {})
  logger.debug 'Calling operation WaasClient#update_access_rules.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_access_rules." if waas_policy_id.nil?
  raise "Missing the required parameter 'access_rules' when calling update_access_rules." if access_rules.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/accessRules'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(access_rules)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_access_rules') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_captchas(waas_policy_id, captchas, opts = {}) ⇒ Response

Updates the list of CAPTCHA challenges in the Web Application Firewall configuration for a WAAS policy. This operation can create, update, or delete CAPTCHAs depending on the structure of the request body. CAPTCHA challenges can be updated by changing the properties of the CAPTCHA object with the rule’s key specified in the key field. CAPTCHA challenges can be reordered by changing the order of the CAPTCHA challenges in the list when updating.

CAPTCHA challenges can be created by adding a new access rule object to the list without a ‘key` property specified. A `key` will be generated for the new CAPTCHA challenges upon update.

Any existing CAPTCHA challenges that are not specified with a ‘key` in the list of CAPTCHA challenges will be deleted upon update.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
# File 'lib/oci/waas/waas_client.rb', line 2332

def update_captchas(waas_policy_id, captchas, opts = {})
  logger.debug 'Calling operation WaasClient#update_captchas.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_captchas." if waas_policy_id.nil?
  raise "Missing the required parameter 'captchas' when calling update_captchas." if captchas.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/captchas'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(captchas)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_captchas') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_certificate(certificate_id, opts = {}) ⇒ Response

It is not possible to update a certificate, only create and delete. Therefore, this operation can only update the display name, freeform tags, and defined tags of a certificate.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

  • :update_certificate_details (OCI::Waas::Models::UpdateCertificateDetails)

    The new display name, freeform tags, and defined tags to apply to a certificate.

Returns:



2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
# File 'lib/oci/waas/waas_client.rb', line 2390

def update_certificate(certificate_id, opts = {})
  logger.debug 'Calling operation WaasClient#update_certificate.' if logger

  raise "Missing the required parameter 'certificate_id' when calling update_certificate." if certificate_id.nil?
  raise "Parameter value for 'certificate_id' must not be blank" if OCI::Internal::Util.blank_string?(certificate_id)

  path = '/certificates/{certificateId}'.sub('{certificateId}', certificate_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(opts[:update_certificate_details])

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_certificate') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Waas::Models::Certificate'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_device_fingerprint_challenge(waas_policy_id, update_device_fingerprint_challenge_details, opts = {}) ⇒ Response

Updates the Device Fingerprint Challenge (DFC) settings in the Web Application Firewall configuration for a policy. The DFC generates a hashed signature of both virtual and real browsers based on 50+ attributes. These proprietary signatures are then leveraged for real-time correlation to identify and block malicious bots.

The signature is based on a library of attributes detected via JavaScript listeners; the attributes include OS, screen resolution, fonts, UserAgent, IP address, etc. We are constantly making improvements and considering new libraries to include in our DFC build. We can also exclude attributes from the signature as needed.

DFC collects attributes to generate a hashed signature about a client u2013 if a fingerprint is not possible, then it will result in a block or alert action. Actions can be enforced across multiple devices if they share they have the same fingerprint.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
# File 'lib/oci/waas/waas_client.rb', line 2452

def update_device_fingerprint_challenge(waas_policy_id, update_device_fingerprint_challenge_details, opts = {})
  logger.debug 'Calling operation WaasClient#update_device_fingerprint_challenge.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_device_fingerprint_challenge." if waas_policy_id.nil?
  raise "Missing the required parameter 'update_device_fingerprint_challenge_details' when calling update_device_fingerprint_challenge." if update_device_fingerprint_challenge_details.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/deviceFingerprintChallenge'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(update_device_fingerprint_challenge_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_device_fingerprint_challenge') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_good_bots(waas_policy_id, good_bots, opts = {}) ⇒ Response

Updates the list of good bots in the Web Application Firewall configuration for a policy. Only the fields specified in the request body will be updated, all other configuration properties will remain unchanged.

Good bots allows you to manage access for bots from known providers, such as Google or Baidu. For more information about good bots, see [Bot Management](docs.cloud.oracle.com/iaas/Content/WAF/Tasks/botmanagement.htm).

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
# File 'lib/oci/waas/waas_client.rb', line 2514

def update_good_bots(waas_policy_id, good_bots, opts = {})
  logger.debug 'Calling operation WaasClient#update_good_bots.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_good_bots." if waas_policy_id.nil?
  raise "Missing the required parameter 'good_bots' when calling update_good_bots." if good_bots.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/goodBots'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(good_bots)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_good_bots') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_human_interaction_challenge(waas_policy_id, update_human_interaction_challenge_details, opts = {}) ⇒ Response

Updates the Human Interaction Challenge (HIC) settings in the Web Application Firewall configuration for a WAAS policy. HIC is a countermeasure that allows the proxy to check the user’s browser for various behaviors that distinguish a human presence from a bot.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
# File 'lib/oci/waas/waas_client.rb', line 2574

def update_human_interaction_challenge(waas_policy_id, update_human_interaction_challenge_details, opts = {})
  logger.debug 'Calling operation WaasClient#update_human_interaction_challenge.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_human_interaction_challenge." if waas_policy_id.nil?
  raise "Missing the required parameter 'update_human_interaction_challenge_details' when calling update_human_interaction_challenge." if update_human_interaction_challenge_details.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/humanInteractionChallenge'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(update_human_interaction_challenge_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_human_interaction_challenge') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_js_challenge(waas_policy_id, update_js_challenge_details, opts = {}) ⇒ Response

Updates the JavaScript challenge settings in the Web Application Firewall configuration for a WAAS policy. JavaScript Challenge validates that the client can accept JavaScript with a binary decision. For more information, see [Bot Management](docs.cloud.oracle.com/iaas/Content/WAF/Tasks/botmanagement.htm).

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
# File 'lib/oci/waas/waas_client.rb', line 2634

def update_js_challenge(waas_policy_id, update_js_challenge_details, opts = {})
  logger.debug 'Calling operation WaasClient#update_js_challenge.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_js_challenge." if waas_policy_id.nil?
  raise "Missing the required parameter 'update_js_challenge_details' when calling update_js_challenge." if update_js_challenge_details.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/jsChallenge'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(update_js_challenge_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_js_challenge') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_policy_config(waas_policy_id, update_policy_config_details, opts = {}) ⇒ Response

Updates the configuration for a WAAS policy. Only the fields specified in the request body will be updated; all other properties will remain unchanged.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
# File 'lib/oci/waas/waas_client.rb', line 2694

def update_policy_config(waas_policy_id, update_policy_config_details, opts = {})
  logger.debug 'Calling operation WaasClient#update_policy_config.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_policy_config." if waas_policy_id.nil?
  raise "Missing the required parameter 'update_policy_config_details' when calling update_policy_config." if update_policy_config_details.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/policyConfig'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(update_policy_config_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_policy_config') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_protection_rules(waas_policy_id, protection_rules, opts = {}) ⇒ Response

Updates the action for each specified protection rule. Requests can either be allowed, blocked, or trigger an alert if they meet the parameters of an applied rule. For more information on protection rules, see [WAF Protection Rules](docs.cloud.oracle.com/iaas/Content/WAF/Tasks/wafprotectionrules.htm). This operation can update or disable protection rules depending on the structure of the request body. Protection rules can be updated by changing the properties of the protection rule object with the rule’s key specified in the key field.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
# File 'lib/oci/waas/waas_client.rb', line 2754

def update_protection_rules(waas_policy_id, protection_rules, opts = {})
  logger.debug 'Calling operation WaasClient#update_protection_rules.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_protection_rules." if waas_policy_id.nil?
  raise "Missing the required parameter 'protection_rules' when calling update_protection_rules." if protection_rules.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/protectionRules'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(protection_rules)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_protection_rules') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_protection_settings(waas_policy_id, update_protection_settings_details, opts = {}) ⇒ Response

Updates the protection settings in the Web Application Firewall configuration for a WAAS policy. Protection settings allow you define what action is taken when a request is blocked by the Web Application Firewall, such as returning a response code or block page. Only the fields specified in the request body will be updated; all other fields will remain unchanged.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
# File 'lib/oci/waas/waas_client.rb', line 2812

def update_protection_settings(waas_policy_id, update_protection_settings_details, opts = {})
  logger.debug 'Calling operation WaasClient#update_protection_settings.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_protection_settings." if waas_policy_id.nil?
  raise "Missing the required parameter 'update_protection_settings_details' when calling update_protection_settings." if update_protection_settings_details.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/protectionSettings'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(update_protection_settings_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_protection_settings') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_threat_feeds(waas_policy_id, threat_feeds, opts = {}) ⇒ Response

Updates the action to take when a request’s IP address matches an address in the specified threat intelligence feed. Threat intelligence feeds are compiled lists of IP addresses with malicious reputations based on internet intelligence. Only the threat feeds specified in the request body will be updated; all other threat feeds will remain unchanged.

Parameters:

  • waas_policy_id (String)
  • threat_feeds (Array<OCI::Waas::Models::OCI::Waas::Models::ThreatFeedAction>)

    A list of threat feeds for which to update the actions.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
# File 'lib/oci/waas/waas_client.rb', line 2870

def update_threat_feeds(waas_policy_id, threat_feeds, opts = {})
  logger.debug 'Calling operation WaasClient#update_threat_feeds.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_threat_feeds." if waas_policy_id.nil?
  raise "Missing the required parameter 'threat_feeds' when calling update_threat_feeds." if threat_feeds.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/threatFeeds'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(threat_feeds)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_threat_feeds') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_waas_policy(waas_policy_id, update_waas_policy_details, opts = {}) ⇒ Response

Updates the details of a WAAS policy, including origins and tags. Only the fields specified in the request body will be updated; all other properties will remain unchanged. To update platform provided resources such as ‘GoodBots`, `ProtectionRules`, and `ThreatFeeds`, first retrieve the list of available resources with the related list operation such as `GetThreatFeeds` or `GetProtectionRules`. The returned list will contain objects with `key` properties that can be used to update the resource during the `UpdateWaasPolicy` request.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
# File 'lib/oci/waas/waas_client.rb', line 2930

def update_waas_policy(waas_policy_id, update_waas_policy_details, opts = {})
  logger.debug 'Calling operation WaasClient#update_waas_policy.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_waas_policy." if waas_policy_id.nil?
  raise "Missing the required parameter 'update_waas_policy_details' when calling update_waas_policy." if update_waas_policy_details.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(update_waas_policy_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_waas_policy') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_waf_address_rate_limiting(waas_policy_id, update_waf_address_rate_limiting_details, opts = {}) ⇒ Response

Updates the address rate limiting settings in the Web Application Firewall configuration for a policy. Rate limiting allows you to configure a threshold for the number of requests from a unique IP address for the given period. You can also define the response code for the requests from the same address that exceed the threshold.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
# File 'lib/oci/waas/waas_client.rb', line 2990

def update_waf_address_rate_limiting(waas_policy_id, update_waf_address_rate_limiting_details, opts = {})
  logger.debug 'Calling operation WaasClient#update_waf_address_rate_limiting.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_waf_address_rate_limiting." if waas_policy_id.nil?
  raise "Missing the required parameter 'update_waf_address_rate_limiting_details' when calling update_waf_address_rate_limiting." if update_waf_address_rate_limiting_details.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/addressRateLimiting'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(update_waf_address_rate_limiting_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_waf_address_rate_limiting') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_waf_config(waas_policy_id, update_waf_config_details, opts = {}) ⇒ Response

Updates the Web Application Firewall configuration for a specified WAAS policy.

To update platform provided resources such as ‘GoodBots`, `ProtectionRules`, and `ThreatFeeds`, first retrieve the list of available resources with the related list operation, such as `GetThreatFeeds` or `GetProtectionRules`.

The returned list will contain objects with ‘key` properties that can be used to update the resource during the `UpdateWafConfig` request.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
# File 'lib/oci/waas/waas_client.rb', line 3058

def update_waf_config(waas_policy_id, update_waf_config_details, opts = {})
  logger.debug 'Calling operation WaasClient#update_waf_config.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_waf_config." if waas_policy_id.nil?
  raise "Missing the required parameter 'update_waf_config_details' when calling update_waf_config." if update_waf_config_details.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(update_waf_config_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_waf_config') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_whitelists(waas_policy_id, whitelists, opts = {}) ⇒ Response

Updates the list of IP addresses that bypass the Web Application Firewall for a WAAS policy. Supports both single IP addresses or subnet masks (CIDR notation).

This operation can create, delete, update, and/or reorder whitelists depending on the structure of the request body.

Whitelists can be updated by changing the properties of the whitelist object with the rule’s key specified in the ‘key` field. Whitelists can be reordered by changing the order of the whitelists in the list of objects when updating.

Whitelists can be created by adding a new whitelist object to the list without a ‘key` property specified. A `key` will be generated for the new whitelist upon update.

Whitelists can be deleted by removing the existing whitelist object from the list. Any existing whitelists that are not specified with a ‘key` in the list of access rules will be deleted upon update.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit ‘nil` value is provided then the operation will not retry

  • :opc_request_id (String)

    The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations Example: If a resource has been deleted and purged from the system, then a retry of the original delete request may be rejected.

  • :if_match (String)

    For optimistic concurrency control. In the ‘PUT` or `DELETE` call for a resource, set the `if-match` parameter to the value of the etag from a previous `GET` or `POST` response for that resource. The resource will be updated or deleted only if the etag provided matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
# File 'lib/oci/waas/waas_client.rb', line 3126

def update_whitelists(waas_policy_id, whitelists, opts = {})
  logger.debug 'Calling operation WaasClient#update_whitelists.' if logger

  raise "Missing the required parameter 'waas_policy_id' when calling update_whitelists." if waas_policy_id.nil?
  raise "Missing the required parameter 'whitelists' when calling update_whitelists." if whitelists.nil?
  raise "Parameter value for 'waas_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(waas_policy_id)

  path = '/waasPolicies/{waasPolicyId}/wafConfig/whitelists'.sub('{waasPolicyId}', waas_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(whitelists)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'WaasClient#update_whitelists') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end