All Products
Search
Document Center

PolarDB:DescribeHistoryTasks

Last Updated:Sep 24, 2026

Queries the historical task list for PolarDB for MySQL.

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

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID.

Note

You can call the DescribeRegions operation to query region information.

cn-beijing

PageSize

integer

No

The number of entries per page. Valid values: 10 to 100. Default value: 10.

10

PageNumber

integer

No

The page number of the query results. Valid values: positive integers. Default value: 1.

1

InstanceType

string

No

Currently, only Instance is supported.

Instance

Status

string

No

The task status. Valid values:

  • Scheduled: Waiting for execution.

  • Running: Running.

  • Succeed: Succeeded.

  • Cancelling: Being canceled.

  • Canceled: Canceled.

  • Waiting: Waiting for the scheduled time.

Separate multiple statuses with commas (,). Default value: empty, which indicates all statuses.

Running

InstanceId

string

No

The resource ID. Specify this parameter to query tasks for the corresponding resource. Separate multiple IDs with commas (,). A maximum of 30 IDs are supported. Default value: empty, which indicates no restriction.

Note

Currently, only cluster IDs are supported.

pc-2zed3m89cw***

TaskId

string

No

The task ID. Separate multiple task IDs with commas (,). A maximum of 30 IDs are supported. Default value: empty, which indicates no restriction.

t-0mqi38ho0cgjv***

TaskType

string

No

The task type. Specify this parameter to query tasks of a specific type. Separate multiple types with commas (,). A maximum of 30 types are supported. Default value: empty, which indicates no restriction.

ChangeVariable

FromStartTime

string

Yes

The beginning of the time range for the task start time. Tasks whose start time is later than this time are queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC+0. The earliest supported time is 30 days before the current time. A value earlier than 30 days is automatically converted to 30 days before the current time.

2025-01-02T11:31:03Z

ToStartTime

string

Yes

The end of the time range for the task start time. Tasks whose start time is earlier than this time are queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC+0.

2025-01-03T11:31:03Z

FromExecTime

integer

No

The minimum execution duration. Filters tasks whose execution duration is greater than this value. Unit: seconds. Default value: 0, which indicates no restriction.

0

ToExecTime

integer

No

The maximum execution duration. Filters tasks whose execution duration is not less than this value. Unit: seconds. Default value: 0, which indicates no restriction.

0

ResourceGroupId

string

No

The resource group ID.

rg-************

Response elements

Element

Type

Description

Example

object

The response parameters.

PageNumber

integer

The page number of the query results.

1

RequestId

string

The request ID.

F90D7C14-2D1C-5B88-9CD1-23AB2CF89***

PageSize

integer

The number of entries per page.

10

TotalCount

string

The total number of tasks that meet the filter conditions, regardless of pagination.

2

Items

array<object>

The task list.

object

The task object.

Status

string

The task status.

  • Scheduled: Waiting for execution.

  • Running: Running.

  • Succeed: Succeeded.

  • Failed: Failed.

  • Cancelling: Being canceled.

  • Canceled: Canceled.

  • Waiting: Waiting for the scheduled time.

Succeed

TaskId

string

The task ID.

t-0mqt8qhnw04ipz0***

CurrentStepName

string

The name of the current step being executed. An empty value indicates that the task has not started.

finish_task

StartTime

string

The task start time.

The time is in the ISO 8601 standard in the YYYY-MM-DDTHH:mm:ssZ format. The time is displayed in UTC.

2025-03-03T07:25:16Z

EndTime

string

The task end time.

The time is in the ISO 8601 standard in the YYYY-MM-DDTHH:mm:ssZ format. The time is displayed in UTC.

2025-03-03T07:30:57Z

TaskType

string

The task type.

ChangeVariable

RemainTime

integer

The estimated remaining execution duration. Unit: seconds.

Note

This value is for reference only. The actual execution duration may vary.

0

Progress

number

The current progress.

100.0

RegionId

string

The region ID.

cn-beijing

InstanceType

string

The resource type.

Instance

InstanceId

string

The resource ID.

pc-2zed3m89cw***

InstanceName

string

The resource name.

pc-2zed3m89cw***

DbType

string

The database type.

polardb_mysql

Product

string

The product.

polardb

TaskDetail

string

The task details.

{\"steps\":[{\"step_name\":\"init_task\"},{\"step_name\":\"exec_task\"},{\"step_name\":\"finish_task\"}]}

ReasonCode

string

The reason why the current task was initiated.

""

ActionInfo

string

The allowed operation information.

Note

This feature is not supported.

{}

Uid

string

The ID of the user to whom the resource belongs.

1816563541899***

CallerSource

string

The request source. Valid values:

  • System: system.

  • User: user.

User

CallerUid

string

The ID of the requesting user. When CallerSource is set to User, this value represents the user UID.

1816563541899***

Examples

Success response

JSON format

{
  "PageNumber": 1,
  "RequestId": "F90D7C14-2D1C-5B88-9CD1-23AB2CF89***",
  "PageSize": 10,
  "TotalCount": "2",
  "Items": [
    {
      "Status": "Succeed",
      "TaskId": "t-0mqt8qhnw04ipz0***",
      "CurrentStepName": "finish_task",
      "StartTime": "2025-03-03T07:25:16Z",
      "EndTime": "2025-03-03T07:30:57Z",
      "TaskType": "ChangeVariable",
      "RemainTime": 0,
      "Progress": 100,
      "RegionId": "cn-beijing",
      "InstanceType": "Instance",
      "InstanceId": "pc-2zed3m89cw***",
      "InstanceName": "pc-2zed3m89cw***",
      "DbType": "polardb_mysql",
      "Product": "polardb",
      "TaskDetail": "{\\\"steps\\\":[{\\\"step_name\\\":\\\"init_task\\\"},{\\\"step_name\\\":\\\"exec_task\\\"},{\\\"step_name\\\":\\\"finish_task\\\"}]}",
      "ReasonCode": "\"\"",
      "ActionInfo": "{}",
      "Uid": "1816563541899***",
      "CallerSource": "User",
      "CallerUid": "1816563541899***"
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 Param.Invalid The parameter is invalid. The parameter is invalid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.