Querying a List of Jobs - ShowSingleJob
Function
This API is used to query jobs submitted on the job management page in a specified MRS cluster.
Constraints
None
Debugging
You can debug this API in API Explorer. Automatic authentication is supported. API Explorer can automatically generate sample SDK code and supports sample SDK code debugging.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
URI
- Format
- Parameter description
Table 1 URI parameters Parameter
Mandatory
Type
Description
project_id
Yes
String
Explanation
Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.
Constraints
N/A
Value range
The value must consist of 1 to 64 characters. Only letters and digits are allowed.
Default value
N/A
cluster_id
Yes
String
Explanation
Cluster ID. If this parameter is specified, the latest metadata of the cluster that has been patched will be obtained. For details about how to obtain the cluster ID, see Obtaining a Cluster ID.
Constraints
N/A
Value range
The value can contain 1 to 64 characters, including only letters, digits, underscores (_), and hyphens (-).
Default value
N/A
Request Parameters
None
Response Parameters
Status code: 202
Parameter | Type | Description |
|---|---|---|
total_record | Integer | Explanation Total number of records. Constraints N/A Value range N/A Default value N/A |
job_list | Array of JobQueryBean objects | Explanation The job list. For details about the parameters, see Table 4. Constraints N/A Value range N/A Default value N/A |
Status code: 400
Parameter | Type | Description |
|---|---|---|
error_code | String | Explanation Error code. Constraints N/A Value range 400: The operation failed. Default value N/A |
error_msg | String | Explanation Error message. Constraints N/A Value range 400: The operation failed. Default value N/A |
Example Response
Status code: 202
Querying a list of jobs is successful.
{
"total_record" : 2,
"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, s3a://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,\nyarn-cluster,\ns3a://obs-test/hadoop-mapreduce-examples-3.1.1.jar]",
"launcher_id" : "application_1564622673393_0611",
"properties" : { }
} ]
} Status code: 400
Failed to query a list of jobs.
{
"error_msg": "Failed to query the job list."
"error_code" : "0166"
} 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
