GetSnapshotBlock - EBS direct APIs
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.

GetSnapshotBlock

Returns the data in a block in an Amazon Elastic Block Store snapshot.

Note

You should always retry requests that receive server (5xx) error responses, and ThrottlingException and RequestThrottledException client error responses. For more information see Error retries in the Amazon Elastic Compute Cloud User Guide.

Request Syntax

GET /snapshots/snapshotId/blocks/blockIndex?blockToken=BlockToken HTTP/1.1

URI Request Parameters

The request uses the following URI parameters.

blockIndex

The block index of the block in which to read the data. A block index is a logical index in units of 512 KiB blocks. To identify the block index, divide the logical offset of the data in the logical volume by the block size (logical offset of data/524288). The logical offset of the data must be 512 KiB aligned.

Valid Range: Minimum value of 0.

Required: Yes

BlockToken

The block token of the block from which to get data. You can obtain the BlockToken by running the ListChangedBlocks or ListSnapshotBlocks operations.

Length Constraints: Maximum length of 256.

Pattern: ^[A-Za-z0-9+/=]+$

Required: Yes

snapshotId

The ID of the snapshot containing the block from which to get data.

Important

If the specified snapshot is encrypted, you must have permission to use the KMS key that was used to encrypt the snapshot. For more information, see Using encryption in the Amazon Elastic Compute Cloud User Guide.

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

Pattern: ^snap-[0-9a-f]+$

Required: Yes

Request Body

The request does not have a request body.

Response Syntax

HTTP/1.1 200 x-amz-Data-Length: DataLength x-amz-Checksum: Checksum x-amz-Checksum-Algorithm: ChecksumAlgorithm BlockData

Response Elements

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

The response returns the following HTTP headers.

Checksum

The checksum generated for the block, which is Base64 encoded.

Length Constraints: Maximum length of 64.

Pattern: ^[A-Za-z0-9+/=]+$

ChecksumAlgorithm

The algorithm used to generate the checksum for the block, such as SHA256.

Length Constraints: Maximum length of 32.

Pattern: ^[A-Za-z0-9]+$

Valid Values: SHA256

DataLength

The size of the data in the block.

The response returns the following as the HTTP body.

BlockData

The data content of the block.

Errors

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

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403

InternalServerException

An internal error has occurred. For more information see Error retries.

HTTP Status Code: 500

RequestThrottledException

The number of API requests has exceeded the maximum allowed API request throttling limit for the snapshot. For more information see Error retries.

HTTP Status Code: 400

ResourceNotFoundException

The specified resource does not exist.

HTTP Status Code: 404

ServiceQuotaExceededException

Your current service quotas do not allow you to perform this action.

HTTP Status Code: 402

ValidationException

The input fails to satisfy the constraints of the EBS direct APIs.

HTTP Status Code: 400

See Also

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