CreateTapes - Storage Gateway
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).

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", "KMSEncrypted": boolean, "KMSKey": "string", "NumTapesToCreate": number, "PoolId": "string", "Tags": [ { "Key": "string", "Value": "string" } ], "TapeBarcodePrefix": "string", "TapeSizeInBytes": number, "Worm": boolean }

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 Amazon Web Services Region.

Type: String

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

Required: Yes

KMSEncrypted

Set to true to use Amazon S3 server-side encryption with your own Amazon KMS key, or false to use a key managed by Amazon S3. Optional.

Valid Values: true | false

Type: Boolean

Required: No

KMSKey

The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for Amazon S3 server-side encryption. Storage Gateway does not support asymmetric CMKs. This value can only be set when KMSEncrypted is true. Optional.

Type: String

Length Constraints: Minimum length of 7. Maximum length of 2048.

Pattern: (^arn:(aws(|-cn|-us-gov|-iso[A-Za-z0-9_-]*)):kms:([a-zA-Z0-9-]+):([0-9]+):(key|alias)/(\S+)$)|(^alias/(\S+)$)

Required: No

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

PoolId

The ID of the pool that you want to add your tape to for archiving. The tape in this pool is archived in the S3 storage class that is associated with the pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the pool.

Type: String

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

Required: No

Tags

A list of up to 50 tags that can be assigned to a virtual tape. Each tag is a key-value pair.

Note

Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.

Type: Array of Tag objects

Required: No

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-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 bytes).

Type: Long

Required: Yes

Worm

Set to TRUE if the tape you are creating is to be configured as a write-once-read-many (WORM) tape.

Type: Boolean

Required: No

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(|-cn|-us-gov|-iso[A-Za-z0-9_-]*)):storagegateway:[a-z\-0-9]+:[0-9]+:tape\/[0-9A-Z]{5,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

Examples

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", "KMSEncrypted": "true", "KMSKey": "arn:aws:kms:us-east-1:11111111:key/b72aaa2a-2222-99tt-12345690qwe", "TapeSizeInBytes": "107374182400", "ClientToken": "77777", "NumTapesToCreate": "3", "PooId": "Deep_Archive", "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 Amazon SDKs, see the following: