Runs a Shell script on one or more Lingjun nodes.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| eflo:RunCommand | update | Node acs:eflo:{#regionId}:{#accountId}:node/{#NodeId}Command acs:ecs:{#regionId}:{#accountId}:command/{#CommandId} |
| 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. Take note of the following:
| ZWNobyAxMjM= |
| Timeout | integer | No | The timeout period for the command. Unit: seconds. A timeout error occurs if the command cannot be run because the process slows down or because a specific module or Cloud Assistant Agent does not exist. When the specified timeout period ends, the command process is forcefully terminated. Default value: 60. | 3600 |
| WorkingDir | string | No | The working path of the command. You can specify a custom path. Default path: Linux instances: By default, the path is in the /home directory of the root user. | /home/user |
| EnableParameter | boolean | No | Specifies 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 the specified value of this parameter is invalid, PlainText is used by default. | Base64 |
| Username | string | No | The username that you use 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 to ensure the idempotency of the request. Use your client to generate the token that is unique among 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 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, the command content is You can specify 0 to 10 custom parameters. Take note of the following:
This parameter is left empty by default, which indicates that the custom parameter feature is disabled. | {"name":"Jack", "accessKey":"LTAIdyvdIqaRY****"} |
| CommandId | string | No | The ID of the command. | c-e996287206324975b5fbe1d*** |
| TerminationMode | string | No | Indicates how the command task is stopped when a command execution is manually stopped or times out. Valid values: Process: The process of the command is stopped. ProcessTree: The process tree of the command is stopped. In this case, the process of the command and all subprocesses are stopped. | ProcessTree |
| Launcher | string | No | The launcher for script execution. Cannot exceed 1 KB. | python3 -u {{ACS::ScriptFileName|Ext(".py")}} |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "2FE2B22C-CF9D-59DE-BF63-DC9B9B33A9D1",
"InvokeId": "t-7d2a745b412b4601b2d47f6a768d*"
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2025-01-02 | The request parameters of the API has changed | View Change Details |
