deleteCluster method

Future<DeleteClusterResponse> deleteCluster({
  1. required String cluster,
})

Deletes the specified cluster. The cluster will transition to the INACTIVE state. Clusters with an INACTIVE status may remain discoverable in your account for a period of time. However, this behavior is subject to change in the future, so you should not rely on INACTIVE clusters persisting.

You must deregister all container instances from this cluster before you may delete it. You can list the container instances in a cluster with ListContainerInstances and deregister them with DeregisterContainerInstance.

May throw ServerException. May throw ClientException. May throw InvalidParameterException. May throw ClusterNotFoundException. May throw ClusterContainsContainerInstancesException. May throw ClusterContainsServicesException. May throw ClusterContainsTasksException. May throw UpdateInProgressException.

Parameter cluster : The short name or full Amazon Resource Name (ARN) of the cluster to delete.

Implementation

Future<DeleteClusterResponse> deleteCluster({
  required String cluster,
}) async {
  ArgumentError.checkNotNull(cluster, 'cluster');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonEC2ContainerServiceV20141113.DeleteCluster'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'cluster': cluster,
    },
  );

  return DeleteClusterResponse.fromJson(jsonResponse.body);
}