describeTasks method
Describes a specified task or tasks.
Currently, stopped tasks appear in the returned results for at least one hour.
If you have tasks with tags, and then delete the cluster, the tagged tasks are returned in the response. If you create a new cluster with the same name as the deleted cluster, the tagged tasks are not included in the response.
May throw AccessDeniedException.
May throw ClientException.
May throw ClusterNotFoundException.
May throw InvalidParameterException.
May throw ServerException.
Parameter tasks :
A list of up to 100 task IDs or full ARN entries.
Parameter cluster :
The short name or full Amazon Resource Name (ARN) of the cluster that
hosts the task or tasks to describe. If you do not specify a cluster, the
default cluster is assumed.
Parameter include :
Specifies whether you want to see the resource tags for the task. If
TAGS is specified, the tags are included in the response. If
this field is omitted, tags aren't included in the response.
Implementation
Future<DescribeTasksResponse> describeTasks({
required List<String> tasks,
String? cluster,
List<TaskField>? include,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonEC2ContainerServiceV20141113.DescribeTasks'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'tasks': tasks,
if (cluster != null) 'cluster': cluster,
if (include != null) 'include': include.map((e) => e.value).toList(),
},
);
return DescribeTasksResponse.fromJson(jsonResponse.body);
}