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
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:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is 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 |
---|---|---|---|---|
swas-open:RunCommand | create |
|
| none |
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 |
---|