Retrieve historical task records.
Operation description
Only supports viewing tasks within the last 30 days.
Debugging
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 Resourcesis 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.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| adb:DescribeHistoryTasks | get | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| RegionId | string | Yes | The region ID | 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. Valid range: positive integers. Default value: 1 | 1 |
| InstanceType | string | No | The instance type. The value is fixed to Instance. | Instance |
| Status | string | No | The state of the task. Valid values:
If querying multiple statuses, separate them with English commas. Default is empty, meaning select all. | Scheduled |
| InstanceId | string | No | 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-******** |
| TaskId | string | No | 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**** |
| TaskType | string | No | 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 |
| FromStartTime | string | Yes | 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 |
| ToStartTime | string | Yes | 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 |
| FromExecTime | integer | No | Minimum task execution time. Used to filter tasks with execution time greater than this value, in seconds. Default 0, meaning no limit. | 0 |
| ToExecTime | integer | No | Maximum task execution time. Used to filter tasks with execution time not less than this value, in seconds. Default 0, meaning no limit. | 0 |
| ResourceGroupId | string | No | Resource group ID. | rg-ae**** |
Response parameters
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.
