Queries the response of an asynchronous API operation for a cluster.

Description

If you succeed in calling an asynchronous API operation, a response is generated before a resulting task is completed. Therefore, to query the result of the task, you can use the TaskId parameter returned by the API operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListTasks

The operation that you want to perform. Set the value to ListTasks.

ClusterId String Yes ehpc-hz-FYUr32****

The ID of the cluster.

You can call the ListClusters operation to obtain the cluster ID.

PageNumber Integer No 1

The number of the page to return. Pages start from page 1. Valid values: 1 to 999.

PageSize Integer No 10

The number of entries to return on each page. Valid values: 1 to 50.

Default value: 10

TaskId String No B745C159-3155-4B94-95D0-4B73D4D2****

The ID of the task. You can call the following asynchronous API operations to obtain the task ID.

Archived Boolean No false

Specifies whether to display the response history of the asynchronous API operation. Valid values:

  • true: displays the current response and response history of the asynchronous API operation.
  • false: displays only the current response of the asynchronous API operation. If no tasks are running, [] is returned.

Default value: false

Note If you specify the TaskId parameter, the Archived parameter is invalid.

Response parameters

Parameter Type Example Description
PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

RequestId String 89A1AC0F-4A6C-4F3D-98F9-BEF9A823****

The ID of the request.

Tasks Array of TaskInfo

The list of task information.

ClusterId String ehpc-hz-FYUr32****

The ID of the cluster.

CurrentStep Integer 16

The current step of the task.

Errors String []

The list of error messages returned for the task.

For information about error messages and their solutions, visit the API Error Center.

Request String {\"requestId\":\"0A6CA33E-BFBF-4F92-BDAE-4E8860DA****\",\"uid\":\"160998252992****\",\"bid\":\"268**\",\"clusterId\":\"ehpc-hz-ysQtcZ****\"}

The request parameters of the task. The value is a JSON string.

Result String {\"Instances\":[{\"InstanceId\":\"i-bp1inb1j2xz8pnoi****\",\"Ip\":\"192.168.*.*\",\"Hostname\":\"login0\",\"role\":\"login\"}]}

The result of the task. Valid values:

  • If TaskType is set to CreateCluster and AddComputes, the value is in the {\"Instances\":[]} format, which indicates the information of the nodes added to the cluster.
  • If TaskType is set to a value other than CreateCluster and AddComputes, the value is in the {} format.
Status String Processing

The status of the task. Valid values:

  • Processing: The task is running.
  • Success: The task is completed.
  • Fail: The task failed.
  • PartialFail: The task partially failed.
TaskId String B745C159-3155-4B94-95D0-4B73D4D2****

The ID of the task.

TaskType String StopCluster

The type of the task. Valid values:

  • CreateCluster: creates a cluster by calling the CreateCluster operation.
  • StartCluster: starts a cluster by calling the StartCluster operation.
  • StopCluster: stops a cluster by calling the StopCluster operation.
  • DeleteCluster: releases a cluster by calling the DeleteCluster operation.
  • AddComputes: adds nodes to a cluster by calling the AddNodes operation.
  • StartComputes: starts nodes by calling the StartNodes operation.
  • ResetCompute: resets nodes by calling the ResetNodes operation.
  • StopComputes: stops nodes by calling the StopNodes operation.
  • DeleteComputes: deletes nodes by calling the DeleteNodes operation.
TotalSteps Integer 35

The total number of steps of the task.

TotalCount Integer 10

The total number of entries of the task.

Examples

Sample requests

http(s)://ehpc.cn-hangzhou.aliyuncs.com/?Action=ListTasks
&ClusterId=ehpc-hz-FYUr32****
&<Common request parameters>

Sample success responses

XML format

<ListTasksResponse>
  <TotalCount>10</TotalCount>
  <Tasks>
        <Status>Processing</Status>
        <Errors>[]</Errors>
        <TaskId>B745C159-3155-4B94-95D0-4B73D4D2****</TaskId>
        <ClusterId>ehpc-hz-FYUr32****</ClusterId>
        <TaskType>StopCluster</TaskType>
        <Request>{\"requestId\":\"0A6CA33E-BFBF-4F92-BDAE-4E8860DA****\",\"uid\":\"160998252992****\",\"bid\":\"268**\",\"clusterId\":\"ehpc-hz-ysQtcZ****\"}</Request>
        <CurrentStep>16</CurrentStep>
        <TotalSteps>35</TotalSteps>
        <Result>{\"Instances\":[{\"InstanceId\":\"i-bp1inb1j2xz8pnoi****\",\"Ip\":\"192.168.*.*\",\"Hostname\":\"login0\",\"role\":\"login\"}]}</Result>
  </Tasks>
  <PageSize>10</PageSize>
  <RequestId>89A1AC0F-4A6C-4F3D-98F9-BEF9A823****</RequestId>
  <PageNumber>1</PageNumber>
</ListTasksResponse>

JSON format

{
    "TotalCount": 10,
    "Tasks": {
        "Status": "Processing",
        "Errors": "[]",
        "TaskId": "B745C159-3155-4B94-95D0-4B73D4D2****",
        "ClusterId": "ehpc-hz-FYUr32****",
        "TaskType": "StopCluster",
        "Request": "{\\\"requestId\\\":\\\"0A6CA33E-BFBF-4F92-BDAE-4E8860DA****\\\",\\\"uid\\\":\\\"160998252992****\\\",\\\"bid\\\":\\\"268**\\\",\\\"clusterId\\\":\\\"ehpc-hz-ysQtcZ****\\\"}",
        "CurrentStep": 16,
        "TotalSteps": 35,
        "Result": "{\\\"Instances\\\":[{\\\"InstanceId\\\":\\\"i-bp1inb1j2xz8pnoi****\\\",\\\"Ip\\\":\\\"192.168.*.*\\\",\\\"Hostname\\\":\\\"login0\\\",\\\"role\\\":\\\"login\\\"}]}"
    },
    "PageSize": 10,
    "RequestId": "89A1AC0F-4A6C-4F3D-98F9-BEF9A823****",
    "PageNumber": 1
}

Error codes

HttpCode Error code Error message Description
407 NotAuthorized You are not authorized by RAM for this request. The error message returned because you are not authorized by RAM for the request.
404 ClusterNotFound The specified cluster does not exist. The error message returned because the specified cluster does not exist.
406 DbError A database service error occurred. The error message returned because the database request has failed.
406 RedisError A Redis service error occurred. The error message returned because the Redis request has failed.
500 UnknownError An unknown error occurred. The error message returned because an unknown error has occurred.
400 NotEnabled You have not enabled this service The error message returned because the service is not activated for your account.
503 ServiceUnavailable The request has failed due to a temporary failure of the server The error message returned because the request has failed. The service is temporarily unavailable.

For a list of error codes, visit the API Error Center.