Execute interactive commands on a specified node 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 InvokeShellCommand

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

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

The ID of the cluster.

Command String Yes echo "hello world"

The content of the command. The content must be 2 to 2,048 characters in length.

Instance.N.Id String No i-1d24****

The ID of the Nth node instance on which the command is run.

Note This parameter specifies the node on which the command is run. If it is not specified, the command will be run on all nodes of the cluster.
WorkingDir String No /root

The working directory of the command. Default value: /root.

Timeout Integer No 3600

The timeout period. If a command times out, the command process will be terminated. Unit: seconds.

Minimum value: 60

Default value: 3600

Response parameters

Parameter Type Example Description
CommandId String c-f4682204a89949979d75e76700e****

The ID of the command. It is used to query the execution status of the command.

InstanceIds List ["i-uf68t1zu3jkhs8w****"]

The list of IDs of the instances on which you want to run the command.

RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368

The ID of the request.

Examples

Sample requests

https://ehpc.cn-hangzhou.aliyuncs.com/?Action=InvokeShellCommand
&ClusterId=ehpc-hz-FYUr32****
&Command=echo "hello world"
&<Common request parameters>

Sample success responses

XML format

<InvokeShellCommandResponse>
      <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
      <CommandId>c-f4682204a89949979d75e76700e0****</CommandId>
      <InstanceIds>
            <InstanceId>i-uf68t1zu3jkhs8w****</InstanceId>
            <InstanceId>i-uf6abz34m2714bp****</InstanceId>
            <InstanceId>i-uf65bh2113hlqvyx****</InstanceId>
            <InstanceId>i-uf68t1zu3jkhs8wx****</InstanceId>
            <InstanceId>i-uf6b0mtpx166fxxi****</InstanceId>
            <InstanceId>i-uf6faknz4dy1bit7****</InstanceId>
      </InstanceIds>
</InvokeShellCommandResponse>

JSON format

{
        "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
        "CommandId": "c-f4682204a89949979d75e76700e0****",
        "InstanceIds": {
            "InstanceId": [
                "i-uf68t1zu3jkhs8w****",
                "i-uf6abz34m2714bp****",
                "i-uf65bh2113hlqvyx****",
                "i-uf68t1zu3jkhs8wx****",
                "i-uf6b0mtpx166fxxi****",
                "i-uf6faknz4dy1bit7****"
            ]
        }
}

Error codes

HttpCode Error code Error message Description
503 ServiceUnavailable The request has failed due to a temporary failure of the server The error message returned because the request has failed. The server is temporarily unavailable.

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