
# 更新带宽 - UpdateBandwidth
#### 功能介绍
更新带宽。
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/IEC/doc?api=UpdateBandwidth)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### 授权信息
账号具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备调用API所需的权限，具体权限要求请参见[权限和授权项](https://support.huaweicloud.com/api-iec/iec_05_0600.html)。
#### URI
PUT /v1/bandwidths/{bandwidth_id}
表1路径参数 
| 参数           | 是否必选 | 参数类型   | 描述    |
|:---|:---|:---|:---|
| bandwidth_id | 是    | String | 带宽id。 |
   
#### 请求参数
表2请求Header参数 
| 参数           | 是否必选 | 参数类型   | 描述                                                                                           |
|:---|:---|:---|:---|
| X-Auth-Token | 是    | String | 用户Token。 通过调用IAM服务获取用户Token接口获取（响应消息头中X-Subject-Token的值）。 |
   
表3请求Body参数 
| 参数        | 是否必选 | 参数类型                                                                            | 描述      |
|:---|:---|:---|:---|
| bandwidth | 是    | [UpdateBandwidthOption] object | 更新带宽参数。 |
   
 表4UpdateBandwidthOption 
| 参数   | 是否必选 | 参数类型    | 描述    |
|:---|:---|:---|:---|
| name | 否    | String  | 带宽名称。 |
| size | 否    | Integer | 带宽大小。 |
   
#### 响应参数
**状态码：200**
表5响应Body参数 
| 参数        | 参数类型                                                     | 描述    |
|:---|:---|:---|
| bandwidth | [Bandwidth] object | 带宽对象。 |
   
 表6Bandwidth 
| 参数             | 参数类型                                                                     | 描述                                                                                                                                                                                                                                                                                                                                                                                                        |
|:---|:---|:---|
| bandwidth_type | String                                                                   | 带宽类型。                                                                                                                                                                                                                                                                                                                                                                                                     |
| charge_mode    | String                                                                   | 计费模式，当前只支持峰值95计费。 取值范围： - 95peak_plus：峰值95计费                                                                                                                          |
| create_time    | String                                                                   | 创建时间。                                                                                                                                                                                                                                                                                                                                                                                                     |
| id             | String                                                                   | 带宽ID。                                                                                                                                                                                                                                                                                                                                                                                                     |
| name           | String                                                                   | 带宽名称。                                                                                                                                                                                                                                                                                                                                                                                                     |
| operator       | [Operator] object                   | 运营商信息。                                                                                                                                                                                                                                                                                                                                                                                                    |
| publicip_info  | Array of [PublicipInfo] objects | 弹性公网IP信息。                                                                                                                                                                                                                                                                                                                                                                                                 |
| share_type     | String                                                                   | 共享带宽类型，标识是否是共享带宽。 取值范围： - WHOLE：共享带宽                                                                                                                                  |
| site_id        | String                                                                   | 边缘站点ID。                                                                                                                                                                                                                                                                                                                                                                                                   |
| site_info      | String                                                                   | 站点信息。                                                                                                                                                                                                                                                                                                                                                                                                     |
| size           | Integer                                                                  | 带宽大小。                                                                                                                                                                                                                                                                                                                                                                                                     |
| status         | String                                                                   | 带宽的状态。 取值范围： - FREEZED：冻结   - NORMAL：正常    |
| update_time    | String                                                                   | 更新时间。                                                                                                                                                                                                                                                                                                                                                                                                     |
| pool_id        | String                                                                   | 线路ID。                                                                                                                                                                                                                                                                                                                                                                                                     |
   
 表7Operator 
| 参数        | 参数类型   | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|:---|:---|:---|
| id        | String | 运营商ID。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| name      | String | 运营商名称。 取值范围： - chinamobile：中国移动；   - chinaunicom：中国联通；   - chinatelecom：中国电信。    |
| i18n_name | String | 运营商国际化名称。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| sa        | String | 运营商的简写。                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
   
 表8PublicipInfo 
| 参数               | 参数类型    | 描述             |
|:---|:---|:---|
| ip_version       | Integer | IP版本的信息        |
| publicip_address | String  | 弹性公网IP         |
| publicip_id      | String  | 弹性公网IP的ID。     |
| publicip_type    | String  | 功能说明：弹性公网IP的类型 |
   
#### 请求示例
更新带宽名称或大小
```
PUT https://{endpoint}/v1/bandwidths/1b0ec107-f6d4-4507-a1f4-7d7721bdbc7b
{
  "bandwidth" : {
    "name" : "new-bandwidth-name"
  }
}
```
#### 响应示例
**状态码：200**
OK
```
{
  "bandwidth" : {
    "id" : "1b0ec107-f6d4-4507-a1f4-7d7721bdbc7b",
    "name" : "Bandwidth_test",
    "size" : 300,
    "share_type" : "WHOLE",
    "publicip_info" : [ {
      "publicip_id" : "39daeb51-3ea9-4c75-86b9-8298fec7018c",
      "publicip_address" : "122.9.251.60",
      "publicip_type" : "5_bgp_900e",
      "ip_version" : 4
    } ],
    "bandwidth_type" : "share",
    "charge_mode" : "95peak_plus",
    "site_id" : "db175dab-acb5-11ea-9310-fa165cf67eaf",
    "status" : "NORMAL",
    "create_time" : "0001-01-01T00:00:00Z",
    "site_info" : "中国/华东地区/浙江/杭州市",
    "operator" : {
      "id" : "99",
      "i18n_name" : "bgp",
      "sa" : "BGP"
    },
    "update_time" : "0001-01-01T00:00:00Z"
  }
}
```
#### 状态码
| 状态码 | 描述                    |
|:---|:---|
| 200 | OK                    |
| 400 | Bad Request           |
| 401 | Unauthorized          |
| 403 | Forbidden             |
| 404 | Not Found             |
| 500 | Internal Server Error |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-iec/ErrorCode.html)。
