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

CreateSnapshot

Initiates a snapshot of a volume.

AWS Storage Gateway provides the ability to back up point-in-time snapshots of your data to Amazon Simple Storage (S3) for durable off-site recovery, as well as import the data to an Amazon Elastic Block Store (EBS) volume in Amazon Elastic Compute Cloud (EC2). You can take snapshots of your gateway volume on a scheduled or ad-hoc basis. This API enables you to take ad-hoc snapshot. For more information, see Editing a Snapshot Schedule.

In the CreateSnapshot request you identify the volume by providing its Amazon Resource Name (ARN). You must also provide description for the snapshot. When AWS Storage Gateway takes the snapshot of specified volume, the snapshot and description appears in the AWS Storage Gateway Console. In response, AWS Storage Gateway returns you a snapshot ID. You can use this snapshot ID to check the snapshot progress or later use it when you want to create a volume from a snapshot. This operation is only supported in stored and cached volume gateway type.

Note

To list or delete a snapshot, you must use the Amazon EC2 API. For more information, see DescribeSnapshots or DeleteSnapshot in the EC2 API reference.

Important

Volume and snapshot IDs are changing to a longer length ID format. For more information, see the important note on the Welcome page.

Request Syntax

{ "SnapshotDescription": "string", "VolumeARN": "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.

SnapshotDescription

Textual description of the snapshot that appears in the Amazon EC2 console, Elastic Block Store snapshots panel in the Description field, and in the AWS Storage Gateway snapshot Details pane, Description field

Type: String

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

Required: Yes

VolumeARN

The Amazon Resource Name (ARN) of the volume. Use the ListVolumes operation to return a list of gateway volumes.

Type: String

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

Required: Yes

Response Syntax

{ "SnapshotId": "string", "VolumeARN": "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.

SnapshotId

The snapshot ID that is used to refer to the snapshot in future operations such as describing snapshots (Amazon Elastic Compute Cloud API DescribeSnapshots) or creating a volume from a snapshot (CreateStorediSCSIVolume).

Type: String

Pattern: \Asnap-([0-9A-Fa-f]{8}|[0-9A-Fa-f]{17})\z

VolumeARN

The Amazon Resource Name (ARN) of the volume of which the snapshot was taken.

Type: String

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

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

ServiceUnavailableError

An internal server error has occurred because the service is unavailable. For more information, see the error and message fields.

HTTP Status Code: 400

Example

Example Request

The following example sends a CreateSnapshot request to take snapshot of the specified an example volume.

Sample Request

POST / HTTP/1.1 Host: storagegateway.us-east-2.amazonaws.com x-amz-Date: 20120425T120000Z Authorization: CSOC7TJPLR0OOKIRLGOHVAICUFVV4KQNSO5AEMVJF66Q9ASUAAJG Content-type: application/x-amz-json-1.1 x-amz-target: StorageGateway_20120630.CreateSnapshot { "VolumeARN": "arn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-12A3456B/volume/vol-1122AABB", "SnapshotDescription": "snapshot description" }

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: CSOC7TJPLR0OOKIRLGOHVAICUFVV4KQNSO5AEMVJF66Q9ASUAAJG Date: Wed, 25 Apr 2012 12:00:02 GMT Content-type: application/x-amz-json-1.1 Content-length: 128 { "VolumeARN": "arn:aws:storagegateway:us-east-2:111122223333:gateway/sgw-12A3456B/volume/vol-1122AABB", "SnapshotId": "snap-78e22663" }

See Also

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