napalm-automation-community / napalm-oneaccess-oneos

NAPALM community driver for OneAccess OneOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

napalm-oneaccess-oneos

PyPI version Python Tests

NAPALM

NAPALM (Network Automation and Programmability Abstraction Layer with Multivendor support) is a Python library that implements a set of functions to interact with different router vendor devices using a unified API.

NAPALM supports several methods to connect to the devices, to manipulate configurations or to retrieve data.

napalm-oneaccess-oneos

NAPALM driver for Ekinops OneAccess devices (OneAccess was acquired by Ekinops in 2017)

Connection to the device is done through a SSH or telnet connection using the netmiko librairy.

Supported devices

All OneAccess devices running OneOS v5.x or OneOS v6.x (CLI commands are mostly indentical between OS5 and OS6)

On your device you can check your OneOS version with the command "show version"

Supported functions

  • ✅ is_alive()
  • ✅ get_facts()
  • ✅ get_interfaces()
  • ✅ get_interfaces_ip()
  • ✅ get_environment()
  • ✅ get_arp_table()
  • ✅ get_config()
  • ✅ get_users()
  • ✅ cli()

Functions definition can be found here

Installation

You can install the driver using pip:

pip install napalm-oneaccess-oneos

Usage

You can use this driver like this:

from napalm import get_network_driver

oneos_driver = get_network_driver("oneaccess_oneos")
device = oneos_driver("192.168.2.1", "admin", "password")
device.open()
print(device.get_facts())

If you want to custom some connection parameter, for example the transport protocol or the port connected to the device, you should use the optional_args argument (its attributes derivate from netmiko)

from napalm import get_network_driver

oneos_driver = get_network_driver("oneaccess_oneos")
conn_args = {
    "port": 2333,
    "transport": "telnet"
}
device = oneos_driver("192.168.10.2", "admin", "password",optional_args=conn_args)
device.open()
print(device.get_interfaces_ip())

Tests

You can execute the unit tests using Pytest:

Run all tests

pytest

Run a specific test (example)

pytest -sk test_get_environment[os6]

Notes: Tests only supported with NAPALM >= 4.0.0

Contributing

If you would like to contribute to this project please contact Robin Guillat (robin@guillat.com)

About

NAPALM community driver for OneAccess OneOS

License:Apache License 2.0


Languages

Language:Python 100.0%