Batch / Client / list_service_jobs

list_service_jobs

Batch.Client.list_service_jobs(**kwargs)

Returns a list of service jobs for a specified job queue.

See also: AWS API Documentation

Request Syntax

response = client.list_service_jobs(
    jobQueue='string',
    jobStatus='SUBMITTED'|'PENDING'|'RUNNABLE'|'SCHEDULED'|'STARTING'|'RUNNING'|'SUCCEEDED'|'FAILED',
    maxResults=123,
    nextToken='string',
    filters=[
        {
            'name': 'string',
            'values': [
                'string',
            ]
        },
    ]
)
Parameters:
  • jobQueue (string) – The name or ARN of the job queue with which to list service jobs.

  • jobStatus (string) – The job status with which to filter service jobs.

  • maxResults (integer) – The maximum number of results returned by ListServiceJobs in paginated output. When this parameter is used, ListServiceJobs only returns maxResults results in a single page and a nextToken response element. The remaining results of the initial request can be seen by sending another ListServiceJobs request with the returned nextToken value. This value can be between 1 and 100. If this parameter isn’t used, then ListServiceJobs returns up to 100 results and a nextToken value if applicable.

  • nextToken (string) –

    The nextToken value returned from a previous paginated ListServiceJobs request where maxResults was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the nextToken value. This value is null when there are no more results to return.

    Note

    Treat this token as an opaque identifier that’s only used to retrieve the next items in a list and not for other programmatic purposes.

  • filters (list) –

    The filters to apply to the service job list query. The filter names and values can be:

    • name: JOB_STATUS values: SUBMITTED | PENDING | RUNNABLE | STARTING | RUNNING | SUCCEEDED | FAILED | SCHEDULED

    • name: JOB_NAME values: case-insensitive matches for the job name. If a filter value ends with an asterisk (*), it matches any job name that begins with the string before the ‘*’.

    • (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) –

Return type:

dict

Returns:

Response Syntax

{
    'jobSummaryList': [
        {
            'latestAttempt': {
                'serviceResourceId': {
                    'name': 'TrainingJobArn',
                    'value': 'string'
                }
            },
            'createdAt': 123,
            'jobArn': 'string',
            'jobId': 'string',
            'jobName': 'string',
            '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.

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

        • 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) –

      The nextToken value to include in a future ListServiceJobs request. When the results of a ListServiceJobs request exceed maxResults, this value can be used to retrieve the next page of results. This value is null when there are no more results to return.

Exceptions

  • Batch.Client.exceptions.ClientException

  • Batch.Client.exceptions.ServerException