List Vaults (GET vaults) - Amazon S3 Glacier
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).

This page is only for existing customers of the S3 Glacier service using Vaults and the original REST API from 2012.

If you're looking for archival storage solutions we suggest using the S3 Glacier storage classes in Amazon S3, S3 Glacier Instant Retrieval, S3 Glacier Flexible Retrieval, and S3 Glacier Deep Archive. To learn more about these storage options, see S3 Glacier storage classes and Long-term data storage using S3 Glacier storage classes in the Amazon S3 User Guide. These storage classes use the Amazon S3 API, are available in all regions, and can be managed within the Amazon S3 console. They offer features like Storage Cost Analysis, Storage Lens, advanced optional encryption features, and more.

List Vaults (GET vaults)

Description

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 per request. If there are more vaults to list, the marker field in the response body 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. In your next List Vaults request you set the marker parameter to the value Amazon S3 Glacier (S3 Glacier) returned in the responses to your previous List Vaults request. You can also limit the number of vaults returned in the response by specifying the limit parameter in the request.

Requests

To get a list of vaults, you send a GET request to the vaults resource.

Syntax

GET /AccountId/vaults HTTP/1.1 Host: glacier.Region.amazonaws.com.cn Date: Date Authorization: SignatureValue x-amz-glacier-version: 2012-06-01

Note

The AccountId value is the Amazon Web Services account ID. This value must match the Amazon Web Services account ID associated with the credentials used to sign the request. You can either specify an Amazon Web Services account ID or optionally a single '-' (hyphen), in which case Amazon S3 Glacier uses the Amazon Web Services 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.

Request Parameters

This operation uses the following request parameters.

Name Description Required
limit

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.

Type: String

Constraints: Minimum integer value of 1. Maximum integer value of 10.

No
marker

A string used for pagination. marker specifies the vault ARN after which the listing of vaults should begin. (The vault specified by marker is not included in the returned list.) Get the marker value from a previous List Vaults response. You need to include the marker only if you are continuing the pagination of results started in a previous List Vaults request. Specifying an empty value ("") for the marker returns a list of vaults starting from the first vault.

Type: String

Constraints: None

No

Request Headers

This operation uses only request headers that are common to all operations. For information about common request headers, see Common Request Headers.

Request Body

This operation does not have a request body.

Responses

Syntax

HTTP/1.1 200 OK x-amzn-RequestId: x-amzn-RequestId Date: Date Content-Type: application/json Content-Length: Length { "Marker": String "VaultList": [ { "CreationDate": String, "LastInventoryDate": String, "NumberOfArchives": Number, "SizeInBytes": Number, "VaultARN": String, "VaultName": String }, ... ] }

Response Headers

This operation uses only response headers that are common to most responses. For information about common response headers, see Common Response Headers.

Response Body

The response body contains the following JSON fields.

CreationDate

The date the vault was created, in Coordinated Universal Time (UTC).

Type: String. A string representation in the ISO 8601 date format, for example 2013-03-20T17:03:43.221Z.

LastInventoryDate

The date of the last vault inventory, in Coordinated Universal Time (UTC). This field can be null if an inventory has not yet run on the vault, for example, if you just created the vault. For information about initiating an inventory for a vault, see Initiate Job (POST jobs).

Type: A string representation in the ISO 8601 date format, for example 2013-03-20T17:03:43.221Z.

Marker

The vaultARN that represents where to continue pagination of the results. You use the marker in another List Vaults request to obtain more vaults in the list. If there are no more vaults, this value is null.

Type: String

NumberOfArchives

The number of archives in the vault as of the last inventory date.

Type: Number

SizeInBytes

The total size, in bytes, of all the archives in the vault including any per-archive overhead, as of the last inventory date.

Type: Number

VaultARN

The Amazon Resource Name (ARN) of the vault.

Type: String

VaultList

An array of objects, with each object providing a description of a vault.

Type: Array

VaultName

The vault name.

Type: String

Errors

For information about Amazon S3 Glacier exceptions and error messages, see Error Responses.

Examples

Example: List All Vaults

The following example lists vaults. Because the marker and limit parameters are not specified in the request, up to 10 vaults are returned.

Example Request

GET /-/vaults HTTP/1.1 Host: glacier.us-west-2.amazonaws.com.cn x-amz-Date: 20170210T120000Z x-amz-glacier-version: 2012-06-01 Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20141123/us-west-2/glacier/aws4_request,SignedHeaders=host;x-amz-date;x-amz-glacier-version,Signature=9257c16da6b25a715ce900a5b45b03da0447acf430195dcb540091b12966f2a2

Example Response

The Marker is null indicating there are no more vaults to list.

HTTP/1.1 200 OK x-amzn-RequestId: AAABZpJrTyioDC_HsOmHae8EZp_uBSJr6cnGOLKp_XJCl-Q Date: Wed, 10 Feb 2017 12:02:00 GMT Content-Type: application/json Content-Length: 497 { "Marker": null, "VaultList": [ { "CreationDate": "2012-03-16T22:22:47.214Z", "LastInventoryDate": "2012-03-21T22:06:51.218Z", "NumberOfArchives": 2, "SizeInBytes": 12334, "VaultARN": "arn:aws:glacier:us-west-2:012345678901:vaults/examplevault1", "VaultName": "examplevault1" }, { "CreationDate": "2012-03-19T22:06:51.218Z", "LastInventoryDate": "2012-03-21T22:06:51.218Z", "NumberOfArchives": 0, "SizeInBytes": 0, "VaultARN": "arn:aws:glacier:us-west-2:012345678901:vaults/examplevault2", "VaultName": "examplevault2" }, { "CreationDate": "2012-03-19T22:06:51.218Z", "LastInventoryDate": "2012-03-25T12:14:31.121Z", "NumberOfArchives": 0, "SizeInBytes": 0, "VaultARN": "arn:aws:glacier:us-west-2:012345678901:vaults/examplevault3", "VaultName": "examplevault3" } ] }

Example: Partial List of Vaults

The following example returns two vaults starting at the vault specified by the marker.

Example Request

GET /-/vaults?limit=2&marker=arn:aws:glacier:us-west-2:012345678901:vaults/examplevault1 HTTP/1.1 Host: glacier.us-west-2.amazonaws.com.cn x-amz-Date: 20170210T120000Z x-amz-glacier-version: 2012-06-01 Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20141123/us-west-2/glacier/aws4_request,SignedHeaders=host;x-amz-date;x-amz-glacier-version,Signature=9257c16da6b25a715ce900a5b45b03da0447acf430195dcb540091b12966f2a2

Example Response

Two vaults are returned in the list. The Marker contains the vault ARN to continue pagination in another List Vaults request.

HTTP/1.1 200 OK x-amzn-RequestId: AAABZpJrTyioDC_HsOmHae8EZp_uBSJr6cnGOLKp_XJCl-Q Date: Wed, 10 Feb 2017 12:02:00 GMT Content-Type: application/json Content-Length: 497 { "Marker": "arn:aws:glacier:us-west-2:012345678901:vaults/examplevault3", "VaultList": [ { "CreationDate": "2012-03-16T22:22:47.214Z", "LastInventoryDate": "2012-03-21T22:06:51.218Z", "NumberOfArchives": 2, "SizeInBytes": 12334, "VaultARN": "arn:aws:glacier:us-west-2:012345678901:vaults/examplevault1", "VaultName": "examplevault1" }, { "CreationDate": "2012-03-19T22:06:51.218Z", "LastInventoryDate": "2012-03-21T22:06:51.218Z", "NumberOfArchives": 0, "SizeInBytes": 0, "VaultARN": "arn:aws:glacier:us-west-2:012345678901:vaults/examplevault2", "VaultName": "examplevault2" } ] }

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: