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

CreateTapeWithBarcode

Creates a virtual tape by using your own barcode. You write data to the virtual tape and then archive the tape. A barcode is unique and can not be reused if it has already been used on a tape . This applies to barcodes used on deleted tapes. This operation is only supported in the tape gateway type.

Note

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

Request Syntax

{ "GatewayARN": "string", "TapeBarcode": "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.

GatewayARN

The unique Amazon Resource Name (ARN) that represents the gateway to associate the virtual tape 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

TapeBarcode

The barcode that you want to assign to the tape.

Note

Barcodes cannot be reused. This includes barcodes used for tapes that have been deleted.

Type: String

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

Pattern: ^[A-Z0-9]*$

Required: Yes

TapeSizeInBytes

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

Note

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

Type: Long

Required: Yes

Response Syntax

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

TapeARN

A unique Amazon Resource Name (ARN) that represents the virtual tape that was created.

Type: String

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 a tape with your own barcode in a tape gateway

In the following request, you add a 100 GB tape cartridge to the tape gateway with the ID sgw-12A3456B. The tape appears in the gateway's virtual tape library. In the request, you set the barcode to "TEST12345".

Sample Request

{ "GatewayARN":"arn:aws:storagegateway:us-east-2:999999999999:gateway/sgw-12A3456B", "TapeSizeInBytes":107374182400, "TapeBarcode":"TEST12345" }

Sample Response

{"TapeARN": ["arn:aws:storagegateway:us-east-2:999999999999:tape/TEST12345"] }

See Also

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