NSX-T Data Center REST API
Create NSGroup
Creates a new NSGroup that can group NSX resources - VIFs, Lportsand LSwitches as well as the grouping objects - IPSet, MACSet and other
NSGroups.
For NSGroups containing VM criteria(both static and dynamic), system VMs will
not be included as members. This filter applies at VM level only.
Exceptions are as follows:
1. LogicalPorts and VNI of System VMs will be included in NSGroup if the criteria
is based on LogicalPort, LogicalSwitch or VNI directly.
Request:
Method:
              POST
            URI Path(s):
              
              
                  
                  /api/v1/ns-groups
                  
              
            Request Headers:
                n/a
            Query Parameters:
    n/a
  Request Body:
    NSGroup+
  Example Request:
POST https://<nsx-mgr>/api/v1/ns-groups { "display_name":"testNSGroup", "members":[ { "resource_type": "NSGroupSimpleExpression", "target_type": "IPSet", "target_property": "id", "op": "EQUALS", "value": "183e372b-854c-4fcc-a24e-05721ce89a60" } ], "membership_criteria": [ { "resource_type": "NSGroupComplexExpression", "expressions": [ { "resource_type": "NSGroupTagExpression", "target_type": "LogicalPort", "scope": "S1", "tag": "T1" }, { "resource_type": "NSGroupTagExpression", "target_type": "LogicalPort", "scope": "S2", "tag": "T2" } ] }, { "resource_type": "NSGroupTagExpression", "target_type": "LogicalSwitch", "scope": "S1", "tag": "T1" } ] }Successful Response:
Response Code:
                201 Created
              Response Headers:
                  
                  Content-type: application/json
                Response Body:
    NSGroup+