Queries Cloud Assistant commands that you manually created or public commands provided by Alibaba Cloud.
Operation description
Operation description
-
If you specify only the
ActionandRegionIdparameters without specifying other request parameters, all active commands (CommandId) that you manually created are queried by default. -
When querying the first page of results with a paged query, set only
MaxResultsto limit the number of entries returned. TheNextTokenvalue in the response serves as the token for querying subsequent pages. When querying subsequent pages, set theNextTokenparameter to theNextTokenvalue obtained from the previous response as the query token, and setMaxResultsto limit the number of entries returned.
Settings: When performing paging, use NextToken and MaxResults for optimal results.
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. Valid values:
|
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
Default value: Base64. |
PlainText |
| PageNumber |
integer |
No |
Note
This parameter is about to go offline. Use NextToken and MaxResults to complete paged query operations. For paging, use NextToken and MaxResults instead. |
1 |
| PageSize |
integer |
No |
Note
This parameter is about to go offline. Use NextToken and MaxResults to complete paged query operations. For paging, use NextToken and MaxResults instead. |
10 |
| MaxResults |
integer |
No |
The maximum number of entries per page for a paged query. 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. |
||
| 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 |
| 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, use the ListTagResources operation to query resources. The tag key can be up to 64 characters in length and 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 of the command list. |
1 |
| TotalCount |
integer |
The total number of commands. |
5 |
| NextToken |
string |
The pagination token returned in this call. |
AAAAAdDWBF2 |
| Commands |
object |
||
| Command |
array<object> |
The command dataset. |
|
|
array<object> |
The command object. |
||
| 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 |
| Required |
boolean |
Indicates whether the custom parameter is required.
Default value: false. |
true |
| ParameterName |
string |
The name of the custom parameter. |
DownloadUrl |
| PossibleValues |
object |
||
| PossibleValue |
array |
The list of possible values for the enumeration-type custom parameter. |
|
|
string |
The possible value for the enumeration-type custom parameter. |
"Linux","Windows" |
|
| PatternRegex |
string |
The regular expression rule for 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 list of custom parameter names parsed from the CommandContent when the command was created, returned as a list. If the custom parameter feature is not used, an empty list is returned. |
|
|
string |
The custom parameter name. |
['parameter1','parameter2'] |
|
| Timeout |
integer |
The timeout period. Unit: seconds. |
3600 |
| Provider |
string |
The provider of the public command. |
AlibabaCloud.ECS.GuestOS |
| Name |
string |
The name of the command. |
testName |
| WorkingDir |
string |
The execution path. |
/home/ |
| CommandContent |
string |
The command content, transmitted in Base64 encoding.
|
Y2QgL3Jvb3Q= |
| Type |
string |
The type of the command. |
RunShellScript |
| Version |
integer |
The version of the public command. If multiple commands belong to the same |
1 |
| InvokeTimes |
integer |
The number of tasks created by using this command. |
2 |
| CreationTime |
string |
The time when the command was created. |
2020-11-17T06:52Z |
| Launcher |
string |
The launcher for script execution. The launcher cannot exceed 1 KB in length. |
python3 -u {{ACS::ScriptFileName|Ext(".py")}} |
| Latest |
boolean |
Indicates whether the public command is the latest version. If multiple commands belong to the same |
true |
| EnableParameter |
boolean |
Indicates whether the custom parameter feature is enabled for the command. |
true |
| CommandId |
string |
The command ID. |
c-hz01272yr52**** |
| Tags |
object |
||
| Tag |
array<object> |
The list of tags for 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 |
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": "Cloud Assistant Agent installation package path",
"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. | |
| 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.