Management Plane API >
Security
>
Services
>
Service Insertion
Add Multiple Rules in a Section
Create multiple serviceinsertion rules in existing serviceinsertion section bounded by
limit of 1000 serviceinsertion rules per section.
Request:
Method:
POST
URI Path(s):
/api/v1/serviceinsertion/sections/<section-id>/rules?action=create_multiple
Request Headers:
n/a
Query Parameters:
ServiceInsertionInsertParameters
+
ServiceInsertionInsertParameters
(
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:
ServiceInsertionRuleList
+
ServiceInsertionRuleList
(
schema
)
Name
Description
Type
Notes
rules
List of the ServiceInsertion rules
List of ServiceInsertion rules in the section. Only homogeneous rules are supported.
array of
ServiceInsertionRule
Required
Maximum items: 1000
Example Request:
POST https://<nsx-mgr>/api/v1/serviceinsertion/sections/2111d18f-27ba-4f19-a51d-2173c3972410/rules?action=create_multiple { "rules" : [ { "display_name": "L3 redirect rule1", "action":"REDIRECT", "direction":"IN_OUT", "redirect_tos": [ { "target_display_name": "service-1", "is_valid": true, "target_type": "ServiceInstance", "target_id": "1d9fb5cb-0344-4d7f-899a-afd93276899f" } ], "sources": [ { "target_display_name": "192.168.100.7", "is_valid": true, "target_type": "IPv4Address", "target_id": "192.168.100.7" } ], "applied_tos": [ { "target_display_name": "plr1_uplink1", "is_valid": true, "target_type": "LogicalRouterPort", "target_id": "bd91fc7f-cd76-438b-8d4f-21dbdc707af7" } ], "destinations": [ { "target_display_name": "192.168.100.8", "is_valid": true, "target_type": "IPv4Address", "target_id": "192.168.100.8" } ] }, { "display_name": "L3 redirect rule2", "action":"REDIRECT", "direction":"IN_OUT", "redirect_tos": [ { "target_display_name": "service-1", "is_valid": true, "target_type": "ServiceInstance", "target_id": "1d9fb5cb-0344-4d7f-899a-afd93276899f" } ], "sources": [ { "target_display_name": "192.168.100.9", "is_valid": true, "target_type": "IPv4Address", "target_id": "192.168.100.9" } ], "applied_tos": [ { "target_display_name": "plr1_uplink1", "is_valid": true, "target_type": "LogicalRouterPort", "target_id": "bd91fc7f-cd76-438b-8d4f-21dbdc707af7" } ], "destinations": [ { "target_display_name": "192.168.100.9", "is_valid": true, "target_type": "IPv4Address", "target_id": "192.168.100.9" } ] } ] }
Successful Response:
Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
ServiceInsertionRuleList
+
ServiceInsertionRuleList
(
schema
)
Name
Description
Type
Notes
rules
List of the ServiceInsertion rules
List of ServiceInsertion rules in the section. Only homogeneous rules are supported.
array of
ServiceInsertionRule
Required
Maximum items: 1000
Example Response:
{ "rules": [ { "id": "58368", "display_name": "L3 redirect rule1", "section_id": "2111d18f-27ba-4f19-a51d-2173c3972410", "destinations_excluded": false, "redirect_tos": [ { "target_display_name": "service-1", "is_valid": true, "target_type": "ServiceInstance", "target_id": "1d9fb5cb-0344-4d7f-899a-afd93276899f" } ], "sources": [ { "target_display_name": "192.168.100.7", "is_valid": true, "target_type": "IPv4Address", "target_id": "192.168.100.7" } ], "destinations": [ { "target_display_name": "192.168.100.8", "is_valid": true, "target_type": "IPv4Address", "target_id": "192.168.100.8" } ], "applied_tos": [ { "target_display_name": "plr1_uplink1", "is_valid": true, "target_type": "LogicalRouterPort", "target_id": "bd91fc7f-cd76-438b-8d4f-21dbdc707af7" } ], "ip_protocol": "IPV4_IPV6", "logged": false, "sources_excluded": false, "disabled": false, "action":"REDIRECT", "direction":"IN_OUT", "_revision": 3 }, { "id": "715776", "display_name": "L3 redirect rule2", "section_id": "2111d18f-27ba-4f19-a51d-2173c3972410", "destinations_excluded": false, "redirect_tos": [ { "target_display_name": "service-1", "is_valid": true, "target_type": "ServiceInstance", "target_id": "1d9fb5cb-0344-4d7f-899a-afd93276899f" } ], "sources": [ { "target_display_name": "192.168.100.9", "is_valid": true, "target_type": "IPv4Address", "target_id": "192.168.100.9" } ], "destinations": [ { "target_display_name": "192.168.100.9", "is_valid": true, "target_type": "IPv4Address", "target_id": "192.168.100.9" } ], "applied_tos": [ { "target_display_name": "plr1_uplink1", "is_valid": true, "target_type": "LogicalRouterPort", "target_id": "bd91fc7f-cd76-438b-8d4f-21dbdc707af7" } ], "ip_protocol": "IPV4_IPV6", "logged": false, "sources_excluded": false, "disabled": false, "action":"REDIRECT", "direction":"IN_OUT", "_revision": 3 } ] }
Required Permissions:
crud
Feature:
service_insertion
Additional Errors:
301 Moved Permanently
307 Temporary Redirect
400 Bad Request
403 Forbidden
409 Conflict
500 Internal Server Error
503 Service Unavailable