Class: Aws::Route53RecoveryControlConfig::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::Route53RecoveryControlConfig::Client
- Includes:
- ClientStubs
- Defined in:
- lib/aws-sdk-route53recoverycontrolconfig/client.rb
Overview
An API client for Route53RecoveryControlConfig. To construct a client, you need to configure a ‘:region` and `:credentials`.
client = Aws::Route53RecoveryControlConfig::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
-
#create_cluster(params = {}) ⇒ Types::CreateClusterResponse
Create a new cluster.
-
#create_control_panel(params = {}) ⇒ Types::CreateControlPanelResponse
Creates a new control panel.
-
#create_routing_control(params = {}) ⇒ Types::CreateRoutingControlResponse
Creates a new routing control.
-
#create_safety_rule(params = {}) ⇒ Types::CreateSafetyRuleResponse
Creates a safety rule in a control panel.
-
#delete_cluster(params = {}) ⇒ Struct
Delete a cluster.
-
#delete_control_panel(params = {}) ⇒ Struct
Deletes a control panel.
-
#delete_routing_control(params = {}) ⇒ Struct
Deletes a routing control.
-
#delete_safety_rule(params = {}) ⇒ Struct
Deletes a safety rule.
-
#describe_cluster(params = {}) ⇒ Types::DescribeClusterResponse
Display the details about a cluster.
-
#describe_control_panel(params = {}) ⇒ Types::DescribeControlPanelResponse
Displays details about a control panel.
-
#describe_routing_control(params = {}) ⇒ Types::DescribeRoutingControlResponse
Displays details about a routing control.
-
#describe_safety_rule(params = {}) ⇒ Types::DescribeSafetyRuleResponse
Returns information about a safety rule.
-
#get_resource_policy(params = {}) ⇒ Types::GetResourcePolicyResponse
Get information about the resource policy for a cluster.
-
#list_associated_route_53_health_checks(params = {}) ⇒ Types::ListAssociatedRoute53HealthChecksResponse
Returns an array of all Amazon Route 53 health checks associated with a specific routing control.
-
#list_clusters(params = {}) ⇒ Types::ListClustersResponse
Returns an array of all the clusters in an account.
-
#list_control_panels(params = {}) ⇒ Types::ListControlPanelsResponse
Returns an array of control panels in an account or in a cluster.
-
#list_routing_controls(params = {}) ⇒ Types::ListRoutingControlsResponse
Returns an array of routing controls for a control panel.
-
#list_safety_rules(params = {}) ⇒ Types::ListSafetyRulesResponse
List the safety rules (the assertion rules and gating rules) that you’ve defined for the routing controls in a control panel.
-
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags for a resource.
-
#tag_resource(params = {}) ⇒ Struct
Adds a tag to a resource.
-
#untag_resource(params = {}) ⇒ Struct
Removes a tag from a resource.
-
#update_control_panel(params = {}) ⇒ Types::UpdateControlPanelResponse
Updates a control panel.
-
#update_routing_control(params = {}) ⇒ Types::UpdateRoutingControlResponse
Updates a routing control.
-
#update_safety_rule(params = {}) ⇒ Types::UpdateSafetyRuleResponse
Update a safety rule (an assertion rule or gating rule).
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.
444 445 446 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 444 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.
1632 1633 1634 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1632 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.
1635 1636 1637 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1635 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.
1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1482 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::Route53RecoveryControlConfig') ) 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-route53recoverycontrolconfig' context[:gem_version] = '1.37.0' Seahorse::Client::Request.new(handlers, context) end |
#create_cluster(params = {}) ⇒ Types::CreateClusterResponse
Create a new cluster. A cluster is a set of redundant Regional endpoints against which you can run API calls to update or get the state of one or more routing controls. Each cluster has a name, status, Amazon Resource Name (ARN), and an array of the five cluster endpoints (one for each supported Amazon Web Services Region) that you can use with API calls to the cluster data plane.
499 500 501 502 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 499 def create_cluster(params = {}, = {}) req = build_request(:create_cluster, params) req.send_request() end |
#create_control_panel(params = {}) ⇒ Types::CreateControlPanelResponse
Creates a new control panel. A control panel represents a group of routing controls that can be changed together in a single transaction. You can use a control panel to centrally view the operational status of applications across your organization, and trigger multi-app failovers in a single transaction, for example, to fail over an Availability Zone or Amazon Web Services Region.
557 558 559 560 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 557 def create_control_panel(params = {}, = {}) req = build_request(:create_control_panel, params) req.send_request() end |
#create_routing_control(params = {}) ⇒ Types::CreateRoutingControlResponse
Creates a new routing control.
A routing control has one of two states: ON and OFF. You can map the routing control state to the state of an Amazon Route 53 health check, which can be used to control traffic routing.
To get or update the routing control state, see the Recovery Cluster (data plane) API actions for Amazon Route 53 Application Recovery Controller.
616 617 618 619 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 616 def create_routing_control(params = {}, = {}) req = build_request(:create_routing_control, params) req.send_request() end |
#create_safety_rule(params = {}) ⇒ Types::CreateSafetyRuleResponse
Creates a safety rule in a control panel. Safety rules let you add safeguards around changing routing control states, and for enabling and disabling routing controls, to help prevent unexpected outcomes.
There are two types of safety rules: assertion rules and gating rules.
Assertion rule: An assertion rule enforces that, when you change a routing control state, that a certain criteria is met. For example, the criteria might be that at least one routing control state is On after the transaction so that traffic continues to flow to at least one cell for the application. This ensures that you avoid a fail-open scenario.
Gating rule: A gating rule lets you configure a gating routing control as an overall “on/off” switch for a group of routing controls. Or, you can configure more complex gating scenarios, for example by configuring multiple gating routing controls.
For more information, see [Safety rules] in the Amazon Route 53 Application Recovery Controller Developer Guide.
[1]: docs.aws.amazon.com/r53recovery/latest/dg/routing-control.safety-rules.html
731 732 733 734 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 731 def create_safety_rule(params = {}, = {}) req = build_request(:create_safety_rule, params) req.send_request() end |
#delete_cluster(params = {}) ⇒ Struct
Delete a cluster.
752 753 754 755 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 752 def delete_cluster(params = {}, = {}) req = build_request(:delete_cluster, params) req.send_request() end |
#delete_control_panel(params = {}) ⇒ Struct
Deletes a control panel.
773 774 775 776 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 773 def delete_control_panel(params = {}, = {}) req = build_request(:delete_control_panel, params) req.send_request() end |
#delete_routing_control(params = {}) ⇒ Struct
Deletes a routing control.
794 795 796 797 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 794 def delete_routing_control(params = {}, = {}) req = build_request(:delete_routing_control, params) req.send_request() end |
#delete_safety_rule(params = {}) ⇒ Struct
Deletes a safety rule.
/>
817 818 819 820 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 817 def delete_safety_rule(params = {}, = {}) req = build_request(:delete_safety_rule, params) req.send_request() end |
#describe_cluster(params = {}) ⇒ Types::DescribeClusterResponse
Display the details about a cluster. The response includes the cluster name, endpoints, status, and Amazon Resource Name (ARN).
The following waiters are defined for this operation (see #wait_until for detailed usage):
* cluster_created
* cluster_deleted
857 858 859 860 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 857 def describe_cluster(params = {}, = {}) req = build_request(:describe_cluster, params) req.send_request() end |
#describe_control_panel(params = {}) ⇒ Types::DescribeControlPanelResponse
Displays details about a control panel.
The following waiters are defined for this operation (see #wait_until for detailed usage):
* control_panel_created
* control_panel_deleted
896 897 898 899 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 896 def describe_control_panel(params = {}, = {}) req = build_request(:describe_control_panel, params) req.send_request() end |
#describe_routing_control(params = {}) ⇒ Types::DescribeRoutingControlResponse
Displays details about a routing control. A routing control has one of two states: ON and OFF. You can map the routing control state to the state of an Amazon Route 53 health check, which can be used to control routing.
To get or update the routing control state, see the Recovery Cluster (data plane) API actions for Amazon Route 53 Application Recovery Controller.
The following waiters are defined for this operation (see #wait_until for detailed usage):
* routing_control_created
* routing_control_deleted
940 941 942 943 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 940 def describe_routing_control(params = {}, = {}) req = build_request(:describe_routing_control, params) req.send_request() end |
#describe_safety_rule(params = {}) ⇒ Types::DescribeSafetyRuleResponse
Returns information about a safety rule.
991 992 993 994 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 991 def describe_safety_rule(params = {}, = {}) req = build_request(:describe_safety_rule, params) req.send_request() end |
#get_resource_policy(params = {}) ⇒ Types::GetResourcePolicyResponse
Get information about the resource policy for a cluster.
1018 1019 1020 1021 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1018 def get_resource_policy(params = {}, = {}) req = build_request(:get_resource_policy, params) req.send_request() end |
#list_associated_route_53_health_checks(params = {}) ⇒ Types::ListAssociatedRoute53HealthChecksResponse
Returns an array of all Amazon Route 53 health checks associated with a specific routing control.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1057 1058 1059 1060 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1057 def list_associated_route_53_health_checks(params = {}, = {}) req = build_request(:list_associated_route_53_health_checks, params) req.send_request() end |
#list_clusters(params = {}) ⇒ Types::ListClustersResponse
Returns an array of all the clusters in an account.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1098 1099 1100 1101 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1098 def list_clusters(params = {}, = {}) req = build_request(:list_clusters, params) req.send_request() end |
#list_control_panels(params = {}) ⇒ Types::ListControlPanelsResponse
Returns an array of control panels in an account or in a cluster.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1142 1143 1144 1145 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1142 def list_control_panels(params = {}, = {}) req = build_request(:list_control_panels, params) req.send_request() end |
#list_routing_controls(params = {}) ⇒ Types::ListRoutingControlsResponse
Returns an array of routing controls for a control panel. A routing control is an Amazon Route 53 Application Recovery Controller construct that has one of two states: ON and OFF. You can map the routing control state to the state of an Amazon Route 53 health check, which can be used to control routing.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1188 1189 1190 1191 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1188 def list_routing_controls(params = {}, = {}) req = build_request(:list_routing_controls, params) req.send_request() end |
#list_safety_rules(params = {}) ⇒ Types::ListSafetyRulesResponse
List the safety rules (the assertion rules and gating rules) that you’ve defined for the routing controls in a control panel.
The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.
1250 1251 1252 1253 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1250 def list_safety_rules(params = {}, = {}) req = build_request(:list_safety_rules, params) req.send_request() end |
#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags for a resource.
1278 1279 1280 1281 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1278 def (params = {}, = {}) req = build_request(:list_tags_for_resource, params) req.send_request() end |
#tag_resource(params = {}) ⇒ Struct
Adds a tag to a resource.
1305 1306 1307 1308 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1305 def tag_resource(params = {}, = {}) req = build_request(:tag_resource, params) req.send_request() end |
#untag_resource(params = {}) ⇒ Struct
Removes a tag from a resource.
1329 1330 1331 1332 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1329 def untag_resource(params = {}, = {}) req = build_request(:untag_resource, params) req.send_request() end |
#update_control_panel(params = {}) ⇒ Types::UpdateControlPanelResponse
Updates a control panel. The only update you can make to a control panel is to change the name of the control panel.
1368 1369 1370 1371 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1368 def update_control_panel(params = {}, = {}) req = build_request(:update_control_panel, params) req.send_request() end |
#update_routing_control(params = {}) ⇒ Types::UpdateRoutingControlResponse
Updates a routing control. You can only update the name of the routing control. To get or update the routing control state, see the Recovery Cluster (data plane) API actions for Amazon Route 53 Application Recovery Controller.
1407 1408 1409 1410 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1407 def update_routing_control(params = {}, = {}) req = build_request(:update_routing_control, params) req.send_request() end |
#update_safety_rule(params = {}) ⇒ Types::UpdateSafetyRuleResponse
Update a safety rule (an assertion rule or gating rule). You can only update the name and the waiting period for a safety rule. To make other updates, delete the safety rule and create a new one.
1473 1474 1475 1476 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1473 def update_safety_rule(params = {}, = {}) req = build_request(:update_safety_rule, 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_created | #describe_cluster | 5 | 26 | | cluster_deleted | #describe_cluster | 5 | 26 | | control_panel_created | #describe_control_panel | 5 | 26 | | control_panel_deleted | #describe_control_panel | 5 | 26 | | routing_control_created | #describe_routing_control | 5 | 26 | | routing_control_deleted | #describe_routing_control | 5 | 26 |
1593 1594 1595 1596 1597 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1593 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.
1601 1602 1603 |
# File 'lib/aws-sdk-route53recoverycontrolconfig/client.rb', line 1601 def waiter_names waiters.keys end |