# DescribeCloudAvailableBandwidthTiers

## 1. 接口描述

调用本接口查询云连接可用的带宽阶梯信息。

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

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

## 2. 请求参数

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

<table><thead><tr><th width="177">名称</th><th width="115.17791411042944">类型</th><th width="125">必选</th><th>描述</th></tr></thead><tbody><tr><td>cloudPortId</td><td>String</td><td>否</td><td>云连接ID。修改云连接带宽限速时请使用该参数，其他参数将被忽略。</td></tr><tr><td>cloudType</td><td>String</td><td>否</td><td><p>云连接类型。可选值：</p><ul><li>AWS</li><li>TENCENT</li><li>GOOGLE</li><li>AZURE</li><li>ALI_CLOUD</li><li>HUAWEI_CLOUD</li><li>BYTE_PLUS</li><li>ORACLE</li></ul></td></tr><tr><td>cloudAccountId</td><td>String</td><td>否</td><td>云平台账号。<br>Google 云此处为Pairing Key，如何获取请参考<a href="https://docs.console.zenlayer.com/welcome/cloud-networking/get-started/validate-connection-in-public-cloud/google-cloud-configuration">Google云配置</a>。<br>Azure 云此处为Service Key。如何获取请参考<a href="https://docs.console.zenlayer.com/welcome/cloud-networking/get-started/validate-connection-in-public-cloud/microsoft-azure-cloud-configuration">Azure云配置</a>。</td></tr><tr><td>cloudRegionId</td><td>String</td><td>否</td><td>公有云区域ID。<br>Google云无需传参</td></tr><tr><td>dcId</td><td>String</td><td>否</td><td>连接云接入点的数据中心ID。</td></tr><tr><td>vlanId</td><td>Integer</td><td>否</td><td>VLAN ID。</td></tr></tbody></table>

## 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
}

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）](https://docs.console.zenlayer.com/api-reference/cn/api-introduction/toolkit)，未来会陆续支持更多开发语言，方便快速接入和使用Zenlayer的产品和服务。

## 6. 错误码

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

| HTTP状态码 | 错误码                              | 说明      |
| ------- | -------------------------------- | ------- |
| 404     | INVALID\_CLOUD\_PORT\_NOT\_FOUND | 云连接不存在。 |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/api-reference/cn/networking/sdn/cloud/describecloudavailablebandwidthtiers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
