Forum Discussion

Sergei_Genchev_'s avatar
Sergei_Genchev_
Icon for Nimbostratus rankNimbostratus
Jul 24, 2014

How can I use logical operators within REST query?

Hi,

 

Documentation for REST tells me that I should be able to use logical operators like eq, ne, lt, gt, and, or, etc. but I cannot find a single example on how to actually do it.

 

Say, I am trying to get information about node(s) that have an IP address 1.1.1.1. I am trying things like:

 

curl -k -u user:pass -X GET https://ltm.example.com/?\$select=address&address%20eq%201.1.1.1

 

curl -k -u user:pass -X GET https://ltm.example.com/?address%20eq%201.1.1.1

 

I could not find anything that works. Can someone point me to the right direction?

 

Thank you!

 

1 Reply

  • Hi,

     

    Not sure we can really do that, the select filter only filter the attribute you want to see. Meaning if you filter on address you will have only this attribute returned for each object. when you code you rest app you may need to work in two times : - retrieve all objects (in an array) - then lookup for the one having the name you want (with a while)