设置IP访问限频
更新时间:2021-01-25
限制IP单节点的每秒访问次数,这里的设置针对所有的路径。本接口用于设置IP访问限频。
| Method | Path | 说明 |
|---|---|---|
| PUT | /v2/dsa/domain/{domain}/config?action=setAntiAttack | 限制IP单节点的每秒访问次数 |
domain: 加速域名
请求体(Request Body)
| 参数 | 可选 | 类型 | 说明 |
|---|---|---|---|
| antiAttack | 必选 | antiAttack | IP访问限频控制 |
antiAttack:
| 参数 | 可选 | 类型 | 说明 |
|---|---|---|---|
| enabled | 必选 | bool | true表示开启IP单节点访问限频,false表示取消限频 |
| data | 必选 | List< limit> | enabled为false此项无意义 |
limit:
| 参数 | 可选 | 类型 | 说明 |
|---|---|---|---|
| limit | 必选 | int | 1秒内单个IP节点请求次数上限 |
响应码 (Http Status Code)
| HTTP Status Code | 说明 |
|---|---|
| 200 | 成功 |
| 400 | 参数错误等 |
请求示例
Plain Text
1PUT /v2/dsa/domain/myself.baidu.com/config?action=setAntiAttack HTTP/1.1
2Host: cdn.baidubce.com
3Content-Length: 45
4Content-Type: application/json
5
6{
7 "antiAttack": {
8 "enable": true,// 关闭 false
9 "data": [
10 {
11 "limit": 1000
12 }
13 ]
14 }
15}
响应示例
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json; charset=utf-8
3Transfer-Encoding: chunked
4
5{
6 "status":"OPERATING"
7}
