describeTaskDefinition method
Future<DescribeTaskDefinitionResponse>
describeTaskDefinition({
- required String taskDefinition,
- List<
TaskDefinitionField> ? include,
Describes a task definition. You can specify a family
and
revision
to find information about a specific task
definition, or you can simply specify the family to find the latest
ACTIVE
revision in that family.
May throw ServerException. May throw ClientException. May throw InvalidParameterException.
Parameter taskDefinition
:
The family
for the latest ACTIVE
revision,
family
and revision
(family:revision
) for a specific revision in the family, or
full Amazon Resource Name (ARN) of the task definition to describe.
Parameter include
:
Specifies whether to see the resource tags for the task definition. If
TAGS
is specified, the tags are included in the response. If
this field is omitted, tags are not included in the response.
Implementation
Future<DescribeTaskDefinitionResponse> describeTaskDefinition({
required String taskDefinition,
List<TaskDefinitionField>? include,
}) async {
ArgumentError.checkNotNull(taskDefinition, 'taskDefinition');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'AmazonEC2ContainerServiceV20141113.DescribeTaskDefinition'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'taskDefinition': taskDefinition,
if (include != null)
'include': include.map((e) => e.toValue()).toList(),
},
);
return DescribeTaskDefinitionResponse.fromJson(jsonResponse.body);
}