-
Notifications
You must be signed in to change notification settings - Fork 48
Enhance get_route_to
#174
Comments
Remind me, what is |
As the name states, it is the type of the next hop. E.g. NULL routes have the next hop type "discard". Also, the type of the next hop can be an interface etc. |
To me it seems we are encoding arbitrary information but maybe I am misunderstanding it.
Examples from different platforms?
Is the type "interface" or an interface? If it's the latter this is clearly the wrong construct. "Ethernet1" is not a type, it's an interface. If you are using arbitrary interface names as type, how can I distinguish that the next hop is of type interface? To me it seems more natural to have
|
Indeed, having more specific names rather than a generic But how would you represent: |
I don't think having a field
Sorry, the "data" on my previous comment had a "bug". |
I recently got a similar use case so circirling back on this one. I mean for junos it's fine we can use key to filter table name if we want specific vrf. But for ios it seems we don't even have this api imported. Any reason? Also for ios, we most use vrf kw or we won't get table in specific vrf. adding @ktbyers to further comment. |
Sorry, I dropped the ball here, I will try to revisit this issue during the week of 17th.
Yes, the reasoning is that nobody submitted any code to add this method. I know you have the skills required, so please go ahead and provide an implementation, if you're willing to @sincerywaing :-) |
I guess the difficult part for ios is that you need parse everything!@mirceaulinic I'll start looking into this :) |
I spent some time looking into this and found it is really complicated to list every attribute for ios -
e.g. no interface shown here
However when there is load balancing and interface, from same device but different protocol
|
so a better implementation would be separate the output to two parts - Part I start from beginning to 'last update' to parse protocol, distance, metric, routing_table; Part II strat from 'Routing descriptor blocks' to the end to return a list of dict including next_hop, age, interface(if any) and protocol_spec arguments. Finally it will look like -
Thoughts? If we are comfortable with this proposal, I'll start look into this. |
@mirceaulinic what's your take on this? I think doing backwards compatible changes like the one you suggested is fine but I don't think we should do backwards incompatible changes as @sincerywaing is suggesting. I am not suggesting his changes don't make sense (which they might) but I think that if we are planning to make backwards incompatible changes we should:
|
This is a sound idea, but I wasn't able to identify if there's any model available yet for the routes state. But sure, that's the long term solid solution. For the short term, given that the method already exists, and @sincerywaing's question is specifically about IOS, we can implement this one easily. Some fields can be returned though:
This information is available -- the
No problem: as long as the device is able to give you this information, we can execute another request to retrieve this data.
This is another request, depending on the protocol. Thoughts? |
Ok, somehow I misunderstood @sincerywaing and I thought he was suggesting changing the current model. |
Two proposed additions:
vrf
next_hop_type
key inside the output dictThe text was updated successfully, but these errors were encountered: