X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=modules%2Flibjuju%2Fexamples%2Fcontroller.py;fp=modules%2Flibjuju%2Fexamples%2Fcontroller.py;h=0000000000000000000000000000000000000000;hp=b61a6f6d19d6a49df8a0c1886c38bf8d22d7b83a;hb=9d18c22a0dc9e295adda50601fc5e2f45d2c9b8a;hpb=19c5cfca317615597be6bf1051e9d2fa903adb97 diff --git a/modules/libjuju/examples/controller.py b/modules/libjuju/examples/controller.py deleted file mode 100644 index b61a6f6..0000000 --- a/modules/libjuju/examples/controller.py +++ /dev/null @@ -1,41 +0,0 @@ -""" -This example: - -1. Connects to current controller. -2. Creates a new model. -3. Deploys an application on the new model. -4. Disconnects from the model -5. Destroys the model - -""" -import logging - -from juju.controller import Controller -from juju import loop - - -async def main(): - controller = Controller() - # connect to current controller with current user, per Juju CLI - await controller.connect() - model = await controller.add_model( - 'my-test-model', - 'aws', - 'aws-tim', - ) - await model.deploy( - 'ubuntu-0', - application_name='ubuntu', - series='trusty', - channel='stable', - ) - await model.disconnect() - await controller.destroy_model(model.info.uuid) - await controller.disconnect() - - -if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG) - ws_logger = logging.getLogger('websockets.protocol') - ws_logger.setLevel(logging.INFO) - loop.run(main())