4 1. Connects to current controller.
5 2. Creates a new model.
6 3. Deploys an application on the new model.
7 4. Disconnects from the model
13 from juju
.controller
import Controller
18 controller
= Controller()
19 # connect to current controller with current user, per Juju CLI
20 await controller
.connect()
21 model
= await controller
.add_model(
28 application_name
='ubuntu',
32 await model
.disconnect()
33 await controller
.destroy_model(model
.info
.uuid
)
34 await controller
.disconnect()
37 if __name__
== '__main__':
38 logging
.basicConfig(level
=logging
.DEBUG
)
39 ws_logger
= logging
.getLogger('websockets.protocol')
40 ws_logger
.setLevel(logging
.INFO
)