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. You can call ListRegions to query available regions. |
cn-hangzhou |
| Name |
string |
Yes |
The name of the command. All characters are supported. The name cannot exceed 128 characters in length. |
testName |
| Description |
string |
No |
The description of the command. All characters are supported. The description cannot exceed 512 characters in length. |
test |
| Type |
string |
Yes |
The language type of the command. Valid values:
|
RunShellScript |
| CommandContent |
string |
Yes |
The content of the command. Take note of the following items:
|
ifconfig -s |
| WorkingDir |
string |
No |
The directory in which the created command is run on the ECS instance. Default value:
|
/root/ |
| Timeout |
integer |
No |
The timeout period for running the command on the instance, in seconds. If the task that runs the command times out, Cloud Assistant forcibly terminates the task process. Valid values: 10 to 86400 (24 hours). Default value: 60. |
60 |
| EnableParameter |
boolean |
No |
Specifies whether the created command uses custom parameters. Default value: false. |
false |
| Tag |
array<object> |
No |
The list of tags. You can specify up to 20 tags. |
|
|
object |
No |
The tag. |
||
| Key |
string |
No |
The key of tag N that is added to the command. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 64 characters in length, and cannot start with aliyun or acs:, or contain http:// or https://. |
TestKey |
| Value |
string |
No |
The value of tag N that is added to the command. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value 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.