Deploying a Charm

There are 3 api calls that need to be made in order to have Juju deploy a charm.

  1. You must add the charm url to the Juju controller
  2. You must make the juju controller aware of any resources attached to that charm
  3. Finally you can deploy.
                           params={"url": "cs:~containers/trusty/etcd-3"})

Getting the resources:

In [7]: r = requests.get("")

In [8]: r.json()
{'~containers/trusty/etcd': {'Meta': {'resources': [{'Size': 17408032,
     'Path': 'etcd',
     'Type': 'file',
     'Origin': '',
     'Name': 'etcd',
     'Description': 'Etcd binary release',
     'Revision': 0,
     'Fingerprint': 'y9Qymsubzlxd/WmshtzlQ6EAj0CXSypD3sROSk7BjgVrT4o2MddLBS/GBt+yWSxC'},
    {'Size': 14878944,
     'Path': 'etcdctl',
     'Type': 'file',
     'Origin': '',
     'Name': 'etcdctl',
     'Description': 'Etcdctl binary release',
     'Revision': 0,
     'Fingerprint': 'hleAj63OFxAF9yGNSWTPJ7ED8WGlqiujAuJfGIQOFGqEUDRGfcoNPVChcbSL//5r'}]},
  'Id': 'cs:~containers/trusty/etcd-3'}}
You must set 'Origin' to 'store' manually.


In [35]: juju.CLIENT.resources(request="AddPendingResources", params={"tag":"application-etcd", "url": "cs:~containers/trusty/etcd-3", "resources":resources})
{'PendingIDs': ['3c1d42f8-2cf9-470b-8159-ef3692f870da',