Developer

 View Only
  • 1.  How to query the Auruba Central API with powershell

    Posted Nov 22, 2019 05:01 PM

    I've been trying to do something use with the Aruba Central API and Powershell.

    I'm able to request a new access token, refresh the token

    and i can also use some of the API queries with the use of an access token


    e.g.


    $uri ="https://eu-apigw.central.arubanetworks.com/device_inventory/v2/devices?sku_type=IAP&access_token=$accessToken"

    $output = Invoke-RestMethod-Uri $uri -Method GET

    -> works


    uri = "https://eu-apigw.central.arubanetworks.com/monitoring/v1/aps?access_token=$accessToken

    $output = Invoke-RestMethod-Uri $uri -Method GET

    -> works


    but..


    trying to get some detail info


    $uri = https://eu-apigw.central.arubanetworks.com/monitoring/v1/aps/SomeSerialNr


    $output = Invoke-RestMethod-Uri $uri -Method GET


    -> not working

    -> how to pass the access token in this URI ? tried with "-body" option but can't find it.


    Can somebody point me in the good direction ?



  • 2.  RE: How to query the Auruba Central API with powershell
    Best Answer

    Posted Nov 23, 2019 12:09 AM

    Hi Tim

     

    Why don't use

    $uri = https://eu-apigw.central.arubanetworks.com/monitoring/v1/aps/SomeSerialNr&access_token=$accessToken" 
    
    
    $output = Invoke-RestMethod-Uri $uri -Method GET

    it should be work...

     

     



  • 3.  RE: How to query the Auruba Central API with powershell

    Posted Nov 25, 2019 03:25 AM

    I guess I had an error with  passing the values into the url, because I tried your suggestion before.

     

    Anyway it's working fine now ! thanks