All Products
Search
Document Center

AnalyticDB:DescribeHistoryTasks

Last Updated:Nov 10, 2025

Retrieve historical task records.

Operation description

Only supports viewing tasks within the last 30 days.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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
adb:DescribeHistoryTasksget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID

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. Valid range: positive integers. Default value: 1

1
InstanceTypestringNo

The instance type. The value is fixed to Instance.

Instance
StatusstringNo

The state of the task. Valid values:

  • Scheduled
  • Running
  • Succeed
  • Failed: The task failed.
  • Cancelling
  • Canceled
  • Waiting

If querying multiple statuses, separate them with English commas. Default is empty, meaning select all.

Scheduled
InstanceIdstringNo

The cluster ID. Separate multiple cluster IDs with commas (,). Maximum 30 cluster IDs. If not filled, defaults to querying historical tasks of all clusters in that region.

amv-********
TaskIdstringNo

The job IDs. Separate multiple task IDs with commas (,). Maximum 30 task IDs. If not filled, defaults to querying historical tasks of all clusters.

t-83br18hloy3faf****
TaskTypestringNo

Task type, used to query specific type task situations. If multiple, separate with English commas (,), maximum 30 supported. Default is empty, meaning no restriction.

autotest_dispatch_cases
FromStartTimestringYes

Start time of task start time, indicating querying tasks whose start time is after this time. Expressed according to ISO8601 standard, and must use UTC +0 time, format: yyyy-MM-ddTHH:mm:ssZ. Earliest supports 30 days ago, automatically converts to 30 days ago if more than 30 days from current time.

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

End time of task start time, indicating querying tasks whose start time is before this time. Expressed according to ISO8601 standard, and must use UTC +0 time, format: yyyy-MM-ddTHH:mm:ssZ.

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

Minimum task execution time. Used to filter tasks with execution time greater than this value, in seconds. Default 0, meaning no limit.

0
ToExecTimeintegerNo

Maximum task execution time. Used to filter tasks with execution time not less than this value, in seconds. Default 0, meaning no limit.

0
ResourceGroupIdstringNo

Resource group ID.

rg-ae****

Response parameters

ParameterTypeDescriptionExample
object
PageNumberinteger

The page number of the returned page.

1
RequestIdstring

Request ID.

E51713A3-BB45-5616-AB15-170B704F8F01
PageSizeinteger

The number of entries returned per page.

10
TotalCountinteger

Total record count.

100
Itemsarray<object>

The task list.

Itemsobject

The task object.

Statusstring

Task status. Valid values:

  • Scheduled
  • Running
  • Succeed
  • Failed: The task failed.
  • Cancelling
  • Canceled
  • Waiting
Running
TaskIdstring

Task ID.

t-83br18hloy3faf****
CurrentStepNamestring

Current executing step name. If empty, represents task has not started.

exec_task
StartTimestring

Task start time.

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

Task end time.

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

Task type.

autotest_dispatch_cases
RemainTimeinteger

Estimated remaining execution time, in seconds.

1000
Progressfloat

Indicates the task progress.

79.0
RegionIdstring

The region ID.

cn-hangzhou
InstanceTypestring

Instance type.

Instance
InstanceIdstring

Cluster ID.

amv-********
InstanceNamestring

The instance ID.

test
DbTypestring

The database engine type.

analyticdb
Productstring

The service name.

ads
TaskDetailstring

The task details.

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

Allowed operation information. When used specifically, matches operation Action based on currentStepName+status in this information. If no Action is matched, represents task current status does not support operations.

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

null

141345906006****
CallerSourcestring

null

141345906006****
CallerUidstring

null

  • null
  • null
User
ReasonCodestring

The reason why the current task was initiated.

test
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true
HttpStatusCodeinteger

The HTTP status code returned.

200
Codestring

The HTTP status code that is returned.

200
Messagestring

The returned message. null

  • null****
  • null
Success
AccessDeniedDetailobject

null

AuthActionstring

null

test
AuthPrincipalDisplayNamestring

null

test
AuthPrincipalOwnerIdstring

null

141345906006****
AuthPrincipalTypestring

null

test
EncodedDiagnosticMessagestring

null

AQFmy+hZZsvoWTQ2NTJFQUFBLUIyNjktMzk5NS05MEZCLUMxMzgwNDUwMDA2Ng==
NoPermissionTypestring

null

  • null
  • null
ImplicitDeny
PolicyTypestring

null

  • null
  • null
  • null
  • null
  • null
ControlPolicy

Examples

Sample success responses

JSONformat

{
  "PageNumber": 1,
  "RequestId": "E51713A3-BB45-5616-AB15-170B704F8F01",
  "PageSize": 10,
  "TotalCount": 100,
  "Items": [
    {
      "Status": "Running",
      "TaskId": "t-83br18hloy3faf****",
      "CurrentStepName": "exec_task",
      "StartTime": "2022-02-03T11:31:03Z",
      "EndTime": "2022-02-03T12:06:17Z",
      "TaskType": "autotest_dispatch_cases",
      "RemainTime": 1000,
      "Progress": 79,
      "RegionId": "cn-hangzhou",
      "InstanceType": "Instance",
      "InstanceId": "amv-********",
      "InstanceName": "test",
      "DbType": "analyticdb",
      "Product": "ads",
      "TaskDetail": "{\\\"callerUid\\\":\\\"test\\\"}",
      "ActionInfo": "{\\\"steps\\\":[{\\\"action_info\\\":{\\\"Waiting\\\":[\\\"modifySwitchTime\\\"]},\\\"step_name\\\":\\\"exec_task\\\"}]}",
      "Uid": "141345906006****",
      "CallerSource": "141345906006****",
      "CallerUid": "User",
      "ReasonCode": "test"
    }
  ],
  "Success": true,
  "HttpStatusCode": 200,
  "Code": 200,
  "Message": "Success",
  "AccessDeniedDetail": {
    "AuthAction": "test",
    "AuthPrincipalDisplayName": "test",
    "AuthPrincipalOwnerId": "141345906006****",
    "AuthPrincipalType": "test",
    "EncodedDiagnosticMessage": "AQFmy+hZZsvoWTQ2NTJFQUFBLUIyNjktMzk5NS05MEZCLUMxMzgwNDUwMDA2Ng==",
    "NoPermissionType": "ImplicitDeny",
    "PolicyType": "ControlPolicy"
  }
}

Error codes

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