You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::QLDB::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for Amazon QLDB. To construct a client, you need to configure a :region and :credentials.

qldb = Aws::QLDB::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::QLDB::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::QLDB::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :active_endpoint_cache (Boolean)

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :disable_host_prefix_injection (Boolean)

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.

  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :endpoint_cache_max_entries (Integer)

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_max_threads (Integer)

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_poll_interval (Integer)

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.

  • :endpoint_discovery (Boolean)

    When set to true, endpoint discovery will be enabled for operations when available. Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#cancel_journal_kinesis_stream(options = {}) ⇒ Types::CancelJournalKinesisStreamResponse

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.

Examples:

Request syntax with placeholder values


resp = client.cancel_journal_kinesis_stream({
  ledger_name: "LedgerName", # required
  stream_id: "UniqueId", # required
})

Response structure


resp.stream_id #=> String

Options Hash (options):

  • :ledger_name (required, String)

    The name of the ledger.

  • :stream_id (required, String)

    The unique ID that QLDB assigns to each QLDB journal stream.

Returns:

See Also:

#create_ledger(options = {}) ⇒ Types::CreateLedgerResponse

Creates a new ledger in your AWS account.

Examples:

Request syntax with placeholder values


resp = client.create_ledger({
  name: "LedgerName", # required
  tags: {
    "TagKey" => "TagValue",
  },
  permissions_mode: "ALLOW_ALL", # required, accepts ALLOW_ALL
  deletion_protection: false,
})

Response structure


resp.name #=> String
resp.arn #=> String
resp.state #=> String, one of "CREATING", "ACTIVE", "DELETING", "DELETED"
resp.creation_date_time #=> Time
resp.deletion_protection #=> true/false

Options Hash (options):

  • :name (required, String)

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

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

  • :tags (Hash<String,String>)

    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.

  • :permissions_mode (required, String)

    The permissions mode to assign to the ledger that you want to create.

  • :deletion_protection (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 using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the UpdateLedger operation to set the flag to false. The QLDB console disables deletion protection for you when you use it to delete a ledger.

Returns:

See Also:

#delete_ledger(options = {}) ⇒ Struct

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 using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the UpdateLedger operation to set the flag to false. The QLDB console disables deletion protection for you when you use it to delete a ledger.

Examples:

Request syntax with placeholder values


resp = client.delete_ledger({
  name: "LedgerName", # required
})

Options Hash (options):

  • :name (required, String)

    The name of the ledger that you want to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#describe_journal_kinesis_stream(options = {}) ⇒ Types::DescribeJournalKinesisStreamResponse

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 your original stream creation request.

Examples:

Request syntax with placeholder values


resp = client.describe_journal_kinesis_stream({
  ledger_name: "LedgerName", # required
  stream_id: "UniqueId", # required
})

Response structure


resp.stream.ledger_name #=> String
resp.stream.creation_time #=> Time
resp.stream.inclusive_start_time #=> Time
resp.stream.exclusive_end_time #=> Time
resp.stream.role_arn #=> String
resp.stream.stream_id #=> String
resp.stream.arn #=> String
resp.stream.status #=> String, one of "ACTIVE", "COMPLETED", "CANCELED", "FAILED", "IMPAIRED"
resp.stream.kinesis_configuration.stream_arn #=> String
resp.stream.kinesis_configuration.aggregation_enabled #=> true/false
resp.stream.error_cause #=> String, one of "KINESIS_STREAM_NOT_FOUND", "IAM_PERMISSION_REVOKED"
resp.stream.stream_name #=> String

Options Hash (options):

  • :ledger_name (required, String)

    The name of the ledger.

  • :stream_id (required, String)

    The unique ID that QLDB assigns to each QLDB journal stream.

Returns:

See Also:

#describe_journal_s3_export(options = {}) ⇒ Types::DescribeJournalS3ExportResponse

Returns information about a journal export job, including the ledger name, export ID, when it was created, current status, and its start and end time export parameters.

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.

Examples:

Request syntax with placeholder values


resp = client.describe_journal_s3_export({
  name: "LedgerName", # required
  export_id: "UniqueId", # required
})

Response structure


resp.export_description.ledger_name #=> String
resp.export_description.export_id #=> String
resp.export_description.export_creation_time #=> Time
resp.export_description.status #=> String, one of "IN_PROGRESS", "COMPLETED", "CANCELLED"
resp.export_description.inclusive_start_time #=> Time
resp.export_description.exclusive_end_time #=> Time
resp.export_description.s3_export_configuration.bucket #=> String
resp.export_description.s3_export_configuration.prefix #=> String
resp.export_description.s3_export_configuration.encryption_configuration.object_encryption_type #=> String, one of "SSE_KMS", "SSE_S3", "NO_ENCRYPTION"
resp.export_description.s3_export_configuration.encryption_configuration.kms_key_arn #=> String
resp.export_description.role_arn #=> String

Options Hash (options):

  • :name (required, String)

    The name of the ledger.

  • :export_id (required, String)

    The unique ID of the journal export job that you want to describe.

Returns:

See Also:

#describe_ledger(options = {}) ⇒ Types::DescribeLedgerResponse

Returns information about a ledger, including its state and when it was created.

Examples:

Request syntax with placeholder values


resp = client.describe_ledger({
  name: "LedgerName", # required
})

Response structure


resp.name #=> String
resp.arn #=> String
resp.state #=> String, one of "CREATING", "ACTIVE", "DELETING", "DELETED"
resp.creation_date_time #=> Time
resp.deletion_protection #=> true/false

Options Hash (options):

  • :name (required, String)

    The name of the ledger that you want to describe.

Returns:

See Also:

#export_journal_to_s3(options = {}) ⇒ Types::ExportJournalToS3Response

Exports journal contents within a date and time range from a ledger into a specified Amazon Simple Storage Service (Amazon S3) bucket. The data is written as files in Amazon Ion format.

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.

Examples:

Request syntax with placeholder values


resp = client.export_journal_to_s3({
  name: "LedgerName", # required
  inclusive_start_time: Time.now, # required
  exclusive_end_time: Time.now, # required
  s3_export_configuration: { # required
    bucket: "S3Bucket", # required
    prefix: "S3Prefix", # required
    encryption_configuration: { # required
      object_encryption_type: "SSE_KMS", # required, accepts SSE_KMS, SSE_S3, NO_ENCRYPTION
      kms_key_arn: "Arn",
    },
  },
  role_arn: "Arn", # required
})

Response structure


resp.export_id #=> String

Options Hash (options):

  • :name (required, String)

    The name of the ledger.

  • :inclusive_start_time (required, Time)

    The inclusive start date and time for the range of journal contents that you want 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.

  • :exclusive_end_time (required, Time)

    The exclusive end date and time for the range of journal contents that you want 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.

  • :s3_export_configuration (required, Types::S3ExportConfiguration)

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

  • :role_arn (required, 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 master key (CMK) in AWS Key Management Service (AWS KMS) for server-side encryption of your exported data.

Returns:

See Also:

#get_block(options = {}) ⇒ Types::GetBlockResponse

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.

Examples:

Request syntax with placeholder values


resp = client.get_block({
  name: "LedgerName", # required
  block_address: { # required
    ion_text: "IonText",
  },
  digest_tip_address: {
    ion_text: "IonText",
  },
})

Response structure


resp.block.ion_text #=> String
resp.proof.ion_text #=> String

Options Hash (options):

  • :name (required, String)

    The name of the ledger.

  • :block_address (required, Types::ValueHolder)

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

  • :digest_tip_address (Types::ValueHolder)

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

Returns:

See Also:

#get_digest(options = {}) ⇒ Types::GetDigestResponse

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.

Examples:

Request syntax with placeholder values


resp = client.get_digest({
  name: "LedgerName", # required
})

Response structure


resp.digest #=> IO
resp.digest_tip_address.ion_text #=> String

Options Hash (options):

  • :name (required, String)

    The name of the ledger.

Returns:

See Also:

#get_revision(options = {}) ⇒ Types::GetRevisionResponse

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.

Examples:

Request syntax with placeholder values


resp = client.get_revision({
  name: "LedgerName", # required
  block_address: { # required
    ion_text: "IonText",
  },
  document_id: "UniqueId", # required
  digest_tip_address: {
    ion_text: "IonText",
  },
})

Response structure


resp.proof.ion_text #=> String
resp.revision.ion_text #=> String

Options Hash (options):

  • :name (required, String)

    The name of the ledger.

  • :block_address (required, Types::ValueHolder)

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

  • :document_id (required, String)

    The unique ID of the document to be verified.

  • :digest_tip_address (Types::ValueHolder)

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

Returns:

See Also:

#list_journal_kinesis_streams_for_ledger(options = {}) ⇒ Types::ListJournalKinesisStreamsForLedgerResponse

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 returns a maximum of MaxResults items. It is paginated so that you can retrieve all the items by calling ListJournalKinesisStreamsForLedger multiple times.

Examples:

Request syntax with placeholder values


resp = client.list_journal_kinesis_streams_for_ledger({
  ledger_name: "LedgerName", # required
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.streams #=> Array
resp.streams[0].ledger_name #=> String
resp.streams[0].creation_time #=> Time
resp.streams[0].inclusive_start_time #=> Time
resp.streams[0].exclusive_end_time #=> Time
resp.streams[0].role_arn #=> String
resp.streams[0].stream_id #=> String
resp.streams[0].arn #=> String
resp.streams[0].status #=> String, one of "ACTIVE", "COMPLETED", "CANCELED", "FAILED", "IMPAIRED"
resp.streams[0].kinesis_configuration.stream_arn #=> String
resp.streams[0].kinesis_configuration.aggregation_enabled #=> true/false
resp.streams[0].error_cause #=> String, one of "KINESIS_STREAM_NOT_FOUND", "IAM_PERMISSION_REVOKED"
resp.streams[0].stream_name #=> String
resp.next_token #=> String

Options Hash (options):

  • :ledger_name (required, String)

    The name of the ledger.

  • :max_results (Integer)

    The maximum number of results to return in a single ListJournalKinesisStreamsForLedger request. (The actual number of results returned might be fewer.)

  • :next_token (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.

Returns:

See Also:

#list_journal_s3_exports(options = {}) ⇒ Types::ListJournalS3ExportsResponse

Returns an array of journal export job descriptions for all ledgers that are associated with the current AWS 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.

Examples:

Request syntax with placeholder values


resp = client.list_journal_s3_exports({
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.journal_s3_exports #=> Array
resp.journal_s3_exports[0].ledger_name #=> String
resp.journal_s3_exports[0].export_id #=> String
resp.journal_s3_exports[0].export_creation_time #=> Time
resp.journal_s3_exports[0].status #=> String, one of "IN_PROGRESS", "COMPLETED", "CANCELLED"
resp.journal_s3_exports[0].inclusive_start_time #=> Time
resp.journal_s3_exports[0].exclusive_end_time #=> Time
resp.journal_s3_exports[0].s3_export_configuration.bucket #=> String
resp.journal_s3_exports[0].s3_export_configuration.prefix #=> String
resp.journal_s3_exports[0].s3_export_configuration.encryption_configuration.object_encryption_type #=> String, one of "SSE_KMS", "SSE_S3", "NO_ENCRYPTION"
resp.journal_s3_exports[0].s3_export_configuration.encryption_configuration.kms_key_arn #=> String
resp.journal_s3_exports[0].role_arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (Integer)

    The maximum number of results to return in a single ListJournalS3Exports request. (The actual number of results returned might be fewer.)

  • :next_token (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.

Returns:

See Also:

#list_journal_s3_exports_for_ledger(options = {}) ⇒ Types::ListJournalS3ExportsForLedgerResponse

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.

Examples:

Request syntax with placeholder values


resp = client.list_journal_s3_exports_for_ledger({
  name: "LedgerName", # required
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.journal_s3_exports #=> Array
resp.journal_s3_exports[0].ledger_name #=> String
resp.journal_s3_exports[0].export_id #=> String
resp.journal_s3_exports[0].export_creation_time #=> Time
resp.journal_s3_exports[0].status #=> String, one of "IN_PROGRESS", "COMPLETED", "CANCELLED"
resp.journal_s3_exports[0].inclusive_start_time #=> Time
resp.journal_s3_exports[0].exclusive_end_time #=> Time
resp.journal_s3_exports[0].s3_export_configuration.bucket #=> String
resp.journal_s3_exports[0].s3_export_configuration.prefix #=> String
resp.journal_s3_exports[0].s3_export_configuration.encryption_configuration.object_encryption_type #=> String, one of "SSE_KMS", "SSE_S3", "NO_ENCRYPTION"
resp.journal_s3_exports[0].s3_export_configuration.encryption_configuration.kms_key_arn #=> String
resp.journal_s3_exports[0].role_arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :name (required, String)

    The name of the ledger.

  • :max_results (Integer)

    The maximum number of results to return in a single ListJournalS3ExportsForLedger request. (The actual number of results returned might be fewer.)

  • :next_token (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.

Returns:

See Also:

#list_ledgers(options = {}) ⇒ Types::ListLedgersResponse

Returns an array of ledger summaries that are associated with the current AWS 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.

Examples:

Request syntax with placeholder values


resp = client.list_ledgers({
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.ledgers #=> Array
resp.ledgers[0].name #=> String
resp.ledgers[0].state #=> String, one of "CREATING", "ACTIVE", "DELETING", "DELETED"
resp.ledgers[0].creation_date_time #=> Time
resp.next_token #=> String

Options Hash (options):

  • :max_results (Integer)

    The maximum number of results to return in a single ListLedgers request. (The actual number of results returned might be fewer.)

  • :next_token (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.

Returns:

See Also:

#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse

Returns all tags for a specified Amazon QLDB resource.

Examples:

Request syntax with placeholder values


resp = client.list_tags_for_resource({
  resource_arn: "Arn", # required
})

Response structure


resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Options Hash (options):

  • :resource_arn (required, String)

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

    arn:aws:qldb:us-east-1:123456789012:ledger/exampleLedger

Returns:

See Also:

#stream_journal_to_kinesis(options = {}) ⇒ Types::StreamJournalToKinesisResponse

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.

Examples:

Request syntax with placeholder values


resp = client.stream_journal_to_kinesis({
  ledger_name: "LedgerName", # required
  role_arn: "Arn", # required
  tags: {
    "TagKey" => "TagValue",
  },
  inclusive_start_time: Time.now, # required
  exclusive_end_time: Time.now,
  kinesis_configuration: { # required
    stream_arn: "Arn", # required
    aggregation_enabled: false,
  },
  stream_name: "StreamName", # required
})

Response structure


resp.stream_id #=> String

Options Hash (options):

  • :ledger_name (required, String)

    The name of the ledger.

  • :role_arn (required, 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.

  • :tags (Hash<String,String>)

    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.

  • :inclusive_start_time (required, Time)

    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.

  • :exclusive_end_time (Time)

    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

  • :kinesis_configuration (required, Types::KinesisConfiguration)

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

  • :stream_name (required, String)

    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.

Returns:

See Also:

#tag_resource(options = {}) ⇒ Struct

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.

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource_arn: "Arn", # required
  tags: { # required
    "TagKey" => "TagValue",
  },
})

Options Hash (options):

  • :resource_arn (required, String)

    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 (required, Hash<String,String>)

    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.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#untag_resource(options = {}) ⇒ Struct

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

Examples:

Request syntax with placeholder values


resp = client.untag_resource({
  resource_arn: "Arn", # required
  tag_keys: ["TagKey"], # required
})

Options Hash (options):

  • :resource_arn (required, String)

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

    arn:aws:qldb:us-east-1:123456789012:ledger/exampleLedger

  • :tag_keys (required, Array<String>)

    The list of tag keys that you want to remove.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_ledger(options = {}) ⇒ Types::UpdateLedgerResponse

Updates properties on a ledger.

Examples:

Request syntax with placeholder values


resp = client.update_ledger({
  name: "LedgerName", # required
  deletion_protection: false,
})

Response structure


resp.name #=> String
resp.arn #=> String
resp.state #=> String, one of "CREATING", "ACTIVE", "DELETING", "DELETED"
resp.creation_date_time #=> Time
resp.deletion_protection #=> true/false

Options Hash (options):

  • :name (required, String)

    The name of the ledger.

  • :deletion_protection (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 using the QLDB API or the AWS Command Line Interface (AWS CLI). You can disable it by calling the UpdateLedger operation to set the flag to false. The QLDB console disables deletion protection for you when you use it to delete a ledger.

Returns:

See Also:

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

  • params (Hash) (defaults to: {})

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:

Returns:

  • (Array<Symbol>)

    the list of supported waiters.