BackupStorage

Client

class BackupStorage.Client

A low-level client representing AWS Backup Storage The frontend service for Cryo Storage.:

client = session.create_client('backupstorage')

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.

close()

Closes underlying endpoint connections.

delete_object(**kwargs)

Delete Object from the incremental base Backup.

See also: AWS API Documentation

Request Syntax

response = client.delete_object(
    BackupJobId='string',
    ObjectName='string'
)
Parameters:
  • BackupJobId (string) – [REQUIRED] Backup job Id for the in-progress backup.

  • ObjectName (string) – [REQUIRED] The name of the Object.

Returns:

None

Exceptions

get_chunk(**kwargs)

Gets the specified object’s chunk.

See also: AWS API Documentation

Request Syntax

response = client.get_chunk(
    StorageJobId='string',
    ChunkToken='string'
)
Parameters:
  • StorageJobId (string) – [REQUIRED] Storage job id

  • ChunkToken (string) – [REQUIRED] Chunk token

Return type:

dict

Returns:

Response Syntax

{
    'Data': StreamingBody(),
    'Length': 123,
    'Checksum': 'string',
    'ChecksumAlgorithm': 'SHA256'
}

Response Structure

  • (dict) –

    • Data (StreamingBody) – Chunk data

    • Length (integer) – Data length

    • Checksum (string) – Data checksum

    • ChecksumAlgorithm (string) – Checksum algorithm

Exceptions

get_object_metadata(**kwargs)

Get metadata associated with an Object.

See also: AWS API Documentation

Request Syntax

response = client.get_object_metadata(
    StorageJobId='string',
    ObjectToken='string'
)
Parameters:
  • StorageJobId (string) – [REQUIRED] Backup job id for the in-progress backup.

  • ObjectToken (string) – [REQUIRED] Object token.

Return type:

dict

Returns:

Response Syntax

{
    'MetadataString': 'string',
    'MetadataBlob': StreamingBody(),
    'MetadataBlobLength': 123,
    'MetadataBlobChecksum': 'string',
    'MetadataBlobChecksumAlgorithm': 'SHA256'
}

Response Structure

  • (dict) –

    • MetadataString (string) – Metadata string.

    • MetadataBlob (StreamingBody) – Metadata blob.

    • MetadataBlobLength (integer) – The size of MetadataBlob.

    • MetadataBlobChecksum (string) – MetadataBlob checksum.

    • MetadataBlobChecksumAlgorithm (string) – Checksum algorithm.

Exceptions

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_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_chunks(**kwargs)

List chunks in a given Object

See also: AWS API Documentation

Request Syntax

response = client.list_chunks(
    StorageJobId='string',
    ObjectToken='string',
    MaxResults=123,
    NextToken='string'
)
Parameters:
  • StorageJobId (string) – [REQUIRED] Storage job id

  • ObjectToken (string) – [REQUIRED] Object token

  • MaxResults (integer) – Maximum number of chunks

  • NextToken (string) – Pagination token

Return type:

dict

Returns:

Response Syntax

