yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #48579
[Bug 1562067] Re: neutron network-show should display the router
We won't support this on the API. But, I don't think we'd need to
anyway. Let me explain...
In the Neutron model, routers attach to subnets, a part of the network.
If you show the network, it lists the subnets that belong to it:
$ neutron net-show private
+-------------------------+--------------+
| Field | Value |
+-------------------------+--------------+
...
| subnets | c03e61b6-... |
| | 45dec6b6-... |
...
+-------------------------+--------------+
Listing a router's ports will show the subnets to which it is attached:
$ neutron router-port-list router1
+--------------+------------------------------------------------------------------+
| id | fixed_ips |
+--------------+------------------------------------------------------------------+
| 2597d0aa-... | {"subnet_id": "c03e61b6-...", "ip_address": "10.0.0.1"} |
| d40960c3-... | {"subnet_id": "45dec6b6-...", "ip_address": "fd80:a290:1ca0::1"} |
+--------------+------------------------------------------------------------------+
>From here, it is just a matter of iterating over routers which could be
a pain if there are many routers but it is possible. The router-port-
list command simply uses the port GET API [1] and passes the device_id
of the router. Looking at that API, I see we could do better. By
passing network_id instead of the router's device ID, we get a list of
ports on the network. Filtering by
device_owner="network:router_interface" should give just the router
ports connected to the network. Within these ports, the device_id will
be the router id of the router connected. I was able to prove this
works with the existing API using this URL [2] against one of my
devstacks. It worked! From here it is just a matter of iterating the
ports in the result and gather the router id(s) and de-duplicating the
list since one router can have multiple ports on the network.
If anything, this is a neutron client request.
[1] http://developer.openstack.org/api-ref-networking-v2.html#ports
[2] http://10.224.24.226:9696/v2.0/ports?network_id=31c0cb78-a381-405f-9349-6f2f944aec25&device_owner=network:router_interface
** Also affects: python-neutronclient
Importance: Undecided
Status: New
** Changed in: python-neutronclient
Importance: Undecided => Wishlist
** Changed in: neutron
Status: New => Won't Fix
** Summary changed:
- neutron network-show should display the router
+ It is difficult to find routers connected given a neutron network
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1562067
Title:
It is difficult to find routers connected given a neutron network
Status in neutron:
Won't Fix
Status in python-neutronclient:
New
Bug description:
Neutron net-show should display the router the network is attached to
if it is attached to a router. There doesn't appear to be any way to
start with a network name/ID and determine the router that network is
using.
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1562067/+subscriptions
References