Close

HPE Aruba Networking Blogs

2020 is the Year of the Networked API

By Christopher Kusek, Contributor

Welcome to 2020! The future is truly upon us. We have flying cars (okay, maybe not). We summer on the moon and Mars (okay, certainly not yet). But maybe the Jetsons got one thing right, and we can do all of our networking configuration merely by pressing a single button? Yes! Definitely! Maybe...Kind of?

Wait. I thought I’m supposed to do everything with the CLI?

No, it's cool. The future really is here, you can do things beyond the CLI!

“But everyone I know uses the CLI to configure everything…”

"The CLI is what I know. I don't have time to learn something new."

“REST API? More like I need to get-some-sleep API after all these configurations."

It's true, and I won't beat a dead horse. Instead, I’ll cite a dead horse so you can play along at home.

Alright now that you’ve had a chance to catch up, some of you might be saying, “Wait, what’s Swagger?" or "Yeah, Swagger seems nice, but that's just for ArubaOS-CX. But what about ArubaOS-Switch? See. You're no help!"

We're in luck. Here's some more reading material for you to dig into:

And frankly, it doesn't stop there. You'll find more and more APIs exposed for pretty much everything these days. But chances are the two primary reasons you're not using the REST API today is, you're too busy to learn something new, and you don't understand how to get it working for you to play around with it.

I feel like if you haven’t been playing around with any of the APIs up until this point, you really just didn’t know how to do it. It's okay. I've been there, and every other admin I know has also been there. The fact of the matter is 'ssh user@hostname' and run command or 'putty to host' and run command is VERY easy and VERY familiar to us, so there's been no reason to learn something new.

Back in the day, I used to pull headers from web servers I would be working with by telnetting to the server on its respective port and making GET or PULL requests. But here in the present, tools like telnet often don’t exist on Macs or PCs without explicitly installing them.

Instead these days, and especially when it comes to playing around with our infrastructure (especially while sorting out what kind of configuration settings we're interested in), we'll want to take advantage of the cURL command.

cURL or "Client URL" is typically the tool you'll use for testing and working with API requests from the CLI.

Network API Client URL

You’ll always want to start your cURL commands off with something you know, connecting to a resource you control or are responsible for, and that way you can sort out if things are working. I can't tell you the number of times we spent troubleshooting a problem with a device and it turned out to be the command itself that was the issue. Also, you might notice I used "--verbose" that, too, is your good friend when it comes to running commands and ensuring you're getting the output you expected.

At this point, it probably wouldn’t hurt to revisit Getting Started with Swagger – Python and ArubaOS-CX, but you'll be farther along at being able to start dipping your toe and the rest of your infrastructure into getting familiar with and comfortable operating your switches and defaulting to cURL instead of relying upon the CLI as your go-to-ops.

Even more important is how this is going to help in the rest of 2020 and beyond as far as standardization, securing your infrastructure, maintaining your configurations and combatting all of the ops problems we suffer from today due to CLI debt. But we'll go into that more in the next article!

Here are some great videos and other sources to help get you even more comfortable and prepared to go beyond the CLI: