Add ACL rule
Updated at:2025-10-16
Description
Add an Access Control List (ACL) rule.
- Up to 20 rules can be added per operation;
Request structure
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}
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| version | String | Yes | URL parameter | For API version No., the current value is 1 |
| clientToken | String | No | Query | Idempotence token, which is an ASCII string with a length not exceeding 64 bits, see details in [ClientToken Idempotence Support](VPC/API Reference/General Description.md#Idempotence) |
| aclRules | List<[AclRuleRequest](VPC/API Reference/Appendix.md#AclRuleRequest)> | Yes | RequestBody | Collection of ACL rules |
Response headers
No special headers are required beyond the standard ones.
Response parameters
No special response parameters are available.
Request example
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}
Response example
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
