From: Tim Van Steenburgh Date: Mon, 27 Feb 2017 15:12:52 +0000 (-0500) Subject: Update add_machine example in docs. X-Git-Tag: 0.4.0~20 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=commitdiff_plain;h=546f9ef4d42473d33fcceb04e9ab410c7a4ec7a4 Update add_machine example in docs. Add some missing constants and show how machines are destroyed. --- diff --git a/docs/narrative/model.rst b/docs/narrative/model.rst index 74f7e84..57dbc81 100644 --- a/docs/narrative/model.rst +++ b/docs/narrative/model.rst @@ -142,6 +142,10 @@ can be used to deploy a charm to a specific machine or container. from juju.model import Model + MB = 1 + GB = 1024 + + model = Model() await model.connect_current() @@ -174,6 +178,15 @@ can be used to deploy a charm to a specific machine or container. to=machine3.id ) + # remove application + await application.remove() + + # destroy machines - note that machine3 must be destroyed before machine2 + # since it's a container on machine2 + await machine3.destroy(force=True) + await machine2.destroy(force=True) + await machine1.destroy(force=True) + Reacting to Changes in a Model ------------------------------