Skip to main content

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.

Metadata

Release files for autocml 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autocml 0.0.5
File Size Uploaded Provenance
autocml-0.0.5.tar.gz 22.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for autocml 0.0.5
File Interpreter ABI Platform
autocml-0.0.5-py3-none-any.whl Python 3 none any Details

Total release size: 45.6 kB

Release files / autocml-0.0.5.tar.gz

Download URL autocml-0.0.5.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ed5ed80af1d29b24fb0204b425e2196f9eb10a2baa60c02b8dae3456ab5ca8ad
BLAKE2b-256 checksum
How to use checksums
1d5dafded04046b3807310687e8af0044c79ab8e5d412bc807bf0d022802d43a
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / autocml-0.0.5-py3-none-any.whl

Download URL autocml-0.0.5-py3-none-any.whl
Size 23.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49d826f901d5110c2db9d276d7f75c1db1d047f61a9df4e71180aa378065b213
BLAKE2b-256 checksum
How to use checksums
9f429380e931d37a91ed40ec3f46ef086f7cd71154210751b80b71c53783b762
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for autocml 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page