Skip to main content

A set of wrapper libraries and command line tools for interacting with Cisco's CML or VIRL2 application

Project description

AutoCML

Authentication

This library (and associated scripts) supports authentication via environment variables. This library supports a variety of different variable names, meant to suit the different names Cisco already uses.

Purpose This Library VIRL Library Breakout Tool Example
CML Controller CML_HOST VIRL2_URL BREAKOUT_CONTROLLER 192.168.0.50
Username CML_USER VIRL2_USER BREAKOUT_USERNAME admin
Password (Base-64) CML_PASS64 cGFzc3dvcmQ=
Password CML_PASS VIRL2_PASS BREAKOUT_PASSWORD password

Any combination of the above variables can be used, although the leftmost variable name will be prioritized in case of conflicts. Using CML_PASS64 is recommended (and prioritized over other password variables) to prevent the likelyhood of successful shoulder-surfers.

Bash example

CML_HOST="<cml server hostname/IP address>"
CML_USER="admin"
CML_PASS="password"

Note: Above example uses a plaintext password. I first recommend converting it to base64, then passing it in a CML_PASS64 environment variable.

Installing

The following should work in both Linux/Bash, and PowerShell.

pip install virl2-client # Install official VIRL/CML library from Cisco
pip install autocml # Install this library + associated utilities

Scripts

This library includes common scripts/commands useful for administrative purposes, or for automating common lab scenarios.

cml-add-users

Loads in a CSV file containing a list of users (a sample CSV can be saved by running cml-add-users --template <OUTPUT TEMPLATE FILENAME>

By default, it adds the users in the csv file to the authenticated CML instance. It only adds/affects users that do not already exist.

Can also delete users that are listed in the csv, if a --delete flag is passed.

Example template:

Username,Password,Full Name,Description,Roles,Groups
user1,plaintext password,User One,The first user,admin,admin_group
user2,another_password,User Two,The second user,,"net378,net123"

Example usage: cml-add-users <USER CSV FILENAME>

View help info for more details (cml-add-users --help)

(Currently untested as the primary author does not have admin access to a multi-user instance)

cml-verify-ints

Asserts a lab's interfaces against a .csv file. The csv file must have exactly three columns, (device ID/label, interface, and IP address (with optional CIDR notation)) and may look like the following:

Node Label,Int,IPv4
n0,GigabitEthernet0/0,192.168.0.24/26
R2,Fa0/2,10.1.34.2/24
R3,L1,10.255.0.3/32

One ran, it will print a report showing which interfaces match, or do not match. Interfaces not listed will not be checked.

Can also dump a CSV of interfaces, that can later be used with this utility to double-check interface addresses.

Also has a flag to emit results as JSON, although it cannot read in JSON inputs.

cml-bulk-labs

Allows for downloading/uploading/deleting lab YAMLs in bulk for archival purposes. Useful when migrating YAML labs files from one CML controller to another (like for a fresh upgrade).

View the help for detailed configuration options/features (cml-bulk-labs --help)

cml-dump-cfgs (WIP)

cml-dump-cmds (WIP)

cml-dump-pings (WIP)

cml-pcap (WIP)

cml-start-session (WIP)

Opens a tabbed terminal emulator to have a tab for each node's console within a lab.

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

autocml-0.0.5.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

autocml-0.0.5-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file autocml-0.0.5.tar.gz.

File metadata

  • Download URL: autocml-0.0.5.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for autocml-0.0.5.tar.gz
Algorithm Hash digest
SHA256 ed5ed80af1d29b24fb0204b425e2196f9eb10a2baa60c02b8dae3456ab5ca8ad
MD5 9af9fa3362e9b309b1b845da95d9d1de
BLAKE2b-256 1d5dafded04046b3807310687e8af0044c79ab8e5d412bc807bf0d022802d43a

See more details on using hashes here.

File details

Details for the file autocml-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: autocml-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for autocml-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 49d826f901d5110c2db9d276d7f75c1db1d047f61a9df4e71180aa378065b213
MD5 4cffaab685b8a01ffa62e68eced65585
BLAKE2b-256 9f429380e931d37a91ed40ec3f46ef086f7cd71154210751b80b71c53783b762

See more details on using hashes here.

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