Merge upstream libjuju
authorAdam Israel <adam.israel@canonical.com>
Wed, 27 Mar 2019 23:07:43 +0000 (19:07 -0400)
committerAdam Israel <adam.israel@canonical.com>
Fri, 5 Apr 2019 14:16:07 +0000 (10:16 -0400)
Merge upstream libjuju (bug fixes)

Change-Id: Ia28b8a0ea2168a4df74823e8493c650491afb695
Signed-off-by: Adam Israel <adam.israel@canonical.com>
41 files changed:
1  2 
modules/libjuju/.gitignore
modules/libjuju/.travis.yml
modules/libjuju/Makefile
modules/libjuju/VERSION
modules/libjuju/docs/changelog.rst
modules/libjuju/juju/application.py
modules/libjuju/juju/client/_client.py
modules/libjuju/juju/client/_client1.py
modules/libjuju/juju/client/_client2.py
modules/libjuju/juju/client/_client3.py
modules/libjuju/juju/client/_client4.py
modules/libjuju/juju/client/_client5.py
modules/libjuju/juju/client/_client7.py
modules/libjuju/juju/client/_client8.py
modules/libjuju/juju/client/_client9.py
modules/libjuju/juju/client/_definitions.py
modules/libjuju/juju/client/connection.py
modules/libjuju/juju/client/facade.py
modules/libjuju/juju/client/schemas-juju-2.5-rc1.json
modules/libjuju/juju/client/schemas-juju-latest.json
modules/libjuju/juju/controller.py
modules/libjuju/juju/juju.py
modules/libjuju/juju/machine.py
modules/libjuju/juju/model.py
modules/libjuju/juju/provisioner.py
modules/libjuju/juju/unit.py
modules/libjuju/juju/user.py
modules/libjuju/juju/utils.py
modules/libjuju/setup.py
modules/libjuju/tests/base.py
modules/libjuju/tests/bundle/mini-bundle.yaml
modules/libjuju/tests/integration/bundle/bundle-resource-rev.yaml
modules/libjuju/tests/integration/cert.pem
modules/libjuju/tests/integration/key.pem
modules/libjuju/tests/integration/test_connection.py
modules/libjuju/tests/integration/test_controller.py
modules/libjuju/tests/integration/test_machine.py
modules/libjuju/tests/integration/test_model.py
modules/libjuju/tests/unit/test_controller.py
modules/libjuju/tests/unit/test_registration_string.py
modules/libjuju/tox.ini

index 7614b47,0000000..6d00fec
mode 100644,000000..100644
--- /dev/null
@@@ -1,14 -1,0 +1,15 @@@
 +*.sw[mnop]
 +.venv/
 +*.pyc
 +*.py~
 +docs/_build/
 +__pycache__/
 +.tox/
 +*.egg-info/
 +.cache/
 +.\#*
 +dist/
 +dev/
 +.pytest_cache
 +pytestdebug.log
++.vscode/
index 4389c8e,0000000..5edfef5
mode 100644,000000..100644
--- /dev/null
@@@ -1,50 -1,0 +1,48 @@@
-     LXD_PASSWORD="password"
 +dist: xenial
 +sudo: required
 +language: python
 +cache: pip
 +before_install:
 +  - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then sudo add-apt-repository -y ppa:jonathonf/python-3.6; fi
 +  - if [[ $TRAVIS_PYTHON_VERSION == '3.7-dev' ]]; then sudo add-apt-repository -y ppa:deadsnakes/ppa; fi
 +  - sudo apt-get update -q
 +  - sudo apt-get remove -qy lxd lxd-client
 +  - sudo apt-get install snapd libsodium-dev -y
 +install:
 +  - sudo snap install lxd || true  # ignore failures so that unit tests will still run, at least
 +  - sudo sh -c 'echo PATH=/snap/bin:$PATH >> /etc/environment';
 +  - sudo snap install jq || true
 +  - sudo snap install juju --classic --$JUJU_CHANNEL || true
 +  - sudo snap install juju-wait --classic || true
 +  - pip install tox-travis
 +env:
 +  global: >
 +    TEST_AGENTS='{"agents":[{"url":"https://api.staging.jujucharms.com/identity","username":"libjuju-ci@yellow"}],"key":{"private":"88OOCxIHQNguRG7zFg2y2Hx5Ob0SeVKKBRnjyehverc=","public":"fDn20+5FGyN2hYO7z0rFUyoHGUnfrleslUNtoYsjNSs="}}'
-   - sudo lxd waitready --timeout 30
-   - sudo lxc storage create default dir
-   - sudo lxd init --auto --trust-password="${LXD_PASSWORD}" --network-address='[::]' --network-port=8443
 +    PATH="/snap/bin:$PATH"
 +
 +matrix:
 +  include:
 +  - python: 3.6
 +    env: JUJU_CHANNEL=edge
 +  - python: 3.6
 +    env: JUJU_CHANNEL=stable
 +  - python: 3.7-dev
 +    env: JUJU_CHANNEL=stable
 +  - python: 3.7-dev
 +    env: JUJU_CHANNEL=edge
 +before_script:
-   # I suspect these could be integrated into the lxd init call
-   - sudo sudo mkdir /var/snap/lxd/common/lxd/storage-pools/juju-zfs
-   - sudo lxc storage create juju-zfs dir source=/var/snap/lxd/common/lxd/storage-pools/juju-zfs # Horrible workaround to LP Bug #1738614
++  # Run lint before performing more expensive operations (fail fast/early)
++  - tox -e lint
 +
-   - sudo addgroup lxd || true
-   - sudo usermod -a -G lxd $USER || true
-   # Trigger generation of the client certificates
-   - sg lxd -c "echo y|lxc remote add "$USER" https://0.0.0.0:8443 --accept-certificate --password='${LXD_PASSWORD}'"
++  # init lxd for tests
++  - sudo lxd waitready --timeout 30
++  - sudo chmod 666 /var/snap/lxd/common/lxd/unix.socket
++  - lxd init --auto --network-address='[::]' --network-port=8443 --storage-backend=dir
 +
-   - sudo -E sudo -u $USER -E juju bootstrap localhost test --config 'identity-url=https://api.staging.jujucharms.com/identity' --config 'allow-model-access=true'
++  # Horrible workaround to LP Bug #1738614
++  - sudo mkdir /var/snap/lxd/common/lxd/storage-pools/juju-zfs
++  - lxc storage create juju-zfs dir source=/var/snap/lxd/common/lxd/storage-pools/juju-zfs
 +
 +script:
++  - juju bootstrap localhost test --config 'identity-url=https://api.staging.jujucharms.com/identity' --config 'allow-model-access=true'
 +  - tox -e py3,integration,serial
index bd59a97,0000000..38dcc11
mode 100644,000000..100644
--- /dev/null
@@@ -1,40 -1,0 +1,46 @@@
- client:
 +BIN := .tox/py3/bin
 +PY := $(BIN)/python
 +PIP := $(BIN)/pip
 +SCHEMAGEN := $(shell which schemagen)
 +VERSION=$(shell cat VERSION)
 +
 +clean:
 +      find . -name __pycache__ -type d -exec rm -r {} +
 +      find . -name *.pyc -delete
 +      rm -rf .tox
 +      rm -rf docs/_build/
 +
 +.tox:
 +      tox -r --notest
 +
-       $(PY) setup.py sdist upload
++client: .tox
 +ifndef SCHEMAGEN
 +      $(error "schemagen is not available, please install from https://github.com/juju/schemagen")
 +endif
 +      $(PY) -m juju.client.facade -s "juju/client/schemas*" -o juju/client/
 +
 +test:
 +      tox
 +
++.PHONY: lint
++lint:
++      tox -e lint --notest
++
 +docs: .tox
 +      $(PIP) install -r docs/requirements.txt
 +      rm -rf docs/_build/
 +      $(BIN)/sphinx-build -b html docs/  docs/_build/
 +      cd docs/_build/ && zip -r docs.zip *
 +
 +release:
 +      git fetch --tags
++      rm dist/*.tar.gz
++      $(PY) setup.py sdist
++      $(BIN)/twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
 +      git tag ${VERSION}
 +      git push --tags
 +
 +upload: release
 +
 +
 +.PHONY: clean client test docs upload release
index 2cc4a7a,0000000..1a96df1
mode 100644,000000..100644
--- /dev/null
@@@ -1,5 -1,0 +1,1 @@@
- <<<<<<< HEAD
- 0.7.3
- =======
- 0.9.1
- >>>>>>> 8a2d5bc35a302a970244b3c307a4f47deac0af63
++0.11.3
index a4a4222,0000000..d5e13ba
mode 100644,000000..100644
--- /dev/null
@@@ -1,247 -1,0 +1,290 @@@
- <<<<<<< HEAD
- =======
 +Changelog
 +---------
 +
- >>>>>>> 8a2d5bc35a302a970244b3c307a4f47deac0af63
++0.11.3
++^^^^^^
++Wednesday March 13 2019
++
++* k8s bundles no longer have application placement (#293)
++* Add retry for connection if all endpoints fail (#288)
++* Support generation of registration string for model sharing. (#279)
++* Add Twine for dist upload on release (#284)
++
++
++0.11.2
++^^^^^^
++Wednesday January 16 2019
++
++* update facade methods for Juju 2.5-rc2 (#281)
++* Add test case for redirect during connect (#275)
++* Implement App.get_resources and pinned resources in bundles (#278)
++
++
++0.11.1
++^^^^^^
++Thursday December 13 2018
++
++* Fix bundles with subordinates for Juju <2.5 (#277)
++
++
++0.11.0
++^^^^^^
++Tuesday December 11 2018
++
++* Updates for new Juju version (#274)
++* Fix wrong variable name in revoke_model function (#271)
++
++
++0.10.2
++^^^^^^
++Tuesday September 18 2018
++
++* set include_stats to false to reduce request time (#266)
++
++
++0.10.1
++^^^^^^
++Monday September 17 2018
++
++* Retry ssh in manual provision test (#265)
++* Clean up lint and add lint coverage to travis config (#263)
++* Increase the timeout for charmstore connections (#262)
++* Fix log level of `Driver connected to juju` message (#258)
++
++
++0.10.0
++^^^^^^
++Thursday August 16 2018
++
++* Fix error due to scp extra opts order (#260)
++* Implement set/get model constraints (#253)
++
++
++>>>>>>> b8a8281b1785358bd5632a119c016f21811172c6
 +0.9.1
 +^^^^^
 +Monday July 16 2018
 +
 +* Update websockets to 6.0 to fix OS X support due to Brew update to Py3.7 (#254)
 +
 +
 +0.9.0
 +^^^^^
 +Friday June 29 2018
 +
 +* python3.7 compatibility updates (#251)
 +* Handle juju not installed in is_bootstrapped for tests (#250)
 +* Add app.reset_config(list). (#249)
 +* Implement model.get_action_status (#248)
 +* Fix `make client` in Python 3.6 (#247)
 +
 +
 +0.8.0
 +^^^^^
 +Thursday June 14 2018
 +
 +* Add support for adding a manual (ssh) machine (#240)
 +* Backwards compatibility fixes (#213)
 +* Implement model.get_action_output (#242)
 +* Fix JSON serialization error for bundle with lxd to unit placement (#243)
 +* Fix reference in docs to connect_current (#239)
 +* Wrap machine agent status workaround in version check (#238)
 +* Convert seconds to nanoseconds for juju.unit.run (#237)
 +* Fix spurious intermittent failure in test_machines.py::test_status (#236)
 +* Define an unused juju-zfs lxd storage pool for Travis (#235)
 +* Add support for Application get_actions (#234)
 +
 +
 +0.7.5
 +^^^^^
 +Friday May 18 2018
 +
 +* Surface errors from bundle plan (#233)
 +* Always send auth-tag even with macaroon auth (#217)
 +* Inline jsonfile credential when sending to controller (#231)
 +
 +0.7.4
 +^^^^^
 +Tuesday Apr 24 2018
 +
 +* Always parse tags and spaces constraints to lists (#228)
 +* Doc index improvements (#211)
 +* Add doc req to force newer pymacaroons to fix RTD builds
 +* Fix dependency conflict for building docs
 +
- <<<<<<< HEAD
- 0.6.1
- ^^^^^
- Fri Sept 29 2017
- * Fix failure when controller supports newer facade version (#145)
- * Fix test failures (#163)
- * Fix SSH key handling when adding a new model (#161)
- * Make Application.upgrade_charm upgrade resources (#158)
- * Expand integration tests to use stable/edge versions of juju (#155)
- * Move docs to ReadTheDocs (https://pythonlibjuju.readthedocs.io/en/latest/)
- =======
- >>>>>>> 8a2d5bc35a302a970244b3c307a4f47deac0af63
 +0.7.3
 +^^^^^
 +Tuesday Feb 20 2018
 +
 +* Full macaroon bakery support (#206)
 +* Fix regression with deploying local charm, add test case (#209)
 +* Expose a machines series (#208)
 +* Automated test runner fixes (#205)
 +
 +0.7.2
 +^^^^^
 +Friday Feb 9 2018
 +
 +* Support deploying bundle YAML file directly (rather than just directory) (#202)
 +
 +0.7.1
 +^^^^^
 +Monday Dec 18 2017
 +
 +* Fix missed renames of model_uuids (#197)
 +
 +0.7.0
 +^^^^^
 +Fri Dec 15 2017
 +
 +* Fix race condition in adding relations (#192)
 +* Fix race condition in connection monitor test (#183)
 +* Fix example in README (#178)
 +* Fix rare hang during Unit.run (#177)
 +* Fix licensing quirks (#176)
 +* Refactor model handling (#171)
 +* Refactor users handling, add get_users (#170)
 +* Upload credential to controller when adding model (#168)
 +* Support 'applications' key in bundles (#165)
 +* Improve handling of thread error handling for loop.run() (#169)
 +* Fix encoding when using to_json() (#166)
 +* Fix intermittent test failures (#167)
 +
 +0.6.1
 +^^^^^
 +Fri Sept 29 2017
 +
 +* Fix failure when controller supports newer facade version (#145)
 +* Fix test failures (#163)
 +* Fix SSH key handling when adding a new model (#161)
 +* Make Application.upgrade_charm upgrade resources (#158)
 +* Expand integration tests to use stable/edge versions of juju (#155)
 +* Move docs to ReadTheDocs (https://pythonlibjuju.readthedocs.io/en/latest/)
 +
 +0.6.0
 +^^^^^
 +Thu June 29 2017
 +
 +* Implement scp functionality (#149)
 +* Add Unit.public_address property (#153)
 +* Adds support for getting/setting config on a model (#152)
 +
 +0.5.3
 +^^^^^
 +Thu June 22 2017
 +
 +* Improve handling of closed connections (#148)
 +* Configurable and larger max message size (#146)
 +
 +0.5.2
 +^^^^^
 +Wed June 14 2017
 +
 +* Fix deploying non-stable channels and explicit revs (#144)
 +
 +0.5.1
 +^^^^^
 +Tue June 13 2017
 +
 +* Update schema for Juju 2.3 alpha1 (#142)
 +* Improve API doc navigation and coverage (#141)
 +* Add type info to Model.add_machine docs (#138)
 +
 +0.5.0
 +^^^^^
 +Thu June 8 2017
 +
 +* Add machine status properties (#133)
 +* Add model context manager (#128)
 +* Implement Application.upgrade_charm method (#132)
 +
 +0.4.3
 +^^^^^
 +Thu June 1 2017
 +
 +* Accept new / unknown API fields gracefully (#131)
 +* Add support for new agent-version field in ModelInfo (#131)
 +* Replace pip with pip3 in install instructions (#129)
 +* Strip local:-prefix from local charm urls (#121)
 +
 +0.4.2
 +^^^^^
 +Wed May 10 2017
 +
 +* Support (and prefer) per-controller macaroon files (#125)
 +
 +0.4.1
 +^^^^^
 +Wed Apr 27 2017
 +
 +* Remove VERSION_MAP and rely on facade list from controller (#118)
 +* Refactor connection task management to avoid cancels (#117)
 +* Refactored login code to better handle redirects (#116)
 +
 +0.4.0
 +^^^^^
 +Wed Apr 19 2017
 +
 +* Feature/api version support (#109)
 +* Expanding controller.py with basic user functions, get_models and
 +  destroy (#89)
 +* Added Monitor class to Connection. (#105)
 +* Support placement lists (#103)
 +* Include resources from store when deploying (#102)
 +* Allow underscore to dash translation when accessing model
 +  attributes (#101)
 +* Added controller to ssh fix. (#100)
 +* Regen schema to pick up missing APIs
 +* Improve error handling
 +* Fix issue where we do not check to make sure that we are receiving the
 +  correct response.
 +* Retry calls to charmstore and increase timeout to 5s
 +* Make connect_model and deploy a bit more friendly
 +* Fix model name not including user
 +* Implement Model.get_status
 +* Add integration tests.
 +
 +0.3.0
 +^^^^^
 +Mon Feb 27 2017
 +
 +* Fix docstrings for placement directives.
 +* Implement Model.add_machine()
 +* Bug fix - "to" parameter to Model.deploy() was broken
 +* Add docs and examples for adding machines and containers and deploying
 +  charms to them.
 +* Make Machine.destroy() block the current coroutine, returning only after
 +  the machine is actually removed from the remote model. This is more
 +  consistent with the way the other apis work (e.g. Model.deploy(),
 +  Application.add_unit(), etc).
 +* Raise NotImplementedError in all unimplemented method stubs instead of
 +  silently passing.
 +
 +0.2.0
 +^^^^^
 +Thu Feb 16 2017
 +
 +* Add default ssh key to newly created model.
 +* Add loop helpers and simplify examples/deploy.py
 +* Add support for deploying local charms, and bundles containing local charm paths.
 +* Add ability to get cloud name for controller.
 +* Bug fix - fix wrong api used in Model.destroy_unit()
 +* Add error detection in bundle deploy.
 +
 +0.1.2
 +^^^^^
 +Thu Dec 22 2016
 +
 +* Bug fix - Include docs in package
 +
 +0.1.1
 +^^^^^
 +Thu Dec 22 2016
 +
 +* Bug fix - Include VERSION file in package
 +
 +0.1.0
 +^^^^^
 +Wed Dec 21 2016
 +
 +* Initial Release
index 84afebe,0000000..3f7f02e
mode 100644,000000..100644
--- /dev/null
@@@ -1,497 -1,0 +1,533 @@@
-     def get_resources(self, details=False):
 +# Copyright 2016 Canonical Ltd.
 +#
 +# Licensed under the Apache License, Version 2.0 (the "License");
 +# you may not use this file except in compliance with the License.
 +# You may obtain a copy of the License at
 +#
 +#     http://www.apache.org/licenses/LICENSE-2.0
 +#
 +#     Unless required by applicable law or agreed to in writing, software
 +#     distributed under the License is distributed on an "AS IS" BASIS,
 +#     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 +#     See the License for the specific language governing permissions and
 +#     limitations under the License.
 +
 +import asyncio
 +import logging
 +
 +from . import model
 +from .client import client
 +from .errors import JujuError
 +from .placement import parse as parse_placement
 +
 +log = logging.getLogger(__name__)
 +
 +
 +class Application(model.ModelEntity):
 +    @property
 +    def _unit_match_pattern(self):
 +        return r'^{}.*$'.format(self.entity_id)
 +
 +    def on_unit_add(self, callable_):
 +        """Add a "unit added" observer to this entity, which will be called
 +        whenever a unit is added to this application.
 +
 +        """
 +        self.model.add_observer(
 +            callable_, 'unit', 'add', self._unit_match_pattern)
 +
 +    def on_unit_remove(self, callable_):
 +        """Add a "unit removed" observer to this entity, which will be called
 +        whenever a unit is removed from this application.
 +
 +        """
 +        self.model.add_observer(
 +            callable_, 'unit', 'remove', self._unit_match_pattern)
 +
 +    @property
 +    def units(self):
 +        return [
 +            unit for unit in self.model.units.values()
 +            if unit.application == self.name
 +        ]
 +
 +    @property
 +    def relations(self):
 +        return [rel for rel in self.model.relations if rel.matches(self.name)]
 +
 +    def related_applications(self, endpoint_name=None):
 +        apps = {}
 +        for rel in self.relations:
 +            if rel.is_peer:
 +                local_ep, remote_ep = rel.endpoints[0]
 +            else:
 +                def is_us(ep):
 +                    return ep.application.name == self.name
 +                local_ep, remote_ep = sorted(rel.endpoints, key=is_us)
 +            if endpoint_name is not None and endpoint_name != local_ep.name:
 +                continue
 +            apps[remote_ep.application.name] = remote_ep.application
 +        return apps
 +
 +    @property
 +    def status(self):
 +        """Get the application status, as set by the charm's leader.
 +
 +        """
 +        return self.safe_data['status']['current']
 +
 +    @property
 +    def status_message(self):
 +        """Get the application status message, as set by the charm's leader.
 +
 +        """
 +        return self.safe_data['status']['message']
 +
 +    @property
 +    def tag(self):
 +        return 'application-%s' % self.name
 +
 +    async def add_relation(self, local_relation, remote_relation):
 +        """Add a relation to another application.
 +
 +        :param str local_relation: Name of relation on this application
 +        :param str remote_relation: Name of relation on the other
 +            application in the form '<application>[:<relation_name>]'
 +
 +        """
 +        if ':' not in local_relation:
 +            local_relation = '{}:{}'.format(self.name, local_relation)
 +
 +        return await self.model.add_relation(local_relation, remote_relation)
 +
 +    async def add_unit(self, count=1, to=None):
 +        """Add one or more units to this application.
 +
 +        :param int count: Number of units to add
 +        :param str to: Placement directive, e.g.::
 +            '23' - machine 23
 +            'lxc:7' - new lxc container on machine 7
 +            '24/lxc/3' - lxc container 3 or machine 24
 +
 +            If None, a new machine is provisioned.
 +
 +        """
 +        app_facade = client.ApplicationFacade.from_connection(self.connection)
 +
 +        log.debug(
 +            'Adding %s unit%s to %s',
 +            count, '' if count == 1 else 's', self.name)
 +
 +        result = await app_facade.AddUnits(
 +            application=self.name,
 +            placement=parse_placement(to) if to else None,
 +            num_units=count,
 +        )
 +
 +        return await asyncio.gather(*[
 +            asyncio.ensure_future(self.model._wait_for_new('unit', unit_id))
 +            for unit_id in result.units
 +        ])
 +
 +    add_units = add_unit
 +
++    async def scale(self, scale=None, scale_change=None):
++        """
++        Set or adjust the scale of this (K8s) application.
++
++        One or the other of scale or scale_change must be provided.
++
++        :param int scale: Scale to which to set this application.
++        :param int scale_change: Amount by which to adjust the scale of this
++            application (can be positive or negative).
++        """
++        app_facade = client.ApplicationFacade.from_connection(self.connection)
++
++        if (scale, scale_change) == (None, None):
++            raise ValueError('Must provide either scale or scale_change')
++
++        log.debug(
++            'Scaling application %s %s %s',
++            self.name, 'to' if scale else 'by', scale or scale_change)
++
++        await app_facade.ScaleApplications([
++            client.ScaleApplicationParam(application_tag=self.tag,
++                                         scale=scale,
++                                         scale_change=scale_change)
++        ])
++
 +    def allocate(self, budget, value):
 +        """Allocate budget to this application.
 +
 +        :param str budget: Name of budget
 +        :param int value: Budget limit
 +
 +        """
 +        raise NotImplementedError()
 +
 +    def attach(self, resource_name, file_path):
 +        """Upload a file as a resource for this application.
 +
 +        :param str resource: Name of the resource
 +        :param str file_path: Path to the file to upload
 +
 +        """
 +        raise NotImplementedError()
 +
 +    def collect_metrics(self):
 +        """Collect metrics on this application.
 +
 +        """
 +        raise NotImplementedError()
 +
 +    async def destroy_relation(self, local_relation, remote_relation):
 +        """Remove a relation to another application.
 +
 +        :param str local_relation: Name of relation on this application
 +        :param str remote_relation: Name of relation on the other
 +            application in the form '<application>[:<relation_name>]'
 +
 +        """
 +        if ':' not in local_relation:
 +            local_relation = '{}:{}'.format(self.name, local_relation)
 +
 +        app_facade = client.ApplicationFacade.from_connection(self.connection)
 +
 +        log.debug(
 +            'Destroying relation %s <-> %s', local_relation, remote_relation)
 +
 +        return await app_facade.DestroyRelation([
 +            local_relation, remote_relation])
 +    remove_relation = destroy_relation
 +
 +    async def destroy_unit(self, *unit_names):
 +        """Destroy units by name.
 +
 +        """
 +        return await self.model.destroy_units(*unit_names)
 +    destroy_units = destroy_unit
 +
 +    async def destroy(self):
 +        """Remove this application from the model.
 +
 +        """
 +        app_facade = client.ApplicationFacade.from_connection(self.connection)
 +
 +        log.debug(
 +            'Destroying %s', self.name)
 +
 +        return await app_facade.Destroy(self.name)
 +    remove = destroy
 +
 +    async def expose(self):
 +        """Make this application publicly available over the network.
 +
 +        """
 +        app_facade = client.ApplicationFacade.from_connection(self.connection)
 +
 +        log.debug(
 +            'Exposing %s', self.name)
 +
 +        return await app_facade.Expose(self.name)
 +
 +    async def get_config(self):
 +        """Return the configuration settings dict for this application.
 +
 +        """
 +        app_facade = client.ApplicationFacade.from_connection(self.connection)
 +
 +        log.debug(
 +            'Getting config for %s', self.name)
 +
 +        return (await app_facade.Get(self.name)).config
 +
 +    async def get_constraints(self):
 +        """Return the machine constraints dict for this application.
 +
 +        """
 +        app_facade = client.ApplicationFacade.from_connection(self.connection)
 +
 +        log.debug(
 +            'Getting constraints for %s', self.name)
 +
 +        result = (await app_facade.Get(self.name)).constraints
 +        return vars(result) if result else result
 +
 +    async def get_actions(self, schema=False):
 +        """Get actions defined for this application.
 +
 +        :param bool schema: Return the full action schema
 +        :return dict: The charms actions, empty dict if none are defined.
 +        """
 +        actions = {}
 +        entity = [{"tag": self.tag}]
 +        action_facade = client.ActionFacade.from_connection(self.connection)
 +        results = (
 +            await action_facade.ApplicationsCharmsActions(entity)).results
 +        for result in results:
 +            if result.application_tag == self.tag and result.actions:
 +                actions = result.actions
 +                break
 +        if not schema:
 +            actions = {k: v['description'] for k, v in actions.items()}
 +        return actions
 +
-         :param bool details: Include detailed info about resources used by each
-             unit
++    async def get_resources(self):
 +        """Return resources for this application.
 +
-         raise NotImplementedError()
++        Returns a dict mapping resource name to
++        :class:`~juju._definitions.CharmResource` instances.
 +        """
-         :param list to_default: A list of config options to be reset to their default value.
++        facade = client.ResourcesFacade.from_connection(self.connection)
++        response = await facade.ListResources([client.Entity(self.tag)])
++
++        resources = dict()
++        for result in response.results:
++            for resource in result.charm_store_resources or []:
++                resources[resource.name] = resource
++            for resource in result.resources or []:
++                if resource.charmresource:
++                    resource = resource.charmresource
++                    resources[resource.name] = resource
++        return resources
 +
 +    async def run(self, command, timeout=None):
 +        """Run command on all units for this application.
 +
 +        :param str command: The command to run
 +        :param int timeout: Time to wait before command is considered failed
 +
 +        """
 +        action = client.ActionFacade.from_connection(self.connection)
 +
 +        log.debug(
 +            'Running `%s` on all units of %s', command, self.name)
 +
 +        # TODO this should return a list of Actions
 +        return await action.Run(
 +            [self.name],
 +            command,
 +            [],
 +            timeout,
 +            [],
 +        )
 +
 +    async def set_annotations(self, annotations):
 +        """Set annotations on this application.
 +
 +        :param annotations map[string]string: the annotations as key/value
 +            pairs.
 +
 +        """
 +        log.debug('Updating annotations on application %s', self.name)
 +
 +        self.ann_facade = client.AnnotationsFacade.from_connection(
 +            self.connection)
 +
 +        ann = client.EntityAnnotations(
 +            entity=self.tag,
 +            annotations=annotations,
 +        )
 +        return await self.ann_facade.Set([ann])
 +
 +    async def set_config(self, config):
 +        """Set configuration options for this application.
 +
 +        :param config: Dict of configuration to set
 +        """
 +        app_facade = client.ApplicationFacade.from_connection(self.connection)
 +
 +        log.debug(
 +            'Setting config for %s: %s', self.name, config)
 +
 +        return await app_facade.Set(self.name, config)
 +
 +    async def reset_config(self, to_default):
 +        """
 +        Restore application config to default values.
 +
++        :param list to_default: A list of config options to be reset to their
++        default value.
 +        """
 +        app_facade = client.ApplicationFacade.from_connection(self.connection)
 +
 +        log.debug(
 +            'Restoring default config for %s: %s', self.name, to_default)
 +
 +        return await app_facade.Unset(self.name, to_default)
 +
 +    async def set_constraints(self, constraints):
 +        """Set machine constraints for this application.
 +
 +        :param dict constraints: Dict of machine constraints
 +
 +        """
 +        app_facade = client.ApplicationFacade.from_connection(self.connection)
 +
 +        log.debug(
 +            'Setting constraints for %s: %s', self.name, constraints)
 +
 +        return await app_facade.SetConstraints(self.name, constraints)
 +
 +    def set_meter_status(self, status, info=None):
 +        """Set the meter status on this status.
 +
 +        :param str status: Meter status, e.g. 'RED', 'AMBER'
 +        :param str info: Extra info message
 +
 +        """
 +        raise NotImplementedError()
 +
 +    def set_plan(self, plan_name):
 +        """Set the plan for this application, effective immediately.
 +
 +        :param str plan_name: Name of plan
 +
 +        """
 +        raise NotImplementedError()
 +
 +    async def unexpose(self):
 +        """Remove public availability over the network for this application.
 +
 +        """
 +        app_facade = client.ApplicationFacade.from_connection(self.connection)
 +
 +        log.debug(
 +            'Unexposing %s', self.name)
 +
 +        return await app_facade.Unexpose(self.name)
 +
 +    def update_allocation(self, allocation):
 +        """Update existing allocation for this application.
 +
 +        :param int allocation: The allocation to set
 +
 +        """
 +        raise NotImplementedError()
 +
 +    async def upgrade_charm(
 +            self, channel=None, force_series=False, force_units=False,
 +            path=None, resources=None, revision=None, switch=None):
 +        """Upgrade the charm for this application.
 +
 +        :param str channel: Channel to use when getting the charm from the
 +            charm store, e.g. 'development'
 +        :param bool force_series: Upgrade even if series of deployed
 +            application is not supported by the new charm
 +        :param bool force_units: Upgrade all units immediately, even if in
 +            error state
 +        :param str path: Uprade to a charm located at path
 +        :param dict resources: Dictionary of resource name/filepath pairs
 +        :param int revision: Explicit upgrade revision
 +        :param str switch: Crossgrade charm url
 +
 +        """
 +        # TODO: Support local upgrades
 +        if path is not None:
 +            raise NotImplementedError("path option is not implemented")
 +        if resources is not None:
 +            raise NotImplementedError("resources option is not implemented")
 +
 +        if switch is not None and revision is not None:
 +            raise ValueError("switch and revision are mutually exclusive")
 +
 +        client_facade = client.ClientFacade.from_connection(self.connection)
 +        resources_facade = client.ResourcesFacade.from_connection(
 +            self.connection)
 +        app_facade = client.ApplicationFacade.from_connection(self.connection)
 +
 +        charmstore = self.model.charmstore
 +        charmstore_entity = None
 +
 +        if switch is not None:
 +            charm_url = switch
 +            if not charm_url.startswith('cs:'):
 +                charm_url = 'cs:' + charm_url
 +        else:
 +            charm_url = self.data['charm-url']
 +            charm_url = charm_url.rpartition('-')[0]
 +            if revision is not None:
 +                charm_url = "%s-%d" % (charm_url, revision)
 +            else:
 +                charmstore_entity = await charmstore.entity(charm_url,
 +                                                            channel=channel)
 +                charm_url = charmstore_entity['Id']
 +
 +        if charm_url == self.data['charm-url']:
 +            raise JujuError('already running charm "%s"' % charm_url)
 +
 +        # Update charm
 +        await client_facade.AddCharm(
 +            url=charm_url,
 +            channel=channel
 +        )
 +
 +        # Update resources
 +        if not charmstore_entity:
 +            charmstore_entity = await charmstore.entity(charm_url,
 +                                                        channel=channel)
 +        store_resources = charmstore_entity['Meta']['resources']
 +
 +        request_data = [client.Entity(self.tag)]
 +        response = await resources_facade.ListResources(request_data)
 +        existing_resources = {
 +            resource.name: resource
 +            for resource in response.results[0].resources
 +        }
 +
 +        resources_to_update = [
 +            resource for resource in store_resources
 +            if resource['Name'] not in existing_resources or
 +            existing_resources[resource['Name']].origin != 'upload'
 +        ]
 +
 +        if resources_to_update:
 +            request_data = [
 +                client.CharmResource(
 +                    description=resource.get('Description'),
 +                    fingerprint=resource['Fingerprint'],
 +                    name=resource['Name'],
 +                    path=resource['Path'],
 +                    revision=resource['Revision'],
 +                    size=resource['Size'],
 +                    type_=resource['Type'],
 +                    origin='store',
 +                ) for resource in resources_to_update
 +            ]
 +            response = await resources_facade.AddPendingResources(
 +                self.tag,
 +                charm_url,
 +                request_data
 +            )
 +            pending_ids = response.pending_ids
 +            resource_ids = {
 +                resource['Name']: id
 +                for resource, id in zip(resources_to_update, pending_ids)
 +            }
 +        else:
 +            resource_ids = None
 +
 +        # Update application
 +        await app_facade.SetCharm(
 +            application=self.entity_id,
 +            channel=channel,
 +            charm_url=charm_url,
 +            config_settings=None,
 +            config_settings_yaml=None,
 +            force_series=force_series,
 +            force_units=force_units,
 +            resource_ids=resource_ids,
 +            storage_constraints=None
 +        )
 +
 +        await self.model.block_until(
 +            lambda: self.data['charm-url'] == charm_url
 +        )
 +
 +    async def get_metrics(self):
 +        """Get metrics for this application's units.
 +
 +        :return: Dictionary of unit_name:metrics
 +
 +        """
 +        return await self.model.get_metrics(self.tag)
index d959a56,0000000..bfa9e6f
mode 100644,000000..100644
--- /dev/null
@@@ -1,368 -1,0 +1,454 @@@
- from juju.client import _client1, _client2, _client3, _client4, _client5
- from juju.client._definitions import *  # noqa
 +# DO NOT CHANGE THIS FILE! This file is auto-generated by facade.py.
 +# Changes will be overwritten/lost when the file is regenerated.
 +
-     "1": _client1,
++from juju.client._definitions import *
++
++from juju.client import _client2, _client1, _client3, _client4, _client5, _client8, _client7, _client9
++
 +
 +CLIENTS = {
-     "5": _client5
 +    "2": _client2,
++    "1": _client1,
 +    "3": _client3,
 +    "4": _client4,
-         """
-         Given a facade name and version, attempt to pull that facade out
-         of the correct client<version>.py file.
-         """
-         for _version in range(int(version), 0, -1):
-             try:
-                 facade = getattr(CLIENTS[str(_version)], name)
-                 return facade
-             except (KeyError, AttributeError):
-                 continue
-         else:
-             raise ImportError("No supported version for facade: "
-                               "{}".format(name))
++    "5": _client5,
++    "8": _client8,
++    "7": _client7,
++    "9": _client9
 +}
 +
 +
 +def lookup_facade(name, version):
-             raise Exception('No facade {} in facades {}'.format(facade_name, connection.facades))
++    """
++    Given a facade name and version, attempt to pull that facade out
++    of the correct client<version>.py file.
++
++    """
++    for _version in range(int(version), 0, -1):
++        try:
++            facade = getattr(CLIENTS[str(_version)], name)
++            return facade
++        except (KeyError, AttributeError):
++            continue
++    else:
++        raise ImportError("No supported version for facade: "
++                          "{}".format(name))
 +
 +
 +class TypeFactory:
 +    @classmethod
 +    def from_connection(cls, connection):
 +        """
 +        Given a connected Connection object, return an initialized and
 +        connected instance of an API Interface matching the name of
 +        this class.
 +
 +        @param connection: initialized Connection object.
 +
 +        """
 +        facade_name = cls.__name__
 +        if not facade_name.endswith('Facade'):
 +           raise TypeError('Unexpected class name: {}'.format(facade_name))
 +        facade_name = facade_name[:-len('Facade')]
 +        version = connection.facades.get(facade_name)
 +        if version is None:
++            raise Exception('No facade {} in facades {}'.format(facade_name,
++                                                                connection.facades))
 +
 +        c = lookup_facade(cls.__name__, version)
 +        c = c()
 +        c.connect(connection)
 +
 +        return c
 +
 +
 +class ActionFacade(TypeFactory):
 +    pass
 +
 +
++class ActionPrunerFacade(TypeFactory):
++    pass
++
++
 +class AgentFacade(TypeFactory):
 +    pass
 +
 +
 +class AgentToolsFacade(TypeFactory):
 +    pass
 +
 +
 +class AllModelWatcherFacade(TypeFactory):
 +    pass
 +
 +
 +class AllWatcherFacade(TypeFactory):
 +    pass
 +
 +
 +class AnnotationsFacade(TypeFactory):
 +    pass
 +
 +
 +class ApplicationFacade(TypeFactory):
 +    pass
 +
 +
++class ApplicationOffersFacade(TypeFactory):
++    pass
++
++
 +class ApplicationRelationsWatcherFacade(TypeFactory):
 +    pass
 +
 +
 +class ApplicationScalerFacade(TypeFactory):
 +    pass
 +
 +
 +class BackupsFacade(TypeFactory):
 +    pass
 +
 +
 +class BlockFacade(TypeFactory):
 +    pass
 +
 +
 +class BundleFacade(TypeFactory):
 +    pass
 +
 +
++class CAASAgentFacade(TypeFactory):
++    pass
++
++
++class CAASFirewallerFacade(TypeFactory):
++    pass
++
++
++class CAASOperatorFacade(TypeFactory):
++    pass
++
++
++class CAASOperatorProvisionerFacade(TypeFactory):
++    pass
++
++
++class CAASUnitProvisionerFacade(TypeFactory):
++    pass
++
++
 +class CharmRevisionUpdaterFacade(TypeFactory):
 +    pass
 +
 +
 +class CharmsFacade(TypeFactory):
 +    pass
 +
 +
 +class CleanerFacade(TypeFactory):
 +    pass
 +
 +
 +class ClientFacade(TypeFactory):
 +    pass
 +
 +
 +class CloudFacade(TypeFactory):
 +    pass
 +
 +
 +class ControllerFacade(TypeFactory):
 +    pass
 +
 +
++class CredentialManagerFacade(TypeFactory):
++    pass
++
++
++class CredentialValidatorFacade(TypeFactory):
++    pass
++
++
++class CrossControllerFacade(TypeFactory):
++    pass
++
++
++class CrossModelRelationsFacade(TypeFactory):
++    pass
++
++
 +class DeployerFacade(TypeFactory):
 +    pass
 +
 +
 +class DiscoverSpacesFacade(TypeFactory):
 +    pass
 +
 +
 +class DiskManagerFacade(TypeFactory):
 +    pass
 +
 +
 +class EntityWatcherFacade(TypeFactory):
 +    pass
 +
 +
++class ExternalControllerUpdaterFacade(TypeFactory):
++    pass
++
++
++class FanConfigurerFacade(TypeFactory):
++    pass
++
++
 +class FilesystemAttachmentsWatcherFacade(TypeFactory):
 +    pass
 +
 +
++class FirewallRulesFacade(TypeFactory):
++    pass
++
++
 +class FirewallerFacade(TypeFactory):
 +    pass
 +
 +
 +class HighAvailabilityFacade(TypeFactory):
 +    pass
 +
 +
 +class HostKeyReporterFacade(TypeFactory):
 +    pass
 +
 +
 +class ImageManagerFacade(TypeFactory):
 +    pass
 +
 +
 +class ImageMetadataFacade(TypeFactory):
 +    pass
 +
 +
 +class InstancePollerFacade(TypeFactory):
 +    pass
 +
 +
 +class KeyManagerFacade(TypeFactory):
 +    pass
 +
 +
 +class KeyUpdaterFacade(TypeFactory):
 +    pass
 +
 +
 +class LeadershipServiceFacade(TypeFactory):
 +    pass
 +
 +
 +class LifeFlagFacade(TypeFactory):
 +    pass
 +
 +
 +class LogForwardingFacade(TypeFactory):
 +    pass
 +
 +
 +class LoggerFacade(TypeFactory):
 +    pass
 +
 +
 +class MachineActionsFacade(TypeFactory):
 +    pass
 +
 +
 +class MachineManagerFacade(TypeFactory):
 +    pass
 +
 +
 +class MachineUndertakerFacade(TypeFactory):
 +    pass
 +
 +
 +class MachinerFacade(TypeFactory):
 +    pass
 +
 +
 +class MeterStatusFacade(TypeFactory):
 +    pass
 +
 +
 +class MetricsAdderFacade(TypeFactory):
 +    pass
 +
 +
 +class MetricsDebugFacade(TypeFactory):
 +    pass
 +
 +
 +class MetricsManagerFacade(TypeFactory):
 +    pass
 +
 +
 +class MigrationFlagFacade(TypeFactory):
 +    pass
 +
 +
 +class MigrationMasterFacade(TypeFactory):
 +    pass
 +
 +
 +class MigrationMinionFacade(TypeFactory):
 +    pass
 +
 +
 +class MigrationStatusWatcherFacade(TypeFactory):
 +    pass
 +
 +
 +class MigrationTargetFacade(TypeFactory):
 +    pass
 +
 +
 +class ModelConfigFacade(TypeFactory):
 +    pass
 +
 +
 +class ModelManagerFacade(TypeFactory):
 +    pass
 +
 +
++class ModelUpgraderFacade(TypeFactory):
++    pass
++
++
 +class NotifyWatcherFacade(TypeFactory):
 +    pass
 +
 +
++class OfferStatusWatcherFacade(TypeFactory):
++    pass
++
++
 +class PayloadsFacade(TypeFactory):
 +    pass
 +
 +
 +class PayloadsHookContextFacade(TypeFactory):
 +    pass
 +
 +
 +class PingerFacade(TypeFactory):
 +    pass
 +
 +
 +class ProvisionerFacade(TypeFactory):
 +    pass
 +
 +
 +class ProxyUpdaterFacade(TypeFactory):
 +    pass
 +
 +
 +class RebootFacade(TypeFactory):
 +    pass
 +
 +
++class RelationStatusWatcherFacade(TypeFactory):
++    pass
++
++
 +class RelationUnitsWatcherFacade(TypeFactory):
 +    pass
 +
 +
 +class RemoteApplicationWatcherFacade(TypeFactory):
 +    pass
 +
 +
++class RemoteRelationsFacade(TypeFactory):
++    pass
++
++
 +class RemoteRelationsWatcherFacade(TypeFactory):
 +    pass
 +
 +
 +class ResourcesFacade(TypeFactory):
 +    pass
 +
 +
 +class ResourcesHookContextFacade(TypeFactory):
 +    pass
 +
 +
 +class ResumerFacade(TypeFactory):
 +    pass
 +
 +
 +class RetryStrategyFacade(TypeFactory):
 +    pass
 +
 +
 +class SSHClientFacade(TypeFactory):
 +    pass
 +
 +
 +class SingularFacade(TypeFactory):
 +    pass
 +
 +
 +class SpacesFacade(TypeFactory):
 +    pass
 +
 +
 +class StatusHistoryFacade(TypeFactory):
 +    pass
 +
 +
 +class StorageFacade(TypeFactory):
 +    pass
 +
 +
 +class StorageProvisionerFacade(TypeFactory):
 +    pass
 +
 +
 +class StringsWatcherFacade(TypeFactory):
 +    pass
 +
 +
 +class SubnetsFacade(TypeFactory):
 +    pass
 +
 +
 +class UndertakerFacade(TypeFactory):
 +    pass
 +
 +
 +class UnitAssignerFacade(TypeFactory):
 +    pass
 +
 +
 +class UniterFacade(TypeFactory):
 +    pass
 +
 +
++class UpgradeSeriesFacade(TypeFactory):
++    pass
++
++
 +class UpgraderFacade(TypeFactory):
 +    pass
 +
 +
 +class UserManagerFacade(TypeFactory):
 +    pass
 +
 +
++class VolumeAttachmentPlansWatcherFacade(TypeFactory):
++    pass
++
++
 +class VolumeAttachmentsWatcherFacade(TypeFactory):
 +    pass
index e161973,0000000..83437bc
mode 100644,000000..100644
--- /dev/null
@@@ -1,6643 -1,0 +1,11068 @@@
-     
 +# DO NOT CHANGE THIS FILE! This file is auto-generated by facade.py.
 +# Changes will be overwritten/lost when the file is regenerated.
 +
 +from juju.client._definitions import *
 +from juju.client.facade import ReturnMapping, Type
 +
 +
++class ActionPrunerFacade(Type):
++    name = 'ActionPruner'
++    version = 1
++    schema =     {'definitions': {'ActionPruneArgs': {'additionalProperties': False,
++                                         'properties': {'max-history-mb': {'type': 'integer'},
++                                                        'max-history-time': {'type': 'integer'}},
++                                         'required': ['max-history-time',
++                                                      'max-history-mb'],
++                                         'type': 'object'},
++                     'Error': {'additionalProperties': False,
++                               'properties': {'code': {'type': 'string'},
++                                              'info': {'$ref': '#/definitions/ErrorInfo'},
++                                              'message': {'type': 'string'}},
++                               'required': ['message', 'code'],
++                               'type': 'object'},
++                     'ErrorInfo': {'additionalProperties': False,
++                                   'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
++                                                  'macaroon-path': {'type': 'string'}},
++                                   'type': 'object'},
++                     'Macaroon': {'additionalProperties': False, 'type': 'object'},
++                     'ModelConfigResult': {'additionalProperties': False,
++                                           'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True,
++                                                                                                  'type': 'object'}},
++                                                                     'type': 'object'}},
++                                           'required': ['config'],
++                                           'type': 'object'},
++                     'NotifyWatchResult': {'additionalProperties': False,
++                                           'properties': {'NotifyWatcherId': {'type': 'string'},
++                                                          'error': {'$ref': '#/definitions/Error'}},
++                                           'required': ['NotifyWatcherId'],
++                                           'type': 'object'}},
++     'properties': {'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}},
++                                    'type': 'object'},
++                    'Prune': {'properties': {'Params': {'$ref': '#/definitions/ActionPruneArgs'}},
++                              'type': 'object'},
++                    'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}},
++                                                   'type': 'object'}},
++     'type': 'object'}
++
++
++    @ReturnMapping(ModelConfigResult)
++    async def ModelConfig(self):
++        '''
++
++        Returns -> typing.Mapping[str, typing.Any]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='ActionPruner',
++                   request='ModelConfig',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(None)
++    async def Prune(self, max_history_mb, max_history_time):
++        '''
++        max_history_mb : int
++        max_history_time : int
++        Returns -> None
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='ActionPruner',
++                   request='Prune',
++                   version=1,
++                   params=_params)
++        _params['max-history-mb'] = max_history_mb
++        _params['max-history-time'] = max_history_time
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(NotifyWatchResult)
++    async def WatchForModelConfigChanges(self):
++        '''
++
++        Returns -> typing.Union[str, _ForwardRef('Error')]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='ActionPruner',
++                   request='WatchForModelConfigChanges',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
 +class AgentToolsFacade(Type):
 +    name = 'AgentTools'
 +    version = 1
 +    schema =     {'properties': {'UpdateToolsAvailable': {'type': 'object'}}, 'type': 'object'}
-         msg = dict(type='AgentTools', request='UpdateToolsAvailable', version=1, params=_params)
++
 +
 +    @ReturnMapping(None)
 +    async def UpdateToolsAvailable(self):
 +        '''
 +
 +        Returns -> None
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-     
++        msg = dict(type='AgentTools',
++                   request='UpdateToolsAvailable',
++                   version=1,
++                   params=_params)
 +
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +class AllWatcherFacade(Type):
 +    name = 'AllWatcher'
 +    version = 1
 +    schema =     {'definitions': {'AllWatcherNextResults': {'additionalProperties': False,
 +                                               'properties': {'deltas': {'items': {'$ref': '#/definitions/Delta'},
 +                                                                         'type': 'array'}},
 +                                               'required': ['deltas'],
 +                                               'type': 'object'},
 +                     'Delta': {'additionalProperties': False,
 +                               'properties': {'entity': {'additionalProperties': True,
 +                                                         'type': 'object'},
 +                                              'removed': {'type': 'boolean'}},
 +                               'required': ['removed', 'entity'],
 +                               'type': 'object'}},
 +     'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/AllWatcherNextResults'}},
 +                             'type': 'object'},
 +                    'Stop': {'type': 'object'}},
 +     'type': 'object'}
-         Returns -> typing.Sequence<+T_co>[~Delta]<~Delta>
++
 +
 +    @ReturnMapping(AllWatcherNextResults)
 +    async def Next(self):
 +        '''
 +
-         msg = dict(type='AllWatcher', request='Next', version=1, params=_params)
++        Returns -> typing.Sequence[~Delta]
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-         msg = dict(type='AllWatcher', request='Stop', version=1, params=_params)
++        msg = dict(type='AllWatcher',
++                   request='Next',
++                   version=1,
++                   params=_params)
 +
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +    @ReturnMapping(None)
 +    async def Stop(self):
 +        '''
 +
 +        Returns -> None
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-     
++        msg = dict(type='AllWatcher',
++                   request='Stop',
++                   version=1,
++                   params=_params)
 +
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +class ApplicationRelationsWatcherFacade(Type):
 +    name = 'ApplicationRelationsWatcher'
 +    version = 1
 +    schema =     {'definitions': {'ApplicationRelationsChange': {'additionalProperties': False,
 +                                                    'properties': {'changed': {'items': {'$ref': '#/definitions/RelationChange'},
 +                                                                               'type': 'array'},
 +                                                                   'removed': {'items': {'type': 'integer'},
 +                                                                               'type': 'array'}},
 +                                                    'type': 'object'},
 +                     'ApplicationRelationsWatchResult': {'additionalProperties': False,
 +                                                         'properties': {'ApplicationRelationsWatcherId': {'type': 'string'},
 +                                                                        'changes': {'$ref': '#/definitions/ApplicationRelationsChange'},
 +                                                                        'error': {'$ref': '#/definitions/Error'}},
 +                                                         'required': ['ApplicationRelationsWatcherId'],
 +                                                         'type': 'object'},
 +                     'Error': {'additionalProperties': False,
 +                               'properties': {'code': {'type': 'string'},
 +                                              'info': {'$ref': '#/definitions/ErrorInfo'},
 +                                              'message': {'type': 'string'}},
 +                               'required': ['message', 'code'],
 +                               'type': 'object'},
 +                     'ErrorInfo': {'additionalProperties': False,
 +                                   'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
 +                                                  'macaroon-path': {'type': 'string'}},
 +                                   'type': 'object'},
 +                     'Macaroon': {'additionalProperties': False, 'type': 'object'},
 +                     'RelationChange': {'additionalProperties': False,
 +                                        'properties': {'changedunits': {'patternProperties': {'.*': {'$ref': '#/definitions/RelationUnitChange'}},
 +                                                                        'type': 'object'},
 +                                                       'departedunits': {'items': {'type': 'string'},
 +                                                                         'type': 'array'},
 +                                                       'id': {'type': 'integer'},
 +                                                       'life': {'type': 'string'}},
 +                                        'required': ['id', 'life'],
 +                                        'type': 'object'},
 +                     'RelationUnitChange': {'additionalProperties': False,
 +                                            'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True,
 +                                                                                                     'type': 'object'}},
 +                                                                        'type': 'object'}},
 +                                            'type': 'object'}},
 +     'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/ApplicationRelationsWatchResult'}},
 +                             'type': 'object'},
 +                    'Stop': {'type': 'object'}},
 +     'type': 'object'}
-         msg = dict(type='ApplicationRelationsWatcher', request='Next', version=1, params=_params)
++
 +
 +    @ReturnMapping(ApplicationRelationsWatchResult)
 +    async def Next(self):
 +        '''
 +
 +        Returns -> typing.Union[str, _ForwardRef('ApplicationRelationsChange'), _ForwardRef('Error')]
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-         msg = dict(type='ApplicationRelationsWatcher', request='Stop', version=1, params=_params)
++        msg = dict(type='ApplicationRelationsWatcher',
++                   request='Next',
++                   version=1,
++                   params=_params)
 +
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +    @ReturnMapping(None)
 +    async def Stop(self):
 +        '''
 +
 +        Returns -> None
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-     
++        msg = dict(type='ApplicationRelationsWatcher',
++                   request='Stop',
++                   version=1,
++                   params=_params)
 +
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +class ApplicationScalerFacade(Type):
 +    name = 'ApplicationScaler'
 +    version = 1
 +    schema =     {'definitions': {'Entities': {'additionalProperties': False,
 +                                  'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
 +                                                              'type': 'array'}},
 +                                  'required': ['entities'],
 +                                  'type': 'object'},
 +                     'Entity': {'additionalProperties': False,
 +                                'properties': {'tag': {'type': 'string'}},
 +                                'required': ['tag'],
 +                                'type': 'object'},
 +                     'Error': {'additionalProperties': False,
 +                               'properties': {'code': {'type': 'string'},
 +                                              'info': {'$ref': '#/definitions/ErrorInfo'},
 +                                              'message': {'type': 'string'}},
 +                               'required': ['message', 'code'],
 +                               'type': 'object'},
 +                     'ErrorInfo': {'additionalProperties': False,
 +                                   'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
 +                                                  'macaroon-path': {'type': 'string'}},
 +                                   'type': 'object'},
 +                     'ErrorResult': {'additionalProperties': False,
 +                                     'properties': {'error': {'$ref': '#/definitions/Error'}},
 +                                     'type': 'object'},
 +                     'ErrorResults': {'additionalProperties': False,
 +                                      'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
 +                                                                 'type': 'array'}},
 +                                      'required': ['results'],
 +                                      'type': 'object'},
 +                     'Macaroon': {'additionalProperties': False, 'type': 'object'},
 +                     'StringsWatchResult': {'additionalProperties': False,
 +                                            'properties': {'changes': {'items': {'type': 'string'},
 +                                                                       'type': 'array'},
 +                                                           'error': {'$ref': '#/definitions/Error'},
 +                                                           'watcher-id': {'type': 'string'}},
 +                                            'required': ['watcher-id'],
 +                                            'type': 'object'}},
 +     'properties': {'Rescale': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
 +                                               'Result': {'$ref': '#/definitions/ErrorResults'}},
 +                                'type': 'object'},
 +                    'Watch': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}},
 +                              'type': 'object'}},
 +     'type': 'object'}
-         entities : typing.Sequence<+T_co>[~Entity]<~Entity>
-         Returns -> typing.Sequence<+T_co>[~ErrorResult]<~ErrorResult>
++
 +
 +    @ReturnMapping(ErrorResults)
 +    async def Rescale(self, entities):
 +        '''
-         msg = dict(type='ApplicationScaler', request='Rescale', version=1, params=_params)
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~ErrorResult]
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-         Returns -> typing.Union[typing.Sequence<+T_co>[str], _ForwardRef('Error')]
++        msg = dict(type='ApplicationScaler',
++                   request='Rescale',
++                   version=1,
++                   params=_params)
 +        _params['entities'] = entities
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +    @ReturnMapping(StringsWatchResult)
 +    async def Watch(self):
 +        '''
 +
-         msg = dict(type='ApplicationScaler', request='Watch', version=1, params=_params)
++        Returns -> typing.Union[typing.Sequence[str], _ForwardRef('Error'), str]
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-     
++        msg = dict(type='ApplicationScaler',
++                   request='Watch',
++                   version=1,
++                   params=_params)
 +
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +class BackupsFacade(Type):
 +    name = 'Backups'
 +    version = 1
 +    schema =     {'definitions': {'BackupsCreateArgs': {'additionalProperties': False,
 +                                           'properties': {'notes': {'type': 'string'}},
 +                                           'required': ['notes'],
 +                                           'type': 'object'},
 +                     'BackupsInfoArgs': {'additionalProperties': False,
 +                                         'properties': {'id': {'type': 'string'}},
 +                                         'required': ['id'],
 +                                         'type': 'object'},
 +                     'BackupsListArgs': {'additionalProperties': False,
 +                                         'type': 'object'},
 +                     'BackupsListResult': {'additionalProperties': False,
 +                                           'properties': {'list': {'items': {'$ref': '#/definitions/BackupsMetadataResult'},
 +                                                                   'type': 'array'}},
 +                                           'required': ['list'],
 +                                           'type': 'object'},
 +                     'BackupsMetadataResult': {'additionalProperties': False,
 +                                               'properties': {'ca-cert': {'type': 'string'},
 +                                                              'ca-private-key': {'type': 'string'},
 +                                                              'checksum': {'type': 'string'},
 +                                                              'checksum-format': {'type': 'string'},
 +                                                              'finished': {'format': 'date-time',
 +                                                                           'type': 'string'},
 +                                                              'hostname': {'type': 'string'},
 +                                                              'id': {'type': 'string'},
 +                                                              'machine': {'type': 'string'},
 +                                                              'model': {'type': 'string'},
 +                                                              'notes': {'type': 'string'},
 +                                                              'series': {'type': 'string'},
 +                                                              'size': {'type': 'integer'},
 +                                                              'started': {'format': 'date-time',
 +                                                                          'type': 'string'},
 +                                                              'stored': {'format': 'date-time',
 +                                                                         'type': 'string'},
 +                                                              'version': {'$ref': '#/definitions/Number'}},
 +                                               'required': ['id',
 +                                                            'checksum',
 +                                                            'checksum-format',
 +                                                            'size',
 +                                                            'stored',
 +                                                            'started',
 +                                                            'finished',
 +                                                            'notes',
 +                                                            'model',
 +                                                            'machine',
 +                                                            'hostname',
 +                                                            'version',
 +                                                            'series',
 +                                                            'ca-cert',
 +                                                            'ca-private-key'],
 +                                               'type': 'object'},
 +                     'BackupsRemoveArgs': {'additionalProperties': False,
 +                                           'properties': {'id': {'type': 'string'}},
 +                                           'required': ['id'],
 +                                           'type': 'object'},
 +                     'Number': {'additionalProperties': False,
 +                                'properties': {'Build': {'type': 'integer'},
 +                                               'Major': {'type': 'integer'},
 +                                               'Minor': {'type': 'integer'},
 +                                               'Patch': {'type': 'integer'},
 +                                               'Tag': {'type': 'string'}},
 +                                'required': ['Major',
 +                                             'Minor',
 +                                             'Tag',
 +                                             'Patch',
 +                                             'Build'],
 +                                'type': 'object'},
 +                     'RestoreArgs': {'additionalProperties': False,
 +                                     'properties': {'backup-id': {'type': 'string'}},
 +                                     'required': ['backup-id'],
 +                                     'type': 'object'}},
 +     'properties': {'Create': {'properties': {'Params': {'$ref': '#/definitions/BackupsCreateArgs'},
 +                                              'Result': {'$ref': '#/definitions/BackupsMetadataResult'}},
 +                               'type': 'object'},
 +                    'FinishRestore': {'type': 'object'},
 +                    'Info': {'properties': {'Params': {'$ref': '#/definitions/BackupsInfoArgs'},
 +                                            'Result': {'$ref': '#/definitions/BackupsMetadataResult'}},
 +                             'type': 'object'},
 +                    'List': {'properties': {'Params': {'$ref': '#/definitions/BackupsListArgs'},
 +                                            'Result': {'$ref': '#/definitions/BackupsListResult'}},
 +                             'type': 'object'},
 +                    'PrepareRestore': {'type': 'object'},
 +                    'Remove': {'properties': {'Params': {'$ref': '#/definitions/BackupsRemoveArgs'}},
 +                               'type': 'object'},
 +                    'Restore': {'properties': {'Params': {'$ref': '#/definitions/RestoreArgs'}},
 +                                'type': 'object'}},
 +     'type': 'object'}
-         msg = dict(type='Backups', request='Create', version=1, params=_params)
++
 +
 +    @ReturnMapping(BackupsMetadataResult)
 +    async def Create(self, notes):
 +        '''
 +        notes : str
 +        Returns -> typing.Union[str, int, _ForwardRef('Number')]
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-         msg = dict(type='Backups', request='FinishRestore', version=1, params=_params)
++        msg = dict(type='Backups',
++                   request='Create',
++                   version=1,
++                   params=_params)
 +        _params['notes'] = notes
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +    @ReturnMapping(None)
 +    async def FinishRestore(self):
 +        '''
 +
 +        Returns -> None
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-         msg = dict(type='Backups', request='Info', version=1, params=_params)
++        msg = dict(type='Backups',
++                   request='FinishRestore',
++                   version=1,
++                   params=_params)
 +
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +    @ReturnMapping(BackupsMetadataResult)
 +    async def Info(self, id_):
 +        '''
 +        id_ : str
 +        Returns -> typing.Union[str, int, _ForwardRef('Number')]
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-         Returns -> typing.Sequence<+T_co>[~BackupsMetadataResult]<~BackupsMetadataResult>
++        msg = dict(type='Backups',
++                   request='Info',
++                   version=1,
++                   params=_params)
 +        _params['id'] = id_
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +    @ReturnMapping(BackupsListResult)
 +    async def List(self):
 +        '''
 +
-         msg = dict(type='Backups', request='List', version=1, params=_params)
++        Returns -> typing.Sequence[~BackupsMetadataResult]
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-         msg = dict(type='Backups', request='PrepareRestore', version=1, params=_params)
++        msg = dict(type='Backups',
++                   request='List',
++                   version=1,
++                   params=_params)
 +
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +    @ReturnMapping(None)
 +    async def PrepareRestore(self):
 +        '''
 +
 +        Returns -> None
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-         msg = dict(type='Backups', request='Remove', version=1, params=_params)
++        msg = dict(type='Backups',
++                   request='PrepareRestore',
++                   version=1,
++                   params=_params)
 +
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +    @ReturnMapping(None)
 +    async def Remove(self, id_):
 +        '''
 +        id_ : str
 +        Returns -> None
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-         msg = dict(type='Backups', request='Restore', version=1, params=_params)
++        msg = dict(type='Backups',
++                   request='Remove',
++                   version=1,
++                   params=_params)
 +        _params['id'] = id_
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +    @ReturnMapping(None)
 +    async def Restore(self, backup_id):
 +        '''
 +        backup_id : str
 +        Returns -> None
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
-     
++        msg = dict(type='Backups',
++                   request='Restore',
++                   version=1,
++                   params=_params)
 +        _params['backup-id'] = backup_id
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
 +class BundleFacade(Type):
 +    name = 'Bundle'
 +    version = 1
 +    schema =     {'definitions': {'BundleChange': {'additionalProperties': False,
 +                                      'properties': {'args': {'items': {'additionalProperties': True,
 +                                                                        'type': 'object'},
 +                                                              'type': 'array'},
 +                                                     'id': {'type': 'string'},
 +                                                     'method': {'type': 'string'},
 +                                                     'requires': {'items': {'type': 'string'},
 +                                                                  'type': 'array'}},
 +                                      'required': ['id',
 +                                                   'method',
 +                                                   'args',
 +                                                   'requires'],
 +                                      'type': 'object'},
 +                     'BundleChangesParams': {'additionalProperties': False,
 +                                             'properties': {'yaml': {'type': 'string'}},
 +                                             'required': ['yaml'],
 +                                             'type': 'object'},
 +                     'BundleChangesResults': {'additionalProperties': False,
 +                                              'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'},
 +                                                                         'type': 'array'},
 +                                                             'errors': {'items': {'type': 'string'},
 +                                                                        'type': 'array'}},
 +                                              'type': 'object'}},
 +     'properties': {'GetChanges': {'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'},
 +                                                  'Result': {'$ref': '#/definitions/BundleChangesResults'}},
 +                                   'type': 'object'}},
 +     'type': 'object'}
-         Returns -> typing.Sequence<+T_co>[~BundleChange]<~BundleChange>
++
 +
 +    @ReturnMapping(BundleChangesResults)
 +    async def GetChanges(self, yaml):
 +        '''
 +        yaml : str
-         msg = dict(type='Bundle', request='GetChanges', version=1, params=_params)
++        Returns -> typing.Union[typing.Sequence[~BundleChange], typing.Sequence[str]]
 +        '''
 +        # map input types to rpc msg
 +        _params = dict()
- class ClientFacade(Type):
-     name = 'Client'
++        msg = dict(type='Bundle',
++                   request='GetChanges',
++                   version=1,
++                   params=_params)
 +        _params['yaml'] = yaml
 +        reply = await self.rpc(msg)
 +        return reply
 +
 +
 +
-     schema =     {'definitions': {'APIHostPortsResult': {'additionalProperties': False,
-                                             'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'},
-                                                                                  'type': 'array'},
-                                                                        'type': 'array'}},
-                                             'required': ['servers'],
-                                             'type': 'object'},
-                      'AddCharm': {'additionalProperties': False,
-                                   'properties': {'channel': {'type': 'string'},
-                                                  'url': {'type': 'string'}},
-                                   'required': ['url', 'channel'],
-                                   'type': 'object'},
-                      'AddCharmWithAuthorization': {'additionalProperties': False,
-                                                    'properties': {'channel': {'type': 'string'},
-                                                                   'macaroon': {'$ref': '#/definitions/Macaroon'},
-                                                                   'url': {'type': 'string'}},
-                                                    'required': ['url',
-                                                                 'channel',
-                                                                 'macaroon'],
-                                                    'type': 'object'},
-                      'AddMachineParams': {'additionalProperties': False,
-                                           'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'},
-                                                                        'type': 'array'},
-                                                          'constraints': {'$ref': '#/definitions/Value'},
-                                                          'container-type': {'type': 'string'},
-                                                          'disks': {'items': {'$ref': '#/definitions/Constraints'},
-                                                                    'type': 'array'},
-                                                          'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'},
-                                                          'instance-id': {'type': 'string'},
-                                                          'jobs': {'items': {'type': 'string'},
-                                                                   'type': 'array'},
-                                                          'nonce': {'type': 'string'},
-                                                          'parent-id': {'type': 'string'},
-                                                          'placement': {'$ref': '#/definitions/Placement'},
-                                                          'series': {'type': 'string'}},
-                                           'required': ['series',
-                                                        'constraints',
-                                                        'jobs',
-                                                        'parent-id',
-                                                        'container-type',
-                                                        'instance-id',
-                                                        'nonce',
-                                                        'hardware-characteristics',
-                                                        'addresses'],
-                                           'type': 'object'},
-                      'AddMachines': {'additionalProperties': False,
-                                      'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'},
-                                                                'type': 'array'}},
-                                      'required': ['params'],
-                                      'type': 'object'},
-                      'AddMachinesResult': {'additionalProperties': False,
-                                            'properties': {'error': {'$ref': '#/definitions/Error'},
-                                                           'machine': {'type': 'string'}},
-                                            'required': ['machine'],
-                                            'type': 'object'},
-                      'AddMachinesResults': {'additionalProperties': False,
-                                             'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'},
-                                                                         'type': 'array'}},
-                                             'required': ['machines'],
-                                             'type': 'object'},
-                      'Address': {'additionalProperties': False,
-                                  'properties': {'scope': {'type': 'string'},
-                                                 'space-name': {'type': 'string'},
-                                                 'type': {'type': 'string'},
-                                                 'value': {'type': 'string'}},
-                                  'required': ['value', 'type', 'scope'],
-                                  'type': 'object'},
-                      'AgentVersionResult': {'additionalProperties': False,
-                                             'properties': {'version': {'$ref': '#/definitions/Number'}},
-                                             'required': ['version'],
-                                             'type': 'object'},
-                      'AllWatcherId': {'additionalProperties': False,
-                                       'properties': {'watcher-id': {'type': 'string'}},
-                                       'required': ['watcher-id'],
-                                       'type': 'object'},
-                      'ApplicationStatus': {'additionalProperties': False,
-                                            'properties': {'can-upgrade-to': {'type': 'string'},
-                                                           'charm': {'type': 'string'},
-                                                           'err': {'additionalProperties': True,
++class CAASAgentFacade(Type):
++    name = 'CAASAgent'
 +    version = 1
-                                                           'exposed': {'type': 'boolean'},
-                                                           'life': {'type': 'string'},
-                                                           'meter-statuses': {'patternProperties': {'.*': {'$ref': '#/definitions/MeterStatus'}},
-                                                                              'type': 'object'},
-                                                           'relations': {'patternProperties': {'.*': {'items': {'type': 'string'},
-                                                                                                      'type': 'array'}},
-                                                                         'type': 'object'},
-                                                           'series': {'type': 'string'},
-                                                           'status': {'$ref': '#/definitions/DetailedStatus'},
-                                                           'subordinate-to': {'items': {'type': 'string'},
-                                                                              'type': 'array'},
-                                                           'units': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}},
-                                                                     'type': 'object'},
-                                                           'workload-version': {'type': 'string'}},
-                                            'required': ['charm',
-                                                         'series',
-                                                         'exposed',
-                                                         'life',
-                                                         'relations',
-                                                         'can-upgrade-to',
-                                                         'subordinate-to',
-                                                         'units',
-                                                         'meter-statuses',
-                                                         'status',
-                                                         'workload-version'],
-                                            'type': 'object'},
-                      'Binary': {'additionalProperties': False,
-                                 'properties': {'Arch': {'type': 'string'},
-                                                'Number': {'$ref': '#/definitions/Number'},
-                                                'Series': {'type': 'string'}},
-                                 'required': ['Number', 'Series', 'Arch'],
++    schema =     {'definitions': {'CloudCredential': {'additionalProperties': False,
++                                         'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}},
 +                                                                  'type': 'object'},
-                      'BundleChange': {'additionalProperties': False,
-                                       'properties': {'args': {'items': {'additionalProperties': True,
-                                                                         'type': 'object'},
-                                                               'type': 'array'},
-                                                      'id': {'type': 'string'},
-                                                      'method': {'type': 'string'},
-                                                      'requires': {'items': {'type': 'string'},
-                                                                   'type': 'array'}},
-                                       'required': ['id',
-                                                    'method',
-                                                    'args',
-                                                    'requires'],
-                                       'type': 'object'},
-                      'BundleChangesParams': {'additionalProperties': False,
-                                              'properties': {'yaml': {'type': 'string'}},
-                                              'required': ['yaml'],
-                                              'type': 'object'},
-                      'BundleChangesResults': {'additionalProperties': False,
-                                               'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'},
-                                                                          'type': 'array'},
-                                                              'errors': {'items': {'type': 'string'},
-                                                                         'type': 'array'}},
-                                               'type': 'object'},
-                      'BytesResult': {'additionalProperties': False,
-                                      'properties': {'result': {'items': {'type': 'integer'},
-                                                                'type': 'array'}},
-                                      'required': ['result'],
++                                                        'auth-type': {'type': 'string'},
++                                                        'redacted': {'items': {'type': 'string'},
++                                                                     'type': 'array'}},
++                                         'required': ['auth-type'],
++                                         'type': 'object'},
++                     'CloudSpec': {'additionalProperties': False,
++                                   'properties': {'cacertificates': {'items': {'type': 'string'},
++                                                                     'type': 'array'},
++                                                  'credential': {'$ref': '#/definitions/CloudCredential'},
++                                                  'endpoint': {'type': 'string'},
++                                                  'identity-endpoint': {'type': 'string'},
++                                                  'name': {'type': 'string'},
++                                                  'region': {'type': 'string'},
++                                                  'storage-endpoint': {'type': 'string'},
++                                                  'type': {'type': 'string'}},
++                                   'required': ['type', 'name'],
++                                   'type': 'object'},
++                     'CloudSpecResult': {'additionalProperties': False,
++                                         'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                        'result': {'$ref': '#/definitions/CloudSpec'}},
++                                         'type': 'object'},
++                     'CloudSpecResults': {'additionalProperties': False,
++                                          'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'},
++                                                                     'type': 'array'}},
++                                          'type': 'object'},
++                     'Entities': {'additionalProperties': False,
++                                  'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
++                                                              'type': 'array'}},
++                                  'required': ['entities'],
++                                  'type': 'object'},
++                     'Entity': {'additionalProperties': False,
++                                'properties': {'tag': {'type': 'string'}},
++                                'required': ['tag'],
 +                                'type': 'object'},
-                      'ConfigValue': {'additionalProperties': False,
-                                      'properties': {'source': {'type': 'string'},
-                                                     'value': {'additionalProperties': True,
-                                                               'type': 'object'}},
-                                      'required': ['value', 'source'],
-                                      'type': 'object'},
-                      'Constraints': {'additionalProperties': False,
-                                      'properties': {'Count': {'type': 'integer'},
-                                                     'Pool': {'type': 'string'},
-                                                     'Size': {'type': 'integer'}},
-                                      'required': ['Pool', 'Size', 'Count'],
++                     'Error': {'additionalProperties': False,
++                               'properties': {'code': {'type': 'string'},
++                                              'info': {'$ref': '#/definitions/ErrorInfo'},
++                                              'message': {'type': 'string'}},
++                               'required': ['message', 'code'],
++                               'type': 'object'},
++                     'ErrorInfo': {'additionalProperties': False,
++                                   'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
++                                                  'macaroon-path': {'type': 'string'}},
++                                   'type': 'object'},
++                     'Macaroon': {'additionalProperties': False, 'type': 'object'},
++                     'ModelConfigResult': {'additionalProperties': False,
++                                           'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True,
++                                                                                                  'type': 'object'}},
++                                                                     'type': 'object'}},
++                                           'required': ['config'],
++                                           'type': 'object'},
++                     'ModelTag': {'additionalProperties': False, 'type': 'object'},
++                     'NotifyWatchResult': {'additionalProperties': False,
++                                           'properties': {'NotifyWatcherId': {'type': 'string'},
++                                                          'error': {'$ref': '#/definitions/Error'}},
++                                           'required': ['NotifyWatcherId'],
++                                           'type': 'object'}},
++     'properties': {'CloudSpec': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                                 'Result': {'$ref': '#/definitions/CloudSpecResults'}},
++                                  'type': 'object'},
++                    'GetCloudSpec': {'properties': {'Params': {'$ref': '#/definitions/ModelTag'},
++                                                    'Result': {'$ref': '#/definitions/CloudSpecResult'}},
 +                                     'type': 'object'},
-                      'DestroyMachines': {'additionalProperties': False,
-                                          'properties': {'force': {'type': 'boolean'},
-                                                         'machine-names': {'items': {'type': 'string'},
-                                                                           'type': 'array'}},
-                                          'required': ['machine-names', 'force'],
-                                          'type': 'object'},
-                      'DetailedStatus': {'additionalProperties': False,
-                                         'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True,
++                    'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}},
++                                    'type': 'object'},
++                    'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}},
++                                                   'type': 'object'}},
++     'type': 'object'}
++
++
++    @ReturnMapping(CloudSpecResults)
++    async def CloudSpec(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~CloudSpecResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASAgent',
++                   request='CloudSpec',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(CloudSpecResult)
++    async def GetCloudSpec(self):
++        '''
++
++        Returns -> typing.Union[_ForwardRef('Error'), _ForwardRef('CloudSpec')]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASAgent',
++                   request='GetCloudSpec',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(ModelConfigResult)
++    async def ModelConfig(self):
++        '''
++
++        Returns -> typing.Mapping[str, typing.Any]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASAgent',
++                   request='ModelConfig',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(NotifyWatchResult)
++    async def WatchForModelConfigChanges(self):
++        '''
++
++        Returns -> typing.Union[str, _ForwardRef('Error')]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASAgent',
++                   request='WatchForModelConfigChanges',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++class CAASFirewallerFacade(Type):
++    name = 'CAASFirewaller'
++    version = 1
++    schema =     {'definitions': {'ApplicationGetConfigResults': {'additionalProperties': False,
++                                                     'properties': {'Results': {'items': {'$ref': '#/definitions/ConfigResult'},
++                                                                                'type': 'array'}},
++                                                     'required': ['Results'],
++                                                     'type': 'object'},
++                     'BoolResult': {'additionalProperties': False,
++                                    'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                   'result': {'type': 'boolean'}},
++                                    'required': ['result'],
++                                    'type': 'object'},
++                     'BoolResults': {'additionalProperties': False,
++                                     'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'},
++                                                                'type': 'array'}},
++                                     'required': ['results'],
 +                                     'type': 'object'},
-                                                        'err': {'additionalProperties': True,
-                                                                'type': 'object'},
-                                                        'info': {'type': 'string'},
-                                                        'kind': {'type': 'string'},
-                                                        'life': {'type': 'string'},
-                                                        'since': {'format': 'date-time',
-                                                                  'type': 'string'},
-                                                        'status': {'type': 'string'},
-                                                        'version': {'type': 'string'}},
-                                         'required': ['status',
-                                                      'info',
-                                                      'data',
-                                                      'since',
-                                                      'kind',
-                                                      'version',
-                                                      'life'],
-                                         'type': 'object'},
-                      'EndpointStatus': {'additionalProperties': False,
-                                         'properties': {'application': {'type': 'string'},
-                                                        'name': {'type': 'string'},
-                                                        'role': {'type': 'string'},
-                                                        'subordinate': {'type': 'boolean'}},
-                                         'required': ['application',
-                                                      'name',
-                                                      'role',
-                                                      'subordinate'],
-                                         'type': 'object'},
++                     'ConfigResult': {'additionalProperties': False,
++                                      'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True,
 +                                                                                             'type': 'object'}},
 +                                                                'type': 'object'},
-                      'EntityStatus': {'additionalProperties': False,
-                                       'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True,
-                                                                                            'type': 'object'}},
-                                                               'type': 'object'},
-                                                      'info': {'type': 'string'},
-                                                      'since': {'format': 'date-time',
-                                                                'type': 'string'},
-                                                      'status': {'type': 'string'}},
-                                       'required': ['status', 'info', 'since'],
-                                       'type': 'object'},
++                                                     'error': {'$ref': '#/definitions/Error'}},
++                                      'required': ['config'],
++                                      'type': 'object'},
 +                     'Entities': {'additionalProperties': False,
 +                                  'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
 +                                                              'type': 'array'}},
 +                                  'required': ['entities'],
 +                                  'type': 'object'},
 +                     'Entity': {'additionalProperties': False,
 +                                'properties': {'tag': {'type': 'string'}},
 +                                'required': ['tag'],
 +                                'type': 'object'},
-                      'ErrorResult': {'additionalProperties': False,
-                                      'properties': {'error': {'$ref': '#/definitions/Error'}},
-                                      'type': 'object'},
-                      'ErrorResults': {'additionalProperties': False,
-                                       'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
-                                                                  'type': 'array'}},
-                                       'required': ['results'],
-                                       'type': 'object'},
-                      'FindToolsParams': {'additionalProperties': False,
-                                          'properties': {'arch': {'type': 'string'},
-                                                         'major': {'type': 'integer'},
-                                                         'minor': {'type': 'integer'},
-                                                         'number': {'$ref': '#/definitions/Number'},
-                                                         'series': {'type': 'string'}},
-                                          'required': ['number',
-                                                       'major',
-                                                       'minor',
-                                                       'arch',
-                                                       'series'],
-                                          'type': 'object'},
-                      'FindToolsResult': {'additionalProperties': False,
-                                          'properties': {'error': {'$ref': '#/definitions/Error'},
-                                                         'list': {'items': {'$ref': '#/definitions/Tools'},
-                                                                  'type': 'array'}},
-                                          'required': ['list'],
-                                          'type': 'object'},
-                      'FullStatus': {'additionalProperties': False,
-                                     'properties': {'applications': {'patternProperties': {'.*': {'$ref': '#/definitions/ApplicationStatus'}},
-                                                                     'type': 'object'},
-                                                    'machines': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}},
-                                                                 'type': 'object'},
-                                                    'model': {'$ref': '#/definitions/ModelStatusInfo'},
-                                                    'relations': {'items': {'$ref': '#/definitions/RelationStatus'},
-                                                                  'type': 'array'},
-                                                    'remote-applications': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteApplicationStatus'}},
-                                                                            'type': 'object'}},
-                                     'required': ['model',
-                                                  'machines',
-                                                  'applications',
-                                                  'remote-applications',
-                                                  'relations'],
 +                     'Error': {'additionalProperties': False,
 +                               'properties': {'code': {'type': 'string'},
 +                                              'info': {'$ref': '#/definitions/ErrorInfo'},
 +                                              'message': {'type': 'string'}},
 +                               'required': ['message', 'code'],
 +                               'type': 'object'},
 +                     'ErrorInfo': {'additionalProperties': False,
 +                                   'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
 +                                                  'macaroon-path': {'type': 'string'}},
 +                                   'type': 'object'},
-                      'GetConstraintsResults': {'additionalProperties': False,
-                                                'properties': {'constraints': {'$ref': '#/definitions/Value'}},
-                                                'required': ['constraints'],
-                                                'type': 'object'},
-                      'HardwareCharacteristics': {'additionalProperties': False,
-                                                  'properties': {'arch': {'type': 'string'},
-                                                                 'availability-zone': {'type': 'string'},
-                                                                 'cpu-cores': {'type': 'integer'},
-                                                                 'cpu-power': {'type': 'integer'},
-                                                                 'mem': {'type': 'integer'},
-                                                                 'root-disk': {'type': 'integer'},
-                                                                 'tags': {'items': {'type': 'string'},
-                                                                          'type': 'array'}},
-                                                  'type': 'object'},
-                      'History': {'additionalProperties': False,
-                                  'properties': {'error': {'$ref': '#/definitions/Error'},
-                                                 'statuses': {'items': {'$ref': '#/definitions/DetailedStatus'},
-                                                              'type': 'array'}},
-                                  'required': ['statuses'],
-                                  'type': 'object'},
-                      'HostPort': {'additionalProperties': False,
-                                   'properties': {'Address': {'$ref': '#/definitions/Address'},
-                                                  'port': {'type': 'integer'}},
-                                   'required': ['Address', 'port'],
-                                   'type': 'object'},
-                      'Macaroon': {'additionalProperties': False, 'type': 'object'},
-                      'MachineHardware': {'additionalProperties': False,
-                                          'properties': {'arch': {'type': 'string'},
-                                                         'availability-zone': {'type': 'string'},
-                                                         'cores': {'type': 'integer'},
-                                                         'cpu-power': {'type': 'integer'},
-                                                         'mem': {'type': 'integer'},
-                                                         'root-disk': {'type': 'integer'},
-                                                         'tags': {'items': {'type': 'string'},
-                                                                  'type': 'array'}},
-                                          'type': 'object'},
-                      'MachineStatus': {'additionalProperties': False,
-                                        'properties': {'agent-status': {'$ref': '#/definitions/DetailedStatus'},
-                                                       'constraints': {'type': 'string'},
-                                                       'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}},
-                                                                      'type': 'object'},
-                                                       'dns-name': {'type': 'string'},
-                                                       'hardware': {'type': 'string'},
-                                                       'has-vote': {'type': 'boolean'},
-                                                       'id': {'type': 'string'},
-                                                       'instance-id': {'type': 'string'},
-                                                       'instance-status': {'$ref': '#/definitions/DetailedStatus'},
-                                                       'ip-addresses': {'items': {'type': 'string'},
-                                                                        'type': 'array'},
-                                                       'jobs': {'items': {'type': 'string'},
-                                                                'type': 'array'},
-                                                       'network-interfaces': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInterface'}},
-                                                                              'type': 'object'},
-                                                       'series': {'type': 'string'},
-                                                       'wants-vote': {'type': 'boolean'}},
-                                        'required': ['agent-status',
-                                                     'instance-status',
-                                                     'dns-name',
-                                                     'instance-id',
-                                                     'series',
-                                                     'id',
-                                                     'containers',
-                                                     'constraints',
-                                                     'hardware',
-                                                     'jobs',
-                                                     'has-vote',
-                                                     'wants-vote'],
-                                        'type': 'object'},
-                      'MeterStatus': {'additionalProperties': False,
-                                      'properties': {'color': {'type': 'string'},
-                                                     'message': {'type': 'string'}},
-                                      'required': ['color', 'message'],
++                     'LifeResult': {'additionalProperties': False,
++                                    'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                   'life': {'type': 'string'}},
++                                    'required': ['life'],
 +                                    'type': 'object'},
-                      'ModelConfigResults': {'additionalProperties': False,
-                                             'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}},
-                                                                       'type': 'object'}},
-                                             'required': ['config'],
++                     'LifeResults': {'additionalProperties': False,
++                                     'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'},
++                                                                'type': 'array'}},
++                                     'required': ['results'],
 +                                     'type': 'object'},
-                      'ModelInfo': {'additionalProperties': False,
-                                    'properties': {'agent-version': {'$ref': '#/definitions/Number'},
-                                                   'cloud-credential-tag': {'type': 'string'},
-                                                   'cloud-region': {'type': 'string'},
-                                                   'cloud-tag': {'type': 'string'},
-                                                   'controller-uuid': {'type': 'string'},
-                                                   'default-series': {'type': 'string'},
-                                                   'life': {'type': 'string'},
-                                                   'machines': {'items': {'$ref': '#/definitions/ModelMachineInfo'},
-                                                                'type': 'array'},
-                                                   'migration': {'$ref': '#/definitions/ModelMigrationStatus'},
-                                                   'name': {'type': 'string'},
-                                                   'owner-tag': {'type': 'string'},
-                                                   'provider-type': {'type': 'string'},
-                                                   'sla': {'$ref': '#/definitions/ModelSLAInfo'},
-                                                   'status': {'$ref': '#/definitions/EntityStatus'},
-                                                   'users': {'items': {'$ref': '#/definitions/ModelUserInfo'},
-                                                             'type': 'array'},
-                                                   'uuid': {'type': 'string'}},
-                                    'required': ['name',
-                                                 'uuid',
-                                                 'controller-uuid',
-                                                 'cloud-tag',
-                                                 'owner-tag',
-                                                 'life',
-                                                 'users',
-                                                 'machines',
-                                                 'sla',
-                                                 'agent-version'],
-                                    'type': 'object'},
-                      'ModelMachineInfo': {'additionalProperties': False,
-                                           'properties': {'hardware': {'$ref': '#/definitions/MachineHardware'},
-                                                          'has-vote': {'type': 'boolean'},
-                                                          'id': {'type': 'string'},
-                                                          'instance-id': {'type': 'string'},
-                                                          'status': {'type': 'string'},
-                                                          'wants-vote': {'type': 'boolean'}},
-                                           'required': ['id'],
++                     'Macaroon': {'additionalProperties': False, 'type': 'object'},
++                     'NotifyWatchResult': {'additionalProperties': False,
++                                           'properties': {'NotifyWatcherId': {'type': 'string'},
++                                                          'error': {'$ref': '#/definitions/Error'}},
++                                           'required': ['NotifyWatcherId'],
++                                           'type': 'object'},
++                     'NotifyWatchResults': {'additionalProperties': False,
++                                            'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'},
++                                                                       'type': 'array'}},
++                                            'required': ['results'],
 +                                            'type': 'object'},
-                      'ModelMigrationStatus': {'additionalProperties': False,
-                                               'properties': {'end': {'format': 'date-time',
-                                                                      'type': 'string'},
-                                                              'start': {'format': 'date-time',
-                                                                        'type': 'string'},
-                                                              'status': {'type': 'string'}},
-                                               'required': ['status', 'start'],
-                                               'type': 'object'},
-                      'ModelSLA': {'additionalProperties': False,
-                                   'properties': {'ModelSLAInfo': {'$ref': '#/definitions/ModelSLAInfo'},
-                                                  'creds': {'items': {'type': 'integer'},
-                                                            'type': 'array'}},
-                                   'required': ['ModelSLAInfo', 'creds'],
++                     'StringsWatchResult': {'additionalProperties': False,
++                                            'properties': {'changes': {'items': {'type': 'string'},
++                                                                       'type': 'array'},
++                                                           'error': {'$ref': '#/definitions/Error'},
++                                                           'watcher-id': {'type': 'string'}},
++                                            'required': ['watcher-id'],
++                                            'type': 'object'}},
++     'properties': {'ApplicationsConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                                          'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}},
++                                           'type': 'object'},
++                    'IsExposed': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                                 'Result': {'$ref': '#/definitions/BoolResults'}},
++                                  'type': 'object'},
++                    'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                            'Result': {'$ref': '#/definitions/LifeResults'}},
++                             'type': 'object'},
++                    'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                             'Result': {'$ref': '#/definitions/NotifyWatchResults'}},
++                              'type': 'object'},
++                    'WatchApplications': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}},
++                                          'type': 'object'}},
++     'type': 'object'}
++
++
++    @ReturnMapping(ApplicationGetConfigResults)
++    async def ApplicationsConfig(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~ConfigResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASFirewaller',
++                   request='ApplicationsConfig',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(BoolResults)
++    async def IsExposed(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~BoolResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASFirewaller',
++                   request='IsExposed',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(LifeResults)
++    async def Life(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~LifeResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASFirewaller',
++                   request='Life',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(NotifyWatchResults)
++    async def Watch(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~NotifyWatchResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASFirewaller',
++                   request='Watch',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(StringsWatchResult)
++    async def WatchApplications(self):
++        '''
++
++        Returns -> typing.Union[typing.Sequence[str], _ForwardRef('Error'), str]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASFirewaller',
++                   request='WatchApplications',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++class CAASOperatorFacade(Type):
++    name = 'CAASOperator'
++    version = 1
++    schema =     {'definitions': {'APIHostPortsResult': {'additionalProperties': False,
++                                            'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'},
++                                                                                 'type': 'array'},
++                                                                       'type': 'array'}},
++                                            'required': ['servers'],
++                                            'type': 'object'},
++                     'Address': {'additionalProperties': False,
++                                 'properties': {'scope': {'type': 'string'},
++                                                'space-name': {'type': 'string'},
++                                                'type': {'type': 'string'},
++                                                'value': {'type': 'string'}},
++                                 'required': ['value', 'type', 'scope'],
++                                 'type': 'object'},
++                     'ApplicationCharm': {'additionalProperties': False,
++                                          'properties': {'charm-modified-version': {'type': 'integer'},
++                                                         'force-upgrade': {'type': 'boolean'},
++                                                         'sha256': {'type': 'string'},
++                                                         'url': {'type': 'string'}},
++                                          'required': ['url',
++                                                       'sha256',
++                                                       'charm-modified-version'],
 +                                          'type': 'object'},
-                      'ModelSLAInfo': {'additionalProperties': False,
-                                       'properties': {'level': {'type': 'string'},
-                                                      'owner': {'type': 'string'}},
-                                       'required': ['level', 'owner'],
++                     'ApplicationCharmResult': {'additionalProperties': False,
++                                                'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                               'result': {'$ref': '#/definitions/ApplicationCharm'}},
++                                                'type': 'object'},
++                     'ApplicationCharmResults': {'additionalProperties': False,
++                                                 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationCharmResult'},
++                                                                            'type': 'array'}},
++                                                 'required': ['results'],
++                                                 'type': 'object'},
++                     'Binary': {'additionalProperties': False,
++                                'properties': {'Arch': {'type': 'string'},
++                                               'Number': {'$ref': '#/definitions/Number'},
++                                               'Series': {'type': 'string'}},
++                                'required': ['Number', 'Series', 'Arch'],
++                                'type': 'object'},
++                     'Entities': {'additionalProperties': False,
++                                  'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
++                                                              'type': 'array'}},
++                                  'required': ['entities'],
 +                                  'type': 'object'},
-                      'ModelSet': {'additionalProperties': False,
-                                   'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True,
-                                                                                          'type': 'object'}},
-                                                             'type': 'object'}},
-                                   'required': ['config'],
++                     'EntitiesVersion': {'additionalProperties': False,
++                                         'properties': {'agent-tools': {'items': {'$ref': '#/definitions/EntityVersion'},
++                                                                        'type': 'array'}},
++                                         'required': ['agent-tools'],
++                                         'type': 'object'},
++                     'Entity': {'additionalProperties': False,
++                                'properties': {'tag': {'type': 'string'}},
++                                'required': ['tag'],
++                                'type': 'object'},
++                     'EntityStatusArgs': {'additionalProperties': False,
++                                          'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True,
++                                                                                               'type': 'object'}},
++                                                                  'type': 'object'},
++                                                         'info': {'type': 'string'},
++                                                         'status': {'type': 'string'},
++                                                         'tag': {'type': 'string'}},
++                                          'required': ['tag',
++                                                       'status',
++                                                       'info',
++                                                       'data'],
++                                          'type': 'object'},
++                     'EntityString': {'additionalProperties': False,
++                                      'properties': {'tag': {'type': 'string'},
++                                                     'value': {'type': 'string'}},
++                                      'required': ['tag', 'value'],
 +                                      'type': 'object'},
-                      'ModelStatusInfo': {'additionalProperties': False,
-                                          'properties': {'available-version': {'type': 'string'},
-                                                         'cloud-tag': {'type': 'string'},
-                                                         'meter-status': {'$ref': '#/definitions/MeterStatus'},
-                                                         'model-status': {'$ref': '#/definitions/DetailedStatus'},
-                                                         'name': {'type': 'string'},
-                                                         'region': {'type': 'string'},
-                                                         'sla': {'type': 'string'},
-                                                         'version': {'type': 'string'}},
-                                          'required': ['name',
-                                                       'cloud-tag',
-                                                       'version',
-                                                       'available-version',
-                                                       'model-status',
-                                                       'meter-status',
-                                                       'sla'],
-                                          'type': 'object'},
-                      'ModelUnset': {'additionalProperties': False,
-                                     'properties': {'keys': {'items': {'type': 'string'},
-                                                             'type': 'array'}},
-                                     'required': ['keys'],
++                     'EntityVersion': {'additionalProperties': False,
++                                       'properties': {'tag': {'type': 'string'},
++                                                      'tools': {'$ref': '#/definitions/Version'}},
++                                       'required': ['tag', 'tools'],
++                                       'type': 'object'},
++                     'Error': {'additionalProperties': False,
++                               'properties': {'code': {'type': 'string'},
++                                              'info': {'$ref': '#/definitions/ErrorInfo'},
++                                              'message': {'type': 'string'}},
++                               'required': ['message', 'code'],
++                               'type': 'object'},
++                     'ErrorInfo': {'additionalProperties': False,
++                                   'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
++                                                  'macaroon-path': {'type': 'string'}},
++                                   'type': 'object'},
++                     'ErrorResult': {'additionalProperties': False,
++                                     'properties': {'error': {'$ref': '#/definitions/Error'}},
++                                     'type': 'object'},
++                     'ErrorResults': {'additionalProperties': False,
++                                      'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
++                                                                 'type': 'array'}},
++                                      'required': ['results'],
++                                      'type': 'object'},
++                     'HostPort': {'additionalProperties': False,
++                                  'properties': {'Address': {'$ref': '#/definitions/Address'},
++                                                 'port': {'type': 'integer'}},
++                                  'required': ['Address', 'port'],
 +                                  'type': 'object'},
-                      'ModelUserInfo': {'additionalProperties': False,
-                                        'properties': {'access': {'type': 'string'},
-                                                       'display-name': {'type': 'string'},
-                                                       'last-connection': {'format': 'date-time',
-                                                                           'type': 'string'},
-                                                       'user': {'type': 'string'}},
-                                        'required': ['user',
-                                                     'display-name',
-                                                     'last-connection',
-                                                     'access'],
-                                        'type': 'object'},
-                      'ModelUserInfoResult': {'additionalProperties': False,
-                                              'properties': {'error': {'$ref': '#/definitions/Error'},
-                                                             'result': {'$ref': '#/definitions/ModelUserInfo'}},
-                                              'type': 'object'},
-                      'ModelUserInfoResults': {'additionalProperties': False,
-                                               'properties': {'results': {'items': {'$ref': '#/definitions/ModelUserInfoResult'},
-                                                                          'type': 'array'}},
-                                               'required': ['results'],
-                                               'type': 'object'},
-                      'NetworkInterface': {'additionalProperties': False,
-                                           'properties': {'dns-nameservers': {'items': {'type': 'string'},
-                                                                              'type': 'array'},
-                                                          'gateway': {'type': 'string'},
-                                                          'ip-addresses': {'items': {'type': 'string'},
-                                                                           'type': 'array'},
-                                                          'is-up': {'type': 'boolean'},
-                                                          'mac-address': {'type': 'string'},
-                                                          'space': {'type': 'string'}},
-                                           'required': ['ip-addresses',
-                                                        'mac-address',
-                                                        'is-up'],
-                                           'type': 'object'},
++                     'LifeResult': {'additionalProperties': False,
++                                    'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                   'life': {'type': 'string'}},
++                                    'required': ['life'],
 +                                    'type': 'object'},
-                      'Placement': {'additionalProperties': False,
-                                    'properties': {'directive': {'type': 'string'},
-                                                   'scope': {'type': 'string'}},
-                                    'required': ['scope', 'directive'],
++                     'LifeResults': {'additionalProperties': False,
++                                     'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'},
++                                                                'type': 'array'}},
++                                     'required': ['results'],
++                                     'type': 'object'},
++                     'Macaroon': {'additionalProperties': False, 'type': 'object'},
++                     'ModelResult': {'additionalProperties': False,
++                                     'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                    'name': {'type': 'string'},
++                                                    'type': {'type': 'string'},
++                                                    'uuid': {'type': 'string'}},
++                                     'required': ['name', 'uuid', 'type'],
++                                     'type': 'object'},
++                     'NotifyWatchResult': {'additionalProperties': False,
++                                           'properties': {'NotifyWatcherId': {'type': 'string'},
++                                                          'error': {'$ref': '#/definitions/Error'}},
++                                           'required': ['NotifyWatcherId'],
++                                           'type': 'object'},
++                     'NotifyWatchResults': {'additionalProperties': False,
++                                            'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'},
++                                                                       'type': 'array'}},
++                                            'required': ['results'],
++                                            'type': 'object'},
 +                     'Number': {'additionalProperties': False,
 +                                'properties': {'Build': {'type': 'integer'},
 +                                               'Major': {'type': 'integer'},
 +                                               'Minor': {'type': 'integer'},
 +                                               'Patch': {'type': 'integer'},
 +                                               'Tag': {'type': 'string'}},
 +                                'required': ['Major',
 +                                             'Minor',
 +                                             'Tag',
 +                                             'Patch',
 +                                             'Build'],
 +                                'type': 'object'},
-                      'PrivateAddress': {'additionalProperties': False,
-                                         'properties': {'target': {'type': 'string'}},
-                                         'required': ['target'],
-                                         'type': 'object'},
-                      'PrivateAddressResults': {'additionalProperties': False,
-                                                'properties': {'private-address': {'type': 'string'}},
-                                                'required': ['private-address'],
-                                                'type': 'object'},
-                      'ProvisioningScriptParams': {'additionalProperties': False,
-                                                   'properties': {'data-dir': {'type': 'string'},
-                                                                  'disable-package-commands': {'type': 'boolean'},
-                                                                  'machine-id': {'type': 'string'},
-                                                                  'nonce': {'type': 'string'}},
-                                                   'required': ['machine-id',
-                                                                'nonce',
-                                                                'data-dir',
-                                                                'disable-package-commands'],
-                                                   'type': 'object'},
-                      'ProvisioningScriptResult': {'additionalProperties': False,
-                                                   'properties': {'script': {'type': 'string'}},
-                                                   'required': ['script'],
-                                                   'type': 'object'},
-                      'PublicAddress': {'additionalProperties': False,
-                                        'properties': {'target': {'type': 'string'}},
-                                        'required': ['target'],
++                     'SetPodSpecParams': {'additionalProperties': False,
++                                          'properties': {'specs': {'items': {'$ref': '#/definitions/EntityString'},
++                                                                   'type': 'array'}},
++                                          'required': ['specs'],
++                                          'type': 'object'},
++                     'SetStatus': {'additionalProperties': False,
++                                   'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'},
++                                                               'type': 'array'}},
++                                   'required': ['entities'],
 +                                   'type': 'object'},
-                      'PublicAddressResults': {'additionalProperties': False,
-                                               'properties': {'public-address': {'type': 'string'}},
-                                               'required': ['public-address'],
-                                               'type': 'object'},
-                      'RelationStatus': {'additionalProperties': False,
-                                         'properties': {'endpoints': {'items': {'$ref': '#/definitions/EndpointStatus'},
-                                                                      'type': 'array'},
-                                                        'id': {'type': 'integer'},
-                                                        'interface': {'type': 'string'},
-                                                        'key': {'type': 'string'},
-                                                        'scope': {'type': 'string'}},
-                                         'required': ['id',
-                                                      'key',
-                                                      'interface',
-                                                      'scope',
-                                                      'endpoints'],
-                                         'type': 'object'},
-                      'RemoteApplicationStatus': {'additionalProperties': False,
-                                                  'properties': {'application-name': {'type': 'string'},
-                                                                 'application-url': {'type': 'string'},
-                                                                 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'},
-                                                                               'type': 'array'},
-                                                                 'err': {'additionalProperties': True,
-                                                                         'type': 'object'},
-                                                                 'life': {'type': 'string'},
-                                                                 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'},
-                                                                                                            'type': 'array'}},
-                                                                               'type': 'object'},
-                                                                 'status': {'$ref': '#/definitions/DetailedStatus'}},
-                                                  'required': ['application-url',
-                                                               'application-name',
-                                                               'endpoints',
-                                                               'life',
-                                                               'relations',
-                                                               'status'],
-                                                  'type': 'object'},
-                      'RemoteEndpoint': {'additionalProperties': False,
-                                         'properties': {'interface': {'type': 'string'},
-                                                        'limit': {'type': 'integer'},
-                                                        'name': {'type': 'string'},
-                                                        'role': {'type': 'string'},
-                                                        'scope': {'type': 'string'}},
-                                         'required': ['name',
-                                                      'role',
-                                                      'interface',
-                                                      'limit',
-                                                      'scope'],
-                                         'type': 'object'},
-                      'ResolveCharmResult': {'additionalProperties': False,
-                                             'properties': {'error': {'type': 'string'},
-                                                            'url': {'type': 'string'}},
++                     'StringResult': {'additionalProperties': False,
++                                      'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                     'result': {'type': 'string'}},
++                                      'required': ['result'],
++                                      'type': 'object'},
++                     'StringsResult': {'additionalProperties': False,
++                                       'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                      'result': {'items': {'type': 'string'},
++                                                                 'type': 'array'}},
 +                                       'type': 'object'},
-                      'ResolveCharmResults': {'additionalProperties': False,
-                                              'properties': {'urls': {'items': {'$ref': '#/definitions/ResolveCharmResult'},
-                                                                      'type': 'array'}},
-                                              'required': ['urls'],
++                     'StringsWatchResult': {'additionalProperties': False,
++                                            'properties': {'changes': {'items': {'type': 'string'},
++                                                                       'type': 'array'},
++                                                           'error': {'$ref': '#/definitions/Error'},
++                                                           'watcher-id': {'type': 'string'}},
++                                            'required': ['watcher-id'],
 +                                            'type': 'object'},
-                      'ResolveCharms': {'additionalProperties': False,
-                                        'properties': {'references': {'items': {'type': 'string'},
-                                                                      'type': 'array'}},
-                                        'required': ['references'],
-                                        'type': 'object'},
-                      'Resolved': {'additionalProperties': False,
-                                   'properties': {'retry': {'type': 'boolean'},
-                                                  'unit-name': {'type': 'string'}},
-                                   'required': ['unit-name', 'retry'],
++                     'StringsWatchResults': {'additionalProperties': False,
++                                             'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'},
++                                                                        'type': 'array'}},
++                                             'required': ['results'],
 +                                             'type': 'object'},
-                      'SetConstraints': {'additionalProperties': False,
-                                         'properties': {'application': {'type': 'string'},
-                                                        'constraints': {'$ref': '#/definitions/Value'}},
-                                         'required': ['application', 'constraints'],
-                                         'type': 'object'},
-                      'SetModelAgentVersion': {'additionalProperties': False,
-                                               'properties': {'version': {'$ref': '#/definitions/Number'}},
-                                               'required': ['version'],
-                                               'type': 'object'},
-                      'StatusHistoryFilter': {'additionalProperties': False,
-                                              'properties': {'date': {'format': 'date-time',
-                                                                      'type': 'string'},
-                                                             'delta': {'type': 'integer'},
-                                                             'exclude': {'items': {'type': 'string'},
-                                                                         'type': 'array'},
-                                                             'size': {'type': 'integer'}},
-                                              'required': ['size',
-                                                           'date',
-                                                           'delta',
-                                                           'exclude'],
-                                              'type': 'object'},
-                      'StatusHistoryRequest': {'additionalProperties': False,
-                                               'properties': {'filter': {'$ref': '#/definitions/StatusHistoryFilter'},
-                                                              'historyKind': {'type': 'string'},
-                                                              'size': {'type': 'integer'},
-                                                              'tag': {'type': 'string'}},
-                                               'required': ['historyKind',
-                                                            'size',
-                                                            'filter',
-                                                            'tag'],
-                                               'type': 'object'},
-                      'StatusHistoryRequests': {'additionalProperties': False,
-                                                'properties': {'requests': {'items': {'$ref': '#/definitions/StatusHistoryRequest'},
-                                                                            'type': 'array'}},
-                                                'required': ['requests'],
++                     'Version': {'additionalProperties': False,
++                                 'properties': {'version': {'$ref': '#/definitions/Binary'}},
++                                 'required': ['version'],
++                                 'type': 'object'}},
++     'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}},
++                                     'type': 'object'},
++                    'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}},
++                                     'type': 'object'},
++                    'Charm': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                             'Result': {'$ref': '#/definitions/ApplicationCharmResults'}},
++                              'type': 'object'},
++                    'CurrentModel': {'properties': {'Result': {'$ref': '#/definitions/ModelResult'}},
++                                     'type': 'object'},
++                    'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                            'Result': {'$ref': '#/definitions/LifeResults'}},
++                             'type': 'object'},
++                    'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}},
 +                                  'type': 'object'},
-                      'StatusHistoryResult': {'additionalProperties': False,
-                                              'properties': {'error': {'$ref': '#/definitions/Error'},
-                                                             'history': {'$ref': '#/definitions/History'}},
-                                              'required': ['history'],
++                    'Remove': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                              'Result': {'$ref': '#/definitions/ErrorResults'}},
++                               'type': 'object'},
++                    'SetPodSpec': {'properties': {'Params': {'$ref': '#/definitions/SetPodSpecParams'},
++                                                  'Result': {'$ref': '#/definitions/ErrorResults'}},
++                                   'type': 'object'},
++                    'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'},
++                                                 'Result': {'$ref': '#/definitions/ErrorResults'}},
++                                  'type': 'object'},
++                    'SetTools': {'properties': {'Params': {'$ref': '#/definitions/EntitiesVersion'},
++                                                'Result': {'$ref': '#/definitions/ErrorResults'}},
++                                 'type': 'object'},
++                    'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                             'Result': {'$ref': '#/definitions/NotifyWatchResults'}},
++                              'type': 'object'},
++                    'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}},
++                                          'type': 'object'},
++                    'WatchUnits': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                                  'Result': {'$ref': '#/definitions/StringsWatchResults'}},
++                                   'type': 'object'}},
++     'type': 'object'}
++
++
++    @ReturnMapping(StringsResult)
++    async def APIAddresses(self):
++        '''
++
++        Returns -> typing.Union[_ForwardRef('Error'), typing.Sequence[str]]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperator',
++                   request='APIAddresses',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(APIHostPortsResult)
++    async def APIHostPorts(self):
++        '''
++
++        Returns -> typing.Sequence[~HostPort]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperator',
++                   request='APIHostPorts',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(ApplicationCharmResults)
++    async def Charm(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~ApplicationCharmResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperator',
++                   request='Charm',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(ModelResult)
++    async def CurrentModel(self):
++        '''
++
++        Returns -> typing.Union[_ForwardRef('Error'), str]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperator',
++                   request='CurrentModel',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(LifeResults)
++    async def Life(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~LifeResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperator',
++                   request='Life',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(StringResult)
++    async def ModelUUID(self):
++        '''
++
++        Returns -> typing.Union[_ForwardRef('Error'), str]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperator',
++                   request='ModelUUID',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(ErrorResults)
++    async def Remove(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~ErrorResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperator',
++                   request='Remove',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(ErrorResults)
++    async def SetPodSpec(self, specs):
++        '''
++        specs : typing.Sequence[~EntityString]
++        Returns -> typing.Sequence[~ErrorResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperator',
++                   request='SetPodSpec',
++                   version=1,
++                   params=_params)
++        _params['specs'] = specs
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(ErrorResults)
++    async def SetStatus(self, entities):
++        '''
++        entities : typing.Sequence[~EntityStatusArgs]
++        Returns -> typing.Sequence[~ErrorResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperator',
++                   request='SetStatus',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(ErrorResults)
++    async def SetTools(self, agent_tools):
++        '''
++        agent_tools : typing.Sequence[~EntityVersion]
++        Returns -> typing.Sequence[~ErrorResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperator',
++                   request='SetTools',
++                   version=1,
++                   params=_params)
++        _params['agent-tools'] = agent_tools
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(NotifyWatchResults)
++    async def Watch(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~NotifyWatchResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperator',
++                   request='Watch',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(NotifyWatchResult)
++    async def WatchAPIHostPorts(self):
++        '''
++
++        Returns -> typing.Union[str, _ForwardRef('Error')]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperator',
++                   request='WatchAPIHostPorts',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(StringsWatchResults)
++    async def WatchUnits(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~StringsWatchResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperator',
++                   request='WatchUnits',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++class CAASOperatorProvisionerFacade(Type):
++    name = 'CAASOperatorProvisioner'
++    version = 1
++    schema =     {'definitions': {'APIHostPortsResult': {'additionalProperties': False,
++                                            'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'},
++                                                                                 'type': 'array'},
++                                                                       'type': 'array'}},
++                                            'required': ['servers'],
++                                            'type': 'object'},
++                     'Address': {'additionalProperties': False,
++                                 'properties': {'scope': {'type': 'string'},
++                                                'space-name': {'type': 'string'},
++                                                'type': {'type': 'string'},
++                                                'value': {'type': 'string'}},
++                                 'required': ['value', 'type', 'scope'],
++                                 'type': 'object'},
++                     'Entities': {'additionalProperties': False,
++                                  'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
++                                                              'type': 'array'}},
++                                  'required': ['entities'],
++                                  'type': 'object'},
++                     'Entity': {'additionalProperties': False,
++                                'properties': {'tag': {'type': 'string'}},
++                                'required': ['tag'],
++                                'type': 'object'},
++                     'EntityPassword': {'additionalProperties': False,
++                                        'properties': {'password': {'type': 'string'},
++                                                       'tag': {'type': 'string'}},
++                                        'required': ['tag', 'password'],
++                                        'type': 'object'},
++                     'EntityPasswords': {'additionalProperties': False,
++                                         'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'},
++                                                                    'type': 'array'}},
++                                         'required': ['changes'],
++                                         'type': 'object'},
++                     'Error': {'additionalProperties': False,
++                               'properties': {'code': {'type': 'string'},
++                                              'info': {'$ref': '#/definitions/ErrorInfo'},
++                                              'message': {'type': 'string'}},
++                               'required': ['message', 'code'],
++                               'type': 'object'},
++                     'ErrorInfo': {'additionalProperties': False,
++                                   'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
++                                                  'macaroon-path': {'type': 'string'}},
++                                   'type': 'object'},
++                     'ErrorResult': {'additionalProperties': False,
++                                     'properties': {'error': {'$ref': '#/definitions/Error'}},
++                                     'type': 'object'},
++                     'ErrorResults': {'additionalProperties': False,
++                                      'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
++                                                                 'type': 'array'}},
++                                      'required': ['results'],
++                                      'type': 'object'},
++                     'HostPort': {'additionalProperties': False,
++                                  'properties': {'Address': {'$ref': '#/definitions/Address'},
++                                                 'port': {'type': 'integer'}},
++                                  'required': ['Address', 'port'],
++                                  'type': 'object'},
++                     'KubernetesFilesystemAttachmentParams': {'additionalProperties': False,
++                                                              'properties': {'mount-point': {'type': 'string'},
++                                                                             'provider': {'type': 'string'},
++                                                                             'read-only': {'type': 'boolean'}},
++                                                              'required': ['provider'],
++                                                              'type': 'object'},
++                     'KubernetesFilesystemParams': {'additionalProperties': False,
++                                                    'properties': {'attachment': {'$ref': '#/definitions/KubernetesFilesystemAttachmentParams'},
++                                                                   'attributes': {'patternProperties': {'.*': {'additionalProperties': True,
++                                                                                                               'type': 'object'}},
++                                                                                  'type': 'object'},
++                                                                   'provider': {'type': 'string'},
++                                                                   'size': {'type': 'integer'},
++                                                                   'storagename': {'type': 'string'},
++                                                                   'tags': {'patternProperties': {'.*': {'type': 'string'}},
++                                                                            'type': 'object'}},
++                                                    'required': ['storagename',
++                                                                 'size',
++                                                                 'provider'],
++                                                    'type': 'object'},
++                     'LifeResult': {'additionalProperties': False,
++                                    'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                   'life': {'type': 'string'}},
++                                    'required': ['life'],
++                                    'type': 'object'},
++                     'LifeResults': {'additionalProperties': False,
++                                     'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'},
++                                                                'type': 'array'}},
++                                     'required': ['results'],
++                                     'type': 'object'},
++                     'Macaroon': {'additionalProperties': False, 'type': 'object'},
++                     'NotifyWatchResult': {'additionalProperties': False,
++                                           'properties': {'NotifyWatcherId': {'type': 'string'},
++                                                          'error': {'$ref': '#/definitions/Error'}},
++                                           'required': ['NotifyWatcherId'],
++                                           'type': 'object'},
++                     'Number': {'additionalProperties': False,
++                                'properties': {'Build': {'type': 'integer'},
++                                               'Major': {'type': 'integer'},
++                                               'Minor': {'type': 'integer'},
++                                               'Patch': {'type': 'integer'},
++                                               'Tag': {'type': 'string'}},
++                                'required': ['Major',
++                                             'Minor',
++                                             'Tag',
++                                             'Patch',
++                                             'Build'],
++                                'type': 'object'},
++                     'OperatorProvisioningInfo': {'additionalProperties': False,
++                                                  'properties': {'api-addresses': {'items': {'type': 'string'},
++                                                                                   'type': 'array'},
++                                                                 'charm-storage': {'$ref': '#/definitions/KubernetesFilesystemParams'},
++                                                                 'image-path': {'type': 'string'},
++                                                                 'tags': {'patternProperties': {'.*': {'type': 'string'}},
++                                                                          'type': 'object'},
++                                                                 'version': {'$ref': '#/definitions/Number'}},
++                                                  'required': ['image-path',
++                                                               'version',
++                                                               'api-addresses',
++                                                               'charm-storage'],
++                                                  'type': 'object'},
++                     'StringResult': {'additionalProperties': False,
++                                      'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                     'result': {'type': 'string'}},
++                                      'required': ['result'],
++                                      'type': 'object'},
++                     'StringsResult': {'additionalProperties': False,
++                                       'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                      'result': {'items': {'type': 'string'},
++                                                                 'type': 'array'}},
++                                       'type': 'object'},
++                     'StringsWatchResult': {'additionalProperties': False,
++                                            'properties': {'changes': {'items': {'type': 'string'},
++                                                                       'type': 'array'},
++                                                           'error': {'$ref': '#/definitions/Error'},
++                                                           'watcher-id': {'type': 'string'}},
++                                            'required': ['watcher-id'],
++                                            'type': 'object'}},
++     'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}},
++                                     'type': 'object'},
++                    'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}},
++                                     'type': 'object'},
++                    'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                            'Result': {'$ref': '#/definitions/LifeResults'}},
++                             'type': 'object'},
++                    'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}},
++                                  'type': 'object'},
++                    'OperatorProvisioningInfo': {'properties': {'Result': {'$ref': '#/definitions/OperatorProvisioningInfo'}},
++                                                 'type': 'object'},
++                    'SetPasswords': {'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'},
++                                                    'Result': {'$ref': '#/definitions/ErrorResults'}},
++                                     'type': 'object'},
++                    'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}},
++                                          'type': 'object'},
++                    'WatchApplications': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}},
++                                          'type': 'object'}},
++     'type': 'object'}
++
++
++    @ReturnMapping(StringsResult)
++    async def APIAddresses(self):
++        '''
++
++        Returns -> typing.Union[_ForwardRef('Error'), typing.Sequence[str]]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperatorProvisioner',
++                   request='APIAddresses',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(APIHostPortsResult)
++    async def APIHostPorts(self):
++        '''
++
++        Returns -> typing.Sequence[~HostPort]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperatorProvisioner',
++                   request='APIHostPorts',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(LifeResults)
++    async def Life(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~LifeResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperatorProvisioner',
++                   request='Life',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(StringResult)
++    async def ModelUUID(self):
++        '''
++
++        Returns -> typing.Union[_ForwardRef('Error'), str]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperatorProvisioner',
++                   request='ModelUUID',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(OperatorProvisioningInfo)
++    async def OperatorProvisioningInfo(self):
++        '''
++
++        Returns -> typing.Union[typing.Sequence[str], _ForwardRef('KubernetesFilesystemParams'), str, typing.Mapping[str, str], _ForwardRef('Number')]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperatorProvisioner',
++                   request='OperatorProvisioningInfo',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(ErrorResults)
++    async def SetPasswords(self, changes):
++        '''
++        changes : typing.Sequence[~EntityPassword]
++        Returns -> typing.Sequence[~ErrorResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperatorProvisioner',
++                   request='SetPasswords',
++                   version=1,
++                   params=_params)
++        _params['changes'] = changes
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(NotifyWatchResult)
++    async def WatchAPIHostPorts(self):
++        '''
++
++        Returns -> typing.Union[str, _ForwardRef('Error')]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperatorProvisioner',
++                   request='WatchAPIHostPorts',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(StringsWatchResult)
++    async def WatchApplications(self):
++        '''
++
++        Returns -> typing.Union[typing.Sequence[str], _ForwardRef('Error'), str]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASOperatorProvisioner',
++                   request='WatchApplications',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++class CAASUnitProvisionerFacade(Type):
++    name = 'CAASUnitProvisioner'
++    version = 1
++    schema =     {'definitions': {'Address': {'additionalProperties': False,
++                                 'properties': {'scope': {'type': 'string'},
++                                                'space-name': {'type': 'string'},
++                                                'type': {'type': 'string'},
++                                                'value': {'type': 'string'}},
++                                 'required': ['value', 'type', 'scope'],
++                                 'type': 'object'},
++                     'ApplicationGetConfigResults': {'additionalProperties': False,
++                                                     'properties': {'Results': {'items': {'$ref': '#/definitions/ConfigResult'},
++                                                                                'type': 'array'}},
++                                                     'required': ['Results'],
++                                                     'type': 'object'},
++                     'ApplicationUnitParams': {'additionalProperties': False,
++                                               'properties': {'address': {'type': 'string'},
++                                                              'data': {'patternProperties': {'.*': {'additionalProperties': True,
++                                                                                                    'type': 'object'}},
++                                                                       'type': 'object'},
++                                                              'filesystem-info': {'items': {'$ref': '#/definitions/KubernetesFilesystemInfo'},
++                                                                                  'type': 'array'},
++                                                              'info': {'type': 'string'},
++                                                              'ports': {'items': {'type': 'string'},
++                                                                        'type': 'array'},
++                                                              'provider-id': {'type': 'string'},
++                                                              'status': {'type': 'string'},
++                                                              'unit-tag': {'type': 'string'}},
++                                               'required': ['provider-id',
++                                                            'unit-tag',
++                                                            'address',
++                                                            'ports',
++                                                            'status',
++                                                            'info'],
++                                               'type': 'object'},
++                     'ConfigResult': {'additionalProperties': False,
++                                      'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True,
++                                                                                             'type': 'object'}},
++                                                                'type': 'object'},
++                                                     'error': {'$ref': '#/definitions/Error'}},
++                                      'required': ['config'],
++                                      'type': 'object'},
++                     'Entities': {'additionalProperties': False,
++                                  'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
++                                                              'type': 'array'}},
++                                  'required': ['entities'],
++                                  'type': 'object'},
++                     'Entity': {'additionalProperties': False,
++                                'properties': {'tag': {'type': 'string'}},
++                                'required': ['tag'],
++                                'type': 'object'},
++                     'EntityStatusArgs': {'additionalProperties': False,
++                                          'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True,
++                                                                                               'type': 'object'}},
++                                                                  'type': 'object'},
++                                                         'info': {'type': 'string'},
++                                                         'status': {'type': 'string'},
++                                                         'tag': {'type': 'string'}},
++                                          'required': ['tag',
++                                                       'status',
++                                                       'info',
++                                                       'data'],
++                                          'type': 'object'},
++                     'Error': {'additionalProperties': False,
++                               'properties': {'code': {'type': 'string'},
++                                              'info': {'$ref': '#/definitions/ErrorInfo'},
++                                              'message': {'type': 'string'}},
++                               'required': ['message', 'code'],
++                               'type': 'object'},
++                     'ErrorInfo': {'additionalProperties': False,
++                                   'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
++                                                  'macaroon-path': {'type': 'string'}},
++                                   'type': 'object'},
++                     'ErrorResult': {'additionalProperties': False,
++                                     'properties': {'error': {'$ref': '#/definitions/Error'}},
++                                     'type': 'object'},
++                     'ErrorResults': {'additionalProperties': False,
++                                      'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
++                                                                 'type': 'array'}},
++                                      'required': ['results'],
++                                      'type': 'object'},
++                     'IntResult': {'additionalProperties': False,
++                                   'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                  'result': {'type': 'integer'}},
++                                   'required': ['result'],
++                                   'type': 'object'},
++                     'IntResults': {'additionalProperties': False,
++                                    'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'},
++                                                               'type': 'array'}},
++                                    'required': ['results'],
++                                    'type': 'object'},
++                     'KubernetesDeviceParams': {'additionalProperties': False,
++                                                'properties': {'Attributes': {'patternProperties': {'.*': {'type': 'string'}},
++                                                                              'type': 'object'},
++                                                               'Count': {'type': 'integer'},
++                                                               'Type': {'type': 'string'}},
++                                                'required': ['Type',
++                                                             'Count',
++                                                             'Attributes'],
++                                                'type': 'object'},
++                     'KubernetesFilesystemAttachmentParams': {'additionalProperties': False,
++                                                              'properties': {'mount-point': {'type': 'string'},
++                                                                             'provider': {'type': 'string'},
++                                                                             'read-only': {'type': 'boolean'}},
++                                                              'required': ['provider'],
++                                                              'type': 'object'},
++                     'KubernetesFilesystemInfo': {'additionalProperties': False,
++                                                  'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True,
++                                                                                                       'type': 'object'}},
++                                                                          'type': 'object'},
++                                                                 'filesystem-id': {'type': 'string'},
++                                                                 'info': {'type': 'string'},
++                                                                 'mount-point': {'type': 'string'},
++                                                                 'pool': {'type': 'string'},
++                                                                 'read-only': {'type': 'boolean'},
++                                                                 'size': {'type': 'integer'},
++                                                                 'status': {'type': 'string'},
++                                                                 'storagename': {'type': 'string'},
++                                                                 'volume': {'$ref': '#/definitions/KubernetesVolumeInfo'}},
++                                                  'required': ['storagename',
++                                                               'pool',
++                                                               'size',
++                                                               'filesystem-id',
++                                                               'status',
++                                                               'info',
++                                                               'volume'],
++                                                  'type': 'object'},
++                     'KubernetesFilesystemParams': {'additionalProperties': False,
++                                                    'properties': {'attachment': {'$ref': '#/definitions/KubernetesFilesystemAttachmentParams'},
++                                                                   'attributes': {'patternProperties': {'.*': {'additionalProperties': True,
++                                                                                                               'type': 'object'}},
++                                                                                  'type': 'object'},
++                                                                   'provider': {'type': 'string'},
++                                                                   'size': {'type': 'integer'},
++                                                                   'storagename': {'type': 'string'},
++                                                                   'tags': {'patternProperties': {'.*': {'type': 'string'}},
++                                                                            'type': 'object'}},
++                                                    'required': ['storagename',
++                                                                 'size',
++                                                                 'provider'],
++                                                    'type': 'object'},
++                     'KubernetesProvisioningInfo': {'additionalProperties': False,
++                                                    'properties': {'constraints': {'$ref': '#/definitions/Value'},
++                                                                   'devices': {'items': {'$ref': '#/definitions/KubernetesDeviceParams'},
++                                                                               'type': 'array'},
++                                                                   'filesystems': {'items': {'$ref': '#/definitions/KubernetesFilesystemParams'},
++                                                                                   'type': 'array'},
++                                                                   'placement': {'type': 'string'},
++                                                                   'pod-spec': {'type': 'string'},
++                                                                   'tags': {'patternProperties': {'.*': {'type': 'string'}},
++                                                                            'type': 'object'},
++                                                                   'volumes': {'items': {'$ref': '#/definitions/KubernetesVolumeParams'},
++                                                                               'type': 'array'}},
++                                                    'required': ['pod-spec',
++                                                                 'constraints'],
++                                                    'type': 'object'},
++                     'KubernetesProvisioningInfoResult': {'additionalProperties': False,
++                                                          'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                                         'result': {'$ref': '#/definitions/KubernetesProvisioningInfo'}},
++                                                          'required': ['result'],
++                                                          'type': 'object'},
++                     'KubernetesProvisioningInfoResults': {'additionalProperties': False,
++                                                           'properties': {'results': {'items': {'$ref': '#/definitions/KubernetesProvisioningInfoResult'},
++                                                                                      'type': 'array'}},
++                                                           'required': ['results'],
++                                                           'type': 'object'},
++                     'KubernetesVolumeAttachmentParams': {'additionalProperties': False,
++                                                          'properties': {'provider': {'type': 'string'},
++                                                                         'read-only': {'type': 'boolean'}},
++                                                          'required': ['provider'],
++                                                          'type': 'object'},
++                     'KubernetesVolumeInfo': {'additionalProperties': False,
++                                              'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True,
++                                                                                                   'type': 'object'}},
++                                                                      'type': 'object'},
++                                                             'info': {'type': 'string'},
++                                                             'persistent': {'type': 'boolean'},
++                                                             'pool': {'type': 'string'},
++                                                             'size': {'type': 'integer'},
++                                                             'status': {'type': 'string'},
++                                                             'volume-id': {'type': 'string'}},
++                                              'required': ['volume-id',
++                                                           'size',
++                                                           'persistent',
++                                                           'status',
++                                                           'info'],
++                                              'type': 'object'},
++                     'KubernetesVolumeParams': {'additionalProperties': False,
++                                                'properties': {'attachment': {'$ref': '#/definitions/KubernetesVolumeAttachmentParams'},
++                                                               'attributes': {'patternProperties': {'.*': {'additionalProperties': True,
++                                                                                                           'type': 'object'}},
++                                                                              'type': 'object'},
++                                                               'provider': {'type': 'string'},
++                                                               'size': {'type': 'integer'},
++                                                               'storagename': {'type': 'string'},
++                                                               'tags': {'patternProperties': {'.*': {'type': 'string'}},
++                                                                        'type': 'object'}},
++                                                'required': ['storagename',
++                                                             'size',
++                                                             'provider'],
++                                                'type': 'object'},
++                     'LifeResult': {'additionalProperties': False,
++                                    'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                   'life': {'type': 'string'}},
++                                    'required': ['life'],
++                                    'type': 'object'},
++                     'LifeResults': {'additionalProperties': False,
++                                     'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'},
++                                                                'type': 'array'}},
++                                     'required': ['results'],
++                                     'type': 'object'},
++                     'Macaroon': {'additionalProperties': False, 'type': 'object'},
++                     'NotifyWatchResult': {'additionalProperties': False,
++                                           'properties': {'NotifyWatcherId': {'type': 'string'},
++                                                          'error': {'$ref': '#/definitions/Error'}},
++                                           'required': ['NotifyWatcherId'],
++                                           'type': 'object'},
++                     'NotifyWatchResults': {'additionalProperties': False,
++                                            'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'},
++                                                                       'type': 'array'}},
++                                            'required': ['results'],
++                                            'type': 'object'},
++                     'SetStatus': {'additionalProperties': False,
++                                   'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'},
++                                                               'type': 'array'}},
++                                   'required': ['entities'],
++                                   'type': 'object'},
++                     'StringsWatchResult': {'additionalProperties': False,
++                                            'properties': {'changes': {'items': {'type': 'string'},
++                                                                       'type': 'array'},
++                                                           'error': {'$ref': '#/definitions/Error'},
++                                                           'watcher-id': {'type': 'string'}},
++                                            'required': ['watcher-id'],
++                                            'type': 'object'},
++                     'UpdateApplicationServiceArg': {'additionalProperties': False,
++                                                     'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'},
++                                                                                  'type': 'array'},
++                                                                    'application-tag': {'type': 'string'},
++                                                                    'provider-id': {'type': 'string'}},
++                                                     'required': ['application-tag',
++                                                                  'provider-id',
++                                                                  'addresses'],
++                                                     'type': 'object'},
++                     'UpdateApplicationServiceArgs': {'additionalProperties': False,
++                                                      'properties': {'args': {'items': {'$ref': '#/definitions/UpdateApplicationServiceArg'},
++                                                                              'type': 'array'}},
++                                                      'required': ['args'],
++                                                      'type': 'object'},
++                     'UpdateApplicationUnitArgs': {'additionalProperties': False,
++                                                   'properties': {'args': {'items': {'$ref': '#/definitions/UpdateApplicationUnits'},
++                                                                           'type': 'array'}},
++                                                   'required': ['args'],
++                                                   'type': 'object'},
++                     'UpdateApplicationUnits': {'additionalProperties': False,
++                                                'properties': {'application-tag': {'type': 'string'},
++                                                               'units': {'items': {'$ref': '#/definitions/ApplicationUnitParams'},
++                                                                         'type': 'array'}},
++                                                'required': ['application-tag',
++                                                             'units'],
++                                                'type': 'object'},
++                     'Value': {'additionalProperties': False,
++                               'properties': {'arch': {'type': 'string'},
++                                              'container': {'type': 'string'},
++                                              'cores': {'type': 'integer'},
++                                              'cpu-power': {'type': 'integer'},
++                                              'instance-type': {'type': 'string'},
++                                              'mem': {'type': 'integer'},
++                                              'root-disk': {'type': 'integer'},
++                                              'spaces': {'items': {'type': 'string'},
++                                                         'type': 'array'},
++                                              'tags': {'items': {'type': 'string'},
++                                                       'type': 'array'},
++                                              'virt-type': {'type': 'string'},
++                                              'zones': {'items': {'type': 'string'},
++                                                        'type': 'array'}},
++                               'type': 'object'}},
++     'properties': {'ApplicationsConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                                          'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}},
++                                           'type': 'object'},
++                    'ApplicationsScale': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                                         'Result': {'$ref': '#/definitions/IntResults'}},
++                                          'type': 'object'},
++                    'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                            'Result': {'$ref': '#/definitions/LifeResults'}},
++                             'type': 'object'},
++                    'ProvisioningInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                                        'Result': {'$ref': '#/definitions/KubernetesProvisioningInfoResults'}},
++                                         'type': 'object'},
++                    'SetOperatorStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'},
++                                                         'Result': {'$ref': '#/definitions/ErrorResults'}},
++                                          'type': 'object'},
++                    'UpdateApplicationsService': {'properties': {'Params': {'$ref': '#/definitions/UpdateApplicationServiceArgs'},
++                                                                 'Result': {'$ref': '#/definitions/ErrorResults'}},
++                                                  'type': 'object'},
++                    'UpdateApplicationsUnits': {'properties': {'Params': {'$ref': '#/definitions/UpdateApplicationUnitArgs'},
++                                                               'Result': {'$ref': '#/definitions/ErrorResults'}},
++                                                'type': 'object'},
++                    'WatchApplications': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}},
++                                          'type': 'object'},
++                    'WatchApplicationsScale': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                                              'Result': {'$ref': '#/definitions/NotifyWatchResults'}},
++                                               'type': 'object'},
++                    'WatchPodSpec': {'properties': {'Params': {'$ref': '#/definitions/Entities'},
++                                                    'Result': {'$ref': '#/definitions/NotifyWatchResults'}},
++                                     'type': 'object'}},
++     'type': 'object'}
++
++
++    @ReturnMapping(ApplicationGetConfigResults)
++    async def ApplicationsConfig(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~ConfigResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASUnitProvisioner',
++                   request='ApplicationsConfig',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(IntResults)
++    async def ApplicationsScale(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~IntResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASUnitProvisioner',
++                   request='ApplicationsScale',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(LifeResults)
++    async def Life(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~LifeResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASUnitProvisioner',
++                   request='Life',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(KubernetesProvisioningInfoResults)
++    async def ProvisioningInfo(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~KubernetesProvisioningInfoResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASUnitProvisioner',
++                   request='ProvisioningInfo',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(ErrorResults)
++    async def SetOperatorStatus(self, entities):
++        '''
++        entities : typing.Sequence[~EntityStatusArgs]
++        Returns -> typing.Sequence[~ErrorResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASUnitProvisioner',
++                   request='SetOperatorStatus',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(ErrorResults)
++    async def UpdateApplicationsService(self, args):
++        '''
++        args : typing.Sequence[~UpdateApplicationServiceArg]
++        Returns -> typing.Sequence[~ErrorResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASUnitProvisioner',
++                   request='UpdateApplicationsService',
++                   version=1,
++                   params=_params)
++        _params['args'] = args
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(ErrorResults)
++    async def UpdateApplicationsUnits(self, args):
++        '''
++        args : typing.Sequence[~UpdateApplicationUnits]
++        Returns -> typing.Sequence[~ErrorResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASUnitProvisioner',
++                   request='UpdateApplicationsUnits',
++                   version=1,
++                   params=_params)
++        _params['args'] = args
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(StringsWatchResult)
++    async def WatchApplications(self):
++        '''
++
++        Returns -> typing.Union[typing.Sequence[str], _ForwardRef('Error'), str]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASUnitProvisioner',
++                   request='WatchApplications',
++                   version=1,
++                   params=_params)
++
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(NotifyWatchResults)
++    async def WatchApplicationsScale(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~NotifyWatchResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASUnitProvisioner',
++                   request='WatchApplicationsScale',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++    @ReturnMapping(NotifyWatchResults)
++    async def WatchPodSpec(self, entities):
++        '''
++        entities : typing.Sequence[~Entity]
++        Returns -> typing.Sequence[~NotifyWatchResult]
++        '''
++        # map input types to rpc msg
++        _params = dict()
++        msg = dict(type='CAASUnitProvisioner',
++                   request='WatchPodSpec',
++                   version=1,
++                   params=_params)
++        _params['entities'] = entities
++        reply = await self.rpc(msg)
++        return reply
++
++
++
++class ClientFacade(Type):
++    name = 'Client'
++    version = 1
++    schema =     {'definitions': {'APIHostPortsResult': {'additionalProperties': False,
++                                            'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'},
++                                                                                 'type': 'array'},
++                                                                       'type': 'array'}},
++                                            'required': ['servers'],
++                                            'type': 'object'},
++                     'AddCharm': {'additionalProperties': False,
++                                  'properties': {'channel': {'type': 'string'},
++                                                 'url': {'type': 'string'}},
++                                  'required': ['url', 'channel'],
++                                  'type': 'object'},
++                     'AddCharmWithAuthorization': {'additionalProperties': False,
++                                                   'properties': {'channel': {'type': 'string'},
++                                                                  'macaroon': {'$ref': '#/definitions/Macaroon'},
++                                                                  'url': {'type': 'string'}},
++                                                   'required': ['url',
++                                                                'channel',
++                                                                'macaroon'],
++                                                   'type': 'object'},
++                     'AddMachineParams': {'additionalProperties': False,
++                                          'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'},
++                                                                       'type': 'array'},
++                                                         'constraints': {'$ref': '#/definitions/Value'},
++                                                         'container-type': {'type': 'string'},
++                                                         'disks': {'items': {'$ref': '#/definitions/Constraints'},
++                                                                   'type': 'array'},
++                                                         'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'},
++                                                         'instance-id': {'type': 'string'},
++                                                         'jobs': {'items': {'type': 'string'},
++                                                                  'type': 'array'},
++                                                         'nonce': {'type': 'string'},
++                                                         'parent-id': {'type': 'string'},
++                                                         'placement': {'$ref': '#/definitions/Placement'},
++                                                         'series': {'type': 'string'}},
++                                          'required': ['series',
++                                                       'constraints',
++                                                       'jobs',
++                                                       'parent-id',
++                                                       'container-type',
++                                                       'instance-id',
++                                                       'nonce',
++                                                       'hardware-characteristics',
++                                                       'addresses'],
++                                          'type': 'object'},
++                     'AddMachines': {'additionalProperties': False,
++                                     'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'},
++                                                               'type': 'array'}},
++                                     'required': ['params'],
++                                     'type': 'object'},
++                     'AddMachinesResult': {'additionalProperties': False,
++                                           'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                          'machine': {'type': 'string'}},
++                                           'required': ['machine'],
++                                           'type': 'object'},
++                     'AddMachinesResults': {'additionalProperties': False,
++                                            'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'},
++                                                                        'type': 'array'}},
++                                            'required': ['machines'],
++                                            'type': 'object'},
++                     'Address': {'additionalProperties': False,
++                                 'properties': {'scope': {'type': 'string'},
++                                                'space-name': {'type': 'string'},
++                                                'type': {'type': 'string'},
++                                                'value': {'type': 'string'}},
++                                 'required': ['value', 'type', 'scope'],
++                                 'type': 'object'},
++                     'AgentVersionResult': {'additionalProperties': False,
++                                            'properties': {'version': {'$ref': '#/definitions/Number'}},
++                                            'required': ['version'],
++                                            'type': 'object'},
++                     'AllWatcherId': {'additionalProperties': False,
++                                      'properties': {'watcher-id': {'type': 'string'}},
++                                      'required': ['watcher-id'],
++                                      'type': 'object'},
++                     'ApplicationStatus': {'additionalProperties': False,
++                                           'properties': {'can-upgrade-to': {'type': 'string'},
++                                                          'charm': {'type': 'string'},
++                                                          'err': {'additionalProperties': True,
++                                                                  'type': 'object'},
++                                                          'exposed': {'type': 'boolean'},
++                                                          'life': {'type': 'string'},
++                                                          'meter-statuses': {'patternProperties': {'.*': {'$ref': '#/definitions/MeterStatus'}},
++                                                                             'type': 'object'},
++                                                          'relations': {'patternProperties': {'.*': {'items': {'type': 'string'},
++                                                                                                     'type': 'array'}},
++                                                                        'type': 'object'},
++                                                          'series': {'type': 'string'},
++                                                          'status': {'$ref': '#/definitions/DetailedStatus'},
++                                                          'subordinate-to': {'items': {'type': 'string'},
++                                                                             'type': 'array'},
++                                                          'units': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}},
++                                                                    'type': 'object'},
++                                                          'workload-version': {'type': 'string'}},
++                                           'required': ['charm',
++                                                        'series',
++                                                        'exposed',
++                                                        'life',
++                                                        'relations',
++                                                        'can-upgrade-to',
++                                                        'subordinate-to',
++                                                        'units',
++                                                        'meter-statuses',
++                                                        'status',
++                                                        'workload-version'],
++                                           'type': 'object'},
++                     'Binary': {'additionalProperties': False,
++                                'properties': {'Arch': {'type': 'string'},
++                                               'Number': {'$ref': '#/definitions/Number'},
++                                               'Series': {'type': 'string'}},
++                                'required': ['Number', 'Series', 'Arch'],
++                                'type': 'object'},
++                     'BundleChange': {'additionalProperties': False,
++                                      'properties': {'args': {'items': {'additionalProperties': True,
++                                                                        'type': 'object'},
++                                                              'type': 'array'},
++                                                     'id': {'type': 'string'},
++                                                     'method': {'type': 'string'},
++                                                     'requires': {'items': {'type': 'string'},
++                                                                  'type': 'array'}},
++                                      'required': ['id',
++                                                   'method',
++                                                   'args',
++                                                   'requires'],
++                                      'type': 'object'},
++                     'BundleChangesParams': {'additionalProperties': False,
++                                             'properties': {'yaml': {'type': 'string'}},
++                                             'required': ['yaml'],
++                                             'type': 'object'},
++                     'BundleChangesResults': {'additionalProperties': False,
++                                              'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'},
++                                                                         'type': 'array'},
++                                                             'errors': {'items': {'type': 'string'},
++                                                                        'type': 'array'}},
++                                              'type': 'object'},
++                     'BytesResult': {'additionalProperties': False,
++                                     'properties': {'result': {'items': {'type': 'integer'},
++                                                               'type': 'array'}},
++                                     'required': ['result'],
++                                     'type': 'object'},
++                     'ConfigValue': {'additionalProperties': False,
++                                     'properties': {'source': {'type': 'string'},
++                                                    'value': {'additionalProperties': True,
++                                                              'type': 'object'}},
++                                     'required': ['value', 'source'],
++                                     'type': 'object'},
++                     'Constraints': {'additionalProperties': False,
++                                     'properties': {'Count': {'type': 'integer'},
++                                                    'Pool': {'type': 'string'},
++                                                    'Size': {'type': 'integer'}},
++                                     'required': ['Pool', 'Size', 'Count'],
++                                     'type': 'object'},
++                     'DestroyMachines': {'additionalProperties': False,
++                                         'properties': {'force': {'type': 'boolean'},
++                                                        'machine-names': {'items': {'type': 'string'},
++                                                                          'type': 'array'}},
++                                         'required': ['machine-names', 'force'],
++                                         'type': 'object'},
++                     'DetailedStatus': {'additionalProperties': False,
++                                        'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True,
++                                                                                             'type': 'object'}},
++                                                                'type': 'object'},
++                                                       'err': {'additionalProperties': True,
++                                                               'type': 'object'},
++                                                       'info': {'type': 'string'},
++                                                       'kind': {'type': 'string'},
++                                                       'life': {'type': 'string'},
++                                                       'since': {'format': 'date-time',
++                                                                 'type': 'string'},
++                                                       'status': {'type': 'string'},
++                                                       'version': {'type': 'string'}},
++                                        'required': ['status',
++                                                     'info',
++                                                     'data',
++                                                     'since',
++                                                     'kind',
++                                                     'version',
++                                                     'life'],
++                                        'type': 'object'},
++                     'EndpointStatus': {'additionalProperties': False,
++                                        'properties': {'application': {'type': 'string'},
++                                                       'name': {'type': 'string'},
++                                                       'role': {'type': 'string'},
++                                                       'subordinate': {'type': 'boolean'}},
++                                        'required': ['application',
++                                                     'name',
++                                                     'role',
++                                                     'subordinate'],
++                                        'type': 'object'},
++                     'Entities': {'additionalProperties': False,
++                                  'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'},
++                                                              'type': 'array'}},
++                                  'required': ['entities'],
++                                  'type': 'object'},
++                     'Entity': {'additionalProperties': False,
++                                'properties': {'tag': {'type': 'string'}},
++                                'required': ['tag'],
++                                'type': 'object'},
++                     'EntityStatus': {'additionalProperties': False,
++                                      'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True,
++                                                                                           'type': 'object'}},
++                                                              'type': 'object'},
++                                                     'info': {'type': 'string'},
++                                                     'since': {'format': 'date-time',
++                                                               'type': 'string'},
++                                                     'status': {'type': 'string'}},
++                                      'required': ['status', 'info', 'since'],
++                                      'type': 'object'},
++                     'Error': {'additionalProperties': False,
++                               'properties': {'code': {'type': 'string'},
++                                              'info': {'$ref': '#/definitions/ErrorInfo'},
++                                              'message': {'type': 'string'}},
++                               'required': ['message', 'code'],
++                               'type': 'object'},
++                     'ErrorInfo': {'additionalProperties': False,
++                                   'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'},
++                                                  'macaroon-path': {'type': 'string'}},
++                                   'type': 'object'},
++                     'ErrorResult': {'additionalProperties': False,
++                                     'properties': {'error': {'$ref': '#/definitions/Error'}},
++                                     'type': 'object'},
++                     'ErrorResults': {'additionalProperties': False,
++                                      'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'},
++                                                                 'type': 'array'}},
++                                      'required': ['results'],
++                                      'type': 'object'},
++                     'FindToolsParams': {'additionalProperties': False,
++                                         'properties': {'arch': {'type': 'string'},
++                                                        'major': {'type': 'integer'},
++                                                        'minor': {'type': 'integer'},
++                                                        'number': {'$ref': '#/definitions/Number'},
++                                                        'series': {'type': 'string'}},
++                                         'required': ['number',
++                                                      'major',
++                                                      'minor',
++                                                      'arch',
++                                                      'series'],
++                                         'type': 'object'},
++                     'FindToolsResult': {'additionalProperties': False,
++                                         'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                        'list': {'items': {'$ref': '#/definitions/Tools'},
++                                                                 'type': 'array'}},
++                                         'required': ['list'],
++                                         'type': 'object'},
++                     'FullStatus': {'additionalProperties': False,
++                                    'properties': {'applications': {'patternProperties': {'.*': {'$ref': '#/definitions/ApplicationStatus'}},
++                                                                    'type': 'object'},
++                                                   'machines': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}},
++                                                                'type': 'object'},
++                                                   'model': {'$ref': '#/definitions/ModelStatusInfo'},
++                                                   'relations': {'items': {'$ref': '#/definitions/RelationStatus'},
++                                                                 'type': 'array'},
++                                                   'remote-applications': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteApplicationStatus'}},
++                                                                           'type': 'object'}},
++                                    'required': ['model',
++                                                 'machines',
++                                                 'applications',
++                                                 'remote-applications',
++                                                 'relations'],
++                                    'type': 'object'},
++                     'GetConstraintsResults': {'additionalProperties': False,
++                                               'properties': {'constraints': {'$ref': '#/definitions/Value'}},
++                                               'required': ['constraints'],
++                                               'type': 'object'},
++                     'HardwareCharacteristics': {'additionalProperties': False,
++                                                 'properties': {'arch': {'type': 'string'},
++                                                                'availability-zone': {'type': 'string'},
++                                                                'cpu-cores': {'type': 'integer'},
++                                                                'cpu-power': {'type': 'integer'},
++                                                                'mem': {'type': 'integer'},
++                                                                'root-disk': {'type': 'integer'},
++                                                                'tags': {'items': {'type': 'string'},
++                                                                         'type': 'array'}},
++                                                 'type': 'object'},
++                     'History': {'additionalProperties': False,
++                                 'properties': {'error': {'$ref': '#/definitions/Error'},
++                                                'statuses': {'items': {'$ref': '#/definitions/DetailedStatus'},
++                                                             'type': 'array'}},
++                                 'required': ['statuses'],
++                                 'type': 'object'},
++                     'HostPort': {'additionalProperties': False,
++                                  'properties': {'Address': {'$ref': '#/definitions/Address'},
++                                                 'port': {'type': 'integer'}},
++                                  'required': ['Address', 'port'],
++                                  'type': 'object'},
++                     'Macaroon': {'additionalProperties': False, 'type': 'object'},
++                     'MachineHardware': {'additionalProperties': False,
++                                         'properties': {'arch': {'type': 'string'},
++                                                        'availability-zone': {'type': 'string'},
++                                                        'cores': {'type': 'integer'},
++                                                        'cpu-power': {'type': 'integer'},
++                                                        'mem': {'type': 'integer'},
++                                                        'root-disk': {'type': 'integer'},
++                                                        'tags': {'items': {'type': 'string'},
++                                                                 'type': 'array'}},
++                                         'type': 'object'},
++                     'MachineStatus': {'additionalProperties': False,
++                                       'properties': {'agent-status': {'$ref': '#/definitions/DetailedStatus'},
++                                                      'constraints': {'type': 'string'},
++                                                      'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}},
++                                                                     'type': 'object'},
++                                                      'dns-name': {'type': 'string'},
++                                                      'hardware': {'type': 'string'},
++                                                      'has-vote': {'type': 'boolean'},
++                                                      'id': {'type': 'string'},
++                                                      'instance-id': {'type': 'string'},
++                                                      'instance-status': {'$ref': '#/definitions/DetailedStatus'},
++                                                      'ip-addresses': {'items': {'type': 'string'},
++                                                                       'type': 'array'},
++                                                      'jobs': {'items': {'type': 'string'},
++                                                               'type': 'array'},
++                                                      'network-interfaces': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInterface'}},
++                                                                             'type': 'object'},
++                                                      'series': {'type': 'string'},
++                                                      'wants-vote': {'type': 'boolean'}},
++                                       'required': ['agent-status',
++                                                    'instance-status',
++                                                    'dns-name',
++                                                    'instance-id',
++                                                    'series',
++                                                    'id',
++                                                    'containers',
++                                                    'constraints',
++                                                    'hardware',
++                                                    'jobs',
++                                                    'has-vote',
++                                                    'wants-vote'],
++                                       'type': 'object'},
++                     'MeterStatus': {'additionalProperties': False,
++                                     'properties': {'color': {'type': 'string'},
++                                                    'message': {'type': 'string'}},
++                                     'required': ['color', 'message'],
++                                     'type': 'object'},
++                     'ModelConfigResults': {'additionalProperties': False,
++                                            'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}},
++                                                                      'type': 'object'}},
++                                            'required': ['config'],
++                                            'type': 'object'},
++                     'ModelInfo': {'additionalProperties': False,
++                                   'properties': {'agent-version': {'$ref': '#/definitions/Number'},
++                                                  'cloud-credential-tag': {'type': 'string'},
++                                                  'cloud-region': {'type': 'string'},
++                                                  'cloud-tag': {'type': 'string'},
++                                                  'controller-uuid': {'type': 'string'},
++                                                  'default-series': {'type': 'string'},
++                                                  'life': {'type': 'string'},
++                                                  'machines': {'items': {'$ref': '#/definitions/ModelMachineInfo'},
++                                                               'type': 'array'},
++                                                  'migration': {'$ref': '#/definitions/ModelMigrationStatus'},
++                                                  'name': {'type': 'string'},
++                                                  'owner-tag': {'type': 'string'},
++                                                  'provider-type': {'type': 'string'},
++                                                  'sla': {'$ref': '#/definitions/ModelSLAInfo'},
++                                                  'status': {'$ref': '#/definitions/EntityStatus'},
++                                                  'users': {'items': {'$ref': '#/definitions/ModelUserInfo'},
++                                                            'type': 'array'},
++                                                  'uuid': {'type': 'string'}},
++                                   'required': ['name',
++                                                'uuid',
++                                                'controller-uuid',
++                                                'cloud-tag',
++                                                'owner-tag',
++                                                'life',
++                                                'users',
++                                                'machines',
++                                                'sla',
++                                                'agent-version'],
++                                   'type': 'object'},
++                     'ModelMachineInfo': {'additionalProperties': False,
++                                          'properties': {'hardware': {'$ref': '#/definitions/MachineHardware'},
++                                                         'has-vote': {'type': 'boolean'},
++                                                         'id': {'type': 'string'},
++                                                         'instance-id': {'type': 'string'},
++                                                         'status': {'type': 'string'},
++                                                         'wants-vote': {'type': 'boolean'}},
++                                          'required': ['id'],
++                                          'type': 'object'},
++                     'ModelMigrationStatus': {'additionalProperties': False,
++                                              'properties': {'end': {'format': 'date-time',
++                                                                     'type': &