Querying Scheduled Tasks
Function
This API is used to query the scheduled tasks in the task center. Before calling this API:
- Learn how to authenticate this API.
- Obtain the required region and endpoint.
Constraints
The scheduled tasks of the last month can be queried at most.
URI
GET /v3/{project_id}/instances/schedule-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 |
instance_id |
No |
String |
Definition Instance ID, which uniquely identifies an instance. Constraints N/A Range The value can contain 36 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 HOTFIX_VERSION_UPGRADE: indicates a hot patch update. Default Value N/A |
start_time |
No |
String |
Definition Start time. The value is 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. Constraints N/A Range N/A Default Value N/A |
end_time |
No |
String |
Definition End time. The value is 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. 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 |
---|---|---|
task_id |
String |
Definition Job ID. Range N/A |
task_name |
String |
Definition Task name. Range N/A |
status |
String |
Definition Task status. Range N/A |
create_time |
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. Range N/A |
start_time |
String |
Definition Time when a task starts to be executed. The format is yyyy-mm-ddThh:mm:ssZ. T is the separator between calendar and hourly notation of time. Z indicates the time zone offset. Range N/A |
instance_id |
String |
Definition Instance ID. Range N/A |
instance_name |
String |
Definition Instance name. Range N/A |
task_content |
Object |
Definition Task information. Range N/A |
Example Request
GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/opengauss/v3/0611f1bd8b00d5d32f17c017f15b599f/instances/schedule-tasks?status=Completed&offset=1&limit=10
Example Response
Tasks queried.
{ "tasks": [ { "status": "Completed", "task_id": "dea835aa-5ceb-4209-be57-ecd7992ed6af", "task_name": "HOTFIX_VERSION_UPGRADE", "create_time": "2024-12-16T06:54:39Z", "start_time": "2024-12-16T06:55:32Z", "instance_id": "54bef6617fab4a88ab52967218c34527in14", "instance_name": "gauss-ba81", "task_content": "3.208.0.6" }, { "status": "Completed", "task_id": "8d93aa3a-20c2-4c53-a3cf-933bde3ba002", "task_name": "HOTFIX_VERSION_UPGRADE", "create_time": "2024-12-16T06:54:39Z", "start_time": "2024-12-16T06:55:32Z", "instance_id": "096d0720b5604eca93b8a216a15d4778in14", "instance_name": "gauss-5185", "task_content": "3.208.0.6" }, { "status": "Completed", "task_id": "5111a1e3-0030-4766-8dd8-7ab73a2e89c4", "task_name": "HOTFIX_VERSION_UPGRADE", "create_time": "2024-12-16T08:51:11Z", "start_time": "2024-12-16T08:53:01Z", "instance_id": "b6ac63d384854e76ba7afd0e10aa9c29in14", "instance_name": "gauss-7fa8", "task_content": "3.208.0.7" } ], "total_count": 3 }
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