Table of Contents
A low-level client representing Amazon Elastic Block Store (EBS):
client = session.create_client('ebs')
These are the available methods:
Check if an operation can be paginated.
Generate a presigned url given a client, its method, and arguments
The presigned url
Create a paginator for an operation.
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'
)
[REQUIRED]
The ID of the snapshot containing the block from which to get data.
[REQUIRED]
The block index of the block from which to get data.
Obtain the BlockIndex by running the ListChangedBlocks or ListSnapshotBlocks operations.
[REQUIRED]
The block token of the block from which to get data.
Obtain the BlockToken by running the ListChangedBlocks or ListSnapshotBlocks operations.
dict
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
Returns an object that can wait for some condition.
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
response = client.list_changed_blocks(
FirstSnapshotId='string',
SecondSnapshotId='string',
NextToken='string',
MaxResults=123,
StartingBlockIndex=123
)
The ID of the first snapshot to use for the comparison.
Warning
The FirstSnapshotID parameter must be specified with a SecondSnapshotId parameter; otherwise, an error occurs.
[REQUIRED]
The ID of the second snapshot to use for the comparison.
Warning
The SecondSnapshotId parameter must be specified with a FirstSnapshotID parameter; otherwise, an error occurs.
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.
dict
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 FirstSnapshotId specified in the ListChangedBlocks 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 SecondSnapshotId specified in the ListChangedBlocks operation.
ExpiryTime (datetime) --
The time when the BlockToken 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.
Exceptions
Returns the block indexes and block tokens for blocks in an Amazon Elastic Block Store snapshot.
See also: AWS API Documentation
Request Syntax
response = client.list_snapshot_blocks(
SnapshotId='string',
NextToken='string',
MaxResults=123,
StartingBlockIndex=123
)
[REQUIRED]
The ID of the snapshot from which to get block indexes and block tokens.
dict
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 BlockToken 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.
Exceptions
Client exceptions are available on a client instance via the exceptions property. For more detailed instructions and examples on the exact usage of client exceptions, see the error handling user guide.
The available client exceptions are:
The specified resource does not exist.
Example
try:
...
except client.exceptions.ResourceNotFoundException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'Message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) --
The specified resource does not exist.
The input fails to satisfy the constraints of the EBS direct APIs.
Example
try:
...
except client.exceptions.ValidationException as e:
print(e.response)
The parsed error response. All exceptions have a top level Error key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'Message': 'string',
'Reason': 'INVALID_CUSTOMER_KEY'|'INVALID_PAGE_TOKEN'|'INVALID_BLOCK_TOKEN'|'INVALID_SNAPSHOT_ID'|'UNRELATED_SNAPSHOTS',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) --
The input fails to satisfy the constraints of the EBS direct APIs.
Message (string) --
Reason (string) --
The reason for the validation exception.
Error (dict) -- Normalized access to common exception attributes.
The available paginators are: