Queries the historical tasks that are created within 30 days.
Operation description
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:
- 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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
rds:DescribeHistoryTasks | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | 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 page number. Pages start from page 1. Default value: 1. | 1 |
InstanceType | string | No | Only Instance is supported. | Instance |
Status | string | No | The status of the task. Valid values:
Separate multiple states with commas (,). This parameter is empty by default, which indicates that tasks in all states are queried. | Scheduled |
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 you can specify an unlimited number of instance IDs. | rm-uf62br2491p5l**** |
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 you can specify an unlimited number of task IDs. | t-83br18hloy3faf**** |
TaskType | string | No | The task type. Separate multiple task types with commas (,). You can specify up to 30 task types. This parameter is empty by default, which indicates that you can specify an unlimited number of task types. | autotest_dispatch_cases |
FromStartTime | string | Yes | The beginning of the time range to query. Only tasks that have a start time later than or equal to the time specified by this parameter are queried. 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. If you set this parameter to a time more than 30 days earlier than the current time, the specified time is automatically converted to a time that is exactly 30 days earlier than the current time. | 2022-01-02T11:31:03Z |
ToStartTime | string | Yes | The end of the time range to query. Only tasks that have a start time earlier than or equal to the time specified by this parameter are queried. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. | 2022-03-02T11:31:03Z |
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. | 0 |
ToExecTime | integer | No | 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 |
ResourceGroupId | string | No | The ID of the resource group. | rg-aekzbvctytru7ua |
Response parameters
Examples
Sample success responses
JSON
format
{
"PageNumber": 1,
"RequestId": "5CD61041-35F7-10F7-BE94-33A48B22****",
"PageSize": 10,
"TotalCount": 2,
"Items": [
{
"Status": 0,
"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-shanghai",
"InstanceType": "Instance",
"InstanceId": "rm-uf62br2491p5l****",
"InstanceName": "test",
"DbType": "mysql",
"Product": "rds",
"TaskDetail": "{\\\"callerUid\\\":\\\"test\\\"}",
"ReasonCode": " ****",
"ActionInfo": "{\\\"steps\\\":[{\\\"action_info\\\":{\\\"Waiting\\\":[\\\"modifySwitchTime\\\"]},\\\"step_name\\\":\\\"exec_task\\\"}]}",
"Uid": "141345906006****",
"CallerSource": "141345906006****",
"CallerUid": "User"
}
]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | Param.Invalid | Param invalid | A request parameter error occurred. |
400 | Param.Invalid.TimeEndBeforeStart | Param invalid. End time before start time | The end time cannot be earlier than the start time. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-11-20 | The Error code has changed. The response structure of the API has changed | View Change Details |
2022-06-20 | Add Operation | View Change Details |