
# 查询编排规则列表 - ListOrchestrations
#### 功能介绍
查询编排规则列表
#### 调用方法
请参见[如何调用API](https://support.huaweicloud.com/api-apig/apig-api-180713003.html)。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-apig/apig-api-grant-policy_0000.html)。
- 如果使用身份策略授权，当前API调用无需身份策略权限。
 
#### URI
GET /v2/{project_id}/apigw/instances/{instance_id}/orchestrations
表1路径参数 
| 参数          | 是否必选 | 参数类型   | 描述                                                                                      |
|:---|:---|:---|:---|
| project_id  | 是    | String | 项目ID，获取方式请参见[获取项目ID](https://support.huaweicloud.com/api-apig/apig-api-180713009.html)。 |
| instance_id | 是    | String | 实例ID，在API网关控制台的"实例信息"中获取。                                                               |
   
表2Query参数 
| 参数                 | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                  |
|:---|:---|:---|:---|
| offset             | 否    | Long    | 偏移量，表示从此偏移量开始查询，偏移量小于0时，自动转换为0 缺省值：**0**                                                                                                                      |
| limit              | 否    | Integer | 每页显示的条目数量，条目数量小于等于0时，自动转换为20，条目数量大于500时，自动转换为500 最小值：**1** 最大值：**500** 缺省值：**20** |
| orchestration_name | 否    | String  | 编排规则名称。                                                                                                                                                                                             |
| precise_search     | 否    | String  | 指定需要精确匹配查找的参数名称，多个参数需要支持精确匹配时参数之间使用","隔开。当前仅支持orchestration_name。                                                                                                                                   |
| orchestration_id   | 否    | String  | 编排规则编号。 支持指定多个编号作为查询条件，多个参数之间使用","隔开，支持的查询参数个数与api允许绑定的参数规则上限保持一致，具体请参考产品介绍的"配额说明"章节。                                                                         |
   
#### 请求参数
表3请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                       |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。 |
   
#### 响应参数
**状态码：200**
表4响应Body参数 
| 参数             | 参数类型                                                                                          | 描述            |
|:---|:---|:---|
| size           | Integer                                                                                       | 本次返回的列表长度     |
| total          | Long                                                                                          | 满足条件的记录数      |
| orchestrations | Array of [OrchestrationBaseResp] objects | 本次查询到的编排规则列表。 |
   
 表5OrchestrationBaseResp 
| 参数                         | 参数类型                                                                                      | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|
| orchestration_name         | String                                                                                    | 编排映射规则名称。 支持英文，数字，下划线，且只能以英文开头，3-64个字符，同一实例下不允许重名。 最小长度：**3** 最大长度：**64**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| orchestration_strategy     | String                                                                                    | 编排策略，有以下几种策略类型： - list：列表；   - hash：哈希；   - range：区间；   - hash_range: 哈希+区间；   - none_value: 空值映射；   - default: 默认值映射；   - head_n: 截取前n项；   - tail_n: 截取后n项；    当编排策略为list时，orchestration_map列表长度\*map_param_list长度不超过3000。 |
| orchestration_mapped_param | [OrchestrationMappedParam] object | 编排后的参数配置，isPreprocessing为false时必填。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| is_preprocessing           | Boolean                                                                                   | 是否为预处理策略，预处理策略只会生成临时参数作为后面参数编排规则的入参标记。当为预处理策略时，该编排规则不能作为除default之外的最后一个编排规则。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| orchestration_id           | String                                                                                    | 编排规则编号。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| orchestration_create_time  | String                                                                                    | 编排规则创建时间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| orchestration_update_time  | String                                                                                    | 编排规则更新时间。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
   
 表6OrchestrationMappedParam 
| 参数                    | 参数类型   | 描述                                                                                                                                                               |
|:---|:---|:---|
| mapped_param_name     | String | 编排后的请求参数名，只支持英文，数字，中划线，必须以英文开头，1-128个字符，不能与已有的参数重名，默认会透传到后端。 最小长度：**1** 最大长度：**128** |
| mapped_param_type     | String | 编排后的参数类型，支持string和number。                                                                                                                                        |
| mapped_param_location | String | 编排后的参数位置，支持query和header。                                                                                                                                         |
   
**状态码：400**
表7响应Body参数 
| 参数         | 参数类型   | 描述   |
|:---|:---|:---|
| error_code | String | 错误码  |
| error_msg  | String | 错误描述 |
   
**状态码：401**
表8响应Body参数 
| 参数         | 参数类型   | 描述   |
|:---|:---|:---|
| error_code | String | 错误码  |
| error_msg  | String | 错误描述 |
   
**状态码：403**
表9响应Body参数 
| 参数         | 参数类型   | 描述   |
|:---|:---|:---|
| error_code | String | 错误码  |
| error_msg  | String | 错误描述 |
   
**状态码：404**
表10响应Body参数 
| 参数         | 参数类型   | 描述   |
|:---|:---|:---|
| error_code | String | 错误码  |
| error_msg  | String | 错误描述 |
   
**状态码：500**
表11响应Body参数 
| 参数         | 参数类型   | 描述   |
|:---|:---|:---|
| error_code | String | 错误码  |
| error_msg  | String | 错误描述 |
   
#### 请求示例
无
#### 响应示例
**状态码：200**
OK
```
{
  "total" : 2,
  "size" : 2,
  "orchestrations" : [ {
    "orchestration_id" : "76545e81d9cb4424bf704ef2b0ac7600",
    "orchestration_name" : "orchestration_demo_1",
    "orchestration_create_time" : "2023-07-02T12:31:23.353Z",
    "orchestration_update_time" : "2023-07-02T13:31:23.353Z",
    "orchestration_strategy" : "list",
    "orchestration_mapped_param" : {
      "mapped_param_name" : "shared-tag",
      "mapped_param_type" : "number",
      "mapped_param_location" : "header"
    }
  }, {
    "orchestration_id" : "yt655e81d9cb4424bf704ef2b0ac7600",
    "orchestration_name" : "orchestration_demo_2",
    "orchestration_create_time" : "2023-07-02T12:31:23.353Z",
    "orchestration_update_time" : "2023-07-02T13:31:23.353Z",
    "orchestration_strategy" : "range",
    "orchestration_mapped_param" : {
      "mapped_param_name" : "shared-tag",
      "mapped_param_type" : "number",
      "mapped_param_location" : "header"
    }
  } ]
}
```
**状态码：400**
Bad Request
```
{
  "error_code" : "APIG.2012",
  "error_msg" : "Invalid parameter value,parameterName:instance_id. Please refer to the support documentation"
}
```
**状态码：401**
Unauthorized
```
{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}
```
**状态码：403**
Forbidden
```
{
  "error_code" : "APIG.1005",
  "error_msg" : "No permissions to request this method"
}
```
**状态码：404**
Not Found
```
{
  "error_code" : "APIG.3030",
  "error_msg" : "The instance does not exist;id:f0fa1789-3b76-433b-a787-9892951c620ec"
}
```
**状态码：500**
Internal Server Error
```
{
  "error_code" : "APIG.9999",
  "error_msg" : "System error"
}
```
#### 状态码
| 状态码 | 描述                    |
|:---|:---|
| 200 | OK                    |
| 400 | Bad Request           |
| 401 | Unauthorized          |
| 403 | Forbidden             |
| 404 | Not Found             |
| 500 | Internal Server Error |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-apig/ErrorCode.html)。
