All Products
Search
Document Center

Simple Application Server:DescribeCommands

Last Updated:Oct 30, 2024

Queries the commands that you created or the common commands that Alibaba Cloud provides.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
swas-open:DescribeCommandsget
  • Command
    acs:swas-open:{#regionId}:{#accountId}:command/*
  • Command
    acs:swas-open:{#regionId}:{#accountId}:command/{#CommandId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID.

cn-hangzhou
CommandIdstringNo

The command ID.

c-sh02yh0932w****
NamestringNo

The command name. Fuzzy match is not supported.

testName
ProviderstringYes

The provider of the common command. Take note of the following items:

  • If you set this parameter to AlibabaCloud, all the common commands provided by Alibaba Cloud are queried.
  • If you set this parameter to User, all the custom commands created by you are queried.
AlibabaCloud
TypestringNo

The language type of the command. Valid values:

  • RunBatScript: batch command, applicable to Windows instances
  • RunPowerShellScript: PowerShell command, applicable to Windows instances
  • RunShellScript: shell command, applicable to Linux instances
RunShellScript
PageNumberstringNo

The page number.

Pages start from 1.

Default value: 1.

1
PageSizestringNo

The number of entries per page.

Maximum value: 50.

Default value: 10.

10
Tagarray<object>No

The tags that are bound to the command.

objectNo

The tags of the command.

KeystringNo

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
ValuestringNo

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
ResourceGroupIdstringNo

The resource group ID.

rg-aek2bti7cf7****

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

20758A-585D-4A41-A9B2-28DA8F4F****
TotalCountinteger

The total number of commands.

10
PageNumberinteger

The page number.

1
PageSizeinteger

The number of entries per page.

10
Commandsarray<object>

The queried commands.

commandobject

The commands.

CommandIdstring

The command ID.

c-gov1k1tqwi9****
Tagsarray<object>

The tags that are bound to the command.

tagobject

The tags of the command.

Keystring

The tag key of the command.

TestKey
Valuestring

The tag value of the command.

TestValue
CreationTimestring

The time when the command was created.

2023-01-05T06:38:53Z
Namestring

The name of the command.

testName
Providerstring

The provider of the command.

User
Typestring

The type of the command.

RunShellScript
Timeoutlong

The timeout period of the command.

60
Descriptionstring

The description of the command.

testDescription
WorkingDirstring

The execution path of the command.

/home
CommandContentstring

The content of the command.

cat /etc/ssh/sshd_config
EnableParameterboolean

Indicates whether the custom parameter feature is enabled for the command.

false
ParameterNamesarray

The custom parameter names that are parsed from the command content specified when the command was created. The custom parameter names are returned in the list format. If the custom parameter feature is disabled, an empty list is returned.

parameterNamestring

The custom parameter name.

parameter1
ParameterDefinitionsarray<object>

Details of the custom parameter.

parameterDefinitionobject

The custom parameter.

Requiredboolean

Indicates whether the custom parameter is required. Valid values:

  • true
  • false

Default value: false.

false
Descriptionstring

The description of the custom parameter.

Command Assistant Agent Installation Package Path
DefaultValuestring

The default value of the custom parameter.

https://aliyun-client-assist.oss-accelerate.aliyuncs.com/linux/aliyun_assist_latest.rpm
ParameterNamestring

The name of the custom parameter.

DownloadUrl
PossibleValuesarray

The valid values of the custom parameter.

possibleValuestring

A valid value of the custom parameter.

Linux
ResourceGroupIdstring

The resource group ID.

rg-aek2bti7cf7****

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
2024-05-29The request parameters of the API has changed. The response structure of the API has changedView Change Details
2024-02-20The request parameters of the API has changed. The response structure of the API has changedView Change Details