Queries tasks in the task center.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
kvstore:DescribeHistoryTasks |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. 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 |
Set the value to Instance. |
Instance |
| Status |
string |
No |
The task status. Valid values:
Note
Empty by default, which queries tasks in all states. Separate multiple states with commas (,). |
Scheduled |
| InstanceId |
string |
No |
The instance ID. Empty by default. Separate multiple instance IDs with commas (,). You can specify up to 30 instance IDs. |
r-uf62br2491p5l**** |
| TaskId |
string |
No |
The task ID. Empty by default. Separate multiple task IDs with commas (,). You can specify up to 30 task IDs. |
t-83br18hloy3faf**** |
| TaskType |
string |
No |
The task type. Empty by default, which queries all task types.
Note
Separate multiple task types with commas (,). |
ModifyInsSpec |
| FromStartTime |
string |
Yes |
The start 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 |
| ToStartTime |
string |
Yes |
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 with a start time earlier than or equal to this value are returned. |
2022-02-02T11:31:03Z |
| FromExecTime |
integer |
No |
The minimum execution duration. Filters tasks whose execution duration exceeds this value. Unit: seconds. Default value: 0, which indicates no limit. |
0 |
| ToExecTime |
integer |
No |
The maximum execution duration. Filters tasks whose execution duration is shorter than or equal to this value. Unit: seconds. Default value: 0, which indicates no limit. |
0 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| PageNumber |
integer |
The page number of the returned page. |
1 |
| RequestId |
string |
The request ID. |
5D622714-AEDD-4609-9167-F5DDD3D1**** |
| PageSize |
integer |
The maximum number of entries returned per page. |
10 |
| TotalCount |
integer |
The total number of tasks that match the filter criteria, regardless of pagination. |
5 |
| Items |
array<object> |
The task objects. |
|
|
object |
|||
| Status |
string |
The task status.
|
Running |
| TaskId |
string |
The task ID. |
t-83br18hloy3faf**** |
| CurrentStepName |
string |
The name of the current step. Empty if the task has not started. |
exec_task |
| StartTime |
string |
The start time of the task, in the yyyy-MM-ddTHH:mm:ssZ format (UTC, ISO 8601). |
2022-02-03T11:31:03Z |
| EndTime |
string |
The end time of the task, in the yyyy-MM-ddTHH:mm:ssZ format (UTC, ISO 8601). |
2022-02-03T12:06:17Z |
| TaskType |
string |
The task type.
|
ModifyInsSpec |
| RemainTime |
integer |
The estimated remaining time to complete the task. Unit: seconds. A value of 0 indicates the task is completed. |
1000 |
| Progress |
number |
The task progress. Valid values: 0 to 100. |
79.0 |
| RegionId |
string |
The region ID. |
cn-shanghai |
| InstanceType |
string |
The instance type. The value is always Instance. |
Instance |
| InstanceId |
string |
The instance ID. |
r-bp1zxszhcgatnx**** |
| InstanceName |
string |
The instance name. |
dba-tair-test-qcloud |
| DbType |
string |
The database type. The value is always redis. |
redis |
| Product |
string |
The product. The value is always kvstore. |
kvstore |
| TaskDetail |
string |
The task details. Details vary by task type. |
{\"callerUid\":\"test\"} |
| ReasonCode |
string |
The reason the task was initiated. |
小版本升级 |
| ActionInfo |
string |
The allowed actions for the task. The system matches the current step name and task status against the actions in ActionInfo. If no match is found, the task does not support any action in its current state. Example:
Supported actions:
|
{"steps":[{"action_info":{"Waiting":["modifySwitchTime"]},"step_name":"exec_task"}]} |
| Uid |
string |
The ID of the resource owner. |
141345906006**** |
| CallerSource |
string |
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**** |
| CallerUid |
string |
The request source. Valid values:
|
User |
Examples
Success response
JSON format
{
"PageNumber": 1,
"RequestId": "5D622714-AEDD-4609-9167-F5DDD3D1****",
"PageSize": 10,
"TotalCount": 5,
"Items": [
{
"Status": "Running",
"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\"}]}",
"Uid": "141345906006****",
"CallerSource": "141345906006****",
"CallerUid": "User"
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Param.Invalid | Param invalid | |
| 400 | Param.Invalid.TimeEndBeforeStart | Param invalid. End time before start time |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.