Queries the Cloud Assistant commands that you created or the common Cloud Assistant commands that Alibaba Cloud provides.
Operation description
If you specify only the Action
and RegionId
parameters, all the available commands (CommandId
) that you created in the specified region are queried by default.
You can use one of the following methods to check the responses:
-
Method 1: During a paged query, when you call the DescribeCommands operation to retrieve the first page of results, set MaxResults to specify the maximum number of entries to return in the call. The return value of NextToken is a pagination token, which can be used in the next request to retrieve a new page of results. When you call the DescribeCommands operation to retrieve a new page of results, set NextToken to the NextToken value returned in the previous call and set MaxResults to specify the maximum number of entries to return in this call.
-
Method 2: Use PageSize to specify the number of entries to return on each page and then use PageNumber to specify the number of the page to return. You can use only one of the preceding methods. If you specify MaxResults or NextToken, the PageSize and PageNumber request parameters do not take effect and the TotalCount response parameter is invalid.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the command. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
Provider | string | No | The provider of the common command. Take note of the following items:
| AlibabaCloud |
CommandId | string | No | The ID of the command. | c-hz01272yr52**** |
Name | string | No | The name of the command. If you specify | testName |
Description | string | No | The description of the common command. This parameter takes effect and fuzzy search is supported by default only when | 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 | long | No | The page number. Pages start from page 1. Default value: 1. | 1 |
PageSize | long | No | The number of entries per page. Valid values: 1 to 50. Default value: 10. | 10 |
MaxResults | integer | No | The maximum number of entries per page. Valid values: 1 to 50. Default value: 10. | 10 |
NextToken | string | No | The pagination token that is used in the next request to retrieve a new page of results. You must specify the token that is obtained from the previous query as the value of NextToken. | AAAAAdDWBF2 |
Latest | boolean | No | Specifies whether to query only the latest version of common commands when common commands are queried. This parameter does not affect the query for private commands.
Default value: false. | true |
ResourceGroupId | string | No | The ID of the resource group to which the command belongs. | rg-123****** |
Tag | object [] | No | The list of tags. | |
Key | string | No | The key of tag N of the command. Valid values of N: 1 to 20. The tag key cannot be an empty string. If a single tag is specified to query resources, up to 1,000 resources that have this tag added can be displayed in the response. If multiple tags are specified to query resources, up to 1,000 resources that have all these tags added can be displayed in the response. To query more than 1,000 resources that have specified tags, call the ListTagResources operation. The tag key can be up to 64 characters in length and cannot start with | TestKey |
Value | string | No | The value of tag N of the command. Valid values of N: 1 to 20. The tag value can be an empty string. It can be up to 128 characters in length and cannot contain | TestValue |
Response parameters
Examples
Sample success responses
JSON
format
{
"PageSize": 10,
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
"PageNumber": 1,
"TotalCount": 5,
"NextToken": "AAAAAdDWBF2",
"Commands": {
"Command": [
{
"CreationTime": "2020-11-17T06:52Z",
"Type": "RunShellScript",
"Timeout": 3600,
"InvokeTimes": 2,
"CommandId": "c-hz01272yr52****",
"WorkingDir": "/home/",
"Description": "testDescription",
"Version": 1,
"Provider": "AlibabaCloud.ECS.GuestOS",
"CommandContent": "Y2QgL3Jvb3Q=",
"Category": "“”",
"Latest": true,
"Name": "testName",
"EnableParameter": true,
"ResourceGroupId": "rg-123******",
"ParameterNames": {
"ParameterName": [
"['parameter1','parameter2']"
]
},
"ParameterDefinitions": {
"ParameterDefinition": [
{
"Required": true,
"Description": "Download path of the Cloud Assistant Agent installation package.",
"DefaultValue": "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_latest.rpm",
"ParameterName": "DownloadUrl",
"PossibleValues": {
"PossibleValue": [
"\"Linux\",\"Windows\""
]
}
}
]
},
"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. | The specified PageNumber parameter is invalid. |
400 | InvalidParam.PageSize | The specified parameter is invalid. | The specified PageSize 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. |
403 | Operation.Forbidden | The operation is not permitted. | The operation is not supported. |
404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | The RegionId provided does not exist |
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. | An internal error has occurred. Try again later. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2023-12-21 | The Error code has changed. The request parameters of the API has changed. The response structure of the API has changed | see changesets | ||||||||||||||||||
| ||||||||||||||||||||
2023-10-24 | The Error code has changed. The request parameters of the API has changed. The response structure of the API has changed | see changesets | ||||||||||||||||||
| ||||||||||||||||||||
2023-05-12 | The Error code has changed | see changesets | ||||||||||||||||||
| ||||||||||||||||||||
2022-02-25 | The Error code has changed | see changesets | ||||||||||||||||||
|