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

ParameterTypeRequiredExampleDescription
ActionStringNoDescribeTasks

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

DBInstanceIdStringYespxc-hzjasd****

The name of the instance.

StartTimeStringYes2021-11-01

The beginning of the time range to query.

EndTimeStringYes2021-11-04

The end of the time range to query.

PageSizeIntegerNo20

The number of entries to return on each page, the value range of the PageSize parameter is 5 to 1000.

PageNumberIntegerNo30

The number of the page to return.

RegionIdStringYescn-hangzhou

The region ID of the instance.

Response parameters

ParameterTypeExampleDescription
RequestIdStringD6045D78-C119-5A17-9DEA-0F810394E008

The ID of the request.

PageNumberInteger1

The page number of the returned page.

PageRecordCountInteger30

The number of entries returned per page.

TotalRecordCountInteger2

The total number of returned entries.

ItemsArray of TaskProgressInfo
StatusStringRUNNING

The state of the task. Valid values:

  • RUNNING: The task is running.
  • FAILED: The task failed.
FinishTimeString2021-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.

ProgressString80

The progress of the task in percentage.

BeginTimeString2021-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.

TaskErrorCodeString400

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

DBNameStringDBName

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

ProgressInfoStringProgressInfo

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

ScaleOutTokenStringFEA5DC20-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.

TaskIdString20089398

The ID of the task.

TaskErrorMessageStringxxxxxxxx

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

TaskActionStringmulti_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=20
&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>400</TaskErrorCode>
        <DBName>DBName</DBName>
        <ProgressInfo>ProgressInfo</ProgressInfo>
        <ScaleOutToken>FEA5DC20-6D8A-5979-97AA-FC57546ADC20</ScaleOutToken>
        <TaskId>20089398</TaskId>
        <TaskErrorMessage>xxxxxxxx</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" : "400",
    "DBName" : "DBName",
    "ProgressInfo" : "ProgressInfo",
    "ScaleOutToken" : "FEA5DC20-6D8A-5979-97AA-FC57546ADC20",
    "TaskId" : "20089398",
    "TaskErrorMessage" : "xxxxxxxx",
    "TaskAction" : "multi_scale_out"
  } ]
}

Error codes

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