Queries the progress details of tasks generated by API calls, such as creating a cluster.
Operation description
You can view the progress details of tasks generated by either direct API calls, such as CreateDBCluster, or operations in the PolarDB console, such as creating a cluster.
Currently, this operation supports viewing the progress details only for tasks generated when you create a cluster by calling the CreateDBCluster operation, provided that the
CreationOptionparameter is not set toCreateGdnStandby.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
polardb:DescribeTasks |
get |
*dbcluster
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DBClusterId |
string |
No |
The cluster ID. Note
Specify either |
pc-*************** |
| DBNodeId |
string |
No |
The node ID. Note
Specify either |
pi-*************** |
| StartTime |
string |
Yes |
The beginning of the time range to query. Specify the time in the |
2020-11-30T00:00Z |
| EndTime |
string |
Yes |
The end of the time range to query. The end time must be later than the start time. Specify the time in the |
2020-12-02T03:00Z |
| Status |
string |
No |
The task status. Valid values:
Note
|
Running |
| PageSize |
integer |
No |
The number of entries to return on each page. Valid values: 30, 50, and 100. Default value: 30. |
30 |
| PageNumber |
integer |
No |
The page number. The value must be an integer that is greater than 0 and does not exceed the maximum value of the Integer data type. Default value: 1. |
1 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| TotalRecordCount |
integer |
The total number of entries returned. |
1 |
| PageRecordCount |
integer |
The number of entries returned on the current page. |
30 |
| Tasks |
object |
||
| Task |
array<object> |
The task details. |
|
|
object |
|||
| FinishTime |
string |
The time when the task was completed. The time is in the |
2020-12-02T02:40:15Z |
| StepsInfo |
string |
The details of the subtasks. |
[{\"remain\":0,\"name\":\"init_task\",\"progress\":100},{\"remain\":1764,\"name\":\"create_instance\",\"progress\":0},{\"remain\":1,\"name\":\"init_cluster\",\"progress\":0},{\"remain\":2,\"name\":\"create_backup\",\"progress\":0}] |
| Progress |
integer |
The progress of the task in percentage. |
100 |
| ExpectedFinishTime |
string |
The estimated end time of the task. This parameter is empty under normal circumstances. |
null |
| BeginTime |
string |
The time when the task started. The time is in the |
2020-12-02T02:39:15Z |
| TaskErrorCode |
string |
The error code returned when an error occurs. Note
This parameter is returned only when the task status is Stop. |
null |
| ProgressInfo |
string |
The description of the task progress. If the task has no progress description, this parameter is empty. |
null |
| CurrentStepName |
string |
The name of the current subtask. |
create_instance |
| StepProgressInfo |
string |
The progress of the subtask. For example, |
1/4 |
| TaskErrorMessage |
string |
The error message returned when an error occurs. Note
This parameter is returned only when the task status is Stop. |
null |
| TaskAction |
string |
The API operation used for the task, such as |
CreateDBInstance |
| DBName |
string |
The database name. Note
This parameter is returned only for tasks related to database operations. |
test |
| Remain |
integer |
The estimated remaining time of the task. Unit: seconds. |
1767 |
| TaskId |
string |
The task ID. |
111111111 |
| EndTime |
string |
The end of the time range to query. |
2020-12-02T03:00Z |
| RequestId |
string |
The request ID. |
4352AD99-9FF5-41A6-A319-068089****** |
| PageNumber |
integer |
The page number. |
1 |
| StartTime |
string |
The beginning of the time range to query. |
2020-11-30T00:00Z |
| DBClusterId |
string |
The ID of the cluster to which the task belongs. |
pc-*************** |
Examples
Success response
JSON format
{
"TotalRecordCount": 1,
"PageRecordCount": 30,
"Tasks": {
"Task": [
{
"FinishTime": "2020-12-02T02:40:15Z",
"StepsInfo": "[{\\\"remain\\\":0,\\\"name\\\":\\\"init_task\\\",\\\"progress\\\":100},{\\\"remain\\\":1764,\\\"name\\\":\\\"create_instance\\\",\\\"progress\\\":0},{\\\"remain\\\":1,\\\"name\\\":\\\"init_cluster\\\",\\\"progress\\\":0},{\\\"remain\\\":2,\\\"name\\\":\\\"create_backup\\\",\\\"progress\\\":0}]",
"Progress": 100,
"ExpectedFinishTime": "null",
"BeginTime": "2020-12-02T02:39:15Z",
"TaskErrorCode": "null",
"ProgressInfo": "null",
"CurrentStepName": "create_instance",
"StepProgressInfo": "1/4",
"TaskErrorMessage": "null",
"TaskAction": "CreateDBInstance",
"DBName": "test",
"Remain": 1767,
"TaskId": "111111111"
}
]
},
"EndTime": "2020-12-02T03:00Z",
"RequestId": "4352AD99-9FF5-41A6-A319-068089******",
"PageNumber": 1,
"StartTime": "2020-11-30T00:00Z",
"DBClusterId": "pc-***************"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidDBNodeId.Malformed | The specified parameter DBNodeId is not valid. | The specified DBNodeId parameter is invalid. |
| 400 | InvalidStartTime.Malformed | The specified parameter StartTime is not valid. | The specified StartTime parameter is invalid. |
| 400 | InvalidEndTime.Malformed | The specified parameter EndTime is not valid. | The specified EndTime parameter is invalid. |
| 400 | InvalidPageSize.Malformed | The specified parameter PageSize is not valid. | The specified PageSize parameter is invalid. |
| 400 | InvalidPageNumber.Malformed | The specified parameter PageNumber is not valid. | The specified PageNumber parameter is invalid. |
| 400 | InvalidStatus.Malformed | The specified parameter Status is not valid. | The specified Status parameter is invalid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.