2 This example doesn't work - it demonstrates features that don't exist yet.
7 from juju
.model
import Model
13 # connect to current model with current user, per Juju CLI
16 goal_state
= Model
.from_yaml('bundle-like-thing')
17 ubuntu_app
= await model
.deploy(
19 application_name
='ubuntu',
23 ubuntu_app
.on_unit_added(callback
=lambda unit
: True)
27 application_name
='nrpe',
32 await model
.add_relation(
37 result
, ok
= await model
.block_until(
38 lambda: model
.matches(goal_state
),
43 if __name__
== '__main__':
44 logging
.basicConfig(level
=logging
.DEBUG
)
45 ws_logger
= logging
.getLogger('websockets.protocol')
46 ws_logger
.setLevel(logging
.INFO
)