X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=docs%2Fnarrative%2Fapplication.rst;h=1565e5f3301b1c9b1ae1243ab2c6c5aa205edd98;hb=97fe9d7b2f97492be5317bd6f257a411c6687e9b;hp=630ce857e0ab35bde1e3f62afe2563a61125b2fa;hpb=63a8dfb2e67f469614dc4856405f5969d56b57e8;p=osm%2FN2VC.git diff --git a/docs/narrative/application.rst b/docs/narrative/application.rst index 630ce85..1565e5f 100644 --- a/docs/narrative/application.rst +++ b/docs/narrative/application.rst @@ -1,5 +1,6 @@ Applications ============ +For api docs, see :class:`juju.application.Application`. Deploying @@ -31,6 +32,26 @@ To deploy a new application, connect a model and then call its ) +Deploying a Local Charm +----------------------- +To deploy a local charm, pass the charm directory path to +`Model.deploy()`. + +.. code:: python + + from juju.model import Model + + model = Model() + await model.connect_current() + + # Deploy a local charm using a path to the charm directory + await model.deploy( + '/home/tvansteenburgh/src/charms/ubuntu', + application_name='ubuntu', + series='trusty', + ) + + Adding Units ------------ To add units to a deployed application, use the @@ -39,14 +60,14 @@ added units (:class:`~juju.unit.Unit` objects) is returned. .. code:: python - ubuntu_app = await model.deploy( - 'ubuntu', - application_name='ubuntu', - series='trusty', - channel='stable', - ) + ubuntu_app = await model.deploy( + 'ubuntu', + application_name='ubuntu', + series='trusty', + channel='stable', + ) - unit_a, unit_b = await ubuntu_app.add_units(count=2) + unit_a, unit_b = await ubuntu_app.add_units(count=2) Updating Config and Constraints