Return-Path: X-Original-To: apmail-ambari-user-archive@www.apache.org Delivered-To: apmail-ambari-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 64F4810E9D for ; Tue, 17 Mar 2015 11:38:41 +0000 (UTC) Received: (qmail 66606 invoked by uid 500); 17 Mar 2015 11:38:41 -0000 Delivered-To: apmail-ambari-user-archive@ambari.apache.org Received: (qmail 66576 invoked by uid 500); 17 Mar 2015 11:38:41 -0000 Mailing-List: contact user-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ambari.apache.org Delivered-To: mailing list user@ambari.apache.org Received: (qmail 66566 invoked by uid 99); 17 Mar 2015 11:38:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Mar 2015 11:38:41 +0000 X-ASF-Spam-Status: No, hits=3.5 required=5.0 tests=FSL_HELO_BARE_IP_2,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ncole@hortonworks.com designates 64.78.52.187 as permitted sender) Received: from [64.78.52.187] (HELO relayvx12c.securemail.intermedia.net) (64.78.52.187) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Mar 2015 11:38:15 +0000 Received: from securemail.intermedia.net (localhost [127.0.0.1]) by emg-ca-1-2.localdomain (Postfix) with ESMTP id 96FCB53E4D for ; Tue, 17 Mar 2015 04:37:51 -0700 (PDT) Subject: Re: how to get the task-id in the install method of the service MIME-Version: 1.0 x-echoworx-emg-received: Tue, 17 Mar 2015 04:37:51.598 -0700 x-echoworx-msg-id: c77c5d8d-c927-4d21-9bcf-a563f228f021 x-echoworx-action: delivered Received: from 10.254.155.17 ([10.254.155.17]) by emg-ca-1-2 (JAMES SMTP Server 2.3.2) with SMTP ID 707 for ; Tue, 17 Mar 2015 04:37:51 -0700 (PDT) Received: from MBX080-W4-CO-2.exch080.serverpod.net (unknown [10.224.117.102]) by emg-ca-1-2.localdomain (Postfix) with ESMTP id 3F2CB53E4D for ; Tue, 17 Mar 2015 04:37:51 -0700 (PDT) Received: from MBX080-W4-CO-1.exch080.serverpod.net (10.224.117.101) by MBX080-W4-CO-2.exch080.serverpod.net (10.224.117.102) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Tue, 17 Mar 2015 04:37:50 -0700 Received: from MBX080-W4-CO-1.exch080.serverpod.net ([10.224.117.101]) by mbx080-w4-co-1.exch080.serverpod.net ([10.224.117.101]) with mapi id 15.00.1044.021; Tue, 17 Mar 2015 04:37:50 -0700 From: Nate Cole To: "user@ambari.apache.org" Thread-Topic: how to get the task-id in the install method of the service Thread-Index: AQHQX7YEtEz8Ew3IqEqLEp8zLfw+Vp0hA4aA Date: Tue, 17 Mar 2015 11:37:49 +0000 Message-ID: <9CFC48EB-9D0E-4B1C-B1F1-19D9AC9E6D81@hortonworks.com> References: <1426489178835.65376@innominds.com> In-Reply-To: <1426489178835.65376@innominds.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [100.11.103.179] x-source-routing-agent: Processed Content-Type: multipart/alternative; boundary="_000_9CFC48EB9D0E4B1CB1F119D9AC9E6D81hortonworkscom_" X-Virus-Checked: Checked by ClamAV on apache.org --_000_9CFC48EB9D0E4B1CB1F119D9AC9E6D81hortonworkscom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable Hi Satya, The task id is available in the command json file itself, so by the time th= e install() method is invoked, you can ask for that attribute. It is at th= e root element of the json called =93taskId=94. You can inspect the value = using something like: task_id =3D config[=93taskId=94] or task_id =3D default(=93/taskId=94, None) Thanks, Nate On Mar 16, 2015, at 2:57 AM, Satyanarayana Jampa > wrote: i am writing a custom service, where in i need to get the command-.= json file path in the "install: method of my custom service. This file is being generated during install f the service at "/var/lib/amba= ri-agent/data/" So, i need the path of this file "/var/lib/ambari-agent/data/command-.json" or, it would be great if i can get the taskid of the running service in the= install method. Thanks, Satya. --_000_9CFC48EB9D0E4B1CB1F119D9AC9E6D81hortonworkscom_ Content-Type: text/html; charset="Windows-1252" Content-ID: <1C1EA107B418CA4694BD19B041AD5CF8@exch080.serverpod.net> Content-Transfer-Encoding: quoted-printable Hi Satya,

The task id is available in the command json file itself, s= o by the time the install() method is invoked, you can ask for that attribu= te.  It is at the root element of the json called =93taskId=94.  = You can inspect the value using something like:

task_id =3D config[=93taskId=94]
or
task_id =3D default(=93/taskId=94, None)

Thanks,
Nate

On Mar 16, 2015, at 2:57 AM, Satyanarayana Jampa <sjampa@innominds.com> w= rote:

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 instal= l f the service at "/var/lib/ambari-agent/data/"

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

Thanks,
Satya.

--_000_9CFC48EB9D0E4B1CB1F119D9AC9E6D81hortonworkscom_--