批量创建SNAT规则
更新时间:2023-09-11
批量创建SNAT规则
描述
批量创建NAT网关的SNAT规则
请求结构
POST /v{version}/nat/snatRule/batchCreate?clientToken={clientToken} HTTP/1.1
Host: bcc.bj.baidubce.com
Authorization: authorization string
{
"natId": "nat-bzawefgr3mg4",
"snatRules": [
{
"ruleName":"test1",
"publicIpsAddress":["100.88.14.90"],
"sourceCIDR": "192.168.16.0/20"
},
{
"ruleName":"test2",
"publicIpsAddress":["100.88.14.90"],
"sourceCIDR": "192.168.1.0/24"
}
]
}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API版本号,当前取值1 |
clientToken | String | 是 | Query参数 | 幂等性Token,是一个长度不超过64位的ASCII字符串,详见ClientToken幂等性 |
natId | String | 是 | RequestBody参数 | NAT网关的ID |
snatRules | List<SnatRuleRequest> | 是 | RequestBody参数 | 内网IP/网段 |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 | 类型 | 描述 |
---|---|---|
snatRuleIds | List<String> | 创建的SNAT规则的ID集合 |
请求示例
POST /v1/nat/snatRule/batchCreate?clientToken=be31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
Host: bcc.bj.baidubce.com
ContentType: application/json
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2018-07-05T04:17:29Z/3600/ host/74c506f68c65e26c633bfa104c863fffac5190fdepublicIpsAddressc1ec24b7c03eb5d67d2e1de
{
"natId": "nat-bzawefgr3mg4",
"snatRules": [
{
"ruleName":"test1",
"publicIpsAddress":["100.88.14.90"],
"sourceCIDR": "192.168.16.0/20"
},
{
"ruleName":"test2",
"publicIpsAddress":["100.88.14.90"],
"sourceCIDR": "192.168.1.0/24"
}
]
}
返回示例
HTTP/1.1 200 OK
x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
Date: Fri, 06 July 2018 07:06:06 GMT
Content-Type: application/json;charset=UTF-8
Server: BWS
{
"snatRuleIds": [
"rule-zrsaybxm7nrn",
"rule-f5kid5g50nua"
]
}