From 9d18c22a0dc9e295adda50601fc5e2f45d2c9b8a Mon Sep 17 00:00:00 2001 From: Adam Israel Date: Thu, 7 Nov 2019 10:38:12 -0500 Subject: [PATCH] Remove vendored libjuju This removes the vendored libjuju, in favour of using the upstream version. Change-Id: I4da23f04fad665502951a70653b894c82349bad3 Signed-off-by: Adam Israel --- Jenkinsfile | 15 + juju | 1 - modules/libjuju/.gitignore | 15 - modules/libjuju/.travis.yml | 48 - modules/libjuju/CONTRIBUTORS | 4 - modules/libjuju/LICENSE | 201 - modules/libjuju/MANIFEST.in | 5 - modules/libjuju/Makefile | 46 - modules/libjuju/TODO | 5 - modules/libjuju/VERSION | 1 - modules/libjuju/docs/Makefile | 230 - .../docs/_extensions/automembersummary.py | 112 - modules/libjuju/docs/_static/custom.css | 5 - modules/libjuju/docs/api/juju.action.rst | 13 - modules/libjuju/docs/api/juju.annotation.rst | 13 - modules/libjuju/docs/api/juju.application.rst | 13 - modules/libjuju/docs/api/juju.client.rst | 120 - modules/libjuju/docs/api/juju.cloud.rst | 13 - modules/libjuju/docs/api/juju.constraints.rst | 13 - modules/libjuju/docs/api/juju.controller.rst | 13 - modules/libjuju/docs/api/juju.delta.rst | 13 - modules/libjuju/docs/api/juju.errors.rst | 13 - modules/libjuju/docs/api/juju.exceptions.rst | 13 - modules/libjuju/docs/api/juju.juju.rst | 13 - modules/libjuju/docs/api/juju.loop.rst | 13 - modules/libjuju/docs/api/juju.machine.rst | 13 - modules/libjuju/docs/api/juju.model.rst | 13 - modules/libjuju/docs/api/juju.placement.rst | 13 - modules/libjuju/docs/api/juju.relation.rst | 13 - modules/libjuju/docs/api/juju.tag.rst | 13 - modules/libjuju/docs/api/juju.unit.rst | 13 - modules/libjuju/docs/api/juju.utils.rst | 13 - modules/libjuju/docs/api/modules.rst | 31 - modules/libjuju/docs/changelog.rst | 290 - modules/libjuju/docs/conf.py | 303 - modules/libjuju/docs/index.rst | 45 - .../libjuju/docs/narrative/application.rst | 136 - modules/libjuju/docs/narrative/controller.rst | 92 - modules/libjuju/docs/narrative/index.rst | 10 - modules/libjuju/docs/narrative/model.rst | 290 - modules/libjuju/docs/narrative/unit.rst | 65 - modules/libjuju/docs/readme.rst | 103 - modules/libjuju/docs/requirements.txt | 5 - .../libjuju/docs/upstream-updates/index.rst | 114 - modules/libjuju/examples/action.py | 49 - modules/libjuju/examples/add_machine.py | 70 - modules/libjuju/examples/add_model.py | 67 - modules/libjuju/examples/allwatcher.py | 31 - modules/libjuju/examples/config.py | 54 - .../libjuju/examples/connect_current_model.py | 27 - modules/libjuju/examples/controller.py | 41 - modules/libjuju/examples/credential.py | 47 - modules/libjuju/examples/deploy.py | 41 - modules/libjuju/examples/fullstatus.py | 23 - modules/libjuju/examples/future.py | 47 - modules/libjuju/examples/leadership.py | 28 - modules/libjuju/examples/livemodel.py | 31 - modules/libjuju/examples/localcharm.py | 34 - modules/libjuju/examples/relate.py | 102 - modules/libjuju/examples/unitrun.py | 46 - modules/libjuju/juju/__init__.py | 0 modules/libjuju/juju/action.py | 10 - modules/libjuju/juju/annotation.py | 9 - modules/libjuju/juju/application.py | 533 - modules/libjuju/juju/client/__init__.py | 0 modules/libjuju/juju/client/_client.py | 454 - modules/libjuju/juju/client/_client1.py | 11068 ----- modules/libjuju/juju/client/_client2.py | 7535 ---- modules/libjuju/juju/client/_client3.py | 6749 --- modules/libjuju/juju/client/_client4.py | 4626 -- modules/libjuju/juju/client/_client5.py | 5322 --- modules/libjuju/juju/client/_client7.py | 1770 - modules/libjuju/juju/client/_client8.py | 1278 - modules/libjuju/juju/client/_client9.py | 2385 - modules/libjuju/juju/client/_definitions.py | 11058 ----- modules/libjuju/juju/client/client.py | 33 - modules/libjuju/juju/client/codegen.py | 52 - modules/libjuju/juju/client/connection.py | 601 - modules/libjuju/juju/client/connector.py | 156 - modules/libjuju/juju/client/facade.py | 818 - modules/libjuju/juju/client/gocookies.py | 102 - modules/libjuju/juju/client/jujudata.py | 219 - modules/libjuju/juju/client/overrides.py | 365 - modules/libjuju/juju/client/runner.py | 21 - .../juju/client/schemas-juju-2.0.0.json | 24533 ---------- .../juju/client/schemas-juju-2.0.1.json | 24799 ----------- .../juju/client/schemas-juju-2.0.2.json | 24799 ----------- .../juju/client/schemas-juju-2.0.3.json | 24799 ----------- .../juju/client/schemas-juju-2.1.0.json | 25652 ----------- .../juju/client/schemas-juju-2.1.1.json | 25730 ----------- .../juju/client/schemas-juju-2.1.2.json | 25730 ----------- .../juju/client/schemas-juju-2.2-alpha1.json | 25974 ----------- .../juju/client/schemas-juju-2.2-beta1.json | 26135 ----------- .../juju/client/schemas-juju-2.2-beta2.json | 26150 ----------- .../juju/client/schemas-juju-2.2-rc1.json | 26295 ----------- .../juju/client/schemas-juju-2.3-alpha1.json | 26050 ----------- .../juju/client/schemas-juju-2.5-rc1.json | 37036 ---------------- modules/libjuju/juju/cloud.py | 81 - modules/libjuju/juju/constraints.py | 87 - modules/libjuju/juju/controller.py | 653 - modules/libjuju/juju/credential.py | 0 modules/libjuju/juju/delta.py | 79 - modules/libjuju/juju/errors.py | 49 - modules/libjuju/juju/exceptions.py | 2 - modules/libjuju/juju/juju.py | 118 - modules/libjuju/juju/loop.py | 42 - modules/libjuju/juju/machine.py | 284 - modules/libjuju/juju/model.py | 2328 - modules/libjuju/juju/placement.py | 58 - modules/libjuju/juju/provisioner.py | 369 - modules/libjuju/juju/relation.py | 123 - modules/libjuju/juju/tag.py | 40 - modules/libjuju/juju/unit.py | 281 - modules/libjuju/juju/user.py | 86 - modules/libjuju/juju/utils.py | 165 - modules/libjuju/scripts/gendoc | 39 - modules/libjuju/setup.py | 61 - modules/libjuju/tests/__init__.py | 0 modules/libjuju/tests/base.py | 148 - modules/libjuju/tests/bundle/bundle.yaml | 28 - modules/libjuju/tests/bundle/invalid.yaml | 7 - modules/libjuju/tests/bundle/mini-bundle.yaml | 9 - modules/libjuju/tests/charm/metadata.yaml | 5 - modules/libjuju/tests/integration/__init__.py | 0 .../bundle/bundle-resource-rev.yaml | 7 - .../tests/integration/bundle/bundle.yaml | 12 - modules/libjuju/tests/integration/cert.pem | 33 - .../tests/integration/charm/metadata.yaml | 5 - modules/libjuju/tests/integration/key.pem | 52 - .../tests/integration/test_application.py | 134 - .../libjuju/tests/integration/test_client.py | 21 - .../tests/integration/test_connection.py | 236 - .../tests/integration/test_controller.py | 228 - .../libjuju/tests/integration/test_errors.py | 68 - .../tests/integration/test_macaroon_auth.py | 108 - .../libjuju/tests/integration/test_machine.py | 65 - .../libjuju/tests/integration/test_model.py | 485 - .../libjuju/tests/integration/test_unit.py | 99 - modules/libjuju/tests/unit/__init__.py | 0 modules/libjuju/tests/unit/test_client.py | 26 - modules/libjuju/tests/unit/test_connection.py | 65 - .../libjuju/tests/unit/test_constraints.py | 57 - modules/libjuju/tests/unit/test_controller.py | 140 - modules/libjuju/tests/unit/test_gocookies.py | 244 - modules/libjuju/tests/unit/test_loop.py | 32 - modules/libjuju/tests/unit/test_model.py | 264 - modules/libjuju/tests/unit/test_overrides.py | 76 - modules/libjuju/tests/unit/test_placement.py | 20 - .../tests/unit/test_registration_string.py | 18 - modules/libjuju/tox.ini | 66 - 150 files changed, 15 insertions(+), 409798 deletions(-) delete mode 120000 juju delete mode 100644 modules/libjuju/.gitignore delete mode 100644 modules/libjuju/.travis.yml delete mode 100644 modules/libjuju/CONTRIBUTORS delete mode 100644 modules/libjuju/LICENSE delete mode 100644 modules/libjuju/MANIFEST.in delete mode 100644 modules/libjuju/Makefile delete mode 100644 modules/libjuju/TODO delete mode 100644 modules/libjuju/VERSION delete mode 100644 modules/libjuju/docs/Makefile delete mode 100644 modules/libjuju/docs/_extensions/automembersummary.py delete mode 100644 modules/libjuju/docs/_static/custom.css delete mode 100644 modules/libjuju/docs/api/juju.action.rst delete mode 100644 modules/libjuju/docs/api/juju.annotation.rst delete mode 100644 modules/libjuju/docs/api/juju.application.rst delete mode 100644 modules/libjuju/docs/api/juju.client.rst delete mode 100644 modules/libjuju/docs/api/juju.cloud.rst delete mode 100644 modules/libjuju/docs/api/juju.constraints.rst delete mode 100644 modules/libjuju/docs/api/juju.controller.rst delete mode 100644 modules/libjuju/docs/api/juju.delta.rst delete mode 100644 modules/libjuju/docs/api/juju.errors.rst delete mode 100644 modules/libjuju/docs/api/juju.exceptions.rst delete mode 100644 modules/libjuju/docs/api/juju.juju.rst delete mode 100644 modules/libjuju/docs/api/juju.loop.rst delete mode 100644 modules/libjuju/docs/api/juju.machine.rst delete mode 100644 modules/libjuju/docs/api/juju.model.rst delete mode 100644 modules/libjuju/docs/api/juju.placement.rst delete mode 100644 modules/libjuju/docs/api/juju.relation.rst delete mode 100644 modules/libjuju/docs/api/juju.tag.rst delete mode 100644 modules/libjuju/docs/api/juju.unit.rst delete mode 100644 modules/libjuju/docs/api/juju.utils.rst delete mode 100644 modules/libjuju/docs/api/modules.rst delete mode 100644 modules/libjuju/docs/changelog.rst delete mode 100644 modules/libjuju/docs/conf.py delete mode 100644 modules/libjuju/docs/index.rst delete mode 100644 modules/libjuju/docs/narrative/application.rst delete mode 100644 modules/libjuju/docs/narrative/controller.rst delete mode 100644 modules/libjuju/docs/narrative/index.rst delete mode 100644 modules/libjuju/docs/narrative/model.rst delete mode 100644 modules/libjuju/docs/narrative/unit.rst delete mode 100644 modules/libjuju/docs/readme.rst delete mode 100644 modules/libjuju/docs/requirements.txt delete mode 100644 modules/libjuju/docs/upstream-updates/index.rst delete mode 100644 modules/libjuju/examples/action.py delete mode 100755 modules/libjuju/examples/add_machine.py delete mode 100644 modules/libjuju/examples/add_model.py delete mode 100644 modules/libjuju/examples/allwatcher.py delete mode 100644 modules/libjuju/examples/config.py delete mode 100644 modules/libjuju/examples/connect_current_model.py delete mode 100644 modules/libjuju/examples/controller.py delete mode 100644 modules/libjuju/examples/credential.py delete mode 100644 modules/libjuju/examples/deploy.py delete mode 100644 modules/libjuju/examples/fullstatus.py delete mode 100644 modules/libjuju/examples/future.py delete mode 100644 modules/libjuju/examples/leadership.py delete mode 100644 modules/libjuju/examples/livemodel.py delete mode 100644 modules/libjuju/examples/localcharm.py delete mode 100644 modules/libjuju/examples/relate.py delete mode 100644 modules/libjuju/examples/unitrun.py delete mode 100644 modules/libjuju/juju/__init__.py delete mode 100644 modules/libjuju/juju/action.py delete mode 100644 modules/libjuju/juju/annotation.py delete mode 100644 modules/libjuju/juju/application.py delete mode 100644 modules/libjuju/juju/client/__init__.py delete mode 100644 modules/libjuju/juju/client/_client.py delete mode 100644 modules/libjuju/juju/client/_client1.py delete mode 100644 modules/libjuju/juju/client/_client2.py delete mode 100644 modules/libjuju/juju/client/_client3.py delete mode 100644 modules/libjuju/juju/client/_client4.py delete mode 100644 modules/libjuju/juju/client/_client5.py delete mode 100644 modules/libjuju/juju/client/_client7.py delete mode 100644 modules/libjuju/juju/client/_client8.py delete mode 100644 modules/libjuju/juju/client/_client9.py delete mode 100644 modules/libjuju/juju/client/_definitions.py delete mode 100644 modules/libjuju/juju/client/client.py delete mode 100644 modules/libjuju/juju/client/codegen.py delete mode 100644 modules/libjuju/juju/client/connection.py delete mode 100644 modules/libjuju/juju/client/connector.py delete mode 100644 modules/libjuju/juju/client/facade.py delete mode 100644 modules/libjuju/juju/client/gocookies.py delete mode 100644 modules/libjuju/juju/client/jujudata.py delete mode 100644 modules/libjuju/juju/client/overrides.py delete mode 100644 modules/libjuju/juju/client/runner.py delete mode 100644 modules/libjuju/juju/client/schemas-juju-2.0.0.json delete mode 100644 modules/libjuju/juju/client/schemas-juju-2.0.1.json delete mode 100644 modules/libjuju/juju/client/schemas-juju-2.0.2.json delete mode 100644 modules/libjuju/juju/client/schemas-juju-2.0.3.json delete mode 100644 modules/libjuju/juju/client/schemas-juju-2.1.0.json delete mode 100644 modules/libjuju/juju/client/schemas-juju-2.1.1.json delete mode 100644 modules/libjuju/juju/client/schemas-juju-2.1.2.json delete mode 100644 modules/libjuju/juju/client/schemas-juju-2.2-alpha1.json delete mode 100644 modules/libjuju/juju/client/schemas-juju-2.2-beta1.json delete mode 100644 modules/libjuju/juju/client/schemas-juju-2.2-beta2.json delete mode 100644 modules/libjuju/juju/client/schemas-juju-2.2-rc1.json delete mode 100644 modules/libjuju/juju/client/schemas-juju-2.3-alpha1.json delete mode 100644 modules/libjuju/juju/client/schemas-juju-2.5-rc1.json delete mode 100644 modules/libjuju/juju/cloud.py delete mode 100644 modules/libjuju/juju/constraints.py delete mode 100644 modules/libjuju/juju/controller.py delete mode 100644 modules/libjuju/juju/credential.py delete mode 100644 modules/libjuju/juju/delta.py delete mode 100644 modules/libjuju/juju/errors.py delete mode 100644 modules/libjuju/juju/exceptions.py delete mode 100644 modules/libjuju/juju/juju.py delete mode 100644 modules/libjuju/juju/loop.py delete mode 100644 modules/libjuju/juju/machine.py delete mode 100644 modules/libjuju/juju/model.py delete mode 100644 modules/libjuju/juju/placement.py delete mode 100644 modules/libjuju/juju/provisioner.py delete mode 100644 modules/libjuju/juju/relation.py delete mode 100644 modules/libjuju/juju/tag.py delete mode 100644 modules/libjuju/juju/unit.py delete mode 100644 modules/libjuju/juju/user.py delete mode 100644 modules/libjuju/juju/utils.py delete mode 100755 modules/libjuju/scripts/gendoc delete mode 100644 modules/libjuju/setup.py delete mode 100644 modules/libjuju/tests/__init__.py delete mode 100644 modules/libjuju/tests/base.py delete mode 100644 modules/libjuju/tests/bundle/bundle.yaml delete mode 100644 modules/libjuju/tests/bundle/invalid.yaml delete mode 100644 modules/libjuju/tests/bundle/mini-bundle.yaml delete mode 100644 modules/libjuju/tests/charm/metadata.yaml delete mode 100644 modules/libjuju/tests/integration/__init__.py delete mode 100644 modules/libjuju/tests/integration/bundle/bundle-resource-rev.yaml delete mode 100644 modules/libjuju/tests/integration/bundle/bundle.yaml delete mode 100644 modules/libjuju/tests/integration/cert.pem delete mode 100644 modules/libjuju/tests/integration/charm/metadata.yaml delete mode 100644 modules/libjuju/tests/integration/key.pem delete mode 100644 modules/libjuju/tests/integration/test_application.py delete mode 100644 modules/libjuju/tests/integration/test_client.py delete mode 100644 modules/libjuju/tests/integration/test_connection.py delete mode 100644 modules/libjuju/tests/integration/test_controller.py delete mode 100644 modules/libjuju/tests/integration/test_errors.py delete mode 100644 modules/libjuju/tests/integration/test_macaroon_auth.py delete mode 100644 modules/libjuju/tests/integration/test_machine.py delete mode 100644 modules/libjuju/tests/integration/test_model.py delete mode 100644 modules/libjuju/tests/integration/test_unit.py delete mode 100644 modules/libjuju/tests/unit/__init__.py delete mode 100644 modules/libjuju/tests/unit/test_client.py delete mode 100644 modules/libjuju/tests/unit/test_connection.py delete mode 100644 modules/libjuju/tests/unit/test_constraints.py delete mode 100644 modules/libjuju/tests/unit/test_controller.py delete mode 100644 modules/libjuju/tests/unit/test_gocookies.py delete mode 100644 modules/libjuju/tests/unit/test_loop.py delete mode 100644 modules/libjuju/tests/unit/test_model.py delete mode 100644 modules/libjuju/tests/unit/test_overrides.py delete mode 100644 modules/libjuju/tests/unit/test_placement.py delete mode 100644 modules/libjuju/tests/unit/test_registration_string.py delete mode 100644 modules/libjuju/tox.ini diff --git a/Jenkinsfile b/Jenkinsfile index ed9e879..e384cbd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,18 @@ +/* + 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. +*/ + properties([ parameters([ string(defaultValue: env.BRANCH_NAME, description: '', name: 'GERRIT_BRANCH'), diff --git a/juju b/juju deleted file mode 120000 index 1d37c18..0000000 --- a/juju +++ /dev/null @@ -1 +0,0 @@ -modules/libjuju/juju \ No newline at end of file diff --git a/modules/libjuju/.gitignore b/modules/libjuju/.gitignore deleted file mode 100644 index 6d00fec..0000000 --- a/modules/libjuju/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -*.sw[mnop] -.venv/ -*.pyc -*.py~ -docs/_build/ -__pycache__/ -.tox/ -*.egg-info/ -.cache/ -.\#* -dist/ -dev/ -.pytest_cache -pytestdebug.log -.vscode/ diff --git a/modules/libjuju/.travis.yml b/modules/libjuju/.travis.yml deleted file mode 100644 index 5edfef5..0000000 --- a/modules/libjuju/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -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="}}' - 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: - # Run lint before performing more expensive operations (fail fast/early) - - tox -e lint - - # 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 - - # 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 diff --git a/modules/libjuju/CONTRIBUTORS b/modules/libjuju/CONTRIBUTORS deleted file mode 100644 index 3895eaa..0000000 --- a/modules/libjuju/CONTRIBUTORS +++ /dev/null @@ -1,4 +0,0 @@ -Benjamin Saller -Tim Van Steenburgh -Cory Johns -Pete VanderGiessen diff --git a/modules/libjuju/LICENSE b/modules/libjuju/LICENSE deleted file mode 100644 index 8dada3e..0000000 --- a/modules/libjuju/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - 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. diff --git a/modules/libjuju/MANIFEST.in b/modules/libjuju/MANIFEST.in deleted file mode 100644 index c14d3fc..0000000 --- a/modules/libjuju/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include *.py CONTRIBUTORS LICENSE README.rst VERSION -recursive-include juju *.py -recursive-include examples *.py -recursive-include docs *.rst -exclude Makefile diff --git a/modules/libjuju/Makefile b/modules/libjuju/Makefile deleted file mode 100644 index 38dcc11..0000000 --- a/modules/libjuju/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -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 - -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 diff --git a/modules/libjuju/TODO b/modules/libjuju/TODO deleted file mode 100644 index 94fc342..0000000 --- a/modules/libjuju/TODO +++ /dev/null @@ -1,5 +0,0 @@ -TODO -==== - -- Add a LogWatcher coroutine that yields from debug-log api -- Add a way to exit the event loop when a Model matches a bundle yaml diff --git a/modules/libjuju/VERSION b/modules/libjuju/VERSION deleted file mode 100644 index 1a96df1..0000000 --- a/modules/libjuju/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.11.3 diff --git a/modules/libjuju/docs/Makefile b/modules/libjuju/docs/Makefile deleted file mode 100644 index 2869eb4..0000000 --- a/modules/libjuju/docs/Makefile +++ /dev/null @@ -1,230 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) - $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from http://sphinx-doc.org/) -endif - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " applehelp to make an Apple Help Book" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " epub3 to make an epub3" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - @echo " coverage to run coverage check of the documentation (if enabled)" - @echo " dummy to check syntax errors of document sources" - -.PHONY: clean -clean: - rm -rf $(BUILDDIR)/* - -.PHONY: html -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -.PHONY: dirhtml -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -.PHONY: singlehtml -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -.PHONY: pickle -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -.PHONY: json -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -.PHONY: htmlhelp -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -.PHONY: qthelp -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/libjuju.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/libjuju.qhc" - -.PHONY: applehelp -applehelp: - $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp - @echo - @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." - @echo "N.B. You won't be able to view it unless you put it in" \ - "~/Library/Documentation/Help or install it in your application" \ - "bundle." - -.PHONY: devhelp -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/libjuju" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/libjuju" - @echo "# devhelp" - -.PHONY: epub -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -.PHONY: epub3 -epub3: - $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 - @echo - @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." - -.PHONY: latex -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -.PHONY: latexpdf -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -.PHONY: latexpdfja -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -.PHONY: text -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -.PHONY: man -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -.PHONY: texinfo -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -.PHONY: info -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -.PHONY: gettext -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -.PHONY: changes -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -.PHONY: linkcheck -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -.PHONY: doctest -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -.PHONY: coverage -coverage: - $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage - @echo "Testing of coverage in the sources finished, look at the " \ - "results in $(BUILDDIR)/coverage/python.txt." - -.PHONY: xml -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -.PHONY: pseudoxml -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." - -.PHONY: dummy -dummy: - $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy - @echo - @echo "Build finished. Dummy builder generates no files." diff --git a/modules/libjuju/docs/_extensions/automembersummary.py b/modules/libjuju/docs/_extensions/automembersummary.py deleted file mode 100644 index cfe0b84..0000000 --- a/modules/libjuju/docs/_extensions/automembersummary.py +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright 2014-2015 Canonical Limited. -# -# 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 importlib -import inspect -import textwrap - -from docutils import nodes -from docutils.statemachine import ViewList -from sphinx.errors import SphinxError -from sphinx.util.compat import Directive -from sphinx.util.nodes import nested_parse_with_titles - - -class AutoMemberSummary(Directive): - required_arguments = 1 - - def run(self): - module_name = self.arguments[0] - - try: - module = importlib.import_module(module_name) - except ImportError: - raise SphinxError("Unable to generate reference docs for %s, " - "could not import" % (module_name)) - - divider = '+{:-<80}+'.format('') - row = '| {:<78} |'.format - lines = [] - for member_name, member in inspect.getmembers(module): - if not self._filter(module_name, member_name, member): - continue - summary = textwrap.wrap(self._get_summary(member), 78) or [''] - link = '`{} <#{}>`_'.format(member_name, - '.'.join([module_name, - member_name])) - methods = ['* `{} <#{}>`_'.format(n, - '.'.join([module_name, - member_name, - n])) - for n, m in inspect.getmembers(member) - if not n.startswith('_') and inspect.isfunction(m)] - - lines.append(divider) - lines.append(row(link)) - lines.append(divider) - for line in summary: - lines.append(row(line)) - if methods: - lines.append(row('')) - lines.append(row('Methods:')) - lines.append(row('')) - for i, method in enumerate(methods): - lines.append(row(method)) - lines.append(divider) - content = '\n'.join(lines) - - result = self._parse(content, '') - return result - - def _get_summary(self, member): - doc = (member.__doc__ or '').splitlines() - - # strip any leading blank lines - while doc and not doc[0].strip(): - doc.pop(0) - - # strip anything after the first blank line - for i, piece in enumerate(doc): - if not piece.strip(): - doc = doc[:i] - break - - return " ".join(doc).strip() - - def _filter(self, module_name, member_name, member): - if member_name.startswith('_'): - return False - if hasattr(member, '__module__'): - # skip imported classes & functions - return member.__module__.startswith(module_name) - elif hasattr(member, '__name__'): - # skip imported modules - return member.__name__.startswith(module_name) - else: - return False # skip instances - return True - - def _parse(self, rst_text, annotation): - result = ViewList() - for line in rst_text.split("\n"): - result.append(line, annotation) - node = nodes.paragraph() - node.document = self.state.document - nested_parse_with_titles(self.state, result, node) - return node.children - - -def setup(app): - app.add_directive('automembersummary', AutoMemberSummary) diff --git a/modules/libjuju/docs/_static/custom.css b/modules/libjuju/docs/_static/custom.css deleted file mode 100644 index 333cd74..0000000 --- a/modules/libjuju/docs/_static/custom.css +++ /dev/null @@ -1,5 +0,0 @@ -.wy-table-responsive table td, -.wy-table-responsive table th -{ - white-space: normal !important; -} diff --git a/modules/libjuju/docs/api/juju.action.rst b/modules/libjuju/docs/api/juju.action.rst deleted file mode 100644 index cc86af2..0000000 --- a/modules/libjuju/docs/api/juju.action.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.action -=========== - -.. rubric:: Summary - -.. automembersummary:: juju.action - -.. rubric:: Reference - -.. automodule:: juju.action - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.annotation.rst b/modules/libjuju/docs/api/juju.annotation.rst deleted file mode 100644 index ec31344..0000000 --- a/modules/libjuju/docs/api/juju.annotation.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.annotation -=============== - -.. rubric:: Summary - -.. automembersummary:: juju.annotation - -.. rubric:: Reference - -.. automodule:: juju.annotation - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.application.rst b/modules/libjuju/docs/api/juju.application.rst deleted file mode 100644 index dba9177..0000000 --- a/modules/libjuju/docs/api/juju.application.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.application -================ - -.. rubric:: Summary - -.. automembersummary:: juju.application - -.. rubric:: Reference - -.. automodule:: juju.application - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.client.rst b/modules/libjuju/docs/api/juju.client.rst deleted file mode 100644 index dad691f..0000000 --- a/modules/libjuju/docs/api/juju.client.rst +++ /dev/null @@ -1,120 +0,0 @@ -Internal APIs -============= - -These packages are for internal use in communicating with the low-level -API. You should use the object oriented API instead. They are documented -here for developer reference. - - -juju\.client\.client module ---------------------------- - -.. automodule:: juju.client.client - :members: - :undoc-members: - :show-inheritance: - -juju\.client\._definitions module ---------------------------------- - -.. automodule:: juju.client._definitions - :members: - :undoc-members: - :show-inheritance: - -juju\.client\._client module ----------------------------- - -.. automodule:: juju.client._client - :members: - :undoc-members: - :show-inheritance: - -juju\.client\._client1 module ------------------------------ - -.. automodule:: juju.client._client1 - :members: - :undoc-members: - :show-inheritance: - -juju\.client\._client2 module ------------------------------ - -.. automodule:: juju.client._client2 - :members: - :undoc-members: - :show-inheritance: - -juju\.client\._client3 module ------------------------------ - -.. automodule:: juju.client._client3 - :members: - :undoc-members: - :show-inheritance: - -juju\.client\._client4 module ------------------------------ - -.. automodule:: juju.client._client4 - :members: - :undoc-members: - :show-inheritance: - -juju\.client\._client5 module ------------------------------ - -.. automodule:: juju.client._client5 - :members: - :undoc-members: - :show-inheritance: - -juju\.client\.codegen module ----------------------------- - -.. automodule:: juju.client.codegen - :members: - :undoc-members: - :show-inheritance: - -juju\.client\.connection module -------------------------------- - -.. automodule:: juju.client.connection - :members: - :undoc-members: - :show-inheritance: - -juju\.client\.facade module ---------------------------- - -.. automodule:: juju.client.facade - :members: - :undoc-members: - :show-inheritance: - -juju\.client\.overrides module ------------------------------- - -.. automodule:: juju.client.overrides - :members: - :undoc-members: - :show-inheritance: - -juju\.client\.runner module ---------------------------- - -.. automodule:: juju.client.runner - :members: - :undoc-members: - :show-inheritance: - - -Module contents ---------------- - -.. automodule:: juju.client - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.cloud.rst b/modules/libjuju/docs/api/juju.cloud.rst deleted file mode 100644 index 39021e0..0000000 --- a/modules/libjuju/docs/api/juju.cloud.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.cloud -========== - -.. rubric:: Summary - -.. automembersummary:: juju.cloud - -.. rubric:: Reference - -.. automodule:: juju.cloud - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.constraints.rst b/modules/libjuju/docs/api/juju.constraints.rst deleted file mode 100644 index 5fcbd31..0000000 --- a/modules/libjuju/docs/api/juju.constraints.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.constraints -================ - -.. rubric:: Summary - -.. automembersummary:: juju.constraints - -.. rubric:: Reference - -.. automodule:: juju.constraints - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.controller.rst b/modules/libjuju/docs/api/juju.controller.rst deleted file mode 100644 index 4484fd5..0000000 --- a/modules/libjuju/docs/api/juju.controller.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.controller -=============== - -.. rubric:: Summary - -.. automembersummary:: juju.controller - -.. rubric:: Reference - -.. automodule:: juju.controller - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.delta.rst b/modules/libjuju/docs/api/juju.delta.rst deleted file mode 100644 index 9924f8c..0000000 --- a/modules/libjuju/docs/api/juju.delta.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.delta -========== - -.. rubric:: Summary - -.. automembersummary:: juju.delta - -.. rubric:: Reference - -.. automodule:: juju.delta - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.errors.rst b/modules/libjuju/docs/api/juju.errors.rst deleted file mode 100644 index 7c77574..0000000 --- a/modules/libjuju/docs/api/juju.errors.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.errors -=========== - -.. rubric:: Summary - -.. automembersummary:: juju.errors - -.. rubric:: Reference - -.. automodule:: juju.errors - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.exceptions.rst b/modules/libjuju/docs/api/juju.exceptions.rst deleted file mode 100644 index 85be2fb..0000000 --- a/modules/libjuju/docs/api/juju.exceptions.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.exceptions -=============== - -.. rubric:: Summary - -.. automembersummary:: juju.exceptions - -.. rubric:: Reference - -.. automodule:: juju.exceptions - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.juju.rst b/modules/libjuju/docs/api/juju.juju.rst deleted file mode 100644 index 68698c3..0000000 --- a/modules/libjuju/docs/api/juju.juju.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.juju -========= - -.. rubric:: Summary - -.. automembersummary:: juju.juju - -.. rubric:: Reference - -.. automodule:: juju.juju - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.loop.rst b/modules/libjuju/docs/api/juju.loop.rst deleted file mode 100644 index 4f175e9..0000000 --- a/modules/libjuju/docs/api/juju.loop.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.loop -========= - -.. rubric:: Summary - -.. automembersummary:: juju.loop - -.. rubric:: Reference - -.. automodule:: juju.loop - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.machine.rst b/modules/libjuju/docs/api/juju.machine.rst deleted file mode 100644 index edb5b6c..0000000 --- a/modules/libjuju/docs/api/juju.machine.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.machine -============ - -.. rubric:: Summary - -.. automembersummary:: juju.machine - -.. rubric:: Reference - -.. automodule:: juju.machine - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.model.rst b/modules/libjuju/docs/api/juju.model.rst deleted file mode 100644 index dfb735d..0000000 --- a/modules/libjuju/docs/api/juju.model.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.model -========== - -.. rubric:: Summary - -.. automembersummary:: juju.model - -.. rubric:: Reference - -.. automodule:: juju.model - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.placement.rst b/modules/libjuju/docs/api/juju.placement.rst deleted file mode 100644 index 67cde0c..0000000 --- a/modules/libjuju/docs/api/juju.placement.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.placement -============== - -.. rubric:: Summary - -.. automembersummary:: juju.placement - -.. rubric:: Reference - -.. automodule:: juju.placement - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.relation.rst b/modules/libjuju/docs/api/juju.relation.rst deleted file mode 100644 index 90e3130..0000000 --- a/modules/libjuju/docs/api/juju.relation.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.relation -============= - -.. rubric:: Summary - -.. automembersummary:: juju.relation - -.. rubric:: Reference - -.. automodule:: juju.relation - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.tag.rst b/modules/libjuju/docs/api/juju.tag.rst deleted file mode 100644 index 9b3a29f..0000000 --- a/modules/libjuju/docs/api/juju.tag.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.tag -======== - -.. rubric:: Summary - -.. automembersummary:: juju.tag - -.. rubric:: Reference - -.. automodule:: juju.tag - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.unit.rst b/modules/libjuju/docs/api/juju.unit.rst deleted file mode 100644 index 4a7d167..0000000 --- a/modules/libjuju/docs/api/juju.unit.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.unit -========= - -.. rubric:: Summary - -.. automembersummary:: juju.unit - -.. rubric:: Reference - -.. automodule:: juju.unit - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/juju.utils.rst b/modules/libjuju/docs/api/juju.utils.rst deleted file mode 100644 index 9220a1b..0000000 --- a/modules/libjuju/docs/api/juju.utils.rst +++ /dev/null @@ -1,13 +0,0 @@ -juju.utils -========== - -.. rubric:: Summary - -.. automembersummary:: juju.utils - -.. rubric:: Reference - -.. automodule:: juju.utils - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/api/modules.rst b/modules/libjuju/docs/api/modules.rst deleted file mode 100644 index 9722a6a..0000000 --- a/modules/libjuju/docs/api/modules.rst +++ /dev/null @@ -1,31 +0,0 @@ -Public APIs -=========== - -It is recommended that you start with :doc:`juju.model` or :doc:`juju.controller`. -If you need helpers to manage the asyncio loop, try :doc:`juju.loop`. - -.. toctree:: - - juju.action - juju.annotation - juju.application - juju.cloud - juju.constraints - juju.controller - juju.delta - juju.errors - juju.exceptions - juju.juju - juju.loop - juju.machine - juju.model - juju.placement - juju.relation - juju.tag - juju.unit - juju.utils - -.. automodule:: juju - :members: - :undoc-members: - :show-inheritance: diff --git a/modules/libjuju/docs/changelog.rst b/modules/libjuju/docs/changelog.rst deleted file mode 100644 index d5e13ba..0000000 --- a/modules/libjuju/docs/changelog.rst +++ /dev/null @@ -1,290 +0,0 @@ -Changelog ---------- - -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 - -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 diff --git a/modules/libjuju/docs/conf.py b/modules/libjuju/docs/conf.py deleted file mode 100644 index a95ec04..0000000 --- a/modules/libjuju/docs/conf.py +++ /dev/null @@ -1,303 +0,0 @@ -# -*- coding: utf-8 -*- -# -# libjuju documentation build configuration file, created by -# sphinx-quickstart on Thu May 19 11:21:38 2016. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os - -from pathlib import Path - -here = Path(__file__).absolute().parent -version = (here.parent / 'VERSION').read_text().strip() - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('..')) - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -sys.path.append(os.path.abspath('_extensions/')) -extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.autosummary', - 'sphinx.ext.intersphinx', - 'sphinx.ext.todo', - 'sphinx.ext.viewcode', - 'sphinxcontrib.asyncio', - 'automembersummary', -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'juju' -copyright = u'2016, Canonical Ltd.' -author = u'Canonical' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = version -# The full version, including alpha/beta/rc tags. -release = version - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = 'sphinx_rtd_theme' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. -# " v documentation" by default. -#html_title = u'libjuju v0.0.0' - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (relative to this directory) to use as a favicon of -# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -#html_extra_path = [] - -# If not None, a 'Last updated on:' timestamp is inserted at every page -# bottom, using the given strftime format. -# The empty string is equivalent to '%b %d, %Y'. -#html_last_updated_fmt = None - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh' -#html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# 'ja' uses this config value. -# 'zh' user can custom change `jieba` dictionary path. -#html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -#html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = 'libjujudoc' - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', - -# Latex figure (float) alignment -#'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - (master_doc, 'libjuju.tex', u'libjuju Documentation', - u'Canonical', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'libjuju', u'libjuju Documentation', - [author], 1) -] - -# If true, show URL addresses after external links. -#man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - (master_doc, 'libjuju', u'libjuju Documentation', - author, 'libjuju', 'One line description of project.', - 'Miscellaneous'), -] - -# Documents to append as an appendix to all manuals. -#texinfo_appendices = [] - -# If false, no module index is generated. -#texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -#texinfo_no_detailmenu = False - -def setup(app): - app.add_stylesheet('custom.css') diff --git a/modules/libjuju/docs/index.rst b/modules/libjuju/docs/index.rst deleted file mode 100644 index 2dd55cb..0000000 --- a/modules/libjuju/docs/index.rst +++ /dev/null @@ -1,45 +0,0 @@ -.. libjuju documentation master file, created by - sphinx-quickstart on Thu May 19 11:21:38 2016. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - - -.. include:: readme.rst - - -Table of Contents ------------------ - -.. toctree:: - :caption: Overview - :glob: - :maxdepth: 3 - - narrative/index - - -.. toctree:: - :caption: API Documentation - :glob: - :maxdepth: 3 - - api/modules - api/juju.client - -.. toctree:: - :caption: Project - :glob: - :maxdepth: 3 - - upstream-updates/index - changelog - - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/modules/libjuju/docs/narrative/application.rst b/modules/libjuju/docs/narrative/application.rst deleted file mode 100644 index 1565e5f..0000000 --- a/modules/libjuju/docs/narrative/application.rst +++ /dev/null @@ -1,136 +0,0 @@ -Applications -============ -For api docs, see :class:`juju.application.Application`. - - -Deploying ---------- -To deploy a new application, connect a model and then call its -:meth:`~juju.model.Model.deploy` method. An -:class:`~juju.application.Application` instance is returned. - -.. code:: python - - from juju.model import Model - - model = Model() - await model.connect_current() - - mysql_app = await model.deploy( - # If a revision number is not included in the charm url, - # the latest revision from the Charm Store will be used. - 'cs:mysql-55', - application_name='mysql', - series='trusty', - channel='stable', - config={ - 'tuning-level': 'safest', - }, - constraints={ - 'mem': 256 * MB, - }, - ) - - -Deploying a Local Charm ------------------------ -To deploy a local charm, pass the charm directory path to -`Model.deploy()`. - -.. code:: python - - from juju.model import Model - - model = Model() - await model.connect_current() - - # Deploy a local charm using a path to the charm directory - await model.deploy( - '/home/tvansteenburgh/src/charms/ubuntu', - application_name='ubuntu', - series='trusty', - ) - - -Adding Units ------------- -To add units to a deployed application, use the -:meth:`juju.application.Application.add_units` method. A list of the newly -added units (:class:`~juju.unit.Unit` objects) is returned. - -.. code:: python - - ubuntu_app = await model.deploy( - 'ubuntu', - application_name='ubuntu', - series='trusty', - channel='stable', - ) - - unit_a, unit_b = await ubuntu_app.add_units(count=2) - - -Updating Config and Constraints -------------------------------- -Example showing how to update configuration and constraints on a deployed -application. The `mysql_app` object is an instance of -:class:`juju.application.Application`. - -.. code:: python - - MB = 1024 * 1024 - - # Update and check app config - await mysql_app.set_config({'tuning-level': 'fast'}) - config = await mysql_app.get_config() - - assert(config['tuning-level']['value'] == 'fast') - - # update and check app constraints - await mysql_app.set_constraints({'mem': 512 * MB}) - constraints = await mysql_app.get_constraints() - - assert(constraints['mem'] == 512 * MB) - - -Adding and Removing Relations ------------------------------ -The :meth:`juju.application.Application.add_relation` method returns a -:class:`juju.relation.Relation` instance. - -.. code:: python - - from juju.model import Model - - model = Model() - await model.connect_current() - - # Deploy mysql-master application - mysql_master = await model.deploy( - 'cs:mysql-55', - application_name='mysql-master', - series='trusty', - channel='stable', - ) - - # Deploy mysql-slave application - mysql_slave = await model.deploy( - 'cs:mysql-55', - application_name='mysql-slave', - series='trusty', - channel='stable', - ) - - # Add the master-slave relation - relation = await mysql_master.add_relation( - # Name of the relation on the local (mysql-master) side - 'master', - # Name of the app:relation on the remote side - 'mysql-slave:slave', - ) - - # Remove the relation - await mysql_master.remove_relation( - 'master', - 'mysql-slave:slave', - ) diff --git a/modules/libjuju/docs/narrative/controller.rst b/modules/libjuju/docs/narrative/controller.rst deleted file mode 100644 index 1d86321..0000000 --- a/modules/libjuju/docs/narrative/controller.rst +++ /dev/null @@ -1,92 +0,0 @@ -Controllers -=========== -A Juju controller provides websocket endpoints for itself and each of its -models. In order to do anything useful, the juju lib must connect to one of -these endpoints. - -Connecting to the controller endpoint is useful if you want to programmatically -create a new model. If the model you want to use already exists, you can -connect directly to it (see py:doc:`model`). - -For API docs, see py:class:`juju.controller.Controller`. - - -Connecting to the Current Controller ------------------------------------- -Connect to the currently active Juju controller (the one returned by -`juju switch`). This only works if you have the Juju CLI client installed. - -.. code:: python - - from juju.controller import Controller - - controller = Controller() - await controller.connect() - - -Connecting to a Named Controller --------------------------------- -Connect to a controller by name. - -.. code:: python - - from juju.controller import Controller - - controller = Controller() - await controller.connect('mycontroller') - - -Connecting with Authentication ------------------------------- -You can control what user you are connecting with by specifying either a -username/password pair, or a macaroon or bakery client that can provide -a macaroon. - - -.. code:: python - - controller = Controller() - await controller.connect(username='admin', - password='f53f08cfc32a2e257fe5393271d89d62') - - # or with a macaroon - await controller.connect(macaroons=[ - { - "Name": "macaroon-218d87053ad19626bcd5a0eef0bc9ba8bd4fbd80a968f52a5fd430b2aa8660df", - "Value": "W3siY2F2ZWF0cyI6 ... jBkZiJ9XQ==", - "Domain": "10.130.48.27", - "Path": "/auth", - "Secure": false, - "HostOnly": true, - "Expires": "2018-03-07T22:07:23Z", - }, - ]) - - # or with a bakery client - from macaroonbakery.httpbakery import Client - from http.cookiejar import FileCookieJar - - bakery_client=Client() - bakery_client.cookies = FileCookieJar('cookies.txt') - controller = Controller() - await controller.connect(bakery_client=bakery_client) - - - -Connecting with an Explicit Endpoint ------------------------------------- -The most flexible, but also most verbose, way to connect is using the API -endpoint url and credentials directly. This method does NOT require the -Juju CLI client to be installed. - -.. code:: python - - controller = Controller() - await controller.connect( - endpoint='10.0.4.171:17070', - username='admin', - password='f53f08cfc32a2e257fe5393271d89d62', - cacert=None, # Left out for brevity, but if you have a cert string you - # should pass it in. You can get the cert from the output - # of The `juju show-controller` command. - ) diff --git a/modules/libjuju/docs/narrative/index.rst b/modules/libjuju/docs/narrative/index.rst deleted file mode 100644 index b1684a0..0000000 --- a/modules/libjuju/docs/narrative/index.rst +++ /dev/null @@ -1,10 +0,0 @@ -**Overview** - -.. toctree:: - :glob: - :maxdepth: 2 - - controller - model - application - unit diff --git a/modules/libjuju/docs/narrative/model.rst b/modules/libjuju/docs/narrative/model.rst deleted file mode 100644 index 42633a1..0000000 --- a/modules/libjuju/docs/narrative/model.rst +++ /dev/null @@ -1,290 +0,0 @@ -Models -====== -A Juju controller provides websocket endpoints for each of its -models. In order to do anything useful with a model, the juju lib must -connect to one of these endpoints. There are several ways to do this. - -For api docs, see py:class:`juju.model.Model`. - - -Connecting to the Current Model -------------------------------- -Connect to the currently active Juju model (the one returned by -`juju switch`). This only works if you have the Juju CLI client installed. - -.. code:: python - - model = Model() - await model.connect() - - -Connecting to a Named Model ---------------------------- -Connect to a model by name, using the same format as that returned from the -`juju switch` command. The accepted format is '[controller:][user/]model'. -This only works if you have the Juju CLI client installed. - -.. code:: python - - model = Model() - await model.connect('juju-2.0.1:admin/libjuju') - - -Connecting with Authentication ------------------------------- -You can control what user you are connecting with by specifying either a -username/password pair, or a macaroon or bakery client that can provide -a macaroon. - - -.. code:: python - - model = Model() - await model.connect(username='admin', - password='f53f08cfc32a2e257fe5393271d89d62') - - # or with a macaroon - await model.connect(macaroons=[ - { - "Name": "macaroon-218d87053ad19626bcd5a0eef0bc9ba8bd4fbd80a968f52a5fd430b2aa8660df", - "Value": "W3siY2F2ZWF0cyI6 ... jBkZiJ9XQ==", - "Domain": "10.130.48.27", - "Path": "/auth", - "Secure": false, - "HostOnly": true, - "Expires": "2018-03-07T22:07:23Z", - }, - ]) - - # or with a bakery client - from macaroonbakery.httpbakery import Client - from http.cookiejar import FileCookieJar - - bakery_client=Client() - bakery_client.cookies = FileCookieJar('cookies.txt') - model = Model() - await model.connect(bakery_client=bakery_client) - - - -Connecting with an Explicit Endpoint ------------------------------------- -The most flexible, but also most verbose, way to connect is using the API -endpoint url, model UUID, and credentials directly. This method does NOT -require the Juju CLI client to be installed. - -.. code:: python - - from juju.model import Model - - model = Model() - await model.connect( - endpoint='10.0.4.171:17070', - uuid='e8399ac7-078c-4817-8e5e-32316d55b083', - username='admin', - password='f53f08cfc32a2e257fe5393271d89d62', - cacert=None, # Left out for brevity, but if you have a cert string you - # should pass it in. You can get the cert from the output - # of The `juju show-controller` command. - ) - - -Creating and Destroying a Model -------------------------------- -Example of creating a new model and then destroying it. See -py:method:`juju.controller.Controller.add_model` and -py:method:`juju.controller.Controller.destroy_model` for more info. - -.. code:: python - - from juju.controller import Controller - - controller = Controller() - await controller.connect_current() - - # Create our new model - model = await controller.add_model( - 'mymodel', # name of your new model - ) - - # Do stuff with our model... - - # Destroy the model - await model.disconnect() - await controller.destroy_model(model.info.uuid) - model = None - - -Adding Machines and Containers ------------------------------- -To add a machine or container, connect to a model and then call its -py:method:`~juju.model.Model.add_machine` method. A -py:class:`~juju.machine.Machine` instance is returned. The machine id -can be used to deploy a charm to a specific machine or container. - -.. code:: python - - from juju.model import Model - - MB = 1 - GB = 1024 - - - model = Model() - await model.connect_current() - - # add a new default machine - machine1 = await model.add_machine() - - # add a machine with constraints, disks, and series specified - machine2 = await model.add_machine( - constraints={ - 'mem': 256 * MB, - }, - disks=[{ - 'pool': 'rootfs', - 'size': 10 * GB, - 'count': 1, - }], - series='xenial', - ) - - # add a lxd container to machine2 - machine3 = await model.add_machine( - 'lxd:{}'.format(machine2.id)) - - # deploy charm to the lxd container - application = await model.deploy( - 'ubuntu-10', - application_name='ubuntu', - series='xenial', - channel='stable', - to=machine3.id - ) - - # remove application - await application.remove() - - # destroy machines - note that machine3 must be destroyed before machine2 - # since it's a container on machine2 - await machine3.destroy(force=True) - await machine2.destroy(force=True) - await machine1.destroy(force=True) - - -Reacting to Changes in a Model ------------------------------- -To watch for and respond to changes in a model, register an observer with the -model. The easiest way to do this is by creating a -py:class:`juju.model.ModelObserver` subclass. - -.. code:: python - - from juju.model import Model, ModelObserver - - class MyModelObserver(ModelObserver): - async def on_change(self, delta, old, new, model): - # The raw change data (dict) from the websocket. - print(delta.data) - - # The entity type (str) affected by this change. - # One of ('action', 'application', 'annotation', 'machine', - # 'unit', 'relation') - print(delta.entity) - - # The type (str) of change. - # One of ('add', 'change', 'remove') - print(delta.type) - - # The 'old' and 'new' parameters are juju.model.ModelEntity - # instances which represent an entity in the model both before - # this change was applied (old) and after (new). - - # If an entity is being added to the model, the 'old' param - # will be None. - if delta.type == 'add': - assert(old is None) - - # If an entity is being removed from the model, the 'new' param - # will be None. - if delta.type == 'remove': - assert(new is None) - - # The 'old' and 'new' parameters, when not None, will be instances - # of a juju.model.ModelEntity subclass. The type of the subclass - # depends on the value of 'delta.entity', for example: - # - # delta.entity type - # ------------ ---- - # 'action' -> juju.action.Action - # 'application' -> juju.application.Application - # 'annotation' -> juju.annotation.Annotation - # 'machine' -> juju.machine.Machine - # 'unit' -> juju.unit.Unit - # 'relation' -> juju.relation.Relation - - # Finally, the 'model' parameter is a reference to the - # juju.model.Model instance to which this observer is attached. - print(id(model)) - - - model = Model() - await model.connect_current() - - model.add_observer(MyModelObserver()) - - -Every change in the model will result in a call to the `on_change()` -method of your observer(s). - -To target your code more precisely, define method names that correspond -to the entity and type of change that you wish to handle. - -.. code:: python - - from juju.model import Model, ModelObserver - - class MyModelObserver(ModelObserver): - async def on_application_change(self, delta, old, new, model): - # Both 'old' and 'new' params will be instances of - # juju.application.Application - pass - - async def on_unit_remove(self, delta, old, new, model): - # Since a unit is being removed, the 'new' param will always - # be None in this handler. The 'old' param will be an instance - # of juju.unit.Unit - the state of the unit before it was removed. - pass - - async def on_machine_add(self, delta, old, new, model): - # Since a machine is being added, the 'old' param will always be - # None in this handler. The 'new' param will be an instance of - # juju.machine.Machine. - pass - - async def on_change(self, delta, old, new, model): - # The catch-all handler - will be called whenever a more - # specific handler method is not defined. - - -Any py:class:`juju.model.ModelEntity` object can be observed directly by -registering callbacks on the object itself. - -.. code:: python - - import logging - - async def on_app_change(delta, old, new, model): - logging.debug('App changed: %r', new) - - async def on_app_remove(delta, old, new, model): - logging.debug('App removed: %r', old) - - ubuntu_app = await model.deploy( - 'ubuntu', - application_name='ubuntu', - series='trusty', - channel='stable', - ) - ubuntu_app.on_change(on_app_change) - ubuntu_app.on_remove(on_app_remove) diff --git a/modules/libjuju/docs/narrative/unit.rst b/modules/libjuju/docs/narrative/unit.rst deleted file mode 100644 index 5d6b48d..0000000 --- a/modules/libjuju/docs/narrative/unit.rst +++ /dev/null @@ -1,65 +0,0 @@ -Units -===== -For api docs, see :class:`juju.unit.Unit`. - - -Running Commands ----------------- -Run arbitrary commands on a unit with the -:meth:`juju.unit.Unit.run` method. This method blocks -the current coroutine until a result is available, and -returns a :class:`juju.action.Action` instance. - - -.. code:: python - - from juju.model import Model - - model = Model() - await model.connect_current() - - app = await model.deploy( - 'ubuntu', - application_name='ubuntu', - series='trusty', - channel='stable', - ) - - for unit in app.units: - action = await unit.run('unit-get public-address') - print(action.results) - - action = await unit.run('uname -a') - print(action.results) - - -Running Actions ---------------- -Run actions on a unit with the -:meth:`juju.unit.Unit.run_action` method. This method -returns a :class:`juju.action.Action` instance immediately. To block until -the action completes, use the :meth:`juju.action.Action.wait` method, as -in the example below. - - -.. code:: python - - from juju.model import Model - - model = Model() - await model.connect_current() - - app = await model.deploy( - 'git', - application_name='git', - series='trusty', - channel='stable', - ) - - for unit in app.units: - # run the 'add-repo' action, passing a 'repo' param - action = await unit.run_action('add-repo', repo='myrepo') - # wait for the action to complete - action = await action.wait() - - print(action.results) diff --git a/modules/libjuju/docs/readme.rst b/modules/libjuju/docs/readme.rst deleted file mode 100644 index 87666d0..0000000 --- a/modules/libjuju/docs/readme.rst +++ /dev/null @@ -1,103 +0,0 @@ -A Python library for Juju -========================= - -Source code: https://github.com/juju/python-libjuju - -Bug reports: https://github.com/juju/python-libjuju/issues - -Documentation: https://pythonlibjuju.readthedocs.io/en/latest/ - - -Requirements ------------- - -* Python 3.5+ -* Juju 2.0+ - - -Design Notes ------------- - -* Asynchronous - uses asyncio and async/await features of python 3.5 -* Websocket-level bindings are programmatically generated (indirectly) from the - Juju golang code, ensuring full api coverage -* Provides an OO layer which encapsulates much of the websocket api and - provides familiar nouns and verbs (e.g. Model.deploy(), Application.add_unit(), - etc.) - - -Installation ------------- - -.. code:: bash - - pip3 install juju - - -Quickstart ----------- -Here's a simple example that shows basic usage of the library. The example -connects to the currently active Juju model, deploys a single unit of the -ubuntu charm, then exits: - - -.. code:: python - - #!/usr/bin/python3 - - import logging - import sys - - from juju import loop - from juju.model import Model - - - async def deploy(): - # Create a Model instance. We need to connect our Model to a Juju api - # server before we can use it. - model = Model() - - # Connect to the currently active Juju model - await model.connect_current() - - try: - # Deploy a single unit of the ubuntu charm, using the latest revision - # from the stable channel of the Charm Store. - ubuntu_app = await model.deploy( - 'ubuntu', - application_name='ubuntu', - series='xenial', - channel='stable', - ) - - if '--wait' in sys.argv: - # optionally block until the application is ready - await model.block_until(lambda: ubuntu_app.status == 'active') - finally: - # Disconnect from the api server and cleanup. - await model.disconnect() - - - def main(): - logging.basicConfig(level=logging.INFO) - - # If you want to see everything sent over the wire, set this to DEBUG. - ws_logger = logging.getLogger('websockets.protocol') - ws_logger.setLevel(logging.INFO) - - # Run the deploy coroutine in an asyncio event loop, using a helper - # that abstracts loop creation and teardown. - loop.run(deploy()) - - - if __name__ == '__main__': - main() - - -More examples can be found in the docs, as well as in the ``examples/`` -directory of the source tree which can be run using ``tox``. For -example, to run ``examples/connect_current_model.py``, use: - -.. code:: bash - - tox -e example -- examples/connect_current_model.py diff --git a/modules/libjuju/docs/requirements.txt b/modules/libjuju/docs/requirements.txt deleted file mode 100644 index dabf3a0..0000000 --- a/modules/libjuju/docs/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -pytz<2018.0,>=2017.2 # conflict between sphinx and macaroonbakery -pymacaroons>=0.13.0,<1.0 # force new version with pynacl instead of libnacl -sphinx==1.6.5 -sphinxcontrib-asyncio -sphinx_rtd_theme diff --git a/modules/libjuju/docs/upstream-updates/index.rst b/modules/libjuju/docs/upstream-updates/index.rst deleted file mode 100644 index 41f448a..0000000 --- a/modules/libjuju/docs/upstream-updates/index.rst +++ /dev/null @@ -1,114 +0,0 @@ -Syncing Upstream Updates -======================== - -Updating the facade and definitions code generated from the schema -to reflect changes in upstream Juju consists of two steps: - -* Creating a new `schemas-juju-.json` file from the Juju code-base -* Generating the libjuju Python code from that schema - -Rarely, you may also have to add or update an override. - - -Creating a Schema File ----------------------- - -First, you will need to fetch SchemaGen_ and a copy of the Juju source. -Once your copy of the Juju source is at the version you want to update to -(probably the `develop` branch, or a release tag) and you have updated -and reinstalled SchemaGen to reflect those changes, you just need to send -the output into a file in the libjuju repository: - -.. code:: bash - - schemagen > juju/client/schemas-juju-2.2-rc1.json - -The version number you use in the filename should match the upstream -version of Juju. You should then also move the `latest` pointer to -the new file: - -.. code:: bash - - rm juju/client/schemas-juju-latest.json - ln -s schemas-juju-2.2-rc1.json juju/client/schemas-juju-latest.json - - -Generating the Python Code --------------------------- - -Once you have a new schema file, you can update the Python code -using the `client` make target: - -.. code:: bash - - make client - -You should expect to see updates to the `juju/client/_definitions.py` file, -as well as one or more of the `juju/client/_clientX.py` files, depending on -which facades were touched. - - -Integrating into the Object Layer ---------------------------------- - -Once the raw client APIs are synced, you may need to integrate any new or -changed API calls into the object layer, to provide a clean, Pythonic way -to interact with the model. This may be as simple as adding an optional -parameter to an existing model method, tweaking what manipulations, if any -the model method does to the data before it is sent to the API, or it may -require adding an entirely new model method to capture the new functionality. - -In general, the approach should be to make the interactions with the model -layer use the same patterns as when you use the CLI, just with Python idioms -and OO approaches. - -When trying to determine what client calls need to be made and what data to -be sent for a given Juju CLI action, it is very useful to add -`--debug --logging-config TRACE` to any Juju CLI command to view the full -conversation between the CLI client and the API server. For example: - -``` -[johnsca@murdoch:~] $ juju deploy --debug --logging-config TRACE ./builds/test -11:51:20 INFO juju.cmd supercommand.go:56 running juju [2.3.5 gc go1.10] -11:51:20 DEBUG juju.cmd supercommand.go:57 args: []string{"/snap/juju/3884/bin/juju", "deploy", "--debug", "--logging-config", "TRACE", "./builds/test"} -11:51:20 INFO juju.juju api.go:67 connecting to API addresses: [35.172.119.191:17070 172.31.94.16:17070 252.94.16.1:17070] -11:51:20 TRACE juju.api certpool.go:49 cert dir "/etc/juju/certs.d" does not exist -11:51:20 DEBUG juju.api apiclient.go:843 successfully dialed "wss://35.172.119.191:17070/model/a7317969-6dab-4ba4-844b-af3d661c228d/api" -11:51:20 INFO juju.api apiclient.go:597 connection established to "wss://35.172.119.191:17070/model/a7317969-6dab-4ba4-844b-af3d661c228d/api" -... -11:51:20 INFO juju.cmd.juju.application series_selector.go:71 with the configured model default series "xenial" -11:51:20 DEBUG httpbakery client.go:244 client do POST https://35.172.119.191:17070/model/a7317969-6dab-4ba4-844b-af3d661c228d/charms?revision=0&schema=local&series=xenial { -11:51:21 DEBUG httpbakery client.go:246 } -> error -11:51:21 INFO cmd deploy.go:1096 Deploying charm "local:xenial/test-0". -11:51:21 TRACE juju.rpc.jsoncodec codec.go:225 -> {"request-id":3,"type":"Charms","version":2,"request":"CharmInfo","params":{"url":"local:xenial/test-0"}} -11:51:21 TRACE juju.rpc.jsoncodec codec.go:120 <- {"request-id":3,"response":{"revision":0,"url":"local:xenial/test-0","config":{"test":{"type":"string","default":""}},"meta":{"name":"test","summary":"test","description":"test","subordinate":false,"series":["xenial"],"resources":{"dummy":{"name":"dummy","type":"file","path":"dummy.snap","description":"dummy snap"}},"min-juju-version":"0.0.0"},"actions":{}}} -11:51:21 TRACE juju.rpc.jsoncodec codec.go:225 -> {"request-id":4,"type":"Charms","version":2,"request":"IsMetered","params":{"url":"local:xenial/test-0"}} -11:51:21 TRACE juju.rpc.jsoncodec codec.go:120 <- {"request-id":4,"response":{"metered":false}} -11:51:21 TRACE juju.rpc.jsoncodec codec.go:225 -> {"request-id":5,"type":"Resources","version":1,"request":"AddPendingResources","params":{"tag":"application-test","url":"local:xenial/test-0","channel":"","macaroon":null,"resources":[{"name":"dummy","type":"file","path":"dummy.snap","description":"dummy snap","origin":"store","revision":-1,"fingerprint":"","size":0}]}} -11:51:21 TRACE juju.rpc.jsoncodec codec.go:120 <- {"request-id":5,"response":{"pending-ids":["c0ffdd92-da23-4fb2-8d41-d82d58423447"]}} -11:51:21 TRACE juju.rpc.jsoncodec codec.go:225 -> {"request-id":6,"type":"Application","version":5,"request":"Deploy","params":{"applications":[{"application":"test","series":"xenial","charm-url":"local:xenial/test-0","channel":"","num-units":1,"config-yaml":"","constraints":{},"resources":{"dummy":"c0ffdd92-da23-4fb2-8d41-d82d58423447"}}]}} -11:51:21 TRACE juju.rpc.jsoncodec codec.go:120 <- {"request-id":6,"response":{"results":[{}]}} -11:51:21 TRACE juju.rpc.jsoncodec codec.go:123 <- error: read tcp 192.168.1.102:52168->35.172.119.191:17070: use of closed network connection (closing true) -11:51:21 DEBUG juju.api monitor.go:35 RPC connection died -11:51:21 INFO cmd supercommand.go:465 command finished -``` - -Note that this will contain login information (which has been removed from the above). - - -Overrides ---------- - -It should be quite rare, but occasionally the generated Python code does -not capture all of the logic needed to properly parse the output from the API -or may otherwise need some small amount of tweaking. This is what the -`juju/client/overrides.py` file is for. An example of this is the `Number` -type, which isn't standard JSON and must be parsed slightly differently. - -At the top of that file are two lists, `__all__` and `__patches__`. The -former replaces entire class implementations, while the latter patches -the attributes of the override classes into the matching generated class, -leaving the rest of the generated class untouched. - - -.. _SchemaGen: https://github.com/juju/schemagen diff --git a/modules/libjuju/examples/action.py b/modules/libjuju/examples/action.py deleted file mode 100644 index f839f11..0000000 --- a/modules/libjuju/examples/action.py +++ /dev/null @@ -1,49 +0,0 @@ -""" -This example: - -1. Connects to current model and resets it. -2. Deploys a git unit. -3. Runs an action against the unit. -4. Waits for the action results to come back, then exits. - -""" -import logging - -from juju import loop -from juju.model import Model - - -async def run_action(unit): - logging.debug('Running action on unit %s', unit.name) - - # unit.run() returns a juju.action.Action instance - action = await unit.run_action('add-repo', repo='myrepo') - # wait for the action to complete - action = await action.wait() - - logging.debug("Action results: %s", action.results) - - -async def main(): - model = Model() - # connect to current model with current user, per Juju CLI - await model.connect() - - app = await model.deploy( - 'git', - application_name='git', - series='trusty', - channel='stable', - ) - - for unit in app.units: - await run_action(unit) - - await model.disconnect() - - -if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG) - ws_logger = logging.getLogger('websockets.protocol') - ws_logger.setLevel(logging.INFO) - loop.run(main()) diff --git a/modules/libjuju/examples/add_machine.py b/modules/libjuju/examples/add_machine.py deleted file mode 100755 index 33d0c34..0000000 --- a/modules/libjuju/examples/add_machine.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env python3.5 - -""" -This example: - -1. Connects to the current model -2. Creates two machines and a lxd container -3. Deploys charm to the lxd container - -""" -import logging - -from juju import loop -from juju.model import Model - -MB = 1 -GB = 1024 - - -async def main(): - model = Model() - await model.connect() - - try: - # add a new default machine - machine1 = await model.add_machine() - # add a machine with constraints, disks, and series - machine2 = await model.add_machine( - constraints={ - 'mem': 256 * MB, - }, - disks=[{ - 'pool': 'rootfs', - 'size': 10 * GB, - 'count': 1, - }], - series='xenial', - ) - # add a lxd container to machine2 - machine3 = await model.add_machine( - 'lxd:{}'.format(machine2.id)) - - # deploy charm to the lxd container - application = await model.deploy( - 'ubuntu-10', - application_name='ubuntu', - series='xenial', - channel='stable', - to=machine3.id - ) - - await model.block_until( - lambda: all(unit.workload_status == 'active' - for unit in application.units)) - - await application.remove() - - await machine3.destroy(force=True) - await machine2.destroy(force=True) - await machine1.destroy(force=True) - finally: - await model.disconnect() - - -if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG) - ws_logger = logging.getLogger('websockets.protocol') - ws_logger.setLevel(logging.INFO) - - loop.run(main()) diff --git a/modules/libjuju/examples/add_model.py b/modules/libjuju/examples/add_model.py deleted file mode 100644 index 88766f1..0000000 --- a/modules/libjuju/examples/add_model.py +++ /dev/null @@ -1,67 +0,0 @@ -""" -This example: - -1. Creates a model on the current controller -2. Deploys a charm to it. -3. Attempts to ssh into the charm - -""" -from juju import loop -from juju import utils -from juju.controller import Controller -import asyncio -from logging import getLogger -import uuid - -LOG = getLogger(__name__) - - -async def main(): - controller = Controller() - print("Connecting to controller") - # connect to current controller with current user, per Juju CLI - await controller.connect() - - try: - model_name = "addmodeltest-{}".format(uuid.uuid4()) - print("Adding model {}".format(model_name)) - model = await controller.add_model(model_name) - - print('Deploying ubuntu') - application = await model.deploy( - 'ubuntu-10', - application_name='ubuntu', - series='trusty', - channel='stable', - ) - - print('Waiting for active') - await asyncio.sleep(10) - await model.block_until( - lambda: all(unit.workload_status == 'active' - for unit in application.units)) - - print("Verifying that we can ssh into the created model") - ret = await utils.execute_process( - 'juju', 'ssh', '-m', model_name, 'ubuntu/0', 'ls /', log=LOG) - assert ret - - print('Removing ubuntu') - await application.remove() - - print("Destroying model") - await controller.destroy_model(model.info.uuid) - - except Exception: - LOG.exception( - "Test failed! Model {} may not be cleaned up".format(model_name)) - - finally: - print('Disconnecting from controller') - if model: - await model.disconnect() - await controller.disconnect() - - -if __name__ == '__main__': - loop.run(main()) diff --git a/modules/libjuju/examples/allwatcher.py b/modules/libjuju/examples/allwatcher.py deleted file mode 100644 index 884230b..0000000 --- a/modules/libjuju/examples/allwatcher.py +++ /dev/null @@ -1,31 +0,0 @@ -""" -This example: - -1. Connects to the current model -2. Starts an AllWatcher -3. Prints all changes received from the AllWatcher -4. Runs forever (kill with Ctrl-C) - -""" -import asyncio -import logging - -from juju.client.connection import Connection -from juju.client import client -from juju import loop - - -async def watch(): - conn = await Connection.connect() - allwatcher = client.AllWatcherFacade.from_connection(conn) - while True: - change = await allwatcher.Next() - for delta in change.deltas: - print(delta.deltas) - - -if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG) - # Run loop until the process is manually stopped (watch will loop - # forever). - loop.run(watch()) diff --git a/modules/libjuju/examples/config.py b/modules/libjuju/examples/config.py deleted file mode 100644 index c7580f6..0000000 --- a/modules/libjuju/examples/config.py +++ /dev/null @@ -1,54 +0,0 @@ -""" -This example: - -1. Connects to the current model -2. Resets it -3. Deploys a charm and prints its config and constraints - -""" -import logging - -from juju.model import Model -from juju import loop - -log = logging.getLogger(__name__) - -MB = 1 - - -async def main(): - model = Model() - # connect to current model with current user, per Juju CLI - await model.connect() - - ubuntu_app = await model.deploy( - 'mysql', - application_name='mysql', - series='trusty', - channel='stable', - config={ - 'tuning-level': 'safest', - }, - constraints={ - 'mem': 256 * MB, - }, - ) - - # update and check app config - await ubuntu_app.set_config({'tuning-level': 'fast'}) - config = await ubuntu_app.get_config() - assert(config['tuning-level']['value'] == 'fast') - - # update and check app constraints - await ubuntu_app.set_constraints({'mem': 512 * MB}) - constraints = await ubuntu_app.get_constraints() - assert(constraints['mem'] == 512 * MB) - - await model.disconnect() - - -if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG) - ws_logger = logging.getLogger('websockets.protocol') - ws_logger.setLevel(logging.INFO) - loop.run(main()) diff --git a/modules/libjuju/examples/connect_current_model.py b/modules/libjuju/examples/connect_current_model.py deleted file mode 100644 index b46a09c..0000000 --- a/modules/libjuju/examples/connect_current_model.py +++ /dev/null @@ -1,27 +0,0 @@ -""" -This is a very basic example that connects to the currently selected model -and prints the number of applications deployed to it. -""" -import logging - -from juju import loop -from juju.model import Model - -log = logging.getLogger(__name__) - - -async def main(): - model = Model() - try: - # connect to the current model with the current user, per the Juju CLI - await model.connect() - print('There are {} applications'.format(len(model.applications))) - finally: - if model.is_connected(): - print('Disconnecting from model') - await model.disconnect() - - -if __name__ == '__main__': - logging.basicConfig(level=logging.INFO) - loop.run(main()) diff --git a/modules/libjuju/examples/controller.py b/modules/libjuju/examples/controller.py deleted file mode 100644 index b61a6f6..0000000 --- a/modules/libjuju/examples/controller.py +++ /dev/null @@ -1,41 +0,0 @@ -""" -This example: - -1. Connects to current controller. -2. Creates a new model. -3. Deploys an application on the new model. -4. Disconnects from the model -5. Destroys the model - -""" -import logging - -from juju.controller import Controller -from juju import loop - - -async def main(): - controller = Controller() - # connect to current controller with current user, per Juju CLI - await controller.connect() - model = await controller.add_model( - 'my-test-model', - 'aws', - 'aws-tim', - ) - await model.deploy( - 'ubuntu-0', - application_name='ubuntu', - series='trusty', - channel='stable', - ) - await model.disconnect() - await controller.destroy_model(model.info.uuid) - await controller.disconnect() - - -if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG) - ws_logger = logging.getLogger('websockets.protocol') - ws_logger.setLevel(logging.INFO) - loop.run(main()) diff --git a/modules/libjuju/examples/credential.py b/modules/libjuju/examples/credential.py deleted file mode 100644 index e653536..0000000 --- a/modules/libjuju/examples/credential.py +++ /dev/null @@ -1,47 +0,0 @@ -import sys -from juju import loop -from juju.controller import Controller - - -async def main(cloud_name, credential_name): - controller = Controller() - model = None - print('Connecting to controller') - # connect to current controller with current user, per Juju CLI - await controller.connect() - try: - print('Adding model') - model = await controller.add_model( - 'test', - cloud_name=cloud_name, - credential_name=credential_name) - - # verify credential - print("Verify model's credential: {}".format( - model.info.cloud_credential_tag)) - - # verify we can deploy - print('Deploying ubuntu') - app = await model.deploy('ubuntu-10') - - print('Waiting for active') - await model.block_until( - lambda: app.units and all(unit.workload_status == 'active' - for unit in app.units)) - - print('Removing ubuntu') - await app.remove() - finally: - print('Cleaning up') - if model: - print('Removing model') - model_uuid = model.info.uuid - await model.disconnect() - await controller.destroy_model(model_uuid) - print('Disconnecting') - await controller.disconnect() - - -if __name__ == '__main__': - assert len(sys.argv) > 2, 'Please provide a cloud and credential name' - loop.run(main(sys.argv[1], sys.argv[2])) diff --git a/modules/libjuju/examples/deploy.py b/modules/libjuju/examples/deploy.py deleted file mode 100644 index 43764d7..0000000 --- a/modules/libjuju/examples/deploy.py +++ /dev/null @@ -1,41 +0,0 @@ -""" -This example: - -1. Connects to the current model -2. Deploy a charm and waits until it reports itself active -3. Destroys the unit and application - -""" -from juju import loop -from juju.model import Model - - -async def main(): - model = Model() - print('Connecting to model') - # connect to current model with current user, per Juju CLI - await model.connect() - - try: - print('Deploying ubuntu') - application = await model.deploy( - 'ubuntu-10', - application_name='ubuntu', - series='trusty', - channel='stable', - ) - - print('Waiting for active') - await model.block_until( - lambda: all(unit.workload_status == 'active' - for unit in application.units)) - - print('Removing ubuntu') - await application.remove() - finally: - print('Disconnecting from model') - await model.disconnect() - - -if __name__ == '__main__': - loop.run(main()) diff --git a/modules/libjuju/examples/fullstatus.py b/modules/libjuju/examples/fullstatus.py deleted file mode 100644 index 5548423..0000000 --- a/modules/libjuju/examples/fullstatus.py +++ /dev/null @@ -1,23 +0,0 @@ -import asyncio - -from juju.client.connection import Connection -from juju.client.client import ClientFacade -from juju import loop - -async def status(): - conn = await Connection.connect() - client = ClientFacade.from_connection(conn) - - patterns = None - status = await client.FullStatus(patterns) - await conn.close() - - print('Applications:', list(status.applications.keys())) - print('Machines:', list(status.machines.keys())) - print('Relations:', status.relations) - - return status - -if __name__ == '__main__': - loop.run(status()) - diff --git a/modules/libjuju/examples/future.py b/modules/libjuju/examples/future.py deleted file mode 100644 index 5e974cf..0000000 --- a/modules/libjuju/examples/future.py +++ /dev/null @@ -1,47 +0,0 @@ -""" -This example doesn't work - it demonstrates features that don't exist yet. - -""" -import logging - -from juju.model import Model -from juju import loop - - -async def main(): - model = Model() - # connect to current model with current user, per Juju CLI - await model.connect() - - goal_state = Model.from_yaml('bundle-like-thing') - ubuntu_app = await model.deploy( - 'ubuntu-0', - application_name='ubuntu', - series='trusty', - channel='stable', - ) - ubuntu_app.on_unit_added(callback=lambda unit: True) - - await model.deploy( - 'nrpe-11', - application_name='nrpe', - series='trusty', - channel='stable', - num_units=0, - ) - await model.add_relation( - 'ubuntu', - 'nrpe', - ) - - result, ok = await model.block_until( - lambda: model.matches(goal_state), - timeout=600 - ) - - -if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG) - ws_logger = logging.getLogger('websockets.protocol') - ws_logger.setLevel(logging.INFO) - loop.run(main()) diff --git a/modules/libjuju/examples/leadership.py b/modules/libjuju/examples/leadership.py deleted file mode 100644 index dbd1b6e..0000000 --- a/modules/libjuju/examples/leadership.py +++ /dev/null @@ -1,28 +0,0 @@ -""" -This example: - -1. Connects to the current model. -2. Prints out leadership status for all deployed units in the model. -3. Cleanly disconnects. - -""" -import asyncio - -from juju.model import Model -from juju import loop - -async def report_leadership(): - model = Model() - await model.connect() - - print("Leadership: ") - for app in model.applications.values(): - for unit in app.units: - print("{}: {}".format( - unit.name, await unit.is_leader_from_status())) - - await model.disconnect() - - -if __name__ == '__main__': - loop.run(report_leadership()) diff --git a/modules/libjuju/examples/livemodel.py b/modules/libjuju/examples/livemodel.py deleted file mode 100644 index 1b10ac9..0000000 --- a/modules/libjuju/examples/livemodel.py +++ /dev/null @@ -1,31 +0,0 @@ -""" -This example: - -1. Connects to the current model -2. Watches the model and prints all changes -3. Runs forever (kill with Ctrl-C) - -""" -from juju.model import Model -from juju import loop - - -async def on_model_change(delta, old, new, model): - print(delta.entity, delta.type, delta.data) - print(old) - print(new) - print(model) - - -async def watch_model(): - model = Model() - # connect to current model with current user, per Juju CLI - await model.connect() - - model.add_observer(on_model_change) - - -if __name__ == '__main__': - # Run loop until the process is manually stopped (watch_model will loop - # forever). - loop.run(watch_model()) diff --git a/modules/libjuju/examples/localcharm.py b/modules/libjuju/examples/localcharm.py deleted file mode 100644 index b9481d4..0000000 --- a/modules/libjuju/examples/localcharm.py +++ /dev/null @@ -1,34 +0,0 @@ -""" -This example shows how to deploy a local charm. It: - -1. Connects to current model. -2. Uploads a local charm (directory on filesystem) to the model. -3. Deploys the uploaded charm. - -""" -import asyncio -import logging - -from juju.model import Model -from juju import loop - - -async def main(): - model = Model() - await model.connect() - - # Deploy a local charm using a path to the charm directory - await model.deploy( - '/home/tvansteenburgh/src/charms/ubuntu', - application_name='ubuntu', - series='trusty', - ) - - await model.disconnect() - - -if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG) - ws_logger = logging.getLogger('websockets.protocol') - ws_logger.setLevel(logging.INFO) - loop.run(main()) diff --git a/modules/libjuju/examples/relate.py b/modules/libjuju/examples/relate.py deleted file mode 100644 index 347e021..0000000 --- a/modules/libjuju/examples/relate.py +++ /dev/null @@ -1,102 +0,0 @@ -""" -This example: - -1. Connects to the current model -2. Resets it -3. Deploys two charms and relates them -4. Waits for units to be idle, then exits - -""" -import asyncio -import logging - -from juju.model import Model, ModelObserver -from juju import loop - - -class MyRemoveObserver(ModelObserver): - async def on_change(self, delta, old, new, model): - if delta.type == 'remove': - assert(new.latest() == new) - assert(new.next() is None) - assert(new.dead) - assert(new.current) - assert(new.connected) - assert(new.previous().dead) - assert(not new.previous().current) - assert(not new.previous().connected) - - -class MyModelObserver(ModelObserver): - _shutting_down = False - - async def on_change(self, delta, old, new, model): - if model.units and model.all_units_idle() and not self._shutting_down: - self._shutting_down = True - logging.debug('All units idle, disconnecting') - await model.reset(force=True) - await model.disconnect() - - -async def main(): - model = Model() - # connect to current model with current user, per Juju CLI - await model.connect() - - try: - model.add_observer(MyRemoveObserver()) - await model.reset(force=True) - model.add_observer(MyModelObserver()) - - ubuntu_app = await model.deploy( - 'ubuntu', - application_name='ubuntu', - series='trusty', - channel='stable', - ) - ubuntu_app.on_change(asyncio.coroutine( - lambda delta, old_app, new_app, model: - print('App changed: {}'.format(new_app.entity_id)) - )) - ubuntu_app.on_remove(asyncio.coroutine( - lambda delta, old_app, new_app, model: - print('App removed: {}'.format(old_app.entity_id)) - )) - ubuntu_app.on_unit_add(asyncio.coroutine( - lambda delta, old_unit, new_unit, model: - print('Unit added: {}'.format(new_unit.entity_id)) - )) - ubuntu_app.on_unit_remove(asyncio.coroutine( - lambda delta, old_unit, new_unit, model: - print('Unit removed: {}'.format(old_unit.entity_id)) - )) - unit_a, unit_b = await ubuntu_app.add_units(count=2) - unit_a.on_change(asyncio.coroutine( - lambda delta, old_unit, new_unit, model: - print('Unit changed: {}'.format(new_unit.entity_id)) - )) - await model.deploy( - 'nrpe', - application_name='nrpe', - series='trusty', - channel='stable', - # subordinates must be deployed without units - num_units=0, - ) - my_relation = await model.add_relation( - 'ubuntu', - 'nrpe', - ) - my_relation.on_remove(asyncio.coroutine( - lambda delta, old_rel, new_rel, model: - print('Relation removed: {}'.format(old_rel.endpoints)) - )) - finally: - await model.disconnect() - - -if __name__ == '__main__': - logging.basicConfig(level=logging.INFO) - ws_logger = logging.getLogger('websockets.protocol') - ws_logger.setLevel(logging.INFO) - loop.run(main()) diff --git a/modules/libjuju/examples/unitrun.py b/modules/libjuju/examples/unitrun.py deleted file mode 100644 index 805f0ae..0000000 --- a/modules/libjuju/examples/unitrun.py +++ /dev/null @@ -1,46 +0,0 @@ -""" -This example: - -1. Connects to current model and resets it. -2. Deploys one ubuntu unit. -3. Runs an action against the unit. -4. Waits for the action results to come back, then exits. - -""" -import logging - -from juju.model import Model -from juju import loop - - -async def run_command(unit): - logging.debug('Running command on unit %s', unit.name) - - # unit.run() returns a juju.action.Action instance - action = await unit.run('unit-get public-address') - logging.debug("Action results: %s", action.results) - - -async def main(): - model = Model() - # connect to current model with current user, per Juju CLI - await model.connect() - - app = await model.deploy( - 'ubuntu-0', - application_name='ubuntu', - series='trusty', - channel='stable', - ) - - for unit in app.units: - await run_command(unit) - - await model.disconnect() - - -if __name__ == '__main__': - logging.basicConfig(level=logging.DEBUG) - ws_logger = logging.getLogger('websockets.protocol') - ws_logger.setLevel(logging.INFO) - loop.run(main()) diff --git a/modules/libjuju/juju/__init__.py b/modules/libjuju/juju/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/modules/libjuju/juju/action.py b/modules/libjuju/juju/action.py deleted file mode 100644 index 7a136a7..0000000 --- a/modules/libjuju/juju/action.py +++ /dev/null @@ -1,10 +0,0 @@ -from . import model - - -class Action(model.ModelEntity): - @property - def status(self): - return self.data['status'] - - async def wait(self): - return await self.model.wait_for_action(self.id) diff --git a/modules/libjuju/juju/annotation.py b/modules/libjuju/juju/annotation.py deleted file mode 100644 index 73c9b1c..0000000 --- a/modules/libjuju/juju/annotation.py +++ /dev/null @@ -1,9 +0,0 @@ -import logging - -from . import model - -log = logging.getLogger(__name__) - - -class Annotation(model.ModelEntity): - pass diff --git a/modules/libjuju/juju/application.py b/modules/libjuju/juju/application.py deleted file mode 100644 index 3f7f02e..0000000 --- a/modules/libjuju/juju/application.py +++ /dev/null @@ -1,533 +0,0 @@ -# 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 '[:]' - - """ - 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 '[:]' - - """ - 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 - - async def get_resources(self): - """Return resources for this application. - - Returns a dict mapping resource name to - :class:`~juju._definitions.CharmResource` instances. - """ - 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) diff --git a/modules/libjuju/juju/client/__init__.py b/modules/libjuju/juju/client/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/modules/libjuju/juju/client/_client.py b/modules/libjuju/juju/client/_client.py deleted file mode 100644 index bfa9e6f..0000000 --- a/modules/libjuju/juju/client/_client.py +++ /dev/null @@ -1,454 +0,0 @@ -# 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 import _client2, _client1, _client3, _client4, _client5, _client8, _client7, _client9 - - -CLIENTS = { - "2": _client2, - "1": _client1, - "3": _client3, - "4": _client4, - "5": _client5, - "8": _client8, - "7": _client7, - "9": _client9 -} - - -def lookup_facade(name, version): - """ - Given a facade name and version, attempt to pull that facade out - of the correct client.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 diff --git a/modules/libjuju/juju/client/_client1.py b/modules/libjuju/juju/client/_client1.py deleted file mode 100644 index 83437bc..0000000 --- a/modules/libjuju/juju/client/_client1.py +++ /dev/null @@ -1,11068 +0,0 @@ -# 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'} - - - @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'} - - - @ReturnMapping(AllWatcherNextResults) - async def Next(self): - ''' - - Returns -> typing.Sequence[~Delta] - ''' - # map input types to rpc msg - _params = dict() - 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'} - - - @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='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'} - - - @ReturnMapping(ErrorResults) - async def Rescale(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - 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): - ''' - - 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'} - - - @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='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='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() - 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): - ''' - - Returns -> typing.Sequence[~BackupsMetadataResult] - ''' - # map input types to rpc msg - _params = dict() - 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='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='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'} - - - @ReturnMapping(BundleChangesResults) - async def GetChanges(self, yaml): - ''' - yaml : str - Returns -> typing.Union[typing.Sequence[~BundleChange], typing.Sequence[str]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Bundle', - request='GetChanges', - version=1, - params=_params) - _params['yaml'] = yaml - reply = await self.rpc(msg) - return reply - - - -class CAASAgentFacade(Type): - name = 'CAASAgent' - version = 1 - schema = {'definitions': {'CloudCredential': {'additionalProperties': False, - 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - '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'}, - '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'}, - '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'}, - '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'}, - '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'}, - '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'}, - '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'}, - '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'}, - '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'}, - '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'}, - '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'}, - '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'}, - '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'}, - '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'}, - 'StringsWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - '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'}, - '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': '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'], - 'type': 'object'}, - 'ModelSLAInfo': {'additionalProperties': False, - 'properties': {'level': {'type': 'string'}, - 'owner': {'type': 'string'}}, - 'required': ['level', 'owner'], - 'type': 'object'}, - 'ModelSet': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}}, - 'required': ['config'], - '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'], - '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'}, - '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'}, - 'Placement': {'additionalProperties': False, - 'properties': {'directive': {'type': 'string'}, - 'scope': {'type': 'string'}}, - 'required': ['scope', 'directive'], - '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'], - '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'}}, - 'type': 'object'}, - 'ResolveCharmResults': {'additionalProperties': False, - 'properties': {'urls': {'items': {'$ref': '#/definitions/ResolveCharmResult'}, - 'type': 'array'}}, - 'required': ['urls'], - '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'], - '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'], - 'type': 'object'}, - 'StatusHistoryResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'history': {'$ref': '#/definitions/History'}}, - 'required': ['history'], - 'type': 'object'}, - 'StatusHistoryResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StatusHistoryResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'StatusParams': {'additionalProperties': False, - 'properties': {'patterns': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['patterns'], - 'type': 'object'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - 'type': 'object'}, - 'Tools': {'additionalProperties': False, - 'properties': {'sha256': {'type': 'string'}, - 'size': {'type': 'integer'}, - 'url': {'type': 'string'}, - 'version': {'$ref': '#/definitions/Binary'}}, - 'required': ['version', 'url', 'size'], - 'type': 'object'}, - 'UnitStatus': {'additionalProperties': False, - 'properties': {'agent-status': {'$ref': '#/definitions/DetailedStatus'}, - 'charm': {'type': 'string'}, - 'leader': {'type': 'boolean'}, - 'machine': {'type': 'string'}, - 'opened-ports': {'items': {'type': 'string'}, - 'type': 'array'}, - 'public-address': {'type': 'string'}, - 'subordinates': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, - 'type': 'object'}, - 'workload-status': {'$ref': '#/definitions/DetailedStatus'}, - 'workload-version': {'type': 'string'}}, - 'required': ['agent-status', - 'workload-status', - 'workload-version', - 'machine', - 'opened-ports', - 'public-address', - 'charm', - 'subordinates'], - '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'}}, - 'type': 'object'}}, - 'properties': {'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, - 'type': 'object'}, - 'AbortCurrentUpgrade': {'type': 'object'}, - 'AddCharm': {'properties': {'Params': {'$ref': '#/definitions/AddCharm'}}, - 'type': 'object'}, - 'AddCharmWithAuthorization': {'properties': {'Params': {'$ref': '#/definitions/AddCharmWithAuthorization'}}, - 'type': 'object'}, - 'AddMachines': {'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, - 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, - 'type': 'object'}, - 'AddMachinesV2': {'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, - 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, - 'type': 'object'}, - 'AgentVersion': {'properties': {'Result': {'$ref': '#/definitions/AgentVersionResult'}}, - 'type': 'object'}, - 'CACert': {'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, - 'type': 'object'}, - 'DestroyMachines': {'properties': {'Params': {'$ref': '#/definitions/DestroyMachines'}}, - 'type': 'object'}, - 'FindTools': {'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, - 'Result': {'$ref': '#/definitions/FindToolsResult'}}, - 'type': 'object'}, - 'FullStatus': {'properties': {'Params': {'$ref': '#/definitions/StatusParams'}, - 'Result': {'$ref': '#/definitions/FullStatus'}}, - 'type': 'object'}, - 'GetBundleChanges': {'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, - 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, - 'type': 'object'}, - 'GetModelConstraints': {'properties': {'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, - 'type': 'object'}, - 'InjectMachines': {'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, - 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, - 'type': 'object'}, - 'ModelGet': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, - 'type': 'object'}, - 'ModelInfo': {'properties': {'Result': {'$ref': '#/definitions/ModelInfo'}}, - 'type': 'object'}, - 'ModelSet': {'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, - 'type': 'object'}, - 'ModelUnset': {'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, - 'type': 'object'}, - 'ModelUserInfo': {'properties': {'Result': {'$ref': '#/definitions/ModelUserInfoResults'}}, - 'type': 'object'}, - 'PrivateAddress': {'properties': {'Params': {'$ref': '#/definitions/PrivateAddress'}, - 'Result': {'$ref': '#/definitions/PrivateAddressResults'}}, - 'type': 'object'}, - 'ProvisioningScript': {'properties': {'Params': {'$ref': '#/definitions/ProvisioningScriptParams'}, - 'Result': {'$ref': '#/definitions/ProvisioningScriptResult'}}, - 'type': 'object'}, - 'PublicAddress': {'properties': {'Params': {'$ref': '#/definitions/PublicAddress'}, - 'Result': {'$ref': '#/definitions/PublicAddressResults'}}, - 'type': 'object'}, - 'ResolveCharms': {'properties': {'Params': {'$ref': '#/definitions/ResolveCharms'}, - 'Result': {'$ref': '#/definitions/ResolveCharmResults'}}, - 'type': 'object'}, - 'Resolved': {'properties': {'Params': {'$ref': '#/definitions/Resolved'}}, - 'type': 'object'}, - 'RetryProvisioning': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SLALevel': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, - 'type': 'object'}, - 'SetModelAgentVersion': {'properties': {'Params': {'$ref': '#/definitions/SetModelAgentVersion'}}, - 'type': 'object'}, - 'SetModelConstraints': {'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, - 'type': 'object'}, - 'SetSLALevel': {'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, - 'type': 'object'}, - 'StatusHistory': {'properties': {'Params': {'$ref': '#/definitions/StatusHistoryRequests'}, - 'Result': {'$ref': '#/definitions/StatusHistoryResults'}}, - 'type': 'object'}, - 'WatchAll': {'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(APIHostPortsResult) - async def APIHostPorts(self): - ''' - - Returns -> typing.Sequence[~HostPort] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='APIHostPorts', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def AbortCurrentUpgrade(self): - ''' - - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AbortCurrentUpgrade', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def AddCharm(self, channel, url): - ''' - channel : str - url : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AddCharm', - version=1, - params=_params) - _params['channel'] = channel - _params['url'] = url - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def AddCharmWithAuthorization(self, channel, macaroon, url): - ''' - channel : str - macaroon : Macaroon - url : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AddCharmWithAuthorization', - version=1, - params=_params) - _params['channel'] = channel - _params['macaroon'] = macaroon - _params['url'] = url - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AddMachinesResults) - async def AddMachines(self, params): - ''' - params : typing.Sequence[~AddMachineParams] - Returns -> typing.Sequence[~AddMachinesResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AddMachines', - version=1, - params=_params) - _params['params'] = params - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AddMachinesResults) - async def AddMachinesV2(self, params): - ''' - params : typing.Sequence[~AddMachineParams] - Returns -> typing.Sequence[~AddMachinesResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AddMachinesV2', - version=1, - params=_params) - _params['params'] = params - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AgentVersionResult) - async def AgentVersion(self): - ''' - - Returns -> Number - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AgentVersion', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(BytesResult) - async def CACert(self): - ''' - - Returns -> typing.Sequence[int] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='CACert', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def DestroyMachines(self, force, machine_names): - ''' - force : bool - machine_names : typing.Sequence[str] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='DestroyMachines', - version=1, - params=_params) - _params['force'] = force - _params['machine-names'] = machine_names - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(FindToolsResult) - async def FindTools(self, arch, major, minor, number, series): - ''' - arch : str - major : int - minor : int - number : Number - series : str - Returns -> typing.Union[_ForwardRef('Error'), typing.Sequence[~Tools]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='FindTools', - version=1, - params=_params) - _params['arch'] = arch - _params['major'] = major - _params['minor'] = minor - _params['number'] = number - _params['series'] = series - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(FullStatus) - async def FullStatus(self, patterns): - ''' - patterns : typing.Sequence[str] - Returns -> typing.Union[typing.Mapping[str, ~ApplicationStatus], str, typing.Mapping[str, ~MachineStatus], _ForwardRef('ModelStatusInfo'), typing.Mapping[str, ~ApplicationOfferStatus], typing.Sequence[~RelationStatus], typing.Mapping[str, ~RemoteApplicationStatus]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='FullStatus', - version=1, - params=_params) - _params['patterns'] = patterns - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(BundleChangesResults) - async def GetBundleChanges(self, yaml): - ''' - yaml : str - Returns -> typing.Union[typing.Sequence[~BundleChange], typing.Sequence[str]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='GetBundleChanges', - version=1, - params=_params) - _params['yaml'] = yaml - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(GetConstraintsResults) - async def GetModelConstraints(self): - ''' - - Returns -> Value - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='GetModelConstraints', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AddMachinesResults) - async def InjectMachines(self, params): - ''' - params : typing.Sequence[~AddMachineParams] - Returns -> typing.Sequence[~AddMachinesResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='InjectMachines', - version=1, - params=_params) - _params['params'] = params - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ModelConfigResults) - async def ModelGet(self): - ''' - - Returns -> typing.Mapping[str, ~ConfigValue] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ModelGet', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ModelInfo) - async def ModelInfo(self): - ''' - - Returns -> typing.Union[_ForwardRef('Number'), str, typing.Sequence[~ModelMachineInfo], _ForwardRef('ModelMigrationStatus'), _ForwardRef('ModelSLAInfo'), _ForwardRef('EntityStatus'), typing.Sequence[~ModelUserInfo]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ModelInfo', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def ModelSet(self, config): - ''' - config : typing.Mapping[str, typing.Any] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ModelSet', - version=1, - params=_params) - _params['config'] = config - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def ModelUnset(self, keys): - ''' - keys : typing.Sequence[str] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ModelUnset', - version=1, - params=_params) - _params['keys'] = keys - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ModelUserInfoResults) - async def ModelUserInfo(self): - ''' - - Returns -> typing.Sequence[~ModelUserInfoResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ModelUserInfo', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(PrivateAddressResults) - async def PrivateAddress(self, target): - ''' - target : str - Returns -> str - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='PrivateAddress', - version=1, - params=_params) - _params['target'] = target - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ProvisioningScriptResult) - async def ProvisioningScript(self, data_dir, disable_package_commands, machine_id, nonce): - ''' - data_dir : str - disable_package_commands : bool - machine_id : str - nonce : str - Returns -> str - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ProvisioningScript', - version=1, - params=_params) - _params['data-dir'] = data_dir - _params['disable-package-commands'] = disable_package_commands - _params['machine-id'] = machine_id - _params['nonce'] = nonce - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(PublicAddressResults) - async def PublicAddress(self, target): - ''' - target : str - Returns -> str - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='PublicAddress', - version=1, - params=_params) - _params['target'] = target - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ResolveCharmResults) - async def ResolveCharms(self, references): - ''' - references : typing.Sequence[str] - Returns -> typing.Sequence[~ResolveCharmResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ResolveCharms', - version=1, - params=_params) - _params['references'] = references - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Resolved(self, retry, unit_name): - ''' - retry : bool - unit_name : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='Resolved', - version=1, - params=_params) - _params['retry'] = retry - _params['unit-name'] = unit_name - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def RetryProvisioning(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='RetryProvisioning', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringResult) - async def SLALevel(self): - ''' - - Returns -> typing.Union[_ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='SLALevel', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def SetModelAgentVersion(self, version): - ''' - version : Number - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='SetModelAgentVersion', - version=1, - params=_params) - _params['version'] = version - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def SetModelConstraints(self, application, constraints): - ''' - application : str - constraints : Value - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='SetModelConstraints', - version=1, - params=_params) - _params['application'] = application - _params['constraints'] = constraints - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def SetSLALevel(self, creds, level): - ''' - creds : typing.Sequence[int] - level : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='SetSLALevel', - version=1, - params=_params) - _params['creds'] = creds - _params['level'] = level - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StatusHistoryResults) - async def StatusHistory(self, requests): - ''' - requests : typing.Sequence[~StatusHistoryRequest] - Returns -> typing.Sequence[~StatusHistoryResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='StatusHistory', - version=1, - params=_params) - _params['requests'] = requests - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AllWatcherId) - async def WatchAll(self): - ''' - - Returns -> str - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='WatchAll', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class CloudFacade(Type): - name = 'Cloud' - version = 1 - schema = {'definitions': {'Cloud': {'additionalProperties': False, - 'properties': {'auth-types': {'items': {'type': 'string'}, - 'type': 'array'}, - 'endpoint': {'type': 'string'}, - 'identity-endpoint': {'type': 'string'}, - 'regions': {'items': {'$ref': '#/definitions/CloudRegion'}, - 'type': 'array'}, - 'storage-endpoint': {'type': 'string'}, - 'type': {'type': 'string'}}, - 'required': ['type'], - 'type': 'object'}, - 'CloudCredential': {'additionalProperties': False, - 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'auth-type': {'type': 'string'}, - 'redacted': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['auth-type'], - 'type': 'object'}, - 'CloudCredentialResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/CloudCredential'}}, - 'type': 'object'}, - 'CloudCredentialResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/CloudCredentialResult'}, - 'type': 'array'}}, - 'type': 'object'}, - 'CloudInstanceTypesConstraint': {'additionalProperties': False, - 'properties': {'cloud-tag': {'type': 'string'}, - 'constraints': {'$ref': '#/definitions/Value'}, - 'region': {'type': 'string'}}, - 'required': ['cloud-tag', - 'region'], - 'type': 'object'}, - 'CloudInstanceTypesConstraints': {'additionalProperties': False, - 'properties': {'constraints': {'items': {'$ref': '#/definitions/CloudInstanceTypesConstraint'}, - 'type': 'array'}}, - 'required': ['constraints'], - 'type': 'object'}, - 'CloudRegion': {'additionalProperties': False, - 'properties': {'endpoint': {'type': 'string'}, - 'identity-endpoint': {'type': 'string'}, - 'name': {'type': 'string'}, - 'storage-endpoint': {'type': 'string'}}, - 'required': ['name'], - 'type': 'object'}, - 'CloudResult': {'additionalProperties': False, - 'properties': {'cloud': {'$ref': '#/definitions/Cloud'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'type': 'object'}, - 'CloudResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/CloudResult'}, - 'type': 'array'}}, - 'type': 'object'}, - 'CloudsResult': {'additionalProperties': False, - 'properties': {'clouds': {'patternProperties': {'.*': {'$ref': '#/definitions/Cloud'}}, - 'type': 'object'}}, - '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'}, - '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'}, - 'InstanceType': {'additionalProperties': False, - 'properties': {'arches': {'items': {'type': 'string'}, - 'type': 'array'}, - 'cost': {'type': 'integer'}, - 'cpu-cores': {'type': 'integer'}, - 'deprecated': {'type': 'boolean'}, - 'memory': {'type': 'integer'}, - 'name': {'type': 'string'}, - 'root-disk': {'type': 'integer'}, - 'virt-type': {'type': 'string'}}, - 'required': ['arches', 'cpu-cores', 'memory'], - 'type': 'object'}, - 'InstanceTypesResult': {'additionalProperties': False, - 'properties': {'cost-currency': {'type': 'string'}, - 'cost-divisor': {'type': 'integer'}, - 'cost-unit': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}, - 'instance-types': {'items': {'$ref': '#/definitions/InstanceType'}, - 'type': 'array'}}, - 'type': 'object'}, - 'InstanceTypesResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/InstanceTypesResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, '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'}, - 'StringsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'UpdateCloudCredential': {'additionalProperties': False, - 'properties': {'credential': {'$ref': '#/definitions/CloudCredential'}, - 'tag': {'type': 'string'}}, - 'required': ['tag', 'credential'], - 'type': 'object'}, - 'UpdateCloudCredentials': {'additionalProperties': False, - 'properties': {'credentials': {'items': {'$ref': '#/definitions/UpdateCloudCredential'}, - 'type': 'array'}}, - 'type': 'object'}, - 'UserCloud': {'additionalProperties': False, - 'properties': {'cloud-tag': {'type': 'string'}, - 'user-tag': {'type': 'string'}}, - 'required': ['user-tag', 'cloud-tag'], - 'type': 'object'}, - 'UserClouds': {'additionalProperties': False, - 'properties': {'user-clouds': {'items': {'$ref': '#/definitions/UserCloud'}, - 'type': 'array'}}, - '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'}}, - 'type': 'object'}}, - 'properties': {'Cloud': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/CloudResults'}}, - 'type': 'object'}, - 'Clouds': {'properties': {'Result': {'$ref': '#/definitions/CloudsResult'}}, - 'type': 'object'}, - 'Credential': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/CloudCredentialResults'}}, - 'type': 'object'}, - 'DefaultCloud': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, - 'type': 'object'}, - 'InstanceTypes': {'properties': {'Params': {'$ref': '#/definitions/CloudInstanceTypesConstraints'}, - 'Result': {'$ref': '#/definitions/InstanceTypesResults'}}, - 'type': 'object'}, - 'RevokeCredentials': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'UpdateCredentials': {'properties': {'Params': {'$ref': '#/definitions/UpdateCloudCredentials'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'UserCredentials': {'properties': {'Params': {'$ref': '#/definitions/UserClouds'}, - 'Result': {'$ref': '#/definitions/StringsResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(CloudResults) - async def Cloud(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~CloudResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Cloud', - request='Cloud', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(CloudsResult) - async def Clouds(self): - ''' - - Returns -> typing.Mapping[str, ~Cloud] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Cloud', - request='Clouds', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(CloudCredentialResults) - async def Credential(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~CloudCredentialResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Cloud', - request='Credential', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringResult) - async def DefaultCloud(self): - ''' - - Returns -> typing.Union[_ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Cloud', - request='DefaultCloud', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(InstanceTypesResults) - async def InstanceTypes(self, constraints): - ''' - constraints : typing.Sequence[~CloudInstanceTypesConstraint] - Returns -> typing.Sequence[~InstanceTypesResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Cloud', - request='InstanceTypes', - version=1, - params=_params) - _params['constraints'] = constraints - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def RevokeCredentials(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Cloud', - request='RevokeCredentials', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def UpdateCredentials(self, credentials): - ''' - credentials : typing.Sequence[~UpdateCloudCredential] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Cloud', - request='UpdateCredentials', - version=1, - params=_params) - _params['credentials'] = credentials - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringsResults) - async def UserCredentials(self, user_clouds): - ''' - user_clouds : typing.Sequence[~UserCloud] - Returns -> typing.Sequence[~StringsResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Cloud', - request='UserCredentials', - version=1, - params=_params) - _params['user-clouds'] = user_clouds - reply = await self.rpc(msg) - return reply - - - -class CredentialManagerFacade(Type): - name = 'CredentialManager' - version = 1 - schema = {'definitions': {'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'}, - 'InvalidateCredentialArg': {'additionalProperties': False, - 'properties': {'reason': {'type': 'string'}}, - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}}, - 'properties': {'InvalidateModelCredential': {'properties': {'Params': {'$ref': '#/definitions/InvalidateCredentialArg'}, - 'Result': {'$ref': '#/definitions/ErrorResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResult) - async def InvalidateModelCredential(self, reason): - ''' - reason : str - Returns -> Error - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CredentialManager', - request='InvalidateModelCredential', - version=1, - params=_params) - _params['reason'] = reason - reply = await self.rpc(msg) - return reply - - - -class CrossControllerFacade(Type): - name = 'CrossController' - version = 1 - schema = {'definitions': {'ControllerAPIInfoResult': {'additionalProperties': False, - 'properties': {'addresses': {'items': {'type': 'string'}, - 'type': 'array'}, - 'cacert': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['addresses', - 'cacert'], - 'type': 'object'}, - 'ControllerAPIInfoResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, - 'type': 'array'}}, - 'required': ['results'], - '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'}, - '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'}}, - 'properties': {'ControllerInfo': {'properties': {'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, - 'type': 'object'}, - 'WatchControllerInfo': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ControllerAPIInfoResults) - async def ControllerInfo(self): - ''' - - Returns -> typing.Sequence[~ControllerAPIInfoResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CrossController', - request='ControllerInfo', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResults) - async def WatchControllerInfo(self): - ''' - - Returns -> typing.Sequence[~NotifyWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CrossController', - request='WatchControllerInfo', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class CrossModelRelationsFacade(Type): - name = 'CrossModelRelations' - version = 1 - schema = {'definitions': {'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'}, - 'IngressNetworksChangeEvent': {'additionalProperties': False, - 'properties': {'application-token': {'type': 'string'}, - 'ingress-required': {'type': 'boolean'}, - 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, - 'type': 'array'}, - 'networks': {'items': {'type': 'string'}, - 'type': 'array'}, - 'relation-token': {'type': 'string'}}, - 'required': ['relation-token', - 'application-token', - 'ingress-required'], - 'type': 'object'}, - 'IngressNetworksChanges': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/IngressNetworksChangeEvent'}, - 'type': 'array'}}, - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'OfferArg': {'additionalProperties': False, - 'properties': {'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, - 'type': 'array'}, - 'offer-uuid': {'type': 'string'}}, - 'required': ['offer-uuid'], - 'type': 'object'}, - 'OfferArgs': {'additionalProperties': False, - 'properties': {'args': {'items': {'$ref': '#/definitions/OfferArg'}, - 'type': 'array'}}, - 'required': ['args'], - 'type': 'object'}, - 'OfferStatusChange': {'additionalProperties': False, - 'properties': {'offer-name': {'type': 'string'}, - 'status': {'$ref': '#/definitions/EntityStatus'}}, - 'required': ['offer-name', 'status'], - 'type': 'object'}, - 'OfferStatusWatchResult': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/OfferStatusChange'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}, - 'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id', - 'changes'], - 'type': 'object'}, - 'OfferStatusWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/OfferStatusWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'RegisterRemoteRelationArg': {'additionalProperties': False, - 'properties': {'application-token': {'type': 'string'}, - 'local-endpoint-name': {'type': 'string'}, - 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, - 'type': 'array'}, - 'offer-uuid': {'type': 'string'}, - 'relation-token': {'type': 'string'}, - 'remote-endpoint': {'$ref': '#/definitions/RemoteEndpoint'}, - 'remote-space': {'$ref': '#/definitions/RemoteSpace'}, - 'source-model-tag': {'type': 'string'}}, - 'required': ['application-token', - 'source-model-tag', - 'relation-token', - 'remote-endpoint', - 'remote-space', - 'offer-uuid', - 'local-endpoint-name'], - 'type': 'object'}, - 'RegisterRemoteRelationArgs': {'additionalProperties': False, - 'properties': {'relations': {'items': {'$ref': '#/definitions/RegisterRemoteRelationArg'}, - 'type': 'array'}}, - 'required': ['relations'], - 'type': 'object'}, - 'RegisterRemoteRelationResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/RemoteRelationDetails'}}, - 'type': 'object'}, - 'RegisterRemoteRelationResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/RegisterRemoteRelationResult'}, - 'type': 'array'}}, - 'type': 'object'}, - 'RelationLifeSuspendedStatusChange': {'additionalProperties': False, - 'properties': {'key': {'type': 'string'}, - 'life': {'type': 'string'}, - 'suspended': {'type': 'boolean'}, - 'suspended-reason': {'type': 'string'}}, - 'required': ['key', - 'life', - 'suspended', - 'suspended-reason'], - 'type': 'object'}, - 'RelationLifeSuspendedStatusWatchResult': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/RelationLifeSuspendedStatusChange'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}, - 'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id', - 'changes'], - 'type': 'object'}, - 'RelationStatusWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/RelationLifeSuspendedStatusWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'RelationUnitsChange': {'additionalProperties': False, - 'properties': {'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, - 'type': 'object'}, - 'departed': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['changed'], - 'type': 'object'}, - 'RelationUnitsWatchResult': {'additionalProperties': False, - 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, - 'error': {'$ref': '#/definitions/Error'}, - 'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id', - 'changes'], - 'type': 'object'}, - 'RelationUnitsWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'RemoteEndpoint': {'additionalProperties': False, - 'properties': {'interface': {'type': 'string'}, - 'limit': {'type': 'integer'}, - 'name': {'type': 'string'}, - 'role': {'type': 'string'}}, - 'required': ['name', - 'role', - 'interface', - 'limit'], - 'type': 'object'}, - 'RemoteEntityArg': {'additionalProperties': False, - 'properties': {'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, - 'type': 'array'}, - 'relation-token': {'type': 'string'}}, - 'required': ['relation-token'], - 'type': 'object'}, - 'RemoteEntityArgs': {'additionalProperties': False, - 'properties': {'args': {'items': {'$ref': '#/definitions/RemoteEntityArg'}, - 'type': 'array'}}, - 'required': ['args'], - 'type': 'object'}, - 'RemoteRelationChangeEvent': {'additionalProperties': False, - 'properties': {'application-token': {'type': 'string'}, - 'changed-units': {'items': {'$ref': '#/definitions/RemoteRelationUnitChange'}, - 'type': 'array'}, - 'departed-units': {'items': {'type': 'integer'}, - 'type': 'array'}, - 'force-cleanup': {'type': 'boolean'}, - 'life': {'type': 'string'}, - 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, - 'type': 'array'}, - 'relation-token': {'type': 'string'}, - 'suspended': {'type': 'boolean'}, - 'suspended-reason': {'type': 'string'}}, - 'required': ['relation-token', - 'application-token', - 'life'], - 'type': 'object'}, - 'RemoteRelationDetails': {'additionalProperties': False, - 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, - 'relation-token': {'type': 'string'}}, - 'required': ['relation-token'], - 'type': 'object'}, - 'RemoteRelationUnit': {'additionalProperties': False, - 'properties': {'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, - 'type': 'array'}, - 'relation-token': {'type': 'string'}, - 'unit': {'type': 'string'}}, - 'required': ['relation-token', 'unit'], - 'type': 'object'}, - 'RemoteRelationUnitChange': {'additionalProperties': False, - 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'unit-id': {'type': 'integer'}}, - 'required': ['unit-id'], - 'type': 'object'}, - 'RemoteRelationUnits': {'additionalProperties': False, - 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RemoteRelationUnit'}, - 'type': 'array'}}, - 'required': ['relation-units'], - 'type': 'object'}, - 'RemoteRelationsChanges': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, - 'type': 'array'}}, - 'type': 'object'}, - 'RemoteSpace': {'additionalProperties': False, - 'properties': {'cloud-type': {'type': 'string'}, - 'name': {'type': 'string'}, - 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'provider-id': {'type': 'string'}, - 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, - 'type': 'array'}}, - 'required': ['cloud-type', - 'name', - 'provider-id', - 'provider-attributes', - 'subnets'], - 'type': 'object'}, - 'SettingsResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'settings': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}}, - 'required': ['settings'], - 'type': 'object'}, - 'SettingsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, - 'type': 'array'}}, - 'required': ['results'], - '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'}, - 'StringsWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'Subnet': {'additionalProperties': False, - 'properties': {'cidr': {'type': 'string'}, - 'life': {'type': 'string'}, - 'provider-id': {'type': 'string'}, - 'provider-network-id': {'type': 'string'}, - 'provider-space-id': {'type': 'string'}, - 'space-tag': {'type': 'string'}, - 'status': {'type': 'string'}, - 'vlan-tag': {'type': 'integer'}, - 'zones': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['cidr', - 'vlan-tag', - 'life', - 'space-tag', - 'zones'], - 'type': 'object'}, - 'UnitSettings': {'additionalProperties': False, - 'properties': {'version': {'type': 'integer'}}, - 'required': ['version'], - 'type': 'object'}}, - 'properties': {'PublishIngressNetworkChanges': {'properties': {'Params': {'$ref': '#/definitions/IngressNetworksChanges'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'PublishRelationChanges': {'properties': {'Params': {'$ref': '#/definitions/RemoteRelationsChanges'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'RegisterRemoteRelations': {'properties': {'Params': {'$ref': '#/definitions/RegisterRemoteRelationArgs'}, - 'Result': {'$ref': '#/definitions/RegisterRemoteRelationResults'}}, - 'type': 'object'}, - 'RelationUnitSettings': {'properties': {'Params': {'$ref': '#/definitions/RemoteRelationUnits'}, - 'Result': {'$ref': '#/definitions/SettingsResults'}}, - 'type': 'object'}, - 'WatchEgressAddressesForRelations': {'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, - 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, - 'type': 'object'}, - 'WatchOfferStatus': {'properties': {'Params': {'$ref': '#/definitions/OfferArgs'}, - 'Result': {'$ref': '#/definitions/OfferStatusWatchResults'}}, - 'type': 'object'}, - 'WatchRelationUnits': {'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, - 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, - 'type': 'object'}, - 'WatchRelationsSuspendedStatus': {'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, - 'Result': {'$ref': '#/definitions/RelationStatusWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResults) - async def PublishIngressNetworkChanges(self, changes): - ''' - changes : typing.Sequence[~IngressNetworksChangeEvent] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CrossModelRelations', - request='PublishIngressNetworkChanges', - version=1, - params=_params) - _params['changes'] = changes - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def PublishRelationChanges(self, changes): - ''' - changes : typing.Sequence[~RemoteRelationChangeEvent] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CrossModelRelations', - request='PublishRelationChanges', - version=1, - params=_params) - _params['changes'] = changes - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(RegisterRemoteRelationResults) - async def RegisterRemoteRelations(self, relations): - ''' - relations : typing.Sequence[~RegisterRemoteRelationArg] - Returns -> typing.Sequence[~RegisterRemoteRelationResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CrossModelRelations', - request='RegisterRemoteRelations', - version=1, - params=_params) - _params['relations'] = relations - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(SettingsResults) - async def RelationUnitSettings(self, relation_units): - ''' - relation_units : typing.Sequence[~RemoteRelationUnit] - Returns -> typing.Sequence[~SettingsResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CrossModelRelations', - request='RelationUnitSettings', - version=1, - params=_params) - _params['relation-units'] = relation_units - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringsWatchResults) - async def WatchEgressAddressesForRelations(self, args): - ''' - args : typing.Sequence[~RemoteEntityArg] - Returns -> typing.Sequence[~StringsWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CrossModelRelations', - request='WatchEgressAddressesForRelations', - version=1, - params=_params) - _params['args'] = args - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(OfferStatusWatchResults) - async def WatchOfferStatus(self, args): - ''' - args : typing.Sequence[~OfferArg] - Returns -> typing.Sequence[~OfferStatusWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CrossModelRelations', - request='WatchOfferStatus', - version=1, - params=_params) - _params['args'] = args - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(RelationUnitsWatchResults) - async def WatchRelationUnits(self, args): - ''' - args : typing.Sequence[~RemoteEntityArg] - Returns -> typing.Sequence[~RelationUnitsWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CrossModelRelations', - request='WatchRelationUnits', - version=1, - params=_params) - _params['args'] = args - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(RelationStatusWatchResults) - async def WatchRelationsSuspendedStatus(self, args): - ''' - args : typing.Sequence[~RemoteEntityArg] - Returns -> typing.Sequence[~RelationLifeSuspendedStatusWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CrossModelRelations', - request='WatchRelationsSuspendedStatus', - version=1, - params=_params) - _params['args'] = args - reply = await self.rpc(msg) - return reply - - - -class DeployerFacade(Type): - name = 'Deployer' - 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'}, - 'DeployerConnectionValues': {'additionalProperties': False, - 'properties': {'api-addresses': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['api-addresses'], - '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'}, - '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'}, - 'HostPort': {'additionalProperties': False, - 'properties': {'Address': {'$ref': '#/definitions/Address'}, - 'port': {'type': 'integer'}}, - 'required': ['Address', 'port'], - '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'}, - 'SetStatus': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, - 'type': 'array'}}, - 'required': ['entities'], - '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'}, - 'StringsWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, - 'type': 'object'}, - 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, - 'type': 'object'}, - 'ConnectionInfo': {'properties': {'Result': {'$ref': '#/definitions/DeployerConnectionValues'}}, - 'type': 'object'}, - 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/LifeResults'}}, - 'type': 'object'}, - 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, - 'type': 'object'}, - 'Remove': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SetPasswords': {'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'UpdateStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - '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='Deployer', - 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='Deployer', - request='APIHostPorts', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(DeployerConnectionValues) - async def ConnectionInfo(self): - ''' - - Returns -> typing.Sequence[str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Deployer', - request='ConnectionInfo', - 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='Deployer', - 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='Deployer', - 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='Deployer', - request='Remove', - version=1, - params=_params) - _params['entities'] = entities - 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='Deployer', - request='SetPasswords', - version=1, - params=_params) - _params['changes'] = changes - 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='Deployer', - request='SetStatus', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def UpdateStatus(self, entities): - ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Deployer', - request='UpdateStatus', - 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='Deployer', - 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='Deployer', - request='WatchUnits', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class ExternalControllerUpdaterFacade(Type): - name = 'ExternalControllerUpdater' - 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'}, - 'ExternalControllerInfo': {'additionalProperties': False, - 'properties': {'addrs': {'items': {'type': 'string'}, - 'type': 'array'}, - 'ca-cert': {'type': 'string'}, - 'controller-alias': {'type': 'string'}, - 'controller-tag': {'type': 'string'}}, - 'required': ['controller-tag', - 'controller-alias', - 'addrs', - 'ca-cert'], - 'type': 'object'}, - 'ExternalControllerInfoResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/ExternalControllerInfo'}}, - 'required': ['result', - 'error'], - 'type': 'object'}, - 'ExternalControllerInfoResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ExternalControllerInfoResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'SetExternalControllerInfoParams': {'additionalProperties': False, - 'properties': {'info': {'$ref': '#/definitions/ExternalControllerInfo'}}, - 'required': ['info'], - 'type': 'object'}, - 'SetExternalControllersInfoParams': {'additionalProperties': False, - 'properties': {'controllers': {'items': {'$ref': '#/definitions/SetExternalControllerInfoParams'}, - 'type': 'array'}}, - 'required': ['controllers'], - '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'}, - 'StringsWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'ExternalControllerInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ExternalControllerInfoResults'}}, - 'type': 'object'}, - 'SetExternalControllerInfo': {'properties': {'Params': {'$ref': '#/definitions/SetExternalControllersInfoParams'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'WatchExternalControllers': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ExternalControllerInfoResults) - async def ExternalControllerInfo(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ExternalControllerInfoResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ExternalControllerUpdater', - request='ExternalControllerInfo', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetExternalControllerInfo(self, controllers): - ''' - controllers : typing.Sequence[~SetExternalControllerInfoParams] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ExternalControllerUpdater', - request='SetExternalControllerInfo', - version=1, - params=_params) - _params['controllers'] = controllers - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringsWatchResults) - async def WatchExternalControllers(self): - ''' - - Returns -> typing.Sequence[~StringsWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ExternalControllerUpdater', - request='WatchExternalControllers', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class FanConfigurerFacade(Type): - name = 'FanConfigurer' - version = 1 - schema = {'definitions': {'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'}, - 'FanConfigEntry': {'additionalProperties': False, - 'properties': {'overlay': {'type': 'string'}, - 'underlay': {'type': 'string'}}, - 'required': ['underlay', 'overlay'], - 'type': 'object'}, - 'FanConfigResult': {'additionalProperties': False, - 'properties': {'fans': {'items': {'$ref': '#/definitions/FanConfigEntry'}, - 'type': 'array'}}, - 'required': ['fans'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'NotifyWatchResult': {'additionalProperties': False, - 'properties': {'NotifyWatcherId': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['NotifyWatcherId'], - 'type': 'object'}}, - 'properties': {'FanConfig': {'properties': {'Result': {'$ref': '#/definitions/FanConfigResult'}}, - 'type': 'object'}, - 'WatchForFanConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(FanConfigResult) - async def FanConfig(self): - ''' - - Returns -> typing.Sequence[~FanConfigEntry] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='FanConfigurer', - request='FanConfig', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResult) - async def WatchForFanConfigChanges(self): - ''' - - Returns -> typing.Union[str, _ForwardRef('Error')] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='FanConfigurer', - request='WatchForFanConfigChanges', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class FirewallRulesFacade(Type): - name = 'FirewallRules' - version = 1 - schema = {'definitions': {'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'}, - 'FirewallRule': {'additionalProperties': False, - 'properties': {'known-service': {'type': 'string'}, - 'whitelist-cidrs': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['known-service'], - 'type': 'object'}, - 'FirewallRuleArgs': {'additionalProperties': False, - 'properties': {'args': {'items': {'$ref': '#/definitions/FirewallRule'}, - 'type': 'array'}}, - 'required': ['args'], - 'type': 'object'}, - 'ListFirewallRulesResults': {'additionalProperties': False, - 'properties': {'Rules': {'items': {'$ref': '#/definitions/FirewallRule'}, - 'type': 'array'}}, - 'required': ['Rules'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}}, - 'properties': {'ListFirewallRules': {'properties': {'Result': {'$ref': '#/definitions/ListFirewallRulesResults'}}, - 'type': 'object'}, - 'SetFirewallRules': {'properties': {'Params': {'$ref': '#/definitions/FirewallRuleArgs'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ListFirewallRulesResults) - async def ListFirewallRules(self): - ''' - - Returns -> typing.Sequence[~FirewallRule] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='FirewallRules', - request='ListFirewallRules', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetFirewallRules(self, args): - ''' - args : typing.Sequence[~FirewallRule] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='FirewallRules', - request='SetFirewallRules', - version=1, - params=_params) - _params['args'] = args - reply = await self.rpc(msg) - return reply - - - -class HostKeyReporterFacade(Type): - name = 'HostKeyReporter' - version = 1 - schema = {'definitions': {'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'}, - 'SSHHostKeySet': {'additionalProperties': False, - 'properties': {'entity-keys': {'items': {'$ref': '#/definitions/SSHHostKeys'}, - 'type': 'array'}}, - 'required': ['entity-keys'], - 'type': 'object'}, - 'SSHHostKeys': {'additionalProperties': False, - 'properties': {'public-keys': {'items': {'type': 'string'}, - 'type': 'array'}, - 'tag': {'type': 'string'}}, - 'required': ['tag', 'public-keys'], - 'type': 'object'}}, - 'properties': {'ReportKeys': {'properties': {'Params': {'$ref': '#/definitions/SSHHostKeySet'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResults) - async def ReportKeys(self, entity_keys): - ''' - entity_keys : typing.Sequence[~SSHHostKeys] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='HostKeyReporter', - request='ReportKeys', - version=1, - params=_params) - _params['entity-keys'] = entity_keys - reply = await self.rpc(msg) - return reply - - - -class KeyManagerFacade(Type): - name = 'KeyManager' - 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'}, - 'ListSSHKeys': {'additionalProperties': False, - 'properties': {'entities': {'$ref': '#/definitions/Entities'}, - 'mode': {'type': 'boolean'}}, - 'required': ['entities', 'mode'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'ModifyUserSSHKeys': {'additionalProperties': False, - 'properties': {'ssh-keys': {'items': {'type': 'string'}, - 'type': 'array'}, - 'user': {'type': 'string'}}, - 'required': ['user', 'ssh-keys'], - 'type': 'object'}, - 'StringsResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'StringsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'AddKeys': {'properties': {'Params': {'$ref': '#/definitions/ModifyUserSSHKeys'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'DeleteKeys': {'properties': {'Params': {'$ref': '#/definitions/ModifyUserSSHKeys'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'ImportKeys': {'properties': {'Params': {'$ref': '#/definitions/ModifyUserSSHKeys'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'ListKeys': {'properties': {'Params': {'$ref': '#/definitions/ListSSHKeys'}, - 'Result': {'$ref': '#/definitions/StringsResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResults) - async def AddKeys(self, ssh_keys, user): - ''' - ssh_keys : typing.Sequence[str] - user : str - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='KeyManager', - request='AddKeys', - version=1, - params=_params) - _params['ssh-keys'] = ssh_keys - _params['user'] = user - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def DeleteKeys(self, ssh_keys, user): - ''' - ssh_keys : typing.Sequence[str] - user : str - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='KeyManager', - request='DeleteKeys', - version=1, - params=_params) - _params['ssh-keys'] = ssh_keys - _params['user'] = user - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def ImportKeys(self, ssh_keys, user): - ''' - ssh_keys : typing.Sequence[str] - user : str - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='KeyManager', - request='ImportKeys', - version=1, - params=_params) - _params['ssh-keys'] = ssh_keys - _params['user'] = user - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringsResults) - async def ListKeys(self, entities, mode): - ''' - entities : Entities - mode : bool - Returns -> typing.Sequence[~StringsResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='KeyManager', - request='ListKeys', - version=1, - params=_params) - _params['entities'] = entities - _params['mode'] = mode - reply = await self.rpc(msg) - return reply - - - -class KeyUpdaterFacade(Type): - name = 'KeyUpdater' - 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'}, - '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'}, - 'StringsResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'StringsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'AuthorisedKeys': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/StringsResults'}}, - 'type': 'object'}, - 'WatchAuthorisedKeys': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(StringsResults) - async def AuthorisedKeys(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~StringsResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='KeyUpdater', - request='AuthorisedKeys', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResults) - async def WatchAuthorisedKeys(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~NotifyWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='KeyUpdater', - request='WatchAuthorisedKeys', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class LifeFlagFacade(Type): - name = 'LifeFlag' - 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'}, - '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'}}, - 'properties': {'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/LifeResults'}}, - 'type': 'object'}, - 'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @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='LifeFlag', - 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='LifeFlag', - request='Watch', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class LogForwardingFacade(Type): - name = 'LogForwarding' - version = 1 - schema = {'definitions': {'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'}, - 'LogForwardingGetLastSentParams': {'additionalProperties': False, - 'properties': {'ids': {'items': {'$ref': '#/definitions/LogForwardingID'}, - 'type': 'array'}}, - 'required': ['ids'], - 'type': 'object'}, - 'LogForwardingGetLastSentResult': {'additionalProperties': False, - 'properties': {'err': {'$ref': '#/definitions/Error'}, - 'record-id': {'type': 'integer'}, - 'record-timestamp': {'type': 'integer'}}, - 'required': ['record-id', - 'record-timestamp', - 'err'], - 'type': 'object'}, - 'LogForwardingGetLastSentResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/LogForwardingGetLastSentResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'LogForwardingID': {'additionalProperties': False, - 'properties': {'model': {'type': 'string'}, - 'sink': {'type': 'string'}}, - 'required': ['model', 'sink'], - 'type': 'object'}, - 'LogForwardingSetLastSentParam': {'additionalProperties': False, - 'properties': {'LogForwardingID': {'$ref': '#/definitions/LogForwardingID'}, - 'record-id': {'type': 'integer'}, - 'record-timestamp': {'type': 'integer'}}, - 'required': ['LogForwardingID', - 'record-id', - 'record-timestamp'], - 'type': 'object'}, - 'LogForwardingSetLastSentParams': {'additionalProperties': False, - 'properties': {'params': {'items': {'$ref': '#/definitions/LogForwardingSetLastSentParam'}, - 'type': 'array'}}, - 'required': ['params'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}}, - 'properties': {'GetLastSent': {'properties': {'Params': {'$ref': '#/definitions/LogForwardingGetLastSentParams'}, - 'Result': {'$ref': '#/definitions/LogForwardingGetLastSentResults'}}, - 'type': 'object'}, - 'SetLastSent': {'properties': {'Params': {'$ref': '#/definitions/LogForwardingSetLastSentParams'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(LogForwardingGetLastSentResults) - async def GetLastSent(self, ids): - ''' - ids : typing.Sequence[~LogForwardingID] - Returns -> typing.Sequence[~LogForwardingGetLastSentResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='LogForwarding', - request='GetLastSent', - version=1, - params=_params) - _params['ids'] = ids - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetLastSent(self, params): - ''' - params : typing.Sequence[~LogForwardingSetLastSentParam] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='LogForwarding', - request='SetLastSent', - version=1, - params=_params) - _params['params'] = params - reply = await self.rpc(msg) - return reply - - - -class LoggerFacade(Type): - name = 'Logger' - 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'}, - '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'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - 'type': 'object'}, - 'StringResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'LoggingConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/StringResults'}}, - 'type': 'object'}, - 'WatchLoggingConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(StringResults) - async def LoggingConfig(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~StringResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Logger', - request='LoggingConfig', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResults) - async def WatchLoggingConfig(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~NotifyWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Logger', - request='WatchLoggingConfig', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class MachineActionsFacade(Type): - name = 'MachineActions' - version = 1 - schema = {'definitions': {'Action': {'additionalProperties': False, - 'properties': {'name': {'type': 'string'}, - 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'receiver': {'type': 'string'}, - 'tag': {'type': 'string'}}, - 'required': ['tag', 'receiver', 'name'], - 'type': 'object'}, - 'ActionExecutionResult': {'additionalProperties': False, - 'properties': {'action-tag': {'type': 'string'}, - 'message': {'type': 'string'}, - 'results': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'status': {'type': 'string'}}, - 'required': ['action-tag', 'status'], - 'type': 'object'}, - 'ActionExecutionResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ActionExecutionResult'}, - 'type': 'array'}}, - 'type': 'object'}, - 'ActionResult': {'additionalProperties': False, - 'properties': {'action': {'$ref': '#/definitions/Action'}, - 'completed': {'format': 'date-time', - 'type': 'string'}, - 'enqueued': {'format': 'date-time', - 'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}, - 'message': {'type': 'string'}, - 'output': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'started': {'format': 'date-time', - 'type': 'string'}, - 'status': {'type': 'string'}}, - 'type': 'object'}, - 'ActionResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, - 'type': 'array'}}, - 'type': 'object'}, - 'ActionsByReceiver': {'additionalProperties': False, - 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}, - 'receiver': {'type': 'string'}}, - 'type': 'object'}, - 'ActionsByReceivers': {'additionalProperties': False, - 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByReceiver'}, - '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'}, - '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'}, - 'StringsWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'Actions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ActionResults'}}, - 'type': 'object'}, - 'BeginActions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'FinishActions': {'properties': {'Params': {'$ref': '#/definitions/ActionExecutionResults'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'RunningActions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, - 'type': 'object'}, - 'WatchActionNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ActionResults) - async def Actions(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ActionResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MachineActions', - request='Actions', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def BeginActions(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MachineActions', - request='BeginActions', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def FinishActions(self, results): - ''' - results : typing.Sequence[~ActionExecutionResult] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MachineActions', - request='FinishActions', - version=1, - params=_params) - _params['results'] = results - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ActionsByReceivers) - async def RunningActions(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ActionsByReceiver] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MachineActions', - request='RunningActions', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringsWatchResults) - async def WatchActionNotifications(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~StringsWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MachineActions', - request='WatchActionNotifications', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class MachineUndertakerFacade(Type): - name = 'MachineUndertaker' - version = 1 - schema = {'definitions': {'Entities': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}}, - 'required': ['entities'], - 'type': 'object'}, - 'EntitiesResult': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['entities'], - 'type': 'object'}, - 'EntitiesResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/EntitiesResult'}, - 'type': 'array'}}, - 'required': ['results'], - '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'}, - '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'}, - 'ProviderInterfaceInfo': {'additionalProperties': False, - 'properties': {'interface-name': {'type': 'string'}, - 'mac-address': {'type': 'string'}, - 'provider-id': {'type': 'string'}}, - 'required': ['interface-name', - 'mac-address', - 'provider-id'], - 'type': 'object'}, - 'ProviderInterfaceInfoResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'interfaces': {'items': {'$ref': '#/definitions/ProviderInterfaceInfo'}, - 'type': 'array'}, - 'machine-tag': {'type': 'string'}}, - 'required': ['machine-tag', - 'interfaces'], - 'type': 'object'}, - 'ProviderInterfaceInfoResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ProviderInterfaceInfoResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'AllMachineRemovals': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/EntitiesResults'}}, - 'type': 'object'}, - 'CompleteMachineRemovals': {'properties': {'Params': {'$ref': '#/definitions/Entities'}}, - 'type': 'object'}, - 'GetMachineProviderInterfaceInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ProviderInterfaceInfoResults'}}, - 'type': 'object'}, - 'WatchMachineRemovals': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(EntitiesResults) - async def AllMachineRemovals(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~EntitiesResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MachineUndertaker', - request='AllMachineRemovals', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def CompleteMachineRemovals(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MachineUndertaker', - request='CompleteMachineRemovals', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ProviderInterfaceInfoResults) - async def GetMachineProviderInterfaceInfo(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ProviderInterfaceInfoResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MachineUndertaker', - request='GetMachineProviderInterfaceInfo', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResults) - async def WatchMachineRemovals(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~NotifyWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MachineUndertaker', - request='WatchMachineRemovals', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class MachinerFacade(Type): - name = 'Machiner' - 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'}, - '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'}, - 'HostPort': {'additionalProperties': False, - 'properties': {'Address': {'$ref': '#/definitions/Address'}, - 'port': {'type': 'integer'}}, - 'required': ['Address', 'port'], - 'type': 'object'}, - 'JobsResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'jobs': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['jobs'], - 'type': 'object'}, - 'JobsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/JobsResult'}, - 'type': 'array'}}, - 'required': ['results'], - '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'}, - 'MachineAddresses': {'additionalProperties': False, - 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, - 'type': 'array'}, - 'tag': {'type': 'string'}}, - 'required': ['tag', 'addresses'], - 'type': 'object'}, - 'NetworkConfig': {'additionalProperties': False, - 'properties': {'address': {'type': 'string'}, - 'cidr': {'type': 'string'}, - 'config-type': {'type': 'string'}, - 'device-index': {'type': 'integer'}, - 'disabled': {'type': 'boolean'}, - 'dns-search-domains': {'items': {'type': 'string'}, - 'type': 'array'}, - 'dns-servers': {'items': {'type': 'string'}, - 'type': 'array'}, - 'gateway-address': {'type': 'string'}, - 'interface-name': {'type': 'string'}, - 'interface-type': {'type': 'string'}, - 'is-default-gateway': {'type': 'boolean'}, - 'mac-address': {'type': 'string'}, - 'mtu': {'type': 'integer'}, - 'no-auto-start': {'type': 'boolean'}, - 'parent-interface-name': {'type': 'string'}, - 'provider-address-id': {'type': 'string'}, - 'provider-id': {'type': 'string'}, - 'provider-space-id': {'type': 'string'}, - 'provider-subnet-id': {'type': 'string'}, - 'provider-vlan-id': {'type': 'string'}, - 'routes': {'items': {'$ref': '#/definitions/NetworkRoute'}, - 'type': 'array'}, - 'vlan-tag': {'type': 'integer'}}, - 'required': ['device-index', - 'mac-address', - 'cidr', - 'mtu', - 'provider-id', - 'provider-subnet-id', - 'provider-space-id', - 'provider-address-id', - 'provider-vlan-id', - 'vlan-tag', - 'interface-name', - 'parent-interface-name', - 'interface-type', - 'disabled'], - 'type': 'object'}, - 'NetworkRoute': {'additionalProperties': False, - 'properties': {'destination-cidr': {'type': 'string'}, - 'gateway-ip': {'type': 'string'}, - 'metric': {'type': 'integer'}}, - 'required': ['destination-cidr', - 'gateway-ip', - 'metric'], - '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'}, - 'SetMachineNetworkConfig': {'additionalProperties': False, - 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, - 'type': 'array'}, - 'tag': {'type': 'string'}}, - 'required': ['tag', 'config'], - 'type': 'object'}, - 'SetMachinesAddresses': {'additionalProperties': False, - 'properties': {'machine-addresses': {'items': {'$ref': '#/definitions/MachineAddresses'}, - 'type': 'array'}}, - 'required': ['machine-addresses'], - 'type': 'object'}, - 'SetStatus': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, - 'type': 'array'}}, - 'required': ['entities'], - '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'}}, - 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, - 'type': 'object'}, - 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, - 'type': 'object'}, - 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'Jobs': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/JobsResults'}}, - 'type': 'object'}, - 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/LifeResults'}}, - 'type': 'object'}, - 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, - 'type': 'object'}, - 'SetMachineAddresses': {'properties': {'Params': {'$ref': '#/definitions/SetMachinesAddresses'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SetObservedNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, - 'type': 'object'}, - 'SetProviderNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'UpdateStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, - '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'}}, - '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='Machiner', - 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='Machiner', - request='APIHostPorts', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def EnsureDead(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Machiner', - request='EnsureDead', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(JobsResults) - async def Jobs(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~JobsResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Machiner', - request='Jobs', - 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='Machiner', - 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='Machiner', - request='ModelUUID', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetMachineAddresses(self, machine_addresses): - ''' - machine_addresses : typing.Sequence[~MachineAddresses] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Machiner', - request='SetMachineAddresses', - version=1, - params=_params) - _params['machine-addresses'] = machine_addresses - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def SetObservedNetworkConfig(self, config, tag): - ''' - config : typing.Sequence[~NetworkConfig] - tag : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Machiner', - request='SetObservedNetworkConfig', - version=1, - params=_params) - _params['config'] = config - _params['tag'] = tag - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetProviderNetworkConfig(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Machiner', - request='SetProviderNetworkConfig', - version=1, - params=_params) - _params['entities'] = entities - 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='Machiner', - request='SetStatus', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def UpdateStatus(self, entities): - ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Machiner', - request='UpdateStatus', - 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='Machiner', - 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='Machiner', - request='WatchAPIHostPorts', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class MeterStatusFacade(Type): - name = 'MeterStatus' - 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'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'MeterStatusResult': {'additionalProperties': False, - 'properties': {'code': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}, - 'info': {'type': 'string'}}, - 'required': ['code', 'info'], - 'type': 'object'}, - 'MeterStatusResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, - 'type': 'array'}}, - 'required': ['results'], - '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'}}, - 'properties': {'GetMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, - 'type': 'object'}, - 'WatchMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(MeterStatusResults) - async def GetMeterStatus(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~MeterStatusResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MeterStatus', - request='GetMeterStatus', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResults) - async def WatchMeterStatus(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~NotifyWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MeterStatus', - request='WatchMeterStatus', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class MetricsManagerFacade(Type): - name = 'MetricsManager' - 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'}}, - 'properties': {'AddJujuMachineMetrics': {'type': 'object'}, - 'CleanupOldMetrics': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SendMetrics': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(None) - async def AddJujuMachineMetrics(self): - ''' - - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MetricsManager', - request='AddJujuMachineMetrics', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def CleanupOldMetrics(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MetricsManager', - request='CleanupOldMetrics', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SendMetrics(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MetricsManager', - request='SendMetrics', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class MigrationFlagFacade(Type): - name = 'MigrationFlag' - 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'}, - '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'}, - 'PhaseResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'phase': {'type': 'string'}}, - 'type': 'object'}, - 'PhaseResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/PhaseResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'Phase': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/PhaseResults'}}, - 'type': 'object'}, - 'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(PhaseResults) - async def Phase(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~PhaseResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationFlag', - request='Phase', - 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='MigrationFlag', - request='Watch', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class MigrationMasterFacade(Type): - name = 'MigrationMaster' - version = 1 - schema = {'definitions': {'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'}, - 'MasterMigrationStatus': {'additionalProperties': False, - 'properties': {'migration-id': {'type': 'string'}, - 'phase': {'type': 'string'}, - 'phase-changed-time': {'format': 'date-time', - 'type': 'string'}, - 'spec': {'$ref': '#/definitions/MigrationSpec'}}, - 'required': ['spec', - 'migration-id', - 'phase', - 'phase-changed-time'], - 'type': 'object'}, - 'MigrationModelInfo': {'additionalProperties': False, - 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, - 'controller-agent-version': {'$ref': '#/definitions/Number'}, - 'name': {'type': 'string'}, - 'owner-tag': {'type': 'string'}, - 'uuid': {'type': 'string'}}, - 'required': ['uuid', - 'name', - 'owner-tag', - 'agent-version', - 'controller-agent-version'], - 'type': 'object'}, - 'MigrationSpec': {'additionalProperties': False, - 'properties': {'model-tag': {'type': 'string'}, - 'target-info': {'$ref': '#/definitions/MigrationTargetInfo'}}, - 'required': ['model-tag', 'target-info'], - 'type': 'object'}, - 'MigrationTargetInfo': {'additionalProperties': False, - 'properties': {'addrs': {'items': {'type': 'string'}, - 'type': 'array'}, - 'auth-tag': {'type': 'string'}, - 'ca-cert': {'type': 'string'}, - 'controller-tag': {'type': 'string'}, - 'macaroons': {'type': 'string'}, - 'password': {'type': 'string'}}, - 'required': ['controller-tag', - 'addrs', - 'ca-cert', - 'auth-tag'], - 'type': 'object'}, - 'MinionReports': {'additionalProperties': False, - 'properties': {'failed': {'items': {'type': 'string'}, - 'type': 'array'}, - 'migration-id': {'type': 'string'}, - 'phase': {'type': 'string'}, - 'success-count': {'type': 'integer'}, - 'unknown-count': {'type': 'integer'}, - 'unknown-sample': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['migration-id', - 'phase', - 'success-count', - 'unknown-count', - 'unknown-sample', - 'failed'], - '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'}, - 'SerializedModel': {'additionalProperties': False, - 'properties': {'bytes': {'items': {'type': 'integer'}, - 'type': 'array'}, - 'charms': {'items': {'type': 'string'}, - 'type': 'array'}, - 'resources': {'items': {'$ref': '#/definitions/SerializedModelResource'}, - 'type': 'array'}, - 'tools': {'items': {'$ref': '#/definitions/SerializedModelTools'}, - 'type': 'array'}}, - 'required': ['bytes', - 'charms', - 'tools', - 'resources'], - 'type': 'object'}, - 'SerializedModelResource': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'application-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, - 'charmstore-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, - 'name': {'type': 'string'}, - 'unit-revisions': {'patternProperties': {'.*': {'$ref': '#/definitions/SerializedModelResourceRevision'}}, - 'type': 'object'}}, - 'required': ['application', - 'name', - 'application-revision', - 'charmstore-revision', - 'unit-revisions'], - 'type': 'object'}, - 'SerializedModelResourceRevision': {'additionalProperties': False, - 'properties': {'description': {'type': 'string'}, - 'fingerprint': {'type': 'string'}, - 'origin': {'type': 'string'}, - 'path': {'type': 'string'}, - 'revision': {'type': 'integer'}, - 'size': {'type': 'integer'}, - 'timestamp': {'format': 'date-time', - 'type': 'string'}, - 'type': {'type': 'string'}, - 'username': {'type': 'string'}}, - 'required': ['revision', - 'type', - 'path', - 'description', - 'origin', - 'fingerprint', - 'size', - 'timestamp'], - 'type': 'object'}, - 'SerializedModelTools': {'additionalProperties': False, - 'properties': {'uri': {'type': 'string'}, - 'version': {'type': 'string'}}, - 'required': ['version', 'uri'], - 'type': 'object'}, - 'SetMigrationPhaseArgs': {'additionalProperties': False, - 'properties': {'phase': {'type': 'string'}}, - 'required': ['phase'], - 'type': 'object'}, - 'SetMigrationStatusMessageArgs': {'additionalProperties': False, - 'properties': {'message': {'type': 'string'}}, - 'required': ['message'], - 'type': 'object'}}, - 'properties': {'Export': {'properties': {'Result': {'$ref': '#/definitions/SerializedModel'}}, - 'type': 'object'}, - 'MigrationStatus': {'properties': {'Result': {'$ref': '#/definitions/MasterMigrationStatus'}}, - 'type': 'object'}, - 'MinionReports': {'properties': {'Result': {'$ref': '#/definitions/MinionReports'}}, - 'type': 'object'}, - 'ModelInfo': {'properties': {'Result': {'$ref': '#/definitions/MigrationModelInfo'}}, - 'type': 'object'}, - 'Prechecks': {'type': 'object'}, - 'Reap': {'type': 'object'}, - 'SetPhase': {'properties': {'Params': {'$ref': '#/definitions/SetMigrationPhaseArgs'}}, - 'type': 'object'}, - 'SetStatusMessage': {'properties': {'Params': {'$ref': '#/definitions/SetMigrationStatusMessageArgs'}}, - 'type': 'object'}, - 'Watch': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, - 'type': 'object'}, - 'WatchMinionReports': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(SerializedModel) - async def Export(self): - ''' - - Returns -> typing.Union[typing.Sequence[int], typing.Sequence[str], typing.Sequence[~SerializedModelTools]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationMaster', - request='Export', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(MasterMigrationStatus) - async def MigrationStatus(self): - ''' - - Returns -> typing.Union[str, _ForwardRef('MigrationSpec')] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationMaster', - request='MigrationStatus', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(MinionReports) - async def MinionReports(self): - ''' - - Returns -> typing.Union[typing.Sequence[str], str, int] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationMaster', - request='MinionReports', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(MigrationModelInfo) - async def ModelInfo(self): - ''' - - Returns -> typing.Union[_ForwardRef('Number'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationMaster', - request='ModelInfo', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Prechecks(self): - ''' - - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationMaster', - request='Prechecks', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Reap(self): - ''' - - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationMaster', - request='Reap', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def SetPhase(self, phase): - ''' - phase : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationMaster', - request='SetPhase', - version=1, - params=_params) - _params['phase'] = phase - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def SetStatusMessage(self, message): - ''' - message : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationMaster', - request='SetStatusMessage', - version=1, - params=_params) - _params['message'] = message - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResult) - async def Watch(self): - ''' - - Returns -> typing.Union[str, _ForwardRef('Error')] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationMaster', - request='Watch', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResult) - async def WatchMinionReports(self): - ''' - - Returns -> typing.Union[str, _ForwardRef('Error')] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationMaster', - request='WatchMinionReports', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class MigrationMinionFacade(Type): - name = 'MigrationMinion' - version = 1 - schema = {'definitions': {'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'}, - 'MinionReport': {'additionalProperties': False, - 'properties': {'migration-id': {'type': 'string'}, - 'phase': {'type': 'string'}, - 'success': {'type': 'boolean'}}, - 'required': ['migration-id', - 'phase', - 'success'], - 'type': 'object'}, - 'NotifyWatchResult': {'additionalProperties': False, - 'properties': {'NotifyWatcherId': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['NotifyWatcherId'], - 'type': 'object'}}, - 'properties': {'Report': {'properties': {'Params': {'$ref': '#/definitions/MinionReport'}}, - 'type': 'object'}, - 'Watch': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(None) - async def Report(self, migration_id, phase, success): - ''' - migration_id : str - phase : str - success : bool - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationMinion', - request='Report', - version=1, - params=_params) - _params['migration-id'] = migration_id - _params['phase'] = phase - _params['success'] = success - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResult) - async def Watch(self): - ''' - - Returns -> typing.Union[str, _ForwardRef('Error')] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationMinion', - request='Watch', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class MigrationStatusWatcherFacade(Type): - name = 'MigrationStatusWatcher' - version = 1 - schema = {'definitions': {'MigrationStatus': {'additionalProperties': False, - 'properties': {'attempt': {'type': 'integer'}, - 'migration-id': {'type': 'string'}, - 'phase': {'type': 'string'}, - 'source-api-addrs': {'items': {'type': 'string'}, - 'type': 'array'}, - 'source-ca-cert': {'type': 'string'}, - 'target-api-addrs': {'items': {'type': 'string'}, - 'type': 'array'}, - 'target-ca-cert': {'type': 'string'}}, - 'required': ['migration-id', - 'attempt', - 'phase', - 'source-api-addrs', - 'source-ca-cert', - 'target-api-addrs', - 'target-ca-cert'], - 'type': 'object'}}, - 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/MigrationStatus'}}, - 'type': 'object'}, - 'Stop': {'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(MigrationStatus) - async def Next(self): - ''' - - Returns -> typing.Union[int, str, typing.Sequence[str]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationStatusWatcher', - 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='MigrationStatusWatcher', - request='Stop', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class MigrationTargetFacade(Type): - name = 'MigrationTarget' - version = 1 - schema = {'definitions': {'AdoptResourcesArgs': {'additionalProperties': False, - 'properties': {'model-tag': {'type': 'string'}, - 'source-controller-version': {'$ref': '#/definitions/Number'}}, - 'required': ['model-tag', - 'source-controller-version'], - 'type': 'object'}, - 'BytesResult': {'additionalProperties': False, - 'properties': {'result': {'items': {'type': 'integer'}, - 'type': 'array'}}, - 'required': ['result'], - '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'}, - 'MigrationModelInfo': {'additionalProperties': False, - 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, - 'controller-agent-version': {'$ref': '#/definitions/Number'}, - 'name': {'type': 'string'}, - 'owner-tag': {'type': 'string'}, - 'uuid': {'type': 'string'}}, - 'required': ['uuid', - 'name', - 'owner-tag', - 'agent-version', - 'controller-agent-version'], - 'type': 'object'}, - 'ModelArgs': {'additionalProperties': False, - 'properties': {'model-tag': {'type': 'string'}}, - 'required': ['model-tag'], - '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'}, - 'SerializedModel': {'additionalProperties': False, - 'properties': {'bytes': {'items': {'type': 'integer'}, - 'type': 'array'}, - 'charms': {'items': {'type': 'string'}, - 'type': 'array'}, - 'resources': {'items': {'$ref': '#/definitions/SerializedModelResource'}, - 'type': 'array'}, - 'tools': {'items': {'$ref': '#/definitions/SerializedModelTools'}, - 'type': 'array'}}, - 'required': ['bytes', - 'charms', - 'tools', - 'resources'], - 'type': 'object'}, - 'SerializedModelResource': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'application-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, - 'charmstore-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, - 'name': {'type': 'string'}, - 'unit-revisions': {'patternProperties': {'.*': {'$ref': '#/definitions/SerializedModelResourceRevision'}}, - 'type': 'object'}}, - 'required': ['application', - 'name', - 'application-revision', - 'charmstore-revision', - 'unit-revisions'], - 'type': 'object'}, - 'SerializedModelResourceRevision': {'additionalProperties': False, - 'properties': {'description': {'type': 'string'}, - 'fingerprint': {'type': 'string'}, - 'origin': {'type': 'string'}, - 'path': {'type': 'string'}, - 'revision': {'type': 'integer'}, - 'size': {'type': 'integer'}, - 'timestamp': {'format': 'date-time', - 'type': 'string'}, - 'type': {'type': 'string'}, - 'username': {'type': 'string'}}, - 'required': ['revision', - 'type', - 'path', - 'description', - 'origin', - 'fingerprint', - 'size', - 'timestamp'], - 'type': 'object'}, - 'SerializedModelTools': {'additionalProperties': False, - 'properties': {'uri': {'type': 'string'}, - 'version': {'type': 'string'}}, - 'required': ['version', 'uri'], - 'type': 'object'}}, - 'properties': {'Abort': {'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}}, - 'type': 'object'}, - 'Activate': {'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}}, - 'type': 'object'}, - 'AdoptResources': {'properties': {'Params': {'$ref': '#/definitions/AdoptResourcesArgs'}}, - 'type': 'object'}, - 'CACert': {'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, - 'type': 'object'}, - 'CheckMachines': {'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'Import': {'properties': {'Params': {'$ref': '#/definitions/SerializedModel'}}, - 'type': 'object'}, - 'LatestLogTime': {'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}, - 'Result': {'format': 'date-time', - 'type': 'string'}}, - 'type': 'object'}, - 'Prechecks': {'properties': {'Params': {'$ref': '#/definitions/MigrationModelInfo'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(None) - async def Abort(self, model_tag): - ''' - model_tag : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationTarget', - request='Abort', - version=1, - params=_params) - _params['model-tag'] = model_tag - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Activate(self, model_tag): - ''' - model_tag : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationTarget', - request='Activate', - version=1, - params=_params) - _params['model-tag'] = model_tag - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def AdoptResources(self, model_tag, source_controller_version): - ''' - model_tag : str - source_controller_version : Number - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationTarget', - request='AdoptResources', - version=1, - params=_params) - _params['model-tag'] = model_tag - _params['source-controller-version'] = source_controller_version - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(BytesResult) - async def CACert(self): - ''' - - Returns -> typing.Sequence[int] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationTarget', - request='CACert', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def CheckMachines(self, model_tag): - ''' - model_tag : str - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationTarget', - request='CheckMachines', - version=1, - params=_params) - _params['model-tag'] = model_tag - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Import(self, bytes_, charms, tools): - ''' - bytes_ : typing.Sequence[int] - charms : typing.Sequence[str] - tools : typing.Sequence[~SerializedModelTools] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationTarget', - request='Import', - version=1, - params=_params) - _params['bytes'] = bytes_ - _params['charms'] = charms - _params['tools'] = tools - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(str) - async def LatestLogTime(self, model_tag): - ''' - model_tag : str - Returns -> str - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationTarget', - request='LatestLogTime', - version=1, - params=_params) - _params['model-tag'] = model_tag - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Prechecks(self, agent_version, name, owner_tag, uuid): - ''' - agent_version : Number - name : str - owner_tag : str - uuid : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='MigrationTarget', - request='Prechecks', - version=1, - params=_params) - _params['agent-version'] = agent_version - _params['name'] = name - _params['owner-tag'] = owner_tag - _params['uuid'] = uuid - reply = await self.rpc(msg) - return reply - - - -class ModelConfigFacade(Type): - name = 'ModelConfig' - version = 1 - schema = {'definitions': {'ConfigValue': {'additionalProperties': False, - 'properties': {'source': {'type': 'string'}, - 'value': {'additionalProperties': True, - 'type': 'object'}}, - 'required': ['value', 'source'], - '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'}, - 'ModelConfigResults': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, - 'type': 'object'}}, - 'required': ['config'], - 'type': 'object'}, - 'ModelSLA': {'additionalProperties': False, - 'properties': {'ModelSLAInfo': {'$ref': '#/definitions/ModelSLAInfo'}, - 'creds': {'items': {'type': 'integer'}, - 'type': 'array'}}, - 'required': ['ModelSLAInfo', 'creds'], - 'type': 'object'}, - 'ModelSLAInfo': {'additionalProperties': False, - 'properties': {'level': {'type': 'string'}, - 'owner': {'type': 'string'}}, - 'required': ['level', 'owner'], - 'type': 'object'}, - 'ModelSet': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}}, - 'required': ['config'], - 'type': 'object'}, - 'ModelUnset': {'additionalProperties': False, - 'properties': {'keys': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['keys'], - 'type': 'object'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - 'type': 'object'}}, - 'properties': {'ModelGet': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, - 'type': 'object'}, - 'ModelSet': {'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, - 'type': 'object'}, - 'ModelUnset': {'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, - 'type': 'object'}, - 'SLALevel': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, - 'type': 'object'}, - 'SetSLALevel': {'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ModelConfigResults) - async def ModelGet(self): - ''' - - Returns -> typing.Mapping[str, ~ConfigValue] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelConfig', - request='ModelGet', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def ModelSet(self, config): - ''' - config : typing.Mapping[str, typing.Any] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelConfig', - request='ModelSet', - version=1, - params=_params) - _params['config'] = config - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def ModelUnset(self, keys): - ''' - keys : typing.Sequence[str] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelConfig', - request='ModelUnset', - version=1, - params=_params) - _params['keys'] = keys - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringResult) - async def SLALevel(self): - ''' - - Returns -> typing.Union[_ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelConfig', - request='SLALevel', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def SetSLALevel(self, creds, level): - ''' - creds : typing.Sequence[int] - level : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelConfig', - request='SetSLALevel', - version=1, - params=_params) - _params['creds'] = creds - _params['level'] = level - reply = await self.rpc(msg) - return reply - - - -class ModelUpgraderFacade(Type): - name = 'ModelUpgrader' - 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'}, - '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'}, - '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'}, - 'SetModelEnvironVersion': {'additionalProperties': False, - 'properties': {'model-tag': {'type': 'string'}, - 'version': {'type': 'integer'}}, - 'required': ['model-tag', - 'version'], - 'type': 'object'}, - 'SetModelEnvironVersions': {'additionalProperties': False, - 'properties': {'models': {'items': {'$ref': '#/definitions/SetModelEnvironVersion'}, - 'type': 'array'}}, - 'type': 'object'}, - 'SetStatus': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, - 'type': 'array'}}, - 'required': ['entities'], - 'type': 'object'}}, - 'properties': {'ModelEnvironVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/IntResults'}}, - 'type': 'object'}, - 'ModelTargetEnvironVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/IntResults'}}, - 'type': 'object'}, - 'SetModelEnvironVersion': {'properties': {'Params': {'$ref': '#/definitions/SetModelEnvironVersions'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SetModelStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'WatchModelEnvironVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(IntResults) - async def ModelEnvironVersion(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~IntResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelUpgrader', - request='ModelEnvironVersion', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(IntResults) - async def ModelTargetEnvironVersion(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~IntResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelUpgrader', - request='ModelTargetEnvironVersion', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetModelEnvironVersion(self, models): - ''' - models : typing.Sequence[~SetModelEnvironVersion] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelUpgrader', - request='SetModelEnvironVersion', - version=1, - params=_params) - _params['models'] = models - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetModelStatus(self, entities): - ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelUpgrader', - request='SetModelStatus', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResults) - async def WatchModelEnvironVersion(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~NotifyWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelUpgrader', - request='WatchModelEnvironVersion', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class NotifyWatcherFacade(Type): - name = 'NotifyWatcher' - version = 1 - schema = {'properties': {'Next': {'type': 'object'}, 'Stop': {'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(None) - async def Next(self): - ''' - - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='NotifyWatcher', - 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='NotifyWatcher', - request='Stop', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class OfferStatusWatcherFacade(Type): - name = 'OfferStatusWatcher' - version = 1 - schema = {'definitions': {'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'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'OfferStatusChange': {'additionalProperties': False, - 'properties': {'offer-name': {'type': 'string'}, - 'status': {'$ref': '#/definitions/EntityStatus'}}, - 'required': ['offer-name', 'status'], - 'type': 'object'}, - 'OfferStatusWatchResult': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/OfferStatusChange'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}, - 'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id', - 'changes'], - 'type': 'object'}}, - 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/OfferStatusWatchResult'}}, - 'type': 'object'}, - 'Stop': {'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(OfferStatusWatchResult) - async def Next(self): - ''' - - Returns -> typing.Union[typing.Sequence[~OfferStatusChange], _ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='OfferStatusWatcher', - 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='OfferStatusWatcher', - request='Stop', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class PayloadsFacade(Type): - name = 'Payloads' - version = 1 - schema = {'definitions': {'Payload': {'additionalProperties': False, - 'properties': {'class': {'type': 'string'}, - 'id': {'type': 'string'}, - 'labels': {'items': {'type': 'string'}, - 'type': 'array'}, - 'machine': {'type': 'string'}, - 'status': {'type': 'string'}, - 'type': {'type': 'string'}, - 'unit': {'type': 'string'}}, - 'required': ['class', - 'type', - 'id', - 'status', - 'labels', - 'unit', - 'machine'], - 'type': 'object'}, - 'PayloadListArgs': {'additionalProperties': False, - 'properties': {'patterns': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['patterns'], - 'type': 'object'}, - 'PayloadListResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/Payload'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'List': {'properties': {'Params': {'$ref': '#/definitions/PayloadListArgs'}, - 'Result': {'$ref': '#/definitions/PayloadListResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(PayloadListResults) - async def List(self, patterns): - ''' - patterns : typing.Sequence[str] - Returns -> typing.Sequence[~Payload] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Payloads', - request='List', - version=1, - params=_params) - _params['patterns'] = patterns - reply = await self.rpc(msg) - return reply - - - -class PayloadsHookContextFacade(Type): - name = 'PayloadsHookContext' - 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'}, - 'LookUpPayloadArg': {'additionalProperties': False, - 'properties': {'id': {'type': 'string'}, - 'name': {'type': 'string'}}, - 'required': ['name', 'id'], - 'type': 'object'}, - 'LookUpPayloadArgs': {'additionalProperties': False, - 'properties': {'args': {'items': {'$ref': '#/definitions/LookUpPayloadArg'}, - 'type': 'array'}}, - 'required': ['args'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'Payload': {'additionalProperties': False, - 'properties': {'class': {'type': 'string'}, - 'id': {'type': 'string'}, - 'labels': {'items': {'type': 'string'}, - 'type': 'array'}, - 'machine': {'type': 'string'}, - 'status': {'type': 'string'}, - 'type': {'type': 'string'}, - 'unit': {'type': 'string'}}, - 'required': ['class', - 'type', - 'id', - 'status', - 'labels', - 'unit', - 'machine'], - 'type': 'object'}, - 'PayloadResult': {'additionalProperties': False, - 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, - 'error': {'$ref': '#/definitions/Error'}, - 'not-found': {'type': 'boolean'}, - 'payload': {'$ref': '#/definitions/Payload'}}, - 'required': ['Entity', - 'payload', - 'not-found'], - 'type': 'object'}, - 'PayloadResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/PayloadResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'SetPayloadStatusArg': {'additionalProperties': False, - 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, - 'status': {'type': 'string'}}, - 'required': ['Entity', 'status'], - 'type': 'object'}, - 'SetPayloadStatusArgs': {'additionalProperties': False, - 'properties': {'args': {'items': {'$ref': '#/definitions/SetPayloadStatusArg'}, - 'type': 'array'}}, - 'required': ['args'], - 'type': 'object'}, - 'TrackPayloadArgs': {'additionalProperties': False, - 'properties': {'payloads': {'items': {'$ref': '#/definitions/Payload'}, - 'type': 'array'}}, - 'required': ['payloads'], - 'type': 'object'}}, - 'properties': {'List': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/PayloadResults'}}, - 'type': 'object'}, - 'LookUp': {'properties': {'Params': {'$ref': '#/definitions/LookUpPayloadArgs'}, - 'Result': {'$ref': '#/definitions/PayloadResults'}}, - 'type': 'object'}, - 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetPayloadStatusArgs'}, - 'Result': {'$ref': '#/definitions/PayloadResults'}}, - 'type': 'object'}, - 'Track': {'properties': {'Params': {'$ref': '#/definitions/TrackPayloadArgs'}, - 'Result': {'$ref': '#/definitions/PayloadResults'}}, - 'type': 'object'}, - 'Untrack': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/PayloadResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(PayloadResults) - async def List(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~PayloadResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='PayloadsHookContext', - request='List', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(PayloadResults) - async def LookUp(self, args): - ''' - args : typing.Sequence[~LookUpPayloadArg] - Returns -> typing.Sequence[~PayloadResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='PayloadsHookContext', - request='LookUp', - version=1, - params=_params) - _params['args'] = args - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(PayloadResults) - async def SetStatus(self, args): - ''' - args : typing.Sequence[~SetPayloadStatusArg] - Returns -> typing.Sequence[~PayloadResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='PayloadsHookContext', - request='SetStatus', - version=1, - params=_params) - _params['args'] = args - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(PayloadResults) - async def Track(self, payloads): - ''' - payloads : typing.Sequence[~Payload] - Returns -> typing.Sequence[~PayloadResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='PayloadsHookContext', - request='Track', - version=1, - params=_params) - _params['payloads'] = payloads - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(PayloadResults) - async def Untrack(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~PayloadResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='PayloadsHookContext', - request='Untrack', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class PingerFacade(Type): - name = 'Pinger' - version = 1 - schema = {'properties': {'Ping': {'type': 'object'}, 'Stop': {'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(None) - async def Ping(self): - ''' - - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Pinger', - request='Ping', - 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='Pinger', - request='Stop', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class ProxyUpdaterFacade(Type): - name = 'ProxyUpdater' - 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'}, - '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'}, - 'ProxyConfig': {'additionalProperties': False, - 'properties': {'ftp': {'type': 'string'}, - 'http': {'type': 'string'}, - 'https': {'type': 'string'}, - 'no-proxy': {'type': 'string'}}, - 'required': ['http', - 'https', - 'ftp', - 'no-proxy'], - 'type': 'object'}, - 'ProxyConfigResult': {'additionalProperties': False, - 'properties': {'apt-proxy-settings': {'$ref': '#/definitions/ProxyConfig'}, - 'error': {'$ref': '#/definitions/Error'}, - 'proxy-settings': {'$ref': '#/definitions/ProxyConfig'}}, - 'required': ['proxy-settings', - 'apt-proxy-settings'], - 'type': 'object'}, - 'ProxyConfigResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ProxyConfigResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'ProxyConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ProxyConfigResults'}}, - 'type': 'object'}, - 'WatchForProxyConfigAndAPIHostPortChanges': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ProxyConfigResults) - async def ProxyConfig(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ProxyConfigResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ProxyUpdater', - request='ProxyConfig', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResults) - async def WatchForProxyConfigAndAPIHostPortChanges(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~NotifyWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ProxyUpdater', - request='WatchForProxyConfigAndAPIHostPortChanges', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class RelationStatusWatcherFacade(Type): - name = 'RelationStatusWatcher' - version = 1 - schema = {'definitions': {'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'}, - 'RelationLifeSuspendedStatusChange': {'additionalProperties': False, - 'properties': {'key': {'type': 'string'}, - 'life': {'type': 'string'}, - 'suspended': {'type': 'boolean'}, - 'suspended-reason': {'type': 'string'}}, - 'required': ['key', - 'life', - 'suspended', - 'suspended-reason'], - 'type': 'object'}, - 'RelationLifeSuspendedStatusWatchResult': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/RelationLifeSuspendedStatusChange'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}, - 'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id', - 'changes'], - 'type': 'object'}}, - 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/RelationLifeSuspendedStatusWatchResult'}}, - 'type': 'object'}, - 'Stop': {'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(RelationLifeSuspendedStatusWatchResult) - async def Next(self): - ''' - - Returns -> typing.Union[typing.Sequence[~RelationLifeSuspendedStatusChange], _ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RelationStatusWatcher', - 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='RelationStatusWatcher', - request='Stop', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class RelationUnitsWatcherFacade(Type): - name = 'RelationUnitsWatcher' - version = 1 - schema = {'definitions': {'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'}, - 'RelationUnitsChange': {'additionalProperties': False, - 'properties': {'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, - 'type': 'object'}, - 'departed': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['changed'], - 'type': 'object'}, - 'RelationUnitsWatchResult': {'additionalProperties': False, - 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, - 'error': {'$ref': '#/definitions/Error'}, - 'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id', - 'changes'], - 'type': 'object'}, - 'UnitSettings': {'additionalProperties': False, - 'properties': {'version': {'type': 'integer'}}, - 'required': ['version'], - 'type': 'object'}}, - 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/RelationUnitsWatchResult'}}, - 'type': 'object'}, - 'Stop': {'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(RelationUnitsWatchResult) - async def Next(self): - ''' - - Returns -> typing.Union[_ForwardRef('RelationUnitsChange'), _ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RelationUnitsWatcher', - 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='RelationUnitsWatcher', - request='Stop', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class RemoteApplicationWatcherFacade(Type): - name = 'RemoteApplicationWatcher' - version = 1 - schema = {'definitions': {'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'}, - 'RemoteApplicationChange': {'additionalProperties': False, - 'properties': {'application-tag': {'type': 'string'}, - 'life': {'type': 'string'}, - 'relations': {'$ref': '#/definitions/RemoteRelationsChange'}}, - 'required': ['application-tag', - 'life', - 'relations'], - 'type': 'object'}, - 'RemoteApplicationWatchResult': {'additionalProperties': False, - 'properties': {'change': {'$ref': '#/definitions/RemoteApplicationChange'}, - 'error': {'$ref': '#/definitions/Error'}, - 'id': {'type': 'string'}}, - 'required': ['id'], - 'type': 'object'}, - 'RemoteEntityId': {'additionalProperties': False, - 'properties': {'model-uuid': {'type': 'string'}, - 'token': {'type': 'string'}}, - 'required': ['model-uuid', 'token'], - 'type': 'object'}, - 'RemoteRelationChange': {'additionalProperties': False, - 'properties': {'changed-units': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteRelationUnitChange'}}, - 'type': 'object'}, - 'departed-units': {'items': {'type': 'string'}, - 'type': 'array'}, - 'id': {'type': 'integer'}, - 'life': {'type': 'string'}}, - 'required': ['id', 'life'], - 'type': 'object'}, - 'RemoteRelationUnitChange': {'additionalProperties': False, - 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'unit-id': {'$ref': '#/definitions/RemoteEntityId'}}, - 'required': ['unit-id'], - 'type': 'object'}, - 'RemoteRelationsChange': {'additionalProperties': False, - 'properties': {'changed': {'items': {'$ref': '#/definitions/RemoteRelationChange'}, - 'type': 'array'}, - 'initial': {'type': 'boolean'}, - 'removed': {'items': {'type': 'integer'}, - 'type': 'array'}}, - 'required': ['initial'], - 'type': 'object'}}, - 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/RemoteApplicationWatchResult'}}, - 'type': 'object'}, - 'Stop': {'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(RemoteApplicationWatchResult) - async def Next(self): - ''' - - Returns -> typing.Union[_ForwardRef('RemoteApplicationChange'), _ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteApplicationWatcher', - 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='RemoteApplicationWatcher', - request='Stop', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class RemoteRelationsFacade(Type): - name = 'RemoteRelations' - version = 1 - schema = {'definitions': {'ControllerAPIInfoResult': {'additionalProperties': False, - 'properties': {'addresses': {'items': {'type': 'string'}, - 'type': 'array'}, - 'cacert': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['addresses', - 'cacert'], - 'type': 'object'}, - 'ControllerAPIInfoResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'ControllerConfigResult': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}}, - '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'}, - 'EntityMacaroonArg': {'additionalProperties': False, - 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, - 'tag': {'type': 'string'}}, - 'required': ['macaroon', 'tag'], - 'type': 'object'}, - 'EntityMacaroonArgs': {'additionalProperties': False, - 'properties': {'Args': {'items': {'$ref': '#/definitions/EntityMacaroonArg'}, - 'type': 'array'}}, - 'required': ['Args'], - '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'}, - 'GetTokenArg': {'additionalProperties': False, - 'properties': {'tag': {'type': 'string'}}, - 'required': ['tag'], - 'type': 'object'}, - 'GetTokenArgs': {'additionalProperties': False, - 'properties': {'Args': {'items': {'$ref': '#/definitions/GetTokenArg'}, - 'type': 'array'}}, - 'required': ['Args'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'RelationUnit': {'additionalProperties': False, - 'properties': {'relation': {'type': 'string'}, - 'unit': {'type': 'string'}}, - 'required': ['relation', 'unit'], - 'type': 'object'}, - 'RelationUnits': {'additionalProperties': False, - 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnit'}, - 'type': 'array'}}, - 'required': ['relation-units'], - 'type': 'object'}, - 'RelationUnitsChange': {'additionalProperties': False, - 'properties': {'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, - 'type': 'object'}, - 'departed': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['changed'], - 'type': 'object'}, - 'RelationUnitsWatchResult': {'additionalProperties': False, - 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, - 'error': {'$ref': '#/definitions/Error'}, - 'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id', - 'changes'], - 'type': 'object'}, - 'RelationUnitsWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'RemoteApplication': {'additionalProperties': False, - 'properties': {'is-consumer-proxy': {'type': 'boolean'}, - 'life': {'type': 'string'}, - 'macaroon': {'$ref': '#/definitions/Macaroon'}, - 'model-uuid': {'type': 'string'}, - 'name': {'type': 'string'}, - 'offer-uuid': {'type': 'string'}, - 'status': {'type': 'string'}}, - 'required': ['name', - 'offer-uuid', - 'model-uuid', - 'is-consumer-proxy'], - 'type': 'object'}, - 'RemoteApplicationResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/RemoteApplication'}}, - 'type': 'object'}, - 'RemoteApplicationResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteApplicationResult'}, - 'type': 'array'}}, - 'type': 'object'}, - 'RemoteEndpoint': {'additionalProperties': False, - 'properties': {'interface': {'type': 'string'}, - 'limit': {'type': 'integer'}, - 'name': {'type': 'string'}, - 'role': {'type': 'string'}}, - 'required': ['name', - 'role', - 'interface', - 'limit'], - 'type': 'object'}, - 'RemoteEntityTokenArg': {'additionalProperties': False, - 'properties': {'tag': {'type': 'string'}, - 'token': {'type': 'string'}}, - 'required': ['tag'], - 'type': 'object'}, - 'RemoteEntityTokenArgs': {'additionalProperties': False, - 'properties': {'Args': {'items': {'$ref': '#/definitions/RemoteEntityTokenArg'}, - 'type': 'array'}}, - 'required': ['Args'], - 'type': 'object'}, - 'RemoteRelation': {'additionalProperties': False, - 'properties': {'application-name': {'type': 'string'}, - 'endpoint': {'$ref': '#/definitions/RemoteEndpoint'}, - 'id': {'type': 'integer'}, - 'key': {'type': 'string'}, - 'life': {'type': 'string'}, - 'remote-application-name': {'type': 'string'}, - 'remote-endpoint-name': {'type': 'string'}, - 'source-model-uuid': {'type': 'string'}, - 'suspended': {'type': 'boolean'}}, - 'required': ['life', - 'suspended', - 'id', - 'key', - 'application-name', - 'endpoint', - 'remote-application-name', - 'remote-endpoint-name', - 'source-model-uuid'], - 'type': 'object'}, - 'RemoteRelationChangeEvent': {'additionalProperties': False, - 'properties': {'application-token': {'type': 'string'}, - 'changed-units': {'items': {'$ref': '#/definitions/RemoteRelationUnitChange'}, - 'type': 'array'}, - 'departed-units': {'items': {'type': 'integer'}, - 'type': 'array'}, - 'force-cleanup': {'type': 'boolean'}, - 'life': {'type': 'string'}, - 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, - 'type': 'array'}, - 'relation-token': {'type': 'string'}, - 'suspended': {'type': 'boolean'}, - 'suspended-reason': {'type': 'string'}}, - 'required': ['relation-token', - 'application-token', - 'life'], - 'type': 'object'}, - 'RemoteRelationResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/RemoteRelation'}}, - 'type': 'object'}, - 'RemoteRelationResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteRelationResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'RemoteRelationUnitChange': {'additionalProperties': False, - 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'unit-id': {'type': 'integer'}}, - 'required': ['unit-id'], - 'type': 'object'}, - 'RemoteRelationsChanges': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, - 'type': 'array'}}, - 'type': 'object'}, - 'SetStatus': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, - 'type': 'array'}}, - 'required': ['entities'], - 'type': 'object'}, - 'SettingsResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'settings': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}}, - 'required': ['settings'], - 'type': 'object'}, - 'SettingsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - 'type': 'object'}, - 'StringResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, - 'type': 'array'}}, - 'required': ['results'], - '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'}, - 'StringsWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'TokenResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'token': {'type': 'string'}}, - 'type': 'object'}, - 'TokenResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/TokenResult'}, - 'type': 'array'}}, - 'type': 'object'}, - 'UnitSettings': {'additionalProperties': False, - 'properties': {'version': {'type': 'integer'}}, - 'required': ['version'], - 'type': 'object'}}, - 'properties': {'ConsumeRemoteRelationChanges': {'properties': {'Params': {'$ref': '#/definitions/RemoteRelationsChanges'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'ControllerAPIInfoForModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, - 'type': 'object'}, - 'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, - 'type': 'object'}, - 'ExportEntities': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/TokenResults'}}, - 'type': 'object'}, - 'GetTokens': {'properties': {'Params': {'$ref': '#/definitions/GetTokenArgs'}, - 'Result': {'$ref': '#/definitions/StringResults'}}, - 'type': 'object'}, - 'ImportRemoteEntities': {'properties': {'Params': {'$ref': '#/definitions/RemoteEntityTokenArgs'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'RelationUnitSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, - 'Result': {'$ref': '#/definitions/SettingsResults'}}, - 'type': 'object'}, - 'Relations': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/RemoteRelationResults'}}, - 'type': 'object'}, - 'RemoteApplications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/RemoteApplicationResults'}}, - 'type': 'object'}, - 'SaveMacaroons': {'properties': {'Params': {'$ref': '#/definitions/EntityMacaroonArgs'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SetRemoteApplicationsStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'WatchLocalRelationUnits': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, - 'type': 'object'}, - 'WatchRemoteApplicationRelations': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, - 'type': 'object'}, - 'WatchRemoteApplications': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, - 'type': 'object'}, - 'WatchRemoteRelations': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResults) - async def ConsumeRemoteRelationChanges(self, changes): - ''' - changes : typing.Sequence[~RemoteRelationChangeEvent] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='ConsumeRemoteRelationChanges', - version=1, - params=_params) - _params['changes'] = changes - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ControllerAPIInfoResults) - async def ControllerAPIInfoForModels(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ControllerAPIInfoResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='ControllerAPIInfoForModels', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ControllerConfigResult) - async def ControllerConfig(self): - ''' - - Returns -> typing.Mapping[str, typing.Any] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='ControllerConfig', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(TokenResults) - async def ExportEntities(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~TokenResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='ExportEntities', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringResults) - async def GetTokens(self, args): - ''' - args : typing.Sequence[~GetTokenArg] - Returns -> typing.Sequence[~StringResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='GetTokens', - version=1, - params=_params) - _params['Args'] = args - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def ImportRemoteEntities(self, args): - ''' - args : typing.Sequence[~RemoteEntityTokenArg] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='ImportRemoteEntities', - version=1, - params=_params) - _params['Args'] = args - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(SettingsResults) - async def RelationUnitSettings(self, relation_units): - ''' - relation_units : typing.Sequence[~RelationUnit] - Returns -> typing.Sequence[~SettingsResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='RelationUnitSettings', - version=1, - params=_params) - _params['relation-units'] = relation_units - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(RemoteRelationResults) - async def Relations(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~RemoteRelationResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='Relations', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(RemoteApplicationResults) - async def RemoteApplications(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~RemoteApplicationResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='RemoteApplications', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SaveMacaroons(self, args): - ''' - args : typing.Sequence[~EntityMacaroonArg] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='SaveMacaroons', - version=1, - params=_params) - _params['Args'] = args - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetRemoteApplicationsStatus(self, entities): - ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='SetRemoteApplicationsStatus', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(RelationUnitsWatchResults) - async def WatchLocalRelationUnits(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~RelationUnitsWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='WatchLocalRelationUnits', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringsWatchResults) - async def WatchRemoteApplicationRelations(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~StringsWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='WatchRemoteApplicationRelations', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringsWatchResult) - async def WatchRemoteApplications(self): - ''' - - Returns -> typing.Union[typing.Sequence[str], _ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='WatchRemoteApplications', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringsWatchResult) - async def WatchRemoteRelations(self): - ''' - - Returns -> typing.Union[typing.Sequence[str], _ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='WatchRemoteRelations', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class RemoteRelationsWatcherFacade(Type): - name = 'RemoteRelationsWatcher' - version = 1 - schema = {'definitions': {'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'}, - 'RemoteEntityId': {'additionalProperties': False, - 'properties': {'model-uuid': {'type': 'string'}, - 'token': {'type': 'string'}}, - 'required': ['model-uuid', 'token'], - 'type': 'object'}, - 'RemoteRelationChange': {'additionalProperties': False, - 'properties': {'changed-units': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteRelationUnitChange'}}, - 'type': 'object'}, - 'departed-units': {'items': {'type': 'string'}, - 'type': 'array'}, - 'id': {'type': 'integer'}, - 'life': {'type': 'string'}}, - 'required': ['id', 'life'], - 'type': 'object'}, - 'RemoteRelationUnitChange': {'additionalProperties': False, - 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'unit-id': {'$ref': '#/definitions/RemoteEntityId'}}, - 'required': ['unit-id'], - 'type': 'object'}, - 'RemoteRelationsChange': {'additionalProperties': False, - 'properties': {'changed': {'items': {'$ref': '#/definitions/RemoteRelationChange'}, - 'type': 'array'}, - 'initial': {'type': 'boolean'}, - 'removed': {'items': {'type': 'integer'}, - 'type': 'array'}}, - 'required': ['initial'], - 'type': 'object'}, - 'RemoteRelationsWatchResult': {'additionalProperties': False, - 'properties': {'RemoteRelationsWatcherId': {'type': 'string'}, - 'change': {'$ref': '#/definitions/RemoteRelationsChange'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['RemoteRelationsWatcherId'], - 'type': 'object'}}, - 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/RemoteRelationsWatchResult'}}, - 'type': 'object'}, - 'Stop': {'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(RemoteRelationsWatchResult) - async def Next(self): - ''' - - Returns -> typing.Union[str, _ForwardRef('RemoteRelationsChange'), _ForwardRef('Error')] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelationsWatcher', - 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='RemoteRelationsWatcher', - request='Stop', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class ResourcesFacade(Type): - name = 'Resources' - version = 1 - schema = {'definitions': {'AddCharmWithAuthorization': {'additionalProperties': False, - 'properties': {'channel': {'type': 'string'}, - 'force': {'type': 'boolean'}, - 'macaroon': {'$ref': '#/definitions/Macaroon'}, - 'url': {'type': 'string'}}, - 'required': ['url', - 'channel', - 'macaroon', - 'force'], - 'type': 'object'}, - 'AddPendingResourcesArgs': {'additionalProperties': False, - 'properties': {'AddCharmWithAuthorization': {'$ref': '#/definitions/AddCharmWithAuthorization'}, - 'Entity': {'$ref': '#/definitions/Entity'}, - 'resources': {'items': {'$ref': '#/definitions/CharmResource'}, - 'type': 'array'}}, - 'required': ['Entity', - 'AddCharmWithAuthorization', - 'resources'], - 'type': 'object'}, - 'AddPendingResourcesResult': {'additionalProperties': False, - 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, - 'pending-ids': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['ErrorResult', - 'pending-ids'], - 'type': 'object'}, - 'CharmResource': {'additionalProperties': False, - 'properties': {'description': {'type': 'string'}, - 'fingerprint': {'items': {'type': 'integer'}, - 'type': 'array'}, - 'name': {'type': 'string'}, - 'origin': {'type': 'string'}, - 'path': {'type': 'string'}, - 'revision': {'type': 'integer'}, - 'size': {'type': 'integer'}, - 'type': {'type': 'string'}}, - 'required': ['name', - 'type', - 'path', - 'origin', - 'revision', - 'fingerprint', - 'size'], - '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'}, - 'ListResourcesArgs': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}}, - 'required': ['entities'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'Resource': {'additionalProperties': False, - 'properties': {'CharmResource': {'$ref': '#/definitions/CharmResource'}, - 'application': {'type': 'string'}, - 'id': {'type': 'string'}, - 'pending-id': {'type': 'string'}, - 'timestamp': {'format': 'date-time', - 'type': 'string'}, - 'username': {'type': 'string'}}, - 'required': ['CharmResource', - 'id', - 'pending-id', - 'application', - 'username', - 'timestamp'], - 'type': 'object'}, - 'ResourcesResult': {'additionalProperties': False, - 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, - 'charm-store-resources': {'items': {'$ref': '#/definitions/CharmResource'}, - 'type': 'array'}, - 'resources': {'items': {'$ref': '#/definitions/Resource'}, - 'type': 'array'}, - 'unit-resources': {'items': {'$ref': '#/definitions/UnitResources'}, - 'type': 'array'}}, - 'required': ['ErrorResult', - 'resources', - 'charm-store-resources', - 'unit-resources'], - 'type': 'object'}, - 'ResourcesResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ResourcesResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'UnitResources': {'additionalProperties': False, - 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, - 'download-progress': {'patternProperties': {'.*': {'type': 'integer'}}, - 'type': 'object'}, - 'resources': {'items': {'$ref': '#/definitions/Resource'}, - 'type': 'array'}}, - 'required': ['Entity', - 'resources', - 'download-progress'], - 'type': 'object'}}, - 'properties': {'AddPendingResources': {'properties': {'Params': {'$ref': '#/definitions/AddPendingResourcesArgs'}, - 'Result': {'$ref': '#/definitions/AddPendingResourcesResult'}}, - 'type': 'object'}, - 'ListResources': {'properties': {'Params': {'$ref': '#/definitions/ListResourcesArgs'}, - 'Result': {'$ref': '#/definitions/ResourcesResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(AddPendingResourcesResult) - async def AddPendingResources(self, addcharmwithauthorization, entity, resources): - ''' - addcharmwithauthorization : AddCharmWithAuthorization - entity : Entity - resources : typing.Sequence[~CharmResource] - Returns -> typing.Union[_ForwardRef('ErrorResult'), typing.Sequence[str]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Resources', - request='AddPendingResources', - version=1, - params=_params) - _params['AddCharmWithAuthorization'] = addcharmwithauthorization - _params['Entity'] = entity - _params['Resources'] = resources - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ResourcesResults) - async def ListResources(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ResourcesResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Resources', - request='ListResources', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class ResourcesHookContextFacade(Type): - name = 'ResourcesHookContext' - version = 1 - schema = {'definitions': {'CharmResource': {'additionalProperties': False, - 'properties': {'description': {'type': 'string'}, - 'fingerprint': {'items': {'type': 'integer'}, - 'type': 'array'}, - 'name': {'type': 'string'}, - 'origin': {'type': 'string'}, - 'path': {'type': 'string'}, - 'revision': {'type': 'integer'}, - 'size': {'type': 'integer'}, - 'type': {'type': 'string'}}, - 'required': ['name', - 'type', - 'path', - 'origin', - 'revision', - 'fingerprint', - 'size'], - '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'}, - 'ListUnitResourcesArgs': {'additionalProperties': False, - 'properties': {'resource-names': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['resource-names'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'Resource': {'additionalProperties': False, - 'properties': {'CharmResource': {'$ref': '#/definitions/CharmResource'}, - 'application': {'type': 'string'}, - 'id': {'type': 'string'}, - 'pending-id': {'type': 'string'}, - 'timestamp': {'format': 'date-time', - 'type': 'string'}, - 'username': {'type': 'string'}}, - 'required': ['CharmResource', - 'id', - 'pending-id', - 'application', - 'username', - 'timestamp'], - 'type': 'object'}, - 'UnitResourceResult': {'additionalProperties': False, - 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, - 'resource': {'$ref': '#/definitions/Resource'}}, - 'required': ['ErrorResult', 'resource'], - 'type': 'object'}, - 'UnitResourcesResult': {'additionalProperties': False, - 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, - 'resources': {'items': {'$ref': '#/definitions/UnitResourceResult'}, - 'type': 'array'}}, - 'required': ['ErrorResult', - 'resources'], - 'type': 'object'}}, - 'properties': {'GetResourceInfo': {'properties': {'Params': {'$ref': '#/definitions/ListUnitResourcesArgs'}, - 'Result': {'$ref': '#/definitions/UnitResourcesResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(UnitResourcesResult) - async def GetResourceInfo(self, resource_names): - ''' - resource_names : typing.Sequence[str] - Returns -> typing.Union[_ForwardRef('ErrorResult'), typing.Sequence[~UnitResourceResult]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ResourcesHookContext', - request='GetResourceInfo', - version=1, - params=_params) - _params['resource-names'] = resource_names - reply = await self.rpc(msg) - return reply - - - -class RetryStrategyFacade(Type): - name = 'RetryStrategy' - 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'}, - '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'}, - 'RetryStrategy': {'additionalProperties': False, - 'properties': {'jitter-retry-time': {'type': 'boolean'}, - 'max-retry-time': {'type': 'integer'}, - 'min-retry-time': {'type': 'integer'}, - 'retry-time-factor': {'type': 'integer'}, - 'should-retry': {'type': 'boolean'}}, - 'required': ['should-retry', - 'min-retry-time', - 'max-retry-time', - 'jitter-retry-time', - 'retry-time-factor'], - 'type': 'object'}, - 'RetryStrategyResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/RetryStrategy'}}, - 'type': 'object'}, - 'RetryStrategyResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/RetryStrategyResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'RetryStrategy': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/RetryStrategyResults'}}, - 'type': 'object'}, - 'WatchRetryStrategy': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(RetryStrategyResults) - async def RetryStrategy(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~RetryStrategyResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RetryStrategy', - request='RetryStrategy', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResults) - async def WatchRetryStrategy(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~NotifyWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='RetryStrategy', - request='WatchRetryStrategy', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class SSHClientFacade(Type): - name = 'SSHClient' - 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'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'SSHAddressResult': {'additionalProperties': False, - 'properties': {'address': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'type': 'object'}, - 'SSHAddressResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'SSHProxyResult': {'additionalProperties': False, - 'properties': {'use-proxy': {'type': 'boolean'}}, - 'required': ['use-proxy'], - 'type': 'object'}, - 'SSHPublicKeysResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'public-keys': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'SSHPublicKeysResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/SSHPublicKeysResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'PrivateAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/SSHAddressResults'}}, - 'type': 'object'}, - 'Proxy': {'properties': {'Result': {'$ref': '#/definitions/SSHProxyResult'}}, - 'type': 'object'}, - 'PublicAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/SSHAddressResults'}}, - 'type': 'object'}, - 'PublicKeys': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/SSHPublicKeysResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(SSHAddressResults) - async def PrivateAddress(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~SSHAddressResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='SSHClient', - request='PrivateAddress', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(SSHProxyResult) - async def Proxy(self): - ''' - - Returns -> bool - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='SSHClient', - request='Proxy', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(SSHAddressResults) - async def PublicAddress(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~SSHAddressResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='SSHClient', - request='PublicAddress', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(SSHPublicKeysResults) - async def PublicKeys(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~SSHPublicKeysResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='SSHClient', - request='PublicKeys', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class SingularFacade(Type): - name = 'Singular' - 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'}, - 'SingularClaim': {'additionalProperties': False, - 'properties': {'controller-tag': {'type': 'string'}, - 'duration': {'type': 'integer'}, - 'model-tag': {'type': 'string'}}, - 'required': ['model-tag', - 'controller-tag', - 'duration'], - 'type': 'object'}, - 'SingularClaims': {'additionalProperties': False, - 'properties': {'claims': {'items': {'$ref': '#/definitions/SingularClaim'}, - 'type': 'array'}}, - 'required': ['claims'], - 'type': 'object'}}, - 'properties': {'Claim': {'properties': {'Params': {'$ref': '#/definitions/SingularClaims'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'Wait': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResults) - async def Claim(self, claims): - ''' - claims : typing.Sequence[~SingularClaim] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Singular', - request='Claim', - version=1, - params=_params) - _params['claims'] = claims - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def Wait(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Singular', - request='Wait', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class StringsWatcherFacade(Type): - name = 'StringsWatcher' - version = 1 - schema = {'definitions': {'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'}, - 'StringsWatchResult': {'additionalProperties': False, - 'properties': {'changes': {'items': {'type': 'string'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}, - 'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id'], - 'type': 'object'}}, - 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, - 'type': 'object'}, - 'Stop': {'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(StringsWatchResult) - async def Next(self): - ''' - - Returns -> typing.Union[typing.Sequence[str], _ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='StringsWatcher', - 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='StringsWatcher', - request='Stop', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class UndertakerFacade(Type): - name = 'Undertaker' - version = 1 - schema = {'definitions': {'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'}, - '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'}, - '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'}, - 'UndertakerModelInfo': {'additionalProperties': False, - 'properties': {'global-name': {'type': 'string'}, - 'is-system': {'type': 'boolean'}, - 'life': {'type': 'string'}, - 'name': {'type': 'string'}, - 'uuid': {'type': 'string'}}, - 'required': ['uuid', - 'name', - 'global-name', - 'is-system', - 'life'], - 'type': 'object'}, - 'UndertakerModelInfoResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/UndertakerModelInfo'}}, - 'required': ['result'], - 'type': 'object'}}, - 'properties': {'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, - 'type': 'object'}, - 'ModelInfo': {'properties': {'Result': {'$ref': '#/definitions/UndertakerModelInfoResult'}}, - 'type': 'object'}, - 'ProcessDyingModel': {'type': 'object'}, - 'RemoveModel': {'type': 'object'}, - 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'UpdateStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'WatchModelResources': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - '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='Undertaker', - request='ModelConfig', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(UndertakerModelInfoResult) - async def ModelInfo(self): - ''' - - Returns -> typing.Union[_ForwardRef('Error'), _ForwardRef('UndertakerModelInfo')] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Undertaker', - request='ModelInfo', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def ProcessDyingModel(self): - ''' - - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Undertaker', - request='ProcessDyingModel', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def RemoveModel(self): - ''' - - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Undertaker', - request='RemoveModel', - version=1, - params=_params) - - 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='Undertaker', - request='SetStatus', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def UpdateStatus(self, entities): - ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Undertaker', - request='UpdateStatus', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResults) - async def WatchModelResources(self): - ''' - - Returns -> typing.Sequence[~NotifyWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Undertaker', - request='WatchModelResources', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class UnitAssignerFacade(Type): - name = 'UnitAssigner' - 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'}, - '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'}, - 'Macaroon': {'additionalProperties': False, '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'}}, - 'properties': {'AssignUnits': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SetAgentStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'WatchUnitAssignments': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResults) - async def AssignUnits(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UnitAssigner', - request='AssignUnits', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetAgentStatus(self, entities): - ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UnitAssigner', - request='SetAgentStatus', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringsWatchResult) - async def WatchUnitAssignments(self): - ''' - - Returns -> typing.Union[typing.Sequence[str], _ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UnitAssigner', - request='WatchUnitAssignments', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class UpgradeSeriesFacade(Type): - name = 'UpgradeSeries' - version = 1 - schema = {'definitions': {'Entities': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}}, - 'required': ['entities'], - 'type': 'object'}, - 'EntitiesResult': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['entities'], - 'type': 'object'}, - 'EntitiesResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/EntitiesResult'}, - 'type': 'array'}}, - 'required': ['results'], - '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'}, - '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'}, - 'PinApplicationResult': {'additionalProperties': False, - 'properties': {'application-name': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['application-name'], - 'type': 'object'}, - 'PinApplicationsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/PinApplicationResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'PinnedLeadershipResult': {'additionalProperties': False, - 'properties': {'result': {'patternProperties': {'.*': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}}, - 'type': 'object'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - 'type': 'object'}, - 'StringResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'UpdateSeriesArg': {'additionalProperties': False, - 'properties': {'force': {'type': 'boolean'}, - 'series': {'type': 'string'}, - 'tag': {'$ref': '#/definitions/Entity'}}, - 'required': ['tag', 'force', 'series'], - 'type': 'object'}, - 'UpdateSeriesArgs': {'additionalProperties': False, - 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, - 'type': 'array'}}, - 'required': ['args'], - 'type': 'object'}, - 'UpgradeSeriesStartUnitCompletionParam': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}, - 'message': {'type': 'string'}}, - 'required': ['entities', - 'message'], - 'type': 'object'}, - 'UpgradeSeriesStatusParam': {'additionalProperties': False, - 'properties': {'entity': {'$ref': '#/definitions/Entity'}, - 'message': {'type': 'string'}, - 'status': {'type': 'string'}}, - 'required': ['entity', - 'status', - 'message'], - 'type': 'object'}, - 'UpgradeSeriesStatusParams': {'additionalProperties': False, - 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusParam'}, - 'type': 'array'}}, - 'required': ['params'], - 'type': 'object'}, - 'UpgradeSeriesStatusResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'status': {'type': 'string'}}, - 'type': 'object'}, - 'UpgradeSeriesStatusResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusResult'}, - 'type': 'array'}}, - 'type': 'object'}}, - 'properties': {'FinishUpgradeSeries': {'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'MachineStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, - 'type': 'object'}, - 'PinMachineApplications': {'properties': {'Result': {'$ref': '#/definitions/PinApplicationsResults'}}, - 'type': 'object'}, - 'PinnedLeadership': {'properties': {'Result': {'$ref': '#/definitions/PinnedLeadershipResult'}}, - 'type': 'object'}, - 'SetMachineStatus': {'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SetUpgradeSeriesUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'StartUnitCompletion': {'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStartUnitCompletionParam'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'TargetSeries': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/StringResults'}}, - 'type': 'object'}, - 'UnitsCompleted': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/EntitiesResults'}}, - 'type': 'object'}, - 'UnitsPrepared': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/EntitiesResults'}}, - 'type': 'object'}, - 'UnpinMachineApplications': {'properties': {'Result': {'$ref': '#/definitions/PinApplicationsResults'}}, - 'type': 'object'}, - 'UpgradeSeriesUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, - 'type': 'object'}, - 'WatchUpgradeSeriesNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResults) - async def FinishUpgradeSeries(self, args): - ''' - args : typing.Sequence[~UpdateSeriesArg] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UpgradeSeries', - request='FinishUpgradeSeries', - version=1, - params=_params) - _params['args'] = args - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(UpgradeSeriesStatusResults) - async def MachineStatus(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~UpgradeSeriesStatusResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UpgradeSeries', - request='MachineStatus', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(PinApplicationsResults) - async def PinMachineApplications(self): - ''' - - Returns -> typing.Sequence[~PinApplicationResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UpgradeSeries', - request='PinMachineApplications', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(PinnedLeadershipResult) - async def PinnedLeadership(self): - ''' - - Returns -> typing.Sequence[str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UpgradeSeries', - request='PinnedLeadership', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetMachineStatus(self, params): - ''' - params : typing.Sequence[~UpgradeSeriesStatusParam] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UpgradeSeries', - request='SetMachineStatus', - version=1, - params=_params) - _params['params'] = params - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetUpgradeSeriesUnitStatus(self, params): - ''' - params : typing.Sequence[~UpgradeSeriesStatusParam] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UpgradeSeries', - request='SetUpgradeSeriesUnitStatus', - version=1, - params=_params) - _params['params'] = params - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def StartUnitCompletion(self, entities, message): - ''' - entities : typing.Sequence[~Entity] - message : str - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UpgradeSeries', - request='StartUnitCompletion', - version=1, - params=_params) - _params['entities'] = entities - _params['message'] = message - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringResults) - async def TargetSeries(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~StringResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UpgradeSeries', - request='TargetSeries', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(EntitiesResults) - async def UnitsCompleted(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~EntitiesResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UpgradeSeries', - request='UnitsCompleted', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(EntitiesResults) - async def UnitsPrepared(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~EntitiesResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UpgradeSeries', - request='UnitsPrepared', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(PinApplicationsResults) - async def UnpinMachineApplications(self): - ''' - - Returns -> typing.Sequence[~PinApplicationResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UpgradeSeries', - request='UnpinMachineApplications', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(UpgradeSeriesStatusResults) - async def UpgradeSeriesUnitStatus(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~UpgradeSeriesStatusResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UpgradeSeries', - request='UpgradeSeriesUnitStatus', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResults) - async def WatchUpgradeSeriesNotifications(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~NotifyWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UpgradeSeries', - request='WatchUpgradeSeriesNotifications', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class UpgraderFacade(Type): - name = 'Upgrader' - version = 1 - schema = {'definitions': {'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'}, - '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'}, - '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'}, - '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'}, - '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'}, - 'Tools': {'additionalProperties': False, - 'properties': {'sha256': {'type': 'string'}, - 'size': {'type': 'integer'}, - 'url': {'type': 'string'}, - 'version': {'$ref': '#/definitions/Binary'}}, - 'required': ['version', 'url', 'size'], - 'type': 'object'}, - 'ToolsResult': {'additionalProperties': False, - 'properties': {'disable-ssl-hostname-verification': {'type': 'boolean'}, - 'error': {'$ref': '#/definitions/Error'}, - 'tools': {'items': {'$ref': '#/definitions/Tools'}, - 'type': 'array'}}, - 'required': ['tools', - 'disable-ssl-hostname-verification'], - 'type': 'object'}, - 'ToolsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ToolsResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'Version': {'additionalProperties': False, - 'properties': {'version': {'$ref': '#/definitions/Binary'}}, - 'required': ['version'], - 'type': 'object'}, - 'VersionResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'version': {'$ref': '#/definitions/Number'}}, - 'type': 'object'}, - 'VersionResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/VersionResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'DesiredVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/VersionResults'}}, - 'type': 'object'}, - 'SetTools': {'properties': {'Params': {'$ref': '#/definitions/EntitiesVersion'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'Tools': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ToolsResults'}}, - 'type': 'object'}, - 'WatchAPIVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(VersionResults) - async def DesiredVersion(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~VersionResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Upgrader', - request='DesiredVersion', - 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='Upgrader', - request='SetTools', - version=1, - params=_params) - _params['agent-tools'] = agent_tools - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ToolsResults) - async def Tools(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ToolsResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Upgrader', - request='Tools', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResults) - async def WatchAPIVersion(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~NotifyWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Upgrader', - request='WatchAPIVersion', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - -class UserManagerFacade(Type): - name = 'UserManager' - version = 1 - schema = {'definitions': {'AddUser': {'additionalProperties': False, - 'properties': {'display-name': {'type': 'string'}, - 'password': {'type': 'string'}, - 'username': {'type': 'string'}}, - 'required': ['username', 'display-name'], - 'type': 'object'}, - 'AddUserResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'secret-key': {'items': {'type': 'integer'}, - 'type': 'array'}, - 'tag': {'type': 'string'}}, - 'type': 'object'}, - 'AddUserResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/AddUserResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'AddUsers': {'additionalProperties': False, - 'properties': {'users': {'items': {'$ref': '#/definitions/AddUser'}, - 'type': 'array'}}, - 'required': ['users'], - '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'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'UserInfo': {'additionalProperties': False, - 'properties': {'access': {'type': 'string'}, - 'created-by': {'type': 'string'}, - 'date-created': {'format': 'date-time', - 'type': 'string'}, - 'disabled': {'type': 'boolean'}, - 'display-name': {'type': 'string'}, - 'last-connection': {'format': 'date-time', - 'type': 'string'}, - 'username': {'type': 'string'}}, - 'required': ['username', - 'display-name', - 'access', - 'created-by', - 'date-created', - 'disabled'], - 'type': 'object'}, - 'UserInfoRequest': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}, - 'include-disabled': {'type': 'boolean'}}, - 'required': ['entities', - 'include-disabled'], - 'type': 'object'}, - 'UserInfoResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/UserInfo'}}, - 'type': 'object'}, - 'UserInfoResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/UserInfoResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'AddUser': {'properties': {'Params': {'$ref': '#/definitions/AddUsers'}, - 'Result': {'$ref': '#/definitions/AddUserResults'}}, - 'type': 'object'}, - 'DisableUser': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'EnableUser': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'RemoveUser': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SetPassword': {'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'UserInfo': {'properties': {'Params': {'$ref': '#/definitions/UserInfoRequest'}, - 'Result': {'$ref': '#/definitions/UserInfoResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(AddUserResults) - async def AddUser(self, users): - ''' - users : typing.Sequence[~AddUser] - Returns -> typing.Sequence[~AddUserResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UserManager', - request='AddUser', - version=1, - params=_params) - _params['users'] = users - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def DisableUser(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UserManager', - request='DisableUser', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def EnableUser(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UserManager', - request='EnableUser', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def RemoveUser(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UserManager', - request='RemoveUser', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetPassword(self, changes): - ''' - changes : typing.Sequence[~EntityPassword] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UserManager', - request='SetPassword', - version=1, - params=_params) - _params['changes'] = changes - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(UserInfoResults) - async def UserInfo(self, entities, include_disabled): - ''' - entities : typing.Sequence[~Entity] - include_disabled : bool - Returns -> typing.Sequence[~UserInfoResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='UserManager', - request='UserInfo', - version=1, - params=_params) - _params['entities'] = entities - _params['include-disabled'] = include_disabled - reply = await self.rpc(msg) - return reply - - - -class VolumeAttachmentPlansWatcherFacade(Type): - name = 'VolumeAttachmentPlansWatcher' - version = 1 - schema = {'definitions': {'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'}, - 'MachineStorageId': {'additionalProperties': False, - 'properties': {'attachment-tag': {'type': 'string'}, - 'machine-tag': {'type': 'string'}}, - 'required': ['machine-tag', - 'attachment-tag'], - 'type': 'object'}, - 'MachineStorageIdsWatchResult': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}, - 'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id', - 'changes'], - 'type': 'object'}}, - 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}}, - 'type': 'object'}, - 'Stop': {'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(MachineStorageIdsWatchResult) - async def Next(self): - ''' - - Returns -> typing.Union[typing.Sequence[~MachineStorageId], _ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='VolumeAttachmentPlansWatcher', - 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='VolumeAttachmentPlansWatcher', - request='Stop', - version=1, - params=_params) - - reply = await self.rpc(msg) - return reply diff --git a/modules/libjuju/juju/client/_client2.py b/modules/libjuju/juju/client/_client2.py deleted file mode 100644 index 416faab..0000000 --- a/modules/libjuju/juju/client/_client2.py +++ /dev/null @@ -1,7535 +0,0 @@ -# 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 ActionFacade(Type): - name = 'Action' - version = 2 - schema = {'definitions': {'Action': {'additionalProperties': False, - 'properties': {'name': {'type': 'string'}, - 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'receiver': {'type': 'string'}, - 'tag': {'type': 'string'}}, - 'required': ['tag', 'receiver', 'name'], - 'type': 'object'}, - 'ActionResult': {'additionalProperties': False, - 'properties': {'action': {'$ref': '#/definitions/Action'}, - 'completed': {'format': 'date-time', - 'type': 'string'}, - 'enqueued': {'format': 'date-time', - 'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}, - 'message': {'type': 'string'}, - 'output': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'started': {'format': 'date-time', - 'type': 'string'}, - 'status': {'type': 'string'}}, - 'type': 'object'}, - 'ActionResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, - 'type': 'array'}}, - 'type': 'object'}, - 'ActionSpec': {'additionalProperties': False, - 'properties': {'description': {'type': 'string'}, - 'params': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}}, - 'required': ['description', 'params'], - 'type': 'object'}, - 'Actions': {'additionalProperties': False, - 'properties': {'actions': {'items': {'$ref': '#/definitions/Action'}, - 'type': 'array'}}, - 'type': 'object'}, - 'ActionsByName': {'additionalProperties': False, - 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}, - 'name': {'type': 'string'}}, - 'type': 'object'}, - 'ActionsByNames': {'additionalProperties': False, - 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByName'}, - 'type': 'array'}}, - 'type': 'object'}, - 'ActionsByReceiver': {'additionalProperties': False, - 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}, - 'receiver': {'type': 'string'}}, - 'type': 'object'}, - 'ActionsByReceivers': {'additionalProperties': False, - 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByReceiver'}, - 'type': 'array'}}, - 'type': 'object'}, - 'ApplicationCharmActionsResult': {'additionalProperties': False, - 'properties': {'actions': {'patternProperties': {'.*': {'$ref': '#/definitions/ActionSpec'}}, - 'type': 'object'}, - 'application-tag': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'type': 'object'}, - 'ApplicationsCharmActionsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationCharmActionsResult'}, - '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'}, - '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'}, - 'FindActionsByNames': {'additionalProperties': False, - 'properties': {'names': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'FindTags': {'additionalProperties': False, - 'properties': {'prefixes': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['prefixes'], - 'type': 'object'}, - 'FindTagsResults': {'additionalProperties': False, - 'properties': {'matches': {'patternProperties': {'.*': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}}, - 'type': 'object'}}, - 'required': ['matches'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'RunParams': {'additionalProperties': False, - 'properties': {'applications': {'items': {'type': 'string'}, - 'type': 'array'}, - 'commands': {'type': 'string'}, - 'machines': {'items': {'type': 'string'}, - 'type': 'array'}, - 'timeout': {'type': 'integer'}, - 'units': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['commands', 'timeout'], - 'type': 'object'}}, - 'properties': {'Actions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ActionResults'}}, - 'type': 'object'}, - 'ApplicationsCharmsActions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ApplicationsCharmActionsResults'}}, - 'type': 'object'}, - 'Cancel': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ActionResults'}}, - 'type': 'object'}, - 'Enqueue': {'properties': {'Params': {'$ref': '#/definitions/Actions'}, - 'Result': {'$ref': '#/definitions/ActionResults'}}, - 'type': 'object'}, - 'FindActionTagsByPrefix': {'properties': {'Params': {'$ref': '#/definitions/FindTags'}, - 'Result': {'$ref': '#/definitions/FindTagsResults'}}, - 'type': 'object'}, - 'FindActionsByNames': {'properties': {'Params': {'$ref': '#/definitions/FindActionsByNames'}, - 'Result': {'$ref': '#/definitions/ActionsByNames'}}, - 'type': 'object'}, - 'ListAll': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, - 'type': 'object'}, - 'ListCompleted': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, - 'type': 'object'}, - 'ListPending': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, - 'type': 'object'}, - 'ListRunning': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, - 'type': 'object'}, - 'Run': {'properties': {'Params': {'$ref': '#/definitions/RunParams'}, - 'Result': {'$ref': '#/definitions/ActionResults'}}, - 'type': 'object'}, - 'RunOnAllMachines': {'properties': {'Params': {'$ref': '#/definitions/RunParams'}, - 'Result': {'$ref': '#/definitions/ActionResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ActionResults) - async def Actions(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ActionResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Action', - request='Actions', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ApplicationsCharmActionsResults) - async def ApplicationsCharmsActions(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ApplicationCharmActionsResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Action', - request='ApplicationsCharmsActions', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ActionResults) - async def Cancel(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ActionResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Action', - request='Cancel', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ActionResults) - async def Enqueue(self, actions): - ''' - actions : typing.Sequence[~Action] - Returns -> typing.Sequence[~ActionResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Action', - request='Enqueue', - version=2, - params=_params) - _params['actions'] = actions - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(FindTagsResults) - async def FindActionTagsByPrefix(self, prefixes): - ''' - prefixes : typing.Sequence[str] - Returns -> typing.Sequence[~Entity] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Action', - request='FindActionTagsByPrefix', - version=2, - params=_params) - _params['prefixes'] = prefixes - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ActionsByNames) - async def FindActionsByNames(self, names): - ''' - names : typing.Sequence[str] - Returns -> typing.Sequence[~ActionsByName] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Action', - request='FindActionsByNames', - version=2, - params=_params) - _params['names'] = names - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ActionsByReceivers) - async def ListAll(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ActionsByReceiver] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Action', - request='ListAll', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ActionsByReceivers) - async def ListCompleted(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ActionsByReceiver] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Action', - request='ListCompleted', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ActionsByReceivers) - async def ListPending(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ActionsByReceiver] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Action', - request='ListPending', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ActionsByReceivers) - async def ListRunning(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ActionsByReceiver] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Action', - request='ListRunning', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ActionResults) - async def Run(self, applications, commands, machines, timeout, units): - ''' - applications : typing.Sequence[str] - commands : str - machines : typing.Sequence[str] - timeout : int - units : typing.Sequence[str] - Returns -> typing.Sequence[~ActionResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Action', - request='Run', - version=2, - params=_params) - _params['applications'] = applications - _params['commands'] = commands - _params['machines'] = machines - _params['timeout'] = timeout - _params['units'] = units - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ActionResults) - async def RunOnAllMachines(self, applications, commands, machines, timeout, units): - ''' - applications : typing.Sequence[str] - commands : str - machines : typing.Sequence[str] - timeout : int - units : typing.Sequence[str] - Returns -> typing.Sequence[~ActionResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Action', - request='RunOnAllMachines', - version=2, - params=_params) - _params['applications'] = applications - _params['commands'] = commands - _params['machines'] = machines - _params['timeout'] = timeout - _params['units'] = units - reply = await self.rpc(msg) - return reply - - - -class AgentFacade(Type): - name = 'Agent' - version = 2 - schema = {'definitions': {'AgentGetEntitiesResult': {'additionalProperties': False, - 'properties': {'container-type': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}, - 'jobs': {'items': {'type': 'string'}, - 'type': 'array'}, - 'life': {'type': 'string'}}, - 'required': ['life', - 'jobs', - 'container-type'], - 'type': 'object'}, - 'AgentGetEntitiesResults': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/AgentGetEntitiesResult'}, - 'type': 'array'}}, - 'required': ['entities'], - 'type': 'object'}, - 'CloudCredential': {'additionalProperties': False, - 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - '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'}, - 'ControllerAPIInfoResult': {'additionalProperties': False, - 'properties': {'addresses': {'items': {'type': 'string'}, - 'type': 'array'}, - 'cacert': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['addresses', - 'cacert'], - 'type': 'object'}, - 'ControllerAPIInfoResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'ControllerConfigResult': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}}, - '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'}, - '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'}, - 'IsMasterResult': {'additionalProperties': False, - 'properties': {'master': {'type': 'boolean'}}, - 'required': ['master'], - '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'}, - 'NotifyWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'StateServingInfo': {'additionalProperties': False, - 'properties': {'api-port': {'type': 'integer'}, - 'ca-private-key': {'type': 'string'}, - 'cert': {'type': 'string'}, - 'controller-api-port': {'type': 'integer'}, - 'private-key': {'type': 'string'}, - 'shared-secret': {'type': 'string'}, - 'state-port': {'type': 'integer'}, - 'system-identity': {'type': 'string'}}, - 'required': ['api-port', - 'state-port', - 'cert', - 'private-key', - 'ca-private-key', - 'shared-secret', - 'system-identity'], - 'type': 'object'}}, - 'properties': {'ClearReboot': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'CloudSpec': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, - 'type': 'object'}, - 'ControllerAPIInfoForModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, - 'type': 'object'}, - 'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, - 'type': 'object'}, - 'GetCloudSpec': {'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, - 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, - 'type': 'object'}, - 'GetEntities': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/AgentGetEntitiesResults'}}, - 'type': 'object'}, - 'IsMaster': {'properties': {'Result': {'$ref': '#/definitions/IsMasterResult'}}, - 'type': 'object'}, - 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, - 'type': 'object'}, - 'SetPasswords': {'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'StateServingInfo': {'properties': {'Result': {'$ref': '#/definitions/StateServingInfo'}}, - 'type': 'object'}, - 'WatchCredentials': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}, - 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResults) - async def ClearReboot(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Agent', - request='ClearReboot', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @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='Agent', - request='CloudSpec', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ControllerAPIInfoResults) - async def ControllerAPIInfoForModels(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ControllerAPIInfoResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Agent', - request='ControllerAPIInfoForModels', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ControllerConfigResult) - async def ControllerConfig(self): - ''' - - Returns -> typing.Mapping[str, typing.Any] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Agent', - request='ControllerConfig', - version=2, - params=_params) - - 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='Agent', - request='GetCloudSpec', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AgentGetEntitiesResults) - async def GetEntities(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~AgentGetEntitiesResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Agent', - request='GetEntities', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(IsMasterResult) - async def IsMaster(self): - ''' - - Returns -> bool - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Agent', - request='IsMaster', - version=2, - 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='Agent', - request='ModelConfig', - version=2, - 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='Agent', - request='SetPasswords', - version=2, - params=_params) - _params['changes'] = changes - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StateServingInfo) - async def StateServingInfo(self): - ''' - - Returns -> typing.Union[int, str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Agent', - request='StateServingInfo', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResults) - async def WatchCredentials(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~NotifyWatchResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Agent', - request='WatchCredentials', - version=2, - params=_params) - _params['entities'] = entities - 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='Agent', - request='WatchForModelConfigChanges', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class AllModelWatcherFacade(Type): - name = 'AllModelWatcher' - version = 2 - 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'} - - - @ReturnMapping(AllWatcherNextResults) - async def Next(self): - ''' - - Returns -> typing.Sequence[~Delta] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='AllModelWatcher', - request='Next', - version=2, - 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='AllModelWatcher', - request='Stop', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class AnnotationsFacade(Type): - name = 'Annotations' - version = 2 - schema = {'definitions': {'AnnotationsGetResult': {'additionalProperties': False, - 'properties': {'annotations': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'entity': {'type': 'string'}, - 'error': {'$ref': '#/definitions/ErrorResult'}}, - 'required': ['entity', 'annotations'], - 'type': 'object'}, - 'AnnotationsGetResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/AnnotationsGetResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'AnnotationsSet': {'additionalProperties': False, - 'properties': {'annotations': {'items': {'$ref': '#/definitions/EntityAnnotations'}, - 'type': 'array'}}, - 'required': ['annotations'], - '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'}, - 'EntityAnnotations': {'additionalProperties': False, - 'properties': {'annotations': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'entity': {'type': 'string'}}, - 'required': ['entity', 'annotations'], - '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'}}, - 'properties': {'Get': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/AnnotationsGetResults'}}, - 'type': 'object'}, - 'Set': {'properties': {'Params': {'$ref': '#/definitions/AnnotationsSet'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(AnnotationsGetResults) - async def Get(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~AnnotationsGetResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Annotations', - request='Get', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def Set(self, annotations): - ''' - annotations : typing.Sequence[~EntityAnnotations] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Annotations', - request='Set', - version=2, - params=_params) - _params['annotations'] = annotations - reply = await self.rpc(msg) - return reply - - - -class ApplicationFacade(Type): - name = 'Application' - version = 2 - schema = {'definitions': {'AddApplicationUnits': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'num-units': {'type': 'integer'}, - 'placement': {'items': {'$ref': '#/definitions/Placement'}, - 'type': 'array'}}, - 'required': ['application', - 'num-units', - 'placement'], - 'type': 'object'}, - 'AddApplicationUnitsResults': {'additionalProperties': False, - 'properties': {'units': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['units'], - 'type': 'object'}, - 'AddRelation': {'additionalProperties': False, - 'properties': {'endpoints': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['endpoints'], - 'type': 'object'}, - 'AddRelationResults': {'additionalProperties': False, - 'properties': {'endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, - 'type': 'object'}}, - 'required': ['endpoints'], - 'type': 'object'}, - 'ApplicationCharmRelations': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}}, - 'required': ['application'], - 'type': 'object'}, - 'ApplicationCharmRelationsResults': {'additionalProperties': False, - 'properties': {'charm-relations': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['charm-relations'], - 'type': 'object'}, - 'ApplicationDeploy': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'channel': {'type': 'string'}, - 'charm-url': {'type': 'string'}, - 'config': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'config-yaml': {'type': 'string'}, - 'constraints': {'$ref': '#/definitions/Value'}, - 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'num-units': {'type': 'integer'}, - 'placement': {'items': {'$ref': '#/definitions/Placement'}, - 'type': 'array'}, - 'resources': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'series': {'type': 'string'}, - 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, - 'type': 'object'}}, - 'required': ['application', - 'series', - 'charm-url', - 'channel', - 'num-units', - 'config-yaml', - 'constraints'], - 'type': 'object'}, - 'ApplicationDestroy': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}}, - 'required': ['application'], - 'type': 'object'}, - 'ApplicationExpose': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}}, - 'required': ['application'], - 'type': 'object'}, - 'ApplicationGet': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}}, - 'required': ['application'], - 'type': 'object'}, - 'ApplicationGetResults': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'charm': {'type': 'string'}, - 'config': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'constraints': {'$ref': '#/definitions/Value'}, - 'series': {'type': 'string'}}, - 'required': ['application', - 'charm', - 'config', - 'constraints', - 'series'], - 'type': 'object'}, - 'ApplicationMetricCredential': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'metrics-credentials': {'items': {'type': 'integer'}, - 'type': 'array'}}, - 'required': ['application', - 'metrics-credentials'], - 'type': 'object'}, - 'ApplicationMetricCredentials': {'additionalProperties': False, - 'properties': {'creds': {'items': {'$ref': '#/definitions/ApplicationMetricCredential'}, - 'type': 'array'}}, - 'required': ['creds'], - 'type': 'object'}, - 'ApplicationSet': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'options': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}}, - 'required': ['application', 'options'], - 'type': 'object'}, - 'ApplicationSetCharm': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'channel': {'type': 'string'}, - 'charm-url': {'type': 'string'}, - 'config-settings': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'config-settings-yaml': {'type': 'string'}, - 'force-series': {'type': 'boolean'}, - 'force-units': {'type': 'boolean'}, - 'resource-ids': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'storage-constraints': {'patternProperties': {'.*': {'$ref': '#/definitions/StorageConstraints'}}, - 'type': 'object'}}, - 'required': ['application', - 'charm-url', - 'channel', - 'force-units', - 'force-series'], - 'type': 'object'}, - 'ApplicationUnexpose': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}}, - 'required': ['application'], - 'type': 'object'}, - 'ApplicationUnset': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'options': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['application', 'options'], - 'type': 'object'}, - 'ApplicationUpdate': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'charm-url': {'type': 'string'}, - 'constraints': {'$ref': '#/definitions/Value'}, - 'force-charm-url': {'type': 'boolean'}, - 'force-series': {'type': 'boolean'}, - 'min-units': {'type': 'integer'}, - 'settings': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'settings-yaml': {'type': 'string'}}, - 'required': ['application', - 'charm-url', - 'force-charm-url', - 'force-series', - 'settings-yaml'], - 'type': 'object'}, - 'ApplicationsDeploy': {'additionalProperties': False, - 'properties': {'applications': {'items': {'$ref': '#/definitions/ApplicationDeploy'}, - 'type': 'array'}}, - 'required': ['applications'], - 'type': 'object'}, - 'CharmRelation': {'additionalProperties': False, - 'properties': {'interface': {'type': 'string'}, - 'limit': {'type': 'integer'}, - 'name': {'type': 'string'}, - 'optional': {'type': 'boolean'}, - 'role': {'type': 'string'}, - 'scope': {'type': 'string'}}, - 'required': ['name', - 'role', - 'interface', - 'optional', - 'limit', - 'scope'], - 'type': 'object'}, - 'Constraints': {'additionalProperties': False, - 'properties': {'Count': {'type': 'integer'}, - 'Pool': {'type': 'string'}, - 'Size': {'type': 'integer'}}, - 'required': ['Pool', 'Size', 'Count'], - 'type': 'object'}, - 'DestroyApplicationUnits': {'additionalProperties': False, - 'properties': {'unit-names': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['unit-names'], - 'type': 'object'}, - 'DestroyRelation': {'additionalProperties': False, - 'properties': {'endpoints': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['endpoints'], - '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'}, - 'GetApplicationConstraints': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}}, - 'required': ['application'], - 'type': 'object'}, - 'GetConstraintsResults': {'additionalProperties': False, - 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, - 'required': ['constraints'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'Placement': {'additionalProperties': False, - 'properties': {'directive': {'type': 'string'}, - 'scope': {'type': 'string'}}, - 'required': ['scope', 'directive'], - 'type': 'object'}, - 'SetConstraints': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'constraints': {'$ref': '#/definitions/Value'}}, - 'required': ['application', 'constraints'], - 'type': 'object'}, - 'StorageConstraints': {'additionalProperties': False, - 'properties': {'count': {'type': 'integer'}, - 'pool': {'type': 'string'}, - 'size': {'type': 'integer'}}, - 'type': 'object'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - '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'}}, - 'type': 'object'}}, - 'properties': {'AddRelation': {'properties': {'Params': {'$ref': '#/definitions/AddRelation'}, - 'Result': {'$ref': '#/definitions/AddRelationResults'}}, - 'type': 'object'}, - 'AddUnits': {'properties': {'Params': {'$ref': '#/definitions/AddApplicationUnits'}, - 'Result': {'$ref': '#/definitions/AddApplicationUnitsResults'}}, - 'type': 'object'}, - 'CharmRelations': {'properties': {'Params': {'$ref': '#/definitions/ApplicationCharmRelations'}, - 'Result': {'$ref': '#/definitions/ApplicationCharmRelationsResults'}}, - 'type': 'object'}, - 'Deploy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationsDeploy'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}}, - 'type': 'object'}, - 'DestroyRelation': {'properties': {'Params': {'$ref': '#/definitions/DestroyRelation'}}, - 'type': 'object'}, - 'DestroyUnits': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, - 'type': 'object'}, - 'Expose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationExpose'}}, - 'type': 'object'}, - 'Get': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, - 'Result': {'$ref': '#/definitions/ApplicationGetResults'}}, - 'type': 'object'}, - 'GetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, - 'Result': {'$ref': '#/definitions/StringResult'}}, - 'type': 'object'}, - 'GetConstraints': {'properties': {'Params': {'$ref': '#/definitions/GetApplicationConstraints'}, - 'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, - 'type': 'object'}, - 'Set': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, - 'type': 'object'}, - 'SetCharm': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, - 'type': 'object'}, - 'SetConstraints': {'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, - 'type': 'object'}, - 'SetMetricCredentials': {'properties': {'Params': {'$ref': '#/definitions/ApplicationMetricCredentials'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'Unexpose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnexpose'}}, - 'type': 'object'}, - 'Unset': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, - 'type': 'object'}, - 'Update': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUpdate'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(AddRelationResults) - async def AddRelation(self, endpoints): - ''' - endpoints : typing.Sequence[str] - Returns -> typing.Mapping[str, ~CharmRelation] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='AddRelation', - version=2, - params=_params) - _params['endpoints'] = endpoints - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AddApplicationUnitsResults) - async def AddUnits(self, application, num_units, placement): - ''' - application : str - num_units : int - placement : typing.Sequence[~Placement] - Returns -> typing.Sequence[str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='AddUnits', - version=2, - params=_params) - _params['application'] = application - _params['num-units'] = num_units - _params['placement'] = placement - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ApplicationCharmRelationsResults) - async def CharmRelations(self, application): - ''' - application : str - Returns -> typing.Sequence[str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='CharmRelations', - version=2, - params=_params) - _params['application'] = application - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def Deploy(self, applications): - ''' - applications : typing.Sequence[~ApplicationDeploy] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='Deploy', - version=2, - params=_params) - _params['applications'] = applications - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Destroy(self, application): - ''' - application : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='Destroy', - version=2, - params=_params) - _params['application'] = application - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def DestroyRelation(self, endpoints): - ''' - endpoints : typing.Sequence[str] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='DestroyRelation', - version=2, - params=_params) - _params['endpoints'] = endpoints - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def DestroyUnits(self, unit_names): - ''' - unit_names : typing.Sequence[str] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='DestroyUnits', - version=2, - params=_params) - _params['unit-names'] = unit_names - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Expose(self, application): - ''' - application : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='Expose', - version=2, - params=_params) - _params['application'] = application - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ApplicationGetResults) - async def Get(self, application): - ''' - application : str - Returns -> typing.Union[str, typing.Mapping[str, typing.Any], _ForwardRef('Value')] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='Get', - version=2, - params=_params) - _params['application'] = application - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringResult) - async def GetCharmURL(self, application): - ''' - application : str - Returns -> typing.Union[_ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='GetCharmURL', - version=2, - params=_params) - _params['application'] = application - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(GetConstraintsResults) - async def GetConstraints(self, application): - ''' - application : str - Returns -> Value - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='GetConstraints', - version=2, - params=_params) - _params['application'] = application - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Set(self, application, options): - ''' - application : str - options : typing.Mapping[str, str] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='Set', - version=2, - params=_params) - _params['application'] = application - _params['options'] = options - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def SetCharm(self, application, channel, charm_url, config_settings, config_settings_yaml, force_series, force_units, resource_ids, storage_constraints): - ''' - application : str - channel : str - charm_url : str - config_settings : typing.Mapping[str, str] - config_settings_yaml : str - force_series : bool - force_units : bool - resource_ids : typing.Mapping[str, str] - storage_constraints : typing.Mapping[str, ~StorageConstraints] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='SetCharm', - version=2, - params=_params) - _params['application'] = application - _params['channel'] = channel - _params['charm-url'] = charm_url - _params['config-settings'] = config_settings - _params['config-settings-yaml'] = config_settings_yaml - _params['force-series'] = force_series - _params['force-units'] = force_units - _params['resource-ids'] = resource_ids - _params['storage-constraints'] = storage_constraints - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def SetConstraints(self, application, constraints): - ''' - application : str - constraints : Value - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='SetConstraints', - version=2, - params=_params) - _params['application'] = application - _params['constraints'] = constraints - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetMetricCredentials(self, creds): - ''' - creds : typing.Sequence[~ApplicationMetricCredential] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='SetMetricCredentials', - version=2, - params=_params) - _params['creds'] = creds - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Unexpose(self, application): - ''' - application : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='Unexpose', - version=2, - params=_params) - _params['application'] = application - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Unset(self, application, options): - ''' - application : str - options : typing.Sequence[str] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='Unset', - version=2, - params=_params) - _params['application'] = application - _params['options'] = options - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Update(self, application, charm_url, constraints, force_charm_url, force_series, min_units, settings, settings_yaml): - ''' - application : str - charm_url : str - constraints : Value - force_charm_url : bool - force_series : bool - min_units : int - settings : typing.Mapping[str, str] - settings_yaml : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='Update', - version=2, - params=_params) - _params['application'] = application - _params['charm-url'] = charm_url - _params['constraints'] = constraints - _params['force-charm-url'] = force_charm_url - _params['force-series'] = force_series - _params['min-units'] = min_units - _params['settings'] = settings - _params['settings-yaml'] = settings_yaml - reply = await self.rpc(msg) - return reply - - - -class ApplicationOffersFacade(Type): - name = 'ApplicationOffers' - version = 2 - schema = {'definitions': {'AddApplicationOffer': {'additionalProperties': False, - 'properties': {'application-description': {'type': 'string'}, - 'application-name': {'type': 'string'}, - 'endpoints': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'model-tag': {'type': 'string'}, - 'offer-name': {'type': 'string'}}, - 'required': ['model-tag', - 'offer-name', - 'application-name', - 'application-description', - 'endpoints'], - 'type': 'object'}, - 'AddApplicationOffers': {'additionalProperties': False, - 'properties': {'Offers': {'items': {'$ref': '#/definitions/AddApplicationOffer'}, - 'type': 'array'}}, - 'required': ['Offers'], - 'type': 'object'}, - 'ApplicationOfferAdminDetails': {'additionalProperties': False, - 'properties': {'ApplicationOfferDetails': {'$ref': '#/definitions/ApplicationOfferDetails'}, - 'application-name': {'type': 'string'}, - 'charm-url': {'type': 'string'}, - 'connections': {'items': {'$ref': '#/definitions/OfferConnection'}, - 'type': 'array'}}, - 'required': ['ApplicationOfferDetails', - 'application-name', - 'charm-url'], - 'type': 'object'}, - 'ApplicationOfferDetails': {'additionalProperties': False, - 'properties': {'application-description': {'type': 'string'}, - 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, - 'type': 'array'}, - 'offer-name': {'type': 'string'}, - 'offer-url': {'type': 'string'}, - 'offer-uuid': {'type': 'string'}, - 'source-model-tag': {'type': 'string'}, - 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, - 'type': 'array'}, - 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, - 'type': 'array'}}, - 'required': ['source-model-tag', - 'offer-uuid', - 'offer-url', - 'offer-name', - 'application-description'], - 'type': 'object'}, - 'ApplicationOfferResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/ApplicationOfferAdminDetails'}}, - 'type': 'object'}, - 'ApplicationOffersResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationOfferResult'}, - 'type': 'array'}}, - 'type': 'object'}, - 'ConsumeOfferDetails': {'additionalProperties': False, - 'properties': {'external-controller': {'$ref': '#/definitions/ExternalControllerInfo'}, - 'macaroon': {'$ref': '#/definitions/Macaroon'}, - 'offer': {'$ref': '#/definitions/ApplicationOfferDetails'}}, - 'type': 'object'}, - 'ConsumeOfferDetailsResult': {'additionalProperties': False, - 'properties': {'ConsumeOfferDetails': {'$ref': '#/definitions/ConsumeOfferDetails'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['ConsumeOfferDetails'], - 'type': 'object'}, - 'ConsumeOfferDetailsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ConsumeOfferDetailsResult'}, - 'type': 'array'}}, - 'type': 'object'}, - 'DestroyApplicationOffers': {'additionalProperties': False, - 'properties': {'force': {'type': 'boolean'}, - 'offer-urls': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['offer-urls'], - 'type': 'object'}, - 'EndpointFilterAttributes': {'additionalProperties': False, - 'properties': {'interface': {'type': 'string'}, - 'name': {'type': 'string'}, - 'role': {'type': 'string'}}, - 'required': ['role', - 'interface', - 'name'], - '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'}, - 'ExternalControllerInfo': {'additionalProperties': False, - 'properties': {'addrs': {'items': {'type': 'string'}, - 'type': 'array'}, - 'ca-cert': {'type': 'string'}, - 'controller-alias': {'type': 'string'}, - 'controller-tag': {'type': 'string'}}, - 'required': ['controller-tag', - 'controller-alias', - 'addrs', - 'ca-cert'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'ModifyOfferAccess': {'additionalProperties': False, - 'properties': {'access': {'type': 'string'}, - 'action': {'type': 'string'}, - 'offer-url': {'type': 'string'}, - 'user-tag': {'type': 'string'}}, - 'required': ['user-tag', - 'action', - 'access', - 'offer-url'], - 'type': 'object'}, - 'ModifyOfferAccessRequest': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyOfferAccess'}, - 'type': 'array'}}, - 'required': ['changes'], - 'type': 'object'}, - 'OfferConnection': {'additionalProperties': False, - 'properties': {'endpoint': {'type': 'string'}, - 'ingress-subnets': {'items': {'type': 'string'}, - 'type': 'array'}, - 'relation-id': {'type': 'integer'}, - 'source-model-tag': {'type': 'string'}, - 'status': {'$ref': '#/definitions/EntityStatus'}, - 'username': {'type': 'string'}}, - 'required': ['source-model-tag', - 'relation-id', - 'username', - 'endpoint', - 'status', - 'ingress-subnets'], - 'type': 'object'}, - 'OfferFilter': {'additionalProperties': False, - 'properties': {'allowed-users': {'items': {'type': 'string'}, - 'type': 'array'}, - 'application-description': {'type': 'string'}, - 'application-name': {'type': 'string'}, - 'application-user': {'type': 'string'}, - 'connected-users': {'items': {'type': 'string'}, - 'type': 'array'}, - 'endpoints': {'items': {'$ref': '#/definitions/EndpointFilterAttributes'}, - 'type': 'array'}, - 'model-name': {'type': 'string'}, - 'offer-name': {'type': 'string'}, - 'owner-name': {'type': 'string'}}, - 'required': ['owner-name', - 'model-name', - 'offer-name', - 'application-name', - 'application-description', - 'application-user', - 'endpoints', - 'connected-users', - 'allowed-users'], - 'type': 'object'}, - 'OfferFilters': {'additionalProperties': False, - 'properties': {'Filters': {'items': {'$ref': '#/definitions/OfferFilter'}, - 'type': 'array'}}, - 'required': ['Filters'], - 'type': 'object'}, - 'OfferURLs': {'additionalProperties': False, - 'properties': {'offer-urls': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'OfferUserDetails': {'additionalProperties': False, - 'properties': {'access': {'type': 'string'}, - 'display-name': {'type': 'string'}, - 'user': {'type': 'string'}}, - 'required': ['user', - 'display-name', - 'access'], - 'type': 'object'}, - 'QueryApplicationOffersResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationOfferAdminDetails'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'RemoteApplicationInfo': {'additionalProperties': False, - 'properties': {'description': {'type': 'string'}, - 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, - 'type': 'array'}, - 'icon-url-path': {'type': 'string'}, - 'model-tag': {'type': 'string'}, - 'name': {'type': 'string'}, - 'offer-url': {'type': 'string'}, - 'source-model-label': {'type': 'string'}}, - 'required': ['model-tag', - 'name', - 'description', - 'offer-url', - 'endpoints', - 'icon-url-path'], - 'type': 'object'}, - 'RemoteApplicationInfoResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/RemoteApplicationInfo'}}, - 'type': 'object'}, - 'RemoteApplicationInfoResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteApplicationInfoResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'RemoteEndpoint': {'additionalProperties': False, - 'properties': {'interface': {'type': 'string'}, - 'limit': {'type': 'integer'}, - 'name': {'type': 'string'}, - 'role': {'type': 'string'}}, - 'required': ['name', - 'role', - 'interface', - 'limit'], - 'type': 'object'}, - 'RemoteSpace': {'additionalProperties': False, - 'properties': {'cloud-type': {'type': 'string'}, - 'name': {'type': 'string'}, - 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'provider-id': {'type': 'string'}, - 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, - 'type': 'array'}}, - 'required': ['cloud-type', - 'name', - 'provider-id', - 'provider-attributes', - 'subnets'], - 'type': 'object'}, - 'Subnet': {'additionalProperties': False, - 'properties': {'cidr': {'type': 'string'}, - 'life': {'type': 'string'}, - 'provider-id': {'type': 'string'}, - 'provider-network-id': {'type': 'string'}, - 'provider-space-id': {'type': 'string'}, - 'space-tag': {'type': 'string'}, - 'status': {'type': 'string'}, - 'vlan-tag': {'type': 'integer'}, - 'zones': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['cidr', - 'vlan-tag', - 'life', - 'space-tag', - 'zones'], - 'type': 'object'}}, - 'properties': {'ApplicationOffers': {'properties': {'Params': {'$ref': '#/definitions/OfferURLs'}, - 'Result': {'$ref': '#/definitions/ApplicationOffersResults'}}, - 'type': 'object'}, - 'DestroyOffers': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationOffers'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'FindApplicationOffers': {'properties': {'Params': {'$ref': '#/definitions/OfferFilters'}, - 'Result': {'$ref': '#/definitions/QueryApplicationOffersResults'}}, - 'type': 'object'}, - 'GetConsumeDetails': {'properties': {'Params': {'$ref': '#/definitions/OfferURLs'}, - 'Result': {'$ref': '#/definitions/ConsumeOfferDetailsResults'}}, - 'type': 'object'}, - 'ListApplicationOffers': {'properties': {'Params': {'$ref': '#/definitions/OfferFilters'}, - 'Result': {'$ref': '#/definitions/QueryApplicationOffersResults'}}, - 'type': 'object'}, - 'ModifyOfferAccess': {'properties': {'Params': {'$ref': '#/definitions/ModifyOfferAccessRequest'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'Offer': {'properties': {'Params': {'$ref': '#/definitions/AddApplicationOffers'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'RemoteApplicationInfo': {'properties': {'Params': {'$ref': '#/definitions/OfferURLs'}, - 'Result': {'$ref': '#/definitions/RemoteApplicationInfoResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ApplicationOffersResults) - async def ApplicationOffers(self, offer_urls): - ''' - offer_urls : typing.Sequence[str] - Returns -> typing.Sequence[~ApplicationOfferResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ApplicationOffers', - request='ApplicationOffers', - version=2, - params=_params) - _params['offer-urls'] = offer_urls - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def DestroyOffers(self, force, offer_urls): - ''' - force : bool - offer_urls : typing.Sequence[str] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ApplicationOffers', - request='DestroyOffers', - version=2, - params=_params) - _params['force'] = force - _params['offer-urls'] = offer_urls - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(QueryApplicationOffersResults) - async def FindApplicationOffers(self, filters): - ''' - filters : typing.Sequence[~OfferFilter] - Returns -> typing.Sequence[~ApplicationOfferAdminDetails] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ApplicationOffers', - request='FindApplicationOffers', - version=2, - params=_params) - _params['Filters'] = filters - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ConsumeOfferDetailsResults) - async def GetConsumeDetails(self, offer_urls): - ''' - offer_urls : typing.Sequence[str] - Returns -> typing.Sequence[~ConsumeOfferDetailsResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ApplicationOffers', - request='GetConsumeDetails', - version=2, - params=_params) - _params['offer-urls'] = offer_urls - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(QueryApplicationOffersResults) - async def ListApplicationOffers(self, filters): - ''' - filters : typing.Sequence[~OfferFilter] - Returns -> typing.Sequence[~ApplicationOfferAdminDetails] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ApplicationOffers', - request='ListApplicationOffers', - version=2, - params=_params) - _params['Filters'] = filters - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def ModifyOfferAccess(self, changes): - ''' - changes : typing.Sequence[~ModifyOfferAccess] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ApplicationOffers', - request='ModifyOfferAccess', - version=2, - params=_params) - _params['changes'] = changes - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def Offer(self, offers): - ''' - offers : typing.Sequence[~AddApplicationOffer] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ApplicationOffers', - request='Offer', - version=2, - params=_params) - _params['Offers'] = offers - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(RemoteApplicationInfoResults) - async def RemoteApplicationInfo(self, offer_urls): - ''' - offer_urls : typing.Sequence[str] - Returns -> typing.Sequence[~RemoteApplicationInfoResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ApplicationOffers', - request='RemoteApplicationInfo', - version=2, - params=_params) - _params['offer-urls'] = offer_urls - reply = await self.rpc(msg) - return reply - - - -class BackupsFacade(Type): - name = 'Backups' - version = 2 - schema = {'definitions': {'BackupsCreateArgs': {'additionalProperties': False, - 'properties': {'keep-copy': {'type': 'boolean'}, - 'no-download': {'type': 'boolean'}, - 'notes': {'type': 'string'}}, - 'required': ['notes', - 'keep-copy', - 'no-download'], - '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'}, - 'filename': {'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', - 'filename'], - 'type': 'object'}, - 'BackupsRemoveArgs': {'additionalProperties': False, - 'properties': {'ids': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['ids'], - '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'}, - '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'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'Restore': {'properties': {'Params': {'$ref': '#/definitions/RestoreArgs'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @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='Create', - version=2, - 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='FinishRestore', - version=2, - 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() - msg = dict(type='Backups', - request='Info', - version=2, - params=_params) - _params['id'] = id_ - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(BackupsListResult) - async def List(self): - ''' - - Returns -> typing.Sequence[~BackupsMetadataResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Backups', - request='List', - version=2, - 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='PrepareRestore', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def Remove(self, id_): - ''' - id_ : str - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Backups', - request='Remove', - version=2, - 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=2, - params=_params) - _params['backup-id'] = backup_id - reply = await self.rpc(msg) - return reply - - - -class BlockFacade(Type): - name = 'Block' - version = 2 - schema = {'definitions': {'Block': {'additionalProperties': False, - 'properties': {'id': {'type': 'string'}, - 'message': {'type': 'string'}, - 'tag': {'type': 'string'}, - 'type': {'type': 'string'}}, - 'required': ['id', 'tag', 'type'], - 'type': 'object'}, - 'BlockResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/Block'}}, - 'required': ['result'], - 'type': 'object'}, - 'BlockResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/BlockResult'}, - 'type': 'array'}}, - 'type': 'object'}, - 'BlockSwitchParams': {'additionalProperties': False, - 'properties': {'message': {'type': 'string'}, - 'type': {'type': 'string'}}, - 'required': ['type'], - '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'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}}, - 'properties': {'List': {'properties': {'Result': {'$ref': '#/definitions/BlockResults'}}, - 'type': 'object'}, - 'SwitchBlockOff': {'properties': {'Params': {'$ref': '#/definitions/BlockSwitchParams'}, - 'Result': {'$ref': '#/definitions/ErrorResult'}}, - 'type': 'object'}, - 'SwitchBlockOn': {'properties': {'Params': {'$ref': '#/definitions/BlockSwitchParams'}, - 'Result': {'$ref': '#/definitions/ErrorResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(BlockResults) - async def List(self): - ''' - - Returns -> typing.Sequence[~BlockResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Block', - request='List', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResult) - async def SwitchBlockOff(self, message, type_): - ''' - message : str - type_ : str - Returns -> Error - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Block', - request='SwitchBlockOff', - version=2, - params=_params) - _params['message'] = message - _params['type'] = type_ - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResult) - async def SwitchBlockOn(self, message, type_): - ''' - message : str - type_ : str - Returns -> Error - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Block', - request='SwitchBlockOn', - version=2, - params=_params) - _params['message'] = message - _params['type'] = type_ - reply = await self.rpc(msg) - return reply - - - -class BundleFacade(Type): - name = 'Bundle' - version = 2 - 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': {'bundleURL': {'type': 'string'}, - 'yaml': {'type': 'string'}}, - 'required': ['yaml', 'bundleURL'], - 'type': 'object'}, - 'BundleChangesResults': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'}, - 'type': 'array'}, - 'errors': {'items': {'type': 'string'}, - 'type': 'array'}}, - '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'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - 'type': 'object'}}, - 'properties': {'ExportBundle': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, - 'type': 'object'}, - 'GetChanges': {'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, - 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(StringResult) - async def ExportBundle(self): - ''' - - Returns -> typing.Union[_ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Bundle', - request='ExportBundle', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(BundleChangesResults) - async def GetChanges(self, yaml): - ''' - yaml : str - Returns -> typing.Union[typing.Sequence[~BundleChange], typing.Sequence[str]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Bundle', - request='GetChanges', - version=2, - params=_params) - _params['yaml'] = yaml - reply = await self.rpc(msg) - return reply - - - -class CharmRevisionUpdaterFacade(Type): - name = 'CharmRevisionUpdater' - version = 2 - schema = {'definitions': {'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'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}}, - 'properties': {'UpdateLatestRevisions': {'properties': {'Result': {'$ref': '#/definitions/ErrorResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResult) - async def UpdateLatestRevisions(self): - ''' - - Returns -> Error - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CharmRevisionUpdater', - request='UpdateLatestRevisions', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class CharmsFacade(Type): - name = 'Charms' - version = 2 - schema = {'definitions': {'CharmActionSpec': {'additionalProperties': False, - 'properties': {'description': {'type': 'string'}, - 'params': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}}, - 'required': ['description', 'params'], - 'type': 'object'}, - 'CharmActions': {'additionalProperties': False, - 'properties': {'specs': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmActionSpec'}}, - 'type': 'object'}}, - 'type': 'object'}, - 'CharmDevice': {'additionalProperties': False, - 'properties': {'CountMax': {'type': 'integer'}, - 'CountMin': {'type': 'integer'}, - 'Description': {'type': 'string'}, - 'Name': {'type': 'string'}, - 'Type': {'type': 'string'}}, - 'required': ['Name', - 'Description', - 'Type', - 'CountMin', - 'CountMax'], - 'type': 'object'}, - 'CharmInfo': {'additionalProperties': False, - 'properties': {'actions': {'$ref': '#/definitions/CharmActions'}, - 'config': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmOption'}}, - 'type': 'object'}, - 'lxd-profile': {'$ref': '#/definitions/CharmLXDProfile'}, - 'meta': {'$ref': '#/definitions/CharmMeta'}, - 'metrics': {'$ref': '#/definitions/CharmMetrics'}, - 'revision': {'type': 'integer'}, - 'url': {'type': 'string'}}, - 'required': ['revision', 'url', 'config'], - 'type': 'object'}, - 'CharmLXDProfile': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'description': {'type': 'string'}, - 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}}, - 'type': 'object'}}, - 'required': ['config', - 'description', - 'devices'], - 'type': 'object'}, - 'CharmMeta': {'additionalProperties': False, - 'properties': {'categories': {'items': {'type': 'string'}, - 'type': 'array'}, - 'description': {'type': 'string'}, - 'devices': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmDevice'}}, - 'type': 'object'}, - 'extra-bindings': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'min-juju-version': {'type': 'string'}, - 'name': {'type': 'string'}, - 'payload-classes': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmPayloadClass'}}, - 'type': 'object'}, - 'peers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, - 'type': 'object'}, - 'provides': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, - 'type': 'object'}, - 'requires': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, - 'type': 'object'}, - 'resources': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmResourceMeta'}}, - 'type': 'object'}, - 'series': {'items': {'type': 'string'}, - 'type': 'array'}, - 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmStorage'}}, - 'type': 'object'}, - 'subordinate': {'type': 'boolean'}, - 'summary': {'type': 'string'}, - 'tags': {'items': {'type': 'string'}, - 'type': 'array'}, - 'terms': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['name', - 'summary', - 'description', - 'subordinate'], - 'type': 'object'}, - 'CharmMetric': {'additionalProperties': False, - 'properties': {'description': {'type': 'string'}, - 'type': {'type': 'string'}}, - 'required': ['type', 'description'], - 'type': 'object'}, - 'CharmMetrics': {'additionalProperties': False, - 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, - 'type': 'object'}, - 'plan': {'$ref': '#/definitions/CharmPlan'}}, - 'required': ['metrics', 'plan'], - 'type': 'object'}, - 'CharmOption': {'additionalProperties': False, - 'properties': {'default': {'additionalProperties': True, - 'type': 'object'}, - 'description': {'type': 'string'}, - 'type': {'type': 'string'}}, - 'required': ['type'], - 'type': 'object'}, - 'CharmPayloadClass': {'additionalProperties': False, - 'properties': {'name': {'type': 'string'}, - 'type': {'type': 'string'}}, - 'required': ['name', 'type'], - 'type': 'object'}, - 'CharmPlan': {'additionalProperties': False, - 'properties': {'required': {'type': 'boolean'}}, - 'required': ['required'], - 'type': 'object'}, - 'CharmRelation': {'additionalProperties': False, - 'properties': {'interface': {'type': 'string'}, - 'limit': {'type': 'integer'}, - 'name': {'type': 'string'}, - 'optional': {'type': 'boolean'}, - 'role': {'type': 'string'}, - 'scope': {'type': 'string'}}, - 'required': ['name', - 'role', - 'interface', - 'optional', - 'limit', - 'scope'], - 'type': 'object'}, - 'CharmResourceMeta': {'additionalProperties': False, - 'properties': {'description': {'type': 'string'}, - 'name': {'type': 'string'}, - 'path': {'type': 'string'}, - 'type': {'type': 'string'}}, - 'required': ['name', - 'type', - 'path', - 'description'], - 'type': 'object'}, - 'CharmStorage': {'additionalProperties': False, - 'properties': {'count-max': {'type': 'integer'}, - 'count-min': {'type': 'integer'}, - 'description': {'type': 'string'}, - 'location': {'type': 'string'}, - 'minimum-size': {'type': 'integer'}, - 'name': {'type': 'string'}, - 'properties': {'items': {'type': 'string'}, - 'type': 'array'}, - 'read-only': {'type': 'boolean'}, - 'shared': {'type': 'boolean'}, - 'type': {'type': 'string'}}, - 'required': ['name', - 'description', - 'type', - 'shared', - 'read-only', - 'count-min', - 'count-max', - 'minimum-size'], - 'type': 'object'}, - 'CharmURL': {'additionalProperties': False, - 'properties': {'url': {'type': 'string'}}, - 'required': ['url'], - 'type': 'object'}, - 'CharmsList': {'additionalProperties': False, - 'properties': {'names': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['names'], - 'type': 'object'}, - 'CharmsListResult': {'additionalProperties': False, - 'properties': {'charm-urls': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['charm-urls'], - 'type': 'object'}, - 'IsMeteredResult': {'additionalProperties': False, - 'properties': {'metered': {'type': 'boolean'}}, - 'required': ['metered'], - 'type': 'object'}}, - 'properties': {'CharmInfo': {'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, - 'Result': {'$ref': '#/definitions/CharmInfo'}}, - 'type': 'object'}, - 'IsMetered': {'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, - 'Result': {'$ref': '#/definitions/IsMeteredResult'}}, - 'type': 'object'}, - 'List': {'properties': {'Params': {'$ref': '#/definitions/CharmsList'}, - 'Result': {'$ref': '#/definitions/CharmsListResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(CharmInfo) - async def CharmInfo(self, url): - ''' - url : str - Returns -> typing.Union[_ForwardRef('CharmActions'), typing.Mapping[str, ~CharmOption], _ForwardRef('CharmMeta'), _ForwardRef('CharmMetrics'), int, str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Charms', - request='CharmInfo', - version=2, - params=_params) - _params['url'] = url - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(IsMeteredResult) - async def IsMetered(self, url): - ''' - url : str - Returns -> bool - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Charms', - request='IsMetered', - version=2, - params=_params) - _params['url'] = url - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(CharmsListResult) - async def List(self, names): - ''' - names : typing.Sequence[str] - Returns -> typing.Sequence[str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Charms', - request='List', - version=2, - params=_params) - _params['names'] = names - reply = await self.rpc(msg) - return reply - - - -class CleanerFacade(Type): - name = 'Cleaner' - version = 2 - schema = {'definitions': {'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'}, - 'NotifyWatchResult': {'additionalProperties': False, - 'properties': {'NotifyWatcherId': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['NotifyWatcherId'], - 'type': 'object'}}, - 'properties': {'Cleanup': {'type': 'object'}, - 'WatchCleanups': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(None) - async def Cleanup(self): - ''' - - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Cleaner', - request='Cleanup', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResult) - async def WatchCleanups(self): - ''' - - Returns -> typing.Union[str, _ForwardRef('Error')] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Cleaner', - request='WatchCleanups', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class ClientFacade(Type): - name = 'Client' - version = 2 - 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'}, - 'force': {'type': 'boolean'}, - 'url': {'type': 'string'}}, - 'required': ['url', 'channel', 'force'], - 'type': 'object'}, - 'AddCharmWithAuthorization': {'additionalProperties': False, - 'properties': {'channel': {'type': 'string'}, - 'force': {'type': 'boolean'}, - 'macaroon': {'$ref': '#/definitions/Macaroon'}, - 'url': {'type': 'string'}}, - 'required': ['url', - 'channel', - 'macaroon', - 'force'], - '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'}, - 'ApplicationOfferStatus': {'additionalProperties': False, - 'properties': {'active-connected-count': {'type': 'integer'}, - 'application-name': {'type': 'string'}, - 'charm': {'type': 'string'}, - 'endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteEndpoint'}}, - 'type': 'object'}, - 'err': {'additionalProperties': True, - 'type': 'object'}, - 'offer-name': {'type': 'string'}, - 'total-connected-count': {'type': 'integer'}}, - 'required': ['offer-name', - 'application-name', - 'charm', - 'endpoints', - 'active-connected-count', - 'total-connected-count'], - 'type': 'object'}, - 'ApplicationStatus': {'additionalProperties': False, - 'properties': {'can-upgrade-to': {'type': 'string'}, - 'charm': {'type': 'string'}, - 'charm-verion': {'type': 'string'}, - 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'err': {'additionalProperties': True, - 'type': 'object'}, - 'exposed': {'type': 'boolean'}, - 'int': {'type': 'integer'}, - 'life': {'type': 'string'}, - 'meter-statuses': {'patternProperties': {'.*': {'$ref': '#/definitions/MeterStatus'}}, - 'type': 'object'}, - 'provider-id': {'type': 'string'}, - 'public-address': {'type': 'string'}, - 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'series': {'type': 'string'}, - 'status': {'$ref': '#/definitions/DetailedStatus'}, - 'string': {'type': 'string'}, - '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', - 'charm-verion', - 'endpoint-bindings', - 'public-address'], - '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': {'bundleURL': {'type': 'string'}, - 'yaml': {'type': 'string'}}, - 'required': ['yaml', 'bundleURL'], - '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': {'agentstream': {'type': 'string'}, - 'arch': {'type': 'string'}, - 'major': {'type': 'integer'}, - 'minor': {'type': 'integer'}, - 'number': {'$ref': '#/definitions/Number'}, - 'series': {'type': 'string'}}, - 'required': ['number', - 'major', - 'minor', - 'arch', - 'series', - 'agentstream'], - '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'}, - 'controller-timestamp': {'format': 'date-time', - 'type': 'string'}, - 'machines': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}}, - 'type': 'object'}, - 'model': {'$ref': '#/definitions/ModelStatusInfo'}, - 'offers': {'patternProperties': {'.*': {'$ref': '#/definitions/ApplicationOfferStatus'}}, - 'type': 'object'}, - 'relations': {'items': {'$ref': '#/definitions/RelationStatus'}, - 'type': 'array'}, - 'remote-applications': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteApplicationStatus'}}, - 'type': 'object'}}, - 'required': ['model', - 'machines', - 'applications', - 'remote-applications', - 'offers', - 'relations', - 'controller-timestamp'], - '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'}, - 'LXDProfile': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'description': {'type': 'string'}, - 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}}, - 'type': 'object'}}, - 'required': ['config', - 'description', - 'devices'], - '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'}, - 'lxd-profiles': {'patternProperties': {'.*': {'$ref': '#/definitions/LXDProfile'}}, - 'type': 'object'}, - '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'}, - 'type': {'type': 'string'}, - 'users': {'items': {'$ref': '#/definitions/ModelUserInfo'}, - 'type': 'array'}, - 'uuid': {'type': 'string'}}, - 'required': ['name', - 'type', - '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'}, - 'message': {'type': 'string'}, - 'status': {'type': 'string'}, - 'wants-vote': {'type': 'boolean'}}, - 'required': ['id'], - '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'], - 'type': 'object'}, - 'ModelSLAInfo': {'additionalProperties': False, - 'properties': {'level': {'type': 'string'}, - 'owner': {'type': 'string'}}, - 'required': ['level', 'owner'], - 'type': 'object'}, - 'ModelSet': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}}, - 'required': ['config'], - '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'}, - 'type': {'type': 'string'}, - 'version': {'type': 'string'}}, - 'required': ['name', - 'type', - 'cloud-tag', - 'version', - 'available-version', - 'model-status', - 'meter-status', - 'sla'], - 'type': 'object'}, - 'ModelUnset': {'additionalProperties': False, - 'properties': {'keys': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['keys'], - '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'}, - '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'}, - 'Placement': {'additionalProperties': False, - 'properties': {'directive': {'type': 'string'}, - 'scope': {'type': 'string'}}, - 'required': ['scope', 'directive'], - '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'], - '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'}, - 'status': {'$ref': '#/definitions/DetailedStatus'}}, - 'required': ['id', - 'key', - 'interface', - 'scope', - 'endpoints', - 'status'], - 'type': 'object'}, - 'RemoteApplicationStatus': {'additionalProperties': False, - 'properties': {'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, - 'type': 'array'}, - 'err': {'additionalProperties': True, - 'type': 'object'}, - 'life': {'type': 'string'}, - 'offer-name': {'type': 'string'}, - 'offer-url': {'type': 'string'}, - 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'status': {'$ref': '#/definitions/DetailedStatus'}}, - 'required': ['offer-url', - 'offer-name', - 'endpoints', - 'life', - 'relations', - 'status'], - 'type': 'object'}, - 'RemoteEndpoint': {'additionalProperties': False, - 'properties': {'interface': {'type': 'string'}, - 'limit': {'type': 'integer'}, - 'name': {'type': 'string'}, - 'role': {'type': 'string'}}, - 'required': ['name', - 'role', - 'interface', - 'limit'], - 'type': 'object'}, - 'ResolveCharmResult': {'additionalProperties': False, - 'properties': {'error': {'type': 'string'}, - 'url': {'type': 'string'}}, - 'type': 'object'}, - 'ResolveCharmResults': {'additionalProperties': False, - 'properties': {'urls': {'items': {'$ref': '#/definitions/ResolveCharmResult'}, - 'type': 'array'}}, - 'required': ['urls'], - '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'], - 'type': 'object'}, - 'SetConstraints': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'constraints': {'$ref': '#/definitions/Value'}}, - 'required': ['application', 'constraints'], - 'type': 'object'}, - 'SetModelAgentVersion': {'additionalProperties': False, - 'properties': {'force': {'type': 'boolean'}, - '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'], - 'type': 'object'}, - 'StatusHistoryResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'history': {'$ref': '#/definitions/History'}}, - 'required': ['history'], - 'type': 'object'}, - 'StatusHistoryResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StatusHistoryResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'StatusParams': {'additionalProperties': False, - 'properties': {'patterns': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['patterns'], - 'type': 'object'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - 'type': 'object'}, - 'Tools': {'additionalProperties': False, - 'properties': {'sha256': {'type': 'string'}, - 'size': {'type': 'integer'}, - 'url': {'type': 'string'}, - 'version': {'$ref': '#/definitions/Binary'}}, - 'required': ['version', 'url', 'size'], - 'type': 'object'}, - 'UnitStatus': {'additionalProperties': False, - 'properties': {'address': {'type': 'string'}, - 'agent-status': {'$ref': '#/definitions/DetailedStatus'}, - 'charm': {'type': 'string'}, - 'leader': {'type': 'boolean'}, - 'machine': {'type': 'string'}, - 'opened-ports': {'items': {'type': 'string'}, - 'type': 'array'}, - 'provider-id': {'type': 'string'}, - 'public-address': {'type': 'string'}, - 'subordinates': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, - 'type': 'object'}, - 'workload-status': {'$ref': '#/definitions/DetailedStatus'}, - 'workload-version': {'type': 'string'}}, - 'required': ['agent-status', - 'workload-status', - 'workload-version', - 'machine', - 'opened-ports', - 'public-address', - 'charm', - 'subordinates'], - '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': {'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, - 'type': 'object'}, - 'AbortCurrentUpgrade': {'type': 'object'}, - 'AddCharm': {'properties': {'Params': {'$ref': '#/definitions/AddCharm'}}, - 'type': 'object'}, - 'AddCharmWithAuthorization': {'properties': {'Params': {'$ref': '#/definitions/AddCharmWithAuthorization'}}, - 'type': 'object'}, - 'AddMachines': {'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, - 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, - 'type': 'object'}, - 'AddMachinesV2': {'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, - 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, - 'type': 'object'}, - 'AgentVersion': {'properties': {'Result': {'$ref': '#/definitions/AgentVersionResult'}}, - 'type': 'object'}, - 'CACert': {'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, - 'type': 'object'}, - 'DestroyMachines': {'properties': {'Params': {'$ref': '#/definitions/DestroyMachines'}}, - 'type': 'object'}, - 'FindTools': {'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, - 'Result': {'$ref': '#/definitions/FindToolsResult'}}, - 'type': 'object'}, - 'FullStatus': {'properties': {'Params': {'$ref': '#/definitions/StatusParams'}, - 'Result': {'$ref': '#/definitions/FullStatus'}}, - 'type': 'object'}, - 'GetBundleChanges': {'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, - 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, - 'type': 'object'}, - 'GetModelConstraints': {'properties': {'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, - 'type': 'object'}, - 'InjectMachines': {'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, - 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, - 'type': 'object'}, - 'ModelGet': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, - 'type': 'object'}, - 'ModelInfo': {'properties': {'Result': {'$ref': '#/definitions/ModelInfo'}}, - 'type': 'object'}, - 'ModelSet': {'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, - 'type': 'object'}, - 'ModelUnset': {'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, - 'type': 'object'}, - 'ModelUserInfo': {'properties': {'Result': {'$ref': '#/definitions/ModelUserInfoResults'}}, - 'type': 'object'}, - 'PrivateAddress': {'properties': {'Params': {'$ref': '#/definitions/PrivateAddress'}, - 'Result': {'$ref': '#/definitions/PrivateAddressResults'}}, - 'type': 'object'}, - 'ProvisioningScript': {'properties': {'Params': {'$ref': '#/definitions/ProvisioningScriptParams'}, - 'Result': {'$ref': '#/definitions/ProvisioningScriptResult'}}, - 'type': 'object'}, - 'PublicAddress': {'properties': {'Params': {'$ref': '#/definitions/PublicAddress'}, - 'Result': {'$ref': '#/definitions/PublicAddressResults'}}, - 'type': 'object'}, - 'ResolveCharms': {'properties': {'Params': {'$ref': '#/definitions/ResolveCharms'}, - 'Result': {'$ref': '#/definitions/ResolveCharmResults'}}, - 'type': 'object'}, - 'Resolved': {'properties': {'Params': {'$ref': '#/definitions/Resolved'}}, - 'type': 'object'}, - 'RetryProvisioning': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SLALevel': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, - 'type': 'object'}, - 'SetModelAgentVersion': {'properties': {'Params': {'$ref': '#/definitions/SetModelAgentVersion'}}, - 'type': 'object'}, - 'SetModelConstraints': {'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, - 'type': 'object'}, - 'SetSLALevel': {'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, - 'type': 'object'}, - 'StatusHistory': {'properties': {'Params': {'$ref': '#/definitions/StatusHistoryRequests'}, - 'Result': {'$ref': '#/definitions/StatusHistoryResults'}}, - 'type': 'object'}, - 'WatchAll': {'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(APIHostPortsResult) - async def APIHostPorts(self): - ''' - - Returns -> typing.Sequence[~HostPort] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='APIHostPorts', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def AbortCurrentUpgrade(self): - ''' - - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AbortCurrentUpgrade', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def AddCharm(self, channel, url): - ''' - channel : str - url : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AddCharm', - version=2, - params=_params) - _params['channel'] = channel - _params['url'] = url - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def AddCharmWithAuthorization(self, channel, macaroon, url): - ''' - channel : str - macaroon : Macaroon - url : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AddCharmWithAuthorization', - version=2, - params=_params) - _params['channel'] = channel - _params['macaroon'] = macaroon - _params['url'] = url - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AddMachinesResults) - async def AddMachines(self, params): - ''' - params : typing.Sequence[~AddMachineParams] - Returns -> typing.Sequence[~AddMachinesResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AddMachines', - version=2, - params=_params) - _params['params'] = params - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AddMachinesResults) - async def AddMachinesV2(self, params): - ''' - params : typing.Sequence[~AddMachineParams] - Returns -> typing.Sequence[~AddMachinesResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AddMachinesV2', - version=2, - params=_params) - _params['params'] = params - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AgentVersionResult) - async def AgentVersion(self): - ''' - - Returns -> Number - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AgentVersion', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(BytesResult) - async def CACert(self): - ''' - - Returns -> typing.Sequence[int] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='CACert', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def DestroyMachines(self, force, machine_names): - ''' - force : bool - machine_names : typing.Sequence[str] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='DestroyMachines', - version=2, - params=_params) - _params['force'] = force - _params['machine-names'] = machine_names - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(FindToolsResult) - async def FindTools(self, arch, major, minor, number, series): - ''' - arch : str - major : int - minor : int - number : Number - series : str - Returns -> typing.Union[_ForwardRef('Error'), typing.Sequence[~Tools]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='FindTools', - version=2, - params=_params) - _params['arch'] = arch - _params['major'] = major - _params['minor'] = minor - _params['number'] = number - _params['series'] = series - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(FullStatus) - async def FullStatus(self, patterns): - ''' - patterns : typing.Sequence[str] - Returns -> typing.Union[typing.Mapping[str, ~ApplicationStatus], str, typing.Mapping[str, ~MachineStatus], _ForwardRef('ModelStatusInfo'), typing.Mapping[str, ~ApplicationOfferStatus], typing.Sequence[~RelationStatus], typing.Mapping[str, ~RemoteApplicationStatus]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='FullStatus', - version=2, - params=_params) - _params['patterns'] = patterns - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(BundleChangesResults) - async def GetBundleChanges(self, yaml): - ''' - yaml : str - Returns -> typing.Union[typing.Sequence[~BundleChange], typing.Sequence[str]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='GetBundleChanges', - version=2, - params=_params) - _params['yaml'] = yaml - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(GetConstraintsResults) - async def GetModelConstraints(self): - ''' - - Returns -> Value - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='GetModelConstraints', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AddMachinesResults) - async def InjectMachines(self, params): - ''' - params : typing.Sequence[~AddMachineParams] - Returns -> typing.Sequence[~AddMachinesResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='InjectMachines', - version=2, - params=_params) - _params['params'] = params - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ModelConfigResults) - async def ModelGet(self): - ''' - - Returns -> typing.Mapping[str, ~ConfigValue] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ModelGet', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ModelInfo) - async def ModelInfo(self): - ''' - - Returns -> typing.Union[_ForwardRef('Number'), str, typing.Sequence[~ModelMachineInfo], _ForwardRef('ModelMigrationStatus'), _ForwardRef('ModelSLAInfo'), _ForwardRef('EntityStatus'), typing.Sequence[~ModelUserInfo]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ModelInfo', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def ModelSet(self, config): - ''' - config : typing.Mapping[str, typing.Any] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ModelSet', - version=2, - params=_params) - _params['config'] = config - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def ModelUnset(self, keys): - ''' - keys : typing.Sequence[str] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ModelUnset', - version=2, - params=_params) - _params['keys'] = keys - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ModelUserInfoResults) - async def ModelUserInfo(self): - ''' - - Returns -> typing.Sequence[~ModelUserInfoResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ModelUserInfo', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(PrivateAddressResults) - async def PrivateAddress(self, target): - ''' - target : str - Returns -> str - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='PrivateAddress', - version=2, - params=_params) - _params['target'] = target - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ProvisioningScriptResult) - async def ProvisioningScript(self, data_dir, disable_package_commands, machine_id, nonce): - ''' - data_dir : str - disable_package_commands : bool - machine_id : str - nonce : str - Returns -> str - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ProvisioningScript', - version=2, - params=_params) - _params['data-dir'] = data_dir - _params['disable-package-commands'] = disable_package_commands - _params['machine-id'] = machine_id - _params['nonce'] = nonce - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(PublicAddressResults) - async def PublicAddress(self, target): - ''' - target : str - Returns -> str - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='PublicAddress', - version=2, - params=_params) - _params['target'] = target - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ResolveCharmResults) - async def ResolveCharms(self, references): - ''' - references : typing.Sequence[str] - Returns -> typing.Sequence[~ResolveCharmResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ResolveCharms', - version=2, - params=_params) - _params['references'] = references - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Resolved(self, retry, unit_name): - ''' - retry : bool - unit_name : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='Resolved', - version=2, - params=_params) - _params['retry'] = retry - _params['unit-name'] = unit_name - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def RetryProvisioning(self, entities): - ''' - entities : typing.Sequence[~Entity] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='RetryProvisioning', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringResult) - async def SLALevel(self): - ''' - - Returns -> typing.Union[_ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='SLALevel', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def SetModelAgentVersion(self, version): - ''' - version : Number - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='SetModelAgentVersion', - version=2, - params=_params) - _params['version'] = version - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def SetModelConstraints(self, application, constraints): - ''' - application : str - constraints : Value - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='SetModelConstraints', - version=2, - params=_params) - _params['application'] = application - _params['constraints'] = constraints - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def SetSLALevel(self, creds, level): - ''' - creds : typing.Sequence[int] - level : str - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='SetSLALevel', - version=2, - params=_params) - _params['creds'] = creds - _params['level'] = level - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StatusHistoryResults) - async def StatusHistory(self, requests): - ''' - requests : typing.Sequence[~StatusHistoryRequest] - Returns -> typing.Sequence[~StatusHistoryResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='StatusHistory', - version=2, - params=_params) - _params['requests'] = requests - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AllWatcherId) - async def WatchAll(self): - ''' - - Returns -> str - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='WatchAll', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class CredentialValidatorFacade(Type): - name = 'CredentialValidator' - version = 2 - schema = {'definitions': {'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'}, - 'InvalidateCredentialArg': {'additionalProperties': False, - 'properties': {'reason': {'type': 'string'}}, - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'ModelCredential': {'additionalProperties': False, - 'properties': {'credential-tag': {'type': 'string'}, - 'exists': {'type': 'boolean'}, - 'model-tag': {'type': 'string'}, - 'valid': {'type': 'boolean'}}, - 'required': ['model-tag', - 'credential-tag'], - 'type': 'object'}, - 'NotifyWatchResult': {'additionalProperties': False, - 'properties': {'NotifyWatcherId': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['NotifyWatcherId'], - 'type': 'object'}}, - 'properties': {'InvalidateModelCredential': {'properties': {'Params': {'$ref': '#/definitions/InvalidateCredentialArg'}, - 'Result': {'$ref': '#/definitions/ErrorResult'}}, - 'type': 'object'}, - 'ModelCredential': {'properties': {'Result': {'$ref': '#/definitions/ModelCredential'}}, - 'type': 'object'}, - 'WatchCredential': {'properties': {'Params': {'$ref': '#/definitions/Entity'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, - 'type': 'object'}, - 'WatchModelCredential': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResult) - async def InvalidateModelCredential(self, reason): - ''' - reason : str - Returns -> Error - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CredentialValidator', - request='InvalidateModelCredential', - version=2, - params=_params) - _params['reason'] = reason - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ModelCredential) - async def ModelCredential(self): - ''' - - Returns -> typing.Union[str, bool] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CredentialValidator', - request='ModelCredential', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResult) - async def WatchCredential(self, tag): - ''' - tag : str - Returns -> typing.Union[str, _ForwardRef('Error')] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CredentialValidator', - request='WatchCredential', - version=2, - params=_params) - _params['tag'] = tag - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(NotifyWatchResult) - async def WatchModelCredential(self): - ''' - - Returns -> typing.Union[str, _ForwardRef('Error')] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='CredentialValidator', - request='WatchModelCredential', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class DiscoverSpacesFacade(Type): - name = 'DiscoverSpaces' - version = 2 - schema = {'definitions': {'AddSubnetParams': {'additionalProperties': False, - 'properties': {'provider-network-id': {'type': 'string'}, - 'space-tag': {'type': 'string'}, - 'subnet-provider-id': {'type': 'string'}, - 'subnet-tag': {'type': 'string'}, - 'vlan-tag': {'type': 'integer'}, - 'zones': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['space-tag'], - 'type': 'object'}, - 'AddSubnetsParams': {'additionalProperties': False, - 'properties': {'subnets': {'items': {'$ref': '#/definitions/AddSubnetParams'}, - 'type': 'array'}}, - 'required': ['subnets'], - 'type': 'object'}, - 'CreateSpaceParams': {'additionalProperties': False, - 'properties': {'provider-id': {'type': 'string'}, - 'public': {'type': 'boolean'}, - 'space-tag': {'type': 'string'}, - 'subnet-tags': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['subnet-tags', - 'space-tag', - 'public'], - 'type': 'object'}, - 'CreateSpacesParams': {'additionalProperties': False, - 'properties': {'spaces': {'items': {'$ref': '#/definitions/CreateSpaceParams'}, - 'type': 'array'}}, - 'required': ['spaces'], - 'type': 'object'}, - 'DiscoverSpacesResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ProviderSpace'}, - 'type': 'array'}}, - 'required': ['results'], - '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'}, - 'ListSubnetsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/Subnet'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'ModelConfigResult': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}}, - 'required': ['config'], - 'type': 'object'}, - 'ProviderSpace': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'name': {'type': 'string'}, - 'provider-id': {'type': 'string'}, - 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, - 'type': 'array'}}, - 'required': ['name', - 'provider-id', - 'subnets'], - 'type': 'object'}, - 'Subnet': {'additionalProperties': False, - 'properties': {'cidr': {'type': 'string'}, - 'life': {'type': 'string'}, - 'provider-id': {'type': 'string'}, - 'provider-network-id': {'type': 'string'}, - 'provider-space-id': {'type': 'string'}, - 'space-tag': {'type': 'string'}, - 'status': {'type': 'string'}, - 'vlan-tag': {'type': 'integer'}, - 'zones': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['cidr', - 'vlan-tag', - 'life', - 'space-tag', - 'zones'], - 'type': 'object'}, - 'SubnetsFilters': {'additionalProperties': False, - 'properties': {'space-tag': {'type': 'string'}, - 'zone': {'type': 'string'}}, - 'type': 'object'}}, - 'properties': {'AddSubnets': {'properties': {'Params': {'$ref': '#/definitions/AddSubnetsParams'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'CreateSpaces': {'properties': {'Params': {'$ref': '#/definitions/CreateSpacesParams'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'ListSpaces': {'properties': {'Result': {'$ref': '#/definitions/DiscoverSpacesResults'}}, - 'type': 'object'}, - 'ListSubnets': {'properties': {'Params': {'$ref': '#/definitions/SubnetsFilters'}, - 'Result': {'$ref': '#/definitions/ListSubnetsResults'}}, - 'type': 'object'}, - 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResults) - async def AddSubnets(self, subnets): - ''' - subnets : typing.Sequence[~AddSubnetParams] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='DiscoverSpaces', - request='AddSubnets', - version=2, - params=_params) - _params['subnets'] = subnets - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def CreateSpaces(self, spaces): - ''' - spaces : typing.Sequence[~CreateSpaceParams] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='DiscoverSpaces', - request='CreateSpaces', - version=2, - params=_params) - _params['spaces'] = spaces - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(DiscoverSpacesResults) - async def ListSpaces(self): - ''' - - Returns -> typing.Sequence[~ProviderSpace] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='DiscoverSpaces', - request='ListSpaces', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ListSubnetsResults) - async def ListSubnets(self, space_tag, zone): - ''' - space_tag : str - zone : str - Returns -> typing.Sequence[~Subnet] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='DiscoverSpaces', - request='ListSubnets', - version=2, - params=_params) - _params['space-tag'] = space_tag - _params['zone'] = zone - 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='DiscoverSpaces', - request='ModelConfig', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class DiskManagerFacade(Type): - name = 'DiskManager' - version = 2 - schema = {'definitions': {'BlockDevice': {'additionalProperties': False, - 'properties': {'BusAddress': {'type': 'string'}, - 'DeviceLinks': {'items': {'type': 'string'}, - 'type': 'array'}, - 'DeviceName': {'type': 'string'}, - 'FilesystemType': {'type': 'string'}, - 'HardwareId': {'type': 'string'}, - 'InUse': {'type': 'boolean'}, - 'Label': {'type': 'string'}, - 'MountPoint': {'type': 'string'}, - 'Size': {'type': 'integer'}, - 'UUID': {'type': 'string'}, - 'WWN': {'type': 'string'}}, - 'required': ['DeviceName', - 'DeviceLinks', - 'Label', - 'UUID', - 'HardwareId', - 'WWN', - 'BusAddress', - 'Size', - 'FilesystemType', - 'InUse', - 'MountPoint'], - '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'}, - 'MachineBlockDevices': {'additionalProperties': False, - 'properties': {'block-devices': {'items': {'$ref': '#/definitions/BlockDevice'}, - 'type': 'array'}, - 'machine': {'type': 'string'}}, - 'required': ['machine'], - 'type': 'object'}, - 'SetMachineBlockDevices': {'additionalProperties': False, - 'properties': {'machine-block-devices': {'items': {'$ref': '#/definitions/MachineBlockDevices'}, - 'type': 'array'}}, - 'required': ['machine-block-devices'], - 'type': 'object'}}, - 'properties': {'SetMachineBlockDevices': {'properties': {'Params': {'$ref': '#/definitions/SetMachineBlockDevices'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResults) - async def SetMachineBlockDevices(self, machine_block_devices): - ''' - machine_block_devices : typing.Sequence[~MachineBlockDevices] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='DiskManager', - request='SetMachineBlockDevices', - version=2, - params=_params) - _params['machine-block-devices'] = machine_block_devices - reply = await self.rpc(msg) - return reply - - - -class EntityWatcherFacade(Type): - name = 'EntityWatcher' - version = 2 - schema = {'definitions': {'EntitiesWatchResult': {'additionalProperties': False, - 'properties': {'changes': {'items': {'type': 'string'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}, - 'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id'], - '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'}}, - 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/EntitiesWatchResult'}}, - 'type': 'object'}, - 'Stop': {'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(EntitiesWatchResult) - async def Next(self): - ''' - - Returns -> typing.Union[typing.Sequence[str], _ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='EntityWatcher', - request='Next', - version=2, - 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='EntityWatcher', - request='Stop', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class FilesystemAttachmentsWatcherFacade(Type): - name = 'FilesystemAttachmentsWatcher' - version = 2 - schema = {'definitions': {'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'}, - 'MachineStorageId': {'additionalProperties': False, - 'properties': {'attachment-tag': {'type': 'string'}, - 'machine-tag': {'type': 'string'}}, - 'required': ['machine-tag', - 'attachment-tag'], - 'type': 'object'}, - 'MachineStorageIdsWatchResult': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}, - 'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id', - 'changes'], - 'type': 'object'}}, - 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}}, - 'type': 'object'}, - 'Stop': {'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(MachineStorageIdsWatchResult) - async def Next(self): - ''' - - Returns -> typing.Union[typing.Sequence[~MachineStorageId], _ForwardRef('Error'), str] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='FilesystemAttachmentsWatcher', - request='Next', - version=2, - 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='FilesystemAttachmentsWatcher', - request='Stop', - version=2, - params=_params) - - reply = await self.rpc(msg) - return reply - - - -class HighAvailabilityFacade(Type): - name = 'HighAvailability' - version = 2 - schema = {'definitions': {'Address': {'additionalProperties': False, - 'properties': {'Scope': {'type': 'string'}, - 'SpaceName': {'type': 'string'}, - 'SpaceProviderId': {'type': 'string'}, - 'Type': {'type': 'string'}, - 'Value': {'type': 'string'}}, - 'required': ['Value', - 'Type', - 'Scope', - 'SpaceName', - 'SpaceProviderId'], - 'type': 'object'}, - 'ControllersChangeResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/ControllersChanges'}}, - 'required': ['result'], - 'type': 'object'}, - 'ControllersChangeResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ControllersChangeResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'ControllersChanges': {'additionalProperties': False, - 'properties': {'added': {'items': {'type': 'string'}, - 'type': 'array'}, - 'converted': {'items': {'type': 'string'}, - 'type': 'array'}, - 'demoted': {'items': {'type': 'string'}, - 'type': 'array'}, - 'maintained': {'items': {'type': 'string'}, - 'type': 'array'}, - 'promoted': {'items': {'type': 'string'}, - 'type': 'array'}, - 'removed': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'ControllersSpec': {'additionalProperties': False, - 'properties': {'constraints': {'$ref': '#/definitions/Value'}, - 'num-controllers': {'type': 'integer'}, - 'placement': {'items': {'type': 'string'}, - 'type': 'array'}, - 'series': {'type': 'string'}}, - 'required': ['num-controllers'], - 'type': 'object'}, - 'ControllersSpecs': {'additionalProperties': False, - 'properties': {'specs': {'items': {'$ref': '#/definitions/ControllersSpec'}, - 'type': 'array'}}, - 'required': ['specs'], - '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'}, - 'HAMember': {'additionalProperties': False, - 'properties': {'public-address': {'$ref': '#/definitions/Address'}, - 'series': {'type': 'string'}, - 'tag': {'type': 'string'}}, - 'required': ['tag', 'public-address', 'series'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'Member': {'additionalProperties': False, - 'properties': {'Address': {'type': 'string'}, - 'Id': {'type': 'integer'}, - 'Priority': {'type': 'number'}, - 'Tags': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'Votes': {'type': 'integer'}}, - 'required': ['Id', - 'Address', - 'Priority', - 'Tags', - 'Votes'], - 'type': 'object'}, - 'MongoUpgradeResults': {'additionalProperties': False, - 'properties': {'ha-members': {'items': {'$ref': '#/definitions/HAMember'}, - 'type': 'array'}, - 'master': {'$ref': '#/definitions/HAMember'}, - 'rs-members': {'items': {'$ref': '#/definitions/Member'}, - 'type': 'array'}}, - 'required': ['rs-members', - 'master', - 'ha-members'], - 'type': 'object'}, - 'MongoVersion': {'additionalProperties': False, - 'properties': {'engine': {'type': 'string'}, - 'major': {'type': 'integer'}, - 'minor': {'type': 'integer'}, - 'patch': {'type': 'string'}}, - 'required': ['major', - 'minor', - 'patch', - 'engine'], - 'type': 'object'}, - 'ResumeReplicationParams': {'additionalProperties': False, - 'properties': {'members': {'items': {'$ref': '#/definitions/Member'}, - 'type': 'array'}}, - 'required': ['members'], - 'type': 'object'}, - 'UpgradeMongoParams': {'additionalProperties': False, - 'properties': {'target': {'$ref': '#/definitions/MongoVersion'}}, - 'required': ['target'], - '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': {'EnableHA': {'properties': {'Params': {'$ref': '#/definitions/ControllersSpecs'}, - 'Result': {'$ref': '#/definitions/ControllersChangeResults'}}, - 'type': 'object'}, - 'ResumeHAReplicationAfterUpgrade': {'properties': {'Params': {'$ref': '#/definitions/ResumeReplicationParams'}}, - 'type': 'object'}, - 'StopHAReplicationForUpgrade': {'properties': {'Params': {'$ref': '#/definitions/UpgradeMongoParams'}, - 'Result': {'$ref': '#/definitions/MongoUpgradeResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ControllersChangeResults) - async def EnableHA(self, specs): - ''' - specs : typing.Sequence[~ControllersSpec] - Returns -> typing.Sequence[~ControllersChangeResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='HighAvailability', - request='EnableHA', - version=2, - params=_params) - _params['specs'] = specs - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def ResumeHAReplicationAfterUpgrade(self, members): - ''' - members : typing.Sequence[~Member] - Returns -> None - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='HighAvailability', - request='ResumeHAReplicationAfterUpgrade', - version=2, - params=_params) - _params['members'] = members - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(MongoUpgradeResults) - async def StopHAReplicationForUpgrade(self, target): - ''' - target : MongoVersion - Returns -> typing.Union[typing.Sequence[~HAMember], _ForwardRef('HAMember'), typing.Sequence[~Member]] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='HighAvailability', - request='StopHAReplicationForUpgrade', - version=2, - params=_params) - _params['target'] = target - reply = await self.rpc(msg) - return reply - - - -class ImageManagerFacade(Type): - name = 'ImageManager' - version = 2 - schema = {'definitions': {'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'}, - 'ImageFilterParams': {'additionalProperties': False, - 'properties': {'images': {'items': {'$ref': '#/definitions/ImageSpec'}, - 'type': 'array'}}, - 'required': ['images'], - 'type': 'object'}, - 'ImageMetadata': {'additionalProperties': False, - 'properties': {'arch': {'type': 'string'}, - 'created': {'format': 'date-time', - 'type': 'string'}, - 'kind': {'type': 'string'}, - 'series': {'type': 'string'}, - 'url': {'type': 'string'}}, - 'required': ['kind', - 'arch', - 'series', - 'url', - 'created'], - 'type': 'object'}, - 'ImageSpec': {'additionalProperties': False, - 'properties': {'arch': {'type': 'string'}, - 'kind': {'type': 'string'}, - 'series': {'type': 'string'}}, - 'required': ['kind', 'arch', 'series'], - 'type': 'object'}, - 'ListImageResult': {'additionalProperties': False, - 'properties': {'result': {'items': {'$ref': '#/definitions/ImageMetadata'}, - 'type': 'array'}}, - 'required': ['result'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}}, - 'properties': {'DeleteImages': {'properties': {'Params': {'$ref': '#/definitions/ImageFilterParams'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'ListImages': {'properties': {'Params': {'$ref': '#/definitions/ImageFilterParams'}, - 'Result': {'$ref': '#/definitions/ListImageResult'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResults) - async def DeleteImages(self, images): - ''' - images : typing.Sequence[~ImageSpec] - Returns -> typing.Sequence[~ErrorResult] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ImageManager', - request='DeleteImages', - version=2, - params=_params) - _params['images'] = images - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ListImageResult) - async def ListImages(self, images): - ''' - images : typing.Sequence[~ImageSpec] - Returns -> typing.Sequence[~ImageMetadata] - ''' - # map input types to rpc msg - _params = dict() - msg = dict(type='ImageManager', - request='ListImages', - version=2, - params=_params) - _params['images'] = images - reply = await self.rpc(msg) - return reply - - - -class ImageMetadataFacade(Type): - name = 'ImageMetadata' - version = 2 - schema = {'definitions': {'CloudImageMetadata': {'additionalProperties': False, - 'properties': {'arch': {'type': 'string'}, - 'image-id': {'type': 'string'}, - 'priority': {'type': 'integer'}, - 'region': {'type': 'string'}, - 'root-storage-size': {'type': 'integer'}, - 'root-storage-type': {'type': 'string'}, - 'series': {'type': 'string'}, - 'source': {'type': 'string'}, - 'stream': {'type': 'string'}, - 'version': {'type': 'string'}, - 'virt-type': {'type': 'string'}}, - 'required': ['image-id', - 'region', - 'version', - 'series', - 'arch', - 'source', - 'priority'], - 'type': 'object'}, - 'CloudImageMetadataList': {'additionalProperties': False, - 'properties': {'metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, - 'type': 'array'}}, - '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'}, - 'ImageMetadataFilter': {'additionalProperties': False, - 'properties': {'arches': {'items': {'type': 'string'}, - 'type': 'array'}, - 'region': {'type': 'string'}, - 'root-storage-type': {'type': 'string'}, - 'series': {'items': {'type': 'string'}, - 'type': 'array'}, - 'stream': {'type': 'string'}, - 'virt-type': {'type': 'string'}}, - 'type': 'object'}, - 'ListCloudImageMetadataResult': {'additionalProperties': False, - 'properties': {'result': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, - 'type': 'array'}}, - 'required': ['result'], - 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'MetadataImageIds': {'additionalProperties': False, -