Skip to content

Commit

Permalink
Merge pull request #88 from GGabriele/ios_branch
Browse files Browse the repository at this point in the history
Started adding IOS support
  • Loading branch information
dbarrosop committed Dec 2, 2015
2 parents 2236153 + 41c8ee0 commit 129a35e
Show file tree
Hide file tree
Showing 9 changed files with 648 additions and 23 deletions.
48 changes: 25 additions & 23 deletions docs/support/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@ General support matrix
----------------------


===================== ========== ============= =========== ============== ============= ============
_ EOS JunOS IOS-XR FortiOS IBM NXOS
===================== ========== ============= =========== ============== ============= ============
**Driver Name** eos junos iosxr fortios ibm nxos
**Structured data** Yes Yes No No Yes Yes
**Minimum version** 4.15.0F 12.1 5.1.0 5.2.0 ??? 6.1
**Backend library** `pyeapi`_ `junos-eznc`_ `pyIOSXR`_ `pyFG`_ `bnclient`_ `pycsco`_
**Caveats** :doc:`eos` :doc:`fortios` :doc:`ibm` :doc:`nxos`
===================== ========== ============= =========== ============== ============= ============
===================== ========== ============= =========== ============== ============= ============ ============
_ EOS JunOS IOS-XR FortiOS IBM NXOS IOS
===================== ========== ============= =========== ============== ============= ============ ============
**Driver Name** eos junos iosxr fortios ibm nxos ios
**Structured data** Yes Yes No No Yes Yes No
**Minimum version** 4.15.0F 12.1 5.1.0 5.2.0 ??? 6.1 ???
**Backend library** `pyeapi`_ `junos-eznc`_ `pyIOSXR`_ `pyFG`_ `bnclient`_ `pycsco`_ `netmiko`_
**Caveats** :doc:`eos` :doc:`fortios` :doc:`ibm` :doc:`nxos` :doc:`ios`
===================== ========== ============= =========== ============== ============= ============ ============

.. _pyeapi: https://github.com/arista-eosplus/pyeapi
.. _junos-eznc: https://github.com/Juniper/py-junos-eznc
.. _pyIOSXR: https://github.com/fooelisa/pyiosxr
.. _pyFG: https://github.com/spotify/pyfg
.. _bnclient: https://github.com/kderynski/blade-netconf-python-client
.. _pycsco: https://github.com/jedelman8/pycsco
.. _netmiko: https://github.com/ktbyers/netmiko


.. warning:: Please, make sure you understand the caveats for your particular platforms before using the library.
Expand All @@ -29,14 +30,14 @@ _ EOS JunOS IOS-XR FortiOS
Configuration support matrix
----------------------------

===================== ========== ===== ========== ============== ============= ==============
_ EOS JunOS IOS-XR FortiOS IBM NXOS
===================== ========== ===== ========== ============== ============= ==============
**Config. replace** Yes Yes Yes Yes Yes [#c3]_ Yes
**Config. merge** Yes Yes Yes Yes Yes Yes
**Compare config** Yes Yes Yes [#c1]_ Yes [#c1]_ Yes [#c1]_ Yes [#c4]_
**Atomic Changes** Yes Yes Yes No [#c2]_ No [#c2]_ Yes/No [#c5]_
**Rollback** Yes [#c2]_ Yes Yes Yes Yes [#c2]_ Yes/No [#c5]_
===================== ========== ===== ========== ============== ============= ============== ==============
_ EOS JunOS IOS-XR FortiOS IBM NXOS IOS
===================== ========== ===== ========== ============== ============= ============== ==============
**Config. replace** Yes Yes Yes Yes Yes [#c3]_ Yes No
**Config. merge** Yes Yes Yes Yes Yes Yes Yes
**Compare config** Yes Yes Yes [#c1]_ Yes [#c1]_ Yes [#c1]_ Yes [#c4]_ Yes
**Atomic Changes** Yes Yes Yes No [#c2]_ No [#c2]_ Yes/No [#c5]_ No [#c2]_
**Rollback** Yes [#c2]_ Yes Yes Yes Yes [#c2]_ Yes/No [#c5]_ Yes
===================== ========== ===== ========== ============== ============= ==============

.. [#c1] Hand-crafted by the API as the device doesn't support the feature.
Expand All @@ -55,12 +56,12 @@ Getters support matrix
.. |yes| unicode:: U+02705 .. Yes
.. |no| unicode:: U+0274C .. No

====================== ===== ===== ====== ======= ====== ======
_ EOS JunOS IOS-XR FortiOS IBM NXOS
====================== ===== ===== ====== ======= ====== ======
**get_facts** |yes| |yes| |yes| |yes| |no| |yes|
**get_interfaces** |yes| |yes| |yes| |yes| |no| |yes|
**get_lldp_neighbors** |yes| |yes| |yes| |yes| |no| |yes|
====================== ===== ===== ====== ======= ====== ====== ======
_ EOS JunOS IOS-XR FortiOS IBM NXOS IOS
====================== ===== ===== ====== ======= ====== ====== ======
**get_facts** |yes| |yes| |yes| |yes| |no| |yes| |yes|
**get_interfaces** |yes| |yes| |yes| |yes| |no| |yes| |yes|
**get_lldp_neighbors** |yes| |yes| |yes| |yes| |no| |yes| |yes|
====================== ===== ===== ====== ======= ====== ======

Caveats
Expand All @@ -73,3 +74,4 @@ Caveats
fortios
ibm
nxos
ios
32 changes: 32 additions & 0 deletions docs/support/ios.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
IOS
----


Prerequisites
_____________

IOS has no native API to play with, that's the reason why we used the Netmiko library to interact with it.
Having Netmiko installed in your working box is a prerequisite.

Notes on configuration comparing
_____

Using the ``compare_config()`` method, we'll have in return a list of commands that will be merged with the current configuration.
Since no configuration replacement's been implremented, this is the only comparison we can obtain.

Notes on configuration merging
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Merges are currently implemented by simply applying the the merge config line by line.
As a result, merges are **not atomic**.

Notes on configuration rollback
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

There is no magic here. Since IOS doesn't support any checkpoint config, what we can do is removing all the commands from the previous commit.
The 'no' keyword will be added to each command and it will be sent again. The system is smart enough to understand parent/child commands.

Anyway, there might be some problems with commands like **description abc 123** since the command to remove would be **no description** but the system
would send **no description abc 123** instead.


2 changes: 2 additions & 0 deletions napalm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from fortios import FortiOSDriver
from nxos import NXOSDriver
from ibm import IBMDriver
from ios import IOSDriver

def get_network_driver(vendor):
driver_mapping = {
Expand All @@ -30,6 +31,7 @@ def get_network_driver(vendor):
'FORTIOS': FortiOSDriver,
'NXOS': NXOSDriver,
'IBM': IBMDriver,
'IOS' : IOSDriver,
}
try:
return driver_mapping[vendor.upper()]
Expand Down

0 comments on commit 129a35e

Please sign in to comment.