Return-Path: X-Original-To: apmail-brooklyn-dev-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B5FCD18BCE for ; Tue, 24 Nov 2015 08:50:45 +0000 (UTC) Received: (qmail 84831 invoked by uid 500); 24 Nov 2015 08:50:45 -0000 Delivered-To: apmail-brooklyn-dev-archive@brooklyn.apache.org Received: (qmail 84791 invoked by uid 500); 24 Nov 2015 08:50:45 -0000 Mailing-List: contact dev-help@brooklyn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.incubator.apache.org Delivered-To: mailing list dev@brooklyn.incubator.apache.org Received: (qmail 84779 invoked by uid 99); 24 Nov 2015 08:50:45 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Nov 2015 08:50:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id B37931A0CC4 for ; Tue, 24 Nov 2015 08:50:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.901 X-Spam-Level: ** X-Spam-Status: No, score=2.901 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=cloudsoftcorp.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id MHk6PV4t9eNv for ; Tue, 24 Nov 2015 08:50:30 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 9322D20562 for ; Tue, 24 Nov 2015 08:50:29 +0000 (UTC) Received: by lfaz4 with SMTP id z4so11735852lfa.0 for ; Tue, 24 Nov 2015 00:50:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudsoftcorp.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=KJfrzq6x3YfeIuvnvZ3oLxDCCAQoVzuatJCrHU043Ls=; b=GaJGNGx3gSdg032LDhSe0GYw47AD8kLuy0HhSxBiWd8zo9cJER3usPBsxfJLFzFxuA dG15S7fIXipIQ1YuTdp7R+ZRDr3sdyxaNNcfZdwNlFOnpZShNDYBSIThmg0zUjwuwoIx OJ91DkdrYsSohJ2VMM7Y0jUcRSkNRZ4Usml+M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=KJfrzq6x3YfeIuvnvZ3oLxDCCAQoVzuatJCrHU043Ls=; b=SOoXYEiHumxFz7GlTujNG66W+8zvV6kOuB6x5z2wsaS4Xbonpk1V3sNr6Z2vb0KaCs Uefn6XGSIc1ltB4TfK1W86yxjvQTTgW0ygaLM8ikZ2De/aNs7CqnIv0r9hQoajqG/IRF fgcFe+berDWTAynaKF/kOFNNIMpD1U0Ol2+mJF4RPa2qWiU4rY+YWTFLK3YpJb/2tRA6 gYZySAA0qux4VISZaSMW+bASG0SWB9HYORyHFOSkLva4hF02Ak7XZn9BoqHSLUwBacoC l1451IaWdh8Y0fEMS2jSGkA4zIcU4hxa5hcS8pOJK64yZterOPpRVI2oi46oJRezCmB8 Rffg== X-Gm-Message-State: ALoCoQmIg+2EAFj++ijqJ79D1LYsOkaPKHJhk0SPM9Gm9WttoXH5IpeAI8vGWd2Ryb2r31eLLCQOCdVV/9onDfmEdQRHNOd7AsVTel4WpD1w1OHgVi+0J0ISPO+4/usWyMN4RgA4xbldJuOufxzB+DNe8igIesAUjg== MIME-Version: 1.0 X-Received: by 10.112.133.42 with SMTP id oz10mr12423285lbb.92.1448355027773; Tue, 24 Nov 2015 00:50:27 -0800 (PST) Received: by 10.25.86.147 with HTTP; Tue, 24 Nov 2015 00:50:27 -0800 (PST) In-Reply-To: References: <564F1921.4060004@gmail.com> <2413429A-2BDE-47D7-9943-07F40DC29F5A@cloudsoftcorp.com> <23B47729-4F0A-4084-A519-1103ED1C5DDA@cloudsoftcorp.com> <5652DBDE.7080407@CloudsoftCorp.com> <5652FC4C.50000@gmail.com> <5652FF79.5070407@gmail.com> Date: Tue, 24 Nov 2015 08:50:27 +0000 Message-ID: Subject: Re: Request for comment on a proposal for a Brooklyn CLI From: David Lloyd To: dev@brooklyn.incubator.apache.org Content-Type: multipart/alternative; boundary=047d7b3a8bfaf08d260525456ece X-Legal-Virus-Advice: Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by Cloudsoft Corporation Limited in this regard and the recipient should carry out such virus and other checks as it considers appropriate. X-Legal-Confidentiality: This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. Cloudsoft Corporation Limited does not accept responsibility for changes made to this message after it was sent. X-Legal-Company-Info: Cloudsoft Corporation Limited. Registered in Scotland. Number: SC349230. Registered Office: 13 Dryden Place, Edinburgh, EH9 1RP. --047d7b3a8bfaf08d260525456ece Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable +1 for option 1 style - but using Mike's suggestion of bk On 24 November 2015 at 08:25, Mark McKenna wrote: > +1 for option 1 > +1 For Mikes suggestion of "bk" over "br" > > On Tue, 24 Nov 2015, 00:12 Mike Zaccardo > wrote: > > > +1 `brooklyn` for server > > +1 2-letter command for client ops, but propose `bk` as the > abbreviation[1] > > > > [1] That's how we New Yorkers do it > > > > On Mon, Nov 23, 2015 at 6:59 AM Aled Sage wrote: > > > > > +1 for option (1): "br". > > > > > > If we're doing single transferable vote [1], then my second preferenc= e > > > would be (3) with the understanding that the brooklyn server-side > > > command may change substantially when we switch to Karaf. We should > also > > > be moving to using something like `service brooklyn start` for the > > > server-side, so we could live with the name clash in the mean time. > > > > > > Aled > > > > > > [1] http://www.electoral-reform.org.uk/single-transferable-vote > > > > > > > > > On 23/11/2015 11:45, Hadrian Zbarcea wrote: > > > > I also like 'brooky' for some weird reason, but +1 for 'br'. > > > > > > > > Hadrian > > > > > > > > On 11/23/2015 04:26 AM, Alex Heneveld wrote: > > > >> > > > >> There is a trend towards 2LAs (two-letter acronyms) for commands i= n > > > >> devops -- for instance `cf` and `tf` and of course `go`. We alrea= dy > > > >> have `brooklyn` as a CLI for the *server*; however it does take a > > > >> `launch` argument so we could overload it: > > > >> > > > >> brooklyn launch # launch a server on localhost (new > > > >> implementation as go command calling to some java) > > > >> brooklyn login URL # connect to a server somewhere > > > >> brooklyn list # > > > >> > > > >> Though that is a bit confusing IMO. Or of course we could rename > > > >> existing bin/brooklyn as brooklyn-server, or go with broo. > > > >> > > > >> Seems to me we have several options: > > > >> > > > >> 1) Use `br` for client operations and `brooklyn` for server > (original > > > >> proposal) > > > >> 2) Use `broo` for client operations and `brooklyn` for server > (Svet's > > > >> proposal) > > > >> 3) Use `brooklyn` for both server and client operations (Andrea's > > > >> proposal, expanded above) > > > >> 4) Use `brooklyn` for client operations and `brooklyn-server` for > > server > > > >> operations (mod of Andrea's proposal) > > > >> > > > >> I'm for "1" -- in my usage the 2LAs become very natural, and we're > > lucky > > > >> that `br` is not a known *nix command. (And I don't think there i= s > > that > > > >> much potential for confusion with the HTML tag.) > > > >> > > > >> Best > > > >> Alex > > > >> > > > >> > > > >> On 20/11/2015 14:32, Andrea Turli wrote: > > > >>> I agree with Svet, `br` sounds weird (too similar to
:) ) Wh= y > > > >>> `brooklyn` is not good? I think autocompletion will help and > > `brooklyn` > > > >>> will be more mnemonic, maybe. > > > >>> > > > >>> My minor comment, > > > >>> Andrea > > > >>> > > > >>> On Fri, 20 Nov 2015 at 14:28 David Lloyd > > > >>> > > > >>> wrote: > > > >>> > > > >>>> The existing CLI caches the login details (URL, username, > password) > > > >>>> in file > > > >>>> ~/.brooklyn_cli, so I guess that we'll look initially at caching > the > > > >>>> other > > > >>>> IDs in this file. > > > >>>> > > > >>>> Dave. > > > >>>> > > > >>>> On 20 November 2015 at 13:18, Svetoslav Neykov < > > > >>>> svetoslav.neykov@cloudsoftcorp.com> wrote: > > > >>>> > > > >>>>> I see many of the commands using context (the cached entity). > Where > > > >>>>> does > > > >>>>> the context go into? Can parallel shells calling into the cli > have > > > >>>>> different contexts? > > > >>>>> Perhaps we should keep the CLI context free and present the use= r > > > >>>>> with a > > > >>>>> console for where context is needed (something similar to > > > >>>>> http://htty.github.io/htty/)? > > > >>>>> > > > >>>>> Personal preference to naming the executable broo. > > > >>>>> > > > >>>>> +1 to having aliases for where context is allowed, but should b= e > > > >>>>> careful > > > >>>>> with the lifetime of the aliases. > > > >>>>> > > > >>>>> Svet. > > > >>>>> > > > >>>>> > > > >>>>>> On 20.11.2015 =D0=B3., at 15:06, Geoff Macartney < > > > >>>>> geoff.macartney@cloudsoftcorp.com> wrote: > > > >>>>>> Perhaps we could have an =E2=80=9Calias=E2=80=9D command for a= pplications etc, > > > >>>> something > > > >>>>> like > > > >>>>>> br application list > > > >>>>>> =E2=80=A6.// view the list of applications > > > >>>>>> br application alias myserver ID12ab > > > >>>>>> br application myserver add abc.yaml > > > >>>>>> br application myserver add def.yaml > > > >>>>>> br application myserver add xyz.yaml > > > >>>>>> > > > >>>>>> > > > >>>>>> =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94 > > > >>>>>> Gnu PGP key - http://is.gd/TTTTuI > > > >>>>>> > > > >>>>>> > > > >>>>>>> On 20 Nov 2015, at 12:59, Aled Sage > wrote: > > > >>>>>>> > > > >>>>>>> Thanks, > > > >>>>>>> > > > >>>>>>> This looks really good. > > > >>>>>>> > > > >>>>>>> It will be great to have this, and to have a getting started > > guide > > > >>>> that > > > >>>>> is based on this new CLI. Many other tools in the devops space > > > >>>>> focus on > > > >>>>> this kind of client CLI (e.g. Docker, Cloud Foundry, etc). > > > >>>>>>> --- > > > >>>>>>> I'm not sure about the "br application cache ", which set= s > > the > > > >>>>>>> app > > > >>>>> id to be used for subsequent calls such as "br entity ...". If > > using > > > >>>>> IDs > > > >>>>> they are globally unique, so we could just miss out the app id > > (we'd > > > >>>>> need > > > >>>>> to add to the REST api to support that). > > > >>>>>>> Would we want to support logical names for apps/entities, > rather > > > >>>>>>> than > > > >>>>> just IDs? The REST api supports looking up the app by its displ= ay > > > >>>>> name. > > > >>>> I'm > > > >>>>> not convinced we want to do that, but it certainly is > simple/useful > > > >>>>> sometimes to use logical names. > > > >>>>>>> Aled > > > >>>>>>> > > > >>>>>>> > > > >>>>>>> On 20/11/2015 12:14, David Lloyd wrote: > > > >>>>>>>> Hi All, > > > >>>>>>>> > > > >>>>>>>> We=E2=80=99ve been thinking that it would be really useful f= or > Brooklyn > > to > > > >>>>> have a > > > >>>>>>>> tool that provides a Command Line Interface (CLI) to augment > the > > > >>>>> current > > > >>>>>>>> web based GUI and REST API. The proposal below outlines what > we > > > >>>>>>>> are > > > >>>>>>>> thinking of. We request comments from the community on the > > idea, > > > >>>>>>>> and > > > >>>>> would > > > >>>>>>>> very much welcome suggestions for developing it. > > > >>>>>>>> > > > >>>>>>>> Comments can be made by replying to this email or by adding > > > >>>>>>>> comment/suggestions to this document: > > > >>>>>>>> > > > >>>> > > > > > > https://docs.google.com/document/d/1KNCHG--ExGevcGoJ3cRzcrjh3mWsZOzyCzRM_= TpoGGo/edit?usp=3Dsharing > > > >>>> > > > >>>> > > > >>>>>>>> (and there are two comments on the document already) > > > >>>>>>>> > > > >>>>>>>> > > > >>>>>>>> Description of Proposal > > > >>>>>>>> > > > >>>>>>>> The current REST API provides a powerful way for controlling > > > >>>> Brooklyn, > > > >>>>> but > > > >>>>>>>> it is difficult to combine operations (using the output of a > > > >>>>>>>> command > > > >>>> as > > > >>>>>>>> input to a second command) using the GUI or using the REST A= PI > > > >>>>>>>> on a > > > >>>>> command > > > >>>>>>>> line. We think that having a dedicated command line tool > would > > > >>>>>>>> make > > > >>>> it > > > >>>>>>>> easier for beginners and advanced users to control Brooklyn. > > > >>>>>>>> > > > >>>>>>>> Robert Moss has already done some excellent work on the =E2= =80=98Go > CLI > > > >>>> client > > > >>>>> for > > > >>>>>>>> Brooklyn REST API=E2=80=99 which can be found at > > > >>>>> brooklyncentral/brooklyn-cli. Our > > > >>>>>>>> intention with this proposal would be to build upon this wor= k > > and > > > >>>>> implement > > > >>>>>>>> a set of commands that go beyond mirroring the REST API. We > > > >>>>>>>> feel it > > > >>>>> would > > > >>>>>>>> be best to keep the CLI in its own repo (so it can follow th= e > Go > > > >>>>>>>> conventions), for example with the name brooklyn-cli. > > > >>>>>>>> > > > >>>>>>>> We think that it is important for a CLI to be portable and t= o > > > >>>>>>>> have as > > > >>>>> few > > > >>>>>>>> (if any) dependencies on other tools as possible. Go has th= e > > > >>>>> advantages of > > > >>>>>>>> compiling to native OS specific binaries that are statically > > > >>>>>>>> linked, > > > >>>> so > > > >>>>>>>> avoids the need for installing dependencies (and getting the > > right > > > >>>>>>>> combination of versions!). It can also be compiled for > multiple > > > >>>>> operating > > > >>>>>>>> systems, enabling a CLI to be built for servers and typical > end > > > >>>>>>>> user > > > >>>>>>>> systems. > > > >>>>>>>> > > > >>>>>>>> Some possible commands that the CLI may provide include: > > > >>>>>>>> > > > >>>>>>>> br login > > > >>>>>>>> > > > >>>>>>>> cache login credentials for the Brooklyn instance > > > >>>>>>>> > > > >>>>>>>> br application list > > > >>>>>>>> > > > >>>>>>>> show the list of applications > > > >>>>>>>> > > > >>>>>>>> br application show > > > >>>>>>>> > > > >>>>>>>> show details of application > > > >>>>>>>> > > > >>>>>>>> br application cache > > > >>>>>>>> > > > >>>>>>>> cache the application to be used with subsequent comman= ds > > > >>>>>>>> that > > > >>>>> require > > > >>>>>>>> an application ID. > > > >>>>>>>> > > > >>>>>>>> br application add > > > >>>>>>>> > > > >>>>>>>> add (deploy) the specified application blueprint > > > >>>>>>>> > > > >>>>>>>> br entity list [-r] > > > >>>>>>>> > > > >>>>>>>> list the entities for an application, recursively if =E2=80= =98-r=E2=80=99 > > > >>>>>>>> specified > > > >>>>>>>> (having previously used =E2=80=98br application cache = =E2=80=99) > > > >>>>>>>> > > > >>>>>>>> br entity show > > > >>>>>>>> > > > >>>>>>>> show the details for an entity > > > >>>>>>>> > > > >>>>>>>> br entity cache > > > >>>>>>>> > > > >>>>>>>> cache the entity to be used with subsequent commands th= at > > > >>>> require > > > >>>>> an > > > >>>>>>>> entity ID (to be discarded if a new application ID is set). > > > >>>>>>>> > > > >>>>>>>> br sensor list > > > >>>>>>>> > > > >>>>>>>> list the sensors for an application / entity > > > >>>>>>>> > > > >>>>>>>> (having previously used =E2=80=98br application cache = =E2=80=99 and =E2=80=98br > > entity > > > >>>>> cache > > > >>>>>>>> =E2=80=99) > > > >>>>>>>> > > > >>>>>>>> br sensor show > > > >>>>>>>> > > > >>>>>>>> show the sensor value > > > >>>>>>>> > > > >>>>>>>> br sensor show service.isUp > > > >>>>>>>> > > > >>>>>>>> show the value of the service.isUp sensor on the previously > > > >>>>>>>> specified > > > >>>>>>>> application / entity > > > >>>>>>>> > > > >>>>>>>> br effector list > > > >>>>>>>> > > > >>>>>>>> list the effectors for an application / entity > > > >>>>>>>> > > > >>>>>>>> br effector invoke "{}" > > > >>>>>>>> > > > >>>>>>>> run the effector for a previously cached application > > / > > > >>>>> entity > > > >>>>>>>> > > > >>>>>>>> > > > >>>>>>>> br catalog list > > > >>>>>>>> > > > >>>>>>>> show the list of available catalog items > > > >>>>>>>> > > > >>>>>>>> br catalog add > > > >>>>>>>> > > > >>>>>>>> add the specified catalog entries > > > >>>>>>>> > > > >>>>>>>> br location list > > > >>>>>>>> > > > >>>>>>>> list the available locations > > > >>>>>>>> > > > >>>>>>>> br location show > > > >>>>>>>> > > > >>>>>>>> show details for location > > > >>>>>>>> > > > >>>>>>>> br location add "{locationSpec}" > > > >>>>>>>> > > > >>>>>>>> add the specified location > > > >>>>>>>> > > > >>>>>>>> It is intended that further commands would be added later su= ch > > as: > > > >>>>>>>> > > > >>>>>>>> - > > > >>>>>>>> > > > >>>>>>>> br policy =E2=80=A6 > > > >>>>>>>> - > > > >>>>>>>> > > > >>>>>>>> br activity =E2=80=A6 > > > >>>>>>>> - > > > >>>>>>>> > > > >>>>>>>> etc. > > > >>>>>>>> > > > >>>>>>>> > > > >>>>>>>> Existing CLI > > > >>>>>>>> > > > >>>>>>>> For reference the implemented commands for the existing > > > >>>>>>>> brooklyn-cli > > > >>>>> are: > > > >>>>>>>> USAGE: > > > >>>>>>>> > > > >>>>>>>> br [global options] command [command options] [arguments..= .] > > > >>>>>>>> > > > >>>>>>>> VERSION: > > > >>>>>>>> > > > >>>>>>>> 0.0.0 > > > >>>>>>>> > > > >>>>>>>> COMMANDS: > > > >>>>>>>> > > > >>>>>>>> access Show access control > > > >>>>>>>> > > > >>>>>>>> activity Show the activity for an entity > > > >>>>>>>> > > > >>>>>>>> activity-children Show the child activities for an entity > > > >>>>>>>> > > > >>>>>>>> activity-stream Show the stream for a given activity > > > >>>>>>>> > > > >>>>>>>> add-catalog Add a new catalog item from the supplied YAML > > > >>>>>>>> > > > >>>>>>>> add-children Add a child or children to this entity from t= he > > > >>>> supplied > > > >>>>> YAML > > > >>>>>>>> application Show the status and location of a running > > > >>>>>>>> application > > > >>>>>>>> > > > >>>>>>>> applications Show the status and location of running > > > >>>>>>>> applications > > > >>>>>>>> > > > >>>>>>>> catalog List the available catalog applications > > > >>>>>>>> > > > >>>>>>>> config Show the config for an application and entity > > > >>>>>>>> > > > >>>>>>>> create Create a new brooklyn application from the supplied > > YAML > > > >>>>>>>> > > > >>>>>>>> delete Delete a brooklyn application > > > >>>>>>>> > > > >>>>>>>> destroy-policy Destroy a policy > > > >>>>>>>> > > > >>>>>>>> effectors Show the list of effectors for an application an= d > > > >>>>>>>> entity > > > >>>>>>>> > > > >>>>>>>> entities Show the entites for an application > > > >>>>>>>> > > > >>>>>>>> entity-children Show the children of an application's enti= ty > > > >>>>>>>> > > > >>>>>>>> locations List the available locations > > > >>>>>>>> > > > >>>>>>>> login Login to brooklyn > > > >>>>>>>> > > > >>>>>>>> policies Show the list of policies for an application and > > entity > > > >>>>>>>> > > > >>>>>>>> policy Show the status of a policy for an application and > > entity > > > >>>>>>>> > > > >>>>>>>> rename-entity Rename an entity > > > >>>>>>>> > > > >>>>>>>> sensor Show the value of a sensor for an application and > > entity > > > >>>>>>>> > > > >>>>>>>> sensors Show the sensors for an application and entity > > > >>>>>>>> > > > >>>>>>>> set-config Set config for an entity > > > >>>>>>>> > > > >>>>>>>> spec Get the YAML spec used to create the entity, if > available > > > >>>>>>>> > > > >>>>>>>> start-policy Start or resume a policy > > > >>>>>>>> > > > >>>>>>>> stop-policy Suspends a policy > > > >>>>>>>> > > > >>>>>>>> tree Show the tree of all applications > > > >>>>>>>> version Display the version of the connected Brooklyn > > > >>>>>>>> > > > >>>>>>>> > > > >>>>>>>> Geoff Macartney (geoff.macartney@cloudsoft.io) > > > >>>>>>>> David Lloyd (david.lloyd@cloudsoft.io) > > > >>>>>>>> > > > >>>>> > > > >> > > > > > > > > > -- > > *Mark McKenna* > > *Twitter :: @m4rkmckenna * > > *PGP :: public-key > * > --047d7b3a8bfaf08d260525456ece--