Explore and experiment with the world of NSO on Cisco Code Exchange, where you can dive right in and try out examples in a user-friendly browser-based integrated development environment (IDE).
But wait, there's more! You can also contribute your examples and share them with everyone. The best part is your peers can play with your examples without installing anything.
If you are new to NSO, start with the NSO Learning Labs, where you can find step-by-step guides.
Two flavors of the NSO Playground are available. Choose the environment that suits you best:
See this guide to learn the difference between System and Local install.
The rest of this guide focuses on the Local Install option.
Click here to start using Cisco Cloud IDE.
Or go to Cisco Code Exchange and start the environment. Click on the Run in Cloud IDE button on the right side of the Repo title.
Once you click the Run in Cloud IDE button, a Cloud IDE instance with the Github repository appears. You find your code under the ~/src directory.
Note: Click on the src directory to expand it and see the code of the repo cloned. Pay attention to the directory structure of the workspace.
To create a new example, follow these steps.
Note: You must use your own repositories.
You can open an issue on this repository to ask for help, share feedback, or request new features.
You can try the following example to get familiar with the Cloud IDE Environment. Copy or type the next commands into the VS Code terminal.
This short example demonstrates how you can set up a simulated network of Cisco IOS routers and manage these netsim devices with NSO in Code Exchange Cloud IDE. NSO talks Cisco CLI towards the routers.
If you want to see a detailed explanation of the commands used, see NSO Intro Learning Lab.
Prepare NSO
source $NCS_DIR/ncsrc ncs-netsim --dir ~/example/netsim create-network cisco-ios-cli-3.8 2 ios ncs-setup --dest ~/example --netsim-dir ~/example/netsim
Start netsim
cd ~/example/ ncs-netsim start
Start NSO
ncs
Review NSO status
ncs --version
ncs --status | grep -i status
Enter NSO and learn the configuration of ios0
.
ncs_cli -C -u admin devices sync-from
See the configuration of ios0
and change the hostname.
config
show full-configuration devices device ios1 config | nomore
devices device ios0 config
ios:hostname nso.cisco.com
Finally see what NSO sends to the device and commit the changes.
top commit dry-run outformat native commit
Go to $NCS_DIR
> examples.ncs
in the VS Code workspace or use the terminal.
cd $NCS_DIR/examples.ncs/ developer:examples.ncs > ll total 28 drwxr-xr-x 1 developer ncsadmin 267 Jun 28 11:38 . drwx------ 1 developer ncsadmin 294 Jul 18 13:33 .. -rw-r--r-- 1 developer ncsadmin 27052 Jun 28 11:38 README drwxr-xr-x 1 developer ncsadmin 27 Jun 28 11:05 crypto drwxr-xr-x 1 developer ncsadmin 36 Jun 28 11:05 datacenter drwxr-xr-x 1 developer ncsadmin 261 Jun 28 11:38 development-guide drwxr-xr-x 1 developer ncsadmin 27 Jun 28 11:05 generic-ned drwxr-xr-x 1 developer ncsadmin 50 Jun 28 11:05 getting-started drwxr-xr-x 1 developer ncsadmin 26 Jun 28 11:05 high-availability drwxr-xr-x 1 developer ncsadmin 69 Jun 28 11:05 misc drwxr-xr-x 1 developer ncsadmin 143 Jun 28 11:05 service-provider drwxr-xr-x 1 developer ncsadmin 19 Jun 28 11:05 snmp-ned drwxr-xr-x 1 developer ncsadmin 155 Jun 28 11:38 snmp-notification-receiver drwxr-xr-x 1 developer ncsadmin 53 Jun 28 11:05 web-server-farm drwxr-xr-x 1 developer ncsadmin 31 Jun 28 11:05 web-ui
Go to Cisco Code Exchange to find more examples created by the community.
Create examples with an "Infrastructure as a Code" mindset. This means everything needed to create your examples is in your GitHub repository.
Avoid specifying NSO versions in the code, we update the playground continuously.
As seen in the examples, use environment variables when developing.
$NCS_DIR
Is a handy environment variable.env | grep -i ncs
Shows other environment variables available by ncs
.The directory structure of the workspace matters. Consider it when creating an example.
Always add a README.md file to the root directory of your repository with instructions on how to set up or run your example.
Use the preview feature (right click) in VS Code to see the markdown files formatted.
Where is the NSO webUI?
Assuming you are using the default port 8080, you can obtain the URL from the DEVENV_APP_8080_URL
environment variable in your terminal. The webUI default credentials are: admin/admin
echo $DEVENV_APP_8080_URL
If you're not sure which port to use, check the available environment variables with.
env | grep -i devenv_app
Can I reset the environment?
How to enable the VS Code NSO Developer Studio - Explorer?.
Which NEDs come with the container?
Example NEDs, which must be considered as examples. NEDs in the container are only used to run the simulated networks. Do not use these example NEDs with real devices.
developer:~ > ls -1 $NCS_DIR/packages/neds/ a10-acos-cli-3.0 alu-sr-cli-3.4 cisco-asa-cli-6.6 cisco-ios-cli-3.0 cisco-ios-cli-3.8 cisco-iosxr-cli-3.0 cisco-iosxr-cli-3.5 cisco-nx-cli-3.0 dell-ftos-cli-3.0 juniper-junos-nc-3.0 developer:~ > ls -1 $NCS_DIR/packages/neds/ | wc -l 10 developer:~ >
My code is approved and is already published on Cisco Code Exchange, why isn't it visible on the playground?
/home/developer/src
in the workspace.ls -l /home/developer/src
Owner
Contributors
Categories
Products
Network Services Orchestrator (NSO)Programming Languages
License
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community