# 查询带宽规则 - ShowBandwidthRule
#### 功能介绍
查询在指定带宽实例下的带宽分组规则。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/EIP/doc?api=ShowBandwidthRule&version=v3)中调试该接口，支持自动认证鉴权。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限。
- 如果使用角色与策略授权，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-eip/eip_apipermission_0000.html)。
- 如果使用身份策略授权，需具备如下身份策略权限。
  
  | 授权项                    | 访问级别 | 资源类型（\*为必须）      | 条件键                                                                                                                                                                                                                                                                                                                                                                                                | 别名                 | 依赖的授权项 |
  |:---|:---|:---|:---|:---|:---|
  | eip:bandwidthRules:get | Read | bandwidth \*     | - g:EnterpriseProjectId   - g:ResourceTag/\<tag-key\>    | vpc:bandwidths:get | -      |
  | eip:bandwidthRules:get | Read | bandwidthRule \* | -                                                                                                                                                                                                                                                                                                                                                                                                  | vpc:bandwidths:get | -      |
     
  
 
#### URI
GET /v3/{project_id}/eip/bandwidths/{bandwidth_id}/bandwidth-rule/{bandwidth_rules_id}
表1路径参数 
| 参数                 | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|:---|
| project_id         | 是    | String | - 参数解释：项目ID。[请参见获取项目ID](https://support.huaweicloud.com/api-eip/eip_api06_0004.html) - 取值范围：不涉及       最大长度：**32** |
| bandwidth_id       | 是    | String | 带宽唯一标识                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| bandwidth_rules_id | 是    | String | 带宽规则唯一标识                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
   
表2Query参数 
| 参数     | 是否必选 | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|:---|:---|:---|:---|
| fields | 否    | String | - 功能说明：查询字段，形式为"fields=id\&fields=name\&..."   - 支持字段：id/name/egress_size/egress_guarented_size/ingress_size/ingress_guarented_size/admin_state_up"    |
   
#### 请求参数
无
#### 响应参数
**状态码：200**
表3响应Body参数 
| 参数             | 参数类型                                                                               | 描述      |
|:---|:---|:---|
| bandwidth_rule | [ShowBandwidthRuleDict] object | 带宽规则对象  |
| request_id     | String                                                                             | 本次请求的编号 |
   
 表4ShowBandwidthRuleDict 
| 参数                    | 参数类型                                                                       | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
|:---|:---|:---|
| id                    | String                                                                     | - 功能说明：带宽规则ID                                                                                                                                                                                                                                                                                     |
| name                  | String                                                                     | - 功能说明：带宽规则名称    最小长度：**0** 最大长度：**64**                                                                                                                                                                                 |
| admin_state_up        | Boolean                                                                    | - 功能说明：配置状态，为False时配置不生效。                                                                                                                                                                                                                                                                         |
| egress_size           | Integer                                                                    | - 功能说明：出网带宽最大值，单位M bps。   - 取值范围：\[0,n\]，其中n为所属带宽的带宽大小（size字段）。0表示设置为最大带宽    最小值：**0** |
| egress_guarented_size | Integer                                                                    | - 功能说明：出网保障带宽大小，单位M bps。取值范围\[0,x\]，其中x为所属带宽剩余的保障额    最小值：**0**                                                                                                                                                                                              |
| publicip_info         | Array of [PublicIpDict] objects | - 功能说明：弹性公网IP信息                                                                                                                                                                                                                                                                                   |
| bandwidthId           | String                                                                     | - 功能说明：带宽Id    最小长度：**1** 最大长度：**36**                                                                                                                                                                                   |
| description           | String                                                                     | - 功能说明：描述    最大长度：**255**                                                                                                                                                                                                                                    |
   
 表5PublicIpDict 
| 参数                 | 参数类型    | 描述                                                        |
|:---|:---|:---|
| publicip_id        | String  | 公网IP ID                                                   |
| publicip_address   | String  | 公网IP地址。IPv6时为IPv6地址对应的IPv4地址。                             |
| publicipv6_address | String  | IPv4时无此字段                                                 |
| publicip_type      | String  | 公网IP所在网络 最大长度：**36** |
| ip_version         | Integer | IP版本                                                      |
   
#### 请求示例
无
#### 响应示例
**状态码：200**
```
{
  "bandwidth_rule" : {
    "id" : "063c367d-8480-4e5e-a80e-56adaccc030b",
    "name" : "v3eip",
    "description" : null,
    "bandwidthId" : "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"
    }
  },
  "request_id" : "dd5d37aa-b3c3-4e8a-934f-c8f73c83eb56"
}
```
#### 状态码
| 状态码 | 描述            |
|:---|:---|
| 200 | GET和PUT操作正常返回 |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-eip/ErrorCode.html)。
