Updated on 2022-12-07 GMT+08:00

Obtaining the List of Batch Processing Jobs

Function

This API is used to obtain the list of batch processing jobs in a queue of a project.

URI

  • URI format

    GET /v2.0/{project_id}/batches

  • Parameter description
    Table 1 URI parameter

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID, which is used for resource isolation. For details about how to obtain its value, see Obtaining a Project ID.

    Table 2 query parameter description

    Parameter

    Mandatory

    Type

    Description

    job_name

    No

    String

    Name of a batch processing job.

    job_id

    No

    String

    This API is used to query a batch job based on the job ID.

    cluster_name

    No

    String

    DLI queue name. If this parameter is left blank, the names of all batch processing jobs in the current project are obtained. You are advised to specify this parameter, instead of leaving it blank.

    queue_name

    No

    String

    DLI queue name. You can query batch jobs based on the queue name. This method is recommended.

    from

    No

    Integer

    Index number of the start batch processing job. By default, the index number starts from 0.

    size

    No

    Integer

    Number of batch processing jobs to be queried

    state

    No

    String

    Query batch jobs by job status.

    owner

    No

    String

    User who submits a job.

Request

None

Response

Table 3 Response parameter description

Parameter

Mandatory

Type

Description

from

No

Integer

Index number of the start batch processing job.

total

No

Integer

Total number of batch processing jobs.

sessions

No

Array of objects

Batch job information. For details, see Table 6 in Creating a Batch Processing Job.

create_time

No

Long

Time when a batch processing job is created.

Example Request

None

Example Response

{
    "from": 0,
    "total": 1,
    "sessions": [
        {
            "id": "178fa687-2e8a-41ed-a439-b00de60bb176",
            "state": "dead",
            "appId": null,
            "log": [
             "stdout: ",
             "stderr: ",
             "YARN Diagnostics: "
           ],
           "sc_type": "A",
           "cluster_name": "test",
           "create_time": 1531906043036
        }
    ]
}

Status Codes

Table 4 describes the status code.

Table 4 Status codes

Status Code

Description

200

The query is successful.

400

Request error.

500

Internal service error.

Error Codes

If an error occurs when this API is invoked, the system does not return the result similar to the preceding example, but returns the error code and error information. For details, see Error Code.