Queries the results of asynchronous API operations in a specified cluster.
Operation description
For some asynchronous API operations such as AddNodes, a successful request immediately returns a result without waiting for the node to be created. You can use the TaskId returned by the operation to query the specific task execution result.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ehpc:ListTasks |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClusterId |
string |
Yes |
The ID of the cluster that you want to query. You can call ListClusters to obtain the cluster ID. |
ehpc-hz-FYUr32**** |
| PageNumber |
integer |
No |
The page number to display. The value starts from 1. Valid values: 1 to 999. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Valid values: 1 to 50. Default value: 10. |
10 |
| TaskId |
string |
No |
The task ID. You can call the following asynchronous API operations to obtain the corresponding TaskId. |
B745C159-3155-4B94-95D0-4B73D4D2**** |
| Archived |
boolean |
No |
Specifies whether to display historical results of completed asynchronous API operations. Valid values:
Default value: false. Note
This parameter does not take effect if you specify the TaskId parameter. Valid values:
|
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| PageSize |
integer |
The number of entries per page. |
10 |
| RequestId |
string |
The request ID. |
89A1AC0F-4A6C-4F3D-98F9-BEF9A823**** |
| PageNumber |
integer |
The current page number. |
1 |
| TotalCount |
integer |
The total number of entries in the task list. |
10 |
| Tasks |
array<object> |
The list of task information. |
|
|
object |
The list of task information. |
||
| Status |
string |
The task execution status. Valid values:
|
Processing |
| TaskType |
string |
The task type. Valid values:
|
StopCluster |
| TotalSteps |
integer |
The total number of steps in the task. |
35 |
| CurrentStep |
integer |
The current step number of the task. |
16 |
| Result |
string |
The task execution result. Valid values:
|
{\"Instances\":[{\"InstanceId\":\"i-bp1inb1j2xz8pnoi****\",\"Ip\":\"192.168.*.*\",\"Hostname\":\"login0\",\"role\":\"login\"}]} |
| Errors |
string |
The list of task execution error messages. You can view error messages and corresponding solutions in the Error Center. |
[] |
| TaskId |
string |
The task ID. |
B745C159-3155-4B94-95D0-4B73D4D2**** |
| Request |
string |
The request parameter information of the task in JSON string format. |
{\"requestId\":\"0A6CA33E-BFBF-4F92-BDAE-4E8860DA****\",\"uid\":\"160998252992****\",\"bid\":\"268**\",\"clusterId\":\"ehpc-hz-ysQtcZ****\"} |
| ClusterId |
string |
The cluster ID. |
ehpc-hz-FYUr32**** |
Examples
Success response
JSON format
{
"PageSize": 10,
"RequestId": "89A1AC0F-4A6C-4F3D-98F9-BEF9A823****",
"PageNumber": 1,
"TotalCount": 10,
"Tasks": [
{
"Status": "Processing",
"TaskType": "StopCluster",
"TotalSteps": 35,
"CurrentStep": 16,
"Result": "{\\\"Instances\\\":[{\\\"InstanceId\\\":\\\"i-bp1inb1j2xz8pnoi****\\\",\\\"Ip\\\":\\\"192.168.*.*\\\",\\\"Hostname\\\":\\\"login0\\\",\\\"role\\\":\\\"login\\\"}]}",
"Errors": "[]",
"TaskId": "B745C159-3155-4B94-95D0-4B73D4D2****",
"Request": "{\\\"requestId\\\":\\\"0A6CA33E-BFBF-4F92-BDAE-4E8860DA****\\\",\\\"uid\\\":\\\"160998252992****\\\",\\\"bid\\\":\\\"268**\\\",\\\"clusterId\\\":\\\"ehpc-hz-ysQtcZ****\\\"}",
"ClusterId": "ehpc-hz-FYUr32****"
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParams | The specified parameter %s is invalid. | The specified parameter %s is invalid. |
| 400 | NotEnabled | You have not enabled this service | You have not enabled this service |
| 500 | UnknownError | An unknown error occurred. | An unknown error occurred. |
| 404 | ClusterNotFound | The specified cluster does not exist. | The specified instance does not exist. |
| 503 | ServiceUnavailable | The request has failed due to a temporary failure of the server | The request has failed due to a temporary failure of the server. |
| 406 | DbError | A database service error occurred. | Database request failed. |
| 406 | RedisError | A Redis service error occurred. | Redis request failed. |
| 407 | NotAuthorized | You are not authorized by RAM for this request. | The request is not authorized by RAM. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.