Using Siri Shortcuts to Interact with Riverbed SD-WAN
Using a RESTful API is not a new concept in today’s networks. In fact, we see it on many of the proof of concept (POC) requests from customers who are deploying Riverbed SD-WAN. It’s quite useful to use automation to interact with the network for many reasons. Creating sites, setting IP addresses, checking the status of an uplink, all these things make sense if we can make it happen quicker and do it in a way that fits our personal workflows.
In this article I will discuss how you can use Siri shortcuts in iOS 12 to interact with the RESTful API of SteelConnect Manager (SCM).
What are Siri Shortcuts?
I’ve followed the progression of Apple iOS for a long time. In fact, some might call me an Apple fanboy although I take exception to that. I am a fan of technology, hence the Technical Evangelist role here at Riverbed. And if you work in the networking industry and like to get at the CLI and fiddle with the cool bits of an operating system then you know that this is not something that Apple lets you do with iOS. But getting at the CLI and fiddling is what give you the power to script actions. So a small company emerged on the App Store and released an app called Workflow. The Workflow app let you visually script a series of events on your iPhone or iPad. Some of the things that you could script would normally require shell access. Well the app was so good that Apple purchased them and integrated the app into iOS 12, renaming it Shortcuts, and it works with Siri Shortcuts to use your voice commands with Siri to initiate complex workflows on your phone.
Simple example of Siri Shortcut
Shortcuts can be downloaded from the App Store at no cost or you can create them from scratch. Below is a simple example of how a shortcut works. In this example we are telling the application to prompt us for some text and then put that text into a variable. Once the variable has data in it should generate an alert with the variable inserted.
The following image shows the output of this shortcut.
**insert GIF here.
So, with that basic understanding, lets turn attention to the RESTful API of Riverbed’s Steelconnect SD-WAN solution.
SteelConnect RESTful API
The SteelConnect Manager can interact by means of a RESTful API.
Using the API and a bit of scripting you can build sites, virtual appliances, WANs. Uplinks, and so on. In fact I recently created a python script to build an entire 7 site demo topology in EVE-NG and the entire process takes about 10 minutes and deploys an internet and MPLS wan for all my sites to connect to. So clearly the power is in the API. So how do you use it?
First, each organization has what we known as an OrgID assigned to it. Anytime we interact with an org we have to use its ID. You can use the API to identify your org ID. As part of our shortcut we will first identify our OrgID and then we use it in all API calls after that.
Using the Riverbed SCM API with Siri Shortcuts
The following shortcut is designed to create a site in our Org. Lets break down the elements of the shortcut. First off, the menu on the left are actions you can add to the shortcut. To add them you just drag them from the left to the right. Since my shortcut is already populated, I’ll just walk you through its functions.
We begin by adding some text and asking the shortcut to speak that text to us.
Next we use dictation to listen for a response and place the words we speak into a variable called location.
Next we ask for a name for the site.
After using dictation again we take the text and put it in a variable called name.
We need to strip the spaces out of the name because this is not allowed by SCM.
Now we use the URL format that’s specified by the API to get my ORG ID.
In the following screenshot I’m calling out the fact that we are adding authentication into the call.
Once I’ve retrieved my ORG ID I place it in a variable called myOrg.
Next we send another call to create a site. Note that as part of the URL I need to substitute my ORG ID.
The difference with this call is that it’s a POST method.
This POST method is going to include the parameters required to create the site. SCM requires at minimum the Name, Long Name, and Location. We are going to use same value for both the name and long name.
After sending the call we speak the text that the site has been created for us.
This should give you a pretty good idea of how the shortcut functions but I highly recommend you watch the following video. In the video I walk through each step and create two sites using two different methods.
This example simple highlights a fraction of the power you have with the Steelconnect API and the Shortcuts app on iOS. This type of functionality is not limited to iOS. Romain Jourdan illustrated this capability with an Amazon Echo in the past. It’s likely we will see more and more capabilities make their way onto our mobile devices and when you combine that with the RESTful capabilities of Riverbed solutions there are many very cool things one can do to interact with the network. Take some time and have a look at our API documentation and think outside of the box.