Queries the Cloud Assistant commands that you created or the public Cloud Assistant commands that Alibaba Cloud provides.
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.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeCommands |
The operation that you want to perform. Set the value to DescribeCommands. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the command. You can call the DescribeRegions operation to query the most recent region list. |
Provider | String | No | AlibabaCloud |
The provider of the public command.
|
CommandId | String | No | c-hz01272yr52**** |
The ID of the command. |
Name | String | No | testName |
The name of the command. Partial command names are not supported. |
Description | String | No | testDescription |
The description of the command. |
Type | String | No | RunShellScript |
The command type. Valid values:
|
ContentEncoding | String | No | PlainText |
The encoding mode of the
Default value: Base64. |
PageNumber | Long | No | 1 |
The number of the page to return. Pages start from page 1. Default value: 1. |
PageSize | Long | No | 10 |
The number of entries to return on each page. Maximum value: 50. Default value: 10. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
PageSize | Long | 10 |
The number of entries returned per page. |
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
The ID of the request. |
PageNumber | Long | 1 |
The page number of the returned page. |
TotalCount | Long | 5 |
The total number of commands. |
Commands | Array of Command |
Details about the commands. |
|
Command | |||
CreationTime | String | 2020-11-17T06:52Z |
The time when the command was created. |
Type | String | RunShellScript |
The command type. |
Timeout | Long | 3600 |
The timeout period. |
InvokeTimes | Integer | 2 |
The number of tasks created by using the command. |
CommandId | String | c-hz01272yr52**** |
The ID of the command. |
WorkingDir | String | /home/ |
The working directory of the command. |
Description | String | testDescription |
The description of the command. |
Version | Integer | 1 |
The version of the public command. If multiple public commands from the same provider
( |
Provider | String | AlibabaCloud.ECS.GuestOS |
The provider of the public command. |
CommandContent | String | Y2QgL3Jvb3Q= |
The Base64-encoded command content. |
Category | String | Alibaba Cloud-ECS-instance system |
The category of the public command. |
Latest | Boolean | true |
Indicates whether the public command is of the latest version. If multiple public
commands from the same provider ( |
Name | String | testName |
The name of the command. |
EnableParameter | Boolean | true |
Indicates whether the custom parameter feature was enabled for the command. |
ParameterNames | Array of String | ['parameter1','parameter2'] |
A list of custom parameter names that are parsed from the command content specified when the command was being created. If the custom parameter feature is not enabled, an empty list is returned. |
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=DescribeCommands
&RegionId=cn-hangzhou
&CommandId=c-hz01272yr52****
&PageNumber=1
&PageSize=10
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeCommandsResponse>
<TotalCount>1</TotalCount>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
<PageSize>10</PageSize>
<PageNumber>1</PageNumber>
<Commands>
<Command>
<Category/>
<Description>test1</Description>
<ParameterNames></ParameterNames>
<Timeout>3600</Timeout>
<Name>testName</Name>
<Provider/>
<CommandContent>Y2QgL3Jvb3Q=</CommandContent>
<WorkingDir/>
<Type>RunShellScript</Type>
<InvokeTimes>2</InvokeTimes>
<CreationTime>2020-11-17T06:52Z</CreationTime>
<EnableParameter>false</EnableParameter>
<CommandId>c-hz01272yr52****</CommandId>
</Command>
</Commands>
</DescribeCommandsResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"TotalCount" : 1,
"RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"PageSize" : 10,
"PageNumber" : 1,
"Commands" : {
"Command" : [ {
"Category" : "",
"Description" : "test1",
"ParameterNames" : {
"ParameterName" : [ ]
},
"Timeout" : 3600,
"Name" : "testName",
"Provider" : "",
"CommandContent" : "Y2QgL3Jvb3Q=",
"WorkingDir" : "",
"Type" : "RunShellScript",
"InvokeTimes" : 2,
"CreationTime" : "2020-11-17T06:52Z",
"EnableParameter" : false,
"CommandId" : "c-hz01272yr52****"
} ]
}
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | RegionId.ApiNotSupported | The api is not supported in this region. | The error message returned because the API operation cannot be called in the specified region. Check whether the RegionId parameter is valid. |
403 | InvalidParam.PageNumber | The specified parameter is invalid. | The error message returned because the specified PageNumber parameter is invalid. |
403 | InvalidParam.PageSize | The specified parameter is invalid. | The error message returned because the specified PageSize parameter is invalid. |
403 | Operation.Forbidden | The operation is not permitted. | The error message returned because the operation is not supported. |
500 | InternalError.Dispatch | An error occurred when you dispatched the request. | The error message returned because an error occurred when the request was being sent. Try again later. |
For a list of error codes, visit the API Error Center.