> 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/zec/elastic-ip/modifyeipblockthreshold.md).

# ModifyEipBlockThreshold

## 1. API Description

This API (ModifyEipBlockThreshold) is used to modify the custom blocking thresholds of the elastic IP.

{% hint style="info" %}
**Notes**

* When a threshold exceeds the team quota limit, the interface returns a quota exceeded error. You can apply for an increase on the quota page of the console.
* The modified thresholds can be queried through the `blockInfoList` returned by [DescribeEips](/api-reference/zec/elastic-ip/describeeips.md). Note that the units in the query result are bps, pps, and count, which are different from the units of the request parameters of this interface.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type    | Description                                                                                                                                                                                                                                                                                                                                                 |
| -------------- | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| eipId          | Yes      | String  | <p>ID of the EIP whose blocking threshold is to be modified.</p><p>EIPs of the CIDR block (IP block) type do not support modifying the blocking threshold.</p><p>It can be obtained by calling <a href="/api-reference/zec/elastic-ip/describeeips.md">DescribeEips</a>.</p>                                                                                |
| enable         | Yes      | Boolean | <p>Whether to enable custom blocking thresholds.</p><p>When <code>false</code> is passed, the existing custom thresholds are removed and the system default thresholds are restored. The four thresholds do not need to be passed in this case.</p>                                                                                                         |
| bps            | No       | Integer | <p>Bandwidth blocking threshold. Unit: Mbps.</p><p>The upper limit is controlled by the quota <code>ZEC\_EIP\_Block\_threshold\_bps\_cap</code>.</p><p>When custom thresholds are enabled, at least one of the four thresholds must be passed. Thresholds that are not passed keep their current values.</p><p>Value range: \[10, +)</p>                    |
| pps            | No       | Integer | <p>Packet rate blocking threshold. Unit: kpps.</p><p>The upper limit is controlled by the quota <code>ZEC\_EIP\_Block\_threshold\_pps\_cap</code>.</p><p>When custom thresholds are enabled, at least one of the four thresholds must be passed. Thresholds that are not passed keep their current values.</p><p>Value range: \[500, +)</p>                 |
| inCps          | No       | Integer | <p>Inbound connection rate blocking threshold. Unit: kcps.</p><p>The upper limit is controlled by the quota <code>ZEC\_EIP\_Block\_threshold\_cps\_in\_cap</code>.</p><p>When custom thresholds are enabled, at least one of the four thresholds must be passed. Thresholds that are not passed keep their current values.</p><p>Value range: \[1, +)</p>   |
| outCps         | No       | Integer | <p>Outbound connection rate blocking threshold. Unit: kcps.</p><p>The upper limit is controlled by the quota <code>ZEC\_EIP\_Block\_threshold\_cps\_out\_cap</code>.</p><p>When custom thresholds are enabled, at least one of the four thresholds must be passed. Thresholds that are not passed keep their current values.</p><p>Value range: \[1, +)</p> |

## 3. Output Parameters

| Parameter Name | Type   | Description                                                                                                           |
| -------------- | ------ | --------------------------------------------------------------------------------------------------------------------- |
| requestId      | String | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Enable custom blocking thresholds and set all four items.**

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

Request：
{
    "eipId": "eipId1",
    "enable": true,
    "bps": 20000,
    "pps": 2000,
    "inCps": 100,
    "outCps": 100
}

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

**2. Modify only the bandwidth threshold, keeping the other three items unchanged.**

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

Request：
{
    "eipId": "eipId1",
    "enable": true,
    "bps": 15000
}

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

**3. Disable custom blocking thresholds and restore the system defaults.**

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

Request：
{
    "eipId": "eipId1",
    "enable": false
}

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

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.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](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code                                               | Description                                               |
| ---------------- | -------------------------------------------------------- | --------------------------------------------------------- |
| 404              | INVALID\_EIP\_NOT\_FOUND                                 | Elastic IP does not exist.                                |
| 400              | OPERATION\_DENIED\_EIP\_BLOCK\_CANNOT\_CHANGE\_THRESHOLD | EIP Block does not support modifying blocking thresholds. |
| 400              | OPERATION\_DENIED\_EIP\_BLOCK\_QUOTA\_LIMIT\_EXCEEDED    | The number of EIP Blocks exceeds the quota limit.         |
