Management Plane API > Networking > Services > Loadbalancer

Create a load balancer rule

Create a load balancer rule.

Request:

Method:
POST
URI Path(s):
/api/v1/loadbalancer/rules
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
LbRule+

Example Request:

POST https://<nsx-mgr>/api/v1/loadbalancer/rules { "resource_type": "LbRule", "display_name": "URIRewriteRule", "description": "Sample URI rewrite rule", "match_conditions" : [{ "type": "LbHttpRequestUriCondition", "match_type": "REGEX", "uri": "/news/(?<year>\\d+)/(?<month>\\d+)/(?<article>.*)", "inverse": false }], "match_strategy" : "ALL", "phase" : "HTTP_REQUEST_REWRITE", "actions" : [{ "type": "LbHttpRequestUriRewriteAction", "uri": "/news/$year-$month-$article" }] }

Successful Response:

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

Example Response:

{ "resource_type" : "LbRule", "id" : "b6a5bffa-f6a9-447c-936f-4633f9eb43a7", "display_name": "URIRewriteRule", "description": "Sample URI rewrite rule", "match_conditions" : [{ "type": "LbHttpRequestUriCondition", "match_type": "REGEX", "uri": "/news/(?<year>\\d+)/(?<month>\\d+)/(?<article>.*)", "inverse": false }], "match_strategy" : "ALL", "phase" : "HTTP_REQUEST_REWRITE", "actions" : [{ "type": "LbHttpRequestUriRewriteAction", "uri": "/news/$year-$month-$article", "uri_arguments": "" }] "_create_time" : 1478304339963, "_create_user" : "admin", "_last_modified_user" : "admin", "_system_owned" : false, "_last_modified_time" : 1478304339963, "_revision" : 0 }

Required Permissions:

crud

Feature:

lb_rules

Additional Errors: