createCluster method

Future<CreateClusterResponse> createCluster({
  1. ClusterType? clusterType,
  2. String? instanceRoleArn,
  3. String? name,
  4. ClusterNetworkSettingsCreateRequest? networkSettings,
  5. String? requestId,
  6. Map<String, String>? tags,
})

Create a new Cluster.

May throw BadGatewayException. May throw BadRequestException. May throw ConflictException. May throw ForbiddenException. May throw GatewayTimeoutException. May throw InternalServerErrorException. May throw TooManyRequestsException.

Parameter clusterType : Specify a type. All the Nodes that you later add to this Cluster must be this type of hardware. One Cluster instance can't contain different hardware types. You won't be able to change this parameter after you create the Cluster.

Parameter instanceRoleArn : The ARN of the IAM role for the Node in this Cluster. The role must include all the operations that you expect these Node to perform. If necessary, create a role in IAM, then attach it here.

Parameter name : Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the types of Nodes in the Cluster. Names are case-sensitive.

Parameter networkSettings : Network settings that connect the Nodes in the Cluster to one or more of the Networks that the Cluster is associated with.

Parameter requestId : The unique ID of the request.

Parameter tags : A collection of key-value pairs.

Implementation

Future<CreateClusterResponse> createCluster({
  ClusterType? clusterType,
  String? instanceRoleArn,
  String? name,
  ClusterNetworkSettingsCreateRequest? networkSettings,
  String? requestId,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    if (clusterType != null) 'clusterType': clusterType.value,
    if (instanceRoleArn != null) 'instanceRoleArn': instanceRoleArn,
    if (name != null) 'name': name,
    if (networkSettings != null) 'networkSettings': networkSettings,
    'requestId': requestId ?? _s.generateIdempotencyToken(),
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/prod/clusters',
    exceptionFnMap: _exceptionFns,
  );
  return CreateClusterResponse.fromJson(response);
}