Runs commands on a simple application server.
Operation description
Command Assistant is an automated O&M tool for Simple Application Server. You can maintain simple application servers by running shell, PowerShell, and batch commands in the Simple Application Server console without remotely logging on to the servers.
Before you use Command Assistant, take note of the following items:
- The simple application server must be in the Running state.
- The Cloud Assistant client is installed on the server. By default, the Cloud Assistant client is installed on simple application servers. If you have manually uninstalled the client, you must reinstall it. For more information, see Install the Cloud Assistant Agent.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
CommandContent | string | Yes | The content of the command. Take note of the following items:
| ifconfig -s |
WorkingDir | string | No | The execution path of the command. Custom paths are supported. Default execution paths vary based on the operating systems of the servers.
| /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 execution task times out, Command Assistant forcibly terminates the task process. Valid values: 10 to 86400. Unit: seconds. The period of 86400 seconds is equal to 24 hours. Default value: 60. | 60 |
Type | string | Yes | The language type of the command. Valid values:
| RunShellScript |
EnableParameter | boolean | No | Specifies whether to enable the custom parameter feature. Default value: false. | false |
Parameters | object | No | The custom parameters in the key-value pair format that are to be passed in when the command includes custom parameters. For example, if the command content is Number of custom parameters ranges from 0 to 20. Take note of the following items:
This parameter is empty by default, which indicates to disable the custom parameter feature. | {"name":"Jack", "accessKey":"LTAIdyvdIqaRY****"} |
WorkingUser | string | No | A user of the server who runs the command. We recommend that you run the command as a regular user to reduce security risks. Default values:
| root |
WindowsPasswordName | string | No | The name of the password to be used to run the command on a Windows server. If you want to use a username other than the default "system" username to run the command on a Windows server, you must specify both the WindowsPasswordName and WorkingUser parameters. To mitigate the risk of password leaks, the password is stored in plaintext in Operation Orchestration Service (OOS) Parameter Store, and only the name of the password is passed in by using WindowsPasswordName. | axtSecretPassword |
InstanceId | string | Yes | The ID of the simple application server. | ace0706b2ac4454d984295a94213**** |
Name | string | Yes | The name of the command. | testName |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
"InvokeId": "t-hz02p9545t6****"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|