QLDB / Client / get_block

get_block#

QLDB.Client.get_block(**kwargs)#

Returns a block object at a specified address in a journal. Also returns a proof of the specified block for verification if DigestTipAddress is provided.

For information about the data contents in a block, see Journal contents in the Amazon QLDB Developer Guide.

If the specified ledger doesn’t exist or is in DELETING status, then throws ResourceNotFoundException.

If the specified ledger is in CREATING status, then throws ResourcePreconditionNotMetException.

If no block exists with the specified address, then throws InvalidParameterException.

See also: AWS API Documentation

Request Syntax

response = client.get_block(
    Name='string',
    BlockAddress={
        'IonText': 'string'
    },
    DigestTipAddress={
        'IonText': 'string'
    }
)
Parameters:
  • Name (string) –

    [REQUIRED]

    The name of the ledger.

  • BlockAddress (dict) –

    [REQUIRED]

    The location of the block that you want to request. An address is an Amazon Ion structure that has two fields: strandId and sequenceNo.

    For example: {strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:14}.

    • IonText (string) –

      An Amazon Ion plaintext value contained in a ValueHolder structure.

  • DigestTipAddress (dict) –

    The latest block location covered by the digest for which to request a proof. An address is an Amazon Ion structure that has two fields: strandId and sequenceNo.

    For example: {strandId:"BlFTjlSXze9BIh1KOszcE3",sequenceNo:49}.

    • IonText (string) –

      An Amazon Ion plaintext value contained in a ValueHolder structure.

Return type:

dict

Returns:

Response Syntax

{
    'Block': {
        'IonText': 'string'
    },
    'Proof': {
        'IonText': 'string'
    }
}

Response Structure

  • (dict) –

    • Block (dict) –

      The block data object in Amazon Ion format.

      • IonText (string) –

        An Amazon Ion plaintext value contained in a ValueHolder structure.

    • Proof (dict) –

      The proof object in Amazon Ion format returned by a GetBlock request. A proof contains the list of hash values required to recalculate the specified digest using a Merkle tree, starting with the specified block.

      • IonText (string) –

        An Amazon Ion plaintext value contained in a ValueHolder structure.

Exceptions

  • QLDB.Client.exceptions.InvalidParameterException

  • QLDB.Client.exceptions.ResourceNotFoundException

  • QLDB.Client.exceptions.ResourcePreconditionNotMetException