Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Adding function for OSPF #216

Open
tcaiazza opened this issue Mar 1, 2017 · 9 comments
Open

Adding function for OSPF #216

tcaiazza opened this issue Mar 1, 2017 · 9 comments

Comments

@tcaiazza
Copy link

tcaiazza commented Mar 1, 2017

I help support a largely OSPF network and would like to add get_ospf_neighbors. I asked on slack if anyone was working on it and didn't hear anyone saying they were. If this is something other want I can try adding it, with the poc in eos.

@mirceaulinic
Copy link
Member

Sure @tcaiazza you can go ahead and submit a PR. Firstly here, in napalm-base, with the feature, doc and tests. Thanks!

@mirceaulinic mirceaulinic added this to the APPROVED milestone Mar 1, 2017
@dbarrosop
Copy link
Member

@tcaiazza if you are not in a hurry, I'd suggest waiting a month/month-and-a-half. I am ironing out the OpenConfig framework and it would be great if we could implement OSPF directly within that framework.

@tcaiazza
Copy link
Author

tcaiazza commented Mar 3, 2017

@dbarrosop I'm not in a big rush, just looking to automate device upgrades and checkouts and will need support for OSPF to do so. Also just interested in getting involved in the napalm project.

@dbarrosop
Copy link
Member

Sorry for the late response, that is great. I will try to compile the OSPF models this weekend and give you some info about it.

@dbarrosop
Copy link
Member

@tcaiazza took some time but all the pieces are in place now. You can find a summary of resources for napalm-yang here:

https://www.dravetech.com/blog/2017/04/09/napalm-yang.html

The ospf model is inside the network_instance. For example:

In [1]: import napalm_yang

In [2]: root = napalm_yang.base.Root()

In [3]: root.add_model(napalm_yang.models.openconfig_network_instance)

In [4]: root.network_instances.network_instance.add("default")
Out[4]: <pyangbind.lib.yangtypes.YANGBaseClass object at 0x11162a650>

In [5]: root.network_instances.network_instance["default"].protocols.protocol.add("ospf ospf")
Out[5]: <pyangbind.lib.yangtypes.YANGBaseClass object at 0x11288ae68>

In [6]: import pprint

In [7]: pprint.pprint(root.network_instances.network_instance["default"].protocols.protocol["ospf ospf"].ospfv2.get())
{'areas': {'area': {}},
 'global': {'config': {'hide-transit-only-networks': False,
                       'igp-shortcuts': False,
                       'log-adjacency-changes': False,
                       'router-id': u'',
                       'summary-route-cost-mode': u'RFC2328_COMPATIBLE'},
            'graceful-restart': {'config': {'enabled': False,
                                            'helper-only': False},
                                 'state': {'enabled': False,
                                           'helper-only': False}},
            'inter-area-propagation-policies': {'inter-area-propagation-policy': {}},
            'mpls': {'config': {'traffic-engineering-extensions': False},
                     'igp-ldp-sync': {'config': {'enabled': False,
                                                 'post-session-up-delay': 0L},
                                      'state': {'enabled': False,
                                                'post-session-up-delay': 0L}},
                     'state': {'traffic-engineering-extensions': False}},
            'state': {'hide-transit-only-networks': False,
                      'igp-shortcuts': False,
                      'log-adjacency-changes': False,
                      'router-id': u'',
                      'summary-route-cost-mode': u'RFC2328_COMPATIBLE'},
            'timers': {'lsa-generation': {'config': {'initial-delay': 0L,
                                                     'maximum-delay': 0L},
                                          'state': {'initial-delay': 0L,
                                                    'maximum-delay': 0L,
                                                    'timer-type': u''}},
                       'max-metric': {'config': {'include': [],
                                                 'set': False,
                                                 'timeout': 0L,
                                                 'trigger': []},
                                      'state': {'include': [],
                                                'set': False,
                                                'timeout': 0L,
                                                'trigger': []}},
                       'spf': {'config': {'initial-delay': 0L,
                                          'maximum-delay': 0L},
                               'state': {'initial-delay': 0L,
                                         'maximum-delay': 0L,
                                         'timer-type': u''}}}}}

Feel free to ping me on slack if/when you start working on this and I will give you a hand getting started.

@tcaiazza
Copy link
Author

@dbarrosop Thanks I'll take a look later this week, was out last week. From the looks of it, I would have to write the translator and profile pieces in the napalm-yang repo, is that correct?

@dbarrosop
Copy link
Member

Yes, that is correct, ping me on slack if you get stuck as I might need to help you there to get you started (not much documentation yet). Also, I am writing a tool to generate a skeleton for the profiles automatically but it's not finished yet. Will try to finish this week, otherwise, you are going to hate me as the network-instance model is insanely large.

@dbarrosop
Copy link
Member

@tcaiazza what's the status of this one? Is this something you still need or that you are working on?

@tcaiazza
Copy link
Author

tcaiazza commented May 30, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants