napalm-automation / napalm-junos

Apache License 2.0
22 stars 42 forks source link

Add ability to view routes in a particular table #157

Open pshemk opened 7 years ago

pshemk commented 7 years ago

issue #156

pshemk commented 7 years ago

pull request #157

mirceaulinic commented 7 years ago

Hi @pshemk - thanks for your contribution.

We have thought about this improvement, see https://github.com/napalm-automation/napalm-base/issues/174. Another thing we wanted to tackle is adding a new field inside the output: next_hop_type. Do you think you could do that too? Please note that this is an API change and we'll nee to implement the changes in two more drivers: iosxr and eos.

pshemk commented 7 years ago

I've renamed table to 'vrf'. I realise that for consistency we should use vrf, but in junos a vrf can have multiple tables, so this might be a tad confusing too.

What is 'next_hop_type' in this context? It looks like the current implementation pulls out all the route properties already:

            "route_to": {
                "13.107.16.0/24": [
                    {
                        "age": 527044,
                        "current_active": true,
                        "inactive_reason": "",
                        "last_active": true,
                        "next_hop": "10.69.2.29",
                        "outgoing_interface": "xe-0/0/1.100",
                        "preference": 170,
                        "protocol": "BGP",
                        "protocol_attributes": {
                            "as_path": "8075 8068",
                            "communities": [
                                "23655:100",
                                "23655:202"
                            ],
                            "local_as": 23655,
                            "local_preference": 130,
                            "metric": 100,
                            "metric2": 839,
                            "preference2": -131,
                            "remote_address": "10.69.0.253",
                            "remote_as": 23655
                        },
                        "routing_table": "InternetCombined.inet.0",
                        "selected_next_hop": true
                    },
mirceaulinic commented 7 years ago

@pshemk this is pending clarification under https://github.com/napalm-automation/napalm-base/issues/174. Meanwhile, you could amend your commits to make sure you're using your email address and github can link them to your account.

pshemk commented 7 years ago

the commits have correct username now.