# ModifyCrossRegionBandwidth

## 1. API Description

This API is used to modify the configurations of the cross-region bandwidth.

{% hint style="info" %} <mark style="color:blue;">**Note**</mark>

* <mark style="color:blue;">If the network billing model is</mark> <mark style="color:blue;">`ByBandwidth`</mark><mark style="color:blue;">, the new bandwidth cap must be different from the original one.</mark>
* <mark style="color:blue;">If the network billing model is</mark> <mark style="color:blue;">`ByInstanceBandwidth95`</mark><mark style="color:blue;">, one of the bandwidth commitment and the burst bandwidth must be modified at least. If the burst bandwidth is not specified, it is not changed by default.</mark>
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

<table><thead><tr><th width="214.03485107421875">Parameter Name</th><th width="112.4652099609375">Required</th><th width="103.7109375">Type</th><th>Description</th></tr></thead><tbody><tr><td>crossRegionBandwidthId</td><td>Yes</td><td>String</td><td>Cross-region bandwidth ID.</td></tr><tr><td>bandwidth</td><td>Yes</td><td>Integer</td><td>Bandwidth cap.</td></tr><tr><td>bandwidthCap</td><td>No</td><td>Integer</td><td><p>Burst bandwidth.</p><p>Unit: Mbps.</p><p>Available range: [1, +).</p></td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="164.475830078125">Parameter Name</th><th width="92.24285888671875">Type</th><th>Description</th></tr></thead><tbody><tr><td>requestId</td><td>String</td><td>The unique request ID, which is returned for each request. RequestId is required for locating a problem.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. For a cross-region bandwidth with the network billing model of `ByBandwidth`, modify the bandwidth cap to 500 Mbps.**

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

Request：
{
  "crossRegionBandwidthId": "<your cross id>",
  "bandwidth": 500
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3"
  }
}
```

**2. For a cross-region bandwidth with the network billing model of `ByInstanceBandwidth95`, modify the bandwidth commitment to 500 Mbps and the burst bandwidth to 1000 Mbps.**

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

Request：
{
  "crossRegionBandwidthId": "<your cross id>",
  "bandwidth": 500,
  "bandwidthCap": 1000
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3"
  }
}
```

**3. For a cross-region bandwidth with the network model of `ByInstanceBandwidth95`, modify the bandwidth commitment to 500 Mbps and leave the burst bandwidth unchanged.**

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

Request：
{
  "crossRegionBandwidthId": "<your cross id>"
  "bandwidth": 500
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3"
  }
}
```

**4. For a cross-region bandwidth with the network model of `ByInstanceBandwidth95`, modify the burst bandwidth to 1000 Mbps and leave the bandwidth commitment unchanged.**

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

Request：
{
  "crossRegionBandwidthId": "<your cross id>"
  "bandwidthCap": 1000
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3"
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 [SDKs](https://github.com/zenlayer/zenlayercloud-api-doc-en/blob/main/api-introduction/software-toolkit/sdk/introduction.md) to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](https://docs.console.zenlayer.com/api/api-introduction/instruction/commonerrorcode).

<table><thead><tr><th width="170.81463623046875">HTTP Status Code</th><th width="303.75640869140625">Error Code</th><th>Description</th></tr></thead><tbody><tr><td>404</td><td>INVALID_VPC_BANDWIDTH_NOT_FOUND</td><td>Cross-region bandwidth does not exist.</td></tr><tr><td>400</td><td>OPERATION_DENIED_VPC_BANDWIDTH_STATUS</td><td>Cross-region bandwidth state does not allow operation.</td></tr><tr><td>400</td><td>INVALID_PARAMETER_BANDWIDTH</td><td>Invalid bandwidth value.</td></tr></tbody></table>
