createRoutingControl method
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.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter clusterArn :
The Amazon Resource Name (ARN) of the cluster that includes the routing
control.
Parameter routingControlName :
The name of the routing control.
Parameter clientToken :
A unique, case-sensitive string of up to 64 ASCII characters. To make an
idempotent API request with an action, specify a client token in the
request.
Parameter controlPanelArn :
The Amazon Resource Name (ARN) of the control panel that includes the
routing control.
Implementation
Future<CreateRoutingControlResponse> createRoutingControl({
required String clusterArn,
required String routingControlName,
String? clientToken,
String? controlPanelArn,
}) async {
final $payload = <String, dynamic>{
'ClusterArn': clusterArn,
'RoutingControlName': routingControlName,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (controlPanelArn != null) 'ControlPanelArn': controlPanelArn,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/routingcontrol',
exceptionFnMap: _exceptionFns,
);
return CreateRoutingControlResponse.fromJson(response);
}