I recently read an article written by Carl Montanari, “On the Punditry of Network APIs”. He just marvellously explained that the API’s we talk about these days have been here forever; in the form of the good old CLI!
In this blog I will show how you can use the CLI as an API through command parsing.
The importance of structured data
Carl says: “Almost always the first things that folks bring up when saying that CLI is an unsuitable mechanism for automation is that there is no structured data, and that the CLI is inherently unreliable.“
Of course, we all love our structured data though we live in a world where it isn’t always provided to us and we need to find a way. So, how to automate when the world isn’t as bright as the Internet advocates?
How to automate using the good old CLI
You will probably have existing CLI devices in your network, you might even have multiple vendors to support. You’ll probably be able to extract data from the device. This might be presented as a piece of text, or a more complex table structure. Once you have the interesting data from either the state or the configuration, you can reuse it in logic or in templates.
I’ve created 3 videos showing how parsing is done using the NetYCE Platform and how this could work for you:
While we still have devices out there that only support the legacy API or while we are still troubleshooting using the CLI we have to consider a way of working with it while still embracing the future. That's exactly what I demonstrated here.
Let me know your thoughts!
Want to know more?
Our #1 priority is helping you in your automation journey. If you want to know how we tackle network automation challenges, watch the video about our Full Stack Network Automation Platform here.