Server IP : 103.119.228.120 / Your IP : 3.145.164.47 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/ssl/lib/mysqlsh/lib/python3.9/site-packages/oci/waas/ |
Upload File : |
# coding: utf-8 # Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. # NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20181116 from __future__ import absolute_import from oci._vendor import requests # noqa: F401 from oci._vendor import six from oci import retry, circuit_breaker # noqa: F401 from oci.base_client import BaseClient from oci.config import get_config_value_or_default, validate_config from oci.signer import Signer from oci.util import Sentinel, get_signer_from_authentication_type, AUTHENTICATION_TYPE_FIELD_NAME from oci.exceptions import InvalidAlloyConfig from oci.alloy import OCI_SDK_ENABLED_SERVICES_SET from .models import waas_type_mapping missing = Sentinel("Missing") class WaasClient(object): """ OCI Web Application Acceleration and Security Services """ def __init__(self, config, **kwargs): """ Creates a new service client :param dict config: Configuration keys and values as per `SDK and Tool Configuration <https://docs.cloud.oracle.com/Content/API/Concepts/sdkconfig.htm>`__. The :py:meth:`~oci.config.from_file` method can be used to load configuration from a file. Alternatively, a ``dict`` can be passed. You can validate_config the dict using :py:meth:`~oci.config.validate_config` :param str service_endpoint: (optional) The endpoint of the service to call using this client. For example ``https://iaas.us-ashburn-1.oraclecloud.com``. If this keyword argument is not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit need to specify a service endpoint. :param timeout: (optional) The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout. :type timeout: float or tuple(float, float) :param signer: (optional) The signer to use when signing requests made by the service client. The default is to use a :py:class:`~oci.signer.Signer` based on the values provided in the config parameter. One use case for this parameter is for `Instance Principals authentication <https://docs.cloud.oracle.com/Content/Identity/Tasks/callingservicesfrominstances.htm>`__ by passing an instance of :py:class:`~oci.auth.signers.InstancePrincipalsSecurityTokenSigner` as the value for this keyword argument :type signer: :py:class:`~oci.signer.AbstractBaseSigner` :param obj retry_strategy: (optional) A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. Retry strategies can also be applied at the operation level by passing a ``retry_strategy`` keyword argument as part of calling the operation. Any value provided at the operation level will override whatever is specified at the client level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` is also available. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. :param obj circuit_breaker_strategy: (optional) A circuit breaker strategy to apply to all calls made by this service client (i.e. at the client level). This client uses :py:data:`~oci.circuit_breaker.DEFAULT_CIRCUIT_BREAKER_STRATEGY` as default if no circuit breaker strategy is provided. The specifics of circuit breaker strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/circuit_breakers.html>`__. :param function circuit_breaker_callback: (optional) Callback function to receive any exceptions triggerred by the circuit breaker. :param bool client_level_realm_specific_endpoint_template_enabled: (optional) A boolean flag to indicate whether or not this client should be created with realm specific endpoint template enabled or disable. By default, this will be set as None. :param allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this client should allow control characters in the response object. By default, the client will not allow control characters to be in the response object. """ if not OCI_SDK_ENABLED_SERVICES_SET.is_service_enabled("waas"): raise InvalidAlloyConfig("The Alloy configuration has disabled this service, this behavior is controlled by OCI_SDK_ENABLED_SERVICES_SET variable. Please check if your local alloy-config file configured the service you're targeting or contact the cloud provider on the availability of this service") validate_config(config, signer=kwargs.get('signer')) if 'signer' in kwargs: signer = kwargs['signer'] elif AUTHENTICATION_TYPE_FIELD_NAME in config: signer = get_signer_from_authentication_type(config) else: signer = Signer( tenancy=config["tenancy"], user=config["user"], fingerprint=config["fingerprint"], private_key_file_location=config.get("key_file"), pass_phrase=get_config_value_or_default(config, "pass_phrase"), private_key_content=config.get("key_content") ) base_client_init_kwargs = { 'regional_client': True, 'service_endpoint': kwargs.get('service_endpoint'), 'base_path': '/20181116', 'service_endpoint_template': 'https://waas.{region}.oci.{secondLevelDomain}', 'service_endpoint_template_per_realm': { }, # noqa: E201 E202 'skip_deserialization': kwargs.get('skip_deserialization', False), 'circuit_breaker_strategy': kwargs.get('circuit_breaker_strategy', circuit_breaker.GLOBAL_CIRCUIT_BREAKER_STRATEGY), 'client_level_realm_specific_endpoint_template_enabled': kwargs.get('client_level_realm_specific_endpoint_template_enabled') } if 'timeout' in kwargs: base_client_init_kwargs['timeout'] = kwargs.get('timeout') if base_client_init_kwargs.get('circuit_breaker_strategy') is None: base_client_init_kwargs['circuit_breaker_strategy'] = circuit_breaker.DEFAULT_CIRCUIT_BREAKER_STRATEGY if 'allow_control_chars' in kwargs: base_client_init_kwargs['allow_control_chars'] = kwargs.get('allow_control_chars') self.base_client = BaseClient("waas", config, signer, waas_type_mapping, **base_client_init_kwargs) self.retry_strategy = kwargs.get('retry_strategy') self.circuit_breaker_callback = kwargs.get('circuit_breaker_callback') def accept_recommendations(self, waas_policy_id, protection_rule_keys, **kwargs): """ 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`__. __ https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/wafprotectionrules.htm :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param list[str] protection_rule_keys: (required) :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/accept_recommendations.py.html>`__ to see an example of how to use accept_recommendations API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/actions/acceptWafConfigRecommendations" method = "POST" operation_name = "accept_recommendations" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/Recommendation/AcceptRecommendations" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"accept_recommendations got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=protection_rule_keys, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=protection_rule_keys, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def cancel_work_request(self, work_request_id, **kwargs): """ Cancels a specified work request. :param str work_request_id: (required) The `OCID`__ of the work request. This number is generated when work request is created. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/cancel_work_request.py.html>`__ to see an example of how to use cancel_work_request API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['workRequestId'] resource_path = "/workRequests/{workRequestId}" method = "DELETE" operation_name = "cancel_work_request" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WorkRequest/CancelWorkRequest" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"cancel_work_request got unknown kwargs: {extra_kwargs!r}") path_params = { "workRequestId": work_request_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def change_address_list_compartment(self, address_list_id, change_address_list_compartment_details, **kwargs): """ Moves address list into a different compartment. When provided, If-Match is checked against ETag values of the address list. For information about moving resources between compartments, see `Moving Resources to a Different Compartment`__. __ https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes :param str address_list_id: (required) The `OCID`__ of the address list. This number is generated when the address list is added to the compartment. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.ChangeAddressListCompartmentDetails change_address_list_compartment_details: (required) :param str if_match: (optional) 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. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/change_address_list_compartment.py.html>`__ to see an example of how to use change_address_list_compartment API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['addressListId'] resource_path = "/addressLists/{addressListId}/actions/changeCompartment" method = "POST" operation_name = "change_address_list_compartment" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/AddressList/ChangeAddressListCompartment" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id", "opc_retry_token" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"change_address_list_compartment got unknown kwargs: {extra_kwargs!r}") path_params = { "addressListId": address_list_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=change_address_list_compartment_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=change_address_list_compartment_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def change_certificate_compartment(self, certificate_id, change_certificate_compartment_details, **kwargs): """ Moves certificate into a different compartment. When provided, If-Match is checked against ETag values of the certificate. For information about moving resources between compartments, see `Moving Resources to a Different Compartment`__. __ https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes :param str certificate_id: (required) The `OCID`__ of the SSL certificate used in the WAAS policy. This number is generated when the certificate is added to the policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.ChangeCertificateCompartmentDetails change_certificate_compartment_details: (required) :param str if_match: (optional) 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. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/change_certificate_compartment.py.html>`__ to see an example of how to use change_certificate_compartment API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['certificateId'] resource_path = "/certificates/{certificateId}/actions/changeCompartment" method = "POST" operation_name = "change_certificate_compartment" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/Certificate/ChangeCertificateCompartment" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id", "opc_retry_token" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"change_certificate_compartment got unknown kwargs: {extra_kwargs!r}") path_params = { "certificateId": certificate_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=change_certificate_compartment_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=change_certificate_compartment_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def change_custom_protection_rule_compartment(self, custom_protection_rule_id, change_custom_protection_rule_compartment_details, **kwargs): """ Moves a custom protection rule into a different compartment within the same tenancy. When provided, If-Match is checked against ETag values of the custom protection rule. For information about moving resources between compartments, see `Moving Resources to a Different Compartment`__. __ https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes :param str custom_protection_rule_id: (required) The `OCID`__ of the custom protection rule. This number is generated when the custom protection rule is added to the compartment. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.ChangeCustomProtectionRuleCompartmentDetails change_custom_protection_rule_compartment_details: (required) :param str if_match: (optional) 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. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/change_custom_protection_rule_compartment.py.html>`__ to see an example of how to use change_custom_protection_rule_compartment API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['customProtectionRuleId'] resource_path = "/customProtectionRules/{customProtectionRuleId}/actions/changeCompartment" method = "POST" operation_name = "change_custom_protection_rule_compartment" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/CustomProtectionRule/ChangeCustomProtectionRuleCompartment" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id", "opc_retry_token" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"change_custom_protection_rule_compartment got unknown kwargs: {extra_kwargs!r}") path_params = { "customProtectionRuleId": custom_protection_rule_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=change_custom_protection_rule_compartment_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=change_custom_protection_rule_compartment_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def change_waas_policy_compartment(self, waas_policy_id, change_waas_policy_compartment_details, **kwargs): """ Moves WAAS policy into a different compartment. When provided, If-Match is checked against ETag values of the WAAS policy. For information about moving resources between compartments, see `Moving Resources to a Different Compartment`__. __ https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.ChangeWaasPolicyCompartmentDetails change_waas_policy_compartment_details: (required) :param str if_match: (optional) 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. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/change_waas_policy_compartment.py.html>`__ to see an example of how to use change_waas_policy_compartment API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/actions/changeCompartment" method = "POST" operation_name = "change_waas_policy_compartment" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WaasPolicy/ChangeWaasPolicyCompartment" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "if_match", "opc_request_id", "opc_retry_token" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"change_waas_policy_compartment got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "if-match": kwargs.get("if_match", missing), "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=change_waas_policy_compartment_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=change_waas_policy_compartment_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def create_address_list(self, create_address_list_details, **kwargs): """ Creates an address list in a set compartment and allows it to be used in a WAAS policy and referenced by access rules. Addresses can be IP addresses and CIDR notations. :param oci.waas.models.CreateAddressListDetails create_address_list_details: (required) The details of the address list resource to create. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.AddressList` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/create_address_list.py.html>`__ to see an example of how to use create_address_list API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = [] resource_path = "/addressLists" method = "POST" operation_name = "create_address_list" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/AddressList/CreateAddressList" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"create_address_list got unknown kwargs: {extra_kwargs!r}") header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, header_params=header_params, body=create_address_list_details, response_type="AddressList", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, header_params=header_params, body=create_address_list_details, response_type="AddressList", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def create_certificate(self, create_certificate_details, **kwargs): """ 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`__. __ https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/wafsettings.htm :param oci.waas.models.CreateCertificateDetails create_certificate_details: (required) The details of the SSL certificate resource to create. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.Certificate` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/create_certificate.py.html>`__ to see an example of how to use create_certificate API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = [] resource_path = "/certificates" method = "POST" operation_name = "create_certificate" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/Certificate/CreateCertificate" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"create_certificate got unknown kwargs: {extra_kwargs!r}") header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, header_params=header_params, body=create_certificate_details, response_type="Certificate", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, header_params=header_params, body=create_certificate_details, response_type="Certificate", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def create_custom_protection_rule(self, create_custom_protection_rule_details, **kwargs): """ Creates a new custom protection rule in the specified compartment. Custom protection rules allow you to create rules in addition to the rulesets provided by the Web Application Firewall service, including rules from `ModSecurity`__. The syntax for custom rules is based on the ModSecurity syntax. For more information about custom protection rules, see `Custom Protection Rules`__. __ https://modsecurity.org/ __ https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/customprotectionrules.htm :param oci.waas.models.CreateCustomProtectionRuleDetails create_custom_protection_rule_details: (required) The details of the custom protection rule. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.CustomProtectionRule` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/create_custom_protection_rule.py.html>`__ to see an example of how to use create_custom_protection_rule API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = [] resource_path = "/customProtectionRules" method = "POST" operation_name = "create_custom_protection_rule" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/CustomProtectionRule/CreateCustomProtectionRule" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"create_custom_protection_rule got unknown kwargs: {extra_kwargs!r}") header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, header_params=header_params, body=create_custom_protection_rule_details, response_type="CustomProtectionRule", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, header_params=header_params, body=create_custom_protection_rule_details, response_type="CustomProtectionRule", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def create_waas_policy(self, create_waas_policy_details, **kwargs): """ 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`__. 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`__. **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. __ https://docs.cloud.oracle.com/iaas/Content/Identity/Concepts/overview.htm __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm :param oci.waas.models.CreateWaasPolicyDetails create_waas_policy_details: (required) The details of the WAAS policy. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/create_waas_policy.py.html>`__ to see an example of how to use create_waas_policy API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = [] resource_path = "/waasPolicies" method = "POST" operation_name = "create_waas_policy" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WaasPolicy/CreateWaasPolicy" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"create_waas_policy got unknown kwargs: {extra_kwargs!r}") header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, header_params=header_params, body=create_waas_policy_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, header_params=header_params, body=create_waas_policy_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def delete_address_list(self, address_list_id, **kwargs): """ Deletes the address list from the compartment if it is not used. :param str address_list_id: (required) The `OCID`__ of the address list. This number is generated when the address list is added to the compartment. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/delete_address_list.py.html>`__ to see an example of how to use delete_address_list API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['addressListId'] resource_path = "/addressLists/{addressListId}" method = "DELETE" operation_name = "delete_address_list" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/AddressList/DeleteAddressList" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"delete_address_list got unknown kwargs: {extra_kwargs!r}") path_params = { "addressListId": address_list_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def delete_certificate(self, certificate_id, **kwargs): """ Deletes an SSL certificate from the WAAS service. :param str certificate_id: (required) The `OCID`__ of the SSL certificate used in the WAAS policy. This number is generated when the certificate is added to the policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/delete_certificate.py.html>`__ to see an example of how to use delete_certificate API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['certificateId'] resource_path = "/certificates/{certificateId}" method = "DELETE" operation_name = "delete_certificate" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/Certificate/DeleteCertificate" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"delete_certificate got unknown kwargs: {extra_kwargs!r}") path_params = { "certificateId": certificate_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def delete_custom_protection_rule(self, custom_protection_rule_id, **kwargs): """ Deletes a Custom Protection rule. :param str custom_protection_rule_id: (required) The `OCID`__ of the custom protection rule. This number is generated when the custom protection rule is added to the compartment. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/delete_custom_protection_rule.py.html>`__ to see an example of how to use delete_custom_protection_rule API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['customProtectionRuleId'] resource_path = "/customProtectionRules/{customProtectionRuleId}" method = "DELETE" operation_name = "delete_custom_protection_rule" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/CustomProtectionRule/DeleteCustomProtectionRule" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"delete_custom_protection_rule got unknown kwargs: {extra_kwargs!r}") path_params = { "customProtectionRuleId": custom_protection_rule_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def delete_waas_policy(self, waas_policy_id, **kwargs): """ Deletes a policy. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/delete_waas_policy.py.html>`__ to see an example of how to use delete_waas_policy API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}" method = "DELETE" operation_name = "delete_waas_policy" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WaasPolicy/DeleteWaasPolicy" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"delete_waas_policy got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_address_list(self, address_list_id, **kwargs): """ Gets the details of an address list. :param str address_list_id: (required) The `OCID`__ of the address list. This number is generated when the address list is added to the compartment. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.AddressList` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/get_address_list.py.html>`__ to see an example of how to use get_address_list API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['addressListId'] resource_path = "/addressLists/{addressListId}" method = "GET" operation_name = "get_address_list" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/AddressList/GetAddressList" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_address_list got unknown kwargs: {extra_kwargs!r}") path_params = { "addressListId": address_list_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="AddressList", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="AddressList", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_certificate(self, certificate_id, **kwargs): """ Gets the details of an SSL certificate. :param str certificate_id: (required) The `OCID`__ of the SSL certificate used in the WAAS policy. This number is generated when the certificate is added to the policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.Certificate` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/get_certificate.py.html>`__ to see an example of how to use get_certificate API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['certificateId'] resource_path = "/certificates/{certificateId}" method = "GET" operation_name = "get_certificate" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/Certificate/GetCertificate" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_certificate got unknown kwargs: {extra_kwargs!r}") path_params = { "certificateId": certificate_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="Certificate", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="Certificate", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_custom_protection_rule(self, custom_protection_rule_id, **kwargs): """ Gets the details of a custom protection rule. :param str custom_protection_rule_id: (required) The `OCID`__ of the custom protection rule. This number is generated when the custom protection rule is added to the compartment. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.CustomProtectionRule` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/get_custom_protection_rule.py.html>`__ to see an example of how to use get_custom_protection_rule API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['customProtectionRuleId'] resource_path = "/customProtectionRules/{customProtectionRuleId}" method = "GET" operation_name = "get_custom_protection_rule" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/CustomProtectionRule/GetCustomProtectionRule" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_custom_protection_rule got unknown kwargs: {extra_kwargs!r}") path_params = { "customProtectionRuleId": custom_protection_rule_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="CustomProtectionRule", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="CustomProtectionRule", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_device_fingerprint_challenge(self, waas_policy_id, **kwargs): """ Gets the device fingerprint challenge settings in the Web Application Firewall configuration for a WAAS policy. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.DeviceFingerprintChallenge` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/get_device_fingerprint_challenge.py.html>`__ to see an example of how to use get_device_fingerprint_challenge API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/deviceFingerprintChallenge" method = "GET" operation_name = "get_device_fingerprint_challenge" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/DeviceFingerprintChallenge/GetDeviceFingerprintChallenge" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_device_fingerprint_challenge got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="DeviceFingerprintChallenge", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="DeviceFingerprintChallenge", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_human_interaction_challenge(self, waas_policy_id, **kwargs): """ Gets the human interaction challenge settings in the Web Application Firewall configuration for a WAAS policy. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.HumanInteractionChallenge` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/get_human_interaction_challenge.py.html>`__ to see an example of how to use get_human_interaction_challenge API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/humanInteractionChallenge" method = "GET" operation_name = "get_human_interaction_challenge" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/HumanInteractionChallenge/GetHumanInteractionChallenge" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_human_interaction_challenge got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="HumanInteractionChallenge", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="HumanInteractionChallenge", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_js_challenge(self, waas_policy_id, **kwargs): """ Gets the JavaScript challenge settings in the Web Application Firewall configuration for a WAAS policy. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.JsChallenge` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/get_js_challenge.py.html>`__ to see an example of how to use get_js_challenge API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/jsChallenge" method = "GET" operation_name = "get_js_challenge" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/JsChallenge/GetJsChallenge" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_js_challenge got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="JsChallenge", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="JsChallenge", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_policy_config(self, waas_policy_id, **kwargs): """ Gets the configuration of a WAAS policy. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.PolicyConfig` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/get_policy_config.py.html>`__ to see an example of how to use get_policy_config API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/policyConfig" method = "GET" operation_name = "get_policy_config" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/PolicyConfig/GetPolicyConfig" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_policy_config got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="PolicyConfig", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="PolicyConfig", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_protection_rule(self, waas_policy_id, protection_rule_key, **kwargs): """ Gets the details of a protection rule in the Web Application Firewall configuration for a WAAS policy. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str protection_rule_key: (required) The protection rule key. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.ProtectionRule` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/get_protection_rule.py.html>`__ to see an example of how to use get_protection_rule API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId', 'protectionRuleKey'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/protectionRules/{protectionRuleKey}" method = "GET" operation_name = "get_protection_rule" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/ProtectionRule/GetProtectionRule" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_protection_rule got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id, "protectionRuleKey": protection_rule_key } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="ProtectionRule", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="ProtectionRule", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_protection_settings(self, waas_policy_id, **kwargs): """ Gets the protection settings in the Web Application Firewall configuration for a WAAS policy. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.ProtectionSettings` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/get_protection_settings.py.html>`__ to see an example of how to use get_protection_settings API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/protectionSettings" method = "GET" operation_name = "get_protection_settings" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/ProtectionSettings/GetProtectionSettings" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_protection_settings got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="ProtectionSettings", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="ProtectionSettings", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_waas_policy(self, waas_policy_id, **kwargs): """ Gets the details of a WAAS policy. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.WaasPolicy` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/get_waas_policy.py.html>`__ to see an example of how to use get_waas_policy API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}" method = "GET" operation_name = "get_waas_policy" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WaasPolicy/GetWaasPolicy" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_waas_policy got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="WaasPolicy", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="WaasPolicy", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_waf_address_rate_limiting(self, waas_policy_id, **kwargs): """ Gets the address rate limiting settings of the Web Application Firewall configuration for a WAAS policy. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.AddressRateLimiting` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/get_waf_address_rate_limiting.py.html>`__ to see an example of how to use get_waf_address_rate_limiting API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/addressRateLimiting" method = "GET" operation_name = "get_waf_address_rate_limiting" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/AddressRateLimiting/GetWafAddressRateLimiting" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_waf_address_rate_limiting got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="AddressRateLimiting", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="AddressRateLimiting", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_waf_config(self, waas_policy_id, **kwargs): """ Gets the Web Application Firewall configuration details for a WAAS policy. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.WafConfig` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/get_waf_config.py.html>`__ to see an example of how to use get_waf_config API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig" method = "GET" operation_name = "get_waf_config" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WafConfig/GetWafConfig" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_waf_config got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="WafConfig", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="WafConfig", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def get_work_request(self, work_request_id, **kwargs): """ Gets the details of a specified work request. :param str work_request_id: (required) The `OCID`__ of the work request. This number is generated when work request is created. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.WorkRequest` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/get_work_request.py.html>`__ to see an example of how to use get_work_request API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['workRequestId'] resource_path = "/workRequests/{workRequestId}" method = "GET" operation_name = "get_work_request" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WorkRequest/GetWorkRequest" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"get_work_request got unknown kwargs: {extra_kwargs!r}") path_params = { "workRequestId": work_request_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="WorkRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, response_type="WorkRequest", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_access_rules(self, waas_policy_id, **kwargs): """ Gets the currently configured access rules for the Web Application Firewall configuration 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.AccessRule` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_access_rules.py.html>`__ to see an example of how to use list_access_rules API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/accessRules" method = "GET" operation_name = "list_access_rules" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/AccessRule/ListAccessRules" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_access_rules got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') query_params = { "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[AccessRule]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[AccessRule]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_address_lists(self, compartment_id, **kwargs): """ Gets a list of address lists that can be used in a WAAS policy. :param str compartment_id: (required) The `OCID`__ of the compartment. This number is generated when the compartment is created. __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param str sort_by: (optional) The value by which address lists are sorted in a paginated 'List' call. If unspecified, defaults to `timeCreated`. Allowed values are: "id", "name", "timeCreated" :param str sort_order: (optional) The value of the sorting direction of resources in a paginated 'List' call. If unspecified, defaults to `DESC`. Allowed values are: "ASC", "DESC" :param list[str] id: (optional) Filter address lists using a list of address lists OCIDs. :param list[str] name: (optional) Filter address lists using a list of names. :param list[str] lifecycle_state: (optional) Filter address lists using a list of lifecycle states. Allowed values are: "CREATING", "ACTIVE", "FAILED", "UPDATING", "DELETING", "DELETED" :param datetime time_created_greater_than_or_equal_to: (optional) A filter that matches address lists created on or after the specified date-time. :param datetime time_created_less_than: (optional) A filter that matches address lists created before the specified date-time. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.AddressListSummary` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_address_lists.py.html>`__ to see an example of how to use list_address_lists API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['compartmentId'] resource_path = "/addressLists" method = "GET" operation_name = "list_address_lists" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/AddressList/ListAddressLists" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page", "sort_by", "sort_order", "id", "name", "lifecycle_state", "time_created_greater_than_or_equal_to", "time_created_less_than" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_address_lists got unknown kwargs: {extra_kwargs!r}") if 'sort_by' in kwargs: sort_by_allowed_values = ["id", "name", "timeCreated"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'lifecycle_state' in kwargs: lifecycle_state_allowed_values = ["CREATING", "ACTIVE", "FAILED", "UPDATING", "DELETING", "DELETED"] for lifecycle_state_item in kwargs['lifecycle_state']: if lifecycle_state_item not in lifecycle_state_allowed_values: raise ValueError( f"Invalid value for `lifecycle_state`, must be one of { lifecycle_state_allowed_values }" ) query_params = { "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortBy": kwargs.get("sort_by", missing), "sortOrder": kwargs.get("sort_order", missing), "compartmentId": compartment_id, "id": self.base_client.generate_collection_format_param(kwargs.get("id", missing), 'multi'), "name": self.base_client.generate_collection_format_param(kwargs.get("name", missing), 'multi'), "lifecycleState": self.base_client.generate_collection_format_param(kwargs.get("lifecycle_state", missing), 'multi'), "timeCreatedGreaterThanOrEqualTo": kwargs.get("time_created_greater_than_or_equal_to", missing), "timeCreatedLessThan": kwargs.get("time_created_less_than", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="list[AddressListSummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="list[AddressListSummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_caching_rules(self, waas_policy_id, **kwargs): """ Gets the currently configured caching rules for the Web Application Firewall configuration of a specified WAAS policy. The rules are processed in the order they are specified in and the first matching rule will be used when processing a request. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.CachingRuleSummary` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_caching_rules.py.html>`__ to see an example of how to use list_caching_rules API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/cachingRules" method = "GET" operation_name = "list_caching_rules" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/CachingRuleSummary/ListCachingRules" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_caching_rules got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') query_params = { "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[CachingRuleSummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[CachingRuleSummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_captchas(self, waas_policy_id, **kwargs): """ 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.Captcha` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_captchas.py.html>`__ to see an example of how to use list_captchas API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/captchas" method = "GET" operation_name = "list_captchas" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/Captcha/ListCaptchas" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_captchas got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') query_params = { "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[Captcha]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[Captcha]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_certificates(self, compartment_id, **kwargs): """ Gets a list of SSL certificates that can be used in a WAAS policy. :param str compartment_id: (required) The `OCID`__ of the compartment. This number is generated when the compartment is created. __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param str sort_by: (optional) 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" :param str sort_order: (optional) The value of the sorting direction of resources in a paginated 'List' call. If unspecified, defaults to `DESC`. Allowed values are: "ASC", "DESC" :param list[str] id: (optional) Filter certificates using a list of certificates OCIDs. :param list[str] display_name: (optional) Filter certificates using a list of display names. :param list[str] lifecycle_state: (optional) Filter certificates using a list of lifecycle states. Allowed values are: "CREATING", "ACTIVE", "FAILED", "UPDATING", "DELETING", "DELETED" :param datetime time_created_greater_than_or_equal_to: (optional) A filter that matches certificates created on or after the specified date-time. :param datetime time_created_less_than: (optional) A filter that matches certificates created before the specified date-time. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.CertificateSummary` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_certificates.py.html>`__ to see an example of how to use list_certificates API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['compartmentId'] resource_path = "/certificates" method = "GET" operation_name = "list_certificates" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/CertificateSummary/ListCertificates" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page", "sort_by", "sort_order", "id", "display_name", "lifecycle_state", "time_created_greater_than_or_equal_to", "time_created_less_than" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_certificates got unknown kwargs: {extra_kwargs!r}") if 'sort_by' in kwargs: sort_by_allowed_values = ["id", "compartmentId", "displayName", "notValidAfter", "timeCreated"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'lifecycle_state' in kwargs: lifecycle_state_allowed_values = ["CREATING", "ACTIVE", "FAILED", "UPDATING", "DELETING", "DELETED"] for lifecycle_state_item in kwargs['lifecycle_state']: if lifecycle_state_item not in lifecycle_state_allowed_values: raise ValueError( f"Invalid value for `lifecycle_state`, must be one of { lifecycle_state_allowed_values }" ) query_params = { "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortBy": kwargs.get("sort_by", missing), "sortOrder": kwargs.get("sort_order", missing), "compartmentId": compartment_id, "id": self.base_client.generate_collection_format_param(kwargs.get("id", missing), 'multi'), "displayName": self.base_client.generate_collection_format_param(kwargs.get("display_name", missing), 'multi'), "lifecycleState": self.base_client.generate_collection_format_param(kwargs.get("lifecycle_state", missing), 'multi'), "timeCreatedGreaterThanOrEqualTo": kwargs.get("time_created_greater_than_or_equal_to", missing), "timeCreatedLessThan": kwargs.get("time_created_less_than", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="list[CertificateSummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="list[CertificateSummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_custom_protection_rules(self, compartment_id, **kwargs): """ Gets a list of custom protection rules for the specified Web Application Firewall. :param str compartment_id: (required) The `OCID`__ of the compartment. This number is generated when the compartment is created. __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param str sort_by: (optional) The value by which custom protection rules are sorted in a paginated 'List' call. If unspecified, defaults to `timeCreated`. Allowed values are: "id", "compartmentId", "displayName", "modSecurityRuleId", "timeCreated" :param str sort_order: (optional) The value of the sorting direction of resources in a paginated 'List' call. If unspecified, defaults to `DESC`. Allowed values are: "ASC", "DESC" :param list[str] id: (optional) Filter custom protection rules using a list of custom protection rule OCIDs. :param list[str] display_name: (optional) Filter custom protection rules using a list of display names. :param list[str] lifecycle_state: (optional) Filter Custom Protection rules using a list of lifecycle states. Allowed values are: "CREATING", "ACTIVE", "FAILED", "UPDATING", "DELETING", "DELETED" :param datetime time_created_greater_than_or_equal_to: (optional) A filter that matches Custom Protection rules created on or after the specified date-time. :param datetime time_created_less_than: (optional) A filter that matches custom protection rules created before the specified date-time. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.CustomProtectionRuleSummary` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_custom_protection_rules.py.html>`__ to see an example of how to use list_custom_protection_rules API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['compartmentId'] resource_path = "/customProtectionRules" method = "GET" operation_name = "list_custom_protection_rules" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/CustomProtectionRule/ListCustomProtectionRules" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page", "sort_by", "sort_order", "id", "display_name", "lifecycle_state", "time_created_greater_than_or_equal_to", "time_created_less_than" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_custom_protection_rules got unknown kwargs: {extra_kwargs!r}") if 'sort_by' in kwargs: sort_by_allowed_values = ["id", "compartmentId", "displayName", "modSecurityRuleId", "timeCreated"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'lifecycle_state' in kwargs: lifecycle_state_allowed_values = ["CREATING", "ACTIVE", "FAILED", "UPDATING", "DELETING", "DELETED"] for lifecycle_state_item in kwargs['lifecycle_state']: if lifecycle_state_item not in lifecycle_state_allowed_values: raise ValueError( f"Invalid value for `lifecycle_state`, must be one of { lifecycle_state_allowed_values }" ) query_params = { "compartmentId": compartment_id, "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortBy": kwargs.get("sort_by", missing), "sortOrder": kwargs.get("sort_order", missing), "id": self.base_client.generate_collection_format_param(kwargs.get("id", missing), 'multi'), "displayName": self.base_client.generate_collection_format_param(kwargs.get("display_name", missing), 'multi'), "lifecycleState": self.base_client.generate_collection_format_param(kwargs.get("lifecycle_state", missing), 'multi'), "timeCreatedGreaterThanOrEqualTo": kwargs.get("time_created_greater_than_or_equal_to", missing), "timeCreatedLessThan": kwargs.get("time_created_less_than", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="list[CustomProtectionRuleSummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="list[CustomProtectionRuleSummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_edge_subnets(self, **kwargs): """ 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. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param str sort_by: (optional) 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" :param str sort_order: (optional) The value of the sorting direction of resources in a paginated 'List' call. If unspecified, defaults to `DESC`. Allowed values are: "ASC", "DESC" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.EdgeSubnet` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_edge_subnets.py.html>`__ to see an example of how to use list_edge_subnets API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = [] resource_path = "/edgeSubnets" method = "GET" operation_name = "list_edge_subnets" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/EdgeSubnet/ListEdgeSubnets" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page", "sort_by", "sort_order" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_edge_subnets got unknown kwargs: {extra_kwargs!r}") if 'sort_by' in kwargs: sort_by_allowed_values = ["cidr", "region", "timeModified"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) query_params = { "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortBy": kwargs.get("sort_by", missing), "sortOrder": kwargs.get("sort_order", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="list[EdgeSubnet]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="list[EdgeSubnet]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_good_bots(self, waas_policy_id, **kwargs): """ 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.GoodBot` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_good_bots.py.html>`__ to see an example of how to use list_good_bots API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/goodBots" method = "GET" operation_name = "list_good_bots" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/GoodBot/ListGoodBots" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_good_bots got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') query_params = { "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[GoodBot]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[GoodBot]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_protection_rules(self, waas_policy_id, **kwargs): """ 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param list[str] mod_security_rule_id: (optional) Filter rules using a list of ModSecurity rule IDs. :param list[str] action: (optional) Filter rules using a list of actions. Allowed values are: "OFF", "DETECT", "BLOCK" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.ProtectionRule` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_protection_rules.py.html>`__ to see an example of how to use list_protection_rules API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/protectionRules" method = "GET" operation_name = "list_protection_rules" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/ProtectionRule/ListProtectionRules" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page", "mod_security_rule_id", "action" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_protection_rules got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') if 'action' in kwargs: action_allowed_values = ["OFF", "DETECT", "BLOCK"] for action_item in kwargs['action']: if action_item not in action_allowed_values: raise ValueError( f"Invalid value for `action`, must be one of { action_allowed_values }" ) query_params = { "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "modSecurityRuleId": self.base_client.generate_collection_format_param(kwargs.get("mod_security_rule_id", missing), 'multi'), "action": self.base_client.generate_collection_format_param(kwargs.get("action", missing), 'multi') } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[ProtectionRule]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[ProtectionRule]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_recommendations(self, waas_policy_id, **kwargs): """ 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`__. The list is sorted by `key`, in ascending order. __ https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/wafprotectionrules.htm :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str recommended_action: (optional) 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" :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.Recommendation` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_recommendations.py.html>`__ to see an example of how to use list_recommendations API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/recommendations" method = "GET" operation_name = "list_recommendations" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/Recommendation/ListRecommendations" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "recommended_action", "limit", "page" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_recommendations got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') if 'recommended_action' in kwargs: recommended_action_allowed_values = ["DETECT", "BLOCK"] if kwargs['recommended_action'] not in recommended_action_allowed_values: raise ValueError( f"Invalid value for `recommended_action`, must be one of { recommended_action_allowed_values }" ) query_params = { "recommendedAction": kwargs.get("recommended_action", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[Recommendation]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[Recommendation]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_threat_feeds(self, waas_policy_id, **kwargs): """ 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.ThreatFeed` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_threat_feeds.py.html>`__ to see an example of how to use list_threat_feeds API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/threatFeeds" method = "GET" operation_name = "list_threat_feeds" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/ThreatFeed/ListThreatFeeds" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_threat_feeds got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') query_params = { "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[ThreatFeed]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[ThreatFeed]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_waas_policies(self, compartment_id, **kwargs): """ Gets a list of WAAS policies. :param str compartment_id: (required) The `OCID`__ of the compartment. This number is generated when the compartment is created. __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param str sort_by: (optional) The value by which policies are sorted in a paginated 'List' call. If unspecified, defaults to `timeCreated`. Allowed values are: "id", "displayName", "timeCreated" :param str sort_order: (optional) The value of the sorting direction of resources in a paginated 'List' call. If unspecified, defaults to `DESC`. Allowed values are: "ASC", "DESC" :param list[str] id: (optional) Filter policies using a list of policy OCIDs. :param list[str] display_name: (optional) Filter policies using a list of display names. :param list[str] lifecycle_state: (optional) Filter policies using a list of lifecycle states. Allowed values are: "CREATING", "ACTIVE", "FAILED", "UPDATING", "DELETING", "DELETED" :param datetime time_created_greater_than_or_equal_to: (optional) A filter that matches policies created on or after the specified date and time. :param datetime time_created_less_than: (optional) A filter that matches policies created before the specified date-time. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.WaasPolicySummary` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_waas_policies.py.html>`__ to see an example of how to use list_waas_policies API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['compartmentId'] resource_path = "/waasPolicies" method = "GET" operation_name = "list_waas_policies" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WaasPolicy/ListWaasPolicies" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page", "sort_by", "sort_order", "id", "display_name", "lifecycle_state", "time_created_greater_than_or_equal_to", "time_created_less_than" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_waas_policies got unknown kwargs: {extra_kwargs!r}") if 'sort_by' in kwargs: sort_by_allowed_values = ["id", "displayName", "timeCreated"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) if 'lifecycle_state' in kwargs: lifecycle_state_allowed_values = ["CREATING", "ACTIVE", "FAILED", "UPDATING", "DELETING", "DELETED"] for lifecycle_state_item in kwargs['lifecycle_state']: if lifecycle_state_item not in lifecycle_state_allowed_values: raise ValueError( f"Invalid value for `lifecycle_state`, must be one of { lifecycle_state_allowed_values }" ) query_params = { "compartmentId": compartment_id, "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortBy": kwargs.get("sort_by", missing), "sortOrder": kwargs.get("sort_order", missing), "id": self.base_client.generate_collection_format_param(kwargs.get("id", missing), 'multi'), "displayName": self.base_client.generate_collection_format_param(kwargs.get("display_name", missing), 'multi'), "lifecycleState": self.base_client.generate_collection_format_param(kwargs.get("lifecycle_state", missing), 'multi'), "timeCreatedGreaterThanOrEqualTo": kwargs.get("time_created_greater_than_or_equal_to", missing), "timeCreatedLessThan": kwargs.get("time_created_less_than", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="list[WaasPolicySummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="list[WaasPolicySummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_waas_policy_custom_protection_rules(self, waas_policy_id, **kwargs): """ Gets the list of currently configured custom protection rules for a WAAS policy. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param list[str] mod_security_rule_id: (optional) Filter rules using a list of ModSecurity rule IDs. :param list[str] action: (optional) Filter rules using a list of actions. Allowed values are: "DETECT", "BLOCK" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.WaasPolicyCustomProtectionRuleSummary` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_waas_policy_custom_protection_rules.py.html>`__ to see an example of how to use list_waas_policy_custom_protection_rules API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/customProtectionRules" method = "GET" operation_name = "list_waas_policy_custom_protection_rules" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/CustomProtectionRule/ListWaasPolicyCustomProtectionRules" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page", "mod_security_rule_id", "action" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_waas_policy_custom_protection_rules got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') if 'action' in kwargs: action_allowed_values = ["DETECT", "BLOCK"] for action_item in kwargs['action']: if action_item not in action_allowed_values: raise ValueError( f"Invalid value for `action`, must be one of { action_allowed_values }" ) query_params = { "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "modSecurityRuleId": self.base_client.generate_collection_format_param(kwargs.get("mod_security_rule_id", missing), 'multi'), "action": self.base_client.generate_collection_format_param(kwargs.get("action", missing), 'multi') } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[WaasPolicyCustomProtectionRuleSummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[WaasPolicyCustomProtectionRuleSummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_waf_blocked_requests(self, waas_policy_id, **kwargs): """ 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). :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param datetime time_observed_greater_than_or_equal_to: (optional) 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. :param datetime time_observed_less_than: (optional) A filter that limits returned events to those occurring before a date and time, specified in RFC 3339 format. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param list[str] waf_feature: (optional) 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" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.WafBlockedRequest` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_waf_blocked_requests.py.html>`__ to see an example of how to use list_waf_blocked_requests API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/reports/waf/blocked" method = "GET" operation_name = "list_waf_blocked_requests" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WafBlockedRequest/ListWafBlockedRequests" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "time_observed_greater_than_or_equal_to", "time_observed_less_than", "limit", "page", "waf_feature" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_waf_blocked_requests got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') if 'waf_feature' in kwargs: waf_feature_allowed_values = ["PROTECTION_RULES", "JS_CHALLENGE", "ACCESS_RULES", "THREAT_FEEDS", "HUMAN_INTERACTION_CHALLENGE", "DEVICE_FINGERPRINT_CHALLENGE", "CAPTCHA", "ADDRESS_RATE_LIMITING"] for waf_feature_item in kwargs['waf_feature']: if waf_feature_item not in waf_feature_allowed_values: raise ValueError( f"Invalid value for `waf_feature`, must be one of { waf_feature_allowed_values }" ) query_params = { "timeObservedGreaterThanOrEqualTo": kwargs.get("time_observed_greater_than_or_equal_to", missing), "timeObservedLessThan": kwargs.get("time_observed_less_than", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "wafFeature": self.base_client.generate_collection_format_param(kwargs.get("waf_feature", missing), 'multi') } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[WafBlockedRequest]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[WafBlockedRequest]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_waf_logs(self, waas_policy_id, **kwargs): """ Gets structured Web Application Firewall event logs for a WAAS policy. Sorted by the `timeObserved` in ascending order (starting from the oldest recorded event). :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `20`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param datetime time_observed_greater_than_or_equal_to: (optional) 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. :param datetime time_observed_less_than: (optional) A filter that matches log entries where the observed event occurred before a date and time, specified in RFC 3339 format. :param str text_contains: (optional) A full text search for logs. :param list[str] access_rule_key: (optional) Filters logs by access rule key. :param list[str] action: (optional) Filters logs by Web Application Firewall action. Allowed values are: "BLOCK", "DETECT", "BYPASS", "LOG", "REDIRECTED" :param list[str] client_address: (optional) Filters logs by client IP address. :param list[str] country_code: (optional) Filters logs by country code. Country codes are in ISO 3166-1 alpha-2 format. For a list of codes, see `ISO's website`__. __ https://www.iso.org/obp/ui/#search/code/ :param list[str] country_name: (optional) Filter logs by country name. :param list[str] fingerprint: (optional) Filter logs by device fingerprint. :param list[str] http_method: (optional) Filter logs by HTTP method. Allowed values are: "OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT" :param list[str] incident_key: (optional) Filter logs by incident key. :param list[str] log_type: (optional) Filter by log type. For more information about WAF logs, see `Logs`__. __ https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/logs.htm Allowed values are: "ACCESS", "PROTECTION_RULES", "JS_CHALLENGE", "CAPTCHA", "ACCESS_RULES", "THREAT_FEEDS", "HUMAN_INTERACTION_CHALLENGE", "DEVICE_FINGERPRINT_CHALLENGE", "ADDRESS_RATE_LIMITING" :param list[str] origin_address: (optional) Filter by origin IP address. :param list[str] referrer: (optional) Filter by referrer. :param list[str] request_url: (optional) Filter by request URL. :param list[int] response_code: (optional) Filter by response code. :param list[str] threat_feed_key: (optional) Filter by threat feed key. :param list[str] user_agent: (optional) Filter by user agent. :param list[str] protection_rule_key: (optional) Filter by protection rule key. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.WafLog` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_waf_logs.py.html>`__ to see an example of how to use list_waf_logs API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafLogs" method = "GET" operation_name = "list_waf_logs" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WafLog/ListWafLogs" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page", "time_observed_greater_than_or_equal_to", "time_observed_less_than", "text_contains", "access_rule_key", "action", "client_address", "country_code", "country_name", "fingerprint", "http_method", "incident_key", "log_type", "origin_address", "referrer", "request_url", "response_code", "threat_feed_key", "user_agent", "protection_rule_key" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_waf_logs got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') if 'action' in kwargs: action_allowed_values = ["BLOCK", "DETECT", "BYPASS", "LOG", "REDIRECTED"] for action_item in kwargs['action']: if action_item not in action_allowed_values: raise ValueError( f"Invalid value for `action`, must be one of { action_allowed_values }" ) if 'http_method' in kwargs: http_method_allowed_values = ["OPTIONS", "GET", "HEAD", "POST", "PUT", "DELETE", "TRACE", "CONNECT"] for http_method_item in kwargs['http_method']: if http_method_item not in http_method_allowed_values: raise ValueError( f"Invalid value for `http_method`, must be one of { http_method_allowed_values }" ) if 'log_type' in kwargs: log_type_allowed_values = ["ACCESS", "PROTECTION_RULES", "JS_CHALLENGE", "CAPTCHA", "ACCESS_RULES", "THREAT_FEEDS", "HUMAN_INTERACTION_CHALLENGE", "DEVICE_FINGERPRINT_CHALLENGE", "ADDRESS_RATE_LIMITING"] for log_type_item in kwargs['log_type']: if log_type_item not in log_type_allowed_values: raise ValueError( f"Invalid value for `log_type`, must be one of { log_type_allowed_values }" ) query_params = { "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "timeObservedGreaterThanOrEqualTo": kwargs.get("time_observed_greater_than_or_equal_to", missing), "timeObservedLessThan": kwargs.get("time_observed_less_than", missing), "textContains": kwargs.get("text_contains", missing), "accessRuleKey": self.base_client.generate_collection_format_param(kwargs.get("access_rule_key", missing), 'multi'), "action": self.base_client.generate_collection_format_param(kwargs.get("action", missing), 'multi'), "clientAddress": self.base_client.generate_collection_format_param(kwargs.get("client_address", missing), 'multi'), "countryCode": self.base_client.generate_collection_format_param(kwargs.get("country_code", missing), 'multi'), "countryName": self.base_client.generate_collection_format_param(kwargs.get("country_name", missing), 'multi'), "fingerprint": self.base_client.generate_collection_format_param(kwargs.get("fingerprint", missing), 'multi'), "httpMethod": self.base_client.generate_collection_format_param(kwargs.get("http_method", missing), 'multi'), "incidentKey": self.base_client.generate_collection_format_param(kwargs.get("incident_key", missing), 'multi'), "logType": self.base_client.generate_collection_format_param(kwargs.get("log_type", missing), 'multi'), "originAddress": self.base_client.generate_collection_format_param(kwargs.get("origin_address", missing), 'multi'), "referrer": self.base_client.generate_collection_format_param(kwargs.get("referrer", missing), 'multi'), "requestUrl": self.base_client.generate_collection_format_param(kwargs.get("request_url", missing), 'multi'), "responseCode": self.base_client.generate_collection_format_param(kwargs.get("response_code", missing), 'multi'), "threatFeedKey": self.base_client.generate_collection_format_param(kwargs.get("threat_feed_key", missing), 'multi'), "userAgent": self.base_client.generate_collection_format_param(kwargs.get("user_agent", missing), 'multi'), "protectionRuleKey": self.base_client.generate_collection_format_param(kwargs.get("protection_rule_key", missing), 'multi') } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[WafLog]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[WafLog]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_waf_requests(self, waas_policy_id, **kwargs): """ 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). :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param datetime time_observed_greater_than_or_equal_to: (optional) 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. :param datetime time_observed_less_than: (optional) A filter that limits returned events to those occurring before a date and time, specified in RFC 3339 format. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.WafRequest` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_waf_requests.py.html>`__ to see an example of how to use list_waf_requests API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/reports/waf/requests" method = "GET" operation_name = "list_waf_requests" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WafRequest/ListWafRequests" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "time_observed_greater_than_or_equal_to", "time_observed_less_than", "limit", "page" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_waf_requests got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') query_params = { "timeObservedGreaterThanOrEqualTo": kwargs.get("time_observed_greater_than_or_equal_to", missing), "timeObservedLessThan": kwargs.get("time_observed_less_than", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[WafRequest]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[WafRequest]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_waf_traffic(self, waas_policy_id, **kwargs): """ Gets the Web Application Firewall traffic data for a WAAS policy. Sorted by `timeObserved` in ascending order (starting from oldest data). :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param datetime time_observed_greater_than_or_equal_to: (optional) 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. :param datetime time_observed_less_than: (optional) A filter that limits returned events to those occurring before a date and time, specified in RFC 3339 format. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.WafTrafficDatum` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_waf_traffic.py.html>`__ to see an example of how to use list_waf_traffic API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/reports/waf/traffic" method = "GET" operation_name = "list_waf_traffic" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WafTrafficDatum/ListWafTraffic" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "time_observed_greater_than_or_equal_to", "time_observed_less_than", "limit", "page" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_waf_traffic got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') query_params = { "timeObservedGreaterThanOrEqualTo": kwargs.get("time_observed_greater_than_or_equal_to", missing), "timeObservedLessThan": kwargs.get("time_observed_less_than", missing), "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[WafTrafficDatum]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[WafTrafficDatum]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_whitelists(self, waas_policy_id, **kwargs): """ Gets the list of whitelists defined in the Web Application Firewall configuration for a WAAS policy. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.Whitelist` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_whitelists.py.html>`__ to see an example of how to use list_whitelists API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/whitelists" method = "GET" operation_name = "list_whitelists" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/Whitelist/ListWhitelists" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_whitelists got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') query_params = { "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[Whitelist]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, query_params=query_params, header_params=header_params, response_type="list[Whitelist]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def list_work_requests(self, waas_policy_id, compartment_id, **kwargs): """ 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. :param str waas_policy_id: (required) The `OCID`__ of the policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str compartment_id: (required) The `OCID`__ of the compartment. This number is generated when the compartment is created. __ https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param int limit: (optional) The maximum number of items to return in a paginated call. If unspecified, defaults to `10`. :param str page: (optional) The value of the `opc-next-page` response header from the previous paginated call. :param str sort_by: (optional) 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" :param str sort_order: (optional) The value of the sorting direction of resources in a paginated 'List' call. If unspecified, defaults to `DESC`. Allowed values are: "ASC", "DESC" :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation uses :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` as default if no retry strategy is provided. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type list of :class:`~oci.waas.models.WorkRequestSummary` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/list_work_requests.py.html>`__ to see an example of how to use list_work_requests API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId', 'compartmentId'] resource_path = "/workRequests" method = "GET" operation_name = "list_work_requests" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WorkRequestSummary/ListWorkRequests" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "limit", "page", "sort_by", "sort_order" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"list_work_requests got unknown kwargs: {extra_kwargs!r}") if 'sort_by' in kwargs: sort_by_allowed_values = ["id", "status", "timeAccepted", "timeStarted", "timeFinished", "operationType"] if kwargs['sort_by'] not in sort_by_allowed_values: raise ValueError( f"Invalid value for `sort_by`, must be one of { sort_by_allowed_values }" ) if 'sort_order' in kwargs: sort_order_allowed_values = ["ASC", "DESC"] if kwargs['sort_order'] not in sort_order_allowed_values: raise ValueError( f"Invalid value for `sort_order`, must be one of { sort_order_allowed_values }" ) query_params = { "waasPolicyId": waas_policy_id, "compartmentId": compartment_id, "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), "sortBy": kwargs.get("sort_by", missing), "sortOrder": kwargs.get("sort_order", missing) } query_params = {k: v for (k, v) in six.iteritems(query_params) if v is not missing and v is not None} header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy is None: retry_strategy = retry.DEFAULT_RETRY_STRATEGY if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="list[WorkRequestSummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, query_params=query_params, header_params=header_params, response_type="list[WorkRequestSummary]", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def purge_cache(self, waas_policy_id, **kwargs): """ Performs a purge of the cache for each specified resource. If no resources are passed, the cache for the entire Web Application Firewall will be purged. For more information, see `Caching Rules`__. __ https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/cachingrules.htm#purge :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str if_match: (optional) 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. :param oci.waas.models.PurgeCache purge_cache: (optional) :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/purge_cache.py.html>`__ to see an example of how to use purge_cache API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/actions/purgeCache" method = "POST" operation_name = "purge_cache" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/PurgeCache/PurgeCache" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "if_match", "purge_cache" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"purge_cache got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=kwargs.get('purge_cache'), allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=kwargs.get('purge_cache'), allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_access_rules(self, waas_policy_id, access_rules, **kwargs): """ 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.list[AccessRule] access_rules: (required) :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_access_rules.py.html>`__ to see an example of how to use update_access_rules API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/accessRules" method = "PUT" operation_name = "update_access_rules" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/AccessRule/UpdateAccessRules" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_access_rules got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=access_rules, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=access_rules, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_address_list(self, address_list_id, **kwargs): """ Updates the details of an address list. Only the fields specified in the request body will be updated; all other properties will remain unchanged. :param str address_list_id: (required) The `OCID`__ of the address list. This number is generated when the address list is added to the compartment. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str if_match: (optional) 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. :param oci.waas.models.UpdateAddressListDetails update_address_list_details: (optional) The details of the address list to update. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.AddressList` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_address_list.py.html>`__ to see an example of how to use update_address_list API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['addressListId'] resource_path = "/addressLists/{addressListId}" method = "PUT" operation_name = "update_address_list" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/AddressList/UpdateAddressList" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "if_match", "update_address_list_details" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_address_list got unknown kwargs: {extra_kwargs!r}") path_params = { "addressListId": address_list_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=kwargs.get('update_address_list_details'), response_type="AddressList", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=kwargs.get('update_address_list_details'), response_type="AddressList", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_caching_rules(self, waas_policy_id, caching_rules_details, **kwargs): """ Updates the configuration for each specified caching rule. Caching rules WAF policies allow you to selectively cache content on Oracle Cloud Infrastructure's edge servers, such as webpages or certain file types. For more information about caching rules, see `Caching Rules`__. This operation can create, delete, update, and/or reorder caching rules depending on the structure of the request body. Caching rules can be updated by changing the properties of the caching rule object with the rule's key specified in the key field. Any existing caching rules that are not specified with a key in the list of access rules will be deleted upon update. The order the caching rules are specified in is important. The rules are processed in the order they are specified and the first matching rule will be used when processing a request. Use `ListCachingRules` to view a list of all available caching rules in a compartment. __ https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/cachingrules.htm :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.list[CachingRule] caching_rules_details: (required) :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_caching_rules.py.html>`__ to see an example of how to use update_caching_rules API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/cachingRules" method = "PUT" operation_name = "update_caching_rules" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/CachingRule/UpdateCachingRules" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_caching_rules got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=caching_rules_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=caching_rules_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_captchas(self, waas_policy_id, captchas, **kwargs): """ 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. Query parameters are allowed in CAPTCHA URL. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.list[Captcha] captchas: (required) A list of CAPTCHA details. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_captchas.py.html>`__ to see an example of how to use update_captchas API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/captchas" method = "PUT" operation_name = "update_captchas" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/Captcha/UpdateCaptchas" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_captchas got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=captchas, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=captchas, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_certificate(self, certificate_id, **kwargs): """ 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. :param str certificate_id: (required) The `OCID`__ of the SSL certificate used in the WAAS policy. This number is generated when the certificate is added to the policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str if_match: (optional) 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. :param oci.waas.models.UpdateCertificateDetails update_certificate_details: (optional) The new display name, freeform tags, and defined tags to apply to a certificate. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.Certificate` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_certificate.py.html>`__ to see an example of how to use update_certificate API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['certificateId'] resource_path = "/certificates/{certificateId}" method = "PUT" operation_name = "update_certificate" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/Certificate/UpdateCertificate" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "if_match", "update_certificate_details" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_certificate got unknown kwargs: {extra_kwargs!r}") path_params = { "certificateId": certificate_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=kwargs.get('update_certificate_details'), response_type="Certificate", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=kwargs.get('update_certificate_details'), response_type="Certificate", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_custom_protection_rule(self, custom_protection_rule_id, update_custom_protection_rule_details, **kwargs): """ Updates the configuration of a custom protection rule. Only the fields specified in the request body will be updated; all other properties will remain unchanged. :param str custom_protection_rule_id: (required) The `OCID`__ of the custom protection rule. This number is generated when the custom protection rule is added to the compartment. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.UpdateCustomProtectionRuleDetails update_custom_protection_rule_details: (required) The details of the custom protection rule to update. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.waas.models.CustomProtectionRule` :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_custom_protection_rule.py.html>`__ to see an example of how to use update_custom_protection_rule API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['customProtectionRuleId'] resource_path = "/customProtectionRules/{customProtectionRuleId}" method = "PUT" operation_name = "update_custom_protection_rule" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/CustomProtectionRule/UpdateCustomProtectionRule" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_custom_protection_rule got unknown kwargs: {extra_kwargs!r}") path_params = { "customProtectionRuleId": custom_protection_rule_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_custom_protection_rule_details, response_type="CustomProtectionRule", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_custom_protection_rule_details, response_type="CustomProtectionRule", allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_device_fingerprint_challenge(self, waas_policy_id, update_device_fingerprint_challenge_details, **kwargs): """ 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 - 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.DeviceFingerprintChallenge update_device_fingerprint_challenge_details: (required) The device fingerprint challenge settings to be updated. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_device_fingerprint_challenge.py.html>`__ to see an example of how to use update_device_fingerprint_challenge API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/deviceFingerprintChallenge" method = "PUT" operation_name = "update_device_fingerprint_challenge" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/DeviceFingerprintChallenge/UpdateDeviceFingerprintChallenge" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_device_fingerprint_challenge got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_device_fingerprint_challenge_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_device_fingerprint_challenge_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_good_bots(self, waas_policy_id, good_bots, **kwargs): """ 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`__. __ https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/botmanagement.htm :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.list[GoodBot] good_bots: (required) :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_good_bots.py.html>`__ to see an example of how to use update_good_bots API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/goodBots" method = "PUT" operation_name = "update_good_bots" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/GoodBot/UpdateGoodBots" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_good_bots got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=good_bots, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=good_bots, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_human_interaction_challenge(self, waas_policy_id, update_human_interaction_challenge_details, **kwargs): """ 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.HumanInteractionChallenge update_human_interaction_challenge_details: (required) The human interaction challenge settings. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_human_interaction_challenge.py.html>`__ to see an example of how to use update_human_interaction_challenge API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/humanInteractionChallenge" method = "PUT" operation_name = "update_human_interaction_challenge" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/HumanInteractionChallenge/UpdateHumanInteractionChallenge" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_human_interaction_challenge got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_human_interaction_challenge_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_human_interaction_challenge_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_js_challenge(self, waas_policy_id, update_js_challenge_details, **kwargs): """ 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`__. __ https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/botmanagement.htm :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.JsChallenge update_js_challenge_details: (required) The JavaScript challenge settings to be updated. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_js_challenge.py.html>`__ to see an example of how to use update_js_challenge API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/jsChallenge" method = "PUT" operation_name = "update_js_challenge" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/JsChallenge/UpdateJsChallenge" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_js_challenge got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_js_challenge_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_js_challenge_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_policy_config(self, waas_policy_id, update_policy_config_details, **kwargs): """ Updates the configuration for a WAAS policy. Only the fields specified in the request body will be updated; all other properties will remain unchanged. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.PolicyConfig update_policy_config_details: (required) The new configuration to apply to a WAAS policy. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_policy_config.py.html>`__ to see an example of how to use update_policy_config API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/policyConfig" method = "PUT" operation_name = "update_policy_config" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/PolicyConfig/UpdatePolicyConfig" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_policy_config got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_policy_config_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_policy_config_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_protection_rules(self, waas_policy_id, protection_rules, **kwargs): """ 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`__. 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. __ https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/wafprotectionrules.htm :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.list[ProtectionRuleAction] protection_rules: (required) :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_protection_rules.py.html>`__ to see an example of how to use update_protection_rules API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/protectionRules" method = "PUT" operation_name = "update_protection_rules" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/ProtectionRule/UpdateProtectionRules" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_protection_rules got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=protection_rules, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=protection_rules, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_protection_settings(self, waas_policy_id, update_protection_settings_details, **kwargs): """ 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.ProtectionSettings update_protection_settings_details: (required) The details of the protection settings to be updated. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_protection_settings.py.html>`__ to see an example of how to use update_protection_settings API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/protectionSettings" method = "PUT" operation_name = "update_protection_settings" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/ProtectionSettings/UpdateProtectionSettings" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_protection_settings got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_protection_settings_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_protection_settings_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_threat_feeds(self, waas_policy_id, threat_feeds, **kwargs): """ 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.list[ThreatFeedAction] threat_feeds: (required) A list of threat feeds for which to update the actions. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_threat_feeds.py.html>`__ to see an example of how to use update_threat_feeds API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/threatFeeds" method = "PUT" operation_name = "update_threat_feeds" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/ThreatFeed/UpdateThreatFeeds" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_threat_feeds got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=threat_feeds, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=threat_feeds, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_waas_policy(self, waas_policy_id, update_waas_policy_details, **kwargs): """ 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.UpdateWaasPolicyDetails update_waas_policy_details: (required) The details of the WAAS policy to update. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_waas_policy.py.html>`__ to see an example of how to use update_waas_policy API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}" method = "PUT" operation_name = "update_waas_policy" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WaasPolicy/UpdateWaasPolicy" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_waas_policy got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_waas_policy_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_waas_policy_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_waas_policy_custom_protection_rules(self, waas_policy_id, update_custom_protection_rules_details, **kwargs): """ Updates the action for each specified custom protection rule. Only the `DETECT` and `BLOCK` actions can be set. Disabled rules should not be included in the list. For more information on protection rules, see `WAF Protection Rules`__. __ https://docs.cloud.oracle.com/iaas/Content/WAF/Tasks/wafprotectionrules.htm :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.list[CustomProtectionRuleSetting] update_custom_protection_rules_details: (required) :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_waas_policy_custom_protection_rules.py.html>`__ to see an example of how to use update_waas_policy_custom_protection_rules API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/customProtectionRules" method = "PUT" operation_name = "update_waas_policy_custom_protection_rules" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/CustomProtectionRule/UpdateWaasPolicyCustomProtectionRules" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_waas_policy_custom_protection_rules got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_custom_protection_rules_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_custom_protection_rules_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_waf_address_rate_limiting(self, waas_policy_id, update_waf_address_rate_limiting_details, **kwargs): """ 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.AddressRateLimiting update_waf_address_rate_limiting_details: (required) The address rate limiting settings. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_waf_address_rate_limiting.py.html>`__ to see an example of how to use update_waf_address_rate_limiting API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/addressRateLimiting" method = "PUT" operation_name = "update_waf_address_rate_limiting" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/AddressRateLimiting/UpdateWafAddressRateLimiting" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_waf_address_rate_limiting got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_waf_address_rate_limiting_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_waf_address_rate_limiting_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_waf_config(self, waas_policy_id, update_waf_config_details, **kwargs): """ 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.WafConfig update_waf_config_details: (required) The new Web Application Firewall configuration to apply to a WAAS policy. :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_waf_config.py.html>`__ to see an example of how to use update_waf_config API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig" method = "PUT" operation_name = "update_waf_config" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/WafConfig/UpdateWafConfig" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_waf_config got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_waf_config_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=update_waf_config_details, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) def update_whitelists(self, waas_policy_id, whitelists, **kwargs): """ Updates the list of IP addresses that bypass the Web Application Firewall for a WAAS policy. Supports single IP addresses, subnet masks (CIDR notation) and Address Lists. 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. :param str waas_policy_id: (required) The `OCID`__ of the WAAS policy. __ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm :param oci.waas.models.list[Whitelist] whitelists: (required) :param str opc_request_id: (optional) The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID. :param str opc_retry_token: (optional) 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. :param str if_match: (optional) 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. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. This operation will not retry by default, users can also use the convenient :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` provided by the SDK to enable retries for it. The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__. To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`. :param bool allow_control_chars: (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings :return: A :class:`~oci.response.Response` object with data of type None :rtype: :class:`~oci.response.Response` :example: Click `here <https://docs.cloud.oracle.com/en-us/iaas/tools/python-sdk-examples/2.133.0/waas/update_whitelists.py.html>`__ to see an example of how to use update_whitelists API. """ # Required path and query arguments. These are in camelCase to replace values in service endpoints. required_arguments = ['waasPolicyId'] resource_path = "/waasPolicies/{waasPolicyId}/wafConfig/whitelists" method = "PUT" operation_name = "update_whitelists" api_reference_link = "https://docs.oracle.com/iaas/api/#/en/waas/20181116/Whitelist/UpdateWhitelists" # Don't accept unknown kwargs expected_kwargs = [ "allow_control_chars", "retry_strategy", "opc_request_id", "opc_retry_token", "if_match" ] extra_kwargs = [_key for _key in six.iterkeys(kwargs) if _key not in expected_kwargs] if extra_kwargs: raise ValueError( f"update_whitelists got unknown kwargs: {extra_kwargs!r}") path_params = { "waasPolicyId": waas_policy_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError(f'Parameter {k} cannot be None, whitespace or empty string') header_params = { "accept": "application/json", "content-type": "application/json", "opc-request-id": kwargs.get("opc_request_id", missing), "opc-retry-token": kwargs.get("opc_retry_token", missing), "if-match": kwargs.get("if_match", missing) } header_params = {k: v for (k, v) in six.iteritems(header_params) if v is not missing and v is not None} retry_strategy = self.base_client.get_preferred_retry_strategy( operation_retry_strategy=kwargs.get('retry_strategy'), client_retry_strategy=self.retry_strategy ) if retry_strategy: if not isinstance(retry_strategy, retry.NoneRetryStrategy): self.base_client.add_opc_retry_token_if_needed(header_params) self.base_client.add_opc_client_retries_header(header_params) retry_strategy.add_circuit_breaker_callback(self.circuit_breaker_callback) return retry_strategy.make_retrying_call( self.base_client.call_api, resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=whitelists, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments) else: return self.base_client.call_api( resource_path=resource_path, method=method, path_params=path_params, header_params=header_params, body=whitelists, allow_control_chars=kwargs.get('allow_control_chars'), operation_name=operation_name, api_reference_link=api_reference_link, required_arguments=required_arguments)