Execute interactive commands on a specified node in a cluster.


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.


Sample requests

&Command=echo "hello world"
&<Common request parameters>

Sample success responses

XML format


JSON format

        "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368",
        "CommandId": "c-f4682204a89949979d75e76700e0****",
        "InstanceIds": {
            "InstanceId": [

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.