Management Plane API > Networking > Services > Policy Based Routing

Create a Section with Rules

Creates a new PBR section with rules. The limit on the number of
rules is defined by maxItems in collection types for PBRRule
(PBRRuleXXXList 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/pbr/sections

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

Request:

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

Example Request:

POST https://<nsx-mgr>/api/v1/pbr/sections?action=create_with_rules&operation=insert_bottom { "display_name":"RDS-vpc-5b4cf63d", "rules":[ { "display_name":"PBR-RDS-vpc-5b4cf63d", "action":"ROUTE_TO_UNDERLAY_NAT", "destinations": [ { "target_display_name": "RDS-vpc-5b4cf63d", "is_valid": true, "target_type": "IPSet", "target_id": "96ebbc9f-6eae-4009-b709-532820dbba2a" } ] }, { "display_name": "PBR-S3-vpc-5b4cf63d", "action":"ROUTE_TO_OVERLAY_NAT", "sources": [ { "target_display_name": "S3", "is_valid": true, "target_type": "IPSet", "target_id": "abcbbc9f-6eae-4009-b709-532820dbba2a" } ] } ] }

Successful Response:

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

Example Response:

{ "resource_type": "PBRSectionRuleList", "id": "3222f90e-921c-46ea-be64-99b1c0c51838", "display_name": "RDS-vpc-5b4cf63d", "rule_count": 2, "rules": [ { "id": "1430528", "display_name": "PBR-RDS-vpc-5b4cf63d", "destinations": [ { "target_display_name": "RDS-vpc-5b4cf63d", "is_valid": true, "target_type": "IPSet", "target_id": "96ebbc9f-6eae-4009-b709-532820dbba2a" } ], "logged": false, "action": "ROUTE_TO_UNDERLAY_NAT", "disabled": false, "_revision": 0 }, { "id": "1430529", "display_name": "PBR-S3-vpc-5b4cf63d", "sources": [ { "target_display_name": "S3", "is_valid": true, "target_type": "IPSet", "target_id": "abcbbc9f-6eae-4009-b709-532820dbba2a" } ], "logged": false, "action": "ROUTE_TO_UNDERLAY_NAT", "disabled": false, "_revision": 0 } ], "_create_time": 1446242294559, "_last_modified_user": "system", "_system_owned": true, "_last_modified_time": 1446242294559, "_create_user": "system", "_revision": 0 }

Required Permissions:

crud

Feature:

pbr

Additional Errors: