Class: Aws::DSQL::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::DSQL::Client
- Includes:
- ClientStubs
- Defined in:
- gems/aws-sdk-dsql/lib/aws-sdk-dsql/client.rb
Overview
An API client for DSQL. To construct a client, you need to configure a :region
and :credentials
.
client = Aws::DSQL::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
-
#create_cluster(params = {}) ⇒ Types::CreateClusterOutput
Creates a cluster in Amazon Aurora DSQL.
-
#create_multi_region_clusters(params = {}) ⇒ Types::CreateMultiRegionClustersOutput
Creates multi-Region clusters in Amazon Aurora DSQL.
-
#delete_cluster(params = {}) ⇒ Types::DeleteClusterOutput
Deletes a cluster in Amazon Aurora DSQL.
-
#delete_multi_region_clusters(params = {}) ⇒ Struct
Deletes a multi-Region cluster in Amazon Aurora DSQL.
-
#get_cluster(params = {}) ⇒ Types::GetClusterOutput
Retrieves information about a cluster.
-
#list_clusters(params = {}) ⇒ Types::ListClustersOutput
Retrieves information about a list of clusters.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceOutput
Lists all of the tags for a resource.
-
#tag_resource(params = {}) ⇒ Struct
Tags a resource with a map of key and value pairs.
-
#untag_resource(params = {}) ⇒ Struct
Removes a tag from a resource.
-
#update_cluster(params = {}) ⇒ Types::UpdateClusterOutput
Updates a cluster.
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.
444 445 446 |
# File 'gems/aws-sdk-dsql/lib/aws-sdk-dsql/client.rb', line 444 def initialize(*args) super end |
Instance Method Details
#create_cluster(params = {}) ⇒ Types::CreateClusterOutput
Creates a cluster in Amazon Aurora DSQL.
513 514 515 516 |
# File 'gems/aws-sdk-dsql/lib/aws-sdk-dsql/client.rb', line 513 def create_cluster(params = {}, = {}) req = build_request(:create_cluster, params) req.send_request() end |
#create_multi_region_clusters(params = {}) ⇒ Types::CreateMultiRegionClustersOutput
Creates multi-Region clusters in Amazon Aurora DSQL. Multi-Region clusters require a linked Region list, which is an array of the Regions in which you want to create linked clusters. Multi-Region clusters require a witness Region, which participates in quorum in failure scenarios.
596 597 598 599 |
# File 'gems/aws-sdk-dsql/lib/aws-sdk-dsql/client.rb', line 596 def create_multi_region_clusters(params = {}, = {}) req = build_request(:create_multi_region_clusters, params) req.send_request() end |
#delete_cluster(params = {}) ⇒ Types::DeleteClusterOutput
Deletes a cluster in Amazon Aurora DSQL.
654 655 656 657 |
# File 'gems/aws-sdk-dsql/lib/aws-sdk-dsql/client.rb', line 654 def delete_cluster(params = {}, = {}) req = build_request(:delete_cluster, params) req.send_request() end |
#delete_multi_region_clusters(params = {}) ⇒ Struct
Deletes a multi-Region cluster in Amazon Aurora DSQL.
702 703 704 705 |
# File 'gems/aws-sdk-dsql/lib/aws-sdk-dsql/client.rb', line 702 def delete_multi_region_clusters(params = {}, = {}) req = build_request(:delete_multi_region_clusters, params) req.send_request() end |
#get_cluster(params = {}) ⇒ Types::GetClusterOutput
Retrieves information about a cluster.
The following waiters are defined for this operation (see #wait_until for detailed usage):
- cluster_active
- cluster_not_exists
756 757 758 759 |
# File 'gems/aws-sdk-dsql/lib/aws-sdk-dsql/client.rb', line 756 def get_cluster(params = {}, = {}) req = build_request(:get_cluster, params) req.send_request() end |
#list_clusters(params = {}) ⇒ Types::ListClustersOutput
Retrieves information about a list of clusters.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
804 805 806 807 |
# File 'gems/aws-sdk-dsql/lib/aws-sdk-dsql/client.rb', line 804 def list_clusters(params = {}, = {}) req = build_request(:list_clusters, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceOutput
Lists all of the tags for a resource.
840 841 842 843 |
# File 'gems/aws-sdk-dsql/lib/aws-sdk-dsql/client.rb', line 840 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Tags a resource with a map of key and value pairs.
878 879 880 881 |
# File 'gems/aws-sdk-dsql/lib/aws-sdk-dsql/client.rb', line 878 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes a tag from a resource.
915 916 917 918 |
# File 'gems/aws-sdk-dsql/lib/aws-sdk-dsql/client.rb', line 915 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_cluster(params = {}) ⇒ Types::UpdateClusterOutput
Updates a cluster.
983 984 985 986 |
# File 'gems/aws-sdk-dsql/lib/aws-sdk-dsql/client.rb', line 983 def update_cluster(params = {}, = {}) req = build_request(:update_cluster, 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 |
---|---|---|---|
cluster_active | #get_cluster | 2 | 60 |
cluster_not_exists | #get_cluster | 2 | 60 |
1099 1100 1101 1102 1103 |
# File 'gems/aws-sdk-dsql/lib/aws-sdk-dsql/client.rb', line 1099 def wait_until(waiter_name, params = {}, = {}) w = waiter(waiter_name, ) yield(w.waiter) if block_given? # deprecated w.wait(params) end |