Network automation in practice lab 3 of 11
Declarative changes - RESTCONF replace on IOS XE and NX-API deltas on NX-OS
Make two Cisco platforms hold exactly the NTP servers and VLANs in one data file: on IOS XE, see the difference between RESTCONF PATCH (merge) and PUT (replace) on a YANG list; on NX-OS, read structured JSON through NX-API, work out the delta, take a checkpoint, apply only the difference and inspect the rollback patch.
Run this lab
It needs Standard: its 3 nodes are set to 4 vCPU and 12,288 MB in total. It is ready about 15 minutes after you start it. It starts already set up, with nothing to paste before the first task.
In your workspace: Shared, then Network Automation in Practice - multi-vendor professional guided labs, then 03 - Declarative changes - RESTCONF replace on IOS XE and NX-API deltas on NX-OS
Run it on Standard from £5 a day
- About 15 min to be ready
- About 70 min of tasks
- Level
- Advanced
- How you work
- CLI-led
- Nodes need
- 4 vCPU, 12,288 MB
- Smallest plan
- Standard
The scenario
Fenwick Rail's data file says every router and switch uses NTP servers 10.20.0.10 and 10.20.0.11, and the York data-centre switch carries VLANs 10, 20 and 30 with set names. The devices disagree: an old NTP server is still configured everywhere, VLAN 10 has its old name, and a project VLAN that ended last year is still there.
"Declarative" means the device ends up holding what the data says: anything extra goes. You'll do it two ways on two Cisco platforms: with RESTCONF's replace operation on the IOS XE router xe1, and by working out the delta yourself through NX-API on the Nexus switch nx1.
Start-up and waits. Click Start all. nx1's NX-API answers about 7 minutes after Start all, and xe1's RESTCONF about 8. Each boots with its management address, the
netopslogin, its APIs on, and the old settings above. Read the files and write TODO 2 while they boot. Measured on our servers: the whole lab was ready for its first task about 15 minutes after Start all, with every device booted.
What you’ll practise
- Read and write a YANG list through RESTCONF, and explain PATCH against PUT
- Remove configuration that isn't in the data, declaratively
- Use NX-API JSON-RPC for structured show output and configuration
- Compute and send only the delta when an API has no replace operation
- Take an NX-OS checkpoint and read the rollback patch for a change
The tasks
- Merge is not replace
- Replace the list
- NX-API: structured data in, commands out
- Work out the delta
- Checkpoint, apply, inspect
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
- devbox
eth0to Mgmt (network) - xe1
Gi1to Mgmt (network) - nx1
e0to Mgmt (network)
| Node | Device | Image in Add Node | Set to |
|---|---|---|---|
| devbox | CloudLabBox code workstation (Docker) | CloudLabBox’s own workstation image, with a browser code editor | 1 vCPU, 2,048 MB |
| xe1 | Cisco CSR 1000v | csr1000vng-universalk9.17.03.08a-serial | 1 vCPU, 4,096 MB |
| nx1 | Cisco Nexus 9000v | nxosv9k-9300v-9.3.10 | 2 vCPU, 6,144 MB |
How to open this lab
Sign in to your workspace at
lab.cloudlabbox.com.In File Manager, open Shared, then the folder
Network Automation in Practice - multi-vendor professional guided labs.Open
03 - Declarative changes - RESTCONF replace on IOS XE and NX-API deltas on NX-OSand 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 Network automation in practice labs
All Network automation in practice labs
Related labs in other courses
CloudLabBox is independent of Arista Networks, Cisco, Fortinet, Juniper Networks and Palo Alto Networks. The lab follows exam topics and isn’t vendor training material; vendor names identify the exams and the images in the workspace.