NAT网关 NAT-批量创建DNAT规则:请求示例

时间:2023-12-01 09:09:59

请求示例

批量创建规则(第一条为指定端口的规则,第二条为all port类型的规则)。

POST https://{Endpoint}/v2/d199ba7e0ba64899b2e81518104b1526/dnat_rules/batch

{
  "dnat_rules" : [ {
    "floating_ip_id" : "bf99c679-9f41-4dac-8513-9c9228e713e1",
    "nat_gateway_id" : "cda3a125-2406-456c-a11f-598e10578541",
    "port_id" : "9a469561-daac-4c94-88f5-39366e5ea193",
    "internal_service_port" : 993,
    "protocol" : "tcp",
    "external_service_port" : 242,
    "description" : "my dnat rule 01"
  }, {
    "floating_ip_id" : "cf99c679-9f41-4dac-8513-9c9228e713e1",
    "nat_gateway_id" : "dda3a125-2406-456c-a11f-598e10578541",
    "private_ip" : "192.168.1.100",
    "internal_service_port" : 0,
    "protocol" : "any",
    "external_service_port" : 0,
    "description" : "my dnat rule 01"
  } ]
}
support.huaweicloud.com/api-natgateway/BatchCreateNatGatewayDnatRules.html