You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@oozie.apache.org by Parrot Silk <si...@gmail.com> on 2013/03/08 20:17:59 UTC

Web Service API: Job Submission example

Hi,

   I tried to send job submission request via curl. However, whatever I
did, I just get "The request sent by the client was syntactically
incorrect". Can someone give an example?

What I have done is:

1. I create a file called "oozie_wf_sample.xml". It contains the following
text:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property>
<name>user.name</name>
<value>foo</value>
</property>
<property>
<name>oozie.wf.application.path</name>
<value>hdfs://localhost:8020/user/foo/examples/apps/map-reduce/</value>
</property>
</configuration>

2. I tried the following curl commands:
curl -X POST -H 'Content-type/xml' -d @oozie_wf_sample.xml
http://192.168.220.129:11000/oozie/v1/jobs

curl -X POST -d @oozie_wf_sample.xml
http://192.168.220.129:11000/oozie/v1/jobs

curl -u foo:bar -X POST -d @oozie_wf_sample.xml
http://192.168.220.129:11000/oozie/v1/jobs

Thanks
Ryan

Re: Web Service API: Job Submission example

Posted by Praveen M <le...@gmail.com>.
That worked for the oozie.wf.application.path.

However, for oozie.coord.application.path, i'm facing the same issue

The following configuration

What I have done is:

1. I create a file called "oozie_wf_sample.xml". It contains the following
text:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property>
<name>user.name</name>
<value>foo</value>
</property>
<property>
<name>oozie.coord.application.path</name>
<value>hdfs://localhost:8020/user/foo/examples/apps/map-reduce/</value>
</property>
</configuration>

does not work, for

curl -X POST -H 'Content-type:application/xml' -d @test.xml
http://localhost:11000/oozie/v1/jobs

>From the doc, oozie.coord.application.path : path to a coordinator
application file, creates a coordinator job, so i also tried, the complete
path to the application file too.
<name>oozie.coord.application.path</name>
<value>hdfs://localhost:8020/user/foo/examples/apps/map-
reduce/coordinator.xml</value>
</property>

It doesn't work either :(

Any help would be appreciated.

Thank you,
Praveen



On Mon, Mar 11, 2013 at 4:00 PM, Parrot Silk <si...@gmail.com> wrote:

> Thank you. That works!
>
>
> 2013/3/8 Parrot Silk <si...@gmail.com>
>
> > Hi,
> >
> >    I tried to send job submission request via curl. However, whatever I
> > did, I just get "The request sent by the client was syntactically
> > incorrect". Can someone give an example?
> >
> > What I have done is:
> >
> > 1. I create a file called "oozie_wf_sample.xml". It contains the
> following
> > text:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <configuration>
> > <property>
> > <name>user.name</name>
> >  <value>foo</value>
> > </property>
> > <property>
> >  <name>oozie.wf.application.path</name>
> > <value>hdfs://localhost:8020/user/foo/examples/apps/map-reduce/</value>
> >  </property>
> > </configuration>
> >
> > 2. I tried the following curl commands:
> > curl -X POST -H 'Content-type/xml' -d @oozie_wf_sample.xml
> > http://192.168.220.129:11000/oozie/v1/jobs
> >
> > curl -X POST -d @oozie_wf_sample.xml
> > http://192.168.220.129:11000/oozie/v1/jobs
> >
> > curl -u foo:bar -X POST -d @oozie_wf_sample.xml
> > http://192.168.220.129:11000/oozie/v1/jobs
> >
> > Thanks
> > Ryan
> >
>



-- 
-Praveen

Re: Web Service API: Job Submission example

Posted by Parrot Silk <si...@gmail.com>.
Thank you. That works!


2013/3/8 Parrot Silk <si...@gmail.com>

> Hi,
>
>    I tried to send job submission request via curl. However, whatever I
> did, I just get "The request sent by the client was syntactically
> incorrect". Can someone give an example?
>
> What I have done is:
>
> 1. I create a file called "oozie_wf_sample.xml". It contains the following
> text:
> <?xml version="1.0" encoding="UTF-8"?>
> <configuration>
> <property>
> <name>user.name</name>
>  <value>foo</value>
> </property>
> <property>
>  <name>oozie.wf.application.path</name>
> <value>hdfs://localhost:8020/user/foo/examples/apps/map-reduce/</value>
>  </property>
> </configuration>
>
> 2. I tried the following curl commands:
> curl -X POST -H 'Content-type/xml' -d @oozie_wf_sample.xml
> http://192.168.220.129:11000/oozie/v1/jobs
>
> curl -X POST -d @oozie_wf_sample.xml
> http://192.168.220.129:11000/oozie/v1/jobs
>
> curl -u foo:bar -X POST -d @oozie_wf_sample.xml
> http://192.168.220.129:11000/oozie/v1/jobs
>
> Thanks
> Ryan
>

Re: Web Service API: Job Submission example

Posted by Praveen M <le...@gmail.com>.
Ah, that helped. Thanks! I think i my issue was that i didn't have a "/" to
end my path.


On Mon, Mar 11, 2013 at 3:13 PM, Alejandro Abdelnur <tu...@cloudera.com>wrote:

> The header should be -H 'Content-type: application/xml'
>
> Thx
>
>
> On Mon, Mar 11, 2013 at 3:06 PM, Praveen M <le...@gmail.com>
> wrote:
>
> > I'm running into the exact same issue.  Can someone please provide some
> > insight in this?
> >
> > Thanks,
> > Praveen
> >
> >
> > On Fri, Mar 8, 2013 at 11:17 AM, Parrot Silk <si...@gmail.com>
> wrote:
> >
> > > Hi,
> > >
> > >    I tried to send job submission request via curl. However, whatever I
> > > did, I just get "The request sent by the client was syntactically
> > > incorrect". Can someone give an example?
> > >
> > > What I have done is:
> > >
> > > 1. I create a file called "oozie_wf_sample.xml". It contains the
> > following
> > > text:
> > > <?xml version="1.0" encoding="UTF-8"?>
> > > <configuration>
> > > <property>
> > > <name>user.name</name>
> > > <value>foo</value>
> > > </property>
> > > <property>
> > > <name>oozie.wf.application.path</name>
> > > <value>hdfs://localhost:8020/user/foo/examples/apps/map-reduce/</value>
> > > </property>
> > > </configuration>
> > >
> > > 2. I tried the following curl commands:
> > > curl -X POST -H 'Content-type/xml' -d @oozie_wf_sample.xml
> > > http://192.168.220.129:11000/oozie/v1/jobs
> > >
> > > curl -X POST -d @oozie_wf_sample.xml
> > > http://192.168.220.129:11000/oozie/v1/jobs
> > >
> > > curl -u foo:bar -X POST -d @oozie_wf_sample.xml
> > > http://192.168.220.129:11000/oozie/v1/jobs
> > >
> > > Thanks
> > > Ryan
> > >
> >
> >
> >
> > --
> > -Praveen
> >
>
>
>
> --
> Alejandro
>



-- 
-Praveen

Re: Web Service API: Job Submission example

Posted by Alejandro Abdelnur <tu...@cloudera.com>.
The header should be -H 'Content-type: application/xml'

Thx


On Mon, Mar 11, 2013 at 3:06 PM, Praveen M <le...@gmail.com> wrote:

> I'm running into the exact same issue.  Can someone please provide some
> insight in this?
>
> Thanks,
> Praveen
>
>
> On Fri, Mar 8, 2013 at 11:17 AM, Parrot Silk <si...@gmail.com> wrote:
>
> > Hi,
> >
> >    I tried to send job submission request via curl. However, whatever I
> > did, I just get "The request sent by the client was syntactically
> > incorrect". Can someone give an example?
> >
> > What I have done is:
> >
> > 1. I create a file called "oozie_wf_sample.xml". It contains the
> following
> > text:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <configuration>
> > <property>
> > <name>user.name</name>
> > <value>foo</value>
> > </property>
> > <property>
> > <name>oozie.wf.application.path</name>
> > <value>hdfs://localhost:8020/user/foo/examples/apps/map-reduce/</value>
> > </property>
> > </configuration>
> >
> > 2. I tried the following curl commands:
> > curl -X POST -H 'Content-type/xml' -d @oozie_wf_sample.xml
> > http://192.168.220.129:11000/oozie/v1/jobs
> >
> > curl -X POST -d @oozie_wf_sample.xml
> > http://192.168.220.129:11000/oozie/v1/jobs
> >
> > curl -u foo:bar -X POST -d @oozie_wf_sample.xml
> > http://192.168.220.129:11000/oozie/v1/jobs
> >
> > Thanks
> > Ryan
> >
>
>
>
> --
> -Praveen
>



-- 
Alejandro

Re: Web Service API: Job Submission example

Posted by Praveen M <le...@gmail.com>.
I'm running into the exact same issue.  Can someone please provide some
insight in this?

Thanks,
Praveen


On Fri, Mar 8, 2013 at 11:17 AM, Parrot Silk <si...@gmail.com> wrote:

> Hi,
>
>    I tried to send job submission request via curl. However, whatever I
> did, I just get "The request sent by the client was syntactically
> incorrect". Can someone give an example?
>
> What I have done is:
>
> 1. I create a file called "oozie_wf_sample.xml". It contains the following
> text:
> <?xml version="1.0" encoding="UTF-8"?>
> <configuration>
> <property>
> <name>user.name</name>
> <value>foo</value>
> </property>
> <property>
> <name>oozie.wf.application.path</name>
> <value>hdfs://localhost:8020/user/foo/examples/apps/map-reduce/</value>
> </property>
> </configuration>
>
> 2. I tried the following curl commands:
> curl -X POST -H 'Content-type/xml' -d @oozie_wf_sample.xml
> http://192.168.220.129:11000/oozie/v1/jobs
>
> curl -X POST -d @oozie_wf_sample.xml
> http://192.168.220.129:11000/oozie/v1/jobs
>
> curl -u foo:bar -X POST -d @oozie_wf_sample.xml
> http://192.168.220.129:11000/oozie/v1/jobs
>
> Thanks
> Ryan
>



-- 
-Praveen