Updated on 2025-08-06 GMT+08:00

Listing Batch Processing Jobs

Function

This API is used to list 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

    Definition

    Project ID, which is used for resource isolation. For how to obtain a project ID, see Obtaining a Project ID.

    Example: 48cc2c48765f481480c7db940d6409d1

    Constraints

    None

    Range

    The value can contain up to 64 characters. Only letters and digits are allowed.

    Default Value

    None

    Table 2 query parameter description

    Parameter

    Mandatory

    Type

    Description

    job_name

    No

    String

    Definition

    Name of a batch processing job.

    Constraints

    None

    Range

    None

    Default Value

    None

    job-id

    No

    String

    Definition

    Job ID used to query a batch job. Example: 03923a72-5ace-466a-a573-e8c7b08b8cf3

    Constraints

    None

    Range

    None

    Default Value

    None

    cluster_name

    No

    String

    Definition

    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.

    Constraints

    None

    Range

    None

    Default Value

    None

    queue_name

    No

    String

    Definition

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

    Constraints

    None

    Range

    None

    Default Value

    None

    from

    No

    Integer

    Definition

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

    Constraints

    None

    Range

    None

    Default Value

    None

    size

    No

    Integer

    Definition

    Number of batch processing jobs to be queried

    Constraints

    None

    Range

    None

    Default Value

    None

    state

    No

    String

    Definition

    Job status by which batch jobs are queried

    Constraints

    None

    Range

    • starting: A job is being started.
    • running: A job is being executed.
    • dead: A session has exited.
    • success: A session is successfully stopped.
    • recovering: A job is being restored.

    Default Value

    None

    owner

    No

    String

    Definition

    User who submits a job.

    Constraints

    None

    Range

    None

    Default Value

    None

Request Parameters

None

Response Parameters

Table 3 Response parameters

Parameter

Mandatory

Type

Description

from

No

Integer

Definition

Index number of the start batch processing job.

Range

None

total

No

Integer

Definition

Total number of batch processing jobs.

Range

None

sessions

No

Array of objects

Definition

Batch job information. For details, see Table 4.

Range

None

create_time

No

Long

Definition

Time when a batch processing job is created.

Range

None

Table 4 sessions parameters

Parameter

Mandatory

Type

Description

duration

No

Long

Definition

Job running duration (unit: millisecond)

Range

None

id

No

String

Definition

ID of a batch processing job

Range

None

state

No

String

Definition

Status of a batch processing job

Range

  • starting: A job is being started.
  • running: A job is being executed.
  • dead: A session has exited.
  • success: A session is successfully stopped.
  • recovering: A job is being restored.

appId

No

String

Definition

Backend application ID of a batch processing job

Range

None

log

No

Array of Strings

Definition

Last 10 records of the current batch processing job

Range

None

sc_type

No

String

Definition

Type of a computing resource. Currently, the value can be A, B, or C. If the computing resource type is customized, value CUSTOMIZED is returned.

Range

  • A: physical resources, with 8 vCPUs and 32 GB of memory
    • driverCores: 2;
    • executorCores: 1;
    • driverMemory: 7G;
    • executorMemory: 4G;
    • numExecutor: 6.
  • B: physical resources, with 16 vCPUs and 64 GB of memory
    • driverCores: 2;
    • executorCores: 2;
    • driverMemory: 7G;
    • executorMemory: 8G;
    • numExecutor: 7.
  • C: physical resources, with 32 vCPUs and 128 GB of memory
    • driverCores: 4;
    • executorCores: 2;
    • driverMemory: 15G;
    • executorMemory: 8G;
    • numExecutor: 14.

cluster_name

No

String

Definition

Queue where a batch processing job is located.

Range

None

create_time

No

Long

Definition

Time when a batch processing job is created. The timestamp is in milliseconds.

Range

None

name

No

String

Definition

Name of a batch processing job.

Range

None

owner

No

String

Definition

Owner of a batch processing job.

Range

None

proxyUser

No

String

Definition

Proxy user (resource tenant) to which a batch processing job belongs.

Range

None

kind

No

String

Definition

Type of a batch processing job. Only Spark parameters are supported.

Range

None

queue

No

String

Definition

Queue where a batch processing job is located.

Range

None

image

No

String

Definition

Custom image. The format is Organization name/Image name:Image version.

This parameter is valid only when feature is set to custom. You can use this parameter with the feature parameter to specify a custom Spark image for job running.

Range

None

req_body

No

String

Definition

Request parameter details.

Range

None

update_time

No

Long

Definition

Time when a batch processing job is updated. The timestamp is in milliseconds.

Range

None

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 5 describes the status code.

Table 5 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 Codes.