Updated on 2023-12-14 GMT+08:00

Querying Batch Job Details

Function

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

URI

  • URI format

    GET /v2.0/{project_id}/batches/{batch_id}

  • Parameter description
    Table 1 URI parameters

    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.

    batch_id

    Yes

    String

    ID of a batch processing job.

Request

None

Response

Table 2 Response parameters

Parameter

Mandatory

Type

Description

id

No

String

ID of a batch processing job.

appId

No

String

Back-end application ID of a batch processing job.

name

No

String

Name of a batch processing job.

owner

No

String

Owner of a batch processing job.

proxyUser

No

String

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

state

No

String

Status of a batch processing job. For details, see Table 7 in Creating a Batch Processing Job.

kind

No

String

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

log

No

Array of Strings

Last 10 records of the current batch processing job.

sc_type

No

String

Type of a computing resource. If the computing resource type is customized, value CUSTOMIZED is returned.

cluster_name

No

String

Queue where a batch processing job is located.

queue

No

String

Queue where a batch processing job is located.

create_time

No

Long

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

update_time

No

Long

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

feature

No

String

Job feature. Type of the Spark image used by a job.

  • basic: indicates that the basic Spark image provided by DLI is used.
  • custom: indicates that the user-defined Spark image is used.
  • ai: indicates that the AI image provided by DLI is used.

spark_version

No

String

Version of the Spark component used by a job. Set this parameter when feature is set to basic or ai. If this parameter is not set, the default Spark component version 2.3.2 is used.

image

No

String

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 user-defined Spark image for job running. For details about how to use custom images, see Data Lake Insight User Guide.

req_body

No

String

Request parameter details.

Example Request

None

Example Response

{
    "id": "0a324461-d9d9-45da-a52a-3b3c7a3d809e",
    "appId": "",
    "name": "",
    "owner": "",
    "proxyUser": "",
    "state": "starting",
    "kind":"",
    "log": [
           "stdout: ",
            "stderr: ",
            "YARN Diagnostics: "
    ],
    "sc_type": "A",
    "cluster_name": "test",
    "queue": "test",
    "create_time": 1531906043036,
    "update_time": 1531906043036
}

Status Codes

Table 3 describes the status code.

Table 3 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.