deleteCluster method
Deletes the specified cluster. The cluster transitions to the
INACTIVE state. Clusters with an INACTIVE status
might remain discoverable in your account for a period of time. However,
this behavior is subject to change in the future. We don't recommend that
you 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 AccessDeniedException.
May throw ClientException.
May throw ClusterContainsCapacityProviderException.
May throw ClusterContainsContainerInstancesException.
May throw ClusterContainsServicesException.
May throw ClusterContainsTasksException.
May throw ClusterNotFoundException.
May throw InvalidParameterException.
May throw ServerException.
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 {
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);
}