Management Plane API > Networking > Logical Switching > Logical Switch Ports

List All Logical Ports

Returns information about all configured logical switch ports. Logical
switch ports connect to VM virtual network interface cards (NICs). Each
logical port is associated with one logical switch.

Request:

Method:
GET
URI Path(s):
/api/v1/logical-ports
Request Headers:
n/a
Query Parameters:
LogicalPortListParameters+
Request Body:
n/a

Example Request:

GET https://<nsx-mgr>/api/v1/logical-ports

Successful Response:

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

Example Response:

{ "result_count": 2, "results": [ { "id": "2f904690-355a-4900-841e-645b3d7fee91", "display_name": "2f904690-355a-4900-841e-645b3d7fee91", "resource_type": "LogicalPort", "address_bindings": [], "logical_switch_id": "849e339e-64b7-47cb-9480-33068f70dc5a", "admin_state": "UP", "attachment": { "id": "f941da72-2b4a-4212-9183-74029d41377e", "attachment_type": "VIF" }, "switching_profile_ids": [ { "value": "49781ebb-6f76-464a-9a7e-c365ba26128b", "key": "IpDiscoverySwitchingProfile" }, { "value": "fad98876-d7ff-11e4-b9d6-1681e6b88ec1", "key": "SpoofGuardSwitchingProfile" }, { "value": "93b4b7e8-f116-415d-a50c-3364611b5d09", "key": "PortMirroringSwitchingProfile" }, { "value": "fbc4fb17-83d9-4b53-a286-ccdf04301888", "key": "SwitchSecuritySwitchingProfile" }, { "value": "f313290b-eba8-4262-bd93-fab5026e9495", "key": "QosSwitchingProfile" } ], "_last_modified_user": "system", "_last_modified_time": 1435282553271, "_create_time": 1435282553249, "_system_owned": true, "_create_user": "system", "_revision": 1 }, { "id": "9467676a-aeae-46f7-90f1-c771e02d1669", "display_name": "9467676a-aeae-46f7-90f1-c771e02d1669", "resource_type": "LogicalPort", "address_bindings": [], "logical_switch_id": "849e339e-64b7-47cb-9480-33068f70dc5a", "admin_state": "UP", "attachment": { "id": "65332f8d-efa2-4dd9-9c92-39ca0bfb1966", "attachment_type": "VIF" }, "switching_profile_ids": [ { "value": "49781ebb-6f76-464a-9a7e-c365ba26128b", "key": "IpDiscoverySwitchingProfile" }, { "value": "fad98876-d7ff-11e4-b9d6-1681e6b88ec1", "key": "SpoofGuardSwitchingProfile" }, { "value": "93b4b7e8-f116-415d-a50c-3364611b5d09", "key": "PortMirroringSwitchingProfile" }, { "value": "fbc4fb17-83d9-4b53-a286-ccdf04301888", "key": "SwitchSecuritySwitchingProfile" }, { "value": "f313290b-eba8-4262-bd93-fab5026e9495", "key": "QosSwitchingProfile" } ], "_last_modified_user": "system", "_last_modified_time": 1435282426932, "_create_time": 1435282426867, "_system_owned": true, "_create_user": "system", "_revision": 1 } ] }

Required Permissions:

read

Feature:

switching_ports

Additional Errors: