deregisterTaskDefinition method
- required String taskDefinition,
Deregisters the specified task definition by family and revision. Upon
deregistration, the task definition is marked as INACTIVE
.
Existing tasks and services that reference an INACTIVE
task
definition continue to run without disruption. Existing services that
reference an INACTIVE
task definition can still scale up or
down by modifying the service's desired count.
You cannot use an INACTIVE
task definition to run new tasks
or create new services, and you cannot update an existing service to
reference an INACTIVE
task definition. However, there may be
up to a 10-minute window following deregistration where these restrictions
have not yet taken effect.
May throw ServerException. May throw ClientException. May throw InvalidParameterException.
Parameter taskDefinition
:
The family
and revision
(family:revision
) or full Amazon Resource Name (ARN) of the
task definition to deregister. You must specify a revision
.
Implementation
Future<DeregisterTaskDefinitionResponse> deregisterTaskDefinition({
required String taskDefinition,
}) async {
ArgumentError.checkNotNull(taskDefinition, 'taskDefinition');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'AmazonEC2ContainerServiceV20141113.DeregisterTaskDefinition'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'taskDefinition': taskDefinition,
},
);
return DeregisterTaskDefinitionResponse.fromJson(jsonResponse.body);
}