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 B309318C69 for ; Tue, 12 Jan 2016 14:05:21 +0000 (UTC) Received: (qmail 30286 invoked by uid 500); 12 Jan 2016 14:05:21 -0000 Delivered-To: apmail-ambari-user-archive@ambari.apache.org Received: (qmail 30240 invoked by uid 500); 12 Jan 2016 14:05:21 -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 30203 invoked by uid 99); 12 Jan 2016 14:05:21 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jan 2016 14:05:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 5F18C180510 for ; Tue, 12 Jan 2016 14:05:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.873 X-Spam-Level: *** X-Spam-Status: No, score=3.873 tagged_above=-999 required=6.31 tests=[FSL_HELO_BARE_IP_2=0.873, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Pa1DDBa37V4H for ; Tue, 12 Jan 2016 14:05:10 +0000 (UTC) Received: from relayvx11b.securemail.intermedia.net (relayvx11b.securemail.intermedia.net [64.78.52.184]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 0B04D2156B for ; Tue, 12 Jan 2016 14:05:09 +0000 (UTC) Received: from securemail.intermedia.net (localhost [127.0.0.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by emg-ca-1-1.localdomain (Postfix) with ESMTPS id 6B41F53DB0 for ; Tue, 12 Jan 2016 06:05:07 -0800 (PST) Subject: Re: Re:Need help Regarding Ambari Custom service Creation MIME-Version: 1.0 x-echoworx-msg-id: 8e643531-2b64-4cdc-8853-2cea403a4693 x-echoworx-emg-received: Tue, 12 Jan 2016 06:05:07.361 -0800 x-echoworx-message-code-hashed: a276740ad0ad4048a11908d433e57985d83824bd3acf918a3cebfdd4e44d8bd1 x-echoworx-action: delivered Received: from 10.254.155.14 ([10.254.155.14]) by emg-ca-1-1 (JAMES SMTP Server 2.3.2) with SMTP ID 390 for ; Tue, 12 Jan 2016 06:05:07 -0800 (PST) Received: from MBX080-W4-CO-1.exch080.serverpod.net (unknown [10.224.117.101]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by emg-ca-1-1.localdomain (Postfix) with ESMTPS id 1BCDF53DB0 for ; Tue, 12 Jan 2016 06:05:07 -0800 (PST) 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 Microsoft SMTP Server (TLS) id 15.0.1130.7; Tue, 12 Jan 2016 06:05:06 -0800 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.1130.005; Tue, 12 Jan 2016 06:05:06 -0800 From: Sumit Mohanty To: "user@ambari.apache.org" Thread-Topic: Re:Need help Regarding Ambari Custom service Creation Thread-Index: AdFKDiVBPmTO/l1yQ8i2T/Zhn9+VWwATPJqAAAAzj4D//41l8IAGjaoA//+xTk8= Date: Tue, 12 Jan 2016 14:05:05 +0000 Message-ID: <1452607505298.96801@hortonworks.com> In-Reply-To: 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: [50.136.233.78] x-source-routing-agent: Processed Content-Type: multipart/alternative; boundary="_000_145260750529896801hortonworkscom_" --_000_145260750529896801hortonworkscom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable I do not think we have such a function in the resource_management library. But you can call any shell command using the Execute() function. -Sumit ________________________________ From: Rohit Kale Sent: Tuesday, January 12, 2016 2:45 AM To: user@ambari.apache.org Subject: RE: Re:Need help Regarding Ambari Custom service Creation Hi Sumit, Thanks for your valuable answer, I was having one more query, Can I use this static function or block to append some string lines from on= e file to another file, Like this File() function is used here for copying, Is there anything we can use for appending from one file to another file. Regards, Rohit Kale +91-8983524506 From: Sumit Mohanty [mailto:smohanty@hortonworks.com] Sent: Friday, January 08, 2016 8:15 PM To: user@ambari.apache.org Subject: Re: Re:Need help Regarding Ambari Custom service Creation The files in folder package/files folders are example of static files that = are available to the service scripts to use. This is one example of such pattern: File(format("{dest_conf_dir}/{name}"), mode=3D0644, group=3Dparams.user_group, owner=3Dparams.accumulo_user, content=3DStaticFile(name) ) ________________________________ From: Rohit Kale > Sent: Friday, January 08, 2016 5:31 AM To: user@ambari.apache.org Subject: RE: Re:Need help Regarding Ambari Custom service Creation I have just used a sample path here, I just want to get some variable through which I can get the location or pa= th where we install services e.g. =93/var/lib/ambari-server/resources/stacks/HDP/2.2/services/=94 Regards, Rohit Kale +91-8983524506 From: Zhang Ruiqiang [mailto:zh.r.q@163.com] Sent: Friday, January 08, 2016 6:55 PM To: user@ambari.apache.org Subject: Re:Need help Regarding Ambari Custom service Creation I can't catch your meaning. Where does the source file path come from? At 2016-01-08 20:28:32, "Rohit Kale" > wrote: Hi I need a help regarding ambari custom service, I want to add a custom service in ambari which copies a file to multiple am= bari agents, For this I want to provide variables for file path in python scripts, these= python scripts get called by the service. I want to get some variable or a way by which I can use the relative path f= or copying my file For e.g. I want to copy a file from location X to Y in python script X location in contained in some ambari folder let=92s say =93/var/lib/ambar= i-server/resources/stacks/HDP/2.2/services//my_sample_file= .txt=94 Y location some location in same node say =93/tmp/=94 I want that I can fetch X location by some variable so that I can use to co= py like: Copy some_variable_name/my_sample_file.txt /tmp/ Can someone help me in this, I tried using =93../../=94 relative path but i= t doesn=92t work. Regards, Rohit Kale DISCLAIMER =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This e-mail may contain privilege= d and confidential information which is the property of Persistent Systems = Ltd. It is intended only for the use of the individual or entity to which i= t is addressed. If you are not the intended recipient, you are not authoriz= ed to read, retain, copy, print, distribute or use this message. If you hav= e received this communication in error, please notify the sender and delete= all copies of this message. Persistent Systems Ltd. does not accept any li= ability for virus infected mails. DISCLAIMER =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This e-mail may contain privilege= d and confidential information which is the property of Persistent Systems = Ltd. It is intended only for the use of the individual or entity to which i= t is addressed. If you are not the intended recipient, you are not authoriz= ed to read, retain, copy, print, distribute or use this message. If you hav= e received this communication in error, please notify the sender and delete= all copies of this message. Persistent Systems Ltd. does not accept any li= ability for virus infected mails. DISCLAIMER =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This e-mail may contain privilege= d and confidential information which is the property of Persistent Systems = Ltd. It is intended only for the use of the individual or entity to which i= t is addressed. If you are not the intended recipient, you are not authoriz= ed to read, retain, copy, print, distribute or use this message. If you hav= e received this communication in error, please notify the sender and delete= all copies of this message. Persistent Systems Ltd. does not accept any li= ability for virus infected mails. --_000_145260750529896801hortonworkscom_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable

I do not think we have such a function in the resource_management librar= y.


But you can call any shell command using the Execute() function.


-Sumit


From: Rohit Kale <rohit_= kale@persistent.com>
Sent: Tuesday, January 12, 2016 2:45 AM
To: user@ambari.apache.org
Subject: RE: Re:Need help Regarding Ambari Custom service Creation
 

Hi Sumit,

Thanks for your valuab= le answer,

I was having one more = query,

Can I use this static = function or block to append some string lines from one file to another file= ,

Like this File() funct= ion is used here for copying,

Is there anything we c= an use for appending from one file to another file.

 

Regards,

Rohit Kale

+91-8983524506

 

From: Sumit Mohanty [mailto:smohanty@hortonwo= rks.com]
Sent: Friday, January 08, 2016 8:15 PM
To: user@ambari.apache.org
Subject: Re: Re:Need help Regarding Ambari Custom service Creation

 

= The files in folder package/files folders are example of static files = that are available to the service scripts to use.

=  

= This is one example of such pattern:

=  

File(format("{dest_conf_dir}/{name}"),
&nb= sp;
mode=3D,
 
group<= span style=3D"font-size:13.0pt; font-family:"Andale Mono",serif; = color:black">=3Dparams.user_group,
  owner=3Dparams.accumulo_user,
 
=3DStaticFile(name)
)

=  


From: Rohit Kale <rohit_kale@persistent.com>
Sent: Friday, January 08, 2016 5:31 AM
To: user@ambari.apache.org=
Subject: RE: Re:Need help Regarding Ambari Custom service Creation

&nbs= p;

I have just used a sam= ple path here,

I just want to get som= e variable through which I can get the location or path where we install se= rvices e.g.

=93/var/lib/ambari-serve= r/resources/stacks/HDP/2.2/services/<MY SERVICE NAME>=94

 

Regards,

Rohit Kale

+91-8983524506

 

From: Zhang Ruiqiang [mailto:zh.r.q@163.com]
Sent: Friday, January 08, 2016 6:55 PM
To: user@ambari.apache.org=
Subject: Re:Need help Regarding Ambari Custom service Creation

 

  I= can't catch your meaning. Where does the source file path come from?



At 2016-01-08 20:28:32, "Rohit Kale" <rohit_kale@persistent.com> wrote:

Hi

I need a help regarding = ambari custom service,

I want to add a custom s= ervice in ambari which copies a file to multiple ambari agents,

For this I want to provi= de variables for file path in python scripts, these python scripts get call= ed by the service.

I want to get some varia= ble or a way by which I can use the relative path for copying my file

For e.g. I want to copy = a file from location X to Y in python script

X location in contained = in some ambari folder let=92s say =93/var/lib/ambari-server/resources/stack= s/HDP/2.2/services/<MY SERVICE NAME>/my_sample_file.txt=94

Y location some location= in same node say =93/tmp/=94

 

I want that I can fetch = X location by some variable so that I can use to copy like:

Copy  some_varia= ble_name/my_sample_file.txt   /tmp/

 

Can someone help me in t= his, I tried using =93../../=94 relative path but it doesn=92t work.=

 

Regards,

Rohit Kale

 

DISCLAIMER =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This e-mail may c= ontain privileged and confidential information which is the property of Per= sistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient,= you are not authorized to read, retain, copy, print, distribute or use thi= s message. If you have received this communication in error, please notify = the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for= virus infected mails.