ListTapes - Storage Gateway

ListTapes

Lists virtual tapes in your virtual tape library (VTL) and your virtual tape shelf (VTS). You specify the tapes to list by specifying one or more tape Amazon Resource Names (ARNs). If you don't specify a tape ARN, the operation lists all virtual tapes in both your VTL and VTS.

This operation supports pagination. By default, the operation returns a maximum of up to 100 tapes. You can optionally specify the Limit parameter in the body to limit the number of tapes in the response. If the number of tapes returned in the response is truncated, the response includes a Marker element that you can use in your subsequent request to retrieve the next set of tapes. This operation is only supported in the tape gateway type.

Request Syntax

{ "Limit": number, "Marker": "string", "TapeARNs": [ "string" ] }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Limit

An optional number limit for the tapes in the list returned by this call.

Type: Integer

Valid Range: Minimum value of 1.

Required: No

Marker

A string that indicates the position at which to begin the returned list of tapes.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1000.

Required: No

TapeARNs

The Amazon Resource Name (ARN) of each of the tapes you want to list. If you don't specify a tape ARN, the response lists all tapes in both your VTL and VTS.

Type: Array of strings

Length Constraints: Minimum length of 50. Maximum length of 500.

Pattern: arn:(aws(|-cn|-us-gov|-iso[A-Za-z0-9_-]*)):storagegateway:[a-z\-0-9]+:[0-9]+:tape\/[0-9A-Z]{5,16}$

Required: No

Response Syntax

{ "Marker": "string", "TapeInfos": [ { "GatewayARN": "string", "PoolEntryDate": number, "PoolId": "string", "RetentionStartDate": number, "TapeARN": "string", "TapeBarcode": "string", "TapeSizeInBytes": number, "TapeStatus": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Marker

A string that indicates the position at which to begin returning the next list of tapes. Use the marker in your next request to continue pagination of tapes. If there are no more tapes to list, this element does not appear in the response body.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1000.

TapeInfos

An array of TapeInfo objects, where each object describes a single tape. If there are no tapes in the tape library or VTS, then the TapeInfos is an empty array.

Type: Array of TapeInfo objects

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServerError

An internal server error has occurred during the request. For more information, see the error and message fields.

HTTP Status Code: 400

InvalidGatewayRequestException

An exception occurred because an invalid gateway request was issued to the service. For more information, see the error and message fields.

HTTP Status Code: 400

Examples

Example request

The ListTapes request in the following example does not specify a limit, marker, or TapeARN field in the response body. This example lists the only two tapes in the VTL and VTS. The response returns up to the first 100 tapes.

Sample Request

POST / HTTP/1.1 Host: storagegateway.us-east-2.amazonaws.com x-amz-Date: 20160425T120000Z Authorization: CSOC7TJPLR0OOKIRLGOHVAICUFVV4KQNSO5AEMVJF66Q9ASUAAJG Content-type: application/x-amz-json-1.1 x-amz-target: StorageGateway_20130630.ListTapes { "TapeARN": "arn:aws:storagegateway:us-east-2:999999999999:tape/TEST38A29D" }

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: CSOC7TJPLR0OOKIRLGOHVAICUFVV4KQNSO5AEMVJF66Q9ASUAAJG Date: Mon, 29 Apr 2016 12:00:02 GMT Content-type: application/x-amz-json-1.1 Content-length: 346 { "Marker": "string", "TapeInfos": [ { "GatewayARN": "arn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-12A3456B", "TapeARN": "arn:aws:storagegateway:us-east-2:999999999999:tape/TEST38A29D", "TapeBarcode": "TEST38A29D", "TapeSizeInBytes": "107374182400", "TapeStatus": "AVAILABLE" }, { "GatewayARN": "arn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-23A4567C", "TapeARN": "arn:aws:storagegateway:us-east-2:999999999999:tape/TEST49B39F", "TapeBarcode": "TEST49B39F", "TapeSizeInBytes": "107374182400", "TapeStatus": "ARCHIVED" } ] }

See Also

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