Querying a Job
Function
This API is used to obtain information about a job via the job ID returned after a query request is delivered.
Calling Method
For details, see Calling APIs.
URI
GET /api/v3/projects/{project_id}/jobs/{job_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Details: Project ID. For details about how to obtain the value, see How to Obtain Parameters in the API URI. Constraints: None Options: Project IDs of the account Default value: N/A |
| job_id | Yes | String | Definition Job ID. For details about how to obtain the value, see How to Obtain Parameters in the API URI. Constraints N/A Range N/A Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Definition Type (or format) of the request body. The default value is application/json. Other values of this field will be provided for specific APIs, if any. Constraints GET requests are not validated. Default Value N/A |
| X-Auth-Token | Yes | String | Details: Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. For details, see Obtaining a User Token. Constraints: None Options: N/A Default value: N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| kind | String | Definition API type Constraints The value cannot be changed. Range N/A Default Value Job |
| apiVersion | String | Definition API version Constraints The value cannot be changed. Range N/A Default Value v3 |
| metadata | JobMetadata object | Definition Job metadata Constraints N/A |
| spec | JobSpec object | Definition Detailed job parameters Constraints N/A |
| status | JobStatus object | Definition Job status Constraints N/A |
| Parameter | Type | Description |
|---|---|---|
| type | String | Definition Job type Constraints N/A Range N/A Default Value N/A |
| clusterUID | String | Definition ID of the cluster where the job runs Constraints N/A Range N/A Default Value N/A |
| resourceID | String | Definition ID of the resource on which the job is executed Constraints N/A Range N/A Default Value N/A |
| resourceName | String | Definition Name of the resource on which the job is executed Constraints N/A Range N/A Default Value N/A |
| extendParam | Map<String,String> | Definition Extended parameters Constraints N/A Range N/A Default Value N/A |
| subJobs | Array of Job objects | Definition Subjob list.
Constraints N/A |
| Parameter | Type | Description |
|---|---|---|
| kind | String | Definition API type Constraints The value cannot be changed. Range N/A Default Value Job |
| apiVersion | String | Definition API version Constraints The value cannot be changed. Range N/A Default Value v3 |
| metadata | JobMetadata object | Definition Job metadata Constraints N/A |
| spec | JobSpec object | Definition Detailed job parameters Constraints N/A |
| status | JobStatus object | Definition Job status Constraints N/A |
| Parameter | Type | Description |
|---|---|---|
| uid | String | Definition Job ID Constraints N/A Range N/A Default Value N/A |
| creationTimestamp | String | Definition Time when a job was created Constraints N/A Range N/A Default Value N/A |
| updateTimestamp | String | Definition Time when a job was updated Constraints N/A Range N/A Default Value N/A |
Example Requests
None
Example Responses
Status code: 200
The progress of the specified job is successfully obtained.
{
"kind" : "Job",
"apiVersion" : "v3",
"metadata" : {
"uid" : "354331b2c-229a-11e8-9c75-0255ac100ceb",
"creationTimestamp" : "2018-08-02 08:12:40.672772389 +0000 UTC",
"updateTimestamp" : "2018-08-02 08:21:50.478108569 +0000 UTC"
},
"spec" : {
"type" : "CreateCluster",
"clusterUID" : "4d1ecb2c-229a-11e8-9c75-0255ac100ceb",
"resourceID" : "6f4dcb2c-229a-11e8-9c75-0255ac100ceb",
"resourceName" : "cluster-name",
"extendParam" : {
"serverID" : "bc467e3a-2338-11e8-825b-0255ac100c13"
},
"subJobs" : [ {
"kind" : "Job",
"apiVersion" : "v3",
"metadata" : {
"uid" : "fd474fab-9606-11e8-baa9-0255ac10215d",
"creationTimestamp" : "2018-08-02 03:52:34.615819618 +0000 UTC",
"updateTimestamp" : "2018-08-02 04:05:29.196243031 +0000 UTC"
},
"spec" : {
"type" : "InstallMaster",
"clusterUID" : "fcc72de0-9606-11e8-baa8-0255ac10215d",
"resourceID" : "fd3b4ac0-9606-11e8-baa8-0255ac10215d",
"extendParam" : {
"serverID" : "fd3b4ac0-9606-11e8-baa8-0255ac10215d"
}
},
"status" : {
"phase" : "Success"
}
}, {
"kind" : "Job",
"apiVersion" : "v3",
"metadata" : {
"uid" : "fd474f82-9606-11e8-baa8-0255ac10215d",
"creationTimestamp" : "2018-08-02 03:52:33.859150791 +0000 UTC",
"updateTimestamp" : "2018-08-02 03:52:34.615655429 +0000 UTC"
},
"spec" : {
"type" : "CreatePSMCert",
"clusterUID" : "fcc72de0-9606-11e8-baa8-0255ac10215d"
},
"status" : {
"phase" : "Success"
}
} ]
},
"status" : {
"phase" : "Running",
"reason" : ""
}
} Status Codes
| Status Code | Description |
|---|---|
| 200 | The progress of the specified job is successfully obtained. |
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
