All Products
Search
Document Center

ApsaraDB for Redis:DescribeHistoryTasks

Last Updated:Mar 21, 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
kvstore:DescribeHistoryTasksRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID. 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 page number. Pages start from page 1. Default value: 1.

1
InstanceTypestringNo

Set the value to Instance.

Instance
StatusstringNo

The task status. Valid values:

  • Scheduled
  • Running
  • Succeed
  • Failed
  • Cancelling
  • Canceled
  • Waiting
Note This parameter is empty by default, which indicates that tasks in all states are queried. Separate multiple states with commas (,).
Scheduled
InstanceIdstringNo

The instance ID. This parameter is empty by default, which indicates that you can specify an unlimited number of instance IDs. Separate multiple instance IDs with commas (,). You can specify up to 30 instance IDs.

r-uf62br2491p5l****
TaskIdstringNo

The task ID. This parameter is empty by default, which indicates that you can specify an unlimited number of task IDs. Separate multiple task IDs with commas (,). You can specify up to 30 task IDs.

t-83br18hloy3faf****
TaskTypestringNo

The task type. This parameter is empty by default, which indicates that you can specify an unlimited number of task types.

  • ModifyInsSpec
  • DeleteInsNode
  • AddInsNode
  • HaSwitch
  • RestartIns
  • CreateIns
  • ModifyInsConfig
Note Separate multiple task types with commas (,).
ModifyInsSpec
FromStartTimestringYes

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. The start time can be up to 30 days earlier than the current time.

2022-01-02T11:31:03Z
ToStartTimestringYes

The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Only tasks that have a start time earlier than or equal to the time specified by this parameter are queried.

2022-03-02T11:31:03Z
FromExecTimeintegerNo

The minimum execution duration of a 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.

0
ToExecTimeintegerNo

The maximum execution duration of a 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.

0

Response parameters

ParameterTypeDescriptionExample
object
PageNumberinteger

The page number of the returned page.

1
RequestIdstring

The request ID.

5D622714-AEDD-4609-9167-F5DDD3D1****
PageSizeinteger

The maximum number of entries returned per page.

10
TotalCountinteger

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

5
Itemsobject []

The queried task objects.

Statusinteger

The task status.

  • Scheduled
  • Running
  • Succeed
  • Failed
  • Cancelling
  • Canceled
  • Waiting
Running
TaskIdstring

The task ID.

t-83br18hloy3faf****
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 task. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time is displayed in UTC.

2022-02-03T11:31:03Z
EndTimestring

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

2022-02-03T12:06:17Z
TaskTypestring

The task type.

  • ModifyInsSpec
  • DeleteInsNode
  • AddInsNode
  • HaSwitch
  • RestartIns
  • CreateIns
  • ModifyInsConfig
ModifyInsSpec
RemainTimeinteger

The estimated amount of time remaining to complete the task. Unit: seconds. A value of 0 indicates that the task is completed.

1000
Progressfloat

The task progress. Valid values: 0 to 100.

79.0
RegionIdstring

The region ID.

cn-shanghai
InstanceTypestring

The instance type. The return value is Instance.

Instance
InstanceIdstring

The instance ID.

r-bp1zxszhcgatnx****
InstanceNamestring

The instance name.

dba-tair-test-qcloud
DbTypestring

The database type. The return value is redis.

redis
Productstring

The product. The return value is kvstore.

kvstore
TaskDetailstring

The task details. The details vary based on the task type.

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

The reason why the current task was initiated.

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 CurrentStepName.
      "action_info": {    // The actions supported for this step.
        "Waiting": [      // The status, which matches 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
  • cancel
  • 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 resources belong.

141345906006****
CallerSourcestring

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

The request source. Valid values:

  • System
  • User
User

Examples

Sample success responses

JSONformat

{
  "PageNumber": 1,
  "RequestId": "5D622714-AEDD-4609-9167-F5DDD3D1****",
  "PageSize": 10,
  "TotalCount": 5,
  "Items": [
    {
      "Status": 0,
      "TaskId": "t-83br18hloy3faf****",
      "CurrentStepName": "exec_task",
      "StartTime": "2022-02-03T11:31:03Z",
      "EndTime": "2022-02-03T12:06:17Z",
      "TaskType": "ModifyInsSpec",
      "RemainTime": 1000,
      "Progress": 79,
      "RegionId": "cn-shanghai",
      "InstanceType": "Instance",
      "InstanceId": "r-bp1zxszhcgatnx****",
      "InstanceName": "dba-tair-test-qcloud",
      "DbType": "redis",
      "Product": "kvstore",
      "TaskDetail": "{\\\"callerUid\\\":\\\"test\\\"}",
      "ReasonCode": "",
      "ActionInfo": "{\\\"steps\\\":[{\\\"action_info\\\":{\\\"Waiting\\\":[\\\"modifySwitchTime\\\"]},\\\"step_name\\\":\\\"exec_task\\\"}]}\n",
      "Uid": "141345906006****",
      "CallerSource": "141345906006****",
      "CallerUid": "User"
    }
  ]
}

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.

Change history

Change timeSummary of changesOperation
No change history