apex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Yan <da...@datatorrent.com>
Subject Re: Reg job failure when submitted using curl
Date Fri, 08 Jan 2016 18:21:17 GMT
You can do so using the REST API.

/ws/v2/applications/<appid> gives you the application name in the form of:

{
  ...
  "name": "{name}",
  ...
}

David

On Fri, Jan 8, 2016 at 9:44 AM, Kottapalli, Venkatesh <
VKottapalli@directv.com> wrote:

> Ok. I see we do the same using UI where the application gets suffixed by
> int values to make it unique.
>
> In that case, is there a way to retrieve the current running job name and
> id from within the application?
>
> My use case needs to access the application details from with in the
> application to track certain things.
>
> So, how do I retrieve "dt.attr.APPLICATION_NAME" that I have set from
> within the application?
>
>
> Regards,
> Venkatesh.
>
>
>
> -----Original Message-----
> From: David Yan [mailto:david@datatorrent.com]
> Sent: Thursday, January 07, 2016 6:07 PM
> To: dev@apex.incubator.apache.org
> Subject: Re: Reg job failure when submitted using curl
>
> It's an expected behavior.  Apex does not allow multiple application
> instances with the same application name.
> What you can do is to use a different name, by adding
> "dt.attr.APPLICATION_NAME": "some-other-name" in your POST payload.
> For example:
>
> curl -XPOST -d '{ "dt.attr.APPLICATION_NAME": "some-other-name" }' http://
> <gatewayserver:9090>/ws/v2/appPackages/<admin>/<jarname>/0.0.1-SNAPSHOT/
> applications/<Processing_Job>/launch
>
> David
>
> On Thu, Jan 7, 2016 at 6:02 PM, Kottapalli, Venkatesh <
> VKottapalli@directv.com> wrote:
>
> > Hi,
> >
> >                 When I try to submit the same job with the same name
> > using the curl command, the second job will be accepted but will be
> > killed. When I submit the job with a different name, it will accept and
> run the job.
> >
> > Can you help me understand this behavior.
> >
> > I need to submit same job multiple times, it is okay if it gets
> > submitted and shows a different name like it does when we submit the job
> from DT UI.
> >
> >                 Curl -XPOST -d <DT_ARGUMENTS> http://
> >
> <gatewayserver:9090>/ws/v2/appPackages/<admin>/<jarname>/0.0.1-SNAPSHOT/applications/<Processing_Job>/launch.
> >
> >                 I am using 3.1.1 version of data torrent.
> >
> >
> > Regards,
> > Venkatesh.
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message