API change: juju CLI support for adding/removing multiple service units at once
Marco Ceppi
marco.ceppi at seacrow.org
Wed Nov 16 23:51:01 UTC 2011
On Wed, 2011-11-16 at 15:25 -0800, Clint Byrum wrote:
> Excerpts from Mark Shuttleworth's message of Wed Nov 16 14:31:06 -0800 2011:
> > On 16/11/11 22:26, Clint Byrum wrote:
> > > Excerpts from Gustavo Niemeyer's message of Wed Nov 16 12:49:13 -0800 2011:
> > >>
> > >> Can we please have just the -n option, though? The long form isn't
> > >> necessary in this case IMO.
> > >>
> > > Agreed, if it stands then -n would be a welcome addition.
> > >
> > > Crazy idea..Is there any reason this isn't just an optional positional
> > > argument? With the restrictions on service names and charm names,
> > > we can just say any positive integer given to add-unit or deploy is a
> > > number of units.
> > >
> > > juju add-unit 5 wordpress juju deploy hadoop-slave 20
> > >
> >
> > What about:
> >
> > juju deploy wordpress 5
> > juju add-unit <name of service> n
>
> Oops, fmt ate my original intended formatting
>
> juju add-unit 5 wordpress
> juju deploy hadoop-slave 20
>
> To Gustavo's point, is there a reason to avoid this way?
>
> It seems fudamental to the object of the command. I want 5 more units
> in wordpress, I want to deploy 20 hadoop-slaves.
>
You have two routes to go with this. Since Juju already uses "no flags"
for the majority of high traffic commands (juju <action> [...]) then
having an option like this without flags makes sense, given that charm
naming schemes have restrictions, you could easily do juju <action>
<number> <service> or juju <action> <service> <number> where the numeric
option will be regarded as number of instances where applicable. That's
probably the more "human" readable way (though that's a pretty
subjective opinion on my part).
I do have to voice concern, if you're going to go ahead with a flag,
using a long flag would be preferred. Now that autocomplete is so well
tuned having English instead of one character is far more human
friendly! I frequently find myself using "tabtab" to find available
options for Juju and other software alike. An option that says
--num-units or something even more English-like.
Marco Ceppi
http://ondina.co
More information about the Juju
mailing list