Get the state for a routing control. A routing control is a simple on/off switch that you can use to route traffic to cells. When a routing control state is set to ON, traffic flows to a cell. When the state is set to OFF, traffic does not flow.
Before you can create a routing control, you must first create a cluster, and then host the control in a control panel on the cluster. For more information, see Create routing control structures in the Amazon Route 53 Application Recovery Controller Developer Guide. You access one of the endpoints for the cluster to get or update the routing control state to redirect traffic for your application.
You must specify Regional endpoints when you work with API cluster operations to get or update routing control states in Route 53 ARC.
To see a code example for getting a routing control state, including accessing Regional cluster endpoints in sequence, see API examples in the Amazon Route 53 Application Recovery Controller Developer Guide.
Learn more about working with routing controls in the following topics in the Amazon Route 53 Application Recovery Controller Developer Guide:
Parameters:
-
routing_control_arn
(Arn)
–
The Amazon Resource Name (ARN) for the routing control that you want to get the state for.
Raises:
Source code in docs_src/capo_route53_recovery_cluster/_services/route53_recovery_cluster.py
| def get_routing_control_state(
self,
routing_control_arn: "capo_route53_recovery_cluster.types.arn.Arn",
*,
config_overrides: Optional[Route53RecoveryClusterClientConfig] = None,
) -> "capo_route53_recovery_cluster.types.get_routing_control_state_response.GetRoutingControlStateResponse":
"""<p>Get the state for a routing control. A routing control is a simple on/off switch that you can use to route traffic to cells. When a routing control state is set to ON, traffic flows to a cell. When the state is set to OFF, traffic does not flow. </p> <p>Before you can create a routing control, you must first create a cluster, and then host the control in a control panel on the cluster. For more information, see <a href="https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.create.html"> Create routing control structures</a> in the Amazon Route 53 Application Recovery Controller Developer Guide. You access one of the endpoints for the cluster to get or update the routing control state to redirect traffic for your application. </p> <p> <i>You must specify Regional endpoints when you work with API cluster operations to get or update routing control states in Route 53 ARC.</i> </p> <p>To see a code example for getting a routing control state, including accessing Regional cluster endpoints in sequence, see <a href="https://docs.aws.amazon.com/r53recovery/latest/dg/service_code_examples_actions.html">API examples</a> in the Amazon Route 53 Application Recovery Controller Developer Guide.</p> <p>Learn more about working with routing controls in the following topics in the Amazon Route 53 Application Recovery Controller Developer Guide:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.update.html"> Viewing and updating routing control states</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/r53recovery/latest/dg/routing-control.html">Working with routing controls in Route 53 ARC</a> </p> </li> </ul>
Args:
routing_control_arn: <p>The Amazon Resource Name (ARN) for the routing control that you want to get the state for.</p>
Raises:
capo_route53_recovery_cluster.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
capo_route53_recovery_cluster.errors.endpoint_temporarily_unavailable_exception.EndpointTemporarilyUnavailableException: <p>The cluster endpoint isn't available. Try another cluster endpoint.</p>
capo_route53_recovery_cluster.errors.internal_server_exception.InternalServerException: <p>There was an unexpected error during processing of the request.</p>
capo_route53_recovery_cluster.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a routing control or control panel that was not found.</p>
capo_route53_recovery_cluster.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling.</p>
capo_route53_recovery_cluster.errors.validation_exception.ValidationException: <p>There was a validation error on the request.</p>
capo_route53_recovery_cluster.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_route53_recovery_cluster.types.get_routing_control_state_request.GetRoutingControlStateRequest]",
) -> OperationResponse[
"capo_route53_recovery_cluster.types.get_routing_control_state_response.GetRoutingControlStateResponse"
]:
import capo_route53_recovery_cluster._operations.toggle_customer_api.get_routing_control_state
output, http_response = (
capo_route53_recovery_cluster._operations.toggle_customer_api.get_routing_control_state.get_routing_control_state(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetRoutingControlState")
)
input_: capo_route53_recovery_cluster.types.get_routing_control_state_request.GetRoutingControlStateRequest = {
"routing_control_arn": routing_control_arn
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|