a Ofxv@sddlmZddlmZddlmZddlmZmZddlm Z ddl m Z m Z ddl mZddlmZmZmZdd lmZmZd d lmZed ZGd ddeZdS))absolute_import)requests)six)retrycircuit_breaker) BaseClient)get_config_value_or_defaultvalidate_config)Signer)Sentinel#get_signer_from_authentication_typeAUTHENTICATION_TYPE_FIELD_NAME),back_up_body_calculate_stream_content_length(is_content_length_calculable_by_req_util)key_management_type_mappingMissingc@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ ddZ ddZddZddZddZddZd S)!KmsVaultClientz API for managing and performing operations with keys and vaults. (For the API for managing secrets, see the Vault Service Secret Management API. For the API for retrieving secrets, see the Vault Service Secret Retrieval API.) c Ks t||ddd|vr$|d}nDt|vr6t|}n2t|d|d|d|dt|d|dd }d |d d d |dd|dtjd}d|vr|d|d<|ddurtj|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 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. signer)rtenancyuser fingerprintkey_file pass_phrase key_content)rrrprivate_key_file_locationrprivate_key_contentTservice_endpoint/z(https://kms.{region}.{secondLevelDomain}skip_deserializationFcircuit_breaker_strategy)regional_clientr base_pathservice_endpoint_templaterr timeoutNallow_control_chars kms_vaultretry_strategycircuit_breaker_callback)r getr r r rrGLOBAL_CIRCUIT_BREAKER_STRATEGY DEFAULT_CIRCUIT_BREAKER_STRATEGYrr base_clientr'r()selfconfigkwargsrbase_client_init_kwargsr1/sparta/input/_build_configuration/image_build+validate/lib/bmcenv/lib64/python3.9/site-packages/oci/key_management/kms_vault_client.py__init__s:0       zKmsVaultClient.__init__c sd}d}d}d}gdfddt|D}|rBtd|d |i}d d t|D}t|D]:\} } | d ust| tjrht| d krhtd| qhdd| dt | dt | dt d} dd t| D} |j j | d|j d} | r^t| tjs0|j | |j | | |j| j|j j|||| | dd| d||d S|j j|||| | dd| d||d Sd S)a Backs up an encrypted file that contains all the metadata of a vault so that you can restore the vault later. You can backup a vault whether or not it contains keys. This operation only backs up the metadata of the vault, and does not include key metadata. :param str vault_id: (required) The OCID of the vault. :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 oci.key_management.models.BackupVaultDetails backup_vault_details: (optional) BackupVaultDetails :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.key_management.models.Vault` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use backup_vault API. z)/20180608/vaults/{vaultId}/actions/backupPOST backup_vault)r%r'if_matchopc_request_idopc_retry_tokenbackup_vault_detailscsg|]}|vr|qSr1r1.0_keyexpected_kwargsr1r2 z/KmsVaultClient.backup_vault..z%backup_vault got unknown kwargs: {!r}vaultIdcSsi|]\}}|tur||qSr1missingr<kvr1r1r2 rAz/KmsVaultClient.backup_vault..Nr7Parameter {} cannot be None, whitespace or empty stringapplication/jsonr7r8r9accept content-typeif-matchopc-request-idopc-retry-tokencSs&i|]\}}|tur|dur||qSNrCrEr1r1r2rHrAr'operation_retry_strategyclient_retry_strategyr:Vaultr% resource_pathmethod path_params header_paramsbody response_typer%operation_nameapi_reference_linkriterkeys ValueErrorformat iteritems isinstance string_typeslenstripr)rDr,get_preferred_retry_strategyr'rNoneRetryStrategyadd_opc_retry_token_if_neededadd_opc_client_retries_headeradd_circuit_breaker_callbackr(make_retrying_callcall_api r-vault_idr/rWrXr]r^ extra_kwargsrYrFrGrZr'r1r>r2r5msn3$       zKmsVaultClient.backup_vaultc s|d}d}d}d}gdfddt|D}|rBtd|d |i}d d t|D}t|D]:\} } | d ust| tjrht| d krhtd| qhdd| dt | dt | dt d} dd t| D} |j j | d|j d} | rVt| tjs0|j | |j | | |j| j|j j|||| d| d||d S|j j|||| d| d||dSd S)a Cancels the scheduled deletion of the specified vault. Canceling a scheduled deletion restores the vault and all keys in it to their respective states from before their scheduled deletion. All keys that were scheduled for deletion prior to vault deletion retain their lifecycle state and time of deletion. As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning write operations exceeds 10 requests per second for a given tenancy. :param str vault_id: (required) The OCID of the vault. :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 :class:`~oci.key_management.models.Vault` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use cancel_vault_deletion API. z1/20180608/vaults/{vaultId}/actions/cancelDeletionr4cancel_vault_deletionr6r%r'r7r8r9csg|]}|vr|qSr1r1r;r>r1r2r@*rAz8KmsVaultClient.cancel_vault_deletion..z.cancel_vault_deletion got unknown kwargs: {!r}rBcSsi|]\}}|tur||qSr1rCrEr1r1r2rH3rAz8KmsVaultClient.cancel_vault_deletion..NrrIrJr7r8r9rKcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rH@rAr'rRrUr%rWrXrYrZr\r%r]r^r_ror1r>r2rrsj6$       z$KmsVaultClient.cancel_vault_deletionc s|d}d}d}d}gdfddt|D}|rBtd|d |i} d d t| D} t| D]:\} } | d ust| tjrht| d krhtd| qhdd| dt | dt | dt d} dd t| D} |j j | d|j d} | rVt| tjs0|j | |j | | |j| j|j j||| | || d||d S|j j||| | || d||dSd S)a Moves a vault 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 resource. As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning write operations exceeds 10 requests per second for a given tenancy. __ https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes :param str vault_id: (required) The OCID of the vault. :param oci.key_management.models.ChangeVaultCompartmentDetails change_vault_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 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_vault_compartment API. z4/20180608/vaults/{vaultId}/actions/changeCompartmentr4change_vault_compartmentr6rscsg|]}|vr|qSr1r1r;r>r1r2r@rAz;KmsVaultClient.change_vault_compartment..z1change_vault_compartment got unknown kwargs: {!r}rBcSsi|]\}}|tur||qSr1rCrEr1r1r2rHrAz;KmsVaultClient.change_vault_compartment..NrrIrJr7r8r9rKcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHrAr'rRr%rWrXrYrZr[r%r]r^r_)r-rp change_vault_compartment_detailsr/rWrXr]r^rqrYrFrGrZr'r1r>r2ruasj:$       z'KmsVaultClient.change_vault_compartmentc s d}d}d}d}gdfddt|D}|rBtd|d d |d t|d td }d dt|D}|jj|d|j d} | rt | t j s|j ||j|| |j| j|jj||||d|d||d S|jj||||d|d||dSdS)a Creates a new vault. The type of vault you create determines key placement, pricing, and available options. Options include storage isolation, a dedicated service endpoint instead of a shared service endpoint for API calls, and either a dedicated hardware security module (HSM) or a multitenant HSM. As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning write operations exceeds 10 requests per second for a given tenancy. :param oci.key_management.models.CreateVaultDetails create_vault_details: (required) CreateVaultDetails :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 :class:`~oci.key_management.models.Vault` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use create_vault API. /20180608/vaultsr4 create_vaultr6)r%r'r8r9csg|]}|vr|qSr1r1r;r>r1r2r@rAz/KmsVaultClient.create_vault..z%create_vault got unknown kwargs: {!r}rJr8r9)rLrMrOrPcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rH%rAz/KmsVaultClient.create_vault..r'rRrUr%)rWrXrZr[r\r%r]r^N)rr`rarbr)rDrcr,rhr'rdrrirjrkrlr(rmrn) r-create_vault_detailsr/rWrXr]r^rqrZr'r1r>r2rys\/       zKmsVaultClient.create_vaultc s|d}d}d}d}gdfddt|D}|rBtd|d |i} d d t| D} t| D]:\} } | d ust| tjrht| d krhtd| qhdd| dt | dt | dt d} dd t| D} |j j | d|j d} | rVt| tjs0|j | |j | | |j| j|j j||| | || d||d S|j j||| | || d||dSd S)a Creates a replica for the vault in another region in the same realm The API is a no-op if called for same region that a vault is already replicated to. 409 if called on a vault that is already replicated to a different region. Users need to delete existing replica first before calling it with a different region. As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning write operations exceeds 10 requests per second for a given tenancy. :param str vault_id: (required) The OCID of the vault. :param oci.key_management.models.CreateVaultReplicaDetails create_vault_replica_details: (required) CreateVaultReplicaDetails :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 create_vault_replica API. z0/20180608/vaults/{vaultId}/actions/createReplicar4create_vault_replicar6rscsg|]}|vr|qSr1r1r;r>r1r2r@rAz7KmsVaultClient.create_vault_replica..z-create_vault_replica got unknown kwargs: {!r}rBcSsi|]\}}|tur||qSr1rCrEr1r1r2rHrAz7KmsVaultClient.create_vault_replica..NrrIrJr7r8r9rKcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHrAr'rRr%rvr_)r-rpcreate_vault_replica_detailsr/rWrXr]r^rqrYrFrGrZr'r1r>r2r{Fsj:$       z#KmsVaultClient.create_vault_replicac s|d}d}d}d}gdfddt|D}|rBtd|d |i} d d t| D} t| D]:\} } | d ust| tjrht| d krhtd| qhdd| dt | dt | dt d} dd t| D} |j j | d|j d} | rVt| tjs0|j | |j | | |j| j|j j||| | || d||d S|j j||| | || d||dSd S)aV Deletes a vault replica As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning write operations exceeds 10 requests per second for a given tenancy. :param str vault_id: (required) The OCID of the vault. :param oci.key_management.models.DeleteVaultReplicaDetails delete_vault_replica_details: (required) DeleteVaultReplicaDetails :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 delete_vault_replica API. z0/20180608/vaults/{vaultId}/actions/deleteReplicar4delete_vault_replicar6rscsg|]}|vr|qSr1r1r;r>r1r2r@rAz7KmsVaultClient.delete_vault_replica..z-delete_vault_replica got unknown kwargs: {!r}rBcSsi|]\}}|tur||qSr1rCrEr1r1r2rHrAz7KmsVaultClient.delete_vault_replica..NrrIrJr7r8r9rKcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHrAr'rRr%rvr_)r-rpdelete_vault_replica_detailsr/rWrXr]r^rqrYrFrGrZr'r1r>r2r}sj6$       z#KmsVaultClient.delete_vault_replicac s\d}d}d}d}gdfddt|D}|rBtd|d |i}d d t|D}t|D]:\} } | d ust| tjrht| d krhtd| qhdd| dt d} dd t| D} |j j | d|j d} | r6t| tjs|j | | |j| j|j j|||| d| d||d S|j j|||| d| d||dSd S)ag Gets the specified vault's configuration information. As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning read operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning read operations exceeds 10 requests per second for a given tenancy. :param str vault_id: (required) The OCID of the vault. :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.key_management.models.Vault` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use get_vault API. /20180608/vaults/{vaultId}GET get_vaultr6r%r'r8csg|]}|vr|qSr1r1r;r>r1r2r@mrAz,KmsVaultClient.get_vault..z"get_vault got unknown kwargs: {!r}rBcSsi|]\}}|tur||qSr1rCrEr1r1r2rHvrAz,KmsVaultClient.get_vault..NrrIrJr8rLrMrOcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHrAr'rRrUr%rtrr`rarbrcrdrerfrgr)rDr,rhr'rrirkrlr(rmrnror1r>r2r>sd$$    zKmsVaultClient.get_vaultc s\d}d}d}d}gdfddt|D}|rBtd|d |i}d d t|D}t|D]:\} } | d ust| tjrht| d krhtd| qhdd| dt d} dd t| D} |j j | d|j d} | r6t| tjs|j | | |j| j|j j|||| d| d||d S|j j|||| d| d||dSd S)a4 Gets the count of keys and key versions in the specified vault to calculate usage against service limits. :param str vault_id: (required) The OCID of the vault. :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.key_management.models.VaultUsage` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use get_vault_usage API. z /20180608/vaults/{vaultId}/usagerget_vault_usager6rcsg|]}|vr|qSr1r1r;r>r1r2r@rAz2KmsVaultClient.get_vault_usage..z(get_vault_usage got unknown kwargs: {!r}rBcSsi|]\}}|tur||qSr1rCrEr1r1r2rHrAz2KmsVaultClient.get_vault_usage..NrrIrJr8rcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHrAr'rR VaultUsager%rtrror1r>r2rsd$    zKmsVaultClient.get_vault_usagec sd}d}d}d}gdfddt|D}|rBtd|d |i}d d t|D}t|D]:\} } | d ust| tjrht| d krhtd| qhd|vrddg} |d| vrtd| d|vrddg} |d| vrtd| | dt | dt | dt | dt d} dd t| D} dd| dt | dt | dt d}d d t|D}|j j | d!|j d"}|rt|tjs|j ||j |||j|j|j j|||| |d#| d$||d% S|j j|||| |d#| d$||d% Sd S)&a Lists the replicas for a vault As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning write operations exceeds 10 requests per second for a given tenancy. :param str vault_id: (required) The OCID of the vault. :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 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 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 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 `DISPLAYNAME` is ascending. Allowed values are: "TIMECREATED", "DISPLAYNAME" :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 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 list of :class:`~oci.key_management.models.VaultReplicaSummary` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use list_vault_replicas API. z//20180608/vaults/{vaultId}/actions/listReplicasrlist_vault_replicasr6) r%r'r7limitpager8r9sort_by sort_ordercsg|]}|vr|qSr1r1r;r>r1r2r@VrAz6KmsVaultClient.list_vault_replicas..z,list_vault_replicas got unknown kwargs: {!r}rBcSsi|]\}}|tur||qSr1rCrEr1r1r2rH_rAz6KmsVaultClient.list_vault_replicas..NrrIr TIMECREATED DISPLAYNAME/Invalid value for `sort_by`, must be one of {0}rASCDESC2Invalid value for `sort_order`, must be one of {0}rr)rrsortBy sortOrdercSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHyrArJr7r8r9rKcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHrAr'rRzlist[VaultReplicaSummary]r%) rWrXrY query_paramsrZr\r%r]r^r_)r-rpr/rWrXr]r^rqrYrFrGsort_by_allowed_valuessort_order_allowed_valuesrrZr'r1r>r2rsF $             z"KmsVaultClient.list_vault_replicasc sd}d}d}d}gdfddt|D}|rBtd|d |vrld d g}|d |vrltd |d |vrddg} |d | vrtd| ||dt|dt|d t|d td} ddt| D} dd|dtd} ddt| D} |jj|d|j d} | rlt | t j sF|j | | |j| j|jj||| | d|d||d S|jj||| | d|d||dSdS) aX Lists the vaults in the specified compartment. As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning read operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning read operations exceeds 10 requests per second for a given tenancy. :param str compartment_id: (required) The OCID of the compartment. :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 `DISPLAYNAME` is ascending. Allowed values are: "TIMECREATED", "DISPLAYNAME" :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 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 list of :class:`~oci.key_management.models.VaultSummary` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use list_vaults API. rxr list_vaultsr6)r%r'rrr8rrcsg|]}|vr|qSr1r1r;r>r1r2r@rAz.KmsVaultClient.list_vaults..z$list_vaults got unknown kwargs: {!r}rrrrrrrrrr) compartmentIdrrrrcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHrAz.KmsVaultClient.list_vaults..rJr8rcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rH rAr'rRzlist[VaultSummary]r%)rWrXrrZr\r%r]r^N)rr`rarbr)rDrcr,rhr'rdrrirkrlr(rmrn) r-compartment_idr/rWrXr]r^rqrrrrZr'r1r>r2rs~7           zKmsVaultClient.list_vaultsc s(d}d}d}d}gdfddt|D}|rBtd|d |i} d d t| D} d |d t|dt|dt|dt|dtd} dd t| D} z|Wnty|dt}Yn0|tur|durt|tj tj fst |dst dt |drPt |drP|j dkrPtj|dkrd| d<n8d| vrt|st||d} | d | d<| d}|jj|d |jd!} | rt| tjs|j| |j| | |j| j|jj||| | |d"|d#||d$ S|jj||| | |d"|d#||d$ SdS)%a Restores a vault from an encrypted backup file. If a vault with the same OCID already exists, this operation returns a response with a 409 HTTP status error code. :param str compartment_id: (required) The OCID of the compartment. :param stream restore_vault_from_file_details: (required) The encrypted backup file to upload to restore the vault. :param int content_length: (optional) The content length of the body. :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 content_md5: (optional) The base64-encoded MD5 hash value of the body, as described in `RFC 2616`__, section 14.15. If the Content-MD5 header is present, Key Management performs an integrity check on the body of the HTTP request by computing the MD5 hash for the body and comparing it to the MD5 hash supplied in the header. If the two hashes don't match, the object is rejected and a response with 400 Unmatched Content MD5 error is returned, along with the message: "The computed MD5 of the request body (ACTUAL_MD5) does not match the Content-MD5 header (HEADER_MD5)." __ https://tools.ietf.org/rfc/rfc2616 :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 :param int buffer_limit: (optional) A buffer limit for the stream to be buffered. buffer_limit is used to set the buffer size capacity. Streams will be read until the size of the buffer reaches the buffer_limit. If the stream size is greater than the buffer_limit, a BufferError exception will be thrown. The buffer_limit parameter is used when the stream object does not have a `seek`, `tell`, or `fileno` property for the Python Request library to calculate out the content length. If buffer_limit is not passed, then the buffer_limit will be defaulted to 100MB. Large streams can cause the process to freeze, consider passing in content-length for large streams instead. :return: A :class:`~oci.response.Response` object with data of type :class:`~oci.key_management.models.Vault` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use restore_vault_from_file API. z(/20180608/vaults/actions/restoreFromFiler4restore_vault_from_filer6)r%r' buffer_limitcontent_lengthr7 content_md5r8r9csg|]}|vr|qSr1r1r;r>r1r2r@rAz:KmsVaultClient.restore_vault_from_file..z0restore_vault_from_file got unknown kwargs: {!r}rcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHrAz:KmsVaultClient.restore_vault_from_file..rJrr7rr8r9)rLzcontent-lengthrNz content-md5rOrPcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHrArestore_vault_from_file_detailsNreadz=The body must be a string, bytes, or provide a read() method.filenonamezr0zContent-Lengthr byte_contentr'rRrUr% rWrXrrZr[r\r%r]r^)rr`rarbrcr)rD NameErrorrd binary_typerehasattr TypeErrorrrutils super_lenrrr,rhr'rrirjrkrlr(rmrn) r-rrr/rWrXr]r^rqrrZcalculated_objr'r1r>r2r,sF       $      z&KmsVaultClient.restore_vault_from_filec sDd}d}d}d}gdfddt|D}|rBtd|d |i}d d t|D}d d |d t|dt|dtd} dd t| D} |jj|d|j d} | rt | t j s|j | |j| | |j| j|jj|||| |dd|d||d S|jj|||| |dd|d||d SdS)a Restores a vault from an encrypted backup file stored in Oracle Cloud Infrastructure Object Storage. If a vault with the same OCID already exists, this operation returns a response with a 409 HTTP status error code. :param str compartment_id: (required) The OCID of the compartment. :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 oci.key_management.models.RestoreVaultFromObjectStoreDetails restore_vault_from_object_store_details: (optional) RestoreVaultFromObjectStoreDetails :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.key_management.models.Vault` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use restore_vault_from_object_store API. z//20180608/vaults/actions/restoreFromObjectStorer4restore_vault_from_object_storer6)r%r'r7r8r9'restore_vault_from_object_store_detailscsg|]}|vr|qSr1r1r;r>r1r2r@ rAzBKmsVaultClient.restore_vault_from_object_store..z8restore_vault_from_object_store got unknown kwargs: {!r}rcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHrAzBKmsVaultClient.restore_vault_from_object_store..rJr7r8r9rKcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHrAr'rRrrUr%rN)rr`rarbrcr)rDr,rhr'rdrrirjrkrlr(rmrn) r-rr/rWrXr]r^rqrrZr'r1r>r2rsh3        z.KmsVaultClient.restore_vault_from_object_storec sd}d}d}d}gdfddt|D}|rBtd|d |i} d d t| D} t| D]:\} } | d ust| tjrht| d krhtd| qhdd| dt | dt | dt d} dd t| D} |j j | d|j d} | rXt| tjs0|j | |j | | |j| j|j j||| | |d| d||d S|j j||| | |d| d||d Sd S)an Schedules the deletion of the specified vault. This sets the lifecycle state of the vault and all keys in it that are not already scheduled for deletion to `PENDING_DELETION` and then deletes them after the retention period ends. The lifecycle state and time of deletion for keys already scheduled for deletion won't change. If any keys in the vault are scheduled to be deleted after the specified time of deletion for the vault, the call is rejected with the error code 409. As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning write operations exceeds 10 requests per second for a given tenancy. :param str vault_id: (required) The OCID of the vault. :param oci.key_management.models.ScheduleVaultDeletionDetails schedule_vault_deletion_details: (required) ScheduleVaultDeletionDetails :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 :class:`~oci.key_management.models.Vault` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use schedule_vault_deletion API. z3/20180608/vaults/{vaultId}/actions/scheduleDeletionr4schedule_vault_deletionr6rscsg|]}|vr|qSr1r1r;r>r1r2r@rAz:KmsVaultClient.schedule_vault_deletion..z0schedule_vault_deletion got unknown kwargs: {!r}rBcSsi|]\}}|tur||qSr1rCrEr1r1r2rHrAz:KmsVaultClient.schedule_vault_deletion..NrrIrJr7r8r9rKcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHrAr'rRrUr%rVr_)r-rpschedule_vault_deletion_detailsr/rWrXr]r^rqrYrFrGrZr'r1r>r2rAsn:$       z&KmsVaultClient.schedule_vault_deletionc sjd}d}d}d}gdfddt|D}|rBtd|d |i} d d t| D} t| D]:\} } | d ust| tjrht| d krhtd| qhdd| dt | dt d} dd t| D} |j j | d|j d} | rBt| tjs|j | | |j| j|j j||| | |d| d||d S|j j||| | |d| d||d Sd S)a% Updates the properties of a vault. Specifically, you can update the `displayName`, `freeformTags`, and `definedTags` properties. Furthermore, the vault must be in an ACTIVE or CREATING state to be updated. As a provisioning operation, this call is subject to a Key Management limit that applies to the total number of requests across all provisioning write operations. Key Management might throttle this call to reject an otherwise valid request when the total rate of provisioning write operations exceeds 10 requests per second for a given tenancy. :param str vault_id: (required) The OCID of the vault. :param oci.key_management.models.UpdateVaultDetails update_vault_details: (required) UpdateVaultDetails :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.key_management.models.Vault` :rtype: :class:`~oci.response.Response` :example: Click `here `__ to see an example of how to use update_vault API. rPUT update_vaultr6)r%r'r7r8csg|]}|vr|qSr1r1r;r>r1r2r@rAz/KmsVaultClient.update_vault..z%update_vault got unknown kwargs: {!r}rBcSsi|]\}}|tur||qSr1rCrEr1r1r2rHrAz/KmsVaultClient.update_vault..NrrIrJr7r8)rLrMrNrOcSs&i|]\}}|tur|dur||qSrQrCrEr1r1r2rHrAr'rRrUr%rVr)r-rpupdate_vault_detailsr/rWrXr]r^rqrYrFrGrZr'r1r>r2rsj0$     zKmsVaultClient.update_vaultN)__name__ __module__ __qualname____doc__r3r5rrruryr{r}rrrrrrrrr1r1r1r2rs(Szz~g~zc^'!urN) __future__r oci._vendorrrocirroci.base_clientr oci.configrr oci.signerr oci.utilr r r rrmodelsrrDobjectrr1r1r1r2s