Management Plane API > Security > Services > Firewall

Create a Section with Rules

Creates a new firewall section with rules. The limit on the number of
rules is defined by maxItems in collection types for FirewallRule
(FirewallRuleXXXList types). When invoked on a section with a large number
of rules, this API is supported only at low rates of invocation (not more
than 4-5 times per minute). The typical latency of this API with about 1024
rules is about 4-5 seconds. This API should not be invoked with large
payloads at automation speeds. More than 50 rules with a large number of
rule references is not supported.

Instead, to create sections, use:
POST /api/v1/firewall/sections

To create rules, use:
POST /api/v1/firewall/sections/<section-id>/rules

Request:

Method:
POST
URI Path(s):
/api/v1/firewall/sections?action=create_with_rules
Request Headers:
n/a
Query Parameters:
FirewallInsertParameters+
Request Body:
FirewallSectionRuleList+

Example Request:

POST https://<nsx-mgr>/api/v1/firewall/sections?action=create_with_rules&operation=insert_bottom { "section_type":"LAYER3", "display_name":"another Layer3 Section with Rules", "stateful":true, "rules":[ { "display_name":"layer3rule1", "action":"ALLOW", "direction":"IN_OUT", "sources": [ { "target_display_name": "192.168.100.5", "is_valid": true, "target_type": "IPv4Address", "target_id": "192.168.100.5" } ], "destinations": [ { "target_display_name": "192.168.100.6", "is_valid": true, "target_type": "IPv4Address", "target_id": "192.168.100.5" } ] } ] }

Successful Response:

Response Code:
201 Created
Response Headers:
Content-type: application/json
Response Body:
FirewallSectionRuleList+

Example Response:

{ "resource_type": "FirewallSectionRuleList", "id": "3222f90e-921c-46ea-be64-99b1c0c51838", "display_name": "another Layer3 Section with Rules", "section_type": "LAYER3", "is_default": false, "stateful": true, "rule_count": 1, "rules": [ { "id": "1430528", "display_name": "layer3rule1", "destinations_excluded": false, "sources": [ { "target_display_name": "192.168.100.5", "is_valid": true, "target_type": "IPv4Address", "target_id": "192.168.100.5" } ], "destinations": [ { "target_display_name": "192.168.100.5", "is_valid": true, "target_type": "IPv4Address", "target_id": "192.168.100.5" } ], "ip_protocol": "IPV4_IPV6", "logged": false, "action": "ALLOW", "sources_excluded": false, "disabled": false, "direction": "IN_OUT", "_revision": 0 } ], "locked": false, "_create_time": 1446242294559, "_last_modified_user": "admin", "_system_owned": false, "_last_modified_time": 1446242294559, "_create_user": "admin", "_revision": 0 }

Required Permissions:

crud

Feature:

firewall_general

Additional Errors: