Skip to main content

A python asyncio implementation for VTY protocol

Project description

Description

aiovty is an asynchronous implementation of the VTY protocol.

Installation

Install the last released version using pip:

python3 -m pip install --user -U aiovty

Or install the latest version from sources:

git clone git@github.com:matan1008/aiovty.git
cd aiovty
python3 -m pip install --user -U -e .

Usage

To create a client, you need to supply the server's prompt name (e.g. 'Router'):

from aiovty import AioVtyClient

vty = AioVtyClient('Router')

Then you can connect giving address:

connection_string = await vty.connect('127.0.0.1', 23)

Note that connecting returns the "connection string", which is the data sent before the first prompt.

After connection you can send your command:

command_response = await vty.command(b'show ip')

You can also enter enabled mode:

await vty.enable()

And initialize a configure terminal:

await vty.configure_terminal()
await vty.command(b'router rip')
print(vty.node)  # Prints `config-router`

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

aiovty-0.0.3.tar.gz (14.7 kB view hashes)

Uploaded Source

Built Distribution

aiovty-0.0.3-py3-none-any.whl (14.8 kB view hashes)

Uploaded Python 3

Supported by

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