Return-Path: X-Original-To: apmail-incubator-cloudstack-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-cloudstack-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 25507D08E for ; Thu, 8 Nov 2012 16:19:33 +0000 (UTC) Received: (qmail 45801 invoked by uid 500); 8 Nov 2012 16:19:32 -0000 Delivered-To: apmail-incubator-cloudstack-dev-archive@incubator.apache.org Received: (qmail 45609 invoked by uid 500); 8 Nov 2012 16:19:32 -0000 Mailing-List: contact cloudstack-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cloudstack-dev@incubator.apache.org Delivered-To: mailing list cloudstack-dev@incubator.apache.org Received: (qmail 45575 invoked by uid 99); 8 Nov 2012 16:19:31 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 16:19:31 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of runseb@gmail.com designates 209.85.212.171 as permitted sender) Received: from [209.85.212.171] (HELO mail-wi0-f171.google.com) (209.85.212.171) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Nov 2012 16:19:25 +0000 Received: by mail-wi0-f171.google.com with SMTP id hj13so4899636wib.0 for ; Thu, 08 Nov 2012 08:19:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=84KST5oXsSNlTEV9AfDNytghYLg5lxHyjQRI2tKBpO8=; b=iFf06uSWMMAhA762w+rc5B8Cxa8bSpI1QNHp9XHAsvTn1uAt2jx2lcmwpeCBOI8C1y eluY6zp/kvnqBMN00ztbe9bqUs6CDyMnbRO1k7JiKqXFRdgF8Q1v13km1tcItfVccztd OIgHTdD1vttfDmoCulkuL8CPPn5HUhAysg6jsALOoLHhtzt4sF+HEKjMnuVPUzNav/DL D5Ox8hGhISzFFgHcNm/Ip3Kmp5rcfEcmz4RFRfsiHD27du0jt67Nv4wOciSfTUv/HMRu xq1Da9ej82/7vgALY8AC0FGZDGaGlo0NvVWfIwylp1TPOlzm84iNBtMdLLrFEDM6OQho Ehwg== Received: by 10.180.100.101 with SMTP id ex5mr31754523wib.16.1352391544739; Thu, 08 Nov 2012 08:19:04 -0800 (PST) Received: from [10.14.9.250] (79.Red-88-2-49.staticIP.rima-tde.net. [88.2.49.79]) by mx.google.com with ESMTPS id hf10sm8468615wib.0.2012.11.08.08.19.03 (version=SSLv3 cipher=OTHER); Thu, 08 Nov 2012 08:19:04 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: CLI for CloudStack: cloudmonkey From: Sebastien Goasguen In-Reply-To: <0BCCCE152323764BB7FD6AE6D7A1D90601004B435A42@BANPMAILBOX01.citrite.net> Date: Thu, 8 Nov 2012 17:19:02 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <98E52F5D-8371-49F5-B6B3-DD608E5771F7@gmail.com> References: <53DC0B94-266A-4FD1-86F4-E271C3695BC2@citrix.com> <0BCCCE152323764BB7FD6AE6D7A1D90601004B4359E2@BANPMAILBOX01.citrite.net> , <0BCCCE152323764BB7FD6AE6D7A1D90601004B4359E6@BANPMAILBOX01.citrite.net> , <0BCCCE152323764BB7FD6AE6D7A1D90601004B435A33@BANPMAILBOX01.citrite.net>, <0BCCCE152323764BB7FD6AE6D7A1D90601004B435A42@BANPMAILBOX01.citrite.net> To: cloudstack-dev@incubator.apache.org X-Mailer: Apple Mail (2.1499) X-Virus-Checked: Checked by ClamAV on apache.org On Nov 8, 2012, at 3:28 PM, Rohit Yadav wrote: > Hi Sebastien, >=20 > Are you using it from pypi/pip, if so do this: > sudo pip uninstall cloudmonkey > sudo pip install cloudmonkey >=20 no, I am doing: sudo python ./setup.py install from the source tree > I've had this bug on mac osx, fixed it: > = https://git-wip-us.apache.org/repos/asf?p=3Dincubator-cloudstack.git;a=3Dc= ommit;h=3D36e7a7884efef7c41ac369549b7bdb93e5122110 >=20 pulled that and reinstalled=E2=80=A6and it works. thanks -sebastien > If it still persists for you, checkout = http://superuser.com/questions/297527/cant-type-the-b-letter-in-python-she= ll-in-os-x >=20 > Let me know if this still fails then. >=20 > Regards. >=20 > ________________________________________ > From: Sebastien Goasguen [runseb@gmail.com] > Sent: Thursday, November 08, 2012 5:37 PM > To: cloudstack-dev@incubator.apache.org > Subject: Re: CLI for CloudStack: cloudmonkey >=20 > Hi, >=20 > I am testing the cli and I have the weirdest issue. When I set the = apikey or secretkey, the lower case 'b' letter does not print at the = prompt. > So if my keys contain 'b' they don't work.. >=20 > I tried all the other letters and they work. >=20 > Anyone seeing this, >=20 > -Sebastien >=20 > On Nov 7, 2012, at 7:25 PM, Rohit Yadav = wrote: >=20 >> yes, I think I'd mentioned in the thread or somewhere. Just use pip = or easy_install (apt-get install python-setuptools on ubuntu, install = python2.6 or above and pip if you don't have it); >>=20 >> sudo pip install cloudmonkey >>=20 >> or sudo easy_install cloudmonkey >>=20 >> now start cloudmonkey: >> $ cloudmonkey >> ... >>=20 >> Will post a blog/screencast this weekend and update doc so everyone = can get help on its usage, though it's pretty intuitive. >> ________________________________________ >> From: Musayev, Ilya [imusayev@webmd.net] >> Sent: Wednesday, November 07, 2012 11:41 PM >> To: cloudstack-dev@incubator.apache.org >> Subject: RE: CLI for CloudStack: cloudmonkey >>=20 >> Rohit, >>=20 >> Can I get the CLI only without going through the whole source code = maven install? Is it part of any RPM? >>=20 >> Thanks >> ilya >>=20 >> -----Original Message----- >> From: Rohit Yadav [mailto:rohit.yadav@citrix.com] >> Sent: Monday, November 05, 2012 11:35 AM >> To: cloudstack-dev@incubator.apache.org >> Subject: Re: CLI for CloudStack: cloudmonkey >>=20 >> Checkout latest code. Few changes to share: >>=20 >> - All lowercase now >> - Tab tab over verbs to see list of params for that api, example list = users >> - This needs improvement but help string, using --help: list user = --help >> - Caching to speedup runtime >> - Color and Parsing fixes >>=20 >> Last, I'm now able to get the doc strings for each attribute/param, = will see this tomorrow. >>=20 >> Need your help, just incase you want to contribute, these are the = TODOs: >>=20 >> - search over history >> - fix parsing >> - doc strings for parameters >> - testing for various kinds of apis (I'm able to deploy a zone with = this, but needs testing) >> - unicode char monkey, used in prompt may mess up history searching = and text display >>=20 >>=20 >> Regards. >>=20 >> On 02-Nov-2012, at 4:58 AM, Edison Su wrote: >>=20 >>>=20 >>>=20 >>>> -----Original Message----- >>>> From: Rohit Yadav [mailto:rohit.yadav@citrix.com] >>>> Sent: Thursday, November 01, 2012 2:23 PM >>>> To: cloudstack-dev@incubator.apache.org >>>> Subject: RE: CLI for CloudStack: cloudmonkey >>>>=20 >>>> After you install the tool, so that cloudmonkey is in your >>>> /usr/local/bin or in $PATH... >>>>=20 >>>> Two ways; >>>> 1. As command line tool, on bash/zsh, use the BNF grammar; >>> line tool >>>> name>:::::: >>>> =3D{'cloudmonkey'} =3D{' '} >>>> =3D{'list', 'create', 'delete', 'update'.... etc.} >>>> =3D{'Users'... etc.} =3D{'listall=3D#'... etc.} So; = $ >>>> cloudmonkey list Users >>>=20 >>>=20 >>> Got it, thanks! >>>=20 >>>>=20 >>>> 2. file redirector: >>>>=20 >>>> $ cat test-file: >>>> list Users >>>> list >>>> >>>>=20 >>>> $ cloudmonkey < test-file >>>>=20 >>>> Note, I'll change the actions (Users, VirtualMachine etc.) to >>>> lowercase (users, virtualmachine etc.) if that's okay? >>>=20 >>> Please do, nobody wants to type extra keystroke, if it's not = necessary. >>>>=20 >>>> Regards. >>>>=20 >>>> ________________________________________ >>>> From: Edison Su [Edison.su@citrix.com] >>>> Sent: Friday, November 02, 2012 1:55 AM >>>> To: cloudstack-dev@incubator.apache.org >>>> Subject: RE: CLI for CloudStack: cloudmonkey >>>>=20 >>>> Oh, it reminds me that how to use the CLI on the bash command line? >>>> I think admin may want to call cloudstack API in a bash script, how >>>> can I do that? >>>>=20 >>>>> -----Original Message----- >>>>> From: Marcus Sorensen [mailto:shadowsor@gmail.com] >>>>> Sent: Thursday, November 01, 2012 1:11 PM >>>>> To: cloudstack-dev@incubator.apache.org >>>>> Subject: Re: CLI for CloudStack: cloudmonkey >>>>>=20 >>>>> Yes, I look forward to using it instead of local curl calls on the >>>>> command line :-) >>>>>=20 >>>>> On Thu, Nov 1, 2012 at 2:02 PM, Edison Su = wrote: >>>>>>=20 >>>>>>=20 >>>>>>> -----Original Message----- >>>>>>> From: Rohit Yadav [mailto:rohit.yadav@citrix.com] >>>>>>> Sent: Thursday, November 01, 2012 11:45 AM >>>>>>> To: cloudstack-dev@incubator.apache.org >>>>>>> Subject: RE: CLI for CloudStack: cloudmonkey >>>>>>>=20 >>>>>>> Hi Chip, please go ahead if we can fix the http/s issue. The >>>>>>> connection is based on marvin, I'm sure using CLI we'll find out >>>>>>> more bugs and fix anything in marvin thereby help maintain >>>>>>> marvin->tests and >>>>> CLI. >>>>>>> Please hack that up on = tools/marvin/marvin/cloudstackConnection.py >>>>>>>=20 >>>>>>> Edison, yes I'm working on the completedefault, I've figured a >>>>>>> solution to the parsing and tabbing issue to show params for any >>>>>>> api and added more verbs to the grammar like deploy, start etc. >>>>>>> In the new approach doc strings and params needed for an api are >>>>>>> fetched and cached in the class locally to speed up the loading = process. >>>>>>> Till it gets committed, cloudmonkey (now) will keep telling the >>>>>>> user what params they are missing until it gets all the required = ones. >>>>>>=20 >>>>>> Great! Thanks for your awesome CLI, people will like it. >>>>>>=20 >>>>>>>=20 >>>>>>> One more thing, for people who may not have unicode support the >>>>>>> prompt may appear weird and history search (up, down ) can mess = up >>>>>>> the visuals. For example on Mac it appears as a colorful emoji, >>>>>>> but I found that it looks weird on other platforms. Will = probably >>>>>>> remove it, or the user can custom set their prompt, using: set >>>>>>> prompt >>>>>>> myprompt> >>>>>>>=20 >>>>>>> Regards. >>>>>>> PS. the set command is full of (fun :) hacks because of >>>>>>> funtional/generic programming, it basically can set any = attribute >>>>>>> on the class, so one can do something like creating something >>>>>>> (var, func). For example set ruler # (so instead of - you will >>>>>>> have a # >>>>>>> separator) >>>>>>>=20 >>>>>>> ________________________________________ >>>>>>> From: Chip Childers [chip.childers@sungard.com] >>>>>>> Sent: Thursday, November 01, 2012 11:15 PM >>>>>>> To: cloudstack-dev@incubator.apache.org >>>>>>> Subject: Re: CLI for CloudStack: cloudmonkey >>>>>>>=20 >>>>>>> On Wed, Oct 31, 2012 at 2:10 PM, Rohit Yadav >>>>>>> >>>>>>> wrote: >>>>>>>> Hi, >>>>>>>>=20 >>>>>>>> I was working on a CLI for cloudstack, it's based on Marvin = (the >>>>>>>> neglected robot) and called cloudmonkey after our beloved = mascot >>>>>>>> :D >>>>>>>>=20 >>>>>>>> I've committed that on master, please review: >>>>>>>> = https://git-wip-us.apache.org/repos/asf?p=3Dincubator-cloudstack.gi >>>>>>>> t; a=3Dc ommit;h=3D2ceaa3911e792dbeb6c40dfb70961008a01f7e3c >>>>>>>>=20 >>>>>>>> Features: >>>>>>>> - it's a shell and also a terminal tool, accepts file = redirection >>>>>>>> and pipes >>>>>>>> - scalable to find and run old and new APIs >>>>>>>> - intuitive grammar and verbs >>>>>>>> - autocompletion (functional hack) >>>>>>>> - shell execution using ! or shell >>>>>>>> - cfg support: user defined variables, like prompt, ruler, = host, port etc. >>>>>>>> - history >>>>>>>> - colors (disable using set color false) >>>>>>>> - dynamic API loading and rule generation >>>>>>>> - leverages Marvin to get latest autogenerated APIs >>>>>>>> - emacs like shortcuts on prompt >>>>>>>> - uses apiKey and secretKey to interact with mgmt server >>>>>>>> - logs all client commands >>>>>>>> - PEP-8 compliant code >>>>>>>>=20 >>>>>>>> FIXMEs: >>>>>>>> - Reverse search over history >>>>>>>> - Fix input and output processing >>>>>>>>=20 >>>>>>>> It requires python and clint; >>>>>>>> pip install clint (or if you have to easy_install clint) mvn >>>>>>>> clean install -P developer cd tools/cli/cloudmonkey python >>>>>>>> cloudmonkey.py >>>>>>>>=20 >>>>>>>> If you want to have the terminal tool installed; cd tools/cli >>>>>>>> python setup.py sdist cd dist pip install >>>>>>>> cloudmonkey-0.0.4.tar.gz (or easy_install etc.) >>>>>>>>=20 >>>>>>>> You can do stuff like; >>>>>>>> cloudmonkey < file-with-commands, or cloudmonkey list Users, or >>>>>>>> as shell; >>>>>>>>=20 >>>>>>>> (If you see unicode chars cloud and monkey below, yes they were >>>>>>>> put intentionally :) >>>>>>>>=20 >>>>>>>> $ cloudmonkey >>>>>>>> =E2=98=81 Apache CloudStack CLI. Type help or ? to list = commands. >>>>>>>> =F0=9F=99=89 cloudmonkey> set apiKey >>>>>>>> =F0=9F=99=89 cloudmonkey> set secretKey >>>>>>>> =F0=9F=99=89 cloudmonkey> >>>>>>>> add api create delete disable enable help = list quit >>>> remove >>>>>>> set shell update >>>>>>>> =F0=9F=99=89 cloudmonkey> list >>>>>>>> Accounts Alerts AsyncJobs = Capabilities >>>>>>> Capacity Clusters = Configurations >>>>>>>> DiskOfferings DomainChildren Domains = Events >>>>>>> EventTypes FirewallRules Hosts >>>>>>>> HypervisorCapabilities Hypervisors = InstanceGroups >>>>>>> IpForwardingRules IsoPermissions Isos >>>>>>> LBStickinessPolicies >>>>>>>> LoadBalancerRuleInstances LoadBalancerRules = NetworkACLs >>>>>>> NetworkDevice NetworkOfferings Networks >>>>>>> NetworkServiceProviders >>>>>>>> OsCategories OsTypes = PhysicalNetworks Pods >>>>>>> PortForwardingRules PrivateGateways = ProjectAccounts >>>>>>>> ProjectInvitations Projects = PublicIpAddresses >>>>>>> RemoteAccessVpns ResourceLimits Routers >>>>>>> SecurityGroups >>>>>>>> ServiceOfferings SnapshotPolicies Snapshots >>>>>>> SSHKeyPairs StaticRoutes = StorageNetworkIpRange >>>>>>> StoragePools >>>>>>>> SupportedNetworkServices Swifts SystemVms >>>> Tags >>>>>>> TemplatePermissions Templates = TrafficTypeImplementors >>>>>>>> TrafficTypes Users = VirtualMachines >>>>>>> VirtualRouterElements VlanIpRanges Volumes >>>>>>> VPCOfferings >>>>>>>> VPCs VpnConnections = VpnCustomerGateways >>>>>>> VpnGateways VpnUsers Zones >>>>>>>> =F0=9F=99=89 cloudmonkey> list Users >>>>>>>> =E2=80=A6 >>>>>>>> =F0=9F=99=89 cloudmonkey> !ls >>>>>>>> # this give you a shell too and one can do things like >>>>>>>> =F0=9F=99=89 cloudmonkey> !for i in Users Account; do echo = `cloudmonkey >>>>>>>> list $i >>>>>>>> | grep id`; done; >>>>>>>>=20 >>>>>>>> Example commands to deploy a datacenter; (fill in dynamic ids >>>>>>>> etc.) create Zone dns1=3D8.8.8.8 internaldns1=3D10.147.28.6 >>>>>>>> name=3DZone1 networktype=3DBasic create PhysicalNetwork >>>>>>>> name=3Dtest-network >>>>> zoneid=3D >>>>>>> add >>>>>>>> TrafficType traffictype=3DGuest physicalnetworkid=3D add = TrafficType >>>>>>>> traffictype=3DManagement physicalnetworkid=3D update = PhysicalNetwork >>>>>>>> state=3DEnabled id=3D list NetworkServiceProviders = name=3DVirtualRouter >>>>>>>> physicalNetworkId=3D list VirtualRouterElements nspid=3D api >>>>>>>> configureVirtualRouterElement enabled=3Dtrue id=3D update >>>>>>>> NetworkServiceProvider state=3DEnabled id=3D list >>>>>>>> NetworkServiceProviders name=3DSecurityGroupProvider >>>>>>>> physicalNetworkId=3D update NetworkServiceProvider = state=3DEnabled >>>>>>>> id=3D create Network zoneid=3D name=3DguestNetworkForBasicZone >>>>>>>> displaytext=3DguestNetworkForBasicZone >>>>>>>> networkofferingid=3D create Pod zoneid=3D name=3DPod1 >>>>> gateway=3D10.147.28.1 >>>>>>>> netmask=3D255.255.255.0 startip=3D10.147.28.220 = endip=3D10.147.28.235 >>>>>>>> create VlanIpRange podid=3D networkid=3D gateway=3D10.147.28.1 >>>>>>>> netmask=3D255.255.255.0 startip=3D10.147.28.236 = endip=3D10.147.28.250 >>>>>>>> forVirtualNetwork=3Dfalse add Cluster zoneid=3D = hypervisor=3DXenServer >>>>>>>> clustertype=3DCloudManaged podid=3D clustername=3DCluster1 add = Host >>>>>>> zoneid=3D >>>>>>>> podid=3D clusterid=3D hypervisor=3DXenServer = clustertype=3DCloudManaged >>>>>>>> username=3Droot password=3Dpassword url=3Dhttp://10.147.28.60 = create >>>>>>>> StoragePool zoneid=3D clusterid=3D name=3DNFS1 >>>>>>>> url=3Dnfs://10.147.28.7/export/home/rohit/primary >>>>>>>> add SecondaryStorage zoneId=3D >>>>>>>> url=3Dnfs://10.147.28.7/export/home/rohit/secondary >>>>>>>> update Zone allocationstate=3DEnabled id=3D >>>>>>>>=20 >>>>>>>> After some stabilisation, I can put it on pypi so any user can >>>>>>>> just do pip >>>>>>> install cloudmonkey to get the CLI. >>>>>>>>=20 >>>>>>>> Regards. >>>>>>>> PS. Marvin the neglected robot and hipster cloudmonkey should >>>>>>>> rule the world :D >>>>>>>=20 >>>>>>> Rohit, >>>>>>>=20 >>>>>>> This is really really cool. It puts the "fun" in managing >>>>>>> instances from a command line. I've been testing it against a >>>>>>> production CloudStack environment, and it's working pretty well. >>>>>>>=20 >>>>>>> If you don't mind, I might hack at the code a bit to fill in = some >>>>>>> gaps that I'm seeing. First example is that it assumes http, >>>>>>> which doesn't work in a public deployment where the endpoint is = over https. >>>>>>>=20 >>>>>>> -chip >>=20 >=20