Education - Australia / New Zealand

 View Only
last person joined: 22 days ago 

A local community of education customers across Australia / NZ. This group will be moderated by HPE Aruba Networking staff and kept up to date with any upcoming training or events that are relevant to the EDU space.

Switch Rest API anycli cmd

This thread has been viewed 8 times
  • 1.  Switch Rest API anycli cmd

    EMPLOYEE
    Posted Nov 02, 2017 03:53 AM
      |   view attached

    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)

    Attachment(s)

    pdf
    Rest AnyCli testing.pdf   266 KB 1 version