Management Plane API >
Networking
>
Services
>
Policy Based Routing
Add Multiple Rules in a Section
Create multiple PBR rules in existing PBR section bounded by
limit of 1000 PBR rules per section.
Request:
Method:
POST
URI Path(s):
/api/v1/pbr/sections/<section-id>/rules?action=create_multiple
Request Headers:
n/a
Query Parameters:
PBRInsertParameters
+
PBRInsertParameters
(
schema
)
Name
Description
Type
Notes
id
Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'.
string
Maximum length: 64
operation
Operation
string
Enum: insert_top, insert_bottom, insert_after, insert_before
Default: "insert_top"
Request Body:
PBRRuleList
+
PBRRuleList
(
schema
)
Name
Description
Type
Notes
rules
List of the PBR rules
List of PBR rules in the section.
array of
PBRRule
Required
Maximum items: 1000
Example Request:
POST https://<nsx-mgr>/api/v1/pbr/sections/2111d18f-27ba-4f19-a51d-2173c3972410/rules?action=create_multiple { "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 }, { "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 } ] }
Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
PBRRuleList
+
PBRRuleList
(
schema
)
Name
Description
Type
Notes
rules
List of the PBR rules
List of PBR rules in the section.
array of
PBRRule
Required
Maximum items: 1000
Example Response:
{ "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": 3 }, { "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": 3 } ] }
Required Permissions:
crud
Feature:
pbr
Additional Errors:
301 Moved Permanently
307 Temporary Redirect
400 Bad Request
403 Forbidden
409 Conflict
500 Internal Server Error
503 Service Unavailable