EBS / Client / get_snapshot_block

get_snapshot_block#

EBS.Client.get_snapshot_block(**kwargs)#

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

See also: AWS API Documentation

Request Syntax

response = client.get_snapshot_block(
    SnapshotId='string',
    BlockIndex=123,
    BlockToken='string'
)
Parameters:
  • SnapshotId (string) –

    [REQUIRED]

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

    Warning

    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.

  • BlockIndex (integer) –

    [REQUIRED]

    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.

  • BlockToken (string) –

    [REQUIRED]

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

Return type:

dict

Returns:

Response Syntax

{
    'DataLength': 123,
    'BlockData': StreamingBody(),
    'Checksum': 'string',
    'ChecksumAlgorithm': 'SHA256'
}

Response Structure

  • (dict) –

    • DataLength (integer) –

      The size of the data in the block.

    • BlockData (StreamingBody) –

      The data content of the block.

    • Checksum (string) –

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

    • ChecksumAlgorithm (string) –

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

Exceptions

  • EBS.Client.exceptions.AccessDeniedException

  • EBS.Client.exceptions.ValidationException

  • EBS.Client.exceptions.ResourceNotFoundException

  • EBS.Client.exceptions.RequestThrottledException

  • EBS.Client.exceptions.ServiceQuotaExceededException

  • EBS.Client.exceptions.InternalServerException