Skip to content

complete_vault_lock

complete_vault_lock(
    account_id: string,
    vault_name: string,
    lock_id: string,
    *,
    config_overrides: Optional[GlacierClientConfig] = None,
) -> None

This operation completes the vault locking process by transitioning the vault lock from the InProgress state to the Locked state, which causes the vault lock policy to become unchangeable. A vault lock is put into the InProgress state by calling InitiateVaultLock. You can obtain the state of the vault lock by calling GetVaultLock. For more information about the vault locking process, Amazon Glacier Vault Lock.

This operation is idempotent. This request is always successful if the vault lock is in the Locked state and the provided lock ID matches the lock ID originally used to lock the vault.

If an invalid lock ID is passed in the request when the vault lock is in the Locked state, the operation returns an AccessDeniedException error. If an invalid lock ID is passed in the request when the vault lock is in the InProgress state, the operation throws an InvalidParameter error.

Parameters:

  • account_id (string) –

    The AccountId value is the AWS account ID. This value must match the AWS account ID associated with the credentials used to sign the request. You can either specify an AWS account ID or optionally a single '-' (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the credentials used to sign the request. If you specify your account ID, do not include any hyphens ('-') in the ID.

  • vault_name (string) –

    The name of the vault.

  • lock_id (string) –

    The lockId value is the lock ID obtained from a InitiateVaultLock request.

Raises:

Examples:

To complete a vault lock The example completes the vault locking process by transitioning the vault lock from the InProgress state to the Locked state.

>>> client.complete_vault_lock(account_id='-', vault_name='example-vault', lock_id='AE863rKkWZU53SLW5be4DUcW')
Source code in docs_src/capo_glacier/_services/glacier.py
def complete_vault_lock(
    self,
    account_id: "capo_glacier.types.string.string",
    vault_name: "capo_glacier.types.string.string",
    lock_id: "capo_glacier.types.string.string",
    *,
    config_overrides: Optional[GlacierClientConfig] = None,
) -> None:
    """<p>This operation completes the vault locking process by transitioning the vault lock from the <code>InProgress</code> state to the <code>Locked</code> state, which causes the vault lock policy to become unchangeable. A vault lock is put into the <code>InProgress</code> state by calling <a>InitiateVaultLock</a>. You can obtain the state of the vault lock by calling <a>GetVaultLock</a>. For more information about the vault locking process, <a href="https://docs.aws.amazon.com/amazonglacier/latest/dev/vault-lock.html">Amazon Glacier Vault Lock</a>. </p> <p>This operation is idempotent. This request is always successful if the vault lock is in the <code>Locked</code> state and the provided lock ID matches the lock ID originally used to lock the vault.</p> <p>If an invalid lock ID is passed in the request when the vault lock is in the <code>Locked</code> state, the operation returns an <code>AccessDeniedException</code> error. If an invalid lock ID is passed in the request when the vault lock is in the <code>InProgress</code> state, the operation throws an <code>InvalidParameter</code> error.</p>

    Args:
        account_id: <p>The <code>AccountId</code> value is the AWS account ID. This value must match the AWS account ID associated with the credentials used to sign the request. You can either specify an AWS account ID or optionally a single '<code>-</code>' (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the credentials used to sign the request. If you specify your account ID, do not include any hyphens ('-') in the ID.</p>
        vault_name: <p>The name of the vault.</p>
        lock_id: <p>The <code>lockId</code> value is the lock ID obtained from a <a>InitiateVaultLock</a> request.</p>

    Raises:
        capo_glacier.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>Returned if a parameter of the request is incorrectly specified.</p>
        capo_glacier.errors.missing_parameter_value_exception.MissingParameterValueException: <p>Returned if a required header or parameter is missing from the request.</p>
        capo_glacier.errors.no_longer_supported_exception.NoLongerSupportedException: <p>Returned if the request was made by a customer with no Amazon Glacier storage. The request is denied as the API is no longer supported for new customers. Please use Amazon S3 Glacier storage classes instead.</p>
        capo_glacier.errors.resource_not_found_exception.ResourceNotFoundException: <p>Returned if the specified resource (such as a vault, upload ID, or job ID) doesn't exist.</p>
        capo_glacier.errors.service_unavailable_exception.ServiceUnavailableException: <p>Returned if the service cannot complete the request.</p>
        capo_glacier.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To complete a vault lock
        The example completes the vault locking process by transitioning the vault lock from the InProgress state to the Locked state.

        >>> client.complete_vault_lock(account_id='-', vault_name='example-vault', lock_id='AE863rKkWZU53SLW5be4DUcW')
    """

    def _handler(
        req: "OperationRequest[capo_glacier.types.complete_vault_lock_input.CompleteVaultLockInput]",
    ) -> OperationResponse[None]:
        import capo_glacier._operations.glacier.complete_vault_lock

        output, http_response = (
            capo_glacier._operations.glacier.complete_vault_lock.complete_vault_lock(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CompleteVaultLock")
    )
    input_: capo_glacier.types.complete_vault_lock_input.CompleteVaultLockInput = {
        "account_id": account_id,
        "vault_name": vault_name,
        "lock_id": lock_id,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output