Command switch

Usage: juju switch [options] [<controller>|<model>|<controller>:|:<model>|<controller>:<model>]

Summary:

Selects or identifies the current controller and model.

Options:

-B, --no-browser-login (= false)

Do not use web browser for authentication

Details:

When used without an argument, the command shows the current controller and its active model. When a single argument without a colon is provided juju first looks for a controller by that name and switches to it, and if it’s not found it tries to switch to a model within current controller. mycontroller: switches to default model in mycontroller, :mymodel switches to mymodel in current controller and mycontroller:mymodel switches to mymodel on mycontroller. The juju models command can be used to determine the active model (of any controller). An asterisk denotes it.

Examples:

   juju switch
    juju switch mymodel
    juju switch mycontroller
    juju switch mycontroller:mymodel
    juju switch mycontroller:

    juju switch :mymodel

See also:

controllers, models, show-controller

I would like to propose a change in behavior of “juju switch”.

Since I often find myself altering between two models for test in one, and waiting for something to happen in the other model.

I would be more efficient if the behavior was to toggle back to the last used model, rather than showing the actual model active. I normally use “juju status” to see which model I’m attached to. So “juju switch” makes not so much sense to get this info.

This would also be efficient when moving between different cloud/controllers as this otherwise forces me to switch a few times before getting it right with names for all controllers, models etc.