Wireless Access

last person joined: 22 hours ago 

Access network design for branch, remote, outdoor, and campus locations with HPE Aruba Networking access points and mobility controllers.
Expand all | Collapse all

AOS 8 filter API syntax

This thread has been viewed 0 times
  • 1.  AOS 8 filter API syntax

    Posted Aug 06, 2018 03:16 PM

    I'm investigating the 8.3 API, and 

     

    GET /object/ap_group

     

    in the WLAN section has a parameter called: "filter".  I am presuming this is a way to filter the results.  As an example, I am trying to filter based on 'profile-name'.  This seems like an efficient way to check to see if a particular group exists, and if it does how it is configured.  However, I can't find any example or documenation other than "JSON filter expression specifying the items to return" which is incredibly vague.  I have tried a few things but haven't been successful.

     

    Can someone point me in the right direction?



  • 2.  RE: AOS 8 filter API syntax

    Posted Aug 07, 2018 12:55 AM

    the filter syntax is described on page 28 onwards, but there are a lot of caveats around shellvars, escaping and variable formatting.

     

    You probably want a data filter, so something like below - note liberal use of escaping on the double quotes because I am passing in SID and MC as shellvars (cant use single quote), also need to escape the $ in the operator and also -g to stop curl processing the [ ]'s

    root@kali:/home/aruba/curl --silent --insecure -b .cookie.v8 -XGET -g -i "$MC/v1/configuration/object/ap_group?config_path=/mm&filter=[{\"ap_group.profile-name\":{\"\$eq\":[\"group-ccc\"]}}]&$SID" | grep group
        "ap_group": [
            "profile-name": "group-ccc", 
    root@kali:/home/aruba/curl# 
    
    >> here is the list unfiltered
    root@kali:/home/aruba/curl# curl --silent --insecure -b .cookie.v8 -XGET -g -i "$MC/v1/configuration/object/ap_group?config_path=/mm&$SID" | grep group                                                              "ap_group": [
            "profile-name": "group-aaa", 
            "profile-name": "group-bbb", 
            "profile-name": "group-ccc", 
    root@kali:/home/aruba/curl# 

    see if that helps, if not, paste samples of your API calls here

     

     

     

     



  • 3.  RE: AOS 8 filter API syntax

    Posted Aug 07, 2018 10:10 AM

    Page 28 of what?



  • 4.  RE: AOS 8 filter API syntax

    Posted Aug 07, 2018 11:38 PM

     


    @lroe wrote:

    Page 28 of what?


    the documentation, "ArubaOS 8.3.x.0 API Guide", it's on the support website.