Querying Tasks
Function
This API is used to query the tasks in the task center. Before calling this API:
- Learn how to authenticate this API.
- Obtain the required region and endpoint.
Constraints
The tasks of the last month can be queried at most.
URI
GET /v3/{project_id}/tasks
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition Project ID of a tenant in a region. To obtain the value, see Obtaining a Project ID. Constraints N/A Range The value can contain 32 characters. Only letters and digits are allowed. Default Value N/A |
status |
No |
String |
Definition Task status. Constraints N/A Range
Default Value N/A |
name |
No |
String |
Definition Task name. Constraints N/A Range
Default Value N/A |
start_time |
No |
String |
Definition Start time. The value is a UNIX timestamp, in milliseconds. The time zone is UTC. Constraints N/A Range N/A Default Value N/A |
end_time |
No |
String |
Definition End time. The value is a UNIX timestamp, in milliseconds. The time zone is UTC. Constraints N/A Range N/A Default Value N/A |
offset |
No |
Integer |
Definition Index offset. Constraints N/A Range 0–2,147,483,647 Default Value 0: The query starts from the first data record. |
limit |
No |
Integer |
Definition Number of records returned by a query. Constraints N/A Range 1–100 Default Value 100 |
Request Parameters
None
Response Parameters
Parameter |
Type |
Description |
---|---|---|
tasks |
Array of objects |
Definition Task list. For details, see Table 3. |
total_count |
Integer |
Definition Number of tasks. Range N/A |
Parameter |
Type |
Description |
---|---|---|
instance_info |
Object |
Definition Information about the instance associated with the task. For details, see Table 4. |
job_id |
String |
Definition Job ID. Range N/A |
name |
String |
Definition Task name. Range N/A |
status |
String |
Definition Task status. Range N/A |
process |
String |
Definition Task progress, in percentage (%) Range N/A |
created_at |
String |
Definition 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. For example, in the Beijing time zone, the offset is +0800. Range N/A |
ended_at |
String |
Definition 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. For example, in the Beijing time zone, the offset is +0800. Range N/A |
fail_reason |
String |
Definition Failure cause. Range N/A |
Example Request
- Querying running tasks
GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/opengauss/v3/0611f1bd8b00d5d32f17c017f15b599f/tasks?status=Running&name=CreateGaussDBV5Instance&offset=1&limit=10
- Querying completed tasks
GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/opengauss/v3/0611f1bd8b00d5d32f17c017f15b599f/tasks?status=Completed&name=CreateGaussDBV5Instance&offset=1&limit=10
- Querying failed tasks
GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/opengauss/v3/0611f1bd8b00d5d32f17c017f15b599f/tasks?status=Failed&name=CreateGaussDBV5Instance&offset=1&limit=10
Example Response
Tasks queried.
{ "tasks" : [ { "instance_info" : { "instance_id" : "ce2dce50f365430abe161bab79495a6ein14", "instance_name" : "gauss-6568-zzh", "instance_status" : "creating" }, "job_id" : "03bc055a-135c-4245-8bd8-b0bc6d3350b3", "name" : "CreateGaussDBV5Instance", "status" : "Failed", "process" : "", "created_at": "2022-08-05T08:15:07+0800", "ended_at": "2022-08-09T03:06:52+0800", "fail_reason" : "500000" }, { "instance_info" : { "instance_id" : "20ba433bd7ee40da9cf35064f04f9e4cin14", "instance_name" : "gauss-7875-lt-m", "instance_status" : "deleted" }, "job_id" : "2cc16e0b-75ab-4a28-9453-16517e990bba", "name" : "DeleteGaussDBV5Instance", "status" : "Completed", "process" : "", "created_at": "2022-08-06T09:15:07+0800", "ended_at": "2022-08-10T03:06:52+0800", "fail_reason" : null } ], "total_count" : 2 }
Status Codes
- Normal
- Abnormal
For details, see Status Codes.
Error Codes
For details, 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