The CLI is here to stay
Network Automation 1 min read

The good old CLI is here to stay

Picture of Bart Dorlandt

Bart Dorlandt on March 4, 2021

APIs are a force for change in networking. Carl Montanari says: If you had to pick one thing for your networking vendors to give you to help you on your automation journey, what is it, and why is it a good API?

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:

11.command_parsing_part1

 

12.command_parse2

 

13.command_parsing_part3



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.

 

m-article-whitepaper

EBOOK

5 lessons — How to start with network automation

DOWNLOAD EBOOK
Picture of Bart Dorlandt

Bart Dorlandt

Bart is a networking expert who spent the majority of his career in the ISP and Enterprise industry, gaining experiences in areas such as Routing & Switching, Linux and programming, while also establishing himself as a respected CCIE. As a Solution Architect at NetYCE he helps businesses succeed with network automation, as well as proving training and being the product owner. For Bart, doing challenging migration projects under high pressure is the most rewarding part of the role. Outside of the office, he enjoys his family, SurvivalFit as a sport, read up on new technologies and doing some basic woodworking.