Switch Rest API anycli cmd
11-02-2017 12:53 AM
The atached document steps though using the service CliCommand call to the Rest API on arubaOS 16.04 switches. This Api call allows you to execute almost any command on the switch. If the switch information has a direct API call you should probably use that.
I attempted to make this a bit more accessible for non programmers (like me) and non linux users by just using the Linux Bash shell and one line commands that can be cut and pasted. This all got a bit too tricky so I ended up using python to parse the Json data. So in that respect it was a fail. I did however manage to keep these Bash/python scripts to one liners. Hopefully this makes it easier to break down and test the components. You can paste part of the program to see what is returned then append the next piece and repaste. Even without Python installed you should be able to decode the base64 data.
If anyone has tried scripting to the Cli you should soon appreciate what a big step forward the REST API is in terms of reliability and consistency. You should be able to achieve an awful lot with a very simple wrapper script. If you haven't tried switch programming before this is pretty easy way to get started Just VirtualBox and a linux VM (and a switch)