There are more AWS SDK examples available in the AWS Doc SDK Examples
Use AddTagsToVault with an AWS SDK or CLI
The following code examples show how to use AddTagsToVault.
- .NET
-
- SDK for .NET
-
Note
There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository
. /// <summary> /// Add tags to the items in an Amazon S3 Glacier vault. /// </summary> /// <param name="vaultName">The name of the vault to add tags to.</param> /// <param name="key">The name of the object to tag.</param> /// <param name="value">The tag value to add.</param> /// <returns>A Boolean value indicating the success of the action.</returns> public async Task<bool> AddTagsToVaultAsync(string vaultName, string key, string value) { var request = new AddTagsToVaultRequest { Tags = new Dictionary<string, string> { { key, value }, }, AccountId = "-", VaultName = vaultName, }; var response = await _glacierService.AddTagsToVaultAsync(request); return response.HttpStatusCode == HttpStatusCode.NoContent; }-
For API details, see AddTagsToVault in AWS SDK for .NET API Reference.
-
- CLI
-
- AWS CLI
-
To add tags to a vault
The following
add-tags-to-vaultexample adds two tags to a vault namedmy-vault.aws glacier add-tags-to-vault \ --account-id - \ --vault-namemy-vault\ --tagsid=1234,date=july2015This command produces no output.
Amazon Glacier requires an account ID argument when performing operations, but you can use a hyphen to specify the in-use account.
For more information, see Tagging Amazon Glacier Resources in the Amazon Glacier Developer Guide.
-
For API details, see AddTagsToVault
in AWS CLI Command Reference.
-