修改指定CFW规则
更新时间:2022-04-25
描述
修改指定CFW规则。
- 五元组(protocol/sourceAddress/destAddress/sourcePort/destPort) + 方向(direction)不能全部相同。
请求结构
PUT /v{version}/cfw/{cfwId}/rule/{cfwRuleId} HTTP/1.1
Host: cfw.baidubce.com
Authorization: authorization string
{
"ipVersion": 4,
"priority": "1"
......
}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必选 | 参数位置 | 描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API版本号 |
cfwId | String | 是 | URL参数 | CFW策略的id |
cfwRuleId | String | 是 | URL参数 | CFW规则的id |
ipVersion | int | 否 | RequestBody参数 | IP协议类型,取值 [ 4 | 6 ] |
priority | int | 否 | RequestBody参数 | 规则优先级,取值 [ 1-1000 ] |
protocol | String | 否 | RequestBody参数 | 协议类型,取值 [ TCP | UDP | ICMP | ALL ] |
direction | String | 否 | RequestBody参数 | 方向,取值 [ in | out ] |
sourceAddress | String | 否 | RequestBody参数 | 源IP,0.0.0.0/0表示所有 |
destAddress | String | 否 | RequestBody参数 | 目的IP,0.0.0.0/0表示所有 |
sourcePort | String | 否 | RequestBody参数 | 源端口,0-65535表示所有 |
destPort | String | 否 | RequestBody参数 | 目的端口,0-65535表示所有 |
action | String | 否 | RequestBody参数 | 策略,取值 [ allow | deny ] |
description | String | 否 | RequestBody参数 | CFW规则的描述 |
返回头域
除公共头域,无其它特殊头域。
返回参数
无返回参数
请求示例
PUT /v1/cfw/cfw-ynfc7p48bt06/rule/cfwr-bk5m51bnsxwp HTTP/1.1
Host: cfw.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2022-03-23T06:29:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
{
"ipVersion": 4,
"priority": "1",
"protocol": "TCP",
"direction": "in",
"sourceAddress": "192.168.0.1",
"destAddress": "192.168.0.2",
"sourcePort": "80",
"destPort": "88",
"action": "allow",
"description": "cfw_rule_desc"
}
返回示例
HTTP/1.1 200 OK
x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
Date: Thu, 23 Mar 2022 06:29:48 GMT
Content-Type: application/json;charset=UTF-8
Server: BWS