<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 11, 2016 at 9:30 AM, Ian Booth <span dir="ltr"><<a href="mailto:ian.booth@canonical.com" target="_blank">ian.booth@canonical.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A few things have been irking me with some aspects of Juju's CLI. Here's a few<br>
thoughts from a user perspective (well, me as user, YMMV).<br>
<br>
The following pain points mainly revolve around commands that operate on a<br>
controller rather than a model.<br>
<br>
eg<br>
<br>
$ juju login [-c controllername] fred<br>
$ juju logout [-c controllername]<br></blockquote><div><br></div><div>I would agree with 'juju login' as it really seems you have to supply the controller, especially since we explicitly disallow logging into the same controller twice. The only case is 'juju logout && juju login'. Or the 'I have to refresh my macaroon' but in that case couldn't we just do "juju login" with no args at all?</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I really think the -c arg is not that natural here.<br>
<br>
$ juju login controllername fred<br>
$ juju logout controllername<br>
<br>
seem a lot more natural and also explicit, because....<br>
I know without args, the "current" controller will be used...<br>
but it's not in your face what that is without running list-controllers first,<br>
and so it's too easy to logout of the wrong controller accidentally. Having<br>
positional args solves that.<br></blockquote><div><br></div><div>I'm fine with an optional positional arg and "juju logout" removes you from the current controller. As it isn't destructive (you can always login again), as long as the command lets you know <i>what</i> you just logged out of, you can undo your mistake. Vs "destroy-controller" which is significantly more permanent when it finishes.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
The same would then apply to other controller commands, like eg add-model<br>
<br>
$ juju add-model mycontroller mymodel<br>
<br>
One thing that might be an issue for people is if they only have one controller,<br>
then<br>
<br>
$ juju logout<br>
or<br>
$ juju add-model<br>
<br>
would just work and requiring a controller name is more typing.<br></blockquote><div><br></div><div>I disagree on 'juju add-model', as I think we have a very good concept of "current context" and adding another model to your current controller is a natural event.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
But 2 points there:<br>
1. as we move forward, people reasonably have more than one controller on the go<br>
at any time, and being explicit about what controller you are wanting to use is<br>
a good thing<br>
2. in the one controller case, we could simply make the controller name optional<br>
so juju logout just works<br>
<br>
We already use a positional arg for destroy-controller - it just seems natural<br>
to do it everywhere for all controller commands.<br></blockquote><div><br></div><div>destroy-controller was always a special case because it is an unrecoverable operation. Almost everything else you can use current context and if it was a mistake you can easily recover.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Anyways, I'd like to see what others think, mine is just the perspective of one<br>
user. I'd be happy to do a snap and put it out there to get feedback.<br>
<br>
--<br>
<br>
Another issue - I would really, really like a "juju whoami" command. We used to<br>
use juju switch-user without args for that, but now it's gone.<br>
<br>
When you are staring at a command prompt and you know you have several<br>
controllers and different logins active, I really want to just go:<br>
<br>
$ juju whoami<br>
Currently active as fred@controller2</blockquote><div><br></div><div>I'd say you'd want what your current user, controller and model is, as that is the current 'context' for commands.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Just to get a quick reminder of what controller I am operating on and who I am<br>
logged in as on the controller. I know we have a way of doing that via list<br>
controllers, but if there's a few, or even if not, you still need to scan your<br>
eyes down a table and look for the one wit the * to see the current one and then<br>
scan across and get see the user etc. It's all a lot harder than just a whoami<br>
command IMO.<br>
<br>
--<br>
<br>
We will need a juju shares command to show who has access to a controller, now<br>
that we have controller permissions login, addmodel, superuser.<br>
<br>
For models, we support:<br>
<br>
$ juju shares -m model<br>
$ juju shares (for the default model)<br>
<br>
What do we want for controller shares?<br>
<br>
$ juju shares-controller ?<br></blockquote><div><br></div><div>It would certainly at least be "controller-shares" (and list-controller-shares) not "shares-controller".</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
which would support positional arg<br>
<br>
$ juju shares-controller mycontroller ?<br></blockquote><div><br></div><div>Again, current context is perfectly ok here. We use current context for all model commands (juju status doesn't require you to specify the model each time). And arguably you're switching controller far less often than you would be switching models.</div><div> </div><div>I wonder if we could roll controller shares just into the same command.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
--<br>
<br>
On the subject of shares, the shares command shows all users with access to a<br>
model (or soon a controller as per above). That's great for admins to see who<br>
they are sharing their stuff with. What I'd like as a user is a command to tell<br>
me what level of access I have to various controllers and models. I'd like this<br>
in list-controllers and list-models.<br>
<br>
$ juju list-controllers<br>
<br>
CONTROLLER MODEL USER CLOUD/REGION ACCESS<br>
fredcontroller* foo fred@local addmodel<br>
ian default admin@local lxd/localhost superuser<br></blockquote><div><br></div><div>FWIW, we're really trying to get rid of the @local syntax, as you're either a local user or a user in the external IDM, but we only support a single external, so we don't have to distinguish between them.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
$ juju list-models<br>
<br>
MODEL OWNER STATUS ACCESS LAST CONNECTION<br>
foo* fred@local available write 5 minutes ago<br>
<br>
The above would make it much easier to see if I could add a model or deploy an<br>
application etc. And I don't get to see who else has access like with juju<br>
shares, just my own access levels. Thoughts?<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>"juju models" and "juju controllers" does indeed seem a good place to list your username and your access level.</div><div><br></div><div>John</div><div>=:-></div><div><br></div></div></div></div>