Queries the interactive commands in a cluster.

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 ListCommands

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

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

The ID of the cluster.

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

CommandId String No c-hz01v8vudql****

The ID of the command.

PageNumber Integer No 1

The number of the page to return.

Page numbers start from 1.

Default value: 1

PageSize Integer No 10

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

Default value: 10

Response parameters

Parameter Type Example Description
Commands Array of Command

The list of commands.

Command
CommandContent String echo "hello world"

The content of the command.

CommandId String c-hz01v8vudql****

The ID of the command.

Timeout String 60

The timeout period.

WorkingDir String /root

The working directory of the command.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

RequestId String 04F0F334-1335-436C-A1D7-6C044FE7****

The ID of the request.

TotalCount Integer 1

The total number of returned entries.

Examples

Sample requests

https://ehpc.cn-hangzhou.aliyuncs.com/?Action=ListCommands
&ClusterId=ehpc-hz-FYUr32****
&<Common request parameters>

Sample success responses

XML format

<ListCommandsResponse>
      <RequestId>04F0F334-1335-436C-A1D7-6C044FE7****</RequestId>
      <TotalCount>1</TotalCount>
      <PageNumber>1</PageNumber>
      <PageSize>10</PageSize>
      <Commands>
            <Command>
                  <CommandId>c-hz01v8vudql****</CommandId>
                  <CommandContent>echo "hello world"</CommandContent>
                  <WorkingDir>/root</WorkingDir>
                  <Timeout>60</Timeout>
            </Command>
      </Commands>
</ListCommandsResponse>

JSON format

{
    "ListCommandsResponse": {
        "RequestId": "04F0F334-1335-436C-A1D7-6C044FE7****",
        "TotalCount": 1,
        "PageNumber": 1,
        "PageSize": 10,
        "Commands": {
            "Command": {
                "CommandId": "c-hz01v8vudql****",
                "CommandContent": "echo \"hello world\"",
                "WorkingDir": "/root",
                "Timeout": 60
            }
        }
    }
}

Error codes

HttpCode Error code Error message Description
400 InvalidParams The specified parameter %s is invalid. The error message returned because the following parameter is invalid: %s.
400 NotEnabled You have not enabled this service The error message returned because the service is not activated for your account.
400 InDebt Your account has overdue payments. The error message returned because your account has overdue payments.
403 InvalidClusterStatus The operation failed due to invalid cluster status. The error message returned because the operation is not supported while the cluster is in the current state.
403 ConflictOpt A conflicting operation is running. The error message returned because an operation that conflicts with the current operation is in progress. Try again later.
404 ClusterNotFound The specified cluster does not exist. The error message returned because the specified cluster does not exist.
404 ObjectNotFound The specified object is not found. The error message returned because the specified object does not exist.
407 NotAuthorized You are not authorized by RAM for this request. The error message returned because you are not authorized by RAM for this request.
406 EcsError An error occurred while calling the ECS API operation. The error message returned because the ECS API call has failed.
406 AgentError The agent service request failed. The error message returned because the proxy request has failed.
406 AliyunError An Alibaba Cloud product error occurred. The error message returned because the operation has failed to call another Alibaba Cloud service.
409 PartFailure Part of the batch operation failed. The error message returned because the batch operation has failed.
500 UnknownError An unknown error occurred. The error message returned because an unknown error has occurred.
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.