ListTasks

class 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'
    }
)
Parameters
  • cluster (string) -- The short name or full Amazon Resource Name (ARN) of the cluster to use when filtering the ListTasks results. If you do not specify a cluster, the default cluster is assumed.
  • containerInstance (string) -- The container instance ID or full ARN of the container instance to use when filtering the ListTasks results. Specifying a containerInstance limits the results to tasks that belong to that container instance.
  • family (string) -- The name of the task definition family to use when filtering the ListTasks results. Specifying a family limits the results to tasks that belong to that family.
  • startedBy (string) --

    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.

  • serviceName (string) -- The name of the service to use when filtering the ListTasks results. Specifying a serviceName limits the results to tasks that belong to that service.
  • desiredStatus (string) --

    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 ).

  • launchType (string) -- The launch type to use when filtering the ListTasks results.
  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      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.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'taskArns': [
        'string',
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • taskArns (list) --

      The list of task ARN entries for the ListTasks request.

      • (string) --
    • NextToken (string) --

      A token to resume pagination.