> 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/zga/resource-group/modifyresourcegroupbandwidthlimit.md).

# ModifyResourceGroupBandwidthLimit

## 1. 接口描述

本接口(ModifyResourceGroupBandwidthLimit)用于修改资源组中加速器共享带宽限速。

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

* 共享带宽限速需要将配置下发到全球各接入点，一般情况下需要 4-6 分钟才可生效。
  {% endhint %}

## 2. 请求参数

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

| 参数名称            | 必选 | 类型      | 描述                                                                                                                         |
| --------------- | -- | ------- | -------------------------------------------------------------------------------------------------------------------------- |
| resourceGroupId | 是  | String  | 资源组 ID。                                                                                                                    |
| enable          | 是  | Boolean | <p>是否开启资源组限速。</p><p>若不开启资源组限速，则以<a href="/api-reference/cn/zga/datastructure.md#accelerateregioninfo">加速区域</a>设置的限速为准。</p> |
| bandwidth       | 是  | Integer | <p>共享带宽限速，</p><p>单位: Mbps，最小值 1。</p><p>最大值为账号设置的最大限速。</p>                                                                  |

## 3. 响应结果

| 参数名称            | 类型     | 描述                                         |
| --------------- | ------ | ------------------------------------------ |
| requestId       | String | 唯一请求 ID，每次请求都会返回。定位问题时需要提供该次请求的 requestId。 |
| resourceGroupId | String | 资源组 ID。                                    |

## 4. 代码示例

{% tabs %}
{% tab title="示例" %}

1. **修改资源组加速器共享带宽限速**

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

Request:
{
    "resourceGroupId": "233676f3-d984-49d2-8b29-0f4065fbc79c",
    "enable": true,
    "bandwidth": 10
}

Response:
{
  "requestId": "T6883FCD0-3E7D-44EA-A517-A421A52A27F4",
  "response": {
    "requestId": "T6883FCD0-3E7D-44EA-A517-A421A52A27F4",
    "resourceGroupId": "233676f3-d984-49d2-8b29-0f4065fbc79c"
  }
}
```

{% 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 状态码 | 错误码                   | 说明                |
| -------- | --------------------- | ----------------- |
| 400      | NO\_ENOUGH\_BANDWIDTH | 带宽限速传参大于账号允许的最大限速 |
