Batch / Client / list_jobs_by_consumable_resource

list_jobs_by_consumable_resource

Batch.Client.list_jobs_by_consumable_resource(**kwargs)

Returns a list of Batch jobs that require a specific consumable resource.

See also: AWS API Documentation

Request Syntax

response = client.list_jobs_by_consumable_resource(
    consumableResource='string',
    filters=[
        {
            'name': 'string',
            'values': [
                'string',
            ]
        },
    ],
    maxResults=123,
    nextToken='string'
)
Parameters:
  • consumableResource (string) –

    [REQUIRED]

    The name or ARN of the consumable resource.

  • filters (list) –

    The filters to apply to the job list query. If used, only those jobs requiring the specified consumable resource ( consumableResource) and that match the value of the filters are listed. The filter names and values can be:

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

    • name: JOB_NAME The values are 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) –

  • maxResults (integer) – The maximum number of results returned by ListJobsByConsumableResource in paginated output. When this parameter is used, ListJobsByConsumableResource 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 ListJobsByConsumableResource request with the returned nextToken value. This value can be between 1 and 100. If this parameter isn’t used, then ListJobsByConsumableResource returns up to 100 results and a nextToken value if applicable.

  • nextToken (string) –

    The nextToken value returned from a previous paginated ListJobsByConsumableResource 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.

Return type:

dict

Returns:

Response Syntax

{
    'jobs': [
        {
            'jobArn': 'string',
            'jobQueueArn': 'string',
            'jobName': 'string',
            'jobDefinitionArn': 'string',
            'shareIdentifier': 'string',
            'jobStatus': 'string',
            'quantity': 123,
            'statusReason': 'string',
            'startedAt': 123,
            'createdAt': 123,
            'consumableResourceProperties': {
                'consumableResourceList': [
                    {
                        'consumableResource': 'string',
                        'quantity': 123
                    },
                ]
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • jobs (list) –

      The list of jobs that require the specified consumable resources.

      • (dict) –

        Current information about a consumable resource required by a job.

        • jobArn (string) –

          The Amazon Resource Name (ARN) of the job.

        • jobQueueArn (string) –

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

        • jobName (string) –

          The name of the job.

        • jobDefinitionArn (string) –

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

        • shareIdentifier (string) –

          The fair-share scheduling policy identifier for the job.

        • jobStatus (string) –

          The status of the job. Can be one of:

          • SUBMITTED

          • PENDING

          • RUNNABLE

          • STARTING

          • RUNNING

          • SUCCEEDED

          • FAILED

        • quantity (integer) –

          The total amount of the consumable resource that is available.

        • statusReason (string) –

          A short, human-readable string to provide more details for the current status of the job.

        • startedAt (integer) –

          The Unix timestamp for when the job was started. More specifically, it’s when the job transitioned from the STARTING state to the RUNNING state.

        • createdAt (integer) –

          The Unix timestamp (in milliseconds) for when the consumable resource was created.

        • consumableResourceProperties (dict) –

          Contains a list of consumable resources required by the job.

          • consumableResourceList (list) –

            The list of consumable resources required by a job.

            • (dict) –

              Information about a consumable resource required to run a job.

              • consumableResource (string) –

                The name or ARN of the consumable resource.

              • quantity (integer) –

                The quantity of the consumable resource that is needed.

    • nextToken (string) –

      The nextToken value to include in a future ListJobsByConsumableResource request. When the results of a ListJobsByConsumableResource 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