Queries further details of the tasks that are generated based on API operations. For example, you can call this operation to view the details of the task when you create a cluster.
- You can call this operation to view the details of a task that is generated by a specific API operation or in the console. The system calls the specific API operation when you perform an operation in the console. For example, you can view the details of the task when you call the CreateDBCluster operation or create a cluster in the console.
- You can view the details of tasks that are generated only when you call the CreateDBCluster operation to create a cluster and
CreationOption
is not set toCreateGdnStandby
.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeTasks |
The operation that you want to perform. Set the value to DescribeTasks. |
DBClusterId | String | No | pc-*************** |
The ID of the cluster. Note You must specify
DBNodeId or DBClusterId . You can call the DescribeDBClusters operation to query the details of the clusters that belong to your Alibaba Cloud
account, such as cluster IDs.
|
DBNodeId | String | No | pi-*************** |
The ID of the node. Note You must specify
DBNodeId or DBClusterId . You can call the DescribeDBClusters operation to query the details of the clusters that belong to your Alibaba Cloud
account, such as cluster IDs.
|
StartTime | String | Yes | 2020-11-30T00:00Z |
The beginning of the time range to query. Specify the time in the |
EndTime | String | Yes | 2020-12-02T03:00Z |
The end of the time range to query. Specify the time in the |
Status | String | No | Running |
The state of the tasks that you want to query. Valid values:
Note
|
PageSize | Integer | No | 30 |
The number of entries to return on each page. Valid values: 30, 50, or 100. Default value: 30. |
PageNumber | Integer | No | 1 |
The number of the page to return. The value must be an integer that is greater than 0. Default value: 1. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
TotalRecordCount | Integer | 1 |
The total number of entries. |
PageRecordCount | Integer | 30 |
The number of entries returned per page. |
Tasks | Array of Task |
Details about the tasks. |
|
Task | |||
FinishTime | String | 2020-12-02T02:40:15Z |
The time when the task was completed. The time is in the |
StepsInfo | String | [{\"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}] |
Details about the subtasks. |
Progress | Integer | 100 |
The progress of the task in percentage. |
ExpectedFinishTime | String | null |
The estimated end time. In most cases, this parameter is empty. |
BeginTime | String | 2020-12-02T02:39:15Z |
The time when the task was started. The time is in the |
TaskErrorCode | String | null |
The error code that is returned when an error occurs. Note This parameter is returned only when the task is in the Stop state.
|
ProgressInfo | String | null |
The description about the task progress. If no progress description is provided for the task, this parameter is empty. |
CurrentStepName | String | create_instance |
The name of the current step. |
StepProgressInfo | String | 1/4 |
The progress of the subtasks. For example, a value of |
TaskErrorMessage | String | null |
The error message that is returned when an error occurs. Note This parameter is returned only when the task is in the Stop state.
|
TaskAction | String | CreateDBInstance |
The API operation that is used by the task, such as |
DBName | String | test |
The name of the database whose tables you want to query. Note This parameter is returned for only the tasks that involve database operations.
|
Remain | Integer | 1767 |
The estimated remaining duration of the task. Unit: seconds. |
TaskId | String | 111111111 |
The ID of the task. |
EndTime | String | 2020-12-02T03:00Z |
The end of the time range. |
RequestId | String | 4352AD99-9FF5-41A6-A319-068089****** |
The ID of the request. |
PageNumber | Integer | 1 |
The page number of the returned page. |
StartTime | String | 2020-11-30T00:00Z |
The beginning of the time range. |
DBClusterId | String | pc-*************** |
The ID of the cluster for which the task was created. |
Examples
Sample requests
http(s)://polardb.aliyuncs.com/?Action=DescribeTasks
&EndTime=2020-11-30T00:00Z
&StartTime=2020-12-01T10:00Z
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeTasksResponse>
<TotalRecordCount>1</TotalRecordCount>
<PageRecordCount>30</PageRecordCount>
<Tasks>
<Task>
<StepProgressInfo>1/4</StepProgressInfo>
<Progress>25</Progress>
<TaskId>111111111</TaskId>
<Remain>1767</Remain>
<FinishTime>2020-12-02T02:40:15Z</FinishTime>
<TaskAction>CreateDBInstance</TaskAction>
<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}]</StepsInfo>
<CurrentStepName>create_instance</CurrentStepName>
<BeginTime>2020-12-02T02:39:15Z</BeginTime>
</Task>
</Tasks>
<RequestId>45CE02A1-1766-42E3-9E5F-24B576******</RequestId>
<EndTime>2020-12-02T03:00Z</EndTime>
<PageNumber>1</PageNumber>
<StartTime>2020-11-30T00:00Z</StartTime>
<DBClusterId>pc-*****************</DBClusterId>
</DescribeTasksResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"TotalRecordCount" : 1,
"PageRecordCount" : 30,
"Tasks" : {
"Task" : [ {
"StepProgressInfo" : "1/4",
"Progress" : 25,
"TaskId" : "111111111",
"Remain" : 1767,
"FinishTime" : "2020-12-02T02:40:15Z",
"TaskAction" : "CreateDBInstance",
"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}]",
"CurrentStepName" : "create_instance",
"BeginTime" : "2020-12-02T02:39:15Z"
} ]
},
"RequestId" : "45CE02A1-1766-42E3-9E5F-24B576******",
"EndTime" : "2020-12-02T03:00Z",
"PageNumber" : 1,
"StartTime" : "2020-11-30T00:00Z",
"DBClusterId" : "pc-*****************"
}
Error code
For a list of error codes, visit the API Error Center.