私有网络VPC

    添加ACL规则

    描述

    添加ACL规则。

    请求结构

    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"
        }
      ]
    }

    请求头域

    除公共头域外,无其它特殊头域。

    请求参数

    参数名称 类型 是否必需 参数位置 描述
    version String URL参数 API版本号
    clientToken String Query参数 幂等性Token,是一个长度不超过64位的ASCII字符串,详见ClientToken幂等性
    aclRules List<AclRuleRequest> RequestBody参数 ACL规则集合

    返回头域

    除公共头域,无其它特殊头域。

    返回参数

    无特殊返回参数。

    请求示例

    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"
      } ]
    }

    返回示例

    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
    上一篇
    查询ACL
    下一篇
    查询ACL规则