QLDB

Table of Contents

Client

class QLDB.Client

A low-level client representing Amazon QLDB

The control plane for Amazon QLDB

import boto3

client = boto3.client('qldb')

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.
cancel_journal_kinesis_stream(**kwargs)

Ends a given Amazon QLDB journal stream. Before a stream can be canceled, its current status must be ACTIVE .

You can't restart a stream after you cancel it. Canceled QLDB stream resources are subject to a 7-day retention period, so they are automatically deleted after this limit expires.

See also: AWS API Documentation

Request Syntax

response = client.cancel_journal_kinesis_stream(
    LedgerName='string',
    StreamId='string'
)
Parameters
  • LedgerName (string) --

    [REQUIRED]

    The name of the ledger.

  • StreamId (string) --

    [REQUIRED]

    The UUID (represented in Base62-encoded text) of the QLDB journal stream to be canceled.

Return type

dict

Returns

Response Syntax

{
    'StreamId': 'string'
}

Response Structure

  • (dict) --

    • StreamId (string) --

      The UUID (Base62-encoded text) of the canceled QLDB journal stream.

Exceptions

  • QLDB.Client.exceptions.InvalidParameterException
  • QLDB.Client.exceptions.ResourceNotFoundException
  • QLDB.Client.exceptions.ResourcePreconditionNotMetException
close()

Closes underlying endpoint connections.

create_ledger(**kwargs)

Creates a new ledger in your Amazon Web Services account in the current Region.

See also: AWS API Documentation

Request Syntax

response = client.create_ledger(
    Name='string',
    Tags={
        'string': 'string'
    },
    PermissionsMode='ALLOW_ALL'|'STANDARD',
    DeletionProtection=True|False,
    KmsKey='string'
)
Parameters
  • Name (string) --

    [REQUIRED]

    The name of the ledger that you want to create. The name must be unique among all of the ledgers in your Amazon Web Services account in the current Region.

    Naming constraints for ledger names are defined in Quotas in Amazon QLDB in the Amazon QLDB Developer Guide .

  • Tags (dict) --

    The key-value pairs to add as tags to the ledger that you want to create. Tag keys are case sensitive. Tag values are case sensitive and can be null.

    • (string) --
      • (string) --
  • PermissionsMode (string) --

    [REQUIRED]

    The permissions mode to assign to the ledger that you want to create. This parameter can have one of the following values:

    • ALLOW_ALL : A legacy permissions mode that enables access control with API-level granularity for ledgers. This mode allows users who have the SendCommand API permission for this ledger to run all PartiQL commands (hence, ALLOW_ALL ) on any tables in the specified ledger. This mode disregards any table-level or command-level IAM permissions policies that you create for the ledger.
    • STANDARD : (Recommended ) A permissions mode that enables access control with finer granularity for ledgers, tables, and PartiQL commands. By default, this mode denies all user requests to run any PartiQL commands on any tables in this ledger. To allow PartiQL commands to run, you must create IAM permissions policies for specific table resources and PartiQL actions, in addition to the SendCommand API permission for the ledger. For information, see Getting started with the standard permissions mode in the Amazon QLDB Developer Guide .

    Note

    We strongly recommend using the STANDARD permissions mode to maximize the security of your ledger data.

  • DeletionProtection (boolean) --

    The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled ( true ) by default.

    If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the UpdateLedger operation to set the flag to false .

  • KmsKey (string) --

    The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more information, see Encryption at rest in the Amazon QLDB Developer Guide .

    Use one of the following options to specify this parameter:

    • AWS_OWNED_KMS_KEY : Use an KMS key that is owned and managed by Amazon Web Services on your behalf.
    • Undefined : By default, use an Amazon Web Services owned KMS key.
    • A valid symmetric customer managed KMS key : Use the specified KMS key in your account that you create, own, and manage. Amazon QLDB does not support asymmetric keys. For more information, see Using symmetric and asymmetric keys in the Key Management Service Developer Guide .

    To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with "alias/" . To specify a key in a different Amazon Web Services account, you must use the key ARN or alias ARN.

    For example:

    • Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
    • Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
    • Alias name: alias/ExampleAlias
    • Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias

    For more information, see Key identifiers (KeyId) in the Key Management Service Developer Guide .

Return type

dict

Returns

Response Syntax

{
    'Name': 'string',
    'Arn': 'string',
    'State': 'CREATING'|'ACTIVE'|'DELETING'|'DELETED',
    'CreationDateTime': datetime(2015, 1, 1),
    'PermissionsMode': 'ALLOW_ALL'|'STANDARD',
    'DeletionProtection': True|False,
    'KmsKeyArn': 'string'
}

Response Structure

  • (dict) --

    • Name (string) --

      The name of the ledger.

    • Arn (string) --

      The Amazon Resource Name (ARN) for the ledger.

    • State (string) --

      The current status of the ledger.

    • CreationDateTime (datetime) --

      The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)

    • PermissionsMode (string) --

      The permissions mode of the ledger that you created.

    • DeletionProtection (boolean) --

      The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled ( true ) by default.

      If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the UpdateLedger operation to set the flag to false .

    • KmsKeyArn (string) --

      The ARN of the customer managed KMS key that the ledger uses for encryption at rest. If this parameter is undefined, the ledger uses an Amazon Web Services owned KMS key for encryption.

Exceptions

  • QLDB.Client.exceptions.InvalidParameterException
  • QLDB.Client.exceptions.ResourceAlreadyExistsException
  • QLDB.Client.exceptions.LimitExceededException
  • QLDB.Client.exceptions.ResourceInUseException
delete_ledger(**kwargs)

Deletes a ledger and all of its contents. This action is irreversible.

If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the UpdateLedger operation to set the flag to false .

See also: AWS API Documentation

Request Syntax

response = client.delete_ledger(
    Name='string'
)
Parameters
Name (string) --

[REQUIRED]

The name of the ledger that you want to delete.

Returns
None

Exceptions

  • QLDB.Client.exceptions.InvalidParameterException
  • QLDB.Client.exceptions.ResourceNotFoundException
  • QLDB.Client.exceptions.ResourceInUseException
  • QLDB.Client.exceptions.ResourcePreconditionNotMetException
describe_journal_kinesis_stream(**kwargs)

Returns detailed information about a given Amazon QLDB journal stream. The output includes the Amazon Resource Name (ARN), stream name, current status, creation time, and the parameters of the original stream creation request.

This action does not return any expired journal streams. For more information, see Expiration for terminal streams in the Amazon QLDB Developer Guide .

See also: AWS API Documentation

Request Syntax

response = client.describe_journal_kinesis_stream(
    LedgerName='string',
    StreamId='string'
)
Parameters
  • LedgerName (string) --

    [REQUIRED]

    The name of the ledger.

  • StreamId (string) --

    [REQUIRED]

    The UUID (represented in Base62-encoded text) of the QLDB journal stream to describe.

Return type

dict

Returns

Response Syntax

{
    'Stream': {
        'LedgerName': 'string',
        'CreationTime': datetime(2015, 1, 1),
        'InclusiveStartTime': datetime(2015, 1, 1),
        'ExclusiveEndTime': datetime(2015, 1, 1),
        'RoleArn': 'string',
        'StreamId': 'string',
        'Arn': 'string',
        'Status': 'ACTIVE'|'COMPLETED'|'CANCELED'|'FAILED'|'IMPAIRED',
        'KinesisConfiguration': {
            'StreamArn': 'string',
            'AggregationEnabled': True|False
        },
        'ErrorCause': 'KINESIS_STREAM_NOT_FOUND'|'IAM_PERMISSION_REVOKED',
        'StreamName': 'string'
    }
}

Response Structure

  • (dict) --

    • Stream (dict) --

      Information about the QLDB journal stream returned by a DescribeJournalS3Export request.

      • LedgerName (string) --

        The name of the ledger.

      • CreationTime (datetime) --

        The date and time, in epoch time format, when the QLDB journal stream was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)

      • InclusiveStartTime (datetime) --

        The inclusive start date and time from which to start streaming journal data.

      • ExclusiveEndTime (datetime) --

        The exclusive date and time that specifies when the stream ends. If this parameter is undefined, the stream runs indefinitely until you cancel it.

      • RoleArn (string) --

        The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal stream to write data records to a Kinesis Data Streams resource.

      • StreamId (string) --

        The UUID (represented in Base62-encoded text) of the QLDB journal stream.

      • Arn (string) --

        The Amazon Resource Name (ARN) of the QLDB journal stream.

      • Status (string) --

        The current state of the QLDB journal stream.

      • KinesisConfiguration (dict) --

        The configuration settings of the Amazon Kinesis Data Streams destination for a QLDB journal stream.

        • StreamArn (string) --

          The Amazon Resource Name (ARN) of the Kinesis Data Streams resource.

        • AggregationEnabled (boolean) --

          Enables QLDB to publish multiple data records in a single Kinesis Data Streams record, increasing the number of records sent per API call.

          This option is enabled by default. Record aggregation has important implications for processing records and requires de-aggregation in your stream consumer. To learn more, see KPL Key Concepts and Consumer De-aggregation in the Amazon Kinesis Data Streams Developer Guide .

      • ErrorCause (string) --

        The error message that describes the reason that a stream has a status of IMPAIRED or FAILED . This is not applicable to streams that have other status values.

      • StreamName (string) --

        The user-defined name of the QLDB journal stream.

Exceptions

  • QLDB.Client.exceptions.InvalidParameterException
  • QLDB.Client.exceptions.ResourceNotFoundException
  • QLDB.Client.exceptions.ResourcePreconditionNotMetException
describe_journal_s3_export(**kwargs)

Returns information about a journal export job, including the ledger name, export ID, creation time, current status, and the parameters of the original export creation request.

This action does not return any expired export jobs. For more information, see Export job expiration in the Amazon QLDB Developer Guide .

If the export job with the given ExportId doesn't exist, then throws ResourceNotFoundException .

If the ledger with the given Name doesn't exist, then throws ResourceNotFoundException .

See also: AWS API Documentation

Request Syntax

response = client.describe_journal_s3_export(
    Name='string',
    ExportId='string'
)
Parameters
  • Name (string) --

    [REQUIRED]

    The name of the ledger.

  • ExportId (string) --

    [REQUIRED]

    The UUID (represented in Base62-encoded text) of the journal export job to describe.

Return type

dict

Returns

Response Syntax

{
    'ExportDescription': {
        'LedgerName': 'string',
        'ExportId': 'string',
        'ExportCreationTime': datetime(2015, 1, 1),
        'Status': 'IN_PROGRESS'|'COMPLETED'|'CANCELLED',
        'InclusiveStartTime': datetime(2015, 1, 1),
        'ExclusiveEndTime': datetime(2015, 1, 1),
        'S3ExportConfiguration': {
            'Bucket': 'string',
            'Prefix': 'string',
            'EncryptionConfiguration': {
                'ObjectEncryptionType': 'SSE_KMS'|'SSE_S3'|'NO_ENCRYPTION',
                'KmsKeyArn': 'string'
            }
        },
        'RoleArn': 'string',
        'OutputFormat': 'ION_BINARY'|'ION_TEXT'|'JSON'
    }
}

Response Structure

  • (dict) --

    • ExportDescription (dict) --

      Information about the journal export job returned by a DescribeJournalS3Export request.

      • LedgerName (string) --

        The name of the ledger.

      • ExportId (string) --

        The UUID (represented in Base62-encoded text) of the journal export job.

      • ExportCreationTime (datetime) --

        The date and time, in epoch time format, when the export job was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)

      • Status (string) --

        The current state of the journal export job.

      • InclusiveStartTime (datetime) --

        The inclusive start date and time for the range of journal contents that was specified in the original export request.

      • ExclusiveEndTime (datetime) --

        The exclusive end date and time for the range of journal contents that was specified in the original export request.

      • S3ExportConfiguration (dict) --

        The Amazon Simple Storage Service (Amazon S3) bucket location in which a journal export job writes the journal contents.

        • Bucket (string) --

          The Amazon S3 bucket name in which a journal export job writes the journal contents.

          The bucket name must comply with the Amazon S3 bucket naming conventions. For more information, see Bucket Restrictions and Limitations in the Amazon S3 Developer Guide .

        • Prefix (string) --

          The prefix for the Amazon S3 bucket in which a journal export job writes the journal contents.

          The prefix must comply with Amazon S3 key naming rules and restrictions. For more information, see Object Key and Metadata in the Amazon S3 Developer Guide .

          The following are examples of valid Prefix values:

          • JournalExports-ForMyLedger/Testing/
          • JournalExports
          • My:Tests/
        • EncryptionConfiguration (dict) --

          The encryption settings that are used by a journal export job to write data in an Amazon S3 bucket.

          • ObjectEncryptionType (string) --

            The Amazon S3 object encryption type.

            To learn more about server-side encryption options in Amazon S3, see Protecting Data Using Server-Side Encryption in the Amazon S3 Developer Guide .

          • KmsKeyArn (string) --

            The Amazon Resource Name (ARN) of a symmetric key in Key Management Service (KMS). Amazon S3 does not support asymmetric KMS keys.

            You must provide a KmsKeyArn if you specify SSE_KMS as the ObjectEncryptionType .

            KmsKeyArn is not required if you specify SSE_S3 as the ObjectEncryptionType .

      • RoleArn (string) --

        The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal export job to do the following:

        • Write objects into your Amazon Simple Storage Service (Amazon S3) bucket.
        • (Optional) Use your customer managed key in Key Management Service (KMS) for server-side encryption of your exported data.
      • OutputFormat (string) --

        The output format of the exported journal data.

Exceptions

  • QLDB.Client.exceptions.ResourceNotFoundException
describe_ledger(**kwargs)

Returns information about a ledger, including its state, permissions mode, encryption at rest settings, and when it was created.

See also: AWS API Documentation

Request Syntax

response = client.describe_ledger(
    Name='string'
)
Parameters
Name (string) --

[REQUIRED]

The name of the ledger that you want to describe.

Return type
dict
Returns
Response Syntax
{
    'Name': 'string',
    'Arn': 'string',
    'State': 'CREATING'|'ACTIVE'|'DELETING'|'DELETED',
    'CreationDateTime': datetime(2015, 1, 1),
    'PermissionsMode': 'ALLOW_ALL'|'STANDARD',
    'DeletionProtection': True|False,
    'EncryptionDescription': {
        'KmsKeyArn': 'string',
        'EncryptionStatus': 'ENABLED'|'UPDATING'|'KMS_KEY_INACCESSIBLE',
        'InaccessibleKmsKeyDateTime': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --
    • Name (string) --

      The name of the ledger.

    • Arn (string) --

      The Amazon Resource Name (ARN) for the ledger.

    • State (string) --

      The current status of the ledger.

    • CreationDateTime (datetime) --

      The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)

    • PermissionsMode (string) --

      The permissions mode of the ledger.

    • DeletionProtection (boolean) --

      The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled ( true ) by default.

      If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the UpdateLedger operation to set the flag to false .

    • EncryptionDescription (dict) --

      Information about the encryption of data at rest in the ledger. This includes the current status, the KMS key, and when the key became inaccessible (in the case of an error).

      • KmsKeyArn (string) --

        The Amazon Resource Name (ARN) of the customer managed KMS key that the ledger uses for encryption at rest. If this parameter is undefined, the ledger uses an Amazon Web Services owned KMS key for encryption.

      • EncryptionStatus (string) --

        The current state of encryption at rest for the ledger. This can be one of the following values:

        • ENABLED : Encryption is fully enabled using the specified key.
        • UPDATING : The ledger is actively processing the specified key change. Key changes in QLDB are asynchronous. The ledger is fully accessible without any performance impact while the key change is being processed. The amount of time it takes to update a key varies depending on the ledger size.
        • KMS_KEY_INACCESSIBLE : The specified customer managed KMS key is not accessible, and the ledger is impaired. Either the key was disabled or deleted, or the grants on the key were revoked. When a ledger is impaired, it is not accessible and does not accept any read or write requests. An impaired ledger automatically returns to an active state after you restore the grants on the key, or re-enable the key that was disabled. However, deleting a customer managed KMS key is irreversible. After a key is deleted, you can no longer access the ledgers that are protected with that key, and the data becomes unrecoverable permanently.
      • InaccessibleKmsKeyDateTime (datetime) --

        The date and time, in epoch time format, when the KMS key first became inaccessible, in the case of an error. (Epoch time format is the number of seconds that have elapsed since 12:00:00 AM January 1, 1970 UTC.)

        This parameter is undefined if the KMS key is accessible.

Exceptions

  • QLDB.Client.exceptions.InvalidParameterException
  • QLDB.Client.exceptions.ResourceNotFoundException
export_journal_to_s3(**kwargs)

Exports journal contents within a date and time range from a ledger into a specified Amazon Simple Storage Service (Amazon S3) bucket. A journal export job can write the data objects in either the text or binary representation of Amazon Ion format, or in JSON Lines text format.

In JSON Lines format, each journal block in the exported data object is a valid JSON object that is delimited by a newline. You can use this format to easily integrate JSON exports with analytics tools such as Glue and Amazon Athena because these services can parse newline-delimited JSON automatically. For more information about the format, see JSON Lines.

If the ledger with the given Name doesn't exist, then throws ResourceNotFoundException .

If the ledger with the given Name is in CREATING status, then throws ResourcePreconditionNotMetException .

You can initiate up to two concurrent journal export requests for each ledger. Beyond this limit, journal export requests throw LimitExceededException .

See also: AWS API Documentation

Request Syntax

response = client.export_journal_to_s3(
    Name='string',
    InclusiveStartTime=datetime(2015, 1, 1),
    ExclusiveEndTime=datetime(2015, 1, 1),
    S3ExportConfiguration={
        'Bucket': 'string',
        'Prefix': 'string',
        'EncryptionConfiguration': {
            'ObjectEncryptionType': 'SSE_KMS'|'SSE_S3'|'NO_ENCRYPTION',
            'KmsKeyArn': 'string'
        }
    },
    RoleArn='string',
    OutputFormat='ION_BINARY'|'ION_TEXT'|'JSON'
)
Parameters
  • Name (string) --

    [REQUIRED]

    The name of the ledger.

  • InclusiveStartTime (datetime) --

    [REQUIRED]

    The inclusive start date and time for the range of journal contents to export.

    The InclusiveStartTime must be in ISO 8601 date and time format and in Universal Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z .

    The InclusiveStartTime must be before ExclusiveEndTime .

    If you provide an InclusiveStartTime that is before the ledger's CreationDateTime , Amazon QLDB defaults it to the ledger's CreationDateTime .

  • ExclusiveEndTime (datetime) --

    [REQUIRED]

    The exclusive end date and time for the range of journal contents to export.

    The ExclusiveEndTime must be in ISO 8601 date and time format and in Universal Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z .

    The ExclusiveEndTime must be less than or equal to the current UTC date and time.

  • S3ExportConfiguration (dict) --

    [REQUIRED]

    The configuration settings of the Amazon S3 bucket destination for your export request.

    • Bucket (string) -- [REQUIRED]

      The Amazon S3 bucket name in which a journal export job writes the journal contents.

      The bucket name must comply with the Amazon S3 bucket naming conventions. For more information, see Bucket Restrictions and Limitations in the Amazon S3 Developer Guide .

    • Prefix (string) -- [REQUIRED]

      The prefix for the Amazon S3 bucket in which a journal export job writes the journal contents.

      The prefix must comply with Amazon S3 key naming rules and restrictions. For more information, see Object Key and Metadata in the Amazon S3 Developer Guide .

      The following are examples of valid Prefix values:

      • JournalExports-ForMyLedger/Testing/
      • JournalExports
      • My:Tests/
    • EncryptionConfiguration (dict) -- [REQUIRED]

      The encryption settings that are used by a journal export job to write data in an Amazon S3 bucket.

      • ObjectEncryptionType (string) -- [REQUIRED]

        The Amazon S3 object encryption type.

        To learn more about server-side encryption options in Amazon S3, see Protecting Data Using Server-Side Encryption in the Amazon S3 Developer Guide .

      • KmsKeyArn (string) --

        The Amazon Resource Name (ARN) of a symmetric key in Key Management Service (KMS). Amazon S3 does not support asymmetric KMS keys.

        You must provide a KmsKeyArn if you specify SSE_KMS as the ObjectEncryptionType .

        KmsKeyArn is not required if you specify SSE_S3 as the ObjectEncryptionType .
  • RoleArn (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal export job to do the following:

    • Write objects into your Amazon Simple Storage Service (Amazon S3) bucket.
    • (Optional) Use your customer managed key in Key Management Service (KMS) for server-side encryption of your exported data.

    To pass a role to QLDB when requesting a journal export, you must have permissions to perform the iam:PassRole action on the IAM role resource. This is required for all journal export requests.

  • OutputFormat (string) -- The output format of your exported journal data. If this parameter is not specified, the exported data defaults to ION_TEXT format.
Return type

dict

Returns

Response Syntax

{
    'ExportId': 'string'
}

Response Structure

  • (dict) --

    • ExportId (string) --

      The UUID (represented in Base62-encoded text) that QLDB assigns to each journal export job.

      To describe your export request and check the status of the job, you can use ExportId to call DescribeJournalS3Export .

Exceptions

  • QLDB.Client.exceptions.ResourceNotFoundException
  • QLDB.Client.exceptions.ResourcePreconditionNotMetException
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
get_digest(**kwargs)

Returns the digest of a ledger at the latest committed block in the journal. The response includes a 256-bit hash value and a block address.

See also: AWS API Documentation

Request Syntax

response = client.get_digest(
    Name='string'
)
Parameters
Name (string) --

[REQUIRED]

The name of the ledger.

Return type
dict
Returns
Response Syntax
{
    'Digest': b'bytes',
    'DigestTipAddress': {
        'IonText': 'string'
    }
}

Response Structure

  • (dict) --
    • Digest (bytes) --

      The 256-bit hash value representing the digest returned by a GetDigest request.

    • DigestTipAddress (dict) --

      The latest block location covered by the digest that you requested. An address is an Amazon Ion structure that has two fields: strandId and sequenceNo .

      • 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
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_revision(**kwargs)

Returns a revision data object for a specified document ID and block address. Also returns a proof of the specified revision for verification if DigestTipAddress is provided.

See also: AWS API Documentation

Request Syntax

response = client.get_revision(
    Name='string',
    BlockAddress={
        'IonText': 'string'
    },
    DocumentId='string',
    DigestTipAddress={
        'IonText': 'string'
    }
)
Parameters
  • Name (string) --

    [REQUIRED]

    The name of the ledger.

  • BlockAddress (dict) --

    [REQUIRED]

    The block location of the document revision to be verified. 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.

  • DocumentId (string) --

    [REQUIRED]

    The UUID (represented in Base62-encoded text) of the document to be verified.

  • 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

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

Response Structure

  • (dict) --

    • Proof (dict) --

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

      • IonText (string) --

        An Amazon Ion plaintext value contained in a ValueHolder structure.

    • Revision (dict) --

      The document revision data object in Amazon Ion format.

      • 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
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_journal_kinesis_streams_for_ledger(**kwargs)

Returns an array of all Amazon QLDB journal stream descriptors for a given ledger. The output of each stream descriptor includes the same details that are returned by DescribeJournalKinesisStream .

This action does not return any expired journal streams. For more information, see Expiration for terminal streams in the Amazon QLDB Developer Guide .

This action returns a maximum of MaxResults items. It is paginated so that you can retrieve all the items by calling ListJournalKinesisStreamsForLedger multiple times.

See also: AWS API Documentation

Request Syntax

response = client.list_journal_kinesis_streams_for_ledger(
    LedgerName='string',
    MaxResults=123,
    NextToken='string'
)
Parameters
  • LedgerName (string) --

    [REQUIRED]

    The name of the ledger.

  • MaxResults (integer) -- The maximum number of results to return in a single ListJournalKinesisStreamsForLedger request. (The actual number of results returned might be fewer.)
  • NextToken (string) -- A pagination token, indicating that you want to retrieve the next page of results. If you received a value for NextToken in the response from a previous ListJournalKinesisStreamsForLedger call, you should use that value as input here.
Return type

dict

Returns

Response Syntax

{
    'Streams': [
        {
            'LedgerName': 'string',
            'CreationTime': datetime(2015, 1, 1),
            'InclusiveStartTime': datetime(2015, 1, 1),
            'ExclusiveEndTime': datetime(2015, 1, 1),
            'RoleArn': 'string',
            'StreamId': 'string',
            'Arn': 'string',
            'Status': 'ACTIVE'|'COMPLETED'|'CANCELED'|'FAILED'|'IMPAIRED',
            'KinesisConfiguration': {
                'StreamArn': 'string',
                'AggregationEnabled': True|False
            },
            'ErrorCause': 'KINESIS_STREAM_NOT_FOUND'|'IAM_PERMISSION_REVOKED',
            'StreamName': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Streams (list) --

      The array of QLDB journal stream descriptors that are associated with the given ledger.

      • (dict) --

        Information about an Amazon QLDB journal stream, including the Amazon Resource Name (ARN), stream name, creation time, current status, and the parameters of the original stream creation request.

        • LedgerName (string) --

          The name of the ledger.

        • CreationTime (datetime) --

          The date and time, in epoch time format, when the QLDB journal stream was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)

        • InclusiveStartTime (datetime) --

          The inclusive start date and time from which to start streaming journal data.

        • ExclusiveEndTime (datetime) --

          The exclusive date and time that specifies when the stream ends. If this parameter is undefined, the stream runs indefinitely until you cancel it.

        • RoleArn (string) --

          The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal stream to write data records to a Kinesis Data Streams resource.

        • StreamId (string) --

          The UUID (represented in Base62-encoded text) of the QLDB journal stream.

        • Arn (string) --

          The Amazon Resource Name (ARN) of the QLDB journal stream.

        • Status (string) --

          The current state of the QLDB journal stream.

        • KinesisConfiguration (dict) --

          The configuration settings of the Amazon Kinesis Data Streams destination for a QLDB journal stream.

          • StreamArn (string) --

            The Amazon Resource Name (ARN) of the Kinesis Data Streams resource.

          • AggregationEnabled (boolean) --

            Enables QLDB to publish multiple data records in a single Kinesis Data Streams record, increasing the number of records sent per API call.

            This option is enabled by default. Record aggregation has important implications for processing records and requires de-aggregation in your stream consumer. To learn more, see KPL Key Concepts and Consumer De-aggregation in the Amazon Kinesis Data Streams Developer Guide .

        • ErrorCause (string) --

          The error message that describes the reason that a stream has a status of IMPAIRED or FAILED . This is not applicable to streams that have other status values.

        • StreamName (string) --

          The user-defined name of the QLDB journal stream.

    • NextToken (string) --

      • If NextToken is empty, the last page of results has been processed and there are no more results to be retrieved.
      • If NextToken is not empty, more results are available. To retrieve the next page of results, use the value of NextToken in a subsequent ListJournalKinesisStreamsForLedger call.

Exceptions

  • QLDB.Client.exceptions.InvalidParameterException
  • QLDB.Client.exceptions.ResourceNotFoundException
  • QLDB.Client.exceptions.ResourcePreconditionNotMetException
list_journal_s3_exports(**kwargs)

Returns an array of journal export job descriptions for all ledgers that are associated with the current Amazon Web Services account and Region.

This action returns a maximum of MaxResults items, and is paginated so that you can retrieve all the items by calling ListJournalS3Exports multiple times.

This action does not return any expired export jobs. For more information, see Export job expiration in the Amazon QLDB Developer Guide .

See also: AWS API Documentation

Request Syntax

response = client.list_journal_s3_exports(
    MaxResults=123,
    NextToken='string'
)
Parameters
  • MaxResults (integer) -- The maximum number of results to return in a single ListJournalS3Exports request. (The actual number of results returned might be fewer.)
  • NextToken (string) -- A pagination token, indicating that you want to retrieve the next page of results. If you received a value for NextToken in the response from a previous ListJournalS3Exports call, then you should use that value as input here.
Return type

dict

Returns

Response Syntax

{
    'JournalS3Exports': [
        {
            'LedgerName': 'string',
            'ExportId': 'string',
            'ExportCreationTime': datetime(2015, 1, 1),
            'Status': 'IN_PROGRESS'|'COMPLETED'|'CANCELLED',
            'InclusiveStartTime': datetime(2015, 1, 1),
            'ExclusiveEndTime': datetime(2015, 1, 1),
            'S3ExportConfiguration': {
                'Bucket': 'string',
                'Prefix': 'string',
                'EncryptionConfiguration': {
                    'ObjectEncryptionType': 'SSE_KMS'|'SSE_S3'|'NO_ENCRYPTION',
                    'KmsKeyArn': 'string'
                }
            },
            'RoleArn': 'string',
            'OutputFormat': 'ION_BINARY'|'ION_TEXT'|'JSON'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • JournalS3Exports (list) --

      The array of journal export job descriptions for all ledgers that are associated with the current Amazon Web Services account and Region.

      • (dict) --

        Information about a journal export job, including the ledger name, export ID, creation time, current status, and the parameters of the original export creation request.

        • LedgerName (string) --

          The name of the ledger.

        • ExportId (string) --

          The UUID (represented in Base62-encoded text) of the journal export job.

        • ExportCreationTime (datetime) --

          The date and time, in epoch time format, when the export job was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)

        • Status (string) --

          The current state of the journal export job.

        • InclusiveStartTime (datetime) --

          The inclusive start date and time for the range of journal contents that was specified in the original export request.

        • ExclusiveEndTime (datetime) --

          The exclusive end date and time for the range of journal contents that was specified in the original export request.

        • S3ExportConfiguration (dict) --

          The Amazon Simple Storage Service (Amazon S3) bucket location in which a journal export job writes the journal contents.

          • Bucket (string) --

            The Amazon S3 bucket name in which a journal export job writes the journal contents.

            The bucket name must comply with the Amazon S3 bucket naming conventions. For more information, see Bucket Restrictions and Limitations in the Amazon S3 Developer Guide .

          • Prefix (string) --

            The prefix for the Amazon S3 bucket in which a journal export job writes the journal contents.

            The prefix must comply with Amazon S3 key naming rules and restrictions. For more information, see Object Key and Metadata in the Amazon S3 Developer Guide .

            The following are examples of valid Prefix values:

            • JournalExports-ForMyLedger/Testing/
            • JournalExports
            • My:Tests/
          • EncryptionConfiguration (dict) --

            The encryption settings that are used by a journal export job to write data in an Amazon S3 bucket.

            • ObjectEncryptionType (string) --

              The Amazon S3 object encryption type.

              To learn more about server-side encryption options in Amazon S3, see Protecting Data Using Server-Side Encryption in the Amazon S3 Developer Guide .

            • KmsKeyArn (string) --

              The Amazon Resource Name (ARN) of a symmetric key in Key Management Service (KMS). Amazon S3 does not support asymmetric KMS keys.

              You must provide a KmsKeyArn if you specify SSE_KMS as the ObjectEncryptionType .

              KmsKeyArn is not required if you specify SSE_S3 as the ObjectEncryptionType .

        • RoleArn (string) --

          The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal export job to do the following:

          • Write objects into your Amazon Simple Storage Service (Amazon S3) bucket.
          • (Optional) Use your customer managed key in Key Management Service (KMS) for server-side encryption of your exported data.
        • OutputFormat (string) --

          The output format of the exported journal data.

    • NextToken (string) --

      • If NextToken is empty, then the last page of results has been processed and there are no more results to be retrieved.
      • If NextToken is not empty, then there are more results available. To retrieve the next page of results, use the value of NextToken in a subsequent ListJournalS3Exports call.

list_journal_s3_exports_for_ledger(**kwargs)

Returns an array of journal export job descriptions for a specified ledger.

This action returns a maximum of MaxResults items, and is paginated so that you can retrieve all the items by calling ListJournalS3ExportsForLedger multiple times.

This action does not return any expired export jobs. For more information, see Export job expiration in the Amazon QLDB Developer Guide .

See also: AWS API Documentation

Request Syntax

response = client.list_journal_s3_exports_for_ledger(
    Name='string',
    MaxResults=123,
    NextToken='string'
)
Parameters
  • Name (string) --

    [REQUIRED]

    The name of the ledger.

  • MaxResults (integer) -- The maximum number of results to return in a single ListJournalS3ExportsForLedger request. (The actual number of results returned might be fewer.)
  • NextToken (string) -- A pagination token, indicating that you want to retrieve the next page of results. If you received a value for NextToken in the response from a previous ListJournalS3ExportsForLedger call, then you should use that value as input here.
Return type

dict

Returns

Response Syntax

{
    'JournalS3Exports': [
        {
            'LedgerName': 'string',
            'ExportId': 'string',
            'ExportCreationTime': datetime(2015, 1, 1),
            'Status': 'IN_PROGRESS'|'COMPLETED'|'CANCELLED',
            'InclusiveStartTime': datetime(2015, 1, 1),
            'ExclusiveEndTime': datetime(2015, 1, 1),
            'S3ExportConfiguration': {
                'Bucket': 'string',
                'Prefix': 'string',
                'EncryptionConfiguration': {
                    'ObjectEncryptionType': 'SSE_KMS'|'SSE_S3'|'NO_ENCRYPTION',
                    'KmsKeyArn': 'string'
                }
            },
            'RoleArn': 'string',
            'OutputFormat': 'ION_BINARY'|'ION_TEXT'|'JSON'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • JournalS3Exports (list) --

      The array of journal export job descriptions that are associated with the specified ledger.

      • (dict) --

        Information about a journal export job, including the ledger name, export ID, creation time, current status, and the parameters of the original export creation request.

        • LedgerName (string) --

          The name of the ledger.

        • ExportId (string) --

          The UUID (represented in Base62-encoded text) of the journal export job.

        • ExportCreationTime (datetime) --

          The date and time, in epoch time format, when the export job was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)

        • Status (string) --

          The current state of the journal export job.

        • InclusiveStartTime (datetime) --

          The inclusive start date and time for the range of journal contents that was specified in the original export request.

        • ExclusiveEndTime (datetime) --

          The exclusive end date and time for the range of journal contents that was specified in the original export request.

        • S3ExportConfiguration (dict) --

          The Amazon Simple Storage Service (Amazon S3) bucket location in which a journal export job writes the journal contents.

          • Bucket (string) --

            The Amazon S3 bucket name in which a journal export job writes the journal contents.

            The bucket name must comply with the Amazon S3 bucket naming conventions. For more information, see Bucket Restrictions and Limitations in the Amazon S3 Developer Guide .

          • Prefix (string) --

            The prefix for the Amazon S3 bucket in which a journal export job writes the journal contents.

            The prefix must comply with Amazon S3 key naming rules and restrictions. For more information, see Object Key and Metadata in the Amazon S3 Developer Guide .

            The following are examples of valid Prefix values:

            • JournalExports-ForMyLedger/Testing/
            • JournalExports
            • My:Tests/
          • EncryptionConfiguration (dict) --

            The encryption settings that are used by a journal export job to write data in an Amazon S3 bucket.

            • ObjectEncryptionType (string) --

              The Amazon S3 object encryption type.

              To learn more about server-side encryption options in Amazon S3, see Protecting Data Using Server-Side Encryption in the Amazon S3 Developer Guide .

            • KmsKeyArn (string) --

              The Amazon Resource Name (ARN) of a symmetric key in Key Management Service (KMS). Amazon S3 does not support asymmetric KMS keys.

              You must provide a KmsKeyArn if you specify SSE_KMS as the ObjectEncryptionType .

              KmsKeyArn is not required if you specify SSE_S3 as the ObjectEncryptionType .

        • RoleArn (string) --

          The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal export job to do the following:

          • Write objects into your Amazon Simple Storage Service (Amazon S3) bucket.
          • (Optional) Use your customer managed key in Key Management Service (KMS) for server-side encryption of your exported data.
        • OutputFormat (string) --

          The output format of the exported journal data.

    • NextToken (string) --

      • If NextToken is empty, then the last page of results has been processed and there are no more results to be retrieved.
      • If NextToken is not empty, then there are more results available. To retrieve the next page of results, use the value of NextToken in a subsequent ListJournalS3ExportsForLedger call.

list_ledgers(**kwargs)

Returns an array of ledger summaries that are associated with the current Amazon Web Services account and Region.

This action returns a maximum of 100 items and is paginated so that you can retrieve all the items by calling ListLedgers multiple times.

See also: AWS API Documentation

Request Syntax

response = client.list_ledgers(
    MaxResults=123,
    NextToken='string'
)
Parameters
  • MaxResults (integer) -- The maximum number of results to return in a single ListLedgers request. (The actual number of results returned might be fewer.)
  • NextToken (string) -- A pagination token, indicating that you want to retrieve the next page of results. If you received a value for NextToken in the response from a previous ListLedgers call, then you should use that value as input here.
Return type

dict

Returns

Response Syntax

{
    'Ledgers': [
        {
            'Name': 'string',
            'State': 'CREATING'|'ACTIVE'|'DELETING'|'DELETED',
            'CreationDateTime': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Ledgers (list) --

      The array of ledger summaries that are associated with the current Amazon Web Services account and Region.

      • (dict) --

        Information about a ledger, including its name, state, and when it was created.

        • Name (string) --

          The name of the ledger.

        • State (string) --

          The current status of the ledger.

        • CreationDateTime (datetime) --

          The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)

    • NextToken (string) --

      A pagination token, indicating whether there are more results available:

      • If NextToken is empty, then the last page of results has been processed and there are no more results to be retrieved.
      • If NextToken is not empty, then there are more results available. To retrieve the next page of results, use the value of NextToken in a subsequent ListLedgers call.

list_tags_for_resource(**kwargs)

Returns all tags for a specified Amazon QLDB resource.

See also: AWS API Documentation

Request Syntax

response = client.list_tags_for_resource(
    ResourceArn='string'
)
Parameters
ResourceArn (string) --

[REQUIRED]

The Amazon Resource Name (ARN) for which to list the tags. For example:

arn:aws:qldb:us-east-1:123456789012:ledger/exampleLedger
Return type
dict
Returns
Response Syntax
{
    'Tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --
    • Tags (dict) --

      The tags that are currently associated with the specified Amazon QLDB resource.

      • (string) --
        • (string) --

Exceptions

  • QLDB.Client.exceptions.InvalidParameterException
  • QLDB.Client.exceptions.ResourceNotFoundException
stream_journal_to_kinesis(**kwargs)

Creates a journal stream for a given Amazon QLDB ledger. The stream captures every document revision that is committed to the ledger's journal and delivers the data to a specified Amazon Kinesis Data Streams resource.

See also: AWS API Documentation

Request Syntax

response = client.stream_journal_to_kinesis(
    LedgerName='string',
    RoleArn='string',
    Tags={
        'string': 'string'
    },
    InclusiveStartTime=datetime(2015, 1, 1),
    ExclusiveEndTime=datetime(2015, 1, 1),
    KinesisConfiguration={
        'StreamArn': 'string',
        'AggregationEnabled': True|False
    },
    StreamName='string'
)
Parameters
  • LedgerName (string) --

    [REQUIRED]

    The name of the ledger.

  • RoleArn (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal stream to write data records to a Kinesis Data Streams resource.

    To pass a role to QLDB when requesting a journal stream, you must have permissions to perform the iam:PassRole action on the IAM role resource. This is required for all journal stream requests.

  • Tags (dict) --

    The key-value pairs to add as tags to the stream that you want to create. Tag keys are case sensitive. Tag values are case sensitive and can be null.

    • (string) --
      • (string) --
  • InclusiveStartTime (datetime) --

    [REQUIRED]

    The inclusive start date and time from which to start streaming journal data. This parameter must be in ISO 8601 date and time format and in Universal Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z .

    The InclusiveStartTime cannot be in the future and must be before ExclusiveEndTime .

    If you provide an InclusiveStartTime that is before the ledger's CreationDateTime , QLDB effectively defaults it to the ledger's CreationDateTime .

  • ExclusiveEndTime (datetime) --

    The exclusive date and time that specifies when the stream ends. If you don't define this parameter, the stream runs indefinitely until you cancel it.

    The ExclusiveEndTime must be in ISO 8601 date and time format and in Universal Coordinated Time (UTC). For example: 2019-06-13T21:36:34Z .

  • KinesisConfiguration (dict) --

    [REQUIRED]

    The configuration settings of the Kinesis Data Streams destination for your stream request.

    • StreamArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the Kinesis Data Streams resource.

    • AggregationEnabled (boolean) --

      Enables QLDB to publish multiple data records in a single Kinesis Data Streams record, increasing the number of records sent per API call.

      This option is enabled by default. Record aggregation has important implications for processing records and requires de-aggregation in your stream consumer. To learn more, see KPL Key Concepts and Consumer De-aggregation in the Amazon Kinesis Data Streams Developer Guide .
  • StreamName (string) --

    [REQUIRED]

    The name that you want to assign to the QLDB journal stream. User-defined names can help identify and indicate the purpose of a stream.

    Your stream name must be unique among other active streams for a given ledger. Stream names have the same naming constraints as ledger names, as defined in Quotas in Amazon QLDB in the Amazon QLDB Developer Guide .

Return type

dict

Returns

Response Syntax

{
    'StreamId': 'string'
}

Response Structure

  • (dict) --

    • StreamId (string) --

      The UUID (represented in Base62-encoded text) that QLDB assigns to each QLDB journal stream.

Exceptions

  • QLDB.Client.exceptions.InvalidParameterException
  • QLDB.Client.exceptions.ResourceNotFoundException
  • QLDB.Client.exceptions.ResourcePreconditionNotMetException
tag_resource(**kwargs)

Adds one or more tags to a specified Amazon QLDB resource.

A resource can have up to 50 tags. If you try to create more than 50 tags for a resource, your request fails and returns an error.

See also: AWS API Documentation

Request Syntax

response = client.tag_resource(
    ResourceArn='string',
    Tags={
        'string': 'string'
    }
)
Parameters
  • ResourceArn (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) to which you want to add the tags. For example:

    arn:aws:qldb:us-east-1:123456789012:ledger/exampleLedger
  • Tags (dict) --

    [REQUIRED]

    The key-value pairs to add as tags to the specified QLDB resource. Tag keys are case sensitive. If you specify a key that already exists for the resource, your request fails and returns an error. Tag values are case sensitive and can be null.

    • (string) --
      • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

  • QLDB.Client.exceptions.InvalidParameterException
  • QLDB.Client.exceptions.ResourceNotFoundException
untag_resource(**kwargs)

Removes one or more tags from a specified Amazon QLDB resource. You can specify up to 50 tag keys to remove.

See also: AWS API Documentation

Request Syntax

response = client.untag_resource(
    ResourceArn='string',
    TagKeys=[
        'string',
    ]
)
Parameters
  • ResourceArn (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) from which to remove the tags. For example:

    arn:aws:qldb:us-east-1:123456789012:ledger/exampleLedger
  • TagKeys (list) --

    [REQUIRED]

    The list of tag keys to remove.

    • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

Exceptions

  • QLDB.Client.exceptions.InvalidParameterException
  • QLDB.Client.exceptions.ResourceNotFoundException
update_ledger(**kwargs)

Updates properties on a ledger.

See also: AWS API Documentation

Request Syntax

response = client.update_ledger(
    Name='string',
    DeletionProtection=True|False,
    KmsKey='string'
)
Parameters
  • Name (string) --

    [REQUIRED]

    The name of the ledger.

  • DeletionProtection (boolean) --

    The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled ( true ) by default.

    If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the UpdateLedger operation to set the flag to false .

  • KmsKey (string) --

    The key in Key Management Service (KMS) to use for encryption of data at rest in the ledger. For more information, see Encryption at rest in the Amazon QLDB Developer Guide .

    Use one of the following options to specify this parameter:

    • AWS_OWNED_KMS_KEY : Use an KMS key that is owned and managed by Amazon Web Services on your behalf.
    • Undefined : Make no changes to the KMS key of the ledger.
    • A valid symmetric customer managed KMS key : Use the specified KMS key in your account that you create, own, and manage. Amazon QLDB does not support asymmetric keys. For more information, see Using symmetric and asymmetric keys in the Key Management Service Developer Guide .

    To specify a customer managed KMS key, you can use its key ID, Amazon Resource Name (ARN), alias name, or alias ARN. When using an alias name, prefix it with "alias/" . To specify a key in a different Amazon Web Services account, you must use the key ARN or alias ARN.

    For example:

    • Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab
    • Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
    • Alias name: alias/ExampleAlias
    • Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias

    For more information, see Key identifiers (KeyId) in the Key Management Service Developer Guide .

Return type

dict

Returns

Response Syntax

{
    'Name': 'string',
    'Arn': 'string',
    'State': 'CREATING'|'ACTIVE'|'DELETING'|'DELETED',
    'CreationDateTime': datetime(2015, 1, 1),
    'DeletionProtection': True|False,
    'EncryptionDescription': {
        'KmsKeyArn': 'string',
        'EncryptionStatus': 'ENABLED'|'UPDATING'|'KMS_KEY_INACCESSIBLE',
        'InaccessibleKmsKeyDateTime': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • Name (string) --

      The name of the ledger.

    • Arn (string) --

      The Amazon Resource Name (ARN) for the ledger.

    • State (string) --

      The current status of the ledger.

    • CreationDateTime (datetime) --

      The date and time, in epoch time format, when the ledger was created. (Epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.)

    • DeletionProtection (boolean) --

      The flag that prevents a ledger from being deleted by any user. If not provided on ledger creation, this feature is enabled ( true ) by default.

      If deletion protection is enabled, you must first disable it before you can delete the ledger. You can disable it by calling the UpdateLedger operation to set the flag to false .

    • EncryptionDescription (dict) --

      Information about the encryption of data at rest in the ledger. This includes the current status, the KMS key, and when the key became inaccessible (in the case of an error).

      • KmsKeyArn (string) --

        The Amazon Resource Name (ARN) of the customer managed KMS key that the ledger uses for encryption at rest. If this parameter is undefined, the ledger uses an Amazon Web Services owned KMS key for encryption.

      • EncryptionStatus (string) --

        The current state of encryption at rest for the ledger. This can be one of the following values:

        • ENABLED : Encryption is fully enabled using the specified key.
        • UPDATING : The ledger is actively processing the specified key change. Key changes in QLDB are asynchronous. The ledger is fully accessible without any performance impact while the key change is being processed. The amount of time it takes to update a key varies depending on the ledger size.
        • KMS_KEY_INACCESSIBLE : The specified customer managed KMS key is not accessible, and the ledger is impaired. Either the key was disabled or deleted, or the grants on the key were revoked. When a ledger is impaired, it is not accessible and does not accept any read or write requests. An impaired ledger automatically returns to an active state after you restore the grants on the key, or re-enable the key that was disabled. However, deleting a customer managed KMS key is irreversible. After a key is deleted, you can no longer access the ledgers that are protected with that key, and the data becomes unrecoverable permanently.
      • InaccessibleKmsKeyDateTime (datetime) --

        The date and time, in epoch time format, when the KMS key first became inaccessible, in the case of an error. (Epoch time format is the number of seconds that have elapsed since 12:00:00 AM January 1, 1970 UTC.)

        This parameter is undefined if the KMS key is accessible.

Exceptions

  • QLDB.Client.exceptions.InvalidParameterException
  • QLDB.Client.exceptions.ResourceNotFoundException
update_ledger_permissions_mode(**kwargs)

Updates the permissions mode of a ledger.

Warning

Before you switch to the STANDARD permissions mode, you must first create all required IAM policies and table tags to avoid disruption to your users. To learn more, see Migrating to the standard permissions mode in the Amazon QLDB Developer Guide .

See also: AWS API Documentation

Request Syntax

response = client.update_ledger_permissions_mode(
    Name='string',
    PermissionsMode='ALLOW_ALL'|'STANDARD'
)
Parameters
  • Name (string) --

    [REQUIRED]

    The name of the ledger.

  • PermissionsMode (string) --

    [REQUIRED]

    The permissions mode to assign to the ledger. This parameter can have one of the following values:

    • ALLOW_ALL : A legacy permissions mode that enables access control with API-level granularity for ledgers. This mode allows users who have the SendCommand API permission for this ledger to run all PartiQL commands (hence, ALLOW_ALL ) on any tables in the specified ledger. This mode disregards any table-level or command-level IAM permissions policies that you create for the ledger.
    • STANDARD : (Recommended ) A permissions mode that enables access control with finer granularity for ledgers, tables, and PartiQL commands. By default, this mode denies all user requests to run any PartiQL commands on any tables in this ledger. To allow PartiQL commands to run, you must create IAM permissions policies for specific table resources and PartiQL actions, in addition to the SendCommand API permission for the ledger. For information, see Getting started with the standard permissions mode in the Amazon QLDB Developer Guide .

    Note

    We strongly recommend using the STANDARD permissions mode to maximize the security of your ledger data.

Return type

dict

Returns

Response Syntax

{
    'Name': 'string',
    'Arn': 'string',
    'PermissionsMode': 'ALLOW_ALL'|'STANDARD'
}

Response Structure

  • (dict) --

    • Name (string) --

      The name of the ledger.

    • Arn (string) --

      The Amazon Resource Name (ARN) for the ledger.

    • PermissionsMode (string) --

      The current permissions mode of the ledger.

Exceptions

  • QLDB.Client.exceptions.InvalidParameterException
  • QLDB.Client.exceptions.ResourceNotFoundException

Paginators

The available paginators are: