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
- Object
- Seahorse::Client::Base
- Aws::QLDB::Client
- 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']
andENV['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
Constructor collapse
-
#initialize(options = {}) ⇒ Aws::QLDB::Client
constructor
Constructs an API client.
API Operations collapse
-
#cancel_journal_kinesis_stream(options = {}) ⇒ Types::CancelJournalKinesisStreamResponse
Ends a given Amazon QLDB journal stream.
-
#create_ledger(options = {}) ⇒ Types::CreateLedgerResponse
Creates a new ledger in your AWS account.
.
-
#delete_ledger(options = {}) ⇒ Struct
Deletes a ledger and all of its contents.
-
#describe_journal_kinesis_stream(options = {}) ⇒ Types::DescribeJournalKinesisStreamResponse
Returns detailed information about a given Amazon QLDB journal stream.
-
#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.
-
#describe_ledger(options = {}) ⇒ Types::DescribeLedgerResponse
Returns information about a ledger, including its state and when it was created.
.
-
#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.
-
#get_block(options = {}) ⇒ Types::GetBlockResponse
Returns a block object at a specified address in a journal.
-
#get_digest(options = {}) ⇒ Types::GetDigestResponse
Returns the digest of a ledger at the latest committed block in the journal.
-
#get_revision(options = {}) ⇒ Types::GetRevisionResponse
Returns a revision data object for a specified document ID and block address.
-
#list_journal_kinesis_streams_for_ledger(options = {}) ⇒ Types::ListJournalKinesisStreamsForLedgerResponse
Returns an array of all Amazon QLDB journal stream descriptors for a given ledger.
-
#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 callingListJournalS3Exports
multiple times.This action does not return any expired export jobs.
-
#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 callingListJournalS3ExportsForLedger
multiple times.This action does not return any expired export jobs.
-
#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. -
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Returns all tags for a specified Amazon QLDB resource.
.
-
#stream_journal_to_kinesis(options = {}) ⇒ Types::StreamJournalToKinesisResponse
Creates a journal stream for a given Amazon QLDB ledger.
-
#tag_resource(options = {}) ⇒ Struct
Adds one or more tags to a specified Amazon QLDB resource.
A resource can have up to 50 tags.
-
#untag_resource(options = {}) ⇒ Struct
Removes one or more tags from a specified Amazon QLDB resource.
-
#update_ledger(options = {}) ⇒ Types::UpdateLedgerResponse
Updates properties on a ledger.
.
Instance Method Summary collapse
-
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
-
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters.
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.
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.
#create_ledger(options = {}) ⇒ Types::CreateLedgerResponse
Creates a new ledger in your AWS account.
#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.
#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.
#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
.
#describe_ledger(options = {}) ⇒ Types::DescribeLedgerResponse
Returns information about a ledger, including its state and when it was created.
#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
.
#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
.
#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.
#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.
#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.
#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.
#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.
#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.
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Returns all tags for a specified Amazon QLDB resource.
#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.
#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.
#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.
#update_ledger(options = {}) ⇒ Types::UpdateLedgerResponse
Updates properties on a ledger.
#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
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:
Waiter Name | Client Method | Default Delay: | Default Max Attempts: |
---|