ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nate Cole <nc...@hortonworks.com>
Subject Re: how to get the task-id in the install method of the service
Date Tue, 17 Mar 2015 11:37:49 GMT
Hi Satya,

The task id is available in the command json file itself, so by the time the install() method
is invoked, you can ask for that attribute.  It is at the root element of the json called
“taskId”.  You can inspect the value using something like:

task_id = config[“taskId”]
or
task_id = default(“/taskId”, None)

Thanks,
Nate

On Mar 16, 2015, at 2:57 AM, Satyanarayana Jampa <sjampa@innominds.com<mailto:sjampa@innominds.com>>
wrote:

i am writing a custom service, where in i need to get the command-<taskid>.json file
path in the "install: method of my custom service.

This file is being generated during install f the service at "/var/lib/ambari-agent/data/"

So, i need the path of this file "/var/lib/ambari-agent/data/command-<TASKID>.json"
or, it would be great if i can get the taskid of the running service in the install method.

Thanks,
Satya.


Mime
View raw message