All Products
Search
Document Center

ApsaraDB for MongoDB:DescribeHistoryTasks

Last Updated:Jan 26, 2026

Queries a list of tasks in the task center.

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

dds:DescribeHistoryTasks

list

*Instance

acs:dds:{#regionId}:{#accountId}:dbinstance/{#InstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

No

The region ID of the pending event. You can call the DescribeRegions operation to query the most recent region list.

cn-beijing

PageSize

integer

No

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

10

PageNumber

integer

No

The number of the page to return. The value must be a positive integer. Default value: 1.

1

InstanceType

string

No

The instance type of the instance. Set the value to Instance.

Instance

Status

string

No

The task status. Valid values:

  • Scheduled: The task is waiting to be executed.

  • Running: The task is running.

  • Succeed: The task is successful.

  • Failed: The task failed.

  • Cancelling: The task is being terminated.

  • Canceled: The task has been terminated.

  • Waiting: The task is waiting for scheduled time.

Separate multiple states with commas (,). This parameter is empty by default, which indicates that tasks in all states are queried.

Succeed,Running,Waiting

InstanceId

string

No

The instance ID. Separate multiple instance IDs with commas (,). You can specify up to 30 instance IDs. This parameter is empty by default, which indicates that tasks of all instances are queried.

dds-8vb38f0e7933xxxx

TaskId

string

No

The task ID. Separate multiple task IDs with commas (,). You can specify up to 30 task IDs. This parameter is empty by default, which indicates that all tasks are queried.

t-0mq1yyhm3ffl2bxxxx

TaskType

string

No

The task type. This parameter is left empty by default, which indicates that all types of tasks are queried. Valid values:

  • CreateIns: Create an instance.

  • DeleteIns: Delete an instance.

  • ChangeVariable: Modify parameter settings for an instance.

  • ModifyInsConfig: Change the configurations of an instance.

  • RestartIns: Restart an instance.

  • HaSwitch: Perform a primary/secondary switchover on an instance.

  • CloneIns: Clone an instance.

  • KernelVersionUpgrade: Update the minor version of an instance.

  • ProxyVersionUpgrade: Upgrade the agent version of an instance.

  • ModifyAccount: Change the account of an instance.

  • ModifyInsSpec: Change the specifications of an instance or perform a data migration on the instance.

  • CreateReadIns: Create a read-only instance.

  • StartIns: Start an instance.

  • StopIns: Stop an instance.

  • ModifyNetwork: Modify the network type for an instance.

  • LockIns: Lock an instance.

  • UnlockIns: Unlock an instance.

  • DiskOnlineExpansion: Scale out the disks of an instance online.

  • StorageOnlineExpansion: Expend the storage capacity of an instance online.

  • AddInsNode: Add a node to an instance.

  • DeleteInsNode: Delete a node from an instance.

  • ManualBackupIns: Manually back up an instance.

  • ModifyInsStorageType: Modify the storage type for an instance.

DeleteInsNode

FromStartTime

string

Yes

The start time of the O&M task to perform. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. You can query data within the last 30 days.

2023-03-15T03:41:26Z

ToStartTime

string

Yes

The end time of the O&M task to perform. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. You can query data within the last 30 days.

2023-03-16T07:21:31Z

FromExecTime

integer

No

The minimum execution duration of the task. This parameter is used to filter tasks whose execution duration is longer than the minimum execution duration. Unit: seconds. The default value is 0, which indicates that no limit is imposed for the query.

0

ToExecTime

integer

No

The maximum execution duration of the task. This parameter is used to filter tasks whose execution duration is shorter than or equal to the maximum execution duration. Unit: seconds. The default value is 0, which indicates that no limit is imposed for the query.

0

ResourceGroupId

string

No

The ID of the resource group.

rg-aek2inrfrnw3xby

Response elements

Element

Type

Description

Example

object

PageNumber

integer

The page number of the returned page.

1

RequestId

string

The request ID.

3C4A2494-XXXX-XXXX-93CF-548DB3375193

PageSize

integer

The maximum number of entries returned per page.

10

TotalCount

integer

The total number of tasks that meet these conditions without taking pagination into account.

5

Items

array<object>

The task objects.

object

Status

string

The task status. Valid values:

  • Scheduled: The task is waiting to be executed.

  • Running: The task is running.

  • Succeed: The task is successful.

  • Failed: The task failed.

  • Cancelling: The task is being terminated.

  • Canceled: The task has been terminated.

  • Waiting: The task is waiting for scheduled time.

Succeed

TaskId

string

The task ID.

t-0mq1yyhm3ffl2bxxxx

CurrentStepName

string

The name of the current step. If this parameter is left empty, the task is not started.

exec_task

StartTime

string

The start time of the performed O&M task. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2023-02-11T02:33Z

EndTime

string

The end time of the performed O&M task. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2023-03-16T02:59Z

TaskType

string

The task type.

  • CreateIns: Create an instance.

  • DeleteIns: Delete an instance.

  • ChangeVariable: Modify parameter settings for an instance.

  • ModifyInsConfig: Change the configurations of an instance.

  • RestartIns: Restart an instance.

  • HaSwitch: Perform a primary/secondary switchover on an instance.

  • CloneIns: Clone an instance.

  • KernelVersionUpgrade: Update the minor version of an instance.

  • ProxyVersionUpgrade: Upgrade the agent version of an instance.

  • ModifyAccount: Change the account of an instance.

  • ModifyInsSpec: Change the specifications of an instance or perform a data migration on the instance.

  • CreateReadIns: Create a read-only instance.

  • StartIns: Start an instance.

  • StopIns: Stop an instance.

  • ModifyNetwork: Modify the network type for an instance.

  • LockIns: Lock an instance.

  • UnlockIns: Unlock an instance.

  • DiskOnlineExpansion: Scale out the disks of an instance online.

  • StorageOnlineExpansion: Expend the storage capacity of an instance online.

  • AddInsNode: Add a node to an instance.

  • DeleteInsNode: Delete a node from an instance.

  • ManualBackupIns: Manually back up an instance.

  • ModifyInsStorageType: Modify the storage type for an instance.

CreateIns

RemainTime

integer

The estimated remaining execution time. Unit: seconds. The value 0 indicates that the task is completed.

1000

Progress

number

The current progress of the task. The valid values range from 0 to 100.

100.0

RegionId

string

The region ID of the instance.

cn-hangzhou

InstanceType

string

The instance type of the instance. The value is fixed to Instance.

Instance

InstanceId

string

The instance ID

dds-t4n18194768fxxxx

InstanceName

string

The name of the instance.

test-dds

DbType

string

The database type. The value is fixed to mongodb.

mongodb

Product

string

The product. The value is fixed to dds.

dds

TaskDetail

string

The details of the task. The task details vary based on the value of the taskType parameter.

{\"callerUid\":\"test\"}

ReasonCode

string

The reason why the current task was initiated.

小版本升级

ActionInfo

string

A set of allowed actions that can be taken on the task. The system matches the current step name and status of the task to the available actions specified by ActionInfo. If no matching action is found, the current status of the task does not support any action. Example:

   "steps": [
    {
      "step_name": "exec_task", // The name of the step, which matches the value of CurrentStepName.
      "action_info": {    // The actions supported for this step.
        "Waiting": [      // The status, which matches the value of Status.
          "modifySwitchTime" // The action. Multiple actions are supported.
        ]
      }
    },
    {
      "step_name": "init_task", // The name of the step.
      "action_info": {    // The actions supported for this step.
        "Running": [      // The status.
          "cancel",       // The action.
          "pause"
        ]
      }
    }
  ]
}

The system may support the following actions:

  • retry: makes another attempt.

  • cancel: makes a cancellation.

  • modifySwitchTime: changes the switching or restoration time.

`{\"steps\":[{\"action_info\":{\"Waiting\":[\"modifySwitchTime\"]},\"step_name\":\"exec_task\"}]}`

Uid

string

The ID of the user to which the resource belongs.

141345906006****

CallerSource

string

The request source. Valid values: System and User.

System

CallerUid

string

The ID of the user who made the request. If CallerSource is set to User, CallerUid indicates the unique ID (UID) of the user.

141345906006****

Examples

Success response

JSON format

{
  "PageNumber": 1,
  "RequestId": "3C4A2494-XXXX-XXXX-93CF-548DB3375193",
  "PageSize": 10,
  "TotalCount": 5,
  "Items": [
    {
      "Status": "Succeed",
      "TaskId": "t-0mq1yyhm3ffl2bxxxx",
      "CurrentStepName": "exec_task",
      "StartTime": "2023-02-11T02:33Z",
      "EndTime": "2023-03-16T02:59Z",
      "TaskType": "CreateIns",
      "RemainTime": 1000,
      "Progress": 100,
      "RegionId": "cn-hangzhou",
      "InstanceType": "Instance",
      "InstanceId": "dds-t4n18194768fxxxx",
      "InstanceName": "test-dds",
      "DbType": "mongodb",
      "Product": "dds",
      "TaskDetail": "{\\\"callerUid\\\":\\\"test\\\"}",
      "ReasonCode": "小版本升级",
      "ActionInfo": "`{\\\"steps\\\":[{\\\"action_info\\\":{\\\"Waiting\\\":[\\\"modifySwitchTime\\\"]},\\\"step_name\\\":\\\"exec_task\\\"}]}`",
      "Uid": "141345906006****",
      "CallerSource": "System",
      "CallerUid": "141345906006****"
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 Param.Invalid Param invalid
400 Param.Invalid.TimeEndBeforeStart Param invalid. End time before start time

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.