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).
Describe an Amazon S3 Glacier vault using an Amazon SDK
The following code example shows how to describe an Amazon S3 Glacier vault.
- .NET
-
- Amazon SDK for .NET
-
/// <summary>
/// Describe an Amazon S3 Glacier vault.
/// </summary>
/// <param name="vaultName">The name of the vault to describe.</param>
/// <returns>The Amazon Resource Name (ARN) of the vault.</returns>
public async Task<string> DescribeVaultAsync(string vaultName)
{
var request = new DescribeVaultRequest
{
AccountId = "-",
VaultName = vaultName,
};
var response = await _glacierService.DescribeVaultAsync(request);
// Display the information about the vault.
Console.WriteLine($"{response.VaultName}\tARN: {response.VaultARN}");
Console.WriteLine($"Created on: {response.CreationDate}\tNumber of Archives: {response.NumberOfArchives}\tSize (in bytes): {response.SizeInBytes}");
if (response.LastInventoryDate != DateTime.MinValue)
{
Console.WriteLine($"Last inventory: {response.LastInventoryDate}");
}
return response.VaultARN;
}
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.