Querying All Jobs

Function

This API is used to query information about all jobs in the current project.

URI

Request

None

Response

Table 3 Response parameters

Parameter

Mandatory

Type

Description

is_success

Yes

Boolean

Indicates whether the request is successfully executed. Value true indicates that the request is successfully executed.

message

Yes

String

System prompt. If execution succeeds, the parameter setting may be left blank.

job_count

Yes

Integer

Indicates the total number of jobs.

jobs

Yes

Array of Objects

Indicates the information about a job. For details, see Table 4.

Table 4 jobs parameters

Parameter

Mandatory

Type

Description

job_id

Yes

String

Job ID.

job_type

Yes

String

Type of a job.

queue_name

Yes

String

Queue to which a job is submitted.

owner

Yes

String

User who submits a job.

start_time

Yes

Long

Time when a job is started. The timestamp is expressed in milliseconds.

duration

Yes

Long

Job running duration (unit: millisecond).

status

Yes

String

Status of a job, including LAUNCHING, RUNNING, FINISHED, FAILED, and CANCELLED.

input_row_count

No

Long

Number of records scanned during the Insert job execution.

bad_row_count

No

Long

Number of error records scanned during the Insert job execution.

input_size

Yes

Long

Size of scanned files during job execution.

result_count

Yes

Integer

Total number of records returned by the current job or total number of records inserted by the Insert job.

database_name

No

String

Name of the database where the target table resides. database_name is valid only for jobs of the Import and Export types.

table_name

No

String

Name of the target table. table_name is valid only for jobs of the Import and Export types.

with_column_header

No

Boolean

Import jobs, which record whether the imported data contains column names.

detail

Yes

String

JSON character string of related columns queried by using SQL statements.

statement

Yes

String

SQL statements of a job.

message

No

String

System prompt

end_time

No

Long

Job end time. The timestamp is in milliseconds.

tags

No

Array of Objects

Job tags. For details, see Table 5.

Table 5 tags parameters

Parameter

Mandatory

Type

Description

key

Yes

String

Tag key

value

Yes

String

Tag value

Example Request

None

Example Response

{
 "is_success": true,
  "message": "",
  "job_count": 1,
  "jobs": [
    {

      "detail": "{\"type\":\"struct\",\"fields\":[{\"name\":\"name\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}},{\"name\":\"age\",\"type\":\"integer\",\"nullable\":true,\"metadata\":{}}]}",
      "duration": 17731,

      "end_time": 1502349821460,
      "input_size": 0,
      "job_id": "37286cc7-0508-4ffd-b636-951c8a5c75de",
      "job_type": "QUERY",
      "message": "",
      "owner": "tenant1",
      "queue_name": "queue1",
      "result_count": 3,
      "start_time": 1502349803729,
      "statement": "select * from t_json_002",
      "status": "FINISHED",
      "with_column_header": false
    }
  ]
}

Status Codes

Table 6 describes the status code.

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