All Products
Search
Document Center

Elastic High Performance Computing:ListTasks

Last Updated:Apr 09, 2024

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

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

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ClusterIdstringYes

The ID of the cluster.

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

ehpc-hz-FYUr32****
PageNumberintegerNo

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

1
PageSizeintegerNo

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

Default value: 10

10
TaskIdstringNo

The ID of the task. 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 returned per page.

10
RequestIdstring

The ID of the request.

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

The page number of the returned page.

1
TotalCountinteger

The total number of entries of the task.

10
Tasksobject []

The list of task information.

Statusstring

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.
Processing
TaskTypestring

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.
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 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.
{\"Instances\":[{\"InstanceId\":\"i-bp1inb1j2xz8pnoi****\",\"Ip\":\"192.168.*.*\",\"Hostname\":\"login0\",\"role\":\"login\"}]}
Errorsstring

The list of error messages returned for the task.

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

[]
TaskIdstring

The ID of the task.

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 ID of the cluster.

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
400InvalidParamsInvalid param: %s-
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.