:doc:`Batch <../../batch>` / Paginator / ListServiceJobs

***************
ListServiceJobs
***************



.. py:class:: Batch.Paginator.ListServiceJobs

  ::

    
    paginator = client.get_paginator('list_service_jobs')

  
  

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

    Creates an iterator that will paginate through responses from :py:meth:`Batch.Client.list_service_jobs`.

    See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/ListServiceJobs>`_    


    **Request Syntax**
    ::

      response_iterator = paginator.paginate(
          jobQueue='string',
          jobStatus='SUBMITTED'|'PENDING'|'RUNNABLE'|'SCHEDULED'|'STARTING'|'RUNNING'|'SUCCEEDED'|'FAILED',
          filters=[
              {
                  'name': 'string',
                  'values': [
                      'string',
                  ]
              },
          ],
          PaginationConfig={
              'MaxItems': 123,
              'PageSize': 123,
              'StartingToken': 'string'
          }
      )
      
    :type jobQueue: string
    :param jobQueue: 

      The name or ARN of the job queue with which to list service jobs.

      

    
    :type jobStatus: string
    :param jobStatus: 

      The job status used to filter service jobs in the specified queue. If the ``filters`` parameter is specified, the ``jobStatus`` parameter is ignored and jobs with any status are returned. The exception is the ``SHARE_IDENTIFIER`` filter and ``jobStatus`` can be used together. If you don't specify a status, only ``RUNNING`` jobs are returned.

       

      .. note::

        

        The ``SHARE_IDENTIFIER`` filter and the ``jobStatus`` field can be used together to filter results.

        

      

    
    :type filters: list
    :param filters: 

      The filter to apply to the query. Only one filter can be used at a time. When the filter is used, ``jobStatus`` is ignored with the exception that ``SHARE_IDENTIFIER`` and ``jobStatus`` can be used together. The results are sorted by the ``createdAt`` field, with the most recent jobs being first.

       

      .. note::

        

        The ``SHARE_IDENTIFIER`` filter and the ``jobStatus`` field can be used together to filter results.

        

        JOB_NAME  

      The value of the filter is a case-insensitive match for the job name. If the value ends with an asterisk (*), the filter matches any job name that begins with the string before the '*'. This corresponds to the ``jobName`` value. For example, ``test1`` matches both ``Test1`` and ``test1``, and ``test1*`` matches both ``test1`` and ``Test10``. When the ``JOB_NAME`` filter is used, the results are grouped by the job name and version.

        BEFORE_CREATED_AT  

      The value for the filter is the time that's before the job was created. This corresponds to the ``createdAt`` value. The value is a string representation of the number of milliseconds since 00:00:00 UTC (midnight) on January 1, 1970.

        AFTER_CREATED_AT  

      The value for the filter is the time that's after the job was created. This corresponds to the ``createdAt`` value. The value is a string representation of the number of milliseconds since 00:00:00 UTC (midnight) on January 1, 1970.

        SHARE_IDENTIFIER  

      The value for the filter is the fairshare scheduling share identifier.

      

    
      - *(dict) --* 

        A filter name and value pair that's used to return a more specific list of results from a ``ListJobs`` or ``ListJobsByConsumableResource`` API operation.

        

      
        - **name** *(string) --* 

          The name of the filter. Filter names are case sensitive.

          

        
        - **values** *(list) --* 

          The filter values.

          

        
          - *(string) --* 

          
      
      
  
    :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**

      
      ::

        {
            'jobSummaryList': [
                {
                    'latestAttempt': {
                        'serviceResourceId': {
                            'name': 'TrainingJobArn',
                            'value': 'string'
                        }
                    },
                    'capacityUsage': [
                        {
                            'capacityUnit': 'string',
                            'quantity': 123.0
                        },
                    ],
                    'createdAt': 123,
                    'jobArn': 'string',
                    'jobId': 'string',
                    'jobName': 'string',
                    'scheduledAt': 123,
                    'serviceJobType': 'SAGEMAKER_TRAINING',
                    'shareIdentifier': 'string',
                    'status': 'SUBMITTED'|'PENDING'|'RUNNABLE'|'SCHEDULED'|'STARTING'|'RUNNING'|'SUCCEEDED'|'FAILED',
                    'statusReason': 'string',
                    'startedAt': 123,
                    'stoppedAt': 123
                },
            ],
            'NextToken': 'string'
        }
        
      **Response Structure**

      

      - *(dict) --* 
        

        - **jobSummaryList** *(list) --* 

          A list of service job summaries.

          
          

          - *(dict) --* 

            Summary information about a service job.

            
            

            - **latestAttempt** *(dict) --* 

              Information about the latest attempt for the service job.

              
              

              - **serviceResourceId** *(dict) --* 

                The service resource identifier associated with the service job attempt.

                
                

                - **name** *(string) --* 

                  The name of the resource identifier.

                  
                

                - **value** *(string) --* 

                  The value of the resource identifier.

                  
            
          
            

            - **capacityUsage** *(list) --* 

              The capacity usage information for this service job, including the unit of measure and quantity of resources being used.

              
              

              - *(dict) --* 

                The capacity usage for a service job, including the unit of measure and quantity of resources being used.

                
                

                - **capacityUnit** *(string) --* 

                  The unit of measure for the service job capacity usage. For service jobs, this is ``NUM_INSTANCES``.

                  
                

                - **quantity** *(float) --* 

                  The quantity of capacity being used by the service job, measured in the units specified by ``capacityUnit``.

                  
            
          
            

            - **createdAt** *(integer) --* 

              The Unix timestamp (in milliseconds) for when the service job was created.

              
            

            - **jobArn** *(string) --* 

              The Amazon Resource Name (ARN) of the service job.

              
            

            - **jobId** *(string) --* 

              The job ID for the service job.

              
            

            - **jobName** *(string) --* 

              The name of the service job.

              
            

            - **scheduledAt** *(integer) --* 

              The Unix timestamp (in milliseconds) for when the service job was scheduled for execution.

              
            

            - **serviceJobType** *(string) --* 

              The type of service job. For SageMaker Training jobs, this value is ``SAGEMAKER_TRAINING``.

              
            

            - **shareIdentifier** *(string) --* 

              The share identifier for the job.

              
            

            - **status** *(string) --* 

              The current status of the service job.

              
            

            - **statusReason** *(string) --* 

              A short string to provide more details on the current status of the service job.

              
            

            - **startedAt** *(integer) --* 

              The Unix timestamp (in milliseconds) for when the service job was started.

              
            

            - **stoppedAt** *(integer) --* 

              The Unix timestamp (in milliseconds) for when the service job stopped running.

              
        
      
        

        - **NextToken** *(string) --* 

          A token to resume pagination.

          
    