Creates a Cloud Assistant command.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
swas-open:CreateCommand |
create |
*Command
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. Call ListRegions to query the available regions. |
cn-hangzhou |
| Name |
string |
Yes |
The name of the command. All character sets are supported. The name can be up to 128 characters long. |
testName |
| Description |
string |
No |
The description of the command. All character sets are supported. The description can be up to 512 characters long. |
test |
| Type |
string |
Yes |
The language type of the command. Valid values:
|
RunShellScript |
| CommandContent |
string |
Yes |
The content of the command. Note the following:
|
ifconfig -s |
| WorkingDir |
string |
No |
The directory where the command is run on the ECS instance. Default values:
|
/root/ |
| Timeout |
integer |
No |
The timeout period for the command to run on the server instance, in seconds. When a command task times out, Cloud Assistant forcibly stops the task process. The timeout period must be between 10 and 86,400 seconds (24 hours). Default value: 60. |
60 |
| EnableParameter |
boolean |
No |
Specifies whether to use custom parameters in the command. Default value: false. |
false |
| Tag |
array<object> |
No |
The tags. You can add up to 20 tags. |
|
|
object |
No |
The tag. |
||
| Key |
string |
No |
The key of tag N to add to the command. Valid values of N: 1 to 20. The tag key cannot be an empty string. It can be up to 64 characters in length and cannot start with `aliyun` or `acs:`. It cannot contain `http://` or `https://`. |
TestKey |
| Value |
string |
No |
The value of tag N to add to the command. Valid values of N: 1 to 20. The tag value can be an empty string. It can be up to 64 characters in length and cannot contain `http://` or `https://`. |
TestValue |
| ResourceGroupId |
string |
No |
The ID of the resource group. |
rg-aek2bti7cf7**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response. |
||
| RequestId |
string |
The request ID. |
20758A-585D-4A41-A9B2-28DA8F4**** |
| CommandId |
string |
The command ID. |
c-sh02yh0932w**** |
Examples
Success response
JSON format
{
"RequestId": "20758A-585D-4A41-A9B2-28DA8F4****",
"CommandId": "c-sh02yh0932w****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.