You can view your custom Cloud Assistant commands or the public commands provided by Alibaba Cloud.
Operation description
API
-
To list all your manually created commands (
CommandId), provide only theActionandRegionIdrequest parameters. -
Use
MaxResultsto limit the number of items to return. If a response includes aNextToken, more results are available. To retrieve the next page, pass the value of thisNextTokenin your subsequent request.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeCommands |
get |
Command
Command
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The ID of the region. To view the latest list of regions, call the DescribeRegions operation. |
cn-hangzhou |
| RegionId |
string |
Yes |
The ID of the region. To view the latest list of regions, call the DescribeRegions operation. |
cn-hangzhou |
| Provider |
string |
No |
The provider of the public command.
|
AlibabaCloud |
| CommandId |
string |
No |
The ID of the command. |
c-hz01272yr52**** |
| Name |
string |
No |
The name of the command.
|
testName |
| Description |
string |
No |
The description of the command.
|
testDescription |
| Type |
string |
No |
The type of the command. Valid values:
|
RunShellScript |
| ContentEncoding |
string |
No |
The encoding format for the
Default value: Base64. |
PlainText |
| PageNumber |
integer |
No |
Note
This parameter is being deprecated. We recommend using NextToken and MaxResults for pagination instead. |
1 |
| PageSize |
integer |
No |
Note
This parameter is being deprecated. We recommend using NextToken and MaxResults for pagination instead. |
10 |
| MaxResults |
integer |
No |
The maximum number of entries to return per page. Maximum value: 50. Default value: 10. |
10 |
| NextToken |
string |
No |
The pagination token for the next page of results. To retrieve the next page, set this parameter to the |
AAAAAdDWBF2 |
| Latest |
boolean |
No |
Specifies whether to return only the latest version of public commands. This parameter does not affect private commands.
Default value: false. |
true |
| ResourceGroupId |
string |
No |
The ID of the resource group to which the command belongs. |
rg-123****** |
| Tag |
array<object> |
No |
The tags used to filter commands. |
|
|
object |
No |
A tag object. |
||
| Value |
string |
No |
The value of the tag. You can specify up to 20 tags. The tag value can be an empty string. The value can be up to 128 characters in length and cannot contain |
TestValue |
| Key |
string |
No |
The key of the tag. You can specify up to 20 tags. The tag key cannot be an empty string. A query can return a maximum of 1,000 resources that match the specified tags. If more than 1,000 resources match, call the ListTagResources operation to query all matching resources. The key can be up to 64 characters in length, cannot start with |
TestKey |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| PageSize |
integer |
The number of entries per page. |
10 |
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
| PageNumber |
integer |
The page number. |
1 |
| TotalCount |
integer |
The total number of commands. |
5 |
| NextToken |
string |
The pagination token that is used in the next request to retrieve a new page of results. If this parameter is not returned, all results have been retrieved. |
AAAAAdDWBF2 |
| Commands |
object |
||
| Command |
array<object> |
The details of the commands. |
|
|
array<object> |
The details of a command. |
||
| ParameterDefinitions |
object |
||
| ParameterDefinition |
array<object> |
The details of the custom parameters. |
|
|
array<object> |
The details of a custom parameter. |
||
| DefaultValue |
string |
The default value of the custom parameter. |
https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_latest.rpm |
| Description |
string |
The description of the custom parameter. |
云助手Agent安装包路径 |
| Required |
boolean |
Specifies whether the custom parameter is required.
Default value: false. |
true |
| ParameterName |
string |
The name of the custom parameter. |
DownloadUrl |
| PossibleValues |
object |
||
| PossibleValue |
array |
An array of valid values for the enumerated parameter. |
|
|
string |
A valid value for an enumerated custom parameter. |
"Linux","Windows" |
|
| PatternRegex |
string |
The regular expression that is used to validate the custom parameter. |
^[a-zA-Z0-9_-]{4,32}$ |
| Description |
string |
The description of the command. |
testDescription |
| Category |
string |
The category of the public command. |
“” |
| ResourceGroupId |
string |
The ID of the resource group to which the command belongs. |
rg-123****** |
| ParameterNames |
object |
||
| ParameterName |
array |
The names of the custom parameters that are parsed from the |
|
|
string |
The name of a custom parameter. |
['parameter1','parameter2'] |
|
| Timeout |
integer |
The timeout period for the command to run, in seconds. |
3600 |
| Provider |
string |
The provider of the public command. |
AlibabaCloud.ECS.GuestOS |
| Name |
string |
The name of the command. |
testName |
| WorkingDir |
string |
The working directory of the command. |
/home/ |
| CommandContent |
string |
The content of the command. The content is Base64-encoded.
|
Y2QgL3Jvb3Q= |
| Type |
string |
The type of the command. |
RunShellScript |
| Version |
integer |
The version of the public command. Public commands that have the same |
1 |
| InvokeTimes |
integer |
The number of times the command has been invoked. |
2 |
| CreationTime |
string |
The time at which the command was created. |
2020-11-17T06:52Z |
| Launcher |
string |
The launcher of the script. The value cannot exceed 1 KB in size. |
python3 -u {{ACS::ScriptFileName|Ext(".py")}} |
| Latest |
boolean |
Indicates whether the command is the latest version. Public commands that have the same |
true |
| EnableParameter |
boolean |
Indicates whether custom parameters are enabled for the command. |
true |
| CommandId |
string |
The command ID. |
c-hz01272yr52**** |
| Tags |
object |
||
| Tag |
array<object> |
The tags attached to the command. |
|
|
object |
A tag that is attached to the command. |
||
| TagKey |
string |
The tag key of the command. |
owner |
| TagValue |
string |
The tag value of the command. |
zhangsan |
Examples
Success response
JSON format
{
"PageSize": 10,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
"PageNumber": 1,
"TotalCount": 5,
"NextToken": "AAAAAdDWBF2",
"Commands": {
"Command": [
{
"ParameterDefinitions": {
"ParameterDefinition": [
{
"DefaultValue": "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_latest.rpm",
"Description": "云助手Agent安装包路径",
"Required": true,
"ParameterName": "DownloadUrl",
"PossibleValues": {
"PossibleValue": [
"\"Linux\",\"Windows\""
]
},
"PatternRegex": "^[a-zA-Z0-9_-]{4,32}$\u0000"
}
]
},
"Description": "testDescription",
"Category": "“”",
"ResourceGroupId": "rg-123******",
"ParameterNames": {
"ParameterName": [
"['parameter1','parameter2']"
]
},
"Timeout": 3600,
"Provider": "AlibabaCloud.ECS.GuestOS",
"Name": "testName",
"WorkingDir": "/home/",
"CommandContent": "Y2QgL3Jvb3Q=",
"Type": "RunShellScript",
"Version": 1,
"InvokeTimes": 2,
"CreationTime": "2020-11-17T06:52Z",
"Launcher": "python3 -u {{ACS::ScriptFileName|Ext(\".py\")}}\n",
"Latest": true,
"EnableParameter": true,
"CommandId": "c-hz01272yr52****",
"Tags": {
"Tag": [
{
"TagKey": "owner",
"TagValue": "zhangsan"
}
]
}
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | RegionId.ApiNotSupported | The api is not supported in this region. | The API operation cannot be called in the specified region. Check whether the specified RegionId parameter is valid. |
| 400 | NumberExceed.Tags | The Tags parameter number is exceed. | The number of tags exceeds the maximum limit. |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | The specified tag key already exists. Tag keys must be unique. |
| 400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | The specified Tag.N.Key parameter is invalid. |
| 400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | The specified tag value is invalid. |
| 400 | MissingParameter.TagKey | You must specify Tag.N.Key. | The tag key is not specified. |
| 400 | InvalidParam.PageNumber | The specified parameter is invalid. | |
| 400 | InvalidParam.PageSize | The specified parameter is invalid. | |
| 400 | InvalidParameter.NextToken | The specified parameter NextToken is not valid. | The specified parameter NextToken is illegal. |
| 400 | InvalidParameter.MaxResults | The specified parameter MaxResults is not valid. | The specified parameter MaxResults is illegal. |
| 500 | InternalError.Dispatch | An error occurred when you dispatched the request. | An error occurred while the request is being sent. Try again later. |
| 500 | ServiceUnavailable | The request has failed due to a temporary failure of the server. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | Operation.Forbidden | The operation is not permitted. | The operation is not supported. |
| 403 | InvalidName.LengthLimitExceeded | The length of the parameter Name exceeds the upper limit. | |
| 403 | InvalidDescription.LengthLimitExceeded | The length of the parameter Description exceeds the upper limit. | |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | Region information error |
| 404 | InvalidCommandType.NotFound | The specified parameter Type does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.