webui-one-example-trunk-port NSO package demonstrates how the JSON-RPC API and a simple webui can be used in combination with NSO webui-one to create custom applications.
- This package will set up a simple trunk between two swithces.
- The package is based on a NSO service template.
- This application is based on a template for use with Cisco ios devices.
- src/yang/webui-one-example-trunk-port.yang Yang service definition.
- templates/webui-one-example-trunk-port-template.xml Config template for Cisco ios device used with the service.
- webui/webui.json Required for the package to be recognised by the NSO webui and a link to the package webui will be visible on the ApplicationHUB.
- webui/index.html Required entrypoint for the package webui, where the user will end up when clicking on the link in the ApplicationHUB.
- webui/script.js Simple Javascript to peform a request to the NSO JSON-RPC.
- webui/style.css CSS Styles.
- NSO version 4.5+
- A modern version of Chrome or Firefox
- cisco-ios ned package
- Available in NSO-install/packages/neds/cisco-ios, copy to your NSO/packages folder.
- Run make in the copied cisco-ios/src folder.
- At least 1 Cisco device, 2 for a more authentic example. Real device or netsim.
- For netsim device look in NSO User Guide, chapter "The Network Simulator"
Download and set up
- Download and put the package contents in the NSO
packages/webui-one-example-trunk-port
folder. - You have to source nso to reach nso commands like ncs_cli
- source NSO-install-folder/nsoenv
- in
webui-one-example-trunk-port/src/
run make
Reload packages using cli or webui.
- CLI: start ncs_cli
- run request packages reload
- WEBUI: In your browser go to http://NSO-HOST/webui-one/ConfigurationEditor/ncs:packages/reload
- Click "Run reload action"
You have to restart NSO
- Restart NSO
The example-webui should now be accessible from the ApplicationHUB, nso-host/webui-one/ or directly at nso-host/custom/webui-one-example-trunk-port
Create a new trunk configuration:
- Give the config a name "MyNewTrunk".
- Fill in devices, ports and vlan-id.
- Submit with "Create/Update Trunk from values"
- Go to the webui-one commit manager to see changes in NSO and Device config.