RunCommand
Runs a Shell script on one or more Lingjun nodes.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
eflo:RunCommand |
update |
Node
Command
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
No |
The command name. |
testName |
| Description |
string |
No |
The command description. |
testDescription |
| CommandContent |
string |
No |
The command content. Note the following items:
|
ZWNobyAxMjM= |
| Timeout |
integer |
No |
The timeout period for the command. Unit: seconds. A timeout error occurs when the command cannot run because the process slows down or a specific module or Cloud Assistant Agent does not exist. When the timeout period ends, the command process is forcefully terminated. Default value: 60. |
3600 |
| WorkingDir |
string |
No |
The working directory of the command. Default path: Linux instances: By default, the path is in the /home directory of the root user. |
/home/user |
| EnableParameter |
boolean |
No |
Whether to use custom parameters in the command. Default value: false. |
false |
| ContentEncoding |
string |
No |
The encoding mode of the command content. Valid values:
Default value: PlainText. If an invalid value is specified, PlainText is used by default. |
Base64 |
| Username |
string |
No |
The username to run the command. The name can be up to 255 characters in length. For Linux instances, the root user is used by default. |
root |
| NodeIdList |
array |
No |
The node list. |
|
|
string |
No |
The node ID. |
"i-bp185dy2o3o6neg****" |
|
| RepeatMode |
string |
No |
The mode to run the command. Valid values:
Default value:
|
Once |
| ClientToken |
string |
No |
The client token that ensures idempotency of the request. Generate a unique token from your client. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see "How to ensure idempotence". |
123e4567-e89b-12d3-a456-426655440000 |
| Frequency |
string |
No |
The schedule to run the command. Supported schedule types: at a fixed interval based on a rate expression, run only once at a specific time, or run at specific times based on a cron expression.
|
0 */20 * * * ? |
| Parameters |
object |
No |
The key-value pairs of custom parameters to pass in when the command includes custom parameters. For example, if the command content is You can specify 0 to 10 custom parameters. Note the following items:
This parameter is empty by default, which means the custom parameter feature is disabled. |
{"name":"Jack", "accessKey":"LTAIdyvdIqaRY****"} |
| CommandId |
string |
No |
The ID of the command. |
c-e996287206324975b5fbe1d*** |
| TerminationMode |
string |
No |
How the command task is stopped when a command execution is manually stopped or times out. Valid values: Process: stops the command process. ProcessTree: stops the process tree of the command, including the command process and all subprocesses. |
ProcessTree |
| Launcher |
string |
No |
The launcher for script execution. Must not exceed 1 KB in size. |
python3 -u {{ACS::ScriptFileName|Ext(".py")}} |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
2FE2B22C-CF9D-59DE-BF63-DC9B9B33A9D1 |
| InvokeId |
string |
The ID of the execution. |
t-7d2a745b412b4601b2d47f6a768d* |
Examples
Success response
JSON format
{
"RequestId": "2FE2B22C-CF9D-59DE-BF63-DC9B9B33A9D1",
"InvokeId": "t-7d2a745b412b4601b2d47f6a768d*"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.