Skip to content

list_vaults async

list_vaults(
    account_id: string,
    *,
    config_overrides: Optional[AsyncGlacierClientConfig] = None,
    marker: Optional[string] = None,
    limit: Optional[int] = None,
) -> ListVaultsOutput

This operation lists all vaults owned by the calling user's account. The list returned in the response is ASCII-sorted by vault name.

By default, this operation returns up to 10 items. If there are more vaults to list, the response marker field contains the vault Amazon Resource Name (ARN) at which to continue the list with a new List Vaults request; otherwise, the marker field is null. To return a list of vaults that begins at a specific vault, set the marker request parameter to the vault ARN you obtained from a previous List Vaults request. You can also limit the number of vaults returned in the response by specifying the limit parameter in the request.

An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM) users don't have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see Access Control Using AWS Identity and Access Management (IAM).

For conceptual information and underlying REST API, see Retrieving Vault Metadata in Amazon Glacier and List Vaults in the Amazon Glacier Developer Guide.

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.

  • marker (Optional[string], default: None ) –

    A string used for pagination. The marker specifies the vault ARN after which the listing of vaults should begin.

  • limit (Optional[int], default: None ) –

    The maximum number of vaults to be returned. The default limit is 10. The number of vaults returned might be fewer than the specified limit, but the number of returned vaults never exceeds the limit.

Raises:

Examples:

To list all vaults owned by the calling user's account The example lists all vaults owned by the specified AWS account.

>>> await client.list_vaults(account_id='-', marker='')
Source code in docs_src/capo_glacier/_services/async_glacier.py
async def list_vaults(
    self,
    account_id: "capo_glacier.types.string.string",
    *,
    config_overrides: Optional[AsyncGlacierClientConfig] = None,
    marker: Optional["capo_glacier.types.string.string"] = None,
    limit: Optional[int] = None,
) -> "capo_glacier.types.list_vaults_output.ListVaultsOutput":
    """<p>This operation lists all vaults owned by the calling user's account. The list returned in the response is ASCII-sorted by vault name.</p> <p>By default, this operation returns up to 10 items. If there are more vaults to list, the response <code>marker</code> field contains the vault Amazon Resource Name (ARN) at which to continue the list with a new List Vaults request; otherwise, the <code>marker</code> field is <code>null</code>. To return a list of vaults that begins at a specific vault, set the <code>marker</code> request parameter to the vault ARN you obtained from a previous List Vaults request. You can also limit the number of vaults returned in the response by specifying the <code>limit</code> parameter in the request. </p> <p>An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM) users don't have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see <a href="https://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html">Access Control Using AWS Identity and Access Management (IAM)</a>.</p> <p>For conceptual information and underlying REST API, see <a href="https://docs.aws.amazon.com/amazonglacier/latest/dev/retrieving-vault-info.html">Retrieving Vault Metadata in Amazon Glacier</a> and <a href="https://docs.aws.amazon.com/amazonglacier/latest/dev/api-vaults-get.html">List Vaults </a> in the <i>Amazon Glacier Developer Guide</i>. </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>
        marker: <p>A string used for pagination. The marker specifies the vault ARN after which the listing of vaults should begin.</p>
        limit: <p>The maximum number of vaults to be returned. The default limit is 10. The number of vaults returned might be fewer than the specified limit, but the number of returned vaults never exceeds the limit.</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 list all vaults owned by the calling user's account
        The example lists all vaults owned by the specified AWS account.

        >>> await client.list_vaults(account_id='-', marker='')
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_glacier.types.list_vaults_input.ListVaultsInput]",
    ) -> AsyncOperationResponse[
        "capo_glacier.types.list_vaults_output.ListVaultsOutput"
    ]:
        import capo_glacier._operations.glacier.list_vaults

        (
            output,
            http_response,
        ) = await capo_glacier._operations.glacier.list_vaults.async_list_vaults(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListVaults")
    )
    input_: capo_glacier.types.list_vaults_input.ListVaultsInput = {
        "account_id": account_id
    }
    if marker is not None:
        input_["marker"] = marker
    if limit is not None:
        input_["limit"] = limit

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output