> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/cn/compute/traffic/bandwidth-cluster/createbandwidthcluster.md).

# CreateBandwidthCluster

## 1. 接口描述

本接口(CreateBandwidthCluster)用于创建一个共享带宽包。

{% hint style="info" %}
**注意事项**

* 如果没有共享带宽包权限，请联系 Zenlayer Support 获取权限。
  {% endhint %}

## 2. 请求参数

以下请求参数列表仅列出了接口中需要的请求参数

| 参数名称                             | 必选 | 类型                                                                                          | 描述                                                                                                                                  |
| -------------------------------- | -- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| areaCode                         | 是  | String                                                                                      | <p>共享带宽包所属地域。</p><p>具体地域信息可以查询<a href="/pages/hVeaJdaqZaATsTLcGclZ">DescribeBandwidthClusterAreas</a>中的<code>areaCode</code>获取。</p> |
| internetChargeType               | 是  | [InternetChargeType](/api-reference/cn/compute/traffic/datastructure.md#internetchargetype) | <p>带宽计费方式。</p><p>默认为月95计费，如果需要日峰值计费，请联系Support开通相关权限。</p><p>默认值：MonthlyPercent95Bandwidth</p>                                       |
| commitBandwidthMbps              | 否  | Integer                                                                                     | <p>保底带宽值。</p><p>单位: Mbps。</p><p>可选值范围：\[0, 999999]</p><p>默认值：0</p>                                                                  |
| internationalCommitBandwidthMbps | 否  | Integer                                                                                     | <p>国际线路保底带宽值。</p><p>单位: Mbps。</p><p>仅 PathBasedBandwidth 线路使用。</p><p>可选值范围：\[0, 999999]</p><p>默认值：0</p>                             |
| networkLineType                  | 否  | [NetworkLineType](/api-reference/cn/compute/traffic/datastructure.md#networklinetype)       | <p>IP网络类型。</p><p>城市共享带宽包该字段必填。</p>                                                                                                  |
| networkType \[已废弃]               | 否  | [NetworkType](/api-reference/cn/compute/traffic/datastructure.md#networktype)               | <p>IP网络类型。</p><p>请使用<code>networkLineType</code>代替。</p>                                                                             |
| name                             | 否  | String                                                                                      | <p>带宽包显示名称。</p><p>如果未指定，默认会使用地域名称命名。</p>                                                                                            |
| product                          | 否  | [ProductRange](/api-reference/cn/compute/traffic/datastructure.md#productrange)             | 城市带宽包所属的产品线范围。                                                                                                                      |
| resourceGroupId                  | 否  | String                                                                                      | 创建后共享带宽包所在的资源组ID，如不指定则放入默认资源组。                                                                                                      |
| tags                             | 否  | [TagAssociation](/api-reference/cn/compute/traffic/datastructure.md#tagassociation)         | 创建共享带宽包时关联的标签。                                                                                                                      |

## 3. 响应结果

| 参数名称               | 类型     | 描述                                                       |
| ------------------ | ------ | -------------------------------------------------------- |
| requestId          | String | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| orderNumber        | String | 订单编号。                                                    |
| bandwidthClusterId | String | 创建的共享带宽包ID。                                              |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
**1. 在上海（SHA) 开通中国移动线路的共享带宽包， 保底设置为1G。**

```json
POST /api/v2/traffic HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: CreateBandwidthCluster
<Common Request Params>

Request:
  {
    "areaCode" : "SHA",
    "chargeType" : "POSTPAID",
    "commitBandwidthMbps" : 1000,
    "networkType" : "CMI",
    "internetChargeType" : "MonthlyPercent95Bandwidth",
    "name" : "sample"
  }

Response:
  {
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
    "response": {
      "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
      "orderNumber": "123232",
      "bandwidthClusterId": "<system-generate-bandwidth-cluster-id>"
    }
  }
```

{% endtab %}
{% endtabs %}

## 5. 开发者工具

Zenlayer Cloud API 2.0 提供了配套的[开发工具集（SDK）](/api-reference/cn/api-introduction/toolkit.md)，未来会陆续支持更多开发语言，方便快速接入和使用Zenlayer的产品和服务。

## 6. 错误码

下面包含业务逻辑中遇到的错误码，其他错误码见[公共错误码](/api-reference/cn/api-introduction/instruction/commonerrorcode.md)

| HTTP状态码 | 错误码                       | 说明          |
| ------- | ------------------------- | ----------- |
| 404     | INVALID\_CITY\_NOT\_FOUND | 未找到指定带宽包城市。 |
