Querying Job Status¶
Function¶
This API is used to query the status of a submitted job.
URI¶
URI format
GET /v1.0/{project_id}/jobs/{job_id}/status
Parameter description
¶ 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.
job_id
Yes
String
Job ID.
Request¶
None
Response¶
Parameter | Type | Description |
---|---|---|
is_success | Boolean | Whether the request is successfully executed. Value true indicates that the request is successfully executed. |
message | String | System prompt. If execution succeeds, this parameter is left blank. |
job_id | String | Job ID. You can get the value by calling Submitting a SQL Job (Recommended). |
job_type | String | Type of a job, Includes DDL, DCL, IMPORT, EXPORT, QUERY, INSERT, DATA_MIGRATION, UPDATE, DELETE, RESTART_QUEUE and SCALE_QUEUE. |
job_mode | String | Job execution mode. The options are as follows:
|
queue_name | String | Name of the queue where the job is submitted. |
owner | String | User who submits a job. |
start_time | Long | Time when a job is started. The timestamp is in milliseconds. |
duration | Long | Job running duration (unit: millisecond). |
status | String | Status of a job, including RUNNING, SCALING, LAUNCHING, FINISHED, FAILED, and CANCELLED. |
input_row_count | Long | Number of records scanned during the Insert job execution. |
bad_row_count | Long | Number of error records scanned during the Insert job execution. |
input_size | Long | Size of scanned files during job execution (unit: byte). |
result_count | Integer | Total number of records returned by the current job or total number of records inserted by the Insert job. |
database_name | String | Name of the database where the target table resides. database_name is valid only for jobs of the IMPORT EXPORT, and QUERY types. |
table_name | String | Name of the target table. table_name is valid only for jobs of the IMPORT EXPORT, and QUERY types. |
detail | String | JSON string for information about related columns. |
statement | String | SQL statements of a job. |
tags | Array of objects | Job tags. For details, see Table 3. |
user_conf | String | JSON string of related columns queried using SQL statements. |
result_format | String | Storage format of job results. Currently, only CSV is supported. |
result_path | String | OBS path of job results. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
key | Yes | String | Tag key |
value | Yes | String | Tag value |
Example Request¶
None
Example Response¶
{
"is_success": true,
"message": "",
"job_id": "208b08d4-0dc2-4dd7-8879-ddd4c020d7aa",
"job_type": "QUERY",
"job_mode":"async",
"queue_name": "default",
"owner": "test",
"start_time": 1509335108918,
"duration": 2523,
"status": "FINISHED",
"input_size": 22,
"result_count": 4,
"database_name":"dbtest",
"table_name":"tbtest",
"detail": "{\"type\":\"struct\",\"fields\":[{\"name\":\"id\",\"type\":\"integer\",\"nullable\":true,\"metadata\":{}},{\"name\":\"name\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}}]}",
"statement": "select * from t1"
}
Status Codes¶
Table 4 describes the status code.
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.