添加ACL规则
更新时间:2024-12-30
描述
添加ACL规则。
- 单次最多可添加20条规则;
请求结构
Plain Text
1POST /v{version}/acl/rule?clientToken={clientToken} HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4{
5 "aclRules":[
6 {
7 "subnetId":"sbn-svz99ha4a40w",
8 "description":"",
9 "protocol":"tcp",
10 "sourceIpAddress":"192.168.0.0",
11 "destinationIpAddress":"192.168.0.0/20",
12 "sourcePort":"1-65535",
13 "destinationPort":"443",
14 "position":2,
15 "direction":"ingress",
16 "action":"allow"
17 }
18 ]
19}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API版本号,当前取值为1 |
clientToken | String | 否 | Query参数 | 幂等性Token,是一个长度不超过64位的ASCII字符串,详见ClientToken幂等性 |
aclRules | List<AclRuleRequest> | 是 | RequestBody参数 | ACL规则集合 |
返回头域
除公共头域,无其它特殊头域。
返回参数
无特殊返回参数。
请求示例
Plain Text
1POST /v1/acl/rule?clientToken=1849ef6b-f73c-4f5d-b88b-259ca47af849
2Authorization: bce-auth-v1/2edaa258361a11e8912505e5e0ae9978/2018-04-02T02:06:35Z/3600/host;x-bce-date/ afb3250d451c9fcfcf1ab6448582df5d6c67899c53bfaf7f51af883e19dc2879
3Host: bcc.bj.baidubce.com
4{
5 "aclRules" : [ {
6 "subnetId" : "sbn-svz99ha4a40w",
7 "description" : "",
8 "protocol" : "tcp",
9 "sourceIpAddress" : "192.168.0.0",
10 "destinationIpAddress" : "192.168.0.0/20",
11 "sourcePort" : "1-65535",
12 "destinationPort" : "443",
13 "position" : 2,
14 "direction" : "ingress",
15 "action" : "allow"
16 }, {
17 "subnetId" : "sbn-svz99ha4a40w",
18 "description" : "",
19 "protocol" : "tcp",
20 "sourceIpAddress" : "192.168.0.0",
21 "destinationIpAddress" : "192.168.0.0/20",
22 "sourcePort" : "1-65535",
23 "destinationPort" : "500",
24 "position" : 5,
25 "direction" : "ingress",
26 "action" : "allow"
27 } ]
28}
返回示例
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 27e9a3a5-989a-48b8-9833-aacc732f7cba
3Date: Mon, 02 Apr 2018 02:06:36 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS