You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@ace.apache.org by "Robert M. Mather" <ro...@gmail.com> on 2015/05/13 17:29:39 UTC

Filter a GET request through the rest api

Let's say I want to do specific queries against the REST api, for example,
get all the distribution2target associations for a particular target.

I know that GET /client/work/ID/distribution2target gets an array of all
the associations and I can filter that myself, but is there a way to use
query params or headers on the get so ACE will filter it?

Robert

Re: Filter a GET request through the rest api

Posted by Marcel Offermans <ma...@luminis.nl>.
On 15 May 2015 at 17:16:01, Jan Willem Janssen (janwillem.janssen@luminis.eu) wrote:
Hi Robert, 

> On 14 May 2015, at 19:38, Robert M. Mather <ro...@gmail.com> wrote: 
> 
> 
> I see in the rest api documentation here: 
> http://ace.apache.org/docs/rest-api.html that all the association entities 
> say "Associations have a left and right hand side. Both can be expressed as 
> filter conditions." 
> 
> I see that the entities return from GET /client/work/ID/distribution2target 
> all have a filter like (&(name=some-distribution-name)) for the 
> leftEndpoint and similarly for the rightEndpoint, so I tried changing it to 
> (&(name=*)) but got a 404. Is my syntax off or is this just not the 
> intended way of using the API? 

The REST api does not provide support for filtering entities, as far as I know. 
Not sure why this was never implemented, but I know for sure that the direct 
client API does provide support for filtering entities. 
I don’t think there was a specific reason, other than nobody did it yet.

Maybe because more people tend to use the shell scripts to control the client.

Feel free to submit an issue to add filter capabilities to entities in the REST API. And, if you feel confident enough, contribute a patch for it.

Greetings, Marcel

Re: Filter a GET request through the rest api

Posted by Jan Willem Janssen <ja...@luminis.eu>.
Hi Robert,

> On 14 May 2015, at 19:38, Robert M. Mather <ro...@gmail.com> wrote:
> 
> 
> I see in the rest api documentation here:
> http://ace.apache.org/docs/rest-api.html that all the association entities
> say "Associations have a left and right hand side. Both can be expressed as
> filter conditions."
> 
> I see that the entities return from GET /client/work/ID/distribution2target
> all have a filter like (&(name=some-distribution-name)) for the
> leftEndpoint and similarly for the rightEndpoint, so I tried changing it to
> (&(name=*)) but got a 404. Is my syntax off or is this just not the
> intended way of using the API?

The REST api does not provide support for filtering entities, as far as I know.
Not sure why this was never implemented, but I know for sure that the direct
client API does provide support for filtering entities.

> 
> Thanks,
> 
> Robert
> 
> On Wed, May 13, 2015 at 8:29 AM, Robert M. Mather <
> robert.mather.rmm@gmail.com> wrote:
> 
>> Let's say I want to do specific queries against the REST api, for example,
>> get all the distribution2target associations for a particular target.
>> 
>> I know that GET /client/work/ID/distribution2target gets an array of all
>> the associations and I can filter that myself, but is there a way to use
>> query params or headers on the get so ACE will filter it?
>> 

--
Met vriendelijke groeten | Kind regards

Jan Willem Janssen | Software Architect
+31 631 765 814

My world is revolving around INAETICS and Amdatu

Luminis Technologies B.V.
Churchillplein 1
7314 BZ   Apeldoorn
+31 88 586 46 00

http://www.luminis-technologies.com
http://www.luminis.eu

KvK (CoC) 09 16 28 93
BTW (VAT) NL8169.78.566.B.01


Re: Filter a GET request through the rest api

Posted by "Robert M. Mather" <ro...@gmail.com>.
I've been playing and researching more on this.

I see in the rest api documentation here:
http://ace.apache.org/docs/rest-api.html that all the association entities
say "Associations have a left and right hand side. Both can be expressed as
filter conditions."

I see that the entities return from GET /client/work/ID/distribution2target
all have a filter like (&(name=some-distribution-name)) for the
leftEndpoint and similarly for the rightEndpoint, so I tried changing it to
(&(name=*)) but got a 404. Is my syntax off or is this just not the
intended way of using the API?

Thanks,

Robert

On Wed, May 13, 2015 at 8:29 AM, Robert M. Mather <
robert.mather.rmm@gmail.com> wrote:

> Let's say I want to do specific queries against the REST api, for example,
> get all the distribution2target associations for a particular target.
>
> I know that GET /client/work/ID/distribution2target gets an array of all
> the associations and I can filter that myself, but is there a way to use
> query params or headers on the get so ACE will filter it?
>
> Robert
>