:doc:`ECS <../../ecs>` / Paginator / ListTasks

*********
ListTasks
*********



.. py:class:: ECS.Paginator.ListTasks

  ::

    
    paginator = client.get_paginator('list_tasks')

  
  

  .. py:method:: paginate(**kwargs)

    Creates an iterator that will paginate through responses from :py:meth:`ECS.Client.list_tasks`.

    See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/ListTasks>`_    


    **Request Syntax**
    ::

      response_iterator = paginator.paginate(
          cluster='string',
          containerInstance='string',
          family='string',
          startedBy='string',
          serviceName='string',
          desiredStatus='RUNNING'|'PENDING'|'STOPPED',
          launchType='EC2'|'FARGATE'|'EXTERNAL'|'MANAGED_INSTANCES',
          PaginationConfig={
              'MaxItems': 123,
              'PageSize': 123,
              'StartingToken': 'string'
          }
      )
      
    :type cluster: string
    :param cluster: 

      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.

      

    
    :type containerInstance: string
    :param containerInstance: 

      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.

      

    
    :type family: string
    :param family: 

      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.

      

    
    :type startedBy: string
    :param startedBy: 

      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.

      

    
    :type serviceName: string
    :param serviceName: 

      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.

      

    
    :type desiredStatus: string
    :param desiredStatus: 

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

        

      

    
    :type launchType: string
    :param launchType: 

      The launch type to use when filtering the ``ListTasks`` results.

      

    
    :type PaginationConfig: dict
    :param PaginationConfig: 

      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.

        

      
    
    
    :rtype: 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.

          
    