All Products
Search
Document Center

PolarDB:DescribeTasks

Last Updated:Sep 24, 2026

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

You must specify either DBNodeId or DBClusterId. You can call the DescribeDBClusters operation to query the details of all clusters under your account, including cluster IDs.

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

DBNodeId

string

No

The node ID.

Note

You must specify either DBNodeId or DBClusterId. You can call the DescribeDBClusters operation to query the details of all clusters under your account, including node IDs.

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

StartTime

string

Yes

The start time of the query. Specify the time in the YYYY-MM-DDThh:mmZ format (UTC).

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 YYYY-MM-DDThh:mmZ format (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 being executed.

  • Finished: The task is completed.

  • Closed: The task is closed.

  • Pause: The task is paused.

  • Stop: The task is interrupted.

Note
  • If this parameter is left empty, only the details of tasks in the Waiting or Running state for the current cluster or node are returned.

  • You can specify multiple task statuses separated by commas.

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 YYYY-MM-DDThh:mm:ssZ format (UTC).

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 YYYY-MM-DDThh:mm:ssZ format (UTC).

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 indicates that the task contains four substeps and the first substep is being executed.

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.

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.