All Products
Search
Document Center

Elastic High Performance Computing:ListTasks

Last Updated:Apr 26, 2024

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

Operation description

For some asynchronous API operations such as AddNodes, the system immediately returns a result without waiting for the node to be created if the request succeeds. In this case, you can use the TaskId returned by the asynchronous API operation to query the result of the task.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringYes

The cluster ID.

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

ehpc-hz-FYUr32****
PageNumberintegerNo

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

1
PageSizeintegerNo

The number of entries per page. Valid values: 1 to 50.

Default value: 10.

10
TaskIdstringNo

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

B745C159-3155-4B94-95D0-4B73D4D2****
ArchivedbooleanNo

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.
false

Response parameters

ParameterTypeDescriptionExample
object
PageSizeinteger

The number of entries per page.

10
RequestIdstring

The request ID.

89A1AC0F-4A6C-4F3D-98F9-BEF9A823****
PageNumberinteger

The page number.

1
TotalCountinteger

The total number of entries returned.

10
Tasksobject []

The queried tasks.

Statusstring

The status of the task. Valid values:

  • Processing: The task is running.
  • Success: The task succeeded.
  • Failed: The task failed.
  • PartialFail: The task partially failed.
Processing
TaskTypestring

The task type. 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.
StopCluster
TotalStepsinteger

The total number of steps of the task.

35
CurrentStepinteger

The current step of the task.

16
Resultstring

The result of the task. Valid values:

  • If you set TaskType to CreateCluster or AddComputes, the value of this parameter is in the {\"Instances\":[]} format. The value indicates the information about the nodes that are added to the cluster.
  • If you set TaskType to a value other than CreateCluster and AddComputes, the value of this parameter is in the {} format.
{\"Instances\":[{\"InstanceId\":\"i-bp1inb1j2xz8pnoi****\",\"Ip\":\"192.168.*.*\",\"Hostname\":\"login0\",\"role\":\"login\"}]}
Errorsstring

The error messages returned for the task.

You can view the error messages and the corresponding solutions in the Error Center.

[]
TaskIdstring

The task ID.

B745C159-3155-4B94-95D0-4B73D4D2****
Requeststring

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

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

The cluster ID.

ehpc-hz-FYUr32****

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError messageDescription
400InvalidParamsThe specified parameter %s is invalid.The specified parameter %s is invalid.
400NotEnabledYou have not enabled this serviceYou have not enabled this service
404ClusterNotFoundThe specified cluster does not exist.The specified instance does not exist.
406DbErrorA database service error occurred.Database request failed.
406RedisErrorA Redis service error occurred.Redis request failed.
407NotAuthorizedYou are not authorized by RAM for this request.The request is not authorized by RAM.
500UnknownErrorAn unknown error occurred.An unknown error occurred.
503ServiceUnavailableThe request has failed due to a temporary failure of the serverThe request has failed due to a temporary failure of the server.

For a list of error codes, visit the Service error codes.