cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1687
Views
0
Helpful
4
Replies

How to use the DevNet NETCONF-YANG and RESTCONF AO SandBox

franktroy
Level 1
Level 1

Hi I am new to this sandbox https://devnetsandbox.cisco.com/RM/Diagram/Index/27d9747a-db48-4565-8d44-df318fce37ad?diagramType=Topology.

 

How do I issue commands to the device or log in?  Can someone provide pointers?

 

Thanks

Frank

4 Replies 4

hapresto
Cisco Employee
Cisco Employee

The credentials for the sandbox and the ports the interfaces run on are all listed in the lab details at the link you shared.  

 

You can also checkout the Learning labs on NETCONF/RESTCONF for some example walkthroughs of using the Sandbox.  

 

Introduction to Model Driven Programmability (ex: NETCONF/YANG) 

 

Hank

Hi Hank,

 

When I click "Try it Now" I have no way to enter commands.  This Resource Commands Window pops up but provides no way to input commands.  The only directions provided are SSH Port, NETCONF Port, etc and Username and Password for the box.

 

What do I start first python?  Sorry this is so confusing at first.  I need a step by step guide.

 

Thanks!

Frank

Hey Frank, 

 

There is no interactive command shell within the portal web page for an Always On Sandbox like this one.  (Reservable Sandboxes do have options to gain access to an SSH connection through the portal).  To use the sandbox, you would use tools like Postman or Python code on your workstation directly to the device using the credentials and address listed in the instructions.  

 

For example, this curl command run from a bash shell connects to the RESTCONF agent on the device and retrieve some details about GigabitEthernet 1 (if you've a bash shell, you can just run this command). 

 

curl -k \
    -u 'root:D_Vay!_10&' \
    -H "Accept: application/yang-data+json" \
    "https://ios-xe-mgmt.cisco.com:9443/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1?fields=name;description"

 

If you are just getting started with network automation and programmability, first let me welcome you aboard.  You're in a great place.  

 

A great place to start your journey, even before diving into the sandbox, is the "Start Now" area of DevNet http://developer.cisco.com/startnow .  Specifically take a look at the Coding & APIs and EN Networking tracks.  They will help get you started and on the way.  

 

If you prefer video format, you can join me in the Network Programmability Basics (https://developer.cisco.com/video/net-prog-basics/) course.  That'll also walk you through the fundamentals of programmability and help you get started quickly.  

 

Another great resource are the labs in this module - https://learninglabs.cisco.com/modules/dev-setup. They will walk you through installing the key development tools on your workstation, no matter the OS.  

 

All along the way you'll get a chance to use this particular sandbox, as well as others on different platforms.  

 

Hope this helps! 

Hank

 

Hi Hank, 

 

I am actually going through those courses and just now getting to try the labs.  But if I try this based on the python example, I get errors.  Any idea what I am doing wrong?  See below.  I tried different ports and get the same result.

 

Thanks

Frank

 

F:\>python F:\python\netconf_entity.py -a 10.1.1.1 -u root -p D_Vay!_10& --port 10000
Traceback (most recent call last):
File "F:\python\netconf_entity.py", line 58, in <module>
with manager.connect_ssh(host=args.host, port=args.port, username=args.username, hostkey_verify=False, password=args.password) as m:
File "C:\Users\Frank P. Troy\AppData\Local\Programs\Python\Python37-32\lib\site-packages\ncclient\manager.py", line 128, in connect_ssh
session.connect(*args, **kwds)
File "C:\Users\Frank P. Troy\AppData\Local\Programs\Python\Python37-32\lib\site-packages\ncclient\transport\ssh.py", line 384, in connec
raise SSHError("Could not open socket to %s:%s" % (host, port))
ncclient.transport.errors.SSHError: Could not open socket to 10.1.1.1:830
'--port' is not recognized as an internal or external command,
operable program or batch file.