Runs commands on a simple application server.
Operation description
Command Assistant is an automated O&M tool that lets you run shell, PowerShell, and batch commands on simple application servers from the console, without logging on to the servers.
Before you use Command Assistant:
-
The simple application server must be in the Running state.
-
The Cloud Assistant client is installed on the server. The client is pre-installed by default. If you manually uninstalled it, reinstall it. For more information, see Install the Cloud Assistant Agent.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
swas-open:RunCommand |
create |
*Command
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| CommandContent |
string |
Yes |
The content of the command.
|
ifconfig -s |
| WorkingDir |
string |
No |
The execution path of the command. You can specify a custom path. Default paths vary by operating system:
|
/home/ |
| RegionId |
string |
Yes |
The region ID of the simple application server. You can call the ListRegions operation to query the most recent region list. |
cn-hangzhou |
| Timeout |
integer |
No |
The timeout period of the command on the server. If a command times out, Command Assistant forcibly terminates the process. Valid values: 10 to 86400. Unit: seconds (86400 seconds = 24 hours). Default value: 60. |
60 |
| Type |
string |
Yes |
The language type of the command. Valid values:
|
RunShellScript |
| EnableParameter |
boolean |
No |
Whether to enable the custom parameter feature. Default value: false. |
false |
| Parameters |
object |
No |
The custom parameters in key-value pair format to pass when the command includes custom parameters. For example, if the command content is You can specify up to 20 custom parameters:
Defaults to empty, which disables the custom parameter feature. |
{"name":"Jack", "accessKey":"LTAI****************"} |
| WorkingUser |
string |
No |
The user who runs the command on the server. To reduce security risks, consider running commands as a regular user. Default values:
|
root |
| WindowsPasswordName |
string |
No |
The name of the password used to run the command on a Windows simple application server. To run commands on a Windows server as a user other than the default system user, specify both WindowsPasswordName and WorkingUser. The password is stored in plaintext in the CloudOps Orchestration Service (OOS) parameter repository to reduce the risk of password leaks. Only the password name is passed through WindowsPasswordName. |
axtSecretPassword |
| InstanceId |
string |
Yes |
The ID of the simple application server. |
ace0706b2ac4454d984295a94213**** |
| Name |
string |
Yes |
The name of the command. |
testName |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
| InvokeId |
string |
The execution ID. |
t-hz02p9545t6**** |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
"InvokeId": "t-hz02p9545t6****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.