Wireless Access

Reply
Contributor I

AOS 8 filter API syntax

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?

Re: AOS 8 filter API syntax

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

 

 

 

 

Contributor I

Re: AOS 8 filter API syntax

Page 28 of what?

Re: AOS 8 filter API syntax

 


@lroe wrote:

Page 28 of what?


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

Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: