Developer

 View Only
last person joined: 7 days ago 

Expand all | Collapse all

REST on Aruba Instant 8.6

This thread has been viewed 7 times
  • 1.  REST on Aruba Instant 8.6

    Posted Apr 09, 2020 10:17 AM

    Hi. 

     

    Referencing Aruba Instant 8.6.0 REST API Guide

    Trying to run a monitoring API against a VC with IP address 192.168.50.100. The two lines have been lifted straight out of the the Guide. All I've changed is the IP addresses and the sid in the second instruction so it matches the response from the login. What am I doing wrong?

     

    chris@Chriss-MacBook-Pro ~ % curl "https://192.168.50.100:4343/rest/login" -H "Content-Type: application/json" --data '{"user": "restapi", "passwd": "Aruba123!"}' --insecure

    {
    "Status": "Success",
    "sid": "ojXOsA5bjkSCTyHzHUML"
    }%

     

    chris@Chriss-MacBook-Pro ~ % curl "https://192.168.50.100:4343/rest/show-cmd?iap_ip_addr=192.168.50.101&cmd=show%20aps&sid=ojXOsA5bjkSCTyHzHUML" -H "Content-Type: application/json" --insecure| sed 's/\
    /
    /g'

     

    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 76 0 76 0 0 228 0 --:--:-- --:--:-- --:--:-- 228
    <?xml version='1.0'?><re><error>Invalid opcode for current user</error></re>

     

    All help appreciated! 

     

    Chris

     



  • 2.  RE: REST on Aruba Instant 8.6

    MVP GURU
    Posted Apr 09, 2020 10:26 AM

    Hi Chris,

     

    Can you add also to header Accept = "application/json" ? i using this for my PowerArubaIAP (call IAP API using PowerShell)

     

     



  • 3.  RE: REST on Aruba Instant 8.6
    Best Answer

    Posted Apr 14, 2020 01:26 PM

    It turns out that it was a user privilege issue. Kudos to James Tinmouth for assisting in resolution. I was using a new management user I'd setup with read-only privileges as I only ever intended to use monitoring commands such as "show aps" and "show clients". It turns out it has to be a management user with all privileges. Personally this feels wrong, especially as the curl command will be sent in clear text! 

     

    @Aruba - can I suggest a few options to make this better? I would log an Innovation ticket but currently don't have permissions! 

     

    1. Reuse the Central API syntax so it can be run against the Instant VC. That would be awesome! 

     

    2. Enhance the existing implementation of monitoring calls in 8.6+ so you can pull result sets for all common monitoring type queries such APs, clients and others. 

     

    Thanks

     

    Chris