> 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/security/alarm/events/describelogs.md).

# DescribeIpBlockEvents

## 1. 接口描述

本接口（DescribeIpBlockEvents）用于查询IP封堵事件列表。

## 2. 请求参数

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

<table><thead><tr><th>参数名称</th><th width="107">必选</th><th width="157">类型</th><th>描述</th></tr></thead><tbody><tr><td>startTime</td><td>是</td><td>Timestamp</td><td>开始时间，时间格式：yyyy-MM-ddTHH:mm:ssZ。</td></tr><tr><td>endTime</td><td>是</td><td>Timestamp</td><td>结束时间，时间格式：yyyy-MM-ddTHH:mm:ssZ。</td></tr><tr><td>ip</td><td>否</td><td>String</td><td>封堵的IP。</td></tr></tbody></table>

## 3. 响应结果

| 参数名称      | 类型                                                                             | 描述                                                    |
| --------- | ------------------------------------------------------------------------------ | ----------------------------------------------------- |
| requestId | String                                                                         | <p>唯一请求 ID。<br>每次请求都会返回。定位问题时需要提供该次请求的 requestId。</p> |
| dataList  | Array of [IpBlockEventInfo](/api-reference/cn/security/alarm/datastructure.md) | 结果集。                                                  |

## 4. 代码示例

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

1. **查询IP封堵事件列表。**

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

Request:
{
    "startTime":"2023-07-26T16:00:00Z",
    "endTime":"2023-08-03T15:59:59Z",
    "ip":"10.1.1.1"
}

Response:
{
  "requestId": "T83B6A963-B111-4BF9-8466-1C3351E2DFD1",
  "dataList": [
        {
            "ip": "10.1.1.1",
            "region": "area-shanghai-1",
            "resourceGroup": "resourceGroup-1",
            "blockTime": "2023-07-28T16:00:00Z",
            "unblockTime": "2023-07-29T16:00:00Z",
            "divertMode": "automatically"
        }
 ]
}
```

{% 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)