{
    'ChunkList': [
        {
            'Index': 123,
            'Length': 123,
            'Checksum': 'string',
            'ChecksumAlgorithm': 'SHA256',
            'ChunkToken': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • ChunkList (list) – List of chunks

      • (dict) – Chunk

        • Index (integer) – Chunk index

        • Length (integer) – Chunk length

        • Checksum (string) – Chunk checksum

        • ChecksumAlgorithm (string) – Checksum algorithm

        • ChunkToken (string) – Chunk token

    • NextToken (string) – Pagination token

Exceptions

list_objects(**kwargs)

List all Objects in a given Backup.

See also: AWS API Documentation

Request Syntax

response = client.list_objects(
    StorageJobId='string',
    StartingObjectName='string',
    StartingObjectPrefix='string',
    MaxResults=123,
    NextToken='string',
    CreatedBefore=datetime(2015, 1, 1),
    CreatedAfter=datetime(2015, 1, 1)
)
Parameters:
  • StorageJobId (string) – [REQUIRED] Storage job id

  • StartingObjectName (string) – Optional, specifies the starting Object name to list from. Ignored if NextToken is not NULL

  • StartingObjectPrefix (string) – Optional, specifies the starting Object prefix to list from. Ignored if NextToken is not NULL

  • MaxResults (integer) – Maximum objects count

  • NextToken (string) – Pagination token

  • CreatedBefore (datetime) – (Optional) Created before filter

  • CreatedAfter (datetime) – (Optional) Created after filter

Return type:

dict

Returns:

Response Syntax

{
    'ObjectList': [
        {
            'Name': 'string',
            'ChunksCount': 123,
            'MetadataString': 'string',
            'ObjectChecksum': 'string',
            'ObjectChecksumAlgorithm': 'SUMMARY',
            'ObjectToken': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • ObjectList (list) – Object list

      • (dict) – Object

        • Name (string) – Object name

        • ChunksCount (integer) – Number of chunks in object

        • MetadataString (string) – Metadata string associated with the Object

        • ObjectChecksum (string) – Object checksum

        • ObjectChecksumAlgorithm (string) – Checksum algorithm

        • ObjectToken (string) – Object token

    • NextToken (string) – Pagination token

Exceptions

notify_object_complete(**kwargs)

Complete upload

See also: AWS API Documentation

Request Syntax

response = client.notify_object_complete(
    BackupJobId='string',
    UploadId='string',
    ObjectChecksum='string',
    ObjectChecksumAlgorithm='SUMMARY',
    MetadataString='string',
    MetadataBlob=b'bytes'|file,
    MetadataBlobLength=123,
    MetadataBlobChecksum='string',
    MetadataBlobChecksumAlgorithm='SHA256'
)
Parameters:
  • BackupJobId (string) – [REQUIRED] Backup job Id for the in-progress backup

  • UploadId (string) – [REQUIRED] Upload Id for the in-progress upload

  • ObjectChecksum (string) – [REQUIRED] Object checksum

  • ObjectChecksumAlgorithm (string) – [REQUIRED] Checksum algorithm

  • MetadataString (string) – Optional metadata associated with an Object. Maximum string length is 256 bytes.

  • MetadataBlob (bytes or seekable file-like object) – Optional metadata associated with an Object. Maximum length is 4MB.

  • MetadataBlobLength (integer) – The size of MetadataBlob.

  • MetadataBlobChecksum (string) – Checksum of MetadataBlob.

  • MetadataBlobChecksumAlgorithm (string) – Checksum algorithm.

Return type:

dict

Returns:

Response Syntax

{
    'ObjectChecksum': 'string',
    'ObjectChecksumAlgorithm': 'SUMMARY'
}

Response Structure

  • (dict) –

    • ObjectChecksum (string) – Object checksum

    • ObjectChecksumAlgorithm (string) – Checksum algorithm

Exceptions

put_chunk(**kwargs)

Upload chunk.

See also: AWS API Documentation

Request Syntax

response = client.put_chunk(
    BackupJobId='string',
    UploadId='string',
    ChunkIndex=123,
    Data=b'bytes'|file,
    Length=123,
    Checksum='string',
    ChecksumAlgorithm='SHA256'
)
Parameters:
  • BackupJobId (string) – [REQUIRED] Backup job Id for the in-progress backup.

  • UploadId (string) – [REQUIRED] Upload Id for the in-progress upload.

  • ChunkIndex (integer) – [REQUIRED] Describes this chunk’s position relative to the other chunks

  • Data (bytes or seekable file-like object) – [REQUIRED] Data to be uploaded

  • Length (integer) – [REQUIRED] Data length

  • Checksum (string) – [REQUIRED] Data checksum

  • ChecksumAlgorithm (string) – [REQUIRED] Checksum algorithm

Return type:

dict

Returns:

Response Syntax

{
    'ChunkChecksum': 'string',
    'ChunkChecksumAlgorithm': 'SHA256'
}

Response Structure

  • (dict) –

    • ChunkChecksum (string) – Chunk checksum

    • ChunkChecksumAlgorithm (string) – Checksum algorithm

Exceptions

put_object(**kwargs)

Upload object that can store object metadata String and data blob in single API call using inline chunk field.

See also: AWS API Documentation

Request Syntax

response = client.put_object(
    BackupJobId='string',
    ObjectName='string',
    MetadataString='string',
    InlineChunk=b'bytes'|file,
    InlineChunkLength=123,
    InlineChunkChecksum='string',
    InlineChunkChecksumAlgorithm='string',
    ObjectChecksum='string',
    ObjectChecksumAlgorithm='SUMMARY',
    ThrowOnDuplicate=True|False
)
Parameters:
  • BackupJobId (string) – [REQUIRED] Backup job Id for the in-progress backup.

  • ObjectName (string) – [REQUIRED] The name of the Object to be uploaded.

  • MetadataString (string) – Store user defined metadata like backup checksum, disk ids, restore metadata etc.

  • InlineChunk (bytes or seekable file-like object) – Inline chunk data to be uploaded.

  • InlineChunkLength (integer) – Length of the inline chunk data.

  • InlineChunkChecksum (string) – Inline chunk checksum

  • InlineChunkChecksumAlgorithm (string) – Inline chunk checksum algorithm

  • ObjectChecksum (string) – object checksum

  • ObjectChecksumAlgorithm (string) – object checksum algorithm

  • ThrowOnDuplicate (boolean) – Throw an exception if Object name is already exist.

Return type:

dict

Returns:

Response Syntax

{
    'InlineChunkChecksum': 'string',
    'InlineChunkChecksumAlgorithm': 'SHA256',
    'ObjectChecksum': 'string',
    'ObjectChecksumAlgorithm': 'SUMMARY'
}

Response Structure

  • (dict) –

    • InlineChunkChecksum (string) – Inline chunk checksum

    • InlineChunkChecksumAlgorithm (string) – Inline chunk checksum algorithm

    • ObjectChecksum (string) – object checksum

    • ObjectChecksumAlgorithm (string) – object checksum algorithm

Exceptions

start_object(**kwargs)

Start upload containing one or many chunks.

See also: AWS API Documentation

Request Syntax

response = client.start_object(
    BackupJobId='string',
    ObjectName='string',
    ThrowOnDuplicate=True|False
)
Parameters:
  • BackupJobId (string) – [REQUIRED] Backup job Id for the in-progress backup

  • ObjectName (string) – [REQUIRED] Name for the object.

  • ThrowOnDuplicate (boolean) – Throw an exception if Object name is already exist.

Return type:

dict

Returns:

Response Syntax

{
    'UploadId': 'string'
}

Response Structure

  • (dict) –

    • UploadId (string) – Upload Id for a given upload.

Exceptions

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

class BackupStorage.Client.exceptions.AccessDeniedException

Example

try:
  ...
except client.exceptions.AccessDeniedException as e:
  print(e.response)
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) –

    • Message (string) –

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

class BackupStorage.Client.exceptions.DataAlreadyExistsException

Non-retryable exception. Attempted to create already existing object or chunk. This message contains a checksum of already presented data.

Example

try:
  ...
except client.exceptions.DataAlreadyExistsException as e:
  print(e.response)
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',
    'Checksum': 'string',
    'ChecksumAlgorithm': 'string',
    'Error': {
        'Code': 'string',
        'Message': 'string'
    }
}

Structure

  • (dict) – Non-retryable exception. Attempted to create already existing object or chunk. This message contains a checksum of already presented data.

    • Message (string) –

    • Checksum (string) – Data checksum used

    • ChecksumAlgorithm (string) – Checksum algorithm used

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

class BackupStorage.Client.exceptions.IllegalArgumentException

Non-retryable exception, indicates client error (wrong argument passed to API). See exception message for details.

Example

try:
  ...
except client.exceptions.IllegalArgumentException as e:
  print(e.response)
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) – Non-retryable exception, indicates client error (wrong argument passed to API). See exception message for details.

    • Message (string) –

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

class BackupStorage.Client.exceptions.KMSInvalidKeyUsageException

Non-retryable exception. Indicates the KMS key usage is incorrect. See exception message for details.

Example

try:
  ...
except client.exceptions.KMSInvalidKeyUsageException as e:
  print(e.response)
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) – Non-retryable exception. Indicates the KMS key usage is incorrect. See exception message for details.

    • Message (string) –

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

class BackupStorage.Client.exceptions.NotReadableInputStreamException

Retryalble exception. Indicated issues while reading an input stream due to the networking issues or connection drop on the client side.

Example

try:
  ...
except client.exceptions.NotReadableInputStreamException as e:
  print(e.response)
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) – Retryalble exception. Indicated issues while reading an input stream due to the networking issues or connection drop on the client side.

    • Message (string) –

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

class BackupStorage.Client.exceptions.ResourceNotFoundException

Non-retryable exception. Attempted to make an operation on non-existing or expired resource.

Example

try:
  ...
except client.exceptions.ResourceNotFoundException as e:
  print(e.response)
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) – Non-retryable exception. Attempted to make an operation on non-existing or expired resource.

    • Message (string) –

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

class BackupStorage.Client.exceptions.RetryableException

Retryable exception. In general indicates internal failure that can be fixed by retry.

Example

try:
  ...
except client.exceptions.RetryableException as e:
  print(e.response)
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) – Retryable exception. In general indicates internal failure that can be fixed by retry.

    • Message (string) –

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

class BackupStorage.Client.exceptions.ServiceInternalException

Deprecated. To be removed from the model.

Example

try:
  ...
except client.exceptions.ServiceInternalException as e:
  print(e.response)
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) – Deprecated. To be removed from the model.

    • Message (string) –

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

class BackupStorage.Client.exceptions.ServiceUnavailableException

Retryable exception, indicates internal server error.

Example

try:
  ...
except client.exceptions.ServiceUnavailableException as e:
  print(e.response)
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) – Retryable exception, indicates internal server error.

    • Message (string) –

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

class BackupStorage.Client.exceptions.ThrottlingException

Increased rate over throttling limits. Can be retried with exponential backoff.

Example

try:
  ...
except client.exceptions.ThrottlingException as e:
  print(e.response)
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) – Increased rate over throttling limits. Can be retried with exponential backoff.

    • Message (string) –

    • Error (dict) – Normalized access to common exception attributes.

      • Code (string) – An identifier specifying the exception type.

      • Message (string) – A descriptive message explaining why the exception occured.

Paginators

The available paginators are: