> 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/sdn/cloud-connect/describecloudavailablebandwidthtiers.md).

# DescribeCloudAvailableBandwidthTiers

## 1. 接口描述

本接口(DescribeCloudAvailableBandwidthTiers)用于查询云连接可用带宽阶梯。

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

* 修改云连接带宽限速时请使用cloudPortId参数查询目标云连接可用的带宽阶梯。
* 若返回结果为空说明云连接当前暂无可用带宽。
  {% endhint %}

## 2. 请求参数

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

| 参数名称           | 必选 | 类型                                                                    | 描述                                                                          |
| -------------- | -- | --------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| cloudType      | 否  | [CloudType](/api-reference/cn/sdn/datastructure.md#cloudtype)         | 云连接类型（AWS、TENCENT、GOOGLE、AZURE、ALI\_CLOUD、HUAWEI\_CLOUD、BYTE\_PLUS、ORACLE）。 |
| cloudRegionId  | 否  | String                                                                | 公有云区域 ID（Google 云无需传参）。                                                     |
| dcId           | 否  | String                                                                | 连接云接入点的数据中心 ID。                                                             |
| vlanId         | 否  | Integer                                                               | <p>VLAN ID。</p><p>可选值范围：\[2, 4000]</p>                                      |
| cloudPortId    | 否  | String                                                                | <p>云连接 ID。</p><p>修改云连接带宽限速时使用，传入后其他参数将被忽略。</p>                              |
| cloudAccountId | 否  | String                                                                | 云平台账号（Google 为 Pairing Key，Azure 为 Service Key）。                            |
| zoneColor      | 否  | [DiversityZone](/api-reference/cn/sdn/datastructure.md#diversityzone) | 可用区标识。                                                                      |

## 3. 响应结果

| 参数名称                    | 类型               | 描述                                                       |
| ----------------------- | ---------------- | -------------------------------------------------------- |
| requestId               | String           | <p>唯一请求 ID。</p><p>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| availableBandwidthTiers | Array of Integer | 云连接可用的带宽阶梯列表。                                            |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}
**1. 创建时查询可用的带宽阶梯**

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

Request：
{
    "cloudType": "AWS",
    "cloudRegionId": "us-east-1",
    "dcId": "0cd74ed4-e0cf-43c8-9c9b-567a1287227a",
    "vlanId": 1024,
    "cloudPortId": null,
    "cloudAccountId": null,
    "zoneColor": null
}

Response：
{
    "requestId": "T266C5563-6D98-42E9-8E62-84DF5849F8EC",
    "response": {
        "requestId": "T266C5563-6D98-42E9-8E62-84DF5849F8EC",
        "availableBandwidthTiers": [
            50,
            100,
            200,
            300,
            400,
            500,
            1000,
            2000,
            5000
        ]
    }
}
```

**2. 修改云连接限速时查询可用的带宽阶梯**

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

Request：
{
    "cloudPortId": "your-cloud-port-id"
}

Response：
{
    "requestId": "T266C5563-6D98-42E9-8E62-84DF5849F8EC",
    "response": {
        "requestId": "T266C5563-6D98-42E9-8E62-84DF5849F8EC",
        "availableBandwidthTiers": [
            50,
            100,
            200,
            300,
            400,
            500,
            1000,
            2000,
            5000
        ]
    }
}
```

{% 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\_CLOUD\_PORT\_NOT\_FOUND       | 云端口不存在。   |
| 400     | INVALID\_CLOUD\_ENDPOINT\_NOT\_SUPPORT | 暂不支持该云类型。 |
