Management Plane API > Networking > Logical Routing And Services > Logical Router Ports

List Logical Router Ports

Returns information about all logical router ports. Information includes the
resource_type (LogicalRouterUpLinkPort, LogicalRouterDownLinkPort,
LogicalRouterLinkPort, LogicalRouterLoopbackPort, LogicalRouterCentralizedServicePort);
logical_router_id (the router to which each logical router port is assigned);
and any service_bindings (such as DHCP relay service).
The GET request can include a query parameter (logical_router_id
or logical_switch_id).

Request:

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

Example Request:

GET https://<nsx-mgr>/api/v1/logical-router-ports?logical_router_id=723c1e3e-c82c-4243-bba0-2e1ef4815143

Successful Response:

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

Example Response:

{ "cursor": "003681096324-23ba-408e-ae24-294a7ba07f60web-tier router", "result_count": 2, "results": [ { "resource_type": "LogicalRouterLinkPort", "_revision": 0, "id": "770ffb50-44f7-4d8c-a359-de0af1088932", "service_bindings": [ { "service_id": "dc5804f7-fdd9-4ef6-b5f8-80b1494ca183", "resource_type": "DhcpRelayService" } ] "logical_router_id": "b676dec7-5d78-4492-9b16-cb7cdcf65328", "_last_modified_user": "admin", "_last_modified_time": 1415746635953, "_create_time": 1415746635953, "_create_user": "admin" "resource_type": "LogicalRouterDownLinkPort", "id": "87db83ed-9a73-436b-91f1-a2a793ffaa31", "display_name": "app-tier router", "logical_router_id": "723c1e3e-c82c-4243-bba0-2e1ef4815143", "mac_address": "02:50:56:56:44:52", "linked_logical_switch_port_id": { "target_display_name": "5a3f8696-e7ed-4e01-9fa6-eba1db8d7371", "is_valid": true, "target_type": "LogicalPort", "target_id": "5a3f8696-e7ed-4e01-9fa6-eba1db8d7371" }, "subnets": [ { "ip_addresses": [ "172.16.20.1" ], "prefix_length": 24 } ], "_last_modified_time": 1457984402672, "_create_time": 1457984402672, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 0 }, { "resource_type": "LogicalRouterLinkPortOnTIER1", "description": "Port created on Tier-1 router for 'overlay-router'(ID: 723c1e3e-c82c-4243-bba0-2e1ef4815143)", "id": "6cafb2ac-27d1-415c-916a-b37e6b8a32e1", "display_name": "tier1 router link port", "logical_router_id": "723c1e3e-c82c-4243-bba0-2e1ef4815143", "mac_address": "02:50:56:00:00:04", "linked_logical_router_port_id": { "target_display_name": "tier0 router link port", "is_valid": true, "target_type": "LogicalRouterLinkPortOnTIER0", "target_id": "48f78319-00e4-47b1-b721-6c3d43df821c" }, "edge_cluster_member_index": [ 0 ], "subnets": [ { "ip_addresses": [ "100.126.240.1" ], "prefix_length": 31 } ], "_last_modified_time": 1457984951916, "_create_time": 1457984404360, "_last_modified_user": "admin", "_system_owned": false, "_create_user": "admin", "_revision": 1 } ] }

Required Permissions:

read

Feature:

routing_routers

Additional Errors: