NSX-T Data Center REST API

List NSGroups

List the NSGroups in a paginated format. The page size is restricted
to 50 NSGroups so that the size of the response remains small even
in the worst case.
Optionally, specify valid member types as request parameter to filter NSGroups.

Request:

Method:
GET
URI Path(s):
/api/v1/ns-groups
Request Headers:
n/a
Query Parameters:
NSGroupListRequestParameters+
Request Body:
n/a

Example Request:

GET https://<nsx-mgr>/api/v1/ ns-groups/ GET https://<nsx-mgr>/api/v1/ ns-groups?member_types=LogicalPort,LogicalSwitch,VirtualMachine

Successful Response:

Response Code:
200 OK
Response Headers:
Content-type: application/json
Response Body:
NSGroupListResult+

Example Response:

{ "sort_ascending": true, "sort_by": "display_name", "result_count": 2, "results": [ { "resource_type": "NSGroup", "id": "71d33895-cebf-4ebe-bb84-5cd6f478cf44", "display_name": "NSGroup-1", "membership_criteria": [ { "resource_type": "NSGroupComplexExpression", "expressions": [ { "resource_type": "NSGroupTagExpression", "scope": "S1", "target_type": "LogicalSwitch", "tag": "T1", "scope_op": "EQUALS", "tag_op": "EQUALS" }, { "resource_type": "NSGroupTagExpression", "scope": "S2", "target_type": "LogicalSwitch", "tag": "T2", "scope_op": "EQUALS", "tag_op": "EQUALS" } ] } ], "members": [ { "resource_type": "NSGroupSimpleExpression", "op": "EQUALS", "target_resource": { "is_valid": true }, "target_type": "LogicalPort", "value": "8a042cca-ea22-4592-a816-c0365acd8a1a", "target_property": "id" } ], "member_count": 1, "_create_user": "admin", "_create_time": 1500424817903, "_last_modified_user": "admin", "_last_modified_time": 1500482503554, "_system_owned": false, "_protection": "NOT_PROTECTED", "_revision": 2 }, { "resource_type": "NSGroup", "id": "b350f55a-efb4-4040-a356-cc8438744e59", "display_name": "NSGroup-2", "membership_criteria": [ { "resource_type": "NSGroupTagExpression", "scope": "S1", "target_type": "LogicalSwitch", "tag": "T1", "scope_op": "EQUALS", "tag_op": "EQUALS" }, { "resource_type": "NSGroupTagExpression", "scope": "S2", "target_type": "LogicalSwitch", "tag": "T2", "scope_op": "EQUALS", "tag_op": "EQUALS" } ], "_create_user": "admin", "_create_time": 1500424859142, "_last_modified_user": "admin", "_last_modified_time": 1500424859148, "_system_owned": false, "_protection": "NOT_PROTECTED", "_revision": 1 } ] } { "sort_ascending": true, "sort_by": "displayName", "result_count": 1, "results": [ { "resource_type": "NSGroup", "id": "a21f8e31-52e9-4790-9574-0c5f52f24096", "display_name": "test-ns-group-4", "members": [ { "resource_type": "NSGroupSimpleExpression", "op": "EQUALS", "target_resource": { "target_display_name": "test-ipset-1", "is_valid": true, "target_type": "IPSet", "target_id": "8c0ab37c-c8db-4d69-99c9-21b6762a86f6" }, "target_type": "IPSet", "value": "8c0ab37c-c8db-4d69-99c9-21b6762a86f6", "target_property": "id" } ], "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": "S3", "tag": "T3" } ] } ], "_create_user": "admin", "_create_time": 1445584267531, "_last_modified_user": "admin", "_system_owned": false, "_last_modified_time": 1445584267531, "_revision": 0 } ] }

Required Permissions:

read

Feature:

groups_groups

Additional Errors: