a fG@sddlmZddlmZddlmZddlmZmZddlm Z ddl m Z m Z ddl mZddlmZmZmZdd lmZdd lmZd d lmZed ZGdddeZdS))absolute_import)requests)six)retrycircuit_breaker) BaseClient)get_config_value_or_defaultvalidate_config)Signer)Sentinel#get_signer_from_authentication_typeAUTHENTICATION_TYPE_FIELD_NAME)InvalidAlloyConfig)OCI_SDK_ENABLED_SERVICES_SET)vault_type_mappingZMissingc@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZddZddZddZdS) VaultsClientz Use the Secret Management API to manage secrets and secret versions. For more information, see [Managing Secrets](/Content/KeyManagement/Tasks/managingsecrets.htm). c Ks&tdstdt||ddd|vr6|d}nDt|vrHt|}n2t|d|d|d|dt|d |d d }d |d ddi|dd|dt j |dd}d|vr|d|d<|ddurt j |d<d|vr|d|d<t d||t fi||_|d|_|d|_dS)a Creates a new service client :param dict config: Configuration keys and values as per `SDK and Tool Configuration `__. 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 `__ 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 `__. :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 `__. :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. ZvaultaThe 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 servicesigner)rtenancyuser fingerprintZkey_file pass_phraseZ key_content)rrrZprivate_key_file_locationrZprivate_key_contentTservice_endpointz /20180608z/https://vaults.{region}.oci.{secondLevelDomain}skip_deserializationFcircuit_breaker_strategy5client_level_realm_specific_endpoint_template_enabled)Zregional_clientr base_pathZservice_endpoint_templateZ#service_endpoint_template_per_realmrrrtimeoutNallow_control_charsZvaultsretry_strategycircuit_breaker_callback)rZis_service_enabledrr getr r r rrZGLOBAL_CIRCUIT_BREAKER_STRATEGYZ DEFAULT_CIRCUIT_BREAKER_STRATEGYrr base_clientrr )selfZconfigkwargsrZbase_client_init_kwargsr%;/usr/lib/python3.9/site-packages/oci/vault/vaults_client.py__init__sB3         zVaultsClient.__init__c sndg}d}d}d}d}gdfddt|D}|rHtd |d|i} d d t| D} t| D]<\} } | d ust| tjrnt| d krntd| dqndd|dt |dt d} dd t| D} |j j |d|j d} | rHt| t js"|j | | |j| j|j j||| | |d|||d S|j j||| | |d|||dSd S)a Cancels the pending deletion of the specified secret. Canceling a scheduled deletion restores the secret's lifecycle state to what it was before you scheduled the secret for deletion. :param str secret_id: (required) The OCID of the secret. :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 you provide matches the resource's current etag value. :param str opc_request_id: (optional) Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service. :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 `__. 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 `__ to see an example of how to use cancel_secret_deletion API. secretIdz*/secrets/{secretId}/actions/cancelDeletionPOSTcancel_secret_deletionzUhttps://docs.oracle.com/iaas/api/#/en/secretmgmt/20180608/Secret/CancelSecretDeletionrrif_matchopc_request_idcsg|]}|vr|qSr%r%.0Z_keyZexpected_kwargsr%r& z7VaultsClient.cancel_secret_deletion..z+cancel_secret_deletion got unknown kwargs: cSsi|]\}}|tur||qSr%missingr/kvr%r%r& r2z7VaultsClient.cancel_secret_deletion..Nr Parameter + cannot be None, whitespace or empty stringapplication/jsonr,r-accept content-typeif-matchopc-request-idcSs&i|]\}}|tur|dur||qSNr3r5r%r%r&r8r2rZoperation_retry_strategyZclient_retry_strategyr resource_pathmethod path_params header_paramsroperation_nameapi_reference_linkrequired_argumentsriterkeys ValueError iteritems isinstance string_typeslenstripr!r4r"get_preferred_retry_strategyrrNoneRetryStrategyadd_opc_client_retries_headeradd_circuit_breaker_callbackr make_retrying_callcall_apir# secret_idr$rJrDrErHrI extra_kwargsrFr6r7rGrr%r0r&r*wsh)$     z#VaultsClient.cancel_secret_deletionc s~dg}d}d}d}d}gdfddt|D}|rHtd |d|i} d d t| D} t| D]<\} } | d ust| tjrnt| d krntd| dqndd|dt |dt d} dd t| D} |j j |d|j d} | d urt j} | rXt| t js2|j | | |j| j|j j||| | |d|||d S|j j||| | |d|||dSd S)a Cancels the ongoing secret rotation. The cancellation is contingent on how far the rotation process has progressed. Upon cancelling a rotation, all future rotations are also disabled. :param str secret_id: (required) The OCID of the secret. :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 you provide matches the resource's current etag value. :param str opc_request_id: (optional) Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service. :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 `__. 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 `__ to see an example of how to use cancel_secret_rotation API. r(z*/secrets/{secretId}/actions/cancelRotationr)cancel_secret_rotationzUhttps://docs.oracle.com/iaas/api/#/en/secretmgmt/20180608/Secret/CancelSecretRotationr+csg|]}|vr|qSr%r%r.r0r%r&r1r2z7VaultsClient.cancel_secret_rotation..z+cancel_secret_rotation got unknown kwargs: cSsi|]\}}|tur||qSr%r3r5r%r%r&r8!r2z7VaultsClient.cancel_secret_rotation..Nrr9r:r;r,r-r<cSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8-r2rrBrrCrrLrMrNrOrPrQrRr!r4r"rSrrDEFAULT_RETRY_STRATEGYrTrUrVr rWrXrYr%r0r&r\sl)$      z#VaultsClient.cancel_secret_rotationc srddg}d}d}d}d}gdfdd t|D} | rJtd | ||d } d d t| D} t| D]<\} } | dust| tjrrt| dkrrtd| dqrdd|dt |dt d} dd t| D} |j j |d|j d}|rLt|t js&|j | ||j|j|j j||| | |d|||d S|j j||| | |d|||dSdS)a Cancels the scheduled deletion of a secret version. :param str secret_id: (required) The OCID of the secret. :param int secret_version_number: (required) The version number of the secret. :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 you provide matches the resource's current etag value. :param str opc_request_id: (optional) Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service. :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 `__. 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 `__ to see an example of how to use cancel_secret_version_deletion API. r(secretVersionNumberzH/secrets/{secretId}/version/{secretVersionNumber}/actions/cancelDeletionr)cancel_secret_version_deletionzchttps://docs.oracle.com/iaas/api/#/en/secretmgmt/20180608/SecretVersion/CancelSecretVersionDeletionr+csg|]}|vr|qSr%r%r.r0r%r&r1r2z?VaultsClient.cancel_secret_version_deletion..z3cancel_secret_version_deletion got unknown kwargs: r(r_cSsi|]\}}|tur||qSr%r3r5r%r%r&r8r2z?VaultsClient.cancel_secret_version_deletion..Nrr9r:r;r,r-r<cSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8r2rrBrrCrKr#rZsecret_version_numberr$rJrDrErHrIr[rFr6r7rGrr%r0r&r`Osj*$     z+VaultsClient.cancel_secret_version_deletionc sdg}d}d}d}d}gdfddt|D} | rHtd | d|i} d d t| D} t| D]<\} } | d ust| tjrnt| d krntd| dqndd|dt |dt |dt d} dd t| D} |j j |d|j d}|r`t|t js8|j | |j | ||j|j|j j||| | ||d|||d S|j j||| | ||d|||d Sd S)aI Moves a secret into a different compartment within the same tenancy. For information about moving resources between compartments, see `Moving Resources to a Different Compartment`__. When provided, if-match is checked against the ETag values of the secret. __ https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes :param str secret_id: (required) The OCID of the secret. :param oci.vault.models.ChangeSecretCompartmentDetails change_secret_compartment_details: (required) The updated compartment details. :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 you provide matches the resource's current etag value. :param str opc_request_id: (optional) Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service. :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 (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation 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 `__. 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 `__ to see an example of how to use change_secret_compartment API. r(z-/secrets/{secretId}/actions/changeCompartmentr)change_secret_compartmentzXhttps://docs.oracle.com/iaas/api/#/en/secretmgmt/20180608/Secret/ChangeSecretCompartmentrrr,r-opc_retry_tokencsg|]}|vr|qSr%r%r.r0r%r&r1r2z:VaultsClient.change_secret_compartment..z.change_secret_compartment got unknown kwargs: cSsi|]\}}|tur||qSr%r3r5r%r%r&r8 r2z:VaultsClient.change_secret_compartment..Nrr9r:r;r,r-rfr=r>r?r@opc-retry-tokencSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8r2rrBr rDrErFrGbodyrrHrIrJ)rrLrMrNrOrPrQrRr!r4r"rSrrrTadd_opc_retry_token_if_neededrUrVr rWrX)r#rZZ!change_secret_compartment_detailsr$rJrDrErHrIr[rFr6r7rGrr%r0r&rdsp7$       z&VaultsClient.change_secret_compartmentc s"g}d}d}d}d}gdfddt|D}|rFtd|d d |d t|d td } d dt| D} |jj|d|jd} | durt j } | rt | t j s|j | |j| | |j| j|jj||| |d|d|||d S|jj||| |d|d|||d SdS)aC Creates a new secret according to the details of the request. This operation is not supported by the Oracle Cloud Infrastructure Terraform Provider. :param oci.vault.models.CreateSecretDetails create_secret_details: (required) Request to create a new secret. :param str opc_request_id: (optional) Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service. :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 (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation 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 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 `__. 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.vault.models.Secret` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use create_secret API. /secretsr) create_secretzMhttps://docs.oracle.com/iaas/api/#/en/secretmgmt/20180608/Secret/CreateSecret)rrr-rfcsg|]}|vr|qSr%r%r.r0r%r&r1qr2z.VaultsClient.create_secret..z"create_secret got unknown kwargs: r;r-rf)r=r>r@rhcSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8|r2z.VaultsClient.create_secret..rrBNSecretr) rDrErGrj response_typerrHrIrJ)rrLrMr!r4rNr"rSrrr^rOrTrkrUrVr rWrX) r#Zcreate_secret_detailsr$rJrDrErHrIr[rGrr%r0r&rm:sf*       zVaultsClient.create_secretc svdg}d}d}d}d}gdfddt|D}|rHtd |d|i} d d t| D} t| D]<\} } | d ust| tjrnt| d krntd| dqndd|dt d} dd t| D} |j j |d|j d} | d urt j} | rNt| t js&|j | | |j| j|j j||| | d|d|||d S|j j||| | d|d|||d Sd S)a Gets information about the specified secret. :param str secret_id: (required) The OCID of the secret. :param str opc_request_id: (optional) Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service. :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 `__. 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.vault.models.Secret` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use get_secret API. r(/secrets/{secretId}GET get_secretzJhttps://docs.oracle.com/iaas/api/#/en/secretmgmt/20180608/Secret/GetSecretrrr-csg|]}|vr|qSr%r%r.r0r%r&r1r2z+VaultsClient.get_secret..zget_secret got unknown kwargs: cSsi|]\}}|tur||qSr%r3r5r%r%r&r8r2z+VaultsClient.get_secret..Nrr9r:r;r-r=r>r@cSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8r2rrBrnr rDrErFrGrorrHrIrJr]rYr%r0r&rrsn $    zVaultsClient.get_secretc szddg}d}d}d}d}gdfdd t|D} | rJtd | ||d } d d t| D} t| D]<\} } | dust| tjrrt| dkrrtd| dqrdd|dt d} dd t| D} |j j |d|j d}|durt j}|rRt|t js*|j | ||j|j|j j||| | d|d|||d S|j j||| | d|d|||d SdS)a) Gets information about the specified version of a secret. :param str secret_id: (required) The OCID of the secret. :param int secret_version_number: (required) The version number of the secret. :param str opc_request_id: (optional) Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service. :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 `__. 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.vault.models.SecretVersion` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use get_secret_version API. r(r_z1/secrets/{secretId}/version/{secretVersionNumber}rqget_secret_versionzXhttps://docs.oracle.com/iaas/api/#/en/secretmgmt/20180608/SecretVersion/GetSecretVersionrscsg|]}|vr|qSr%r%r.r0r%r&r14r2z3VaultsClient.get_secret_version..z'get_secret_version got unknown kwargs: racSsi|]\}}|tur||qSr%r3r5r%r%r&r8>r2z3VaultsClient.get_secret_version..Nrr9r:r;r-rtcSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8Ir2rrBZ SecretVersionrrur]rbr%r0r&rvsp#$    zVaultsClient.get_secret_versionc sdg}d}d}d}d}gdfddt|D}|rHtd |d|i} d d t| D} t| D]<\} } | d ust| tjrnt| d krntd| dqnd|vrdg} |d| vrtd| d|vrddg} |d| vrtd| |dt |dt |dt |dt d}dd t|D}dd|dt d}dd t|D}|j j |d|j d }|d urt j}|rt|t js|j |||j|j|j j||| ||d!|d"|||d# S|j j||| ||d!|d"|||d# Sd S)$a Lists all secret versions for the specified secret. :param str secret_id: (required) The OCID of the secret. :param int limit: (optional) The maximum number of items to return in a paginated "List" call. :param str page: (optional) The value of the `opc-next-page` response header from the previous "List" call. :param str opc_request_id: (optional) Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service. :param str sort_by: (optional) The field to sort by. Only one sort order may be provided. Time created is default ordered as descending. Display name is default ordered as ascending. Allowed values are: "VERSION_NUMBER" :param str sort_order: (optional) The sort order to use, either ascending (`ASC`) or descending (`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 `__. 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.vault.models.SecretVersionSummary` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use list_secret_versions API. r(z/secrets/{secretId}/versionsrqlist_secret_versionszahttps://docs.oracle.com/iaas/api/#/en/secretmgmt/20180608/SecretVersionSummary/ListSecretVersions)rrlimitpager-sort_by sort_ordercsg|]}|vr|qSr%r%r.r0r%r&r1r2z5VaultsClient.list_secret_versions..z)list_secret_versions got unknown kwargs: cSsi|]\}}|tur||qSr%r3r5r%r%r&r8r2z5VaultsClient.list_secret_versions..Nrr9r:rzZVERSION_NUMBER,Invalid value for `sort_by`, must be one of r{ASCDESC/Invalid value for `sort_order`, must be one of rxry)rxrysortBy sortOrdercSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8r2r;r-rtcSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8r2rrBzlist[SecretVersionSummary]r) rDrErF query_paramsrGrorrHrIrJr])r#rZr$rJrDrErHrIr[rFr6r7sort_by_allowed_valuessort_order_allowed_valuesrrGrr%r0r&rwms1 $           z!VaultsClient.list_secret_versionsc sdg}d}d}d}d}gdfddt|D}|rHtd |d |vrrd d g} |d | vrrtd | d|vrddg} |d| vrtd| d|vrgd} |d| vrtd| ||dt|dt|dt|d t|dt|dt|dtd} ddt| D} dd|dtd} ddt| D} |jj|d |jd!}|d"urxt j }|rt |t j s|j | ||j|j|jj||| | d#|d$|||d% S|jj||| | d#|d$|||d% Sd"S)&am Lists all secrets in the specified vault and compartment. :param str compartment_id: (required) The OCID of the compartment. :param str name: (optional) The secret name. :param int limit: (optional) The maximum number of items to return in a paginated "List" call. :param str page: (optional) The value of the `opc-next-page` response header from the previous "List" call. :param str opc_request_id: (optional) Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service. :param str sort_by: (optional) The field to sort by. You can specify only one sort order. The default order for `TIMECREATED` is descending. The default order for `NAME` is ascending. Allowed values are: "TIMECREATED", "NAME" :param str sort_order: (optional) The sort order to use, either ascending (`ASC`) or descending (`DESC`). Allowed values are: "ASC", "DESC" :param str vault_id: (optional) The OCID of the vault. :param str lifecycle_state: (optional) A filter that returns only resources that match the specified lifecycle state. The state value is case-insensitive. Allowed values are: "CREATING", "ACTIVE", "UPDATING", "DELETING", "DELETED", "SCHEDULING_DELETION", "PENDING_DELETION", "CANCELLING_DELETION", "FAILED" :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 `__. 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.vault.models.SecretSummary` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use list_secrets API. compartmentIdrlrq list_secretszShttps://docs.oracle.com/iaas/api/#/en/secretmgmt/20180608/SecretSummary/ListSecrets) rrnamerxryr-rzr{vault_idlifecycle_statecsg|]}|vr|qSr%r%r.r0r%r&r1Nr2z-VaultsClient.list_secrets..z!list_secrets got unknown kwargs: rzZ TIMECREATEDNAMEr|r{r}r~rr) ZCREATINGZACTIVEZUPDATINGZDELETINGZDELETEDZSCHEDULING_DELETIONZPENDING_DELETIONZCANCELLING_DELETIONZFAILEDz4Invalid value for `lifecycle_state`, must be one of rrxryr)rrrxryrrZvaultIdZlifecycleStatecSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8rr2z-VaultsClient.list_secrets..r;r-rtcSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8yr2rrBNzlist[SecretSummary]r) rDrErrGrorrHrIrJ)rrLrMr!r4rNr"rSrrr^rOrTrUrVr rWrX)r#Zcompartment_idr$rJrDrErHrIr[rrZlifecycle_state_allowed_valuesrrGrr%r0r&rs=                 zVaultsClient.list_secretsc sdg}d}d}d}d}gdfddt|D}|rHtd |d|i} d d t| D} t| D]<\} } | d ust| tjrnt| d krntd| dqndd|dt |dt |dt d} dd t| D} |j j |d|j d} | d urt j} | rnt| t jsH|j | |j | | |j| j|j j||| | |d|||d S|j j||| | |d|||dSd S)av API to force rotation of an existing secret in Vault and the specified target system; expects secret to have a valid Target System Details object :param str secret_id: (required) The OCID of the secret. :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 you provide matches the resource's current etag value. :param str opc_request_id: (optional) Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service. :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 (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation 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 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 `__. 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 `__ to see an example of how to use rotate_secret API. r(z"/secrets/{secretId}/actions/rotater) rotate_secretzMhttps://docs.oracle.com/iaas/api/#/en/secretmgmt/20180608/Secret/RotateSecretrecsg|]}|vr|qSr%r%r.r0r%r&r1r2z.VaultsClient.rotate_secret..z"rotate_secret got unknown kwargs: cSsi|]\}}|tur||qSr%r3r5r%r%r&r8r2z.VaultsClient.rotate_secret..Nrr9r:r;r,r-rfrgcSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8r2rrBrrC)rrLrMrNrOrPrQrRr!r4r"rSrrr^rTrkrUrVr rWrXrYr%r0r&rsp/$        zVaultsClient.rotate_secretc srdg}d}d}d}d}gdfddt|D} | rHtd | d|i} d d t| D} t| D]<\} } | d ust| tjrnt| d krntd| dqndd|dt |dt d} dd t| D} |j j |d|j d}|rJt|t js"|j | ||j|j|j j||| | ||d|||d S|j j||| | ||d|||d Sd S)a Schedules the deletion of the specified secret. This sets the lifecycle state of the secret to `PENDING_DELETION` and then deletes it after the specified retention period ends. :param str secret_id: (required) The OCID of the secret. :param oci.vault.models.ScheduleSecretDeletionDetails schedule_secret_deletion_details: (required) Request to schedule the deletion of a secret. :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 you provide matches the resource's current etag value. :param str opc_request_id: (optional) Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service. :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 `__. 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 `__ to see an example of how to use schedule_secret_deletion API. r(z,/secrets/{secretId}/actions/scheduleDeletionr)schedule_secret_deletionzWhttps://docs.oracle.com/iaas/api/#/en/secretmgmt/20180608/Secret/ScheduleSecretDeletionr+csg|]}|vr|qSr%r%r.r0r%r&r1Kr2z9VaultsClient.schedule_secret_deletion..z-schedule_secret_deletion got unknown kwargs: cSsi|]\}}|tur||qSr%r3r5r%r%r&r8Tr2z9VaultsClient.schedule_secret_deletion..Nrr9r:r;r,r-r<cSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8`r2rrBrrirK)r#rZZ schedule_secret_deletion_detailsr$rJrDrErHrIr[rFr6r7rGrr%r0r&rsl+$     z%VaultsClient.schedule_secret_deletionc svddg}d}d}d}d} gdfdd t|D} | rJtd | ||d } d d t| D} t| D]<\} } | dust| tjrrt| dkrrtd| dqrdd|dt |dt d}dd t|D}|j j |d|j d}|rNt|t js&|j |||j|j|j j||| |||d|| |d S|j j||| |||d|| |d SdS)a< Schedules the deletion of the specified secret version. This deletes it after the specified retention period ends. You can only delete a secret version if the secret version rotation state is marked as `DEPRECATED`. :param str secret_id: (required) The OCID of the secret. :param int secret_version_number: (required) The version number of the secret. :param oci.vault.models.ScheduleSecretVersionDeletionDetails schedule_secret_version_deletion_details: (required) Request to delete a secret version. :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 you provide matches the resource's current etag value. :param str opc_request_id: (optional) Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service. :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 `__. 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 `__ to see an example of how to use schedule_secret_version_deletion API. r(r_zJ/secrets/{secretId}/version/{secretVersionNumber}/actions/scheduleDeletionr) schedule_secret_version_deletionzehttps://docs.oracle.com/iaas/api/#/en/secretmgmt/20180608/SecretVersion/ScheduleSecretVersionDeletionr+csg|]}|vr|qSr%r%r.r0r%r&r1r2zAVaultsClient.schedule_secret_version_deletion..z5schedule_secret_version_deletion got unknown kwargs: racSsi|]\}}|tur||qSr%r3r5r%r%r&r8r2zAVaultsClient.schedule_secret_version_deletion..Nrr9r:r;r,r-r<cSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8r2rrBrrirK)r#rZrcZ(schedule_secret_version_deletion_detailsr$rJrDrErHrIr[rFr6r7rGrr%r0r&rsn.$     z-VaultsClient.schedule_secret_version_deletionc svdg}d}d}d}d}gdfddt|D} | rHtd | d|i} d d t| D} t| D]<\} } | d ust| tjrnt| d krntd| dqndd|dt |dt d} dd t| D} |j j |d|j d}|rLt|t js"|j | ||j|j|j j||| | |d|d|||d S|j j||| | |d|d|||d Sd S)a> Updates the properties of a secret. Specifically, you can update the version number of the secret to make that version number the current version. You can also update a secret's description, its free-form or defined tags, rules and the secret contents. Updating the secret content automatically creates a new secret version. You cannot, however, update the current secret version number, secret contents, and secret rules at the same time. Furthermore, the secret must in an `ACTIVE` lifecycle state to be updated. This operation is not supported by the Oracle Cloud Infrastructure Terraform Provider. :param str secret_id: (required) The OCID of the secret. :param oci.vault.models.UpdateSecretDetails update_secret_details: (required) Request to update a secret. :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 you provide matches the resource's current etag value. :param str opc_request_id: (optional) Unique identifier for the request. If provided, the returned request ID will include this value. Otherwise, a random request ID will be generated by the service. :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 `__. 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.vault.models.Secret` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use update_secret API. r(rpZPUT update_secretzMhttps://docs.oracle.com/iaas/api/#/en/secretmgmt/20180608/Secret/UpdateSecretr+csg|]}|vr|qSr%r%r.r0r%r&r11r2z.VaultsClient.update_secret..z"update_secret got unknown kwargs: cSsi|]\}}|tur||qSr%r3r5r%r%r&r8:r2z.VaultsClient.update_secret..Nrr9r:r;r,r-r<cSs&i|]\}}|tur|dur||qSrAr3r5r%r%r&r8Fr2rrBrnr) rDrErFrGrjrorrHrIrJrK)r#rZZupdate_secret_detailsr$rJrDrErHrIr[rFr6r7rGrr%r0r&rsp/$     zVaultsClient.update_secretN)__name__ __module__ __qualname____doc__r'r*r\r`rdrmrrrvrwrrrrrr%r%r%r&rs"[kmm~gdh vosrN)Z __future__rZ oci._vendorrrZocirrZoci.base_clientrZ oci.configrr Z oci.signerr Zoci.utilr r r Zoci.exceptionsrZ oci.alloyrZmodelsrr4objectrr%r%r%r&s