All Products
Search
Document Center

ApsaraDB for MongoDB:DescribeHistoryTasks

Last Updated:Sep 03, 2024

Queries a list of tasks in the task center.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dds:DescribeHistoryTaskslist
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

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

cn-beijing
PageSizeintegerNo

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

10
PageNumberintegerNo

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

1
InstanceTypestringNo

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

Instance
StatusstringNo

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
InstanceIdstringNo

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
TaskIdstringNo

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
TaskTypestringNo

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
FromStartTimestringYes

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
ToStartTimestringYes

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
FromExecTimeintegerNo

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
ToExecTimeintegerNo

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

Response parameters

ParameterTypeDescriptionExample
object
PageNumberinteger

The page number of the returned page.

1
RequestIdstring

The request ID.

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

The maximum number of entries returned per page.

10
TotalCountinteger

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

5
Itemsarray<object>

The task objects.

object
Statusinteger

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
TaskIdstring

The task ID.

t-0mq1yyhm3ffl2bxxxx
CurrentStepNamestring

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

exec_task
StartTimestring

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
EndTimestring

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
TaskTypestring

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
RemainTimeinteger

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

1000
Progressfloat

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

100.0
RegionIdstring

The region ID of the instance.

cn-hangzhou
InstanceTypestring

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

Instance
InstanceIdstring

The instance ID

dds-t4n18194768fxxxx
InstanceNamestring

The name of the instance.

test-dds
DbTypestring

The database type. The value is fixed to mongodb.

mongodb
Productstring

The product. The value is fixed to dds.

dds
TaskDetailstring

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

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

The reason why the current task was initiated.

test
ActionInfostring

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\"}]}`
Uidstring

The ID of the user to which the resource belongs.

141345906006****
CallerSourcestring

The request source. Valid values: System and User.

System
CallerUidstring

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

Sample success responses

JSONformat

{
  "PageNumber": 1,
  "RequestId": "3C4A2494-XXXX-XXXX-93CF-548DB3375193",
  "PageSize": 10,
  "TotalCount": 5,
  "Items": [
    {
      "Status": 0,
      "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": "test",
      "ActionInfo": "`{\\\"steps\\\":[{\\\"action_info\\\":{\\\"Waiting\\\":[\\\"modifySwitchTime\\\"]},\\\"step_name\\\":\\\"exec_task\\\"}]}`",
      "Uid": "141345906006****",
      "CallerSource": "System",
      "CallerUid": "141345906006****"
    }
  ]
}

Error codes

HTTP status codeError codeError message
400Param.InvalidParam invalid
400Param.Invalid.TimeEndBeforeStartParam invalid. End time before start time

For a list of error codes, visit the Service error codes.