All Products
Search
Document Center

PolarDB:DescribeTasks

Last Updated:Dec 12, 2025

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 CreationOption parameter is not set to CreateGdnStandby.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

polardb:DescribeTasks

get

*dbcluster

acs:polardb:{#regionId}:{#accountId}:dbcluster/{#dbclusterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBClusterId

string

No

The cluster ID.

Note

Specify either DBNodeId or DBClusterId. Call the DescribeDBClusters operation to query the details of all clusters in your account, including cluster IDs.

pc-***************

DBNodeId

string

No

The node ID.

Note

Specify either DBNodeId or DBClusterId. Call the DescribeDBClusters operation to query the details of all clusters in your account, including node IDs.

pi-***************

StartTime

string

Yes

The beginning of the time range to query. Specify the time in the YYYY-MM-DDThh:mmZ format. The time must be in UTC.

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 YYYY-MM-DDThh:mmZ format. The time must be in UTC.

2020-12-02T03:00Z

Status

string

No

The task status. Valid values:

  • Waiting: The task is waiting to be executed.

  • Running: The task is running.

  • Finished: The task is complete.

  • Closed: The task is closed.

  • Pause: The task is paused.

  • Stop: The task is interrupted.

Note
  • If you leave this parameter empty, the details of all tasks in the Waiting or Running state for the current cluster or node are returned.

  • To query tasks in multiple states, separate the state names with a comma (,).

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 YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

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 YYYY-MM-DDThh:mm:ssZ format. The time is displayed in UTC.

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 indicates that the task consists of four subtasks and the first subtask is in progress.

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.

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.