https://github.com/selfuryon/netdev
Asynchronous multi-vendor library for interacting with network devices
https://github.com/selfuryon/netdev
async asyncssh automation cisco hpe juniper netdev netmiko network python python-3
Last synced: 5 months ago
JSON representation
Asynchronous multi-vendor library for interacting with network devices
- Host: GitHub
- URL: https://github.com/selfuryon/netdev
- Owner: selfuryon
- License: apache-2.0
- Archived: true
- Created: 2016-06-11T17:46:07.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-08-19T23:42:20.000Z (almost 4 years ago)
- Last Synced: 2025-01-20T09:52:06.838Z (5 months ago)
- Topics: async, asyncssh, automation, cisco, hpe, juniper, netdev, netmiko, network, python, python-3
- Language: Python
- Homepage: http://netdev.readthedocs.io/
- Size: 372 KB
- Stars: 214
- Watchers: 20
- Forks: 46
- Open Issues: 23
-
Metadata Files:
- Readme: README.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
THIS PROJECT IS UNMAINTAINED
****************************
I'm not interested in this project anymore, sorry.
I don't work as an network engineer anymore so I haven't any special goals to improve and maintain it.Netdev
******Asynchronous multi-vendor library for interacting with network devices
Inspired by netmiko
Requires:
---------
* asyncio
* AsyncSSH
* Python >=3.5
* pyYAML
Supports:
---------
* Cisco IOS
* Cisco IOS XE
* Cisco IOS XR
* Cisco ASA
* Cisco NX-OS
* Cisco SG3XX
* HP Comware (like V1910 too)
* Fujitsu Blade Switches
* Mikrotik RouterOS
* Arista EOS
* Juniper JunOS
* Aruba AOS 6.X
* Aruba AOS 8.X
* Terminal
* Alcatel AOSExamples:
---------
Example of interacting with Cisco IOS devices:.. code-block:: python
import asyncio
import netdevasync def task(param):
async with netdev.create(**param) as ios:
# Testing sending simple command
out = await ios.send_command("show ver")
print(out)
# Testing sending configuration set
commands = ["line console 0", "exit"]
out = await ios.send_config_set(commands)
print(out)
# Testing sending simple command with long output
out = await ios.send_command("show run")
print(out)
# Testing interactive dialog
out = await ios.send_command("conf", pattern=r'\[terminal\]\?', strip_command=False)
out += await ios.send_command("term", strip_command=False)
out += await ios.send_command("exit", strip_command=False, strip_prompt=False)
print(out)async def run():
dev1 = { 'username' : 'user',
'password' : 'pass',
'device_type': 'cisco_ios',
'host': 'ip address',
}
dev2 = { 'username' : 'user',
'password' : 'pass',
'device_type': 'cisco_ios',
'host': 'ip address',
}
devices = [dev1, dev2]
tasks = [task(dev) for dev in devices]
await asyncio.wait(tasks)loop = asyncio.get_event_loop()
loop.run_until_complete(run())