Class: Aws::SimpleDBv2::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::SimpleDBv2::Client
- Includes:
- ClientStubs
- Defined in:
- lib/aws-sdk-simpledbv2/client.rb
Overview
An API client for SimpleDBv2. To construct a client, you need to configure a ‘:region` and `:credentials`.
client = Aws::SimpleDBv2::Client.new(
region: region_name,
credentials: credentials,
# ...
)
For details on configuring region and credentials see the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).
See #initialize for a full list of supported configuration options.
Class Attribute Summary collapse
- .identifier ⇒ Object readonly private
API Operations collapse
-
#get_export(params = {}) ⇒ Types::GetExportResponse
Returns information for an existing domain export.
-
#list_exports(params = {}) ⇒ Types::ListExportsResponse
Lists all exports that were created.
-
#start_domain_export(params = {}) ⇒ Types::StartDomainExportResponse
Initiates the export of a SimpleDB domain to an S3 bucket.
Class Method Summary collapse
- .errors_module ⇒ Object private
Instance Method Summary collapse
- #build_request(operation_name, params = {}) ⇒ Object private
-
#initialize(options) ⇒ Client
constructor
A new instance of Client.
-
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
- #waiter_names ⇒ Object deprecated private Deprecated.
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
471 472 473 |
# File 'lib/aws-sdk-simpledbv2/client.rb', line 471 def initialize(*args) super end |
Class Attribute Details
.identifier ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
854 855 856 |
# File 'lib/aws-sdk-simpledbv2/client.rb', line 854 def identifier @identifier end |
Class Method Details
.errors_module ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
857 858 859 |
# File 'lib/aws-sdk-simpledbv2/client.rb', line 857 def errors_module Errors end |
Instance Method Details
#build_request(operation_name, params = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 |
# File 'lib/aws-sdk-simpledbv2/client.rb', line 714 def build_request(operation_name, params = {}) handlers = @handlers.for(operation_name) tracer = config.telemetry_provider.tracer_provider.tracer( Aws::Telemetry.module_to_tracer_name('Aws::SimpleDBv2') ) context = Seahorse::Client::RequestContext.new( operation_name: operation_name, operation: config.api.operation(operation_name), client: self, params: params, config: config, tracer: tracer ) context[:gem_name] = 'aws-sdk-simpledbv2' context[:gem_version] = '1.3.0' Seahorse::Client::Request.new(handlers, context) end |
#get_export(params = {}) ⇒ Types::GetExportResponse
Returns information for an existing domain export.
The following waiters are defined for this operation (see #wait_until for detailed usage):
* export_succeeded
551 552 553 554 |
# File 'lib/aws-sdk-simpledbv2/client.rb', line 551 def get_export(params = {}, = {}) req = build_request(:get_export, params) req.send_request() end |
#list_exports(params = {}) ⇒ Types::ListExportsResponse
Lists all exports that were created. The results are paginated and can be filtered by domain name.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
617 618 619 620 |
# File 'lib/aws-sdk-simpledbv2/client.rb', line 617 def list_exports(params = {}, = {}) req = build_request(:list_exports, params) req.send_request() end |
#start_domain_export(params = {}) ⇒ Types::StartDomainExportResponse
Initiates the export of a SimpleDB domain to an S3 bucket.
705 706 707 708 |
# File 'lib/aws-sdk-simpledbv2/client.rb', line 705 def start_domain_export(params = {}, = {}) req = build_request(:start_domain_export, params) req.send_request() end |
#wait_until(waiter_name, params = {}, options = {}) {|w.waiter| ... } ⇒ Boolean
Polls an API operation until a resource enters a desired state.
## Basic Usage
A waiter will call an API operation until:
-
It is successful
-
It enters a terminal state
-
It makes the maximum number of attempts
In between attempts, the waiter will sleep.
# polls in a loop, sleeping between attempts
client.wait_until(waiter_name, params)
## Configuration
You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You can pass configuration as the final arguments hash.
# poll for ~25 seconds
client.wait_until(waiter_name, params, {
max_attempts: 5,
delay: 5,
})
## 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(waiter_name, params, {
# disable max attempts
max_attempts: nil,
# poll for 1 hour, instead of a number of attempts
before_wait: -> (attempts, response) do
throw :failure if Time.now - started_at > 3600
end
})
## Handling Errors
When a waiter is unsuccessful, it will raise an error. All of the failure errors extend from Waiters::Errors::WaiterFailed.
begin
client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
# resource did not enter the desired state in time
end
## Valid Waiters
The following table lists the valid waiter names, the operations they call, and the default ‘:delay` and `:max_attempts` values.
| waiter_name | params | :delay | :max_attempts | | —————- | ——————- | ——– | ————- | | export_succeeded | #get_export | 30 | 5 |
820 821 822 823 824 |
# File 'lib/aws-sdk-simpledbv2/client.rb', line 820 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |
#waiter_names ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
828 829 830 |
# File 'lib/aws-sdk-simpledbv2/client.rb', line 828 def waiter_names waiters.keys end |