An implementation of Cisco pyATS
Project description
pyYAHTS
An interpretation of pyATS
pyYAHTS is a dyanmic, on-demand, YAML-free / testbed.yaml free, implementation of pyATS.
It works with any IOS / IOS-XE / IOS-XR / NXOS device!
The results are Rich JSON printed to the screen
Requirements
pyYAHTS is an extension of pyATS, which is required, and only runs on Linux operating systems
Installation
- pip install pyYAHTS
Getting Started
pyYAHTS works on any Cisco OS IOS / IOS-XE / IOS-XR / NXOS
pyYAHTS requires the follow options be speficied at runtime:
-
(Required) Hostname of the device - must exactly match the configured hostname
-
(Required) Operating System - Either ios, iosxe, iosxr, or nxos
-
(Required) Username
-
(Required) Password
-
(Required) Command - Either a pyATS Learn Function, such as ospf, or any supported pyATS Parsed CLI Show Command, such as "show ip interface brief"
-
(Optional) Filetype - Creates an output file -
Supported filetpyes: JSON, YAML, HTML, Datatable HTML, Markdown, PDF, CSV
-
(Optional) Email - 3 required fields if you want to e-mail the output with GMail
--from_email - Your GMail Address
--email_password - Your Gmail Password
--to_email - The recipients Email
For a list of supported Learn Functions please visit Available Learn Functions
For a list of supported Parsers please visit Available Show Command Parsers
A sample of "Show IP Interface" Parsers for IOS-XE
Using pyYAHTS
In any virtual environment with pyATS installed pyYAHTS can be executed several ways
- Prompted Inputs
(virtualenv)$ pyYAHTS
Hostname: dist-sw01
OS (ios, iosxe, iosxr, nxos): nxos
Username: cisco
Password:
Command: ospf
- Directly supplying options
(virtualenv)$ pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf
- Mixing supplied options and prompted responses
(virtualenv)$ pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco
Command: ospf
Creating Output files
If you include the optional --filetype flag you can create JSON and YAML files from the data
pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype json
pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype yaml
pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype html
pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype datatable
pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype markdown
pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype pdf
pyYAHTS --hostname dist-sw01 --os nxos --username cisco --password cisco --command ospf --filetype csv
E-Mail Network State
If you include the optional E-Mail flags you can send the network state data using GMail
You will have to enable IMAP permissions on your GMail Account Enable IMAP in GMail
You may also have to enable support for Less Secure Apps
The three required flags to send an email are:
--from_email - Your GMail Address
--email_password - Your Gmail Password
--to_email - The recipients Email
Additonally if you specify a filetype (--filetype) the output file will be automatically attached to the email
Help
pyYAHTS includes a handy Rich Click Help! Simple type:
$ pyYAHTS --help
Contact
Please reach out on Twitter Twitter or open an issue if you hit any snags or have any questions!
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
Built Distribution
File details
Details for the file pyYAHTS-1.0.23.tar.gz
.
File metadata
- Download URL: pyYAHTS-1.0.23.tar.gz
- Upload date:
- Size: 93.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.3 Linux/5.4.72-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31b8f1181a4ef708d04e1c053efa75c9cd81c6029b1df5d362f52a635389912c |
|
MD5 | a32afa762e10e85397bb2d9b61a6ee8e |
|
BLAKE2b-256 | 611771b31680ef9c713f2a50b7f6d20e578a5123c772a5b4f3504172c8f41504 |
File details
Details for the file pyYAHTS-1.0.23-py3-none-any.whl
.
File metadata
- Download URL: pyYAHTS-1.0.23-py3-none-any.whl
- Upload date:
- Size: 96.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.10.3 Linux/5.4.72-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 346ea695a59998af10db8b4c7fb65f1d8dcbe5de4d03fdb9d8e3fa20e53e580c |
|
MD5 | 951eeb41e332717a79b3113fb1e3a620 |
|
BLAKE2b-256 | d97f2b8887d187d6d6f8b185b3b929b7059d6e6c065886371f8f70ecd0a88dd0 |