Skip to main content

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


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.4.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asyncnetfsm-0.0.4-py3-none-any.whl (36.0 kB view details)

Uploaded Python 3

File details

Details for the file asyncnetfsm-0.0.4.tar.gz.

File metadata

  • Download URL: asyncnetfsm-0.0.4.tar.gz
  • Upload date:
  • Size: 19.0 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

Hashes for asyncnetfsm-0.0.4.tar.gz
Algorithm Hash digest
SHA256 f7ebbe90f23f06acdeb4d0295f77e9ce7b1fee8b71e6150c905413156ccfe592
MD5 ab399a6014e1b0f15b534b26ebaa1fe0
BLAKE2b-256 e739095ed2c1b7cd672da90d56ef8a49f3397e0179fa2935d771da45e66d396d

See more details on using hashes here.

File details

Details for the file asyncnetfsm-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: asyncnetfsm-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 36.0 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

Hashes for asyncnetfsm-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3954a55396d0971463f51577f53cdbde730a0a355912d009037a477a73c2d66c
MD5 99b8d94eb2a24acef4cee01e58349445
BLAKE2b-256 569a971cf7e24fd4f9581f53edfb16e9f5465a72ff02ca4c36224f69ca15383d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page