Add ACL Rules
Last Updated:2020-07-20
Description
Add ACL rules.
Request Structure
POST /v{version}/acl/rule?clientToken={clientToken} HTTP/1.1
Host: bcc.bj.baidubce.com
Authorization: authorization string
{
"aclRules":[
{
"subnetId":"sbn-svz99ha4a40w",
"description":"",
"protocol":"tcp",
"sourceIpAddress":"192.168.0.0",
"destinationIpAddress":"192.168.0.0/20",
"sourcePort":"1-65535",
"destinationPort":"443",
"position":2,
"direction":"ingress",
"action":"allow"
}
]
}
Request Header
There are no other special headers except the public headers.
Request Parameter
Parameter name | Type | Required or not | Parameter position | Description |
---|---|---|---|---|
version | String | Yes | URL parameter | API version number |
clientToken | String | No | Query parameter | Idempotence Token is an ASCII string with length not exceeding 64 bytes, for details, please see ClientToken Idempotence |
aclRules | List<AclRuleRequest> | Yes | RequestBody parameter | ACL rule set |
Return Header
There are no other special headers except the public headers.
Return Parameter
There is no special return parameter.
Request Example
POST /v1/acl/rule?clientToken=1849ef6b-f73c-4f5d-b88b-259ca47af849
Authorization: bce-auth-v1/2edaa258361a11e8912505e5e0ae9978/2018-04-02T02:06:35Z/3600/host;x-bce-date/ afb3250d451c9fcfcf1ab6448582df5d6c67899c53bfaf7f51af883e19dc2879
Host: bcc.bj.baidubce.com
{
"aclRules" : [ {
"subnetId" : "sbn-svz99ha4a40w",
"description" : "",
"protocol" : "tcp",
"sourceIpAddress" : "192.168.0.0",
"destinationIpAddress" : "192.168.0.0/20",
"sourcePort" : "1-65535",
"destinationPort" : "443",
"position" : 2,
"direction" : "ingress",
"action" : "allow"
}, {
"subnetId" : "sbn-svz99ha4a40w",
"description" : "",
"protocol" : "tcp",
"sourceIpAddress" : "192.168.0.0",
"destinationIpAddress" : "192.168.0.0/20",
"sourcePort" : "1-65535",
"destinationPort" : "500",
"position" : 5,
"direction" : "ingress",
"action" : "allow"
} ]
}
Return Example
HTTP/1.1 200 OK
x-bce-request-id: 27e9a3a5-989a-48b8-9833-aacc732f7cba
Date: Mon, 02 Apr 2018 02:06:36 GMT
Server: BWS
Content-Type: application/json;charset=UTF-8