Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to pass parameters through API to be picked up by a shell script in Oozie?

How to pass parameters through API to be picked up by a shell script in Oozie?

New Contributor

I am able to submit an oozie job by by specifying the username, wf.application.path in an XML body that is sent as a POST request to the oozie server.

<code><configuration>
<property>
    <name>user.name</name>
    <value>cmluat</value>
</property>
<property>
    <name>oozie.wf.application.path</name>
    <value>hdfs://somename/user/hue/oozie/workspaces/hue-oozie-1537788744.34/</value>
</property>
<property>
    <name>Country</name>
    <value>Malaysia</value>
</property>

When job status is viewed (through Hue), I am able to see the above name, value pairs under 'configuration" tab.

My question is, how do I get my shell action (that contains a shell/python script) to take these name value pairs as inputs/ arguments (Country, Malaysia).

Is there some feature in Hue to pass tags from config.xml on to the shell action. Or better yet, is there a path on HDFS where the above config .xml passed from UI to server is stored?


Side Question The path /user/hue/oozie/workspaces/hue-oozie-1537788744.34/ (which is the one provided in the XML for job submission) contains the workflow.xml, shellscript.sh, lib etc

But when i view the status of the job ID that I get as a response to job submission, clicking on the shellscript.sh visible in the DAG (through Hue) redirects me to a /user/hue/oozie/workspaces/hue-oozie-1452553957.19/ which does not exist (even when accessed out of Hue through terminal via hdfs user).

What is the workflow path hue-oozie-1452553957.19 and how does it get created, what does it contain etc?

2 REPLIES 2

Re: How to pass parameters through API to be picked up by a shell script in Oozie?

Super Guru

Re: How to pass parameters through API to be picked up by a shell script in Oozie?

New Contributor

@sunile.manjee Thanks, that is an informative article.

But my question still remains. Since I need to pass the arguments from UI side (through Oozie REST API) and these variable arguments can't be stored on HDFS.

The only file that I am able to send via the API is the config.XML as described in the question. Now how do I use the Name, Value pairs in these files as arguments inside the shell action?