simply its Netdev with textFSM
Project description
AsyncNetFSM
Asynchronous multi-vendor library for interacting with network devices
Inspired by netdev
Requires:
- asyncio
- AsyncSSH
- Python >=3.5
- pyYAML
Supports:
- Cisco IOS
- Cisco IOS XE
- Cisco IOS XR
- Cisco ASA
- Cisco NX-OS
- HP Comware (like V1910 too)
- Fujitsu Blade Switches
- Mikrotik RouterOS
- Arista EOS
- Juniper JunOS
- Aruba AOS 6.X
- Aruba AOS 8.X
- Terminal
Examples:
Example of interacting with Cisco IOS devices:
.. code-block:: python
import asyncio
import asyncnetfsm
async def task(param):
async with asyncnetfsm.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())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asyncnetfsm-0.0.9.tar.gz
(19.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asyncnetfsm-0.0.9.tar.gz.
File metadata
- Download URL: asyncnetfsm-0.0.9.tar.gz
- Upload date:
- Size: 19.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e86d02b96a97aa256e2eff5c131d7ccf0de63b14b251473eb0cc37710298036d
|
|
| MD5 |
d1b24619acd6c6d5552e278ee517cb48
|
|
| BLAKE2b-256 |
9e0eb441644878797d50aa25bf787072fa2879ffb4a2d94bc75779fb5c29ce3b
|
File details
Details for the file asyncnetfsm-0.0.9-py3-none-any.whl.
File metadata
- Download URL: asyncnetfsm-0.0.9-py3-none-any.whl
- Upload date:
- Size: 36.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81d4615aa5d347e864a267e3ec64c4ea63571bb481741630e9a0c71bb6ddfd41
|
|
| MD5 |
1f47d788f151b768524585503ed32080
|
|
| BLAKE2b-256 |
8747877e3cc5c522d34b8a28050ef3651962a3f690bd26fb45af562f2996a4be
|