Querying Job Statuses
Function
This API is used to query the execution status of a job.
Ater an asynchronous API is called, for example an API for creating BMSs or attaching or detaching disks, job_id will be returned. You can use job_id to query the job status.
Debugging
You can debug this API in API Explorer.
URI
GET /v1/{project_id}/jobs/{job_id}
Table 1 lists the parameters.
| Parameter | Mandatory | Description |
|---|---|---|
| project_id | Yes | Specifies the project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
| job_id | Yes | Specifies the job ID. |
Request Parameters
None
Example Request
1 | GET https://{BMS Endpoint}/v1/bbf1946d374b44a0a2a95533562ba954/jobs/2c9eb2c5544cbf6101544f0635672b60 |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| status | String | Specifies the job status.
|
| entities | Object | Specifies the job object. For details, see Table 2. The displayed information varies depending on what jobs are executed. |
| job_id | String | Specifies the job ID. |
| job_type | String | Specifies the job. The value can be:
|
| begin_time | String | Specifies the time when the job started. The timestamp format is ISO 8601, for example, 2019-04-25T20:04:47.591Z. |
| end_time | String | Specifies the time when the job ended. The timestamp format is ISO 8601, for example, 2019-04-26T20:04:47.591Z. |
| error_code | String | Specifies the error code returned upon a job execution failure. |
| fail_reason | String | Specifies the cause of a job execution failure. |
| message | String | Specifies the message returned when an error occurs. |
| code | String | Specifies the error code returned when an error occurs. For details about error codes, see section Status Codes. |
| Parameter | Type | Description |
|---|---|---|
| server_id | String | If the job is a BMS-related operation, server_id is displayed. |
| nic_id | String | If the job is a NIC-related operation, nic_id is displayed. |
| sub_jobs_total | Integer | Specifies the number of sub-jobs. If the job has no sub-jobs, the value of this parameter is 0. |
| sub_jobs | Array of objects | Specifies the execution information about a sub-job. If the job has no sub-jobs, the value of this parameter is left blank. For details, see Table 3. |
| Parameter | Type | Description |
|---|---|---|
| status | String | Specifies the job status.
|
| entities | Object | Specifies the job object. The displayed information varies depending on what jobs are executed. For details, see Table 4. |
| job_id | String | Specifies the job ID. |
| job_type | String | Specifies the job type. The value can be:
|
| begin_time | String | Specifies the time when the job started. The timestamp format is ISO 8601, for example, 2019-04-25T20:04:47.591Z. |
| end_time | String | Specifies the time when the job ended. The timestamp format is ISO 8601, for example, 2019-04-26T20:04:47.591Z. |
| error_code | String | Specifies the error code returned upon a job execution failure. |
| fail_reason | String | Specifies the cause of a job execution failure. |
| message | String | Specifies the message returned when an error occurs. |
| code | String | Specifies the error code returned when an error occurs. For details about error codes, see section Status Codes. |
Example Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | { "status": "SUCCESS", "entities": { "sub_jobs_total": 1, "sub_jobs": [ { "status": "SUCCESS", "entities": { "server_id": "bae51750-0089-41a1-9b18-5c777978ff6d" }, "job_id": "2c9eb2c5544cbf6101544f0635672b60", "job_type": "baremetalSingleCreate", "begin_time": "2019-04-25T20:04:47.591Z", "end_time": "2019-04-25T20:08:21.328Z", "error_code": null, "fail_reason": null } ] }, "job_id": "2c9eb2c5544cbf6101544f0602af2b4f", "job_type": "baremetalBatchCreate", "begin_time": "2019-04-25T20:04:34.604Z", "end_time": "2019-04-25T20:08:41.593Z", "error_code": null, "fail_reason": null } |
Returned Values
| Returned Values | Description |
|---|---|
| 200 | The request has been successfully processed. |
For details about other returned values, see Status Codes.
Error Codes
See Error Codes.
What is your overall rating for this page?
Thank 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