RunCommand
Executes 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 name of the command. |
testName |
| Description |
string |
No |
The description of the command. |
testDescription |
| CommandContent |
string |
No |
The content of the command. Take note of the following items:
|
ZWNobyAxMjM= |
| Timeout |
integer |
No |
The timeout period for executing the command, in seconds. A timeout occurs when the command cannot be executed due to process issues, missing modules, or missing Cloud Assistant Agent. After a timeout, the command process is forcibly terminated. Default value: 60. |
3600 |
| WorkingDir |
string |
No |
You can customize the execution path of the command. Default paths: Linux instances: The default execution path is the |
/home/user |
| EnableParameter |
boolean |
No |
Specifies whether the command contains custom parameters. Default value: false. |
false |
| ContentEncoding |
string |
No |
The encoding format of the script content. Valid values:
Default value: PlainText. If you specify an invalid value, the value is processed as PlainText. |
Base64 |
| Username |
string |
No |
The name of the user that executes the command on the instance. The name cannot exceed 255 characters in length. For Linux instances, the default user is root. |
root |
| NodeIdList |
array |
No |
The list of nodes. Array length: 1 to 100. The node IDs must belong to created Lingjun nodes. You can call the ListClusterNodes or ListFreeNodes operation to query the node IDs. |
|
|
string |
No |
The node ID. |
e01-cn-zvp2tgykr08 |
|
| RepeatMode |
string |
No |
The execution mode of the command. Valid values:
Default value:
|
Once |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that the value is unique among different requests. 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 for executing the command. Three scheduling methods are supported: execution at fixed intervals (based on Rate expressions), one-time execution at a specified time, and clock-based scheduled execution (based on Cron expressions).
|
0 */20 * * * ? |
| Parameters |
object |
No |
The key-value pairs of custom parameters that are passed when the command is executed, if the command contains custom parameters. For example, if the command content is You can specify 0 to 10 custom parameters. Take note of the following items:
Default value: empty. An empty value indicates that this parameter is not specified and custom parameters are disabled. |
{"name":"Jack", "accessKey":"LTAI***********"} |
| CommandId |
string |
No |
The ID of the command. |
c-e996287206324975b5fbe1d*** |
| TerminationMode |
string |
No |
The mode used when the task is stopped manually or interrupted due to an execution timeout. Valid values: Process: Stops the current script process. ProcessTree: Stops the current process tree, which is the collection of the script process and all child processes created by it. |
ProcessTree |
| Launcher |
string |
No |
The launcher for script execution. The size cannot exceed 1 KB. |
python3 -u {{ACS::ScriptFileName|Ext(".py")}} |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
Id of the request |
2FE2B22C-CF9D-59DE-BF63-DC9B9B33A9D1 |
| InvokeId |
string |
The invocation ID. |
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.