NORNIR-APPS
Pluggable Network CLI tool built on top of Nornir and Napalm
Why do I need this?
nornir_apps is a lightweight wrapper around Nornir and Napalm and it provides a CLI that makes it easy to plugin Nornir-based scripts you have. The ClI tool comes with a few plugins that use the nornir_napalm tools that may already be suitable for quick tasks. However, you can easily add to the CLI by writing your own plugin.
Getting Started
Installation
Install nornir_apps using pip:
pip install nornir-apps
Configure your Nornir inventory and Initialization config
You can use your existing nornir configuration files and inventory without any modifications. By default, nornir_apps looks for a config.yaml file in the root of directory from which you're using the nornir-app CLI command. You can pass another file using the -i or --init-file flag as well. You can review sample configuration and inventory files below. They are samples from the examples directory in the root of this repo.
Sample hosts file
# examples/inventory/hosts.yaml
cat9k:
hostname: 10.253.175.87
port: 22
username: cisco
password: cisco
groups:
- cisco_iosxe
Sample Groups file
# examples/inventory/groups.yaml
---
cisco_iosxe:
platform: ios
data:
role: router
connection_options:
napalm:
extras:
optional_args:
fast_cli: False
secret: cisco
conn_timeout: 30
Nornir Initialization file
---
core:
raise_on_error: False
runner:
plugin: threaded
options:
num_workers: 100
logging:
enabled: True
inventory:
plugin: SimpleInventory
options:
host_file: "inventory/hosts.yaml"
group_file: "inventory/groups.yaml"
defaults_file: "inventory/defaults.yaml"
Getting Started with the CLI
View available commands
Use nornir_apps --help to view the included commands based on the napalm_nornir project. Any plugin that you create and register will show as an available command in the future.
➜ nornir_app --help
<OUPUT OMMITTED>
Commands:
napalm-configure Retrieve device configuration
napalm-get Retrieve device configuration using napalm getters
napalm-ping Ping device
napalm-validate Validate device compliance using napalm_validate
Examples
nornir_app -i inventory/config.yaml -h cat9k napalm-ping -d 8.8.8.8
Note: the CLI looks for a
config.yamlfile by default to initiliaze Nornir
If you have a config.yaml file present in the current directory, you can omit the -i flag:
nornir_app -h cat9k napalm-ping -d 8.8.8.8
The -h or --host-filter option allows you to pass a simple filter to the inventory for host selection.
nornir_app -h platform=ios,role=router napalm-ping -d 8.8.8.8
Metadata
Release files for nornir-apps 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| nornir-apps-0.0.3.tar.gz | 8.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nornir_apps-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.2 kB
Release files / nornir-apps-0.0.3.tar.gz
| Download URL | nornir-apps-0.0.3.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef74679cbfae03fc66a064a8f4a86a9c512383d1287624d17c4994c34fa675ea
|
|
BLAKE2b-256 checksum How to use checksums |
76f94b865d454c3f6742ad0604b721c9d900ab6498bb77ccdd9dd721123b3953
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.7
|
Release files / nornir_apps-0.0.3-py3-none-any.whl
| Download URL | nornir_apps-0.0.3-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2064105d6e27baa569d239caa77a6bef4e23f5cecefea500eb70dbcd3e44dafe
|
|
BLAKE2b-256 checksum How to use checksums |
fcb9a109a9358725d6262b264f9b8d4c25210f5a7ef3ac2389f911a80c616594
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.7
|
Security for nornir-apps 0.0.3
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.