How to manage controllers

> See also: juju:controller

This document demonstrates various ways in which you can interact with a controller.

Bootstrap a controller

> See also: juju:list-of-supported-clouds

With the python-libjuju client, you can only connect to a pre-existing controller. To bootstrap a controller, see the juju client.

View details about a controller

To view details about a controller in python-libjuju, with a connected controller object (below, controller), you can call the Controller.info() function to retrieve information about the connected controller:

await controller.info()

> See more: Controller.info()

Switch to a different controller

To switch to a different controller with python-libjuju, simply connect to the controller you want to work with, which is done by calling connect on the Controller object (below, controller):

from juju.model import Controller

controller = Controller()
await controller.connect() # will connect to the "current" controller

await controller.connect('mycontroller') # will connect to the controller named "mycontroller"

Note that if the controller object is already connected to a controller, then that connection will be closed before making the new connection.

> See more: Controller.connect(), Connect with Authentication, Connect with explicit endpoints