Queries the progress details of tasks generated through API operations, such as creating a cluster.
Operation description
You can view tasks generated by directly calling an API operation such as CreateDBCluster, or tasks generated when the system calls the corresponding API operation while you use a feature in the PolarDB console, such as creating a cluster.
Currently, you can view only the progress details of tasks generated when creating a cluster, that is, when the CreateDBCluster operation is called and 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
You must specify either |
pc-*************** |
| DBNodeId |
string |
No |
The node ID. Note
You must specify either |
pi-*************** |
| StartTime |
string |
Yes |
The start time of the query. Specify the time in the |
2020-11-30T00:00Z |
| EndTime |
string |
Yes |
The end time of the 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 per page. Valid values: 30, 50, and 100. Default value: 30. |
30 |
| PageNumber |
integer |
No |
The page number. The value must be a positive integer that 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 records. |
1 |
| PageRecordCount |
integer |
The number of records 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 task substeps. |
[{\"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 task progress percentage. |
100 |
| ExpectedFinishTime |
string |
The expected end time. This parameter is empty if no special circumstances exist. |
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 the task fails. Note
This parameter is returned only when the task status is Stop. |
null |
| ProgressInfo |
string |
The description of the task progress. This parameter is empty if the target task has no progress description. |
null |
| CurrentStepName |
string |
The name of the current substep of the task. |
create_instance |
| StepProgressInfo |
string |
The substep progress of the task. For example, |
1/4 |
| TaskErrorMessage |
string |
The error message returned when the task fails. Note
This parameter is returned only when the task status is Stop. |
null |
| TaskAction |
string |
The API operation used by the target task, such as |
CreateDBInstance |
| DBName |
string |
The database name. Note
This parameter is returned only for tasks that involve database-related operations. |
test |
| Remain |
integer |
The estimated remaining time of the task. Unit: seconds. |
1767 |
| TaskId |
string |
The ID of the target task. |
111111111 |
| EndTime |
string |
The end time of the query. The time is in the ISO 8601 standard in the UTC time zone (format: YYYY-MM-DDTHH:mmZ). |
2020-12-02T03:00Z |
| RequestId |
string |
The request ID. |
4352AD99-9FF5-41A6-A319-068089****** |
| PageNumber |
integer |
The page number. |
1 |
| StartTime |
string |
The start time of the query. The time is in the ISO 8601 standard in the UTC time zone (format: YYYY-MM-DDTHH:mmZ). |
2020-11-30T00:00Z |
| DBClusterId |
string |
The cluster ID associated with the task. |
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.