# 全量查询带宽规则列表 - ListBandwidthRules
#### 功能介绍
查询租户在指定带宽实例的所有带宽分组规则。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/EIP/doc?api=ListBandwidthRules&version=v3)中调试该接口，支持自动认证鉴权。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-eip/eip_apipermission_0000.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                     | 访问级别 | 资源类型（\*为必须）      | 条件键                                                                                                                                                                                                                                                                                                                                                                                                        | 别名                 | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | eip:bandwidthRules:list | List | bandwidth \*     | - g:EnterpriseProjectId   - g:ResourceTag/\<tag-key\>    | vpc:bandwidths:get | -      |
  | eip:bandwidthRules:list | List | bandwidthRule \* | -                                                                                                                                                                                                                                                                                                                                                                                                          | vpc:bandwidths:get | -      |
     
  
 
#### URI
GET /v3/{project_id}/eip/bandwidths/{bandwidth_id}/bandwidth-rules
表1路径参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
|:---|:---|:---|:---|
| project_id   | 是    | String | - 参数解释：项目ID。[请参见获取项目ID](https://support.huaweicloud.com/api-eip/eip_api06_0004.html) - 取值范围：不涉及       最大长度：**32** |
| bandwidth_id | 是    | String | 带宽唯一标识                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
   
表2Query参数 
| 参数                    | 是否必选 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
|:---|:---|:---|:---|
| marker                | 否    | String  | - 功能说明：分页查询起始的资源ID，为空时为查询第一页                                                                                                                                                                                                                                                                                                   |
| limit                 | 否    | Integer | - 功能说明：每页返回的资源个数   - 取值范围：1\~2000    最小值：**0** 最大值：**2000**              |
| fields                | 否    | String  | - 功能说明：查询字段，形式为"fields=id\&fields=name\&...   - 支持字段：id/name/egress_size/egress_guarented_size/ingress_size/ingress_guarented_size/admin_state_up    |
| sort_key              | 否    | String  | - 功能说明：排序字段，形式为"sort_key=id   - 支持字段：id/name/egress_size/egress_guarented_size"                                                                      |
| sort_dir              | 否    | String  | - 功能说明：排序方向   - 取值范围：asc、desc                                                                                                                        |
| id                    | 否    | String  | - 功能说明："根据id过滤"                                                                                                                                                                                                                                                                                                                |
| name                  | 否    | String  | - 功能说明："根据name过滤"                                                                                                                                                                                                                                                                                                              |
| egress_size           | 否    | String  | - 功能说明："根据egress_size过滤"                                                                                                                                                                                                                                                                                                       |
| egress_guarented_size | 否    | String  | - 功能说明："根据egress_guarented_size过滤"                                                                                                                                                                                                                                                                                             |
| admin_state_up        | 否    | String  | - 功能说明："根据admin_state_up过滤"                                                                                                                                                                                                                                                                                                    |
   
#### 请求参数
无
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数              | 参数类型                                                                                  | 描述      |
|:---|:---|:---|
| request_id      | String                                                                                | 本次请求的编号 |
| bandwidth_rules | Array of [BandwidthRuleDict] objects | 带宽规则列表  |
| page_info       | [PageInfoDict] object                     | 分页页码信息  |
   
 表4BandwidthRuleDict 
| 参数                    | 参数类型                                                                                | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|:---|:---|:---|
| id                    | String                                                                              | - 功能说明：带宽组规则唯一标识                                                                                                                                                                                                                                                                                                                             |
| name                  | String                                                                              | - 功能说明：带宽规则名称   - 取值范围：1-64个字符，支持数字、字母、中文、_(下划线)、-（中划线）、.（点）    最小长度：**1** 最大长度：**64** |
| description           | String                                                                              | - 功能说明：带宽规则说明   - 取值范围：1-255个字符，支持数字、字母、中文、_(下划线)、-（中划线）、.（点）                                                                                                      |
| bandwidth_id          | String                                                                              | - 功能说明：带宽唯一标识                                                                                                                                                                                                                                                                                                                                |
| admin_state_up        | Boolean                                                                             | - 功能说明：配置状态，为False时配置不生效。    缺省值：**true**                                                                                                                                                                                                                                                              |
| egress_size           | Integer                                                                             | - 功能说明：出网带宽最大值，单位M bps   - 取值范围\[0,n\]，其中n为所属带宽的带宽大小（size字段）。0表示设置为最大带宽。                                                                                           |
| egress_guarented_size | Integer                                                                             | - 功能说明：出网保底带宽大小,单位M bps。   - 取值范围\[0,x\]，其中x为所属带宽剩余的保障额。    最小值：**0** 缺省值：**0**        |
| publicip_info         | Array of [PublicipInfoDict] objects | - 功能说明：带宽对应的弹性公网IP信息   - 约束与限制：WHOLE类型的带宽支持多个弹性公网IP，PER类型的带宽只能对应一个弹性公网IP                                                                                           |
   
 表5PublicipInfoDict 
| 参数                 | 参数类型    | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
|:---|:---|:---|
| publicip_address   | String  | - 功能说明：弹性公网IP或者IPv6端口的地址                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| publicip_id        | String  | - 功能说明：带宽对应的弹性公网IP或者IPv6端口的唯一标识                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| publicip_type      | String  | **参数解释：** 弹性公网IP的类型。 **约束与限制：** 必须是系统具体支持的类型。publicip_id为IPv4端口，所以"type"字段未给定时，默认为5_bgp。 **取值范围：**     5_bgp (全动态BGP)，5_sbgp (静态BGP)，5_bgp-premium(精品BGP) -  华南-广州：5_bgp、5_sbgp   -  华东-上海一：5_bgp、5_sbgp   -  华东-上海二：5_bgp、5_sbgp   -  华北-北京一：5_bgp、5_sbgp   -  中国-香港：5_bgp、5_bgp-premium   -  亚太-曼谷：5_bgp   -  亚太-新加坡：5_bgp   -  非洲-约翰内斯堡：5_bgp   -  西南-贵阳一：5_sbgp   -  华北-北京四：5_bgp、5_sbgp   -  拉美-圣地亚哥：5_bgp   -  拉美-圣保罗一：5_bgp   -  拉美-墨西哥城一：5_bgp   -  拉美-布宜诺斯艾利斯一：5_bgp   -  拉美-利马一：5_bgp   -  拉美-圣地亚哥二： 5_bgp    最大长度：**36** |
| publicipv6_address | String  | - 功能说明：IPv4时无此字段，IPv6时为申请到的弹性公网IP地址                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ip_version         | Integer | - IP版本信息   - 取值范围： - 4：IPv4   - 6：IPv6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   
 表6PageInfoDict 
| 参数              | 参数类型    | 描述                 |
|:---|:---|:---|
| previous_marker | String  | 翻页时，作为前一页的marker取值 |
| next_marker     | String  | 翻页时，作为后一页的marker取值 |
| current_count   | Integer | 当前页的数据总数           |
   
#### 请求示例
无
#### 响应示例
**状态码：200**
```
{
  "request_id" : "dd5d37aa-b3c3-4e8a-934f-c8f73c83eb56",
  "bandwidth_rules" : [ {
    "id" : "063c367d-8480-4e5e-a80e-56adaccc030b",
    "name" : "v3eip",
    "description" : null,
    "bandwidth_id" : "065162a2-8166-4d0d-ab1e-4b8d192c330c",
    "admin_state_up" : true,
    "egress_size" : 0,
    "egress_guarented_size" : 0,
    "publicip_info" : {
      "publicip_id" : "6285e7be-fd9f-497c-bc2d-dd0bdea6efe0",
      "ip_version" : 4,
      "publicip_type" : "5_bgp",
      "publicip_address" : "161.xx.xx.9"
    }
  }, {
    "id" : "a79fd11a-047b-4f5b-8f12-99c178cc780a",
    "name" : "222",
    "description" : null,
    "bandwidth_id" : "065162a2-8166-4d0d-ab1e-4b8d192c330c",
    "admin_state_up" : true,
    "egress_size" : 0,
    "egress_guarented_size" : 0,
    "publicip_info" : {
      "publicip_id" : "4ca21961-8e52-4ff4-b9c5-af2dcc2c7b50",
      "ip_version" : 4,
      "publicip_type" : "5_bgp",
      "publicip_address" : "161.xx.xx.13"
    }
  } ],
  "page_info" : {
    "next_marker" : "1e323ebc-4fff-4cf7-ae3f-c4e2f2a46bad",
    "previous_marker" : "11b1ef2d-1d62-4578-9e57-fd566b7a3eea",
    "current_count" : 2
  }
}
```
#### 状态码
| 状态码 | 描述            |
|:---|:---|
| 200 | GET和PUT操作正常返回 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-eip/ErrorCode.html)。
