napalm-automation / napalm

Network Automation and Programmability Abstraction Layer with Multivendor support
Apache License 2.0
2.26k stars 554 forks source link

Missing route-target information in get_network_instances #502

Open afourmy opened 7 years ago

afourmy commented 7 years ago

This issue follows the discussion we had in https://github.com/napalm-automation/napalm/pull/497 (implementation of get_network_instances for IOS). As of now, the get_network_instances contains the Route Distinguisher and the list of interfaces of the VRF.

It would useful to have also the route-targets, namely which RT are imported and exported for each AFI. Cisco and Juniper don't manage the import/export of RT in the same fashion (with Cisco, route-maps can be used to define which RT are imported/export, and how (by changing the community or extcommunities); we can try to think of a vendor-agnostic output despite that.

dbarrosop commented 7 years ago

@mirceaulinic as discussed in the PR, is this something you know and/or can take to the openconfig meeting?

mirceaulinic commented 6 years ago

Sure thing, I will bring this on the next OC agenda. Thanks!

nickrusso42518 commented 5 years ago

I see this has not yet been implemented and I have a need for it. I am noodling around now because I've already solved the route-target parsing problem for a specific use case on IOS.

https://github.com/nickrusso42518/vpnm/blob/master/plugins/filter/filter.py

I'd be willing to submit a PR for IOS and IOS-XR assuming I can get it working, although I probably won't try to "follow" route-map RT application. Many of those RT applications are IP prefix or BGP community-specific and would be very hard to represent without massively complicating the structured data returned. Just returning the RTs present in the VRF configuration by address-family would be a huge step forward.