Listing Batch Processing Jobs

Function

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

URI

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.