Amazon Elastic Block Store

2019/12/04 - Amazon Elastic Block Store - 3 new api methods

Changes  This release introduces the EBS direct APIs for Snapshots: 1. ListSnapshotBlocks, which lists the block indexes and block tokens for blocks in an Amazon EBS snapshot. 2. ListChangedBlocks, which lists the block indexes and block tokens for blocks that are different between two snapshots of the same volume/snapshot lineage. 3. GetSnapshotBlock, which returns the data in a block of an Amazon EBS snapshot.

ListSnapshotBlocks (new) Link ¶

Returns the block indexes and block tokens for blocks in an Amazon Elastic Block Store snapshot.

See also: AWS API Documentation

Request Syntax

client.list_snapshot_blocks(
    SnapshotId='string',
    NextToken='string',
    MaxResults=123,
    StartingBlockIndex=123
)
type SnapshotId

string

param SnapshotId

[REQUIRED]

The ID of the snapshot from which to get block indexes and block tokens.

type NextToken

string

param NextToken

The token to request the next page of results.

type MaxResults

integer

param MaxResults

The number of results to return.

type StartingBlockIndex

integer

param StartingBlockIndex

The block index from which the list should start. The list in the response will start from this block index or the next valid block index in the snapshot.

rtype

dict

returns

Response Syntax

{
    'Blocks': [
        {
            'BlockIndex': 123,
            'BlockToken': 'string'
        },
    ],
    'ExpiryTime': datetime(2015, 1, 1),
    'VolumeSize': 123,
    'BlockSize': 123,
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Blocks (list) --

      An array of objects containing information about the blocks.

      • (dict) --

        A block of data in an Amazon Elastic Block Store snapshot.

        • BlockIndex (integer) --

          The block index.

        • BlockToken (string) --

          The block token for the block index.

    • ExpiryTime (datetime) --

      The time when the block token expires.

    • VolumeSize (integer) --

      The size of the volume in GB.

    • BlockSize (integer) --

      The size of the block.

    • NextToken (string) --

      The token to use to retrieve the next page of results. This value is null when there are no more results to return.

ListChangedBlocks (new) Link ¶

Returns the block indexes and block tokens for blocks that are different between two Amazon Elastic Block Store snapshots of the same volume/snapshot lineage.

See also: AWS API Documentation

Request Syntax

client.list_changed_blocks(
    FirstSnapshotId='string',
    SecondSnapshotId='string',
    NextToken='string',
    MaxResults=123,
    StartingBlockIndex=123
)
type FirstSnapshotId

string

param FirstSnapshotId

The ID of the first snapshot to use for the comparison.

type SecondSnapshotId

string

param SecondSnapshotId

[REQUIRED]

The ID of the second snapshot to use for the comparison.

type NextToken

string

param NextToken

The token to request the next page of results.

type MaxResults

integer

param MaxResults

The number of results to return.

type StartingBlockIndex

integer

param StartingBlockIndex

The block index from which the comparison should start.

The list in the response will start from this block index or the next valid block index in the snapshots.

rtype

dict

returns

Response Syntax

{
    'ChangedBlocks': [
        {
            'BlockIndex': 123,
            'FirstBlockToken': 'string',
            'SecondBlockToken': 'string'
        },
    ],
    'ExpiryTime': datetime(2015, 1, 1),
    'VolumeSize': 123,
    'BlockSize': 123,
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ChangedBlocks (list) --

      An array of objects containing information about the changed blocks.

      • (dict) --

        A block of data in an Amazon Elastic Block Store snapshot that is different from another snapshot of the same volume/snapshot lineage.

        • BlockIndex (integer) --

          The block index.

        • FirstBlockToken (string) --

          The block token for the block index of the first snapshot ID specified in the list changed blocks operation. This value is absent if the first snapshot does not have the changed block that is on the second snapshot.

        • SecondBlockToken (string) --

          The block token for the block index of the second snapshot ID specified in the list changed blocks operation.

    • ExpiryTime (datetime) --

      The time when the block token expires.

    • VolumeSize (integer) --

      The size of the volume in GB.

    • BlockSize (integer) --

      The size of the block.

    • NextToken (string) --

      The token to use to retrieve the next page of results. This value is null when there are no more results to return.

GetSnapshotBlock (new) Link ¶

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

See also: AWS API Documentation

Request Syntax

client.get_snapshot_block(
    SnapshotId='string',
    BlockIndex=123,
    BlockToken='string'
)
type SnapshotId

string

param SnapshotId

[REQUIRED]

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

type BlockIndex

integer

param BlockIndex

[REQUIRED]

The block index of the block from which to get data.

Obtain the block index by running the list changed blocks or list snapshot blocks operations.

type BlockToken

string

param BlockToken

[REQUIRED]

The block token of the block from which to get data.

Obtain the block token by running the list changed blocks or list snapshot blocks operations.

rtype

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 (:class:`.StreamingBody`) --

      The data content of the block.

    • Checksum (string) --

      The checksum generated for the block.

    • ChecksumAlgorithm (string) --

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