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
14 from juju
.controller
import Controller
18 controller
= Controller()
19 await controller
.connect_current()
20 model
= await controller
.add_model(
27 application_name
='ubuntu',
31 await model
.disconnect()
32 await controller
.destroy_model(model
.info
.uuid
)
33 await controller
.disconnect()
37 logging
.basicConfig(level
=logging
.DEBUG
)
38 ws_logger
= logging
.getLogger('websockets.protocol')
39 ws_logger
.setLevel(logging
.INFO
)
40 loop
= asyncio
.get_event_loop()
42 loop
.create_task(run())