DescribeCommandInvocations

1. 接口描述

本接口(DescribeCommandInvocations)用于查询执行记录列表

2. 请求参数

以下请求参数列表仅列出了接口中需要的请求参数

参数名称
必选
类型
描述

commandIds

Array of String

根据命令ID进行筛选。

invocationIds

Array of String

根据执行记录ID筛选。

instanceIds

Array of String

根据执行的实例ID筛选。

invocationStatuses

根据执行的总状态筛选。

pageSize

Integer

返回的分页大小,默认为20,最大为10000。

可选值范围:[1, 10000]。

pageNum

Integer

返回的分页数,默认为1。

可选值范围:[1, +)。

3. 响应结果

参数名称
类型
描述

requestId

String

唯一请求 ID。

每次请求都会返回。定位问题时需要提供该次请求的 requestId。

dataSet

命令执行记录列表。

totalCount

Integer

匹配条件的命令执行记录总数。

4. 代码示例

1. 根据执行记录ID查询执行记录。

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

Request:
{
    "invocationIds": ["<invocationId>"]
}

Response:
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "dataSet": [
      {
        "invocationId": "<invocationId>",
        "commandId": "<commandId>",
        "commandName": "Test Command",
        "commandType": "SHELL",
        "content": "echo 'hello world'",
        "timeout": 0,
        "createTime": "2025-10-17 14:31:25",
        "invocationStatus": "Success",
        "invocationInstances": [
          {
            "instanceId": "<instanceId>",
            "instanceName": "Test",
            "taskStatus": "Success",
            "exitCode": 0,
            "errorCode": null,
            "output": "hello world",
            "outputError": null,
            "execStartTime": "2025-10-17 14:32:25",
            "execEndTime": "2025-10-17 14:32:35"
          }
        ]
      }
    ],
    "totalCount": 0
  }
}

5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的开发工具集(SDK),未来会陆续支持更多开发语言,方便快速接入和使用Zenlayer的产品和服务。

6. 错误码

下面包含业务逻辑中遇到的错误码,其他错误码见公共错误码

HTTP状态码

错误码

说明

最后更新于