Querying a List of Jobs
Function
This API is used to query the job list in a specified MRS cluster.
URI
- Format
- Parameter description
Table 1 URI parameters Parameter
Mandatory
Type
Description
project_id
Yes
String
The project ID. For details about how to obtain the project ID, see Obtaining a Project ID.
cluster_id
Yes
String
The cluster ID. For details about how to obtain the cluster ID, see Obtaining a Cluster ID.
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
job_name |
No |
String |
The job name. The value can contain 1 to 128 characters. Only letters, numbers, hyphens (-), and underscores (_) are allowed. |
job_id |
No |
String |
The job ID. The value can contain 1 to 64 characters. Only letters, numbers, and hyphens (-) are allowed. |
user |
No |
String |
The username. The value can contain 1 to 32 characters. Only letters, numbers, hyphens (-), underscores (_), and periods (.) are allowed, but the value cannot start with a number. |
job_type |
No |
String |
The job type. Possible values:
|
job_state |
No |
String |
The job execution status. Possible values:
|
job_result |
No |
String |
The job execution result. Possible values:
|
queue |
No |
String |
The type of the resource queue used by a job. The value can contain 1 to 64 characters. Only letters, numbers, and hyphens (-) are allowed. |
limit |
No |
String |
The number of records displayed on each page in the returned result. The default value is 10. |
offset |
No |
String |
The default offset from which the job list starts to be queried is 1. |
sort_by |
No |
String |
The sorting mode of returned results. The default value is desc. Possible values:
|
submitted_time_begin |
No |
Long |
The UTC timestamp after which a job is submitted, in milliseconds, for example, 1562032041362. |
submitted_time_end |
No |
Long |
The UTC timestamp before which a job is submitted, in milliseconds, for example, 1562032041362. |
Response Parameters
Status code: 202
Parameter |
Type |
Description |
---|---|---|
job_list |
Array of JobQueryBean objects |
The job list. For details about the parameters, see Table 4. |
Parameter |
Type |
Description |
---|---|---|
job_id |
String |
The job ID. |
user |
String |
The name of the user who submits a job. |
job_name |
String |
The job name. |
job_result |
String |
The final result of a job. Possible values:
|
job_state |
String |
The job execution status. Possible values:
|
job_progress |
Float |
The job execution progress. |
job_type |
String |
The job type. Possible values:
|
started_time |
Long |
The time when a job starts to execute, in milliseconds. |
submitted_time |
Long |
The time when a job is submitted, in milliseconds. |
finished_time |
Long |
The time when a job execution is completed, in milliseconds. |
elapsed_time |
Long |
The job execution duration, in milliseconds. |
arguments |
String |
The running parameters. |
properties |
String |
The configuration parameter, which is used to configure -d parameters. The value can contain a maximum of 2,048 characters. Special characters (;|&>'<$!\\) are not allowed. This parameter can be left blank. |
launcher_id |
String |
The actual job ID. |
app_id |
String |
The actual job ID. |
tracking_url |
String |
The URL for accessing logs. Currently, only SparkSubmit jobs support this parameter. This parameter accesses the Yarn Web UI via the EIP bound to the cluster. If the EIP is unbound from the cluster on the VPC console, the MRS service data is not updated in a timely manner and the access fails. In this case, you can bind the EIP to the cluster again to rectify the fault. |
queue |
String |
The type of the resource queue used by a job. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
The error code. |
error_msg |
String |
The error message. |
Example
- Example request
GET https://{endpoint}/v2/{project_id}/clusters/{cluster_id}/job-executions
- Example response
- Example of a successful response
{ "job_list": [{ "job_id": "981374c1-85da-44ee-be32-edfb4fba776c", "user": "xxxx", "job_name": "SparkSubmitTset", "job_result": "UNDEFINED", "job_state": "ACCEPTED", "job_progress": "0", "job_type": "SparkSubmit", "started_time": "0", "submitted_time": 1564714763119, "finished_time": "0", "elapsed_time": "0", "queue": "default", "arguments": "[--class, --driver-memory, --executor-cores, --master, yarn-cluster, obs://obs-test/hadoop-mapreduce-examples-3.1.1.jar, dddd]", "launcher_id": "application_1564622673393_0613", "properties": "{}" }, { "job_id": "c54c8aa0-c277-4f83-8acc-521d85cfa32b", "user": "xxxx", "job_name": "SparkSubmitTset2", "job_result": "UNDEFINED", "job_state": "ACCEPTED", "job_progress": "0", "job_type": "SparkSubmit", "started_time": "0", "submitted_time": 1564714020099, "finished_time": "0", "elapsed_time": "0", "queue": "default", "arguments": "[--conf, yujjsjhe, --driver-memory, yueujdjjd, --master, yarn-cluster, obs://obs-test/hadoop-mapreduce-examples-3.1.1.jar]", "launcher_id": "application_1564622673393_0611", "properties": "{}" } ] }
- Example of a failed response
{ "error_msg": "Failed to query the job list." "error_code":"0166" }
- Example of a successful response
Status Codes
See Status Codes.
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot