Queries the tasks that are performed on a PolarDB-X instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No DescribeTasks

The operation that you want to perform. Set the value to DescribeTasks.

DBInstanceId String Yes pxc-hzjasd****

The name of the instance.

StartTime String No 2021-11-01

The beginning of the time range to query.

EndTime String No 2021-11-04

The end of the time range to query.

PageSize Integer No 1

The number of the page to return.

PageNumber Integer No 30

The number of entries to return on each page.

RegionId String Yes cn-hangzhou

The region ID of the instance.

Response parameters

Parameter Type Example Description
RequestId String D6045D78-C119-5A17-9DEA-0F810394E008

The ID of the request.

PageNumber Integer 1

The page number of the returned page.

PageRecordCount Integer 30

The number of entries returned per page.

TotalRecordCount Integer 2

The total number of returned entries.

Items Array of TaskProgressInfo
Status String RUNNING

The state of the task. Valid values:

  • RUNNING: The task is running.
  • FAILED: The task failed.
FinishTime String 2021-10-20T20:00:00Z

The end time of the task. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format.

Progress String 80

The progress of the task in percentage.

BeginTime String 2021-10-20T19:40:00Z

The start time of the task. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mm:ssZ format.

TaskErrorCode String TaskErrorCode

The error code. This parameter is returned only for failed tasks.

DBName String DBName

The name of the database that is associated with the task. In most cases, an empty string is returned for this parameter.

ProgressInfo String ProgressInfo

The details about the task progress. In most cases, an empty string is returned for this parameter.

ScaleOutToken String FEA5DC20-6D8A-5979-97AA-FC57546ADC20

The token of the task. The token uniquely identifies the task in the backend. This parameter is returned only for scale-out tasks.

TaskId String 20089398

The ID of the task.

TaskErrorMessage String TaskErrorMessage

The error message. This parameter is returned only for failed tasks.

TaskAction String multi_scale_out

The unique identifier of the task type in the backend.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeTasks
&DBInstanceId=pxc-hzjasd****
&StartTime=2021-11-01
&EndTime=2021-11-04
&PageSize=1
&PageNumber=30
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DescribeTasksResponse>
    <RequestId>D6045D78-C119-5A17-9DEA-0F810394E008</RequestId>
    <PageNumber>1</PageNumber>
    <PageRecordCount>30</PageRecordCount>
    <TotalRecordCount>2</TotalRecordCount>
    <Items>
        <Status>RUNNING</Status>
        <FinishTime>2021-10-20T20:00:00Z</FinishTime>
        <Progress>80</Progress>
        <BeginTime>2021-10-20T19:40:00Z</BeginTime>
        <TaskErrorCode>TaskErrorCode</TaskErrorCode>
        <DBName>DBName</DBName>
        <ProgressInfo>ProgressInfo</ProgressInfo>
        <ScaleOutToken>FEA5DC20-6D8A-5979-97AA-FC57546ADC20</ScaleOutToken>
        <TaskId>20089398</TaskId>
        <TaskErrorMessage>TaskErrorMessage</TaskErrorMessage>
        <TaskAction>multi_scale_out</TaskAction>
    </Items>
</DescribeTasksResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "D6045D78-C119-5A17-9DEA-0F810394E008",
  "PageNumber" : 1,
  "PageRecordCount" : 30,
  "TotalRecordCount" : 2,
  "Items" : [ {
    "Status" : "RUNNING",
    "FinishTime" : "2021-10-20T20:00:00Z",
    "Progress" : "80",
    "BeginTime" : "2021-10-20T19:40:00Z",
    "TaskErrorCode" : "TaskErrorCode",
    "DBName" : "DBName",
    "ProgressInfo" : "ProgressInfo",
    "ScaleOutToken" : "FEA5DC20-6D8A-5979-97AA-FC57546ADC20",
    "TaskId" : "20089398",
    "TaskErrorMessage" : "TaskErrorMessage",
    "TaskAction" : "multi_scale_out"
  } ]
}

Error codes

For a list of error codes, visit the API Error Center.