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 the parameters to oozie restapi where the parameters are dynamic.

how to pass the parameters to oozie restapi where the parameters are dynamic.

Explorer

Usecase description:

There are 2 server A and B and in 2 different network where from A server will be sending a request for file and request has pass through oozie restapi and hit the hive database in the B server. Processing happens in the server B and the response will be the requested file and send it back to A server.

The request for file will be dynamically changing and it will be in hive database.

command:

curl --negotiate -u "knoxuser:knoxpassword" -X POST -H "Content-Type: application/xml" -d @config.xml http://oozie-baseurl/oozie/v1/jobs/?jobtype=hive

cat config.xml

<?xml version="1.0" encoding="UTF-8"?> <configuration> <property> <name>fs.default.name</name> <value>hdfs://namenode</value> </property> <property> <name>mapred.job.tracker</name> <value>net:8060</value> </property> <property> <name>user.name</name> <value>user.name</value> </property> <property> <name>oozie.hive.script</name> <value>SELECT column1 from database.table where column2='filename.zip' limit 1;</value> </property> <property> <name>oozie.libpath</name> <value>pathofoozie</value> </property> <!--property> <name>oozie.proxysubmission</name> <value>true</value> <--/property> </configuration>

Error:

<html><head><title>Apache Tomcat/6.0.37 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - /oozie/v1/jobs/</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/oozie/v1/jobs/</u></p><p><b>description</b> <u>The requested resource is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/6.0.37</h3></body></html>

Reference : http://archive.cloudera.com/cdh4/cdh/4/oozie/WebServicesAPI.html#Proxy_Hive_Job_Submission
Don't have an account?
Coming from Hortonworks? Activate your account here