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
- 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.
| Device | Address | Notes |
|---|---|---|
| XE1 | Gi1 10.37.0.1/24 | IOS XE 17.3, a virtual machine |
| DEV | 10.37.0.100/24 | Ubuntu 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
- Understand where APIs fit
- Enable RESTCONF on XE1
- Make your first GET request
- Read JSON properly
- Change the configuration through the API
- 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.
Every link, as text
- XE1
Gi1to DEVeth0
| Node | Device | Image in Add Node | Set to |
|---|---|---|---|
| XE1 | Cisco CSR 1000v | csr1000vng-universalk9.17.03.08a-serial | 1 vCPU, 4,096 MB |
| DEV | EVE-NG GUI server (Docker) | eve-gui-server:latest | 1 vCPU, 1,024 MB |
How to open this lab
Sign in to your workspace at
lab.cloudlabbox.com.In File Manager, open Shared, then the folder
CCNA 200-301 guided labs.Open
37 - REST APIs and JSON with RESTCONF on IOS XEand 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
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.