Runs interactive commands in a cluster node.

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.

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

Command String Yes echo "hello world"

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

Instance.N.Id String No i-bp1in9hmw3ur52x0****

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

Note The Instance.N.Id parameter specifies the node on which the command is run. If it is not specified, the command is 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 is terminated. Unit: seconds.

Default value: 60

Response parameters

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

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

InstanceIds List [ "i-uf68t1zu3jkhs8w****", "i-uf6abz34m2714bp****", "i-uf65bh2113hlqvyx****", "i-uf68t1zu3jkhs8wx****", "i-uf6b0mtpx166fxxi****", "i-uf6faknz4dy1bit7****" ]

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-hz01v8vudql****</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-hz01v8vudql****",
        "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 service is temporarily unavailable.

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