Queries Cloud Assistant commands that you manually created or public commands provided by Alibaba Cloud.
Operation description
Operation description
-
If you specify only the Action and RegionId parameters without other request parameters, all available commands (
CommandId) that you manually created are queried by default. -
When paged query the first page of results, set only MaxResults to limit the number of entries to return. The NextToken value returned in the response serves as the token for querying subsequent pages. When paged query subsequent pages, set NextToken to the value obtained from the previous response and set MaxResults to limit the number of entries to return.
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 region ID. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| Provider |
string |
No |
The provider of the public command. The following list describes the valid values of this parameter:
|
AlibabaCloud |
| CommandId |
string |
No |
The command ID. |
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 mode of the CommandContent and Output fields in the response. Valid values:
Default value: Base64. |
PlainText |
| PageNumber |
integer |
No |
Note
This parameter is about to be deprecated. Use NextToken and MaxResults to perform paging operations. |
1 |
| PageSize |
integer |
No |
Note
This parameter is about to be deprecated. Use NextToken and MaxResults to perform paging operations. |
10 |
| MaxResults |
integer |
No |
The maximum number of entries per page for paging. Maximum value: 50. Default value: 10. |
10 |
| NextToken |
string |
No |
The pagination token. Set this parameter to the NextToken value returned in the previous API call. |
AAAAAdDWBF2 |
| Latest |
boolean |
No |
Specifies whether to query only the latest version of public commands when the query results include public commands. This parameter does not affect the query of 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. |
|
|
object |
No |
The tag object. |
||
| Key |
string |
No |
The tag key of the command. Valid values of N: 1 to 20. The tag key cannot be an empty string. If you use a single tag to filter resources, the resource count with this tag cannot exceed 1,000. If you use multiple tags to filter resources, the resource count with all specified tags attached cannot exceed 1,000. If the resource count exceeds 1,000, call the ListTagResources operation to query the resources. The tag key can be up to 64 characters in length and cannot start with |
TestKey |
| Value |
string |
No |
The tag value of the command. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot contain |
TestValue |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Commands |
object |
||
| Command |
array<object> |
The command dataset. |
|
|
array<object> |
The command object. |
||
| Category |
string |
The category of the public command. |
“” |
| CommandContent |
string |
The command content, transmitted in Base64 encoding.
|
Y2QgL3Jvb3Q= |
| CommandId |
string |
The command ID. |
c-hz01272yr52**** |
| CreationTime |
string |
The time when the command was created. The time follows the ISO 8601 standard in the UTC time zone. |
2020-11-17T06:52Z |
| Description |
string |
The description of the command. |
testDescription |
| EnableParameter |
boolean |
Indicates whether custom parameters are enabled for the command. |
true |
| InvokeTimes |
integer |
The number of tasks created by using the command. |
2 |
| Latest |
boolean |
Indicates whether the public command is the latest version. If multiple commands belong to the same |
true |
| Launcher |
string |
The bootstrap program for script execution. The value cannot exceed 1 KB in length. |
python3 -u {{ACS::ScriptFileName|Ext(".py")}} |
| Name |
string |
The name of the command. |
testName |
| ParameterDefinitions |
object |
||
| ParameterDefinition |
array<object> |
The list of custom parameter details. |
|
|
array<object> |
The custom parameter object. |
||
| 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. |
Cloud Assistant Agent installation package path |
| ParameterName |
string |
The name of the custom parameter. |
DownloadUrl |
| PatternRegex |
string |
The regular expression rule for the custom parameter. |
^[a-zA-Z0-9_-]{4,32}$ |
| PossibleValues |
object |
||
| PossibleValue |
array |
The list of possible values for the enumeration-type custom parameter. |
|
|
string |
The possible value of the enumeration-type custom parameter. |
"Linux","Windows" |
|
| Required |
boolean |
Indicates whether the custom parameter is required.
Default value: false. |
true |
| ParameterNames |
object |
||
| ParameterName |
array |
The list of custom parameter names parsed from the CommandContent when the command was created. The value is returned as a list. If the custom parameter feature is not used, an empty list is returned. |
|
|
string |
The name of the custom parameter. |
['parameter1','parameter2'] |
|
| Provider |
string |
The provider of the public command. |
AlibabaCloud.ECS.GuestOS |
| ResourceGroupId |
string |
The ID of the resource group to which the command belongs. |
rg-123****** |
| Tags |
object |
||
| Tag |
array<object> |
The list of tags of the command. |
|
|
object |
The tag information object of the command. |
||
| TagKey |
string |
The tag key of the command. |
owner |
| TagValue |
string |
The tag value of the command. |
zhangsan |
| Timeout |
integer |
The timeout period. Unit: seconds. |
3600 |
| Type |
string |
The type of the command. |
RunShellScript |
| Version |
integer |
The version of the public command. If multiple commands belong to the same |
1 |
| WorkingDir |
string |
The execution path. |
/home/ |
| NextToken |
string |
The pagination token returned in this call. |
AAAAAdDWBF2 |
| PageNumber |
integer |
The page number of the command list. |
1 |
| PageSize |
integer |
The number of entries per page. |
10 |
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
| TotalCount |
integer |
The total number of commands. |
5 |
Examples
Success response
JSON format
{
"Commands": {
"Command": [
{
"Category": "“”",
"CommandContent": "Y2QgL3Jvb3Q=",
"CommandId": "c-hz01272yr52****",
"CreationTime": "2020-11-17T06:52Z",
"Description": "testDescription",
"EnableParameter": true,
"InvokeTimes": 2,
"Latest": true,
"Launcher": "python3 -u {{ACS::ScriptFileName|Ext(\".py\")}}\n",
"Name": "testName",
"ParameterDefinitions": {
"ParameterDefinition": [
{
"DefaultValue": "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_latest.rpm",
"Description": "Cloud Assistant Agent installation package path",
"ParameterName": "DownloadUrl",
"PatternRegex": "^[a-zA-Z0-9_-]{4,32}$\u0000",
"PossibleValues": {
"PossibleValue": [
"\"Linux\",\"Windows\""
]
},
"Required": true
}
]
},
"ParameterNames": {
"ParameterName": [
"['parameter1','parameter2']"
]
},
"Provider": "AlibabaCloud.ECS.GuestOS",
"ResourceGroupId": "rg-123******",
"Tags": {
"Tag": [
{
"TagKey": "owner",
"TagValue": "zhangsan"
}
]
},
"Timeout": 3600,
"Type": "RunShellScript",
"Version": 1,
"WorkingDir": "/home/"
}
]
},
"NextToken": "AAAAAdDWBF2",
"PageNumber": 1,
"PageSize": 10,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
"TotalCount": 5
}
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 | InvalidParameterCharacter | The specified parameter %s contains illegal characters. | |
| 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. | |
| 404 | InvalidCommandId.NotFound | The specified commandId does not exist |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.