ECS.Paginator.ListTasks¶paginator = client.get_paginator('list_tasks')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from ECS.Client.list_tasks().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
cluster='string',
containerInstance='string',
family='string',
startedBy='string',
serviceName='string',
desiredStatus='RUNNING'|'PENDING'|'STOPPED',
launchType='EC2'|'FARGATE'|'EXTERNAL',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
ListTasks results. If you do not specify a cluster, the default cluster is assumed.ListTasks results. Specifying a containerInstance limits the results to tasks that belong to that container instance.ListTasks results. Specifying a family limits the results to tasks that belong to that family.The startedBy value to filter the task results with. Specifying a startedBy value limits the results to tasks that were started with that value.
When you specify startedBy as the filter, it must be the only filter that you use.
ListTasks results. Specifying a serviceName limits the results to tasks that belong to that service.The task desired status to use when filtering the ListTasks results. Specifying a desiredStatus of STOPPED limits the results to tasks that Amazon ECS has set the desired status to STOPPED . This can be useful for debugging tasks that aren't starting properly or have died or finished. The default status filter is RUNNING , which shows tasks that Amazon ECS has set the desired status to RUNNING .
Note
Although you can filter results based on a desired status of PENDING , this doesn't return any results. Amazon ECS never sets the desired status of a task to that value (only a task's lastStatus may have a value of PENDING ).
ListTasks results.A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'taskArns': [
'string',
],
'NextToken': 'string'
}
Response Structure
(dict) --
taskArns (list) --
The list of task ARN entries for the ListTasks request.
NextToken (string) --
A token to resume pagination.