Okay thanks for the feedback. We will add docs around URL-encoding as I hadn’t 
realized its a problem till now.

—
Mona

From: David Morel <[email protected]<mailto:[email protected]>>
Date: Tuesday, March 25, 2014 at 11:03 AM
To: Mona Chitnis <[email protected]<mailto:[email protected]>>
Cc: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>, David Morel 
<[email protected]<mailto:[email protected]>>
Subject: Re: Oozie REST API and filters

Hi Mona,
I think the docs (last time I checked, using 3.3.2 IIRC) are not completely 
clear about URL-encoding the string, which is a common pitfall for people not 
used to manipulate URLs. I could be wrong, I didn't check them lately.
David


2014-03-25 18:21 GMT+01:00 Mona Chitnis 
<[email protected]<mailto:[email protected]>>:
The docs do specify the following:

The syntax for the filter is
[NAME=VALUE][;NAME=VALUE]*Valid filter names are:

* name: the application name from the workflow/coordinator/bundle
definition
* user: the user that submitted the job
* group: the group for the job
* status: the status of the job

The query will do an AND among all the filter names.
The query will do an OR among all the filter values for the same name.
Multiple values must be specified as different
name value pairs.

Also, you could refer to the updated documentation -
http://oozie.apache.org/docs/4.0.0/WebServicesAPI.html. Are you still
using older version - 3.1.3-incubating?



On 3/25/14, 6:16 AM, "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>> wrote:

>Thanks David - chaining them with %3B (';') works!
>
>This sort of information is not available in the Oozie Web Services
>documentation:
>https://oozie.apache.org/docs/3.1.3-incubating/WebServicesAPI.html
>
>It would be very helpful to have it there.
>
>-Michael
>
>
>On Mon, Mar 24, 2014 at 4:37 PM, David Morel
><[email protected]<mailto:[email protected]>>wrote:
>
>> On 24 Mar 2014, at 21:12, [email protected]<mailto:[email protected]> 
>> wrote:
>>
>>  Thanks, David.  I've been testing them with Groovy code and that is
>>> working
>>> well.
>>>
>>> I've hit a new snag with the REST API I'm hoping someone can help with:
>>>  is
>>> it possible to chain multiple filters in one REST call?
>>>
>>> For example -
>>>
>>> If I query:
>>> http://myserver:11000/oozie/v1/jobs?jobtype=coord&filter=user%3Dmyuser
>>> I get 51 results.
>>>
>>>
>>> If I query:
>>>
>>>http://myserver:11000/oozie/v1/jobs?jobtype=coord&filter=name%3Dcoord-ab
>>>c
>>> I get 5 results.
>>>
>>>
>>> If I put them together with the user filter first
>>> http://myserver:11000/oozie/v1/jobs?jobtype=coord&filter=
>>> user%3Dmyuser&filter=name%3Dcoord-abc
>>> I get 51 results
>>>
>>>
>>> If I put them together with the name filter first:
>>> http://myserver:11000/oozie/v1/jobs?jobtype=coord&filter=
>>> name%3Dcoord-abc&filter=user%3Dmyuser
>>> I get 5 results.
>>>
>>>
>>> If I put them together with the name filter first and a non-existent
>>>user
>>> http://myserver:11000/oozie/v1/jobs?jobtype=coord&filter=
>>> name%3Dcoord-abc&filter=user%3Dnobodythere
>>> I get 5 results.
>>>
>>>
>>> So the second filter is *completely ignored*.  *Is there a way to set
>>>two
>>> or more filters on one REST query?*
>>>
>>
>> try this:
>>
>> http://myserver:11000/oozie/v1/jobs?jobtype=coord&filter=
>> name%3Dcoord-abc%3Buser%3Dnobodythere
>>
>> david
>>


Reply via email to