CCNA lab 37 of 46

REST APIs and JSON with RESTCONF on IOS XE

Talk to a router the way controllers and automation tools do: enable RESTCONF on IOS XE, read its configuration as JSON with curl and Python, change it with PATCH, PUT and DELETE, and decode every status code and every part of the JSON.

Run this lab

It needs Lite: its 2 nodes are set to 2 vCPU and 5,120 MB in total. That fits the free demo too.

In your workspace: Shared, then CCNA 200-301 guided labs, then 37 - REST APIs and JSON with RESTCONF on IOS XE

Try it free for 30 minutesRun it on Lite from £3 a day

The free demo needs no card and no email. Every lab plan includes every guided lab.

Level
Intermediate
Time
About 55 minutes
Nodes need
2 vCPU, 5,120 MB
Smallest plan
Lite

The scenario

Kingfisher Logistics is moving from typing commands on each router to managing the network through APIs: a controller, scripts and later Ansible. Before buying anything, the team wants to understand what an API call to a router actually looks like. Your test router is XE1, an IOS XE router (a CSR 1000v), and your workstation is DEV, which has curl and Python.

DeviceAddressNotes
XE1Gi1 10.37.0.1/24IOS XE 17.3, a virtual machine
DEV10.37.0.100/24Ubuntu workstation (a container); /root/restconf/ has a README and a Python script

What you’ll practise

  • Compare traditional and controller-based networking, the three planes, and northbound and southbound APIs
  • Describe REST: client-server, stateless, CRUD and HTTP verbs, status codes, authentication and data encoding
  • Enable RESTCONF on an IOS XE router
  • Read and interpret JSON objects, arrays, keys and value types
  • Create, update and delete configuration through the API and verify it on the CLI

The tasks

  1. Understand where APIs fit
  2. Enable RESTCONF on XE1
  3. Make your first GET request
  4. Read JSON properly
  5. Change the configuration through the API
  6. Read the errors

The Lab Tasks pane has the scenario, these tasks, the checks to run, hints and the full solution.

Topology and devices

The network as it opens in EVE-NG, drawn from the lab’s own canvas, and the image each node runs.

Topology of REST APIs and JSON with RESTCONF on IOS XE2 nodes, 1 link. Every link is listed as text below the diagram.XE1DEVGi1eth0
2 nodes, with the interface names each link uses. On a narrow screen, scroll the diagram sideways.
Nodes in REST APIs and JSON with RESTCONF on IOS XE, with the image each runs and the vCPU and RAM it’s set to
NodeDeviceImage in Add NodeSet to
XE1Cisco CSR 1000vcsr1000vng-universalk9.17.03.08a-serial1 vCPU, 4,096 MB
DEVEVE-NG GUI server (Docker)eve-gui-server:latest1 vCPU, 1,024 MB

How to open this lab

  1. Sign in to your workspace at lab.cloudlabbox.com.

  2. In File Manager, open Shared, then the folder CCNA 200-301 guided labs.

  3. Open 37 - REST APIs and JSON with RESTCONF on IOS XE and start its nodes, then open Lab Tasks for the scenario and the steps.

The lab is read-only. You can start the nodes and configure the devices, but changes to the topology can’t be saved. To change it, rebuild it in your own folder.

More CCNA labs

All CCNA labs

Related labs in other courses

CloudLabBox is independent of Cisco. The lab follows exam topics and isn’t vendor training material; vendor names identify the exams and the images in the workspace.