Queries the commands that you created or the common commands that Alibaba Cloud provides.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
swas-open:DescribeCommands | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID. | cn-hangzhou |
CommandId | string | No | The command ID. | c-sh02yh0932w**** |
Name | string | No | The command name. Fuzzy match is not supported. | testName |
Provider | string | Yes | The provider of the common command. Take note of the following items:
| AlibabaCloud |
Type | string | No | The language type of the command. Valid values:
| RunShellScript |
PageNumber | string | No | The page number. Pages start from 1. Default value: 1. | 1 |
PageSize | string | No | The number of entries per page. Maximum value: 50. Default value: 10. | 10 |
Tag | array<object> | No | The tags that are bound to the command. | |
object | No | The tags of the command. | ||
Key | string | No | The tag key of the command. A tag key can be 1 to 64 characters in length. Valid values of N: 1 to 20. | TestKey |
Value | string | No | The tag value of the command. A tag value can be up to 64 characters in length. Valid values of N: 1 to 20. | TestValue |
ResourceGroupId | string | No | The resource group ID. | rg-aek2bti7cf7**** |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "20758A-585D-4A41-A9B2-28DA8F4F****",
"TotalCount": 10,
"PageNumber": 1,
"PageSize": 10,
"Commands": [
{
"CommandId": "c-gov1k1tqwi9****",
"Tags": [
{
"Key": "TestKey",
"Value": "TestValue"
}
],
"CreationTime": "2023-01-05T06:38:53Z",
"Name": "testName",
"Provider": "User",
"Type": "RunShellScript",
"Timeout": 60,
"Description": "testDescription",
"WorkingDir": "/home",
"CommandContent": "cat /etc/ssh/sshd_config",
"EnableParameter": false,
"ParameterNames": [
"parameter1"
],
"ParameterDefinitions": [
{
"Required": false,
"Description": "Command Assistant Agent Installation Package Path",
"DefaultValue": "https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_latest.rpm",
"ParameterName": "DownloadUrl",
"PossibleValues": [
"Linux"
]
}
],
"ResourceGroupId": "rg-aek2bti7cf7****"
}
]
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-05-29 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |
2024-02-20 | The request parameters of the API has changed. The response structure of the API has changed | View Change Details |