createCluster method
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.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter clusterName :
The name of the cluster.
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 networkType :
The network type of the cluster. NetworkType can be one of the following:
IPV4, DUALSTACK.
Parameter tags :
The tags associated with the cluster.
Implementation
Future<CreateClusterResponse> createCluster({
required String clusterName,
String? clientToken,
NetworkType? networkType,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'ClusterName': clusterName,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (networkType != null) 'NetworkType': networkType.value,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/cluster',
exceptionFnMap: _exceptionFns,
);
return CreateClusterResponse.fromJson(response);
}