Menu
AWS Storage Gateway Service
API Reference (API Version 2013-06-30)

CreateTapes

Creates one or more virtual tapes. You write data to the virtual tapes and then archive the tapes. This operation is only supported in the tape gateway type.

Note

Cache storage must be allocated to the gateway before you can create virtual tapes. Use the AddCache operation to add cache storage to a gateway.

Request Syntax

{
   "ClientToken": "string",
   "GatewayARN": "string",
   "NumTapesToCreate": number,
   "TapeBarcodePrefix": "string",
   "TapeSizeInBytes": number
}

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.

ClientToken

A unique identifier that you use to retry a request. If you retry a request, use the same ClientToken you specified in the initial request.

Note

Using the same ClientToken prevents creating the tape multiple times.

Type: String

Length Constraints: Minimum length of 5. Maximum length of 100.

Required: Yes

GatewayARN

The unique Amazon Resource Name (ARN) that represents the gateway to associate the virtual tapes with. Use the ListGateways operation to return a list of gateways for your account and region.

Type: String

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

Required: Yes

NumTapesToCreate

The number of virtual tapes that you want to create.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 10.

Required: Yes

TapeBarcodePrefix

A prefix that you append to the barcode of the virtual tape you are creating. This prefix makes the barcode unique.

Note

The prefix must be 1 to 4 characters in length and must be one of the uppercase letters from A to Z.

Type: String

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

Pattern: ^[A-Z]*$

Required: Yes

TapeSizeInBytes

The size, in bytes, of the virtual tapes that you want to create.

Note

The size must be aligned by gigabyte (1024*1024*1024 byte).

Type: Long

Required: Yes

Response Syntax

{
   "TapeARNs": [ "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.

TapeARNs

A list of unique Amazon Resource Names (ARNs) that represents the virtual tapes that were created.

Type: Array of strings

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

Pattern: ^arn:(aws|aws-cn):storagegateway:[a-z\-0-9]+:[0-9]+:tape\/[0-9A-Z]{7,16}$

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

Example

Create tapes in a tape gateway

In the following request, you add three virtual tape cartridges, 100 GB each in size, to the tape gateway with the ID sgw-12A3456B. The tapes appear in the gateway's virtual tape library. In the request, you set the tape's barcode prefix to "TEST".

Sample Request

{
   "GatewayARN":"arn:aws:storagegateway:us-east-2:999999999999:gateway/sgw-12A3456B",
   "TapeSizeInBytes":107374182400,
   "ClientToken":"77777",
   "NumTapesToCreate":3,
   "TapeBarcodePrefix":"TEST"
}
            

Sample Response

{"TapeARNs":
  ["arn:aws:storagegateway:us-east-2:999999999999:tape/TEST38A29D", "arn:aws:storagegateway:us-east-2:123456789012:tape/TEST3AA29F", "arn:aws:storagegateway:us-east-2:123456789012:tape/TEST3BA29E"]
}
            

See Also

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