Hi, You should use Oozie REST APIs for this. Submitting the WF via REST will return the WF:id in JSON, similar to how you get it back from the CLI.
You can use this loop as a starting point to monitoring a running wf: https://github.com/kristopherkane/oozietop/blob/master/oozietop.py - This was a pet project but could be extended to receive a wf id then poll Oozie for status completion. If Oozie is 'kerberized' and that is difficult for you to work with, consider using knox.apache.org in front which will allow you to use HTTP basic auth over SSL. Kris On Sat, Jun 20, 2015 at 5:40 AM, Bijoy Deb <[email protected]> wrote: > Hi, > > I have created a workflow using Oozie that comprises of multiple action > nodes and have been successfully able to run those via coordinator.But I > want to invoke the Oozie workflow via some wrapper shell script.The wrapper > script should invoke the Oozie command,wait till the oozie job > completes(success or error) and return back the Oozie success status code > (0) or the error code of the failed oozie action node(if any node of the > oozie workflow has failed). > > From what I have seen so far,I know that as soon as I invoke the oozie > command to run a workflow,the command exits with the job id getting printed > on linux console,while the oozie job keeps running asynchronously in the > backend.But I want my wrapper script to block till the oozie coordinator > job completion and return back the success/error code. > > Can you please let me know how/if I can achieve this using any of the oozie > features. > > I am using Oozie version 3.3.2 and bash shell in Linux. > > Note: In case anyone is curious about why I need such kind of feature - the > requirement is that my wrapper shell script should know how long has an > oozie job run for,when an oozie job has completed,and accordingly return > back the exit code so that the parent process that is calling the wrapper > script knows whether the job completed successfully or not,and if errored > out,raise an alert/ticket for the support team. > > Thanks, > Bijoy >
