Network Services Orchestrator Remote CLI
CLI utility to manage NSO remotely from the command line.
Credentials can be set using the following environmental variables
NSO_RESTCONF_URL
NSO_USER
NSO_PASSWORD
Supported subcommands
Add devices
% ./nso_remote_cli add-devices --help
Usage: nso_remote_cli add-devices [OPTIONS]
Add devices into NSO
Options:
-i, --inventory-file TEXT NSO Inventory file in yaml format. Use
--print-inventory-example to generate one
[default: ./nso_device_inventory.yaml]
-e, --print-inventory-example Print example inventory file
-f, --fetch-keys Fetch devices' SSH keys
-s, --sync-from Sync from devices
--help Show this message and exit. Show this message and exit.
Parameters can be added to the inventory file as needed, as long as they are defined in the yang models. If you are
not sure how to add your devices with extra settings, add one device manually in NSO,
execute "show running-config devices device | de-select config | display json" and convert the output to yaml
Example output
% ./nso_remote_cli add-devices -i test.yaml
Devices added successfully
Install
- It is strongly recommended to use virtual environments
- Install dependencies in requirements.txt in any python supported system
- Test using nso_remote_cli --help
% ./nso_remote_cli --help
Usage: nso_remote_cli [OPTIONS] COMMAND [ARGS]...
Top level command
Options:
--help Show this message and exit.
Commands:
add-devices Add devices into NSO
Sandbox
If you do not have a NSO instance available, you can use the NSO Reservable Sandbox
to test the script
If you need to revisit the NSO Basics, you can start here.
Use Case
# NSO remote CLI management
### Manage one or multiple NSO instances from your terminal
This CLI utility allows you to interact with NSO remotely and can be used to automate repetitive tasks.
Supported use cases:
* Automate devices from inventory file