Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
The following code example shows how to list tags for an Amazon S3 Glacier vault.
- .NET
-
- Amazon SDK for .NET
-
/// <summary>
/// List tags for an Amazon S3 Glacier vault.
/// </summary>
/// <param name="vaultName">The name of the vault to list tags for.</param>
/// <returns>A dictionary listing the tags attached to each object in the
/// vault and its tags.</returns>
public async Task<Dictionary<string, string>> ListTagsForVaultAsync(string vaultName)
{
var request = new ListTagsForVaultRequest
{
// Using a hyphen "-" for the Account Id will
// cause the SDK to use the Account Id associated
// with the default user.
AccountId = "-",
VaultName = vaultName,
};
var response = await _glacierService.ListTagsForVaultAsync(request);
return response.Tags;
}
For a complete list of Amazon SDK developer guides and code examples, see
Using S3 Glacier with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.