Network content API
Before we dive into code, let's take a moment to think about the API that we are trying to create. Planning for an API is usually more art than science; it really depends on your situation and preference. What I suggest next is, by no means, the right way, but for now, stay with me for the purpose of getting started.
Recall that in our diagram, we had four Cisco IOSv devices. Let's pretend that two of them, namely iosv-1 and iosv-2, are of the network role of spine. The other two devices, iosv-3 and iosv-4, are in our network service as leafs. These are obviously arbitrary choices and can be modified later on, but the point is that we want to keep some data about our network devices and expose them via an API.
To make ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access