Security

Reply
Contributor I
Posts: 23
Registered: ‎09-17-2012

REST API JSON filter not working 6.6.2

So I want to query for a specific device mac. In the API explorer I create a json filter '{"mac":"xx-xx-xx-xx-xx-xx"}' and this works. In the return I see the create_time field is

"create_time": 1478804392  

 So I create a filter '{"mac":"xx-xx-xx-xx-xx-xx","create_time":"1478804392"}'

 

And this does not work. Is something wrong with my syntax? I should be able to do a multi-field query correct? I've also tried the query without the quotes around the time stamp but that doesn't work either.

Guru Elite
Posts: 8,322
Registered: ‎09-08-2010

Re: REST API JSON filter not working 6.6.2

Try removing the quotes around the create_time value:

 

{"mac":"xx-xx-xx-xx-xx-xx","create_time":1478804392}


Tim Cappalli | Aruba Security TME
@timcappalli | timcappalli.me | ACMX #367 / ACCX #480
Contributor I
Posts: 23
Registered: ‎09-17-2012

Re: REST API JSON filter not working 6.6.2

Thanks, but that didn't work either. I tried a query with only the create_time and that didn't work either. I did a query with the start_time though and that worked. It looks like it might be just something with the create_time field itself.

Guru Elite
Posts: 8,322
Registered: ‎09-08-2010

Re: REST API JSON filter not working 6.6.2

When you do a GET, is that attribute returned?

Tim Cappalli | Aruba Security TME
@timcappalli | timcappalli.me | ACMX #367 / ACCX #480
Contributor I
Posts: 23
Registered: ‎09-17-2012

Re: REST API JSON filter not working 6.6.2


cappalli wrote:
When you do a GET, is that attribute returned?

Yes.

Guru Elite
Posts: 8,322
Registered: ‎09-08-2010

Re: REST API JSON filter not working 6.6.2

Just out of curiosity, why do you need to filter on both of those attributes
simultaneously? There can only be one account in the database with a
particular username.

Tim Cappalli | Aruba Security TME
@timcappalli | timcappalli.me | ACMX #367 / ACCX #480
Contributor I
Posts: 23
Registered: ‎09-17-2012

Re: REST API JSON filter not working 6.6.2


cappalli wrote:
Just out of curiosity, why do you need to filter on both of those attributes
simultaneously? There can only be one account in the database with a
particular username.

I was just testing. What I really want to do is return all devices that were created before a certain date. Like I said I did the query with just the create_time and it didn't work either. I think I'll open a TAC case and see if they can recreate the issue. I can do the date checking within my script if I need to for now.

Contributor I
Posts: 23
Registered: ‎09-17-2012

Re: REST API JSON filter not working 6.6.2

I opened a case with the TAC and they confirmed the issue was happening on their server. They will open a ticket with engineering to look into it.


miker wrote:

I was just testing. What I really want to do is return all devices that were created before a certain date. Like I said I did the query with just the create_time and it didn't work either. I think I'll open a TAC case and see if they can recreate the issue. I can do the date checking within my script if I need to for now.


 

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