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-abc
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?*

Thanks,
Michael



On Fri, Mar 21, 2014 at 11:57 AM, David Morel <[email protected]>wrote:

> Start by putting your url between single quotes as you run in a shell?
> David
>
> On 21 mars 2014 16:11:28 CET, [email protected] wrote:
>
>> I am learning the Oozie REST API and having trouble getting filters to work.
>>
>> In particular, I have two user cases:
>> 1) I want is to query for coordinator jobs that are in a certain state,
>> such as "RUNNING"
>> 2) I want to get the info for a particular coordinator job based on its name
>>
>> My attempts so far have all failed.  I can limit the output to just
>> coordinator jobs, but trying to limit or filter further doesn't work.
>>
>> I am using Oozie version: 3.3.2
>>
>>
>> *Examples*
>>
>>
>> All of these requests return the exact same data:
>>
>> curl -o coord.out1.json $OOZIE_URL/v1/jobs?jobtype=coord
>> curl -o coord.out2.json $OOZIE_URL/v1/jobs?jobtype=coord
>> &filter=status%3Drunning
>> curl -o coord.out3.json $OOZIE_URL/v1/jobs?jobtype=coord
>> &filter=status%3DRUNNING
>> curl -o coord.out4.json $OOZIE_URL/v1/jobs?jobtype=coord
>> &filter=status%3DKILLED
>> curl -o coord.out5.json
>> $OOZIE_URL/v1/jobs?jobtype=coord&status=RUNNING
>> curl -o coord.out6.json $OOZIE_URL/v1/jobs?jobtype=coord&filter=coordJobName
>> %3Dunify-datamart-build-for-testgroup
>> curl -o coord.out7.json $OOZIE_URL/v1/jobs?jobtype=coord&filter=coordJobName
>> %3Dunify
>> curl -o coord.out8.json $OOZIE_URL/v1/jobs?jobtype=coord&coordJobName=unify-
>> datamart-build-for-testgroup
>>
>>
>> The all return return 423 lines of json (when expanded).  It does only
>> return coordinatorJobs, but it returns all jobs and all statuses.
>>
>> Interestingly, this one returns an error that "request sent by the client
>> was syntactically incorrect"
>>
>> $ curl -o coord.out3.json $OOZIE_URL/v1/jobs?filter=status%3Drunning&jobtype
>> =coord
>>
>> Please help me figure out how to use filters properly.  There is very
>> limited documentation available on the web about how to do this.
>>
>> Thank you,
>>
>> -Michael
>>
>>

Reply via email to