Support Questions

Find answers, ask questions, and share your expertise

Invoking oozie rest api kerberos from java / scala

Hello all

I am would like some help to find information, tutorial, blogs, etc, about how to invoke the oozie rest api in a kerberized cluster, I am available to invoke the oozie rest api from shell with the command:

curl -i --negotiate -u : dataloaderusr -X POST -H "Content-Type: application/xml" -d @/tmp/workflow.xml http://hdfshadoop:11000/oozie/v2/jobs?action=start

I am trying to do the same request from my app, the app is build using playframework 2.6.15, I am searching information about, and I found 2 libraries:

1) pac4j

2) using org.apache.oozie.client.AuthOozieClient

But I didn't find examples about how to do that request, I am thinking that will be easier with AuthOozieClient, but I couldn't been able to add the dependeci library using sbt, I have this:

libraryDependencies += "org.apache.oozie" % "oozie-core" % "5.0.0"
libraryDependencies += "org.apache.oozie" % "oozie-client" % "5.0.0"  

class OozieWrapper {
  var wc: AuthOozieClient
  var OOZIE_SERVER_URL = "http://localhost:11000/oozie"
  def OozieWrapper(oozieUrlStr: String) = {
    val oozieURL = new URL(oozieUrlStr)
    wc = new AuthOozieClient(oozieURL.toString)
  }
}

I am getting this error:

OozieWrapper.scala:15:14: not found: type AuthOozieClient


I think that this should be a very popular topic, but I can't find examples, information or documentation about how make it.


Some help will be great.

Thank you so much.

1 REPLY 1

I solved it restartind intelij, now the dependecy of

libraryDependencies +="org.apache.oozie"%"oozie-client"%"5.0.0"

is in the project.