All Products
Search
Document Center

Simple Application Server:DescribeCommands

Last Updated:Sep 08, 2026

Queries commands that you manually created or public commands provided by Alibaba Cloud.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

swas-open:DescribeCommands

get

*Command

acs:swas-open:{#regionId}:{#accountId}:command/*

*Command

acs:swas-open:{#regionId}:{#accountId}:command/{#CommandId}

None 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 name of the command. Fuzzy match is not supported.

testName

Provider

string

Yes

The provider of the public command. Valid values:

  • AlibabaCloud: queries all public commands provided by Alibaba Cloud.

  • User: queries all custom commands that you created.

AlibabaCloud

Type

string

No

The language type of the command. Valid values:

  • RunBatScript: Bat command for Windows instances.

  • RunPowerShellScript: PowerShell command for Windows instances.

  • RunShellScript: Shell command for Linux instances.

RunShellScript

PageNumber

string

No

The page number.

Minimum value: 1.

Default value: 1.

1

PageSize

string

No

The number of entries per page for a paged query.

Maximum value: 50.

Default value: 10.

10

Tag

array<object>

No

The tags of the command.

object

No

The tag.

Key

string

No

The tag key of the command. The tag key must be 1 to 64 characters in length. Valid values of N: 1 to 20.

TestKey

Value

string

No

The tag value of the command. The tag value must be 1 to 64 characters in length. Valid values of N: 1 to 20.

TestValue

ResourceGroupId

string

No

The resource group ID.

rg-aek2bti7cf7****

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

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

TotalCount

integer

The total number of commands.

10

PageNumber

integer

The page number of the command list.

1

PageSize

integer

The number of entries per page.

10

Commands

array<object>

The commands.

array<object>

The command information struct.

CommandId

string

The command ID.

c-gov1k1tqwi9****

Tags

array<object>

The tags of the command.

object

The tag.

Key

string

The tag key of the command.

TestKey

Value

string

The tag value of the command.

TestValue

CreationTime

string

The time when the command was created. The time is displayed in UTC (Z) in the YYYY-MM-DDThh:mm:ssZ format.

2023-01-05T06:38:53Z

Name

string

The command name.

testName

Provider

string

The provider of the command.

User

Type

string

The command type.

RunShellScript

Timeout

integer

The timeout period. Unit: seconds.

60

Description

string

The command description.

testDescription

WorkingDir

string

The execution path.

/home

CommandContent

string

The command content.

cat /etc/ssh/sshd_config

EnableParameter

boolean

Indicates whether custom parameters are enabled for the command.

false

ParameterNames

array

The list of custom parameter names parsed from CommandContent when the command was created. The list is returned in the List format. If the custom parameter feature is not enabled, an empty list is returned.

string

The custom parameter.

parameter1

ParameterDefinitions

array<object>

The list of custom parameter details.

object

The custom parameter details struct.

Required

boolean

Indicates whether the custom parameter is required. Valid values:

  • true: Required.

  • false: Not required.

Default value: false.

false

Description

string

The description of the custom parameter.

Cloud Assistant Agent installation package path

DefaultValue

string

The default value of the custom parameter.

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

ParameterName

string

The name of the custom parameter.

DownloadUrl

PossibleValues

array

The possible values of the enumeration-type custom parameter.

string

The value of the enumeration-type custom parameter.

Linux

ResourceGroupId

string

The resource group ID.

rg-aek2bti7cf7****

Examples

Success response

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

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.