# 查询用户工单步骤批次实例 - ListExecutionInstances
#### 功能介绍
查询工单步骤批次实例，如脚本分批操作里的ECS实例。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/COC/doc?api=ListExecutionInstances)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-coc/coc_api_06.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                                     | 访问级别 | 资源类型（\*为必须） | 条件键 | 别名 | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | coc:execution:listExecutionStepInstance | Read | -           | -   | -  | -      |
     
#### URI
GET /v1/executions/instances
表1Query参数 
| 参数                | 是否必选 | 参数类型    | 描述                                                                                 |
|:---|:---|:---|:---|
| limit             | 否    | Integer | **参数解释：** 分页参数。 **约束限制：** 每页显示的条目数量。 **取值范围：** 不涉及。 **默认取值：** 不涉及。                 |
| offset            | 否    | Integer | **参数解释：** 分页参数。 **约束限制：** 从offset指定的下一条数据开始查询，不传默认0。 **取值范围：** 不涉及。 **默认取值：** 不涉及。 |
| execution_step_id | 否    | String  | **参数解释：** 工单步骤id。 **约束限制：** 不涉及。 **取值范围：** 不涉及。 **默认取值：** 不涉及。                     |
#### 请求参数
无
#### 响应参数
**状态码：200**
表2响应Body参数 
| 参数         | 参数类型                                                                                         | 描述                                                                                           |
|:---|:---|:---|
| error_code | String                                                                                       | **参数解释：** 错误码。 **取值范围：** 参见[错误码](https://support.huaweicloud.com/api-coc/ErrorCode.html)章节。  |
| error_msg  | String                                                                                       | **参数解释：** 错误信息。 **取值范围：** 参见[错误码](https://support.huaweicloud.com/api-coc/ErrorCode.html)章节。 |
| data       | Array of [data] objects | **参数解释：** 批次实例列表。 **取值范围：** 不涉及。                                                             |
| total      | Long                                                                                         | **参数解释：** 总数。 **取值范围：** 不涉及。                                                                 |
   
 表3data 
| 参数                    | 参数类型                 | 描述                                                                                                                                                                                                                                                                                                                                                |
|:---|:---|:---|
| id                    | Integer              | **参数解释：** 批次执行实例id。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                |
| execution_instance_id | String               | **参数解释：** 工单实例id。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                  |
| execution_step_id     | String               | **参数解释：** 工单步骤id。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                  |
| start_time            | Long                 | **参数解释：** 实例执行开始时间。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                |
| end_time              | Long                 | **参数解释：** 实例执行结束时间。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                |
| status                | String               | **参数解释：** 实例执行状态。 **取值范围：** - Running：运行中。 - Succeed：成功。 - Canceled：取消。 - Failed：失败。                                                                                                                                                                                                                                                              |
| message               | String               | **参数解释：** 实例执行信息。 **取值范围：** 不涉及。                                                                                                                                                                                                                                                                                                                  |
| properties            | Map\<String,String\> | **参数解释：** map形式记录批次里的实例信息， 如分批执行脚本，则记录批次里的实例信息 如循环分批调用API，则记录调用api的参数以及调用结果。 { "agent_id": "c30c90ac18124a4490ce49xxx", "fixed_ip": "192.168.1.xxx", "resource_name": "ecs-xx-xx", "region_id": "cn-north-x", "provider": "ecs", "region_id": "cn-north-x", "resource_id": "25aaed31-80f1-4976-8xxxxxxx", "type": "cloudservers" } **取值范围：** 不涉及。 |
   
**状态码：400**
表4响应Body参数 
| 参数         | 参数类型   | 描述                                                                                           |
|:---|:---|:---|
| error_code | String | **参数解释：** 错误码。 **取值范围：** 参见[错误码](https://support.huaweicloud.com/api-coc/ErrorCode.html)章节。  |
| error_msg  | String | **参数解释：** 错误描述。 **取值范围：** 参见[错误码](https://support.huaweicloud.com/api-coc/ErrorCode.html)章节。 |
   
#### 请求示例
查询工单步骤批次实例，如脚本分批操作里的ECS实例。
```
GET https://{Endpoint}/v1/executions/instances?execution_step_id=EXS2025062314121901xxxxx&offset=0&limit=10
```
#### 响应示例
**状态码：200**
请求成功。
```
{
  "data" : [ {
    "id" : 4482,
    "execution_instance_id" : "EXI202506231412xxxxxxx",
    "execution_step_id" : "EXS202506231412xxxxxxx",
    "status" : "Failed",
    "start_time" : 1750659139000,
    "end_time" : 1750659210000,
    "message" : null,
    "properties" : {
      "provider" : "ecs",
      "type" : "cloudservers",
      "properties" : {
        "host_name" : "coc-platform-gamxxxxxxx",
        "fixed_ip" : null,
        "floating_ip" : null
      },
      "resource_id" : "a4594206-05ee-41fd-84xxxxxxx",
      "agent_sn" : null,
      "enterprise_project_id" : "9d414beb-88b7-4ea8-9e61-1xxxxxxx",
      "project_id" : "10a6c23c2a1044779794798xxxxxxx",
      "region_id" : "cn-north-7"
    }
  }, {
    "id" : 4483,
    "execution_instance_id" : "EXI20250623141219xxxxxxx",
    "execution_step_id" : "EXS202506231412xxxxxxx",
    "status" : "Failed",
    "start_time" : 1750659139000,
    "end_time" : 1750659210000,
    "message" : null,
    "properties" : {
      "provider" : "ecs",
      "type" : "cloudservers",
      "properties" : {
        "host_name" : "coc-cube-cn-north-7-gamxxxxxxx",
        "fixed_ip" : "10.2.51.200",
        "floating_ip" : null
      },
      "resource_id" : "adfbb61d-bdcd-46bb-9b32-edxxxxxxx",
      "agent_sn" : "2bc74fbce77d4528b59810xxxxxxx",
      "enterprise_project_id" : "b022c6d1-4af5-46dd-8exxxxxxx",
      "project_id" : "10a6c23c2a10447797947xxxxxxx",
      "region_id" : "cn-north-x"
    }
  } ],
  "total" : 2
}
```
#### 状态码
| 状态码 | 描述                                                                                 |
|:---|:---|
| 200 | 请求成功。                                                                              |
| 400 | 包含错误信息。 更多状态码请参考[状态码](https://support.huaweicloud.com/api-coc/coc_api_05_03.html)。 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-coc/ErrorCode.html)。
