Querying the List of Jobs Running in an Exclusive Cluster
Function
This API is used to query the list of jobs running in an exclusive cluster. The following parameters are involved in this API: name, status, show_detail, cursor, next, limit, and order.
URI
- URI format
GET /v1.0/{project_id}/reserved_cluster/{cluster_id}/jobs
- Parameter description
Table 1 URI parameter description Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.
cluster_id
Yes
Integer
ID of an exclusive cluster.
name
No
String
Job name.
status
No
String
Job status code. The options are as follows:
- job_init
- job_submitting
- job_submit_fail
- job_running
- job_running_exception
- job_canceling
- job_cancel_success
- job_cancel_fail
show_detail
No
Boolean
Whether to return job details. The default value is false.
cursor
No
Long
Job ID.
next
No
Boolean
Whether to switch to the next page. The default value is true.
limit
No
Integer
Number of returned data records. The default value is 20.
order
No
String
Query result display. Value asc indicates that the query results are displayed in ascending order, and value desc indicates that the query results are displayed in descending order. The default value is desc.
Request
None
Response
- Example response
{ "message_id": "CS.23000", "message": "Querying of the job list succeeds.", "payload": { "total": 3, "jobs": [ { "job_id": 52912, "name": "carbondata0809", "desc": "", "user_name": "cs_testuser", "job_type": "flink_sql_job", "status": "job_running", "status_desc": "", "create_time": 1533803494092, "start_time": 1533805889940, "duration": 207119, "root_id": -1, "graph_editor_enabled": false }, { "job_id": 52819, "name": "testSparkJar", "desc": "", "user_name": "cs_testuser", "job_type": "spark_streaming_jar_job", "status": "job_running", "status_desc": "", "create_time": 1533798894629, "start_time": 1533799258793, "duration": 6838266, "root_id": -1, "graph_editor_enabled": false }, { "job_id": 52818, "name": "testFlinkJar", "desc": "testFlinkJar", "user_name": "cs_testuser", "job_type": "flink_jar_job", "status": "job_running", "status_desc": "", "create_time": 1533798799737, "start_time": 1533798894283, "duration": 7202776, "root_id": -1, "graph_editor_enabled": false } ] }, "current_time": 1533806097155 } - Parameter description
Table 2 Response parameters Parameter
Mandatory
Type
Description
message_id
No
String
Message type ID.
message
No
String
Message content.
current_time
No
Int
Current time, expressed by milliseconds.
payload
No
None
Information about the list of jobs running in an exclusive cluster.
total
No
Int
Number of records in the query result.
jobs
No
None
Information about a job.
job_id
Yes
Long
Job ID.
name
No
String
Job name.
desc
No
String
Job description.
username
No
String
Username. This parameter is valid only when show_detail is set to true.
job_type
No
String
Job type.
status
No
String
Job status.
status_desc
No
String
Description of job status.
create_time
Yes
Int
Time when a job is created.
start_time
No
Int
Time when a job is enabled. Value 0 indicates that the job has not been enabled.
duration
No
Int
Running duration of a job, expressed by milliseconds.
user_id
No
String
ID of the user who creates the job. This parameter is valid only when show_detail is set to true.
cluster_id
No
Int
Resource ID of an exclusive cluster. Ensure that the current user has been authorized to use resources of the exclusive cluster.
project_id
No
String
ID of the project to which a job belongs. This parameter is valid only when show_detail is set to true.
sql_body
No
String
Stream SQL statement.
run_mode
No
String
Running mode of a job. A job can run in shared or exclusive mode.
spu_number
No
Int
Number of SPUs selected for a job.
parallel_number
No
Int
Number of parallel jobs set by a user.
job_config
No
None
Job configuration. This parameter is valid only when show_detail is set to true.
checkpoint_enabled
No
boolean
Whether to enable the automatic job snapshot function.
- true: indicates to enable the automatic job snapshot function.
- false: indicates to disable the automatic job snapshot function.
- Default value: false
checkpoint_mode
No
String
Snapshot mode. The values include:
- ExactlyOnce
- AtLeastOnce
checkpoint_interval
No
Int
Snapshot interval, expressed by seconds.
log_enabled
No
boolean
Whether to enable the log storage function.
obs_bucket
No
String
Name of an OBS bucket.
checkpoint_interval
No
Int
Snapshot interval, expressed by seconds.
jar_url
No
String
OBS path of the JAR package. This parameter is valid only when show_detail is set to true.
main_class
No
String
OBS path where users are authorized to save the snapshot when checkpoint_enabled is set to true. This parameter is valid only when show_detail is set to true.
args
No
String
Job running parameter of the JAR package. This parameter is valid only when show_detail is set to true.
execution_graph
No
String
Job execution plan. This parameter is valid only when show_detail is set to true.
update_time
No
Int
Job update time. This parameter is valid only when show_detail is set to true.
Status Code
Table 3 describes the status code.
Error Code
For details, see Error Codes.
Last Article: Restarting an Exclusive Cluster
Next Article: Add an IP-Domain Mapping
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.