DescribeCommands

1. API Description

This API is used to query command list.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

commandIds

No

Array of String

Query according to command ID.

You can query up to 100 commands in each request.

name

No

String

Query according to command name. Fuzzy search supported.

types

No

Array of CommandType

Query according to command script language.

pageSize

No

Integer

Number of items in the current page result.

Default value: 20;

Maximum value: 1000.

pageNum

No

Integer

Number of pages returned.

Default value: 1.

Value range: [1, +).

tagKeys

No

Array of String

Query according to tag key.

You can query up to 20 tag keys in each request.

tags

No

Array of Tag

Query according to tag.

You can query up to 20 tags in each request.

3. Output Parameters

Parameter Name
Type
Description

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

dataSet

Array of Command

Command list.

totalCount

Integer

Number of commands meeting the filtering conditions.

4. Code Example

Query command list.

POST /api/v2/zos HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeCommands
<Common Request Params>

Request:
{
}

Response:
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "dataSet": [
      {
        "commandId": "<commandId>",
        "name": "Test",
        "description": "Echo test",
        "content": "echo 1",
        "type": "SHELL",
        "createTime": "2025-10-17 11:12:54",
        "latestInvocationTime": "2025-10-17 11:12:54",
        "tags": {
          "tags": [
            {
              "key": "test",
              "value": "test"
            }
          ]
        },
        "resourceGroup": {
          "resourceGroupId": "<resourceGroupId>",
          "resourceGroupName": "Default Resource Group"
        }
      }
    ],
    "totalCount": 0
  }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

No error codes related to the API business logic. For other error codes, see Common Error Codes.​

Last updated