deleteTaskSet method
Deletes a specified task set within a service. This is used when a service
uses the EXTERNAL
deployment controller type. For more
information, see Amazon
ECS Deployment Types in the Amazon Elastic Container Service
Developer Guide.
May throw ServerException. May throw ClientException. May throw InvalidParameterException. May throw ClusterNotFoundException. May throw UnsupportedFeatureException. May throw AccessDeniedException. May throw ServiceNotFoundException. May throw ServiceNotActiveException. May throw TaskSetNotFoundException.
Parameter cluster
:
The short name or full Amazon Resource Name (ARN) of the cluster that
hosts the service that the task set exists in to delete.
Parameter service
:
The short name or full Amazon Resource Name (ARN) of the service that
hosts the task set to delete.
Parameter taskSet
:
The task set ID or full Amazon Resource Name (ARN) of the task set to
delete.
Parameter force
:
If true
, this allows you to delete a task set even if it
hasn't been scaled down to zero.
Implementation
Future<DeleteTaskSetResponse> deleteTaskSet({
required String cluster,
required String service,
required String taskSet,
bool? force,
}) async {
ArgumentError.checkNotNull(cluster, 'cluster');
ArgumentError.checkNotNull(service, 'service');
ArgumentError.checkNotNull(taskSet, 'taskSet');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonEC2ContainerServiceV20141113.DeleteTaskSet'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'cluster': cluster,
'service': service,
'taskSet': taskSet,
if (force != null) 'force': force,
},
);
return DeleteTaskSetResponse.fromJson(jsonResponse.body);
}