2 This is a very basic example that connects to the currently selected model
3 and prints the number of applications deployed to it.
8 from juju
.model
import Model
10 log
= logging
.getLogger(__name__
)
16 # connect to the current model with the current user, per the Juju CLI
18 print('There are {} applications'.format(len(model
.applications
)))
20 if model
.is_connected():
21 print('Disconnecting from model')
22 await model
.disconnect()
25 if __name__
== '__main__':
26 logging
.basicConfig(level
=logging
.INFO
)