EBS

Table of Contents

Client

class EBS.Client

A low-level client representing Amazon Elastic Block Store (EBS):

import boto3

client = boto3.client('ebs')

These are the available methods:

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)

Generate a presigned url given a client, its method, and arguments

Parameters
  • ClientMethod (string) -- The client method to presign for
  • Params (dict) -- The parameters normally passed to ClientMethod.
  • ExpiresIn (int) -- The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)
  • HttpMethod (string) -- The http method to use on the generated url. By default, the http method is whatever is used in the method's model.
Returns

The presigned url

get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
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.

  • BlockIndex (integer) --

    [REQUIRED]

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

    Obtain the BlockIndex by running the ListChangedBlocks or ListSnapshotBlocks operations.

  • BlockToken (string) --

    [REQUIRED]

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

    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.ValidationException
  • EBS.Client.exceptions.ResourceNotFoundException
get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters
waiter_name (str) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
Returns
The specified waiter object.
Return type
botocore.waiter.Waiter
list_changed_blocks(**kwargs)

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
)
Parameters
  • FirstSnapshotId (string) --

    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.

  • SecondSnapshotId (string) --

    [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.

  • NextToken (string) -- The token to request the next page of results.
  • MaxResults (integer) -- The number of results to return.
  • StartingBlockIndex (integer) --

    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.

Return type

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 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

  • EBS.Client.exceptions.ValidationException
  • EBS.Client.exceptions.ResourceNotFoundException
list_snapshot_blocks(**kwargs)

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
)
Parameters
  • SnapshotId (string) --

    [REQUIRED]

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

  • NextToken (string) -- The token to request the next page of results.
  • MaxResults (integer) -- The number of results to return.
  • StartingBlockIndex (integer) -- 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.
Return type

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 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

  • EBS.Client.exceptions.ValidationException
  • EBS.Client.exceptions.ResourceNotFoundException

Paginators

The available paginators are: