Class: Aws::SimpleDBv2::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::SimpleDBv2::Client
- Includes:
- ClientStubs
- Defined in:
- gems/aws-sdk-simpledbv2/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.
See #initialize for a full list of supported configuration options.
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
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.
Instance Method Summary collapse
-
#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.
Methods included from ClientStubs
#api_requests, #stub_data, #stub_responses
Methods inherited from Seahorse::Client::Base
add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins
Methods included from Seahorse::Client::HandlerBuilder
#handle, #handle_request, #handle_response
Constructor Details
#initialize(options) ⇒ Client
Returns a new instance of Client.
473 474 475 |
# File 'gems/aws-sdk-simpledbv2/lib/aws-sdk-simpledbv2/client.rb', line 473 def initialize(*args) super end |
Instance Method Details
#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
553 554 555 556 |
# File 'gems/aws-sdk-simpledbv2/lib/aws-sdk-simpledbv2/client.rb', line 553 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.
619 620 621 622 |
# File 'gems/aws-sdk-simpledbv2/lib/aws-sdk-simpledbv2/client.rb', line 619 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.
707 708 709 710 |
# File 'gems/aws-sdk-simpledbv2/lib/aws-sdk-simpledbv2/client.rb', line 707 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 |
822 823 824 825 826 |
# File 'gems/aws-sdk-simpledbv2/lib/aws-sdk-simpledbv2/client.rb', line 822 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |