Glacier / Client / add_tags_to_vault

add_tags_to_vault

Glacier.Client.add_tags_to_vault(**kwargs)

This operation adds the specified tags to a vault. Each tag is composed of a key and a value. Each vault can have up to 10 tags. If your request would cause the tag limit for the vault to be exceeded, the operation throws the LimitExceededException error. If a tag already exists on the vault under a specified key, the existing key value will be overwritten. For more information about tags, see Tagging Amazon Glacier Resources.

See also: AWS API Documentation

Request Syntax

response = client.add_tags_to_vault(
    vaultName='string',
    Tags={
        'string': 'string'
    }
)
Parameters:
  • accountId (string) –

    The AccountId value is the AWS account ID of the account that owns the vault. 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 use an account ID, do not include any hyphens (‘-’) in the ID.

    Note: this parameter is set to “-” bydefault if no value is not specified.

  • vaultName (string) –

    [REQUIRED]

    The name of the vault.

  • Tags (dict) –

    The tags to add to the vault. Each tag is composed of a key and a value. The value can be an empty string.

    • (string) –

      • (string) –

Returns:

None

Exceptions

  • Glacier.Client.exceptions.InvalidParameterValueException

  • Glacier.Client.exceptions.MissingParameterValueException

  • Glacier.Client.exceptions.ResourceNotFoundException

  • Glacier.Client.exceptions.LimitExceededException

  • Glacier.Client.exceptions.ServiceUnavailableException

  • Glacier.Client.exceptions.NoLongerSupportedException

Examples

The example adds two tags to a my-vault.

response = client.add_tags_to_vault(
    Tags={
        'examplekey1': 'examplevalue1',
        'examplekey2': 'examplevalue2',
    },
    accountId='-',
    vaultName='my-vault',
)

print(response)

Expected Output:

{
    'ResponseMetadata': {
        '...': '...',
    },
}