Obtaining Task Information
Function
This API is used to obtain information about a task with a specified ID. Before calling this API:
- Learn how to authenticate this API.
URI
GET https://{Endpoint}/v3/{project_id}/jobs?id={id}
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| project_id | String | Yes | Explanation: Project ID of a tenant in a region. To obtain the value, see Obtaining a Project ID. Restrictions: None Value range: The value can contain 32 characters. Only letters and digits are allowed. Default value: None |
| id | String | Yes | Explanation: Task ID. This parameter value indicates the asynchronous task ID returned by APIs (except APIs for applying a parameter template and creating a manual backup). Restrictions: None Value range: UUID format Default value: None |
Request Parameters
None
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| job | Object | Explanation: Task information. For details, see Table 3. |
| Parameter | Type | Description |
|---|---|---|
| id | String | Explanation: Task ID. Value range: UUID format |
| name | String | Explanation: Task name. Value range: None |
| status | String | Explanation: Task execution status Value range:
|
| created | String | Explanation: Creation time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between calendar and hourly notation of time. Z indicates the time zone offset. Example: 2021-07-12T09:22:04+0800. Value range: None |
| ended | String | Explanation: End time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between calendar and hourly notation of time. Z indicates the time zone offset. Example: 2021-07-12T09:22:04+0800. Value range: None |
| progress | String | Explanation: Task execution progress. The execution progress (such as "60%", indicating the task execution progress is 60%) is displayed only when the task is being executed. Otherwise, "" is returned. Value range: None |
| instance | Object | Explanation: Instance on which the task is executed. For details, see Table 4. |
| fail_reason | String | Explanation: Task failure information. Value range: None |
| Parameter | Type | Description |
|---|---|---|
| id | String | Explanation: Instance ID, which is the unique identifier of an instance. Value range: The value can contain 32 characters. Only letters and digits are allowed. |
| name | String | Explanation: DB instance name. Value range: The value must start with a letter and can contain 4 to 64 characters. Only letters, digits, hyphens (-), and underscores (_) are allowed. |
Example Request
Obtaining information about a task with a specified ID
GET https://gaussdb-opengauss.eu-west-101.myhuaweicloud.eu/v3/0549b4a43100d4f32f51c01c2fe4acdb/jobs?id=5cbb8a90-2253-4cff-8a13-49aa8f31dfb5
Example Response
Information queried.
{
"job" : {
"id" : "5cbb8a90-2253-4cff-8a13-49aa8f31dfb5",
"name" : "CreateGaussDBV5Instance",
"status" : "Completed",
"created" : "2021-07-12T09:22:04+0800",
"ended" : "2021-07-12T10:10:13+0800",
"progress" : "",
"instance" : {
"id" : "b34f8c791f2643578510c093aa2351a8in14",
"name" : "gauss-c1a3"
},
"fail_reason" : null
}
} Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Codes
For details, see Error Codes.