From 6000f1e86349b61e29e1c634c65d6f4a3abf11d7 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Fri, 30 Aug 2024 10:19:31 +0900 Subject: [PATCH 01/29] Dima's local tox hacks --- tox.ini | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tox.ini b/tox.ini index dc37577b..ddbe6b71 100644 --- a/tox.ini +++ b/tox.ini @@ -36,12 +36,15 @@ deps = pytest pytest-asyncio pytest-xdist + pytest-randomly Twine websockets kubernetes hvac packaging setuptools +#setenv = +# SETUPTOOLS_USE_DISTUTILS=stdlib [testenv:docs] deps = @@ -66,8 +69,10 @@ commands = python -m pytest --tb native -ra -v -n auto -k 'integration' -m 'not serial' {posargs} [testenv:unit] +base_python = 3.10 envdir = {toxworkdir}/py3 commands = + python --version pip install urllib3<2 pip install pylxd python -m pytest --tb native -ra -v -n auto {toxinidir}/tests/unit {posargs} From 16872c3bc903305990c43c7011e871aa7f9cc653 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Fri, 30 Aug 2024 10:20:43 +0900 Subject: [PATCH 02/29] Add Facade 20 --- juju/client/_client.py | 5 +- juju/client/_client1.py | 56 +- juju/client/_client10.py | 897 + juju/client/_client19.py | 12 +- juju/client/_client2.py | 31 +- juju/client/_client20.py | 1773 + juju/client/_client3.py | 1065 + juju/client/_client5.py | 537 + juju/client/_client7.py | 7 +- juju/client/_definitions.py | 390 +- juju/client/facade.py | 8 +- juju/client/schemas-juju-3.5.2.json | 53484 ++++++++++++++++++++++++++ 12 files changed, 58198 insertions(+), 67 deletions(-) create mode 100644 juju/client/_client20.py create mode 100644 juju/client/schemas-juju-3.5.2.json diff --git a/juju/client/_client.py b/juju/client/_client.py index 4bfc5720..3cd83b9d 100644 --- a/juju/client/_client.py +++ b/juju/client/_client.py @@ -4,7 +4,7 @@ from juju.client._definitions import * -from juju.client import _client7, _client1, _client3, _client4, _client2, _client17, _client6, _client11, _client10, _client5, _client9, _client18, _client19 +from juju.client import _client7, _client1, _client3, _client4, _client2, _client17, _client6, _client11, _client10, _client5, _client9, _client18, _client19, _client20 CLIENTS = { @@ -20,7 +20,8 @@ "5": _client5, "9": _client9, "18": _client18, - "19": _client19 + "19": _client19, + "20": _client20 } diff --git a/juju/client/_client1.py b/juju/client/_client1.py index d7a4cca6..a4887fe4 100644 --- a/juju/client/_client1.py +++ b/juju/client/_client1.py @@ -738,9 +738,11 @@ class CAASApplicationProvisionerFacade(Type): 'name': {'type': 'string'}}, 'type': 'object'}, 'CharmContainer': {'additionalProperties': False, - 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'properties': {'gid': {'type': 'integer'}, + 'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, 'type': 'array'}, - 'resource': {'type': 'string'}}, + 'resource': {'type': 'string'}, + 'uid': {'type': 'integer'}}, 'type': 'object'}, 'CharmDeployment': {'additionalProperties': False, 'properties': {'min-version': {'type': 'string'}, @@ -783,6 +785,7 @@ class CAASApplicationProvisionerFacade(Type): 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, 'categories': {'items': {'type': 'string'}, 'type': 'array'}, + 'charm-user': {'type': 'string'}, 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, 'type': 'object'}, 'deployment': {'$ref': '#/definitions/CharmDeployment'}, @@ -1860,9 +1863,11 @@ class CAASFirewallerFacade(Type): 'name': {'type': 'string'}}, 'type': 'object'}, 'CharmContainer': {'additionalProperties': False, - 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'properties': {'gid': {'type': 'integer'}, + 'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, 'type': 'array'}, - 'resource': {'type': 'string'}}, + 'resource': {'type': 'string'}, + 'uid': {'type': 'integer'}}, 'type': 'object'}, 'CharmDeployment': {'additionalProperties': False, 'properties': {'min-version': {'type': 'string'}, @@ -1905,6 +1910,7 @@ class CAASFirewallerFacade(Type): 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, 'categories': {'items': {'type': 'string'}, 'type': 'array'}, + 'charm-user': {'type': 'string'}, 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, 'type': 'object'}, 'deployment': {'$ref': '#/definitions/CharmDeployment'}, @@ -2346,9 +2352,11 @@ class CAASFirewallerSidecarFacade(Type): 'name': {'type': 'string'}}, 'type': 'object'}, 'CharmContainer': {'additionalProperties': False, - 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'properties': {'gid': {'type': 'integer'}, + 'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, 'type': 'array'}, - 'resource': {'type': 'string'}}, + 'resource': {'type': 'string'}, + 'uid': {'type': 'integer'}}, 'type': 'object'}, 'CharmDeployment': {'additionalProperties': False, 'properties': {'min-version': {'type': 'string'}, @@ -2391,6 +2399,7 @@ class CAASFirewallerSidecarFacade(Type): 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, 'categories': {'items': {'type': 'string'}, 'type': 'array'}, + 'charm-user': {'type': 'string'}, 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, 'type': 'object'}, 'deployment': {'$ref': '#/definitions/CharmDeployment'}, @@ -3903,9 +3912,11 @@ class CAASOperatorProvisionerFacade(Type): 'name': {'type': 'string'}}, 'type': 'object'}, 'CharmContainer': {'additionalProperties': False, - 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'properties': {'gid': {'type': 'integer'}, + 'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, 'type': 'array'}, - 'resource': {'type': 'string'}}, + 'resource': {'type': 'string'}, + 'uid': {'type': 'integer'}}, 'type': 'object'}, 'CharmDeployment': {'additionalProperties': False, 'properties': {'min-version': {'type': 'string'}, @@ -3948,6 +3959,7 @@ class CAASOperatorProvisionerFacade(Type): 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, 'categories': {'items': {'type': 'string'}, 'type': 'array'}, + 'charm-user': {'type': 'string'}, 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, 'type': 'object'}, 'deployment': {'$ref': '#/definitions/CharmDeployment'}, @@ -4920,9 +4932,11 @@ class CrossModelSecretsFacade(Type): 'peek': {'type': 'boolean'}, 'refresh': {'type': 'boolean'}, 'revision': {'type': 'integer'}, + 'source-controller-uuid': {'type': 'string'}, 'unit-id': {'type': 'integer'}, 'uri': {'type': 'string'}}, - 'required': ['application-token', + 'required': ['source-controller-uuid', + 'application-token', 'unit-id', 'uri'], 'type': 'object'}, @@ -10094,7 +10108,13 @@ async def rpc(self, msg): class SecretsDrainFacade(Type): name = 'SecretsDrain' version = 1 - schema = {'definitions': {'ChangeSecretBackendArg': {'additionalProperties': False, + schema = {'definitions': {'AccessInfo': {'additionalProperties': False, + 'properties': {'role': {'type': 'string'}, + 'scope-tag': {'type': 'string'}, + 'target-tag': {'type': 'string'}}, + 'required': ['target-tag', 'scope-tag', 'role'], + 'type': 'object'}, + 'ChangeSecretBackendArg': {'additionalProperties': False, 'properties': {'content': {'$ref': '#/definitions/SecretContentParams'}, 'revision': {'type': 'integer'}, 'uri': {'type': 'string'}}, @@ -10122,7 +10142,9 @@ class SecretsDrainFacade(Type): 'required': ['results'], 'type': 'object'}, 'ListSecretResult': {'additionalProperties': False, - 'properties': {'create-time': {'format': 'date-time', + 'properties': {'access': {'items': {'$ref': '#/definitions/AccessInfo'}, + 'type': 'array'}, + 'create-time': {'format': 'date-time', 'type': 'string'}, 'description': {'type': 'string'}, 'label': {'type': 'string'}, @@ -12317,7 +12339,13 @@ async def WatchAPIVersion(self, entities=None): class UserSecretsDrainFacade(Type): name = 'UserSecretsDrain' version = 1 - schema = {'definitions': {'ChangeSecretBackendArg': {'additionalProperties': False, + schema = {'definitions': {'AccessInfo': {'additionalProperties': False, + 'properties': {'role': {'type': 'string'}, + 'scope-tag': {'type': 'string'}, + 'target-tag': {'type': 'string'}}, + 'required': ['target-tag', 'scope-tag', 'role'], + 'type': 'object'}, + 'ChangeSecretBackendArg': {'additionalProperties': False, 'properties': {'content': {'$ref': '#/definitions/SecretContentParams'}, 'revision': {'type': 'integer'}, 'uri': {'type': 'string'}}, @@ -12357,7 +12385,9 @@ class UserSecretsDrainFacade(Type): 'required': ['args'], 'type': 'object'}, 'ListSecretResult': {'additionalProperties': False, - 'properties': {'create-time': {'format': 'date-time', + 'properties': {'access': {'items': {'$ref': '#/definitions/AccessInfo'}, + 'type': 'array'}, + 'create-time': {'format': 'date-time', 'type': 'string'}, 'description': {'type': 'string'}, 'label': {'type': 'string'}, diff --git a/juju/client/_client10.py b/juju/client/_client10.py index e26850bf..2700cef3 100644 --- a/juju/client/_client10.py +++ b/juju/client/_client10.py @@ -663,3 +663,900 @@ async def WatchUpgradeSeriesNotifications(self, entities=None): return reply + +class ModelManagerFacade(Type): + name = 'ModelManager' + version = 10 + schema = {'definitions': {'ChangeModelCredentialParams': {'additionalProperties': False, + 'properties': {'credential-tag': {'type': 'string'}, + 'model-tag': {'type': 'string'}}, + 'required': ['model-tag', + 'credential-tag'], + 'type': 'object'}, + 'ChangeModelCredentialsParams': {'additionalProperties': False, + 'properties': {'model-credentials': {'items': {'$ref': '#/definitions/ChangeModelCredentialParams'}, + 'type': 'array'}}, + 'required': ['model-credentials'], + 'type': 'object'}, + 'DestroyModelParams': {'additionalProperties': False, + 'properties': {'destroy-storage': {'type': 'boolean'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}, + 'model-tag': {'type': 'string'}, + 'timeout': {'type': 'integer'}}, + 'required': ['model-tag'], + 'type': 'object'}, + 'DestroyModelsParams': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/DestroyModelParams'}, + 'type': 'array'}}, + 'required': ['models'], + 'type': 'object'}, + 'DumpModelRequest': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'simplified': {'type': 'boolean'}}, + 'required': ['entities', 'simplified'], + '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': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + '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'}, + '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'}, + 'virt-type': {'type': 'string'}}, + 'type': 'object'}, + 'MapResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['result'], + 'type': 'object'}, + 'MapResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MapResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Model': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'type': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'type', 'owner-tag'], + 'type': 'object'}, + 'ModelApplicationInfo': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}}, + 'required': ['name'], + 'type': 'object'}, + 'ModelCreateArgs': {'additionalProperties': False, + 'properties': {'cloud-tag': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'credential': {'type': 'string'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'region': {'type': 'string'}}, + 'required': ['name', 'owner-tag'], + 'type': 'object'}, + 'ModelDefaultValues': {'additionalProperties': False, + 'properties': {'cloud-region': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelDefaults': {'additionalProperties': False, + 'properties': {'controller': {'additionalProperties': True, + 'type': 'object'}, + 'default': {'additionalProperties': True, + 'type': 'object'}, + 'regions': {'items': {'$ref': '#/definitions/RegionDefaults'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ModelDefaultsResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ModelDefaults'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelDefaultsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ModelDefaultsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelEntityCount': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'entity': {'type': 'string'}}, + 'required': ['entity', 'count'], + 'type': 'object'}, + 'ModelFilesystemInfo': {'additionalProperties': False, + 'properties': {'detachable': {'type': 'boolean'}, + 'id': {'type': 'string'}, + 'message': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id'], + 'type': 'object'}, + 'ModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'cloud-credential-tag': {'type': 'string'}, + 'cloud-credential-validity': {'type': 'boolean'}, + 'cloud-region': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'controller-uuid': {'type': 'string'}, + 'default-base': {'type': 'string'}, + 'default-series': {'type': 'string'}, + 'is-controller': {'type': 'boolean'}, + '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'}, + 'secret-backends': {'items': {'$ref': '#/definitions/SecretBackendResult'}, + 'type': 'array'}, + 'sla': {'$ref': '#/definitions/ModelSLAInfo'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'supported-features': {'items': {'$ref': '#/definitions/SupportedFeature'}, + 'type': 'array'}, + 'type': {'type': 'string'}, + 'users': {'items': {'$ref': '#/definitions/ModelUserInfo'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', + 'type', + 'uuid', + 'controller-uuid', + 'is-controller', + 'cloud-tag', + 'owner-tag', + 'life', + 'users', + 'machines', + 'secret-backends', + 'sla', + 'agent-version'], + 'type': 'object'}, + 'ModelInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ModelInfo'}}, + 'type': 'object'}, + 'ModelInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ModelInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelMachineInfo': {'additionalProperties': False, + 'properties': {'display-name': {'type': 'string'}, + 'ha-primary': {'type': 'boolean'}, + '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'}, + 'ModelSLAInfo': {'additionalProperties': False, + 'properties': {'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', 'owner'], + 'type': 'object'}, + 'ModelStatus': {'additionalProperties': False, + 'properties': {'application-count': {'type': 'integer'}, + 'applications': {'items': {'$ref': '#/definitions/ModelApplicationInfo'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'filesystems': {'items': {'$ref': '#/definitions/ModelFilesystemInfo'}, + 'type': 'array'}, + 'hosted-machine-count': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'machines': {'items': {'$ref': '#/definitions/ModelMachineInfo'}, + 'type': 'array'}, + 'model-tag': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'type': {'type': 'string'}, + 'unit-count': {'type': 'integer'}, + 'volumes': {'items': {'$ref': '#/definitions/ModelVolumeInfo'}, + 'type': 'array'}}, + 'required': ['model-tag', + 'life', + 'type', + 'hosted-machine-count', + 'application-count', + 'unit-count', + 'owner-tag'], + 'type': 'object'}, + 'ModelStatusResults': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/ModelStatus'}, + 'type': 'array'}}, + 'required': ['models'], + 'type': 'object'}, + 'ModelSummariesRequest': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag'], + 'type': 'object'}, + 'ModelSummary': {'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'}, + 'counts': {'items': {'$ref': '#/definitions/ModelEntityCount'}, + 'type': 'array'}, + 'default-series': {'type': 'string'}, + 'is-controller': {'type': 'boolean'}, + 'last-connection': {'format': 'date-time', + 'type': 'string'}, + 'life': {'type': 'string'}, + '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'}, + 'user-access': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', + 'uuid', + 'type', + 'controller-uuid', + 'is-controller', + 'cloud-tag', + 'owner-tag', + 'life', + 'user-access', + 'last-connection', + 'counts', + 'sla', + 'agent-version'], + 'type': 'object'}, + 'ModelSummaryResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ModelSummary'}}, + 'type': 'object'}, + 'ModelSummaryResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ModelSummaryResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelUnsetKeys': {'additionalProperties': False, + 'properties': {'cloud-region': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + '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'}, + 'model-tag': {'type': 'string'}, + 'user': {'type': 'string'}}, + 'required': ['model-tag', + 'user', + 'display-name', + 'last-connection', + 'access'], + 'type': 'object'}, + 'ModelVolumeInfo': {'additionalProperties': False, + 'properties': {'detachable': {'type': 'boolean'}, + 'id': {'type': 'string'}, + 'message': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id'], + 'type': 'object'}, + 'ModifyModelAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'action': {'type': 'string'}, + 'model-tag': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', + 'action', + 'access', + 'model-tag'], + 'type': 'object'}, + 'ModifyModelAccessRequest': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyModelAccess'}, + 'type': 'array'}}, + 'required': ['changes'], + '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'}, + 'RegionDefaults': {'additionalProperties': False, + 'properties': {'region-name': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['region-name', 'value'], + 'type': 'object'}, + 'SecretBackend': {'additionalProperties': False, + 'properties': {'backend-type': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'name': {'type': 'string'}, + 'token-rotate-interval': {'type': 'integer'}}, + 'required': ['name', + 'backend-type', + 'config'], + 'type': 'object'}, + 'SecretBackendResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'message': {'type': 'string'}, + 'num-secrets': {'type': 'integer'}, + 'result': {'$ref': '#/definitions/SecretBackend'}, + 'status': {'type': 'string'}}, + 'required': ['result', + 'id', + 'num-secrets', + 'status'], + 'type': 'object'}, + 'SetModelDefaults': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/ModelDefaultValues'}, + 'type': 'array'}}, + 'required': ['config'], + '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'}, + 'SupportedFeature': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['name', 'description'], + 'type': 'object'}, + 'UnsetModelDefaults': {'additionalProperties': False, + 'properties': {'keys': {'items': {'$ref': '#/definitions/ModelUnsetKeys'}, + 'type': 'array'}}, + 'required': ['keys'], + 'type': 'object'}, + 'UserModel': {'additionalProperties': False, + 'properties': {'last-connection': {'format': 'date-time', + 'type': 'string'}, + 'model': {'$ref': '#/definitions/Model'}}, + 'required': ['model', 'last-connection'], + 'type': 'object'}, + 'UserModelList': {'additionalProperties': False, + 'properties': {'user-models': {'items': {'$ref': '#/definitions/UserModel'}, + 'type': 'array'}}, + 'required': ['user-models'], + 'type': 'object'}}, + 'properties': {'ChangeModelCredential': {'description': 'ChangeModelCredential ' + 'changes cloud ' + 'credential reference ' + 'for models.\n' + 'These new cloud ' + 'credentials must ' + 'already exist on the ' + 'controller.', + 'properties': {'Params': {'$ref': '#/definitions/ChangeModelCredentialsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CreateModel': {'description': 'CreateModel creates a new ' + 'model using the account and\n' + 'model config specified in the ' + 'args.', + 'properties': {'Params': {'$ref': '#/definitions/ModelCreateArgs'}, + 'Result': {'$ref': '#/definitions/ModelInfo'}}, + 'type': 'object'}, + 'DestroyModels': {'description': 'DestroyModels will try to ' + 'destroy the specified ' + 'models.\n' + 'If there is a block on ' + 'destruction, this method ' + 'will return an error.\n' + 'From ModelManager v7 ' + 'onwards, DestroyModels gains ' + "'force' and 'max-wait' " + 'parameters.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyModelsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DumpModels': {'description': 'DumpModels will export the ' + 'models into the database ' + 'agnostic\n' + 'representation. The user needs ' + 'to either be a controller ' + 'admin, or have\n' + 'admin privileges on the model ' + 'itself.', + 'properties': {'Params': {'$ref': '#/definitions/DumpModelRequest'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'DumpModelsDB': {'description': 'DumpModelsDB will gather all ' + 'documents from all model ' + 'collections\n' + 'for the specified model. The ' + 'map result contains a map of ' + 'collection\n' + 'names to lists of documents ' + 'represented as maps.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MapResults'}}, + 'type': 'object'}, + 'ListModelSummaries': {'description': 'ListModelSummaries ' + 'returns models that the ' + 'specified user\n' + 'has access to in the ' + 'current server. ' + 'Controller admins ' + '(superuser)\n' + 'can list models for any ' + 'user. Other users\n' + 'can only ask about ' + 'their own models.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSummariesRequest'}, + 'Result': {'$ref': '#/definitions/ModelSummaryResults'}}, + 'type': 'object'}, + 'ListModels': {'description': 'ListModels returns the models ' + 'that the specified user\n' + 'has access to in the current ' + 'server. Controller admins ' + '(superuser)\n' + 'can list models for any user. ' + 'Other users\n' + 'can only ask about their own ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/UserModelList'}}, + 'type': 'object'}, + 'ModelDefaultsForClouds': {'description': 'ModelDefaultsForClouds ' + 'returns the default ' + 'config values for ' + 'the specified\n' + 'clouds.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelDefaultsResults'}}, + 'type': 'object'}, + 'ModelInfo': {'description': 'ModelInfo returns information ' + 'about the specified models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelInfoResults'}}, + 'type': 'object'}, + 'ModelStatus': {'description': 'ModelStatus returns a summary ' + 'of the model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelStatusResults'}}, + 'type': 'object'}, + 'ModifyModelAccess': {'description': 'ModifyModelAccess ' + 'changes the model access ' + 'granted to users.', + 'properties': {'Params': {'$ref': '#/definitions/ModifyModelAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModelDefaults': {'description': 'SetModelDefaults writes ' + 'new values for the ' + 'specified default model ' + 'settings.', + 'properties': {'Params': {'$ref': '#/definitions/SetModelDefaults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UnsetModelDefaults': {'description': 'UnsetModelDefaults ' + 'removes the specified ' + 'default model settings.', + 'properties': {'Params': {'$ref': '#/definitions/UnsetModelDefaults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def ChangeModelCredential(self, model_credentials=None): + ''' + ChangeModelCredential changes cloud credential reference for models. + These new cloud credentials must already exist on the controller. + + model_credentials : typing.Sequence[~ChangeModelCredentialParams] + Returns -> ErrorResults + ''' + if model_credentials is not None and not isinstance(model_credentials, (bytes, str, list)): + raise Exception("Expected model_credentials to be a Sequence, received: {}".format(type(model_credentials))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ChangeModelCredential', + version=10, + params=_params) + _params['model-credentials'] = model_credentials + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelInfo) + async def CreateModel(self, cloud_tag=None, config=None, credential=None, name=None, owner_tag=None, region=None): + ''' + CreateModel creates a new model using the account and + model config specified in the args. + + cloud_tag : str + config : typing.Mapping[str, typing.Any] + credential : str + name : str + owner_tag : str + region : str + Returns -> ModelInfo + ''' + if cloud_tag is not None and not isinstance(cloud_tag, (bytes, str)): + raise Exception("Expected cloud_tag to be a str, received: {}".format(type(cloud_tag))) + + if config is not None and not isinstance(config, dict): + raise Exception("Expected config to be a Mapping, received: {}".format(type(config))) + + if credential is not None and not isinstance(credential, (bytes, str)): + raise Exception("Expected credential to be a str, received: {}".format(type(credential))) + + if name is not None and not isinstance(name, (bytes, str)): + raise Exception("Expected name to be a str, received: {}".format(type(name))) + + if owner_tag is not None and not isinstance(owner_tag, (bytes, str)): + raise Exception("Expected owner_tag to be a str, received: {}".format(type(owner_tag))) + + if region is not None and not isinstance(region, (bytes, str)): + raise Exception("Expected region to be a str, received: {}".format(type(region))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='CreateModel', + version=10, + params=_params) + _params['cloud-tag'] = cloud_tag + _params['config'] = config + _params['credential'] = credential + _params['name'] = name + _params['owner-tag'] = owner_tag + _params['region'] = region + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyModels(self, models=None): + ''' + DestroyModels will try to destroy the specified models. + If there is a block on destruction, this method will return an error. + From ModelManager v7 onwards, DestroyModels gains 'force' and 'max-wait' parameters. + + models : typing.Sequence[~DestroyModelParams] + Returns -> ErrorResults + ''' + if models is not None and not isinstance(models, (bytes, str, list)): + raise Exception("Expected models to be a Sequence, received: {}".format(type(models))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='DestroyModels', + version=10, + params=_params) + _params['models'] = models + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def DumpModels(self, entities=None, simplified=None): + ''' + DumpModels will export the models into the database agnostic + representation. The user needs to either be a controller admin, or have + admin privileges on the model itself. + + entities : typing.Sequence[~Entity] + simplified : bool + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + if simplified is not None and not isinstance(simplified, bool): + raise Exception("Expected simplified to be a bool, received: {}".format(type(simplified))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='DumpModels', + version=10, + params=_params) + _params['entities'] = entities + _params['simplified'] = simplified + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MapResults) + async def DumpModelsDB(self, entities=None): + ''' + DumpModelsDB will gather all documents from all model collections + for the specified model. The map result contains a map of collection + names to lists of documents represented as maps. + + entities : typing.Sequence[~Entity] + Returns -> MapResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='DumpModelsDB', + version=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelSummaryResults) + async def ListModelSummaries(self, all_=None, user_tag=None): + ''' + ListModelSummaries returns models that the specified user + has access to in the current server. Controller admins (superuser) + can list models for any user. Other users + can only ask about their own models. + + all_ : bool + user_tag : str + Returns -> ModelSummaryResults + ''' + if all_ is not None and not isinstance(all_, bool): + raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + + if user_tag is not None and not isinstance(user_tag, (bytes, str)): + raise Exception("Expected user_tag to be a str, received: {}".format(type(user_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ListModelSummaries', + version=10, + params=_params) + _params['all'] = all_ + _params['user-tag'] = user_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UserModelList) + async def ListModels(self, tag=None): + ''' + ListModels returns the models that the specified user + has access to in the current server. Controller admins (superuser) + can list models for any user. Other users + can only ask about their own models. + + tag : str + Returns -> UserModelList + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ListModels', + version=10, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelDefaultsResults) + async def ModelDefaultsForClouds(self, entities=None): + ''' + ModelDefaultsForClouds returns the default config values for the specified + clouds. + + entities : typing.Sequence[~Entity] + Returns -> ModelDefaultsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModelDefaultsForClouds', + version=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelInfoResults) + async def ModelInfo(self, entities=None): + ''' + ModelInfo returns information about the specified models. + + entities : typing.Sequence[~Entity] + Returns -> ModelInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModelInfo', + version=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelStatusResults) + async def ModelStatus(self, entities=None): + ''' + ModelStatus returns a summary of the model. + + entities : typing.Sequence[~Entity] + Returns -> ModelStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModelStatus', + version=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyModelAccess(self, changes=None): + ''' + ModifyModelAccess changes the model access granted to users. + + changes : typing.Sequence[~ModifyModelAccess] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModifyModelAccess', + version=10, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModelDefaults(self, config=None): + ''' + SetModelDefaults writes new values for the specified default model settings. + + config : typing.Sequence[~ModelDefaultValues] + Returns -> ErrorResults + ''' + if config is not None and not isinstance(config, (bytes, str, list)): + raise Exception("Expected config to be a Sequence, received: {}".format(type(config))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='SetModelDefaults', + version=10, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UnsetModelDefaults(self, keys=None): + ''' + UnsetModelDefaults removes the specified default model settings. + + keys : typing.Sequence[~ModelUnsetKeys] + Returns -> ErrorResults + ''' + if keys is not None and not isinstance(keys, (bytes, str, list)): + raise Exception("Expected keys to be a Sequence, received: {}".format(type(keys))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='UnsetModelDefaults', + version=10, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/_client19.py b/juju/client/_client19.py index 476ed112..3171ef69 100644 --- a/juju/client/_client19.py +++ b/juju/client/_client19.py @@ -1821,6 +1821,12 @@ class UniterFacade(Type): 'type': 'array'}}, 'required': ['servers'], 'type': 'object'}, + 'AccessInfo': {'additionalProperties': False, + 'properties': {'role': {'type': 'string'}, + 'scope-tag': {'type': 'string'}, + 'target-tag': {'type': 'string'}}, + 'required': ['target-tag', 'scope-tag', 'role'], + 'type': 'object'}, 'Action': {'additionalProperties': False, 'properties': {'execution-group': {'type': 'string'}, 'name': {'type': 'string'}, @@ -1978,6 +1984,8 @@ class UniterFacade(Type): 'type': 'array'}, 'secret-revokes': {'items': {'$ref': '#/definitions/GrantRevokeSecretArg'}, 'type': 'array'}, + 'secret-track-latest': {'items': {'type': 'string'}, + 'type': 'array'}, 'secret-updates': {'items': {'$ref': '#/definitions/UpdateSecretArg'}, 'type': 'array'}, 'set-raw-k8s-spec': {'$ref': '#/definitions/PodSpec'}, @@ -2235,7 +2243,9 @@ class UniterFacade(Type): 'required': ['results'], 'type': 'object'}, 'ListSecretResult': {'additionalProperties': False, - 'properties': {'create-time': {'format': 'date-time', + 'properties': {'access': {'items': {'$ref': '#/definitions/AccessInfo'}, + 'type': 'array'}, + 'create-time': {'format': 'date-time', 'type': 'string'}, 'description': {'type': 'string'}, 'label': {'type': 'string'}, diff --git a/juju/client/_client2.py b/juju/client/_client2.py index a62430c0..5728356b 100644 --- a/juju/client/_client2.py +++ b/juju/client/_client2.py @@ -641,9 +641,11 @@ class CAASUnitProvisionerFacade(Type): 'name': {'type': 'string'}}, 'type': 'object'}, 'CharmContainer': {'additionalProperties': False, - 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'properties': {'gid': {'type': 'integer'}, + 'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, 'type': 'array'}, - 'resource': {'type': 'string'}}, + 'resource': {'type': 'string'}, + 'uid': {'type': 'integer'}}, 'type': 'object'}, 'CharmDeployment': {'additionalProperties': False, 'properties': {'min-version': {'type': 'string'}, @@ -686,6 +688,7 @@ class CAASUnitProvisionerFacade(Type): 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, 'categories': {'items': {'type': 'string'}, 'type': 'array'}, + 'charm-user': {'type': 'string'}, 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, 'type': 'object'}, 'deployment': {'$ref': '#/definitions/CharmDeployment'}, @@ -5108,7 +5111,13 @@ async def WatchRemoteRelations(self): class SecretsFacade(Type): name = 'Secrets' version = 2 - schema = {'definitions': {'CreateSecretArg': {'additionalProperties': False, + schema = {'definitions': {'AccessInfo': {'additionalProperties': False, + 'properties': {'role': {'type': 'string'}, + 'scope-tag': {'type': 'string'}, + 'target-tag': {'type': 'string'}}, + 'required': ['target-tag', 'scope-tag', 'role'], + 'type': 'object'}, + 'CreateSecretArg': {'additionalProperties': False, 'properties': {'UpsertSecretArg': {'$ref': '#/definitions/UpsertSecretArg'}, 'content': {'$ref': '#/definitions/SecretContentParams'}, 'description': {'type': 'string'}, @@ -5167,7 +5176,9 @@ class SecretsFacade(Type): 'applications'], 'type': 'object'}, 'ListSecretResult': {'additionalProperties': False, - 'properties': {'create-time': {'format': 'date-time', + 'properties': {'access': {'items': {'$ref': '#/definitions/AccessInfo'}, + 'type': 'array'}, + 'create-time': {'format': 'date-time', 'type': 'string'}, 'description': {'type': 'string'}, 'label': {'type': 'string'}, @@ -5479,7 +5490,13 @@ async def UpdateSecrets(self, args=None): class SecretsManagerFacade(Type): name = 'SecretsManager' version = 2 - schema = {'definitions': {'CreateSecretArg': {'additionalProperties': False, + schema = {'definitions': {'AccessInfo': {'additionalProperties': False, + 'properties': {'role': {'type': 'string'}, + 'scope-tag': {'type': 'string'}, + 'target-tag': {'type': 'string'}}, + 'required': ['target-tag', 'scope-tag', 'role'], + 'type': 'object'}, + 'CreateSecretArg': {'additionalProperties': False, 'properties': {'UpsertSecretArg': {'$ref': '#/definitions/UpsertSecretArg'}, 'content': {'$ref': '#/definitions/SecretContentParams'}, 'description': {'type': 'string'}, @@ -5577,7 +5594,9 @@ class SecretsManagerFacade(Type): 'required': ['args'], 'type': 'object'}, 'ListSecretResult': {'additionalProperties': False, - 'properties': {'create-time': {'format': 'date-time', + 'properties': {'access': {'items': {'$ref': '#/definitions/AccessInfo'}, + 'type': 'array'}, + 'create-time': {'format': 'date-time', 'type': 'string'}, 'description': {'type': 'string'}, 'label': {'type': 'string'}, diff --git a/juju/client/_client20.py b/juju/client/_client20.py new file mode 100644 index 00000000..3118b373 --- /dev/null +++ b/juju/client/_client20.py @@ -0,0 +1,1773 @@ +# 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.facade import Type, ReturnMapping +from juju.client._definitions import * + + +class ApplicationFacade(Type): + name = 'Application' + version = 20 + schema = {'definitions': {'AddApplicationUnits': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'attach-storage': {'items': {'type': 'string'}, + 'type': 'array'}, + 'num-units': {'type': 'integer'}, + 'placement': {'items': {'$ref': '#/definitions/Placement'}, + 'type': 'array'}, + 'policy': {'type': 'string'}}, + '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'}, + 'via-cidrs': {'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'}, + 'ApplicationConfigUnsetArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/ApplicationUnset'}, + 'type': 'array'}}, + 'required': ['Args'], + 'type': 'object'}, + 'ApplicationConstraint': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'ApplicationDeploy': {'additionalProperties': False, + 'properties': {'Force': {'type': 'boolean'}, + 'application': {'type': 'string'}, + 'attach-storage': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + 'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'charm-url': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-yaml': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'devices': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'num-units': {'type': 'integer'}, + 'placement': {'items': {'$ref': '#/definitions/Placement'}, + 'type': 'array'}, + 'policy': {'type': 'string'}, + 'resources': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'charm-url', + 'channel', + 'num-units', + 'config-yaml', + 'constraints', + 'Force'], + 'type': 'object'}, + 'ApplicationExpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'exposed-endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/ExposedEndpoint'}}, + 'type': 'object'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'branch': {'type': 'string'}}, + 'required': ['application', 'branch'], + 'type': 'object'}, + 'ApplicationGetArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ApplicationGet'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'ApplicationGetConfigResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/ConfigResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'ApplicationGetConstraintsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationConstraint'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ApplicationGetResults': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'application-config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'base': {'$ref': '#/definitions/Base'}, + 'channel': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', + 'charm', + 'config', + 'constraints', + 'base', + 'channel'], + 'type': 'object'}, + 'ApplicationInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ApplicationResult'}}, + 'type': 'object'}, + 'ApplicationInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ApplicationMergeBindings': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'force': {'type': 'boolean'}}, + 'required': ['application-tag', + 'bindings', + 'force'], + 'type': 'object'}, + 'ApplicationMergeBindingsArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ApplicationMergeBindings'}, + 'type': 'array'}}, + 'required': ['args'], + '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'}, + 'ApplicationOfferDetailsV5': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description'], + 'type': 'object'}, + 'ApplicationResult': {'additionalProperties': False, + 'properties': {'base': {'$ref': '#/definitions/Base'}, + 'channel': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'exposed': {'type': 'boolean'}, + 'exposed-endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/ExposedEndpoint'}}, + 'type': 'object'}, + 'life': {'type': 'string'}, + 'principal': {'type': 'boolean'}, + 'remote': {'type': 'boolean'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'principal', + 'exposed', + 'remote', + 'life'], + 'type': 'object'}, + 'ApplicationSetCharm': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'charm-url': {'type': 'string'}, + 'config-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-settings-yaml': {'type': 'string'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'force': {'type': 'boolean'}, + 'force-base': {'type': 'boolean'}, + 'force-units': {'type': 'boolean'}, + 'generation': {'type': 'string'}, + 'resource-ids': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-constraints': {'patternProperties': {'.*': {'$ref': '#/definitions/StorageConstraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'generation', + 'charm-url', + 'channel', + 'force', + 'force-units', + 'force-base'], + 'type': 'object'}, + 'ApplicationUnexpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'exposed-endpoints': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', + 'exposed-endpoints'], + 'type': 'object'}, + 'ApplicationUnset': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'options': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', + 'branch', + 'options'], + 'type': 'object'}, + 'ApplicationsDeploy': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/ApplicationDeploy'}, + 'type': 'array'}}, + 'required': ['applications'], + 'type': 'object'}, + 'Base': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'required': ['name', 'channel'], + 'type': 'object'}, + 'CharmOrigin': {'additionalProperties': False, + 'properties': {'architecture': {'type': 'string'}, + 'base': {'$ref': '#/definitions/Base'}, + 'branch': {'type': 'string'}, + 'hash': {'type': 'string'}, + 'id': {'type': 'string'}, + 'instance-key': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'risk': {'type': 'string'}, + 'source': {'type': 'string'}, + 'track': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['source', 'type', 'id'], + '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'}, + 'CharmURLOriginResult': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'error': {'$ref': '#/definitions/Error'}, + 'url': {'type': 'string'}}, + 'required': ['url', 'charm-origin'], + 'type': 'object'}, + 'ConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['config'], + 'type': 'object'}, + 'ConfigSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-yaml': {'type': 'string'}, + 'generation': {'type': 'string'}}, + 'required': ['application', + 'generation', + 'config', + 'config-yaml'], + 'type': 'object'}, + 'ConfigSetArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/ConfigSet'}, + 'type': 'array'}}, + 'required': ['Args'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'ConsumeApplicationArgV5': {'additionalProperties': False, + 'properties': {'ApplicationOfferDetailsV5': {'$ref': '#/definitions/ApplicationOfferDetailsV5'}, + 'application-alias': {'type': 'string'}, + 'application-description': {'type': 'string'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'external-controller': {'$ref': '#/definitions/ExternalControllerInfo'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description', + 'ApplicationOfferDetailsV5'], + 'type': 'object'}, + 'ConsumeApplicationArgsV5': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ConsumeApplicationArgV5'}, + 'type': 'array'}}, + 'type': 'object'}, + 'DeployFromRepositoryArg': {'additionalProperties': False, + 'properties': {'ApplicationName': {'type': 'string'}, + 'AttachStorage': {'items': {'type': 'string'}, + 'type': 'array'}, + 'CharmName': {'type': 'string'}, + 'ConfigYAML': {'type': 'string'}, + 'Cons': {'$ref': '#/definitions/Value'}, + 'Devices': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}, + 'DryRun': {'type': 'boolean'}, + 'Placement': {'items': {'$ref': '#/definitions/Placement'}, + 'type': 'array'}, + 'Storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}, + 'Trust': {'type': 'boolean'}, + 'base': {'$ref': '#/definitions/Base'}, + 'channel': {'type': 'string'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'force': {'type': 'boolean'}, + 'num-units': {'type': 'integer'}, + 'resources': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'revision': {'type': 'integer'}}, + 'required': ['CharmName', + 'ApplicationName', + 'AttachStorage', + 'ConfigYAML', + 'Cons', + 'Devices', + 'DryRun', + 'Placement', + 'Storage', + 'Trust'], + 'type': 'object'}, + 'DeployFromRepositoryArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/DeployFromRepositoryArg'}, + 'type': 'array'}}, + 'required': ['Args'], + 'type': 'object'}, + 'DeployFromRepositoryInfo': {'additionalProperties': False, + 'properties': {'architecture': {'type': 'string'}, + 'base': {'$ref': '#/definitions/Base'}, + 'channel': {'type': 'string'}, + 'effective-channel': {'type': 'string'}, + 'name': {'type': 'string'}, + 'revision': {'type': 'integer'}}, + 'required': ['architecture', + 'channel', + 'name', + 'revision'], + 'type': 'object'}, + 'DeployFromRepositoryResult': {'additionalProperties': False, + 'properties': {'Errors': {'items': {'$ref': '#/definitions/Error'}, + 'type': 'array'}, + 'Info': {'$ref': '#/definitions/DeployFromRepositoryInfo'}, + 'PendingResourceUploads': {'items': {'$ref': '#/definitions/PendingResourceUpload'}, + 'type': 'array'}}, + 'required': ['Errors', + 'Info', + 'PendingResourceUploads'], + 'type': 'object'}, + 'DeployFromRepositoryResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/DeployFromRepositoryResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'DestroyApplicationInfo': {'additionalProperties': False, + 'properties': {'destroyed-storage': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'destroyed-units': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'detached-storage': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'type': 'object'}, + 'DestroyApplicationParams': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'destroy-storage': {'type': 'boolean'}, + 'dry-run': {'type': 'boolean'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}}, + 'required': ['application-tag', + 'force'], + 'type': 'object'}, + 'DestroyApplicationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'$ref': '#/definitions/DestroyApplicationInfo'}}, + 'type': 'object'}, + 'DestroyApplicationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/DestroyApplicationResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'DestroyApplicationsParams': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/DestroyApplicationParams'}, + 'type': 'array'}}, + 'required': ['applications'], + 'type': 'object'}, + 'DestroyConsumedApplicationParams': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}}, + 'required': ['application-tag'], + 'type': 'object'}, + 'DestroyConsumedApplicationsParams': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/DestroyConsumedApplicationParams'}, + 'type': 'array'}}, + 'required': ['applications'], + 'type': 'object'}, + 'DestroyRelation': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'type': 'string'}, + 'type': 'array'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}, + 'relation-id': {'type': 'integer'}}, + 'required': ['relation-id'], + 'type': 'object'}, + 'DestroyUnitInfo': {'additionalProperties': False, + 'properties': {'destroyed-storage': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'detached-storage': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'type': 'object'}, + 'DestroyUnitParams': {'additionalProperties': False, + 'properties': {'destroy-storage': {'type': 'boolean'}, + 'dry-run': {'type': 'boolean'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag'], + 'type': 'object'}, + 'DestroyUnitResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'$ref': '#/definitions/DestroyUnitInfo'}}, + 'type': 'object'}, + 'DestroyUnitResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/DestroyUnitResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'DestroyUnitsParams': {'additionalProperties': False, + 'properties': {'units': {'items': {'$ref': '#/definitions/DestroyUnitParams'}, + 'type': 'array'}}, + 'required': ['units'], + 'type': 'object'}, + 'EndpointRelationData': {'additionalProperties': False, + 'properties': {'ApplicationData': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'cross-model': {'type': 'boolean'}, + 'endpoint': {'type': 'string'}, + 'related-endpoint': {'type': 'string'}, + 'relation-id': {'type': 'integer'}, + 'unit-relation-data': {'patternProperties': {'.*': {'$ref': '#/definitions/RelationData'}}, + 'type': 'object'}}, + 'required': ['relation-id', + 'endpoint', + 'cross-model', + 'related-endpoint', + 'ApplicationData', + 'unit-relation-data'], + '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': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + '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'}, + 'ExposedEndpoint': {'additionalProperties': False, + 'properties': {'expose-to-cidrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'expose-to-spaces': {'items': {'type': 'string'}, + 'type': 'array'}}, + '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'}, + 'OfferUserDetails': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'display-name': {'type': 'string'}, + 'user': {'type': 'string'}}, + 'required': ['user', + 'display-name', + 'access'], + 'type': 'object'}, + 'PendingResourceUpload': {'additionalProperties': False, + 'properties': {'Filename': {'type': 'string'}, + 'Name': {'type': 'string'}, + 'Type': {'type': 'string'}}, + 'required': ['Name', + 'Filename', + 'Type'], + 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'RelationData': {'additionalProperties': False, + 'properties': {'InScope': {'type': 'boolean'}, + 'UnitData': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['InScope', 'UnitData'], + 'type': 'object'}, + 'RelationSuspendedArg': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'relation-id': {'type': 'integer'}, + 'suspended': {'type': 'boolean'}}, + 'required': ['relation-id', + 'message', + 'suspended'], + 'type': 'object'}, + 'RelationSuspendedArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RelationSuspendedArg'}, + 'type': 'array'}}, + 'required': ['args'], + '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'}, + 'ScaleApplicationInfo': {'additionalProperties': False, + 'properties': {'num-units': {'type': 'integer'}}, + 'required': ['num-units'], + 'type': 'object'}, + 'ScaleApplicationParams': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'scale': {'type': 'integer'}, + 'scale-change': {'type': 'integer'}}, + 'required': ['application-tag', + 'scale', + 'force'], + 'type': 'object'}, + 'ScaleApplicationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'$ref': '#/definitions/ScaleApplicationInfo'}}, + 'type': 'object'}, + 'ScaleApplicationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ScaleApplicationResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ScaleApplicationsParams': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/ScaleApplicationParams'}, + 'type': 'array'}}, + 'required': ['applications'], + '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'}, + 'UnitInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/UnitResult'}}, + 'type': 'object'}, + 'UnitInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UnitInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UnitResult': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'leader': {'type': 'boolean'}, + 'life': {'type': 'string'}, + 'machine': {'type': 'string'}, + 'opened-ports': {'items': {'type': 'string'}, + 'type': 'array'}, + 'provider-id': {'type': 'string'}, + 'public-address': {'type': 'string'}, + 'relation-data': {'items': {'$ref': '#/definitions/EndpointRelationData'}, + 'type': 'array'}, + 'tag': {'type': 'string'}, + 'workload-version': {'type': 'string'}}, + 'required': ['tag', + 'workload-version', + 'opened-ports', + 'charm'], + 'type': 'object'}, + 'UnitsResolved': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}, + 'retry': {'type': 'boolean'}, + 'tags': {'$ref': '#/definitions/Entities'}}, + 'type': 'object'}, + 'UpdateChannelArg': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'channel'], + 'type': 'object'}, + 'UpdateChannelArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateChannelArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'image-id': {'type': 'string'}, + 'instance-role': {'type': 'string'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'root-disk-source': {'type': 'string'}, + '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': {'AddRelation': {'description': 'AddRelation adds a relation ' + 'between the specified ' + 'endpoints and returns the ' + 'relation info.', + 'properties': {'Params': {'$ref': '#/definitions/AddRelation'}, + 'Result': {'$ref': '#/definitions/AddRelationResults'}}, + 'type': 'object'}, + 'AddUnits': {'description': 'AddUnits adds a given number of ' + 'units to an application.', + 'properties': {'Params': {'$ref': '#/definitions/AddApplicationUnits'}, + 'Result': {'$ref': '#/definitions/AddApplicationUnitsResults'}}, + 'type': 'object'}, + 'ApplicationsInfo': {'description': 'ApplicationsInfo returns ' + 'applications information.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationInfoResults'}}, + 'type': 'object'}, + 'CharmConfig': {'description': 'CharmConfig returns charm ' + 'config for the input list of ' + 'applications and\n' + 'model generations.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationGetArgs'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'CharmRelations': {'description': 'CharmRelations implements ' + 'the server side of ' + 'Application.CharmRelations.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationCharmRelations'}, + 'Result': {'$ref': '#/definitions/ApplicationCharmRelationsResults'}}, + 'type': 'object'}, + 'Consume': {'description': 'Consume adds remote applications ' + 'to the model without creating any\n' + 'relations.', + 'properties': {'Params': {'$ref': '#/definitions/ConsumeApplicationArgsV5'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Deploy': {'description': 'Deploy fetches the charms from the ' + 'charm store and deploys them\n' + 'using the specified placement ' + 'directives.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationsDeploy'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DeployFromRepository': {'description': 'DeployFromRepository ' + 'is a one-stop ' + 'deployment method for ' + 'repository\n' + 'charms. Only a charm ' + 'name is required to ' + 'deploy. If argument ' + 'validation\n' + 'fails, a list of all ' + 'errors found in ' + 'validation will be ' + 'returned. If a\n' + 'local resource is ' + 'provided, details ' + 'required for ' + 'uploading the ' + 'validated\n' + 'resource will be ' + 'returned.', + 'properties': {'Params': {'$ref': '#/definitions/DeployFromRepositoryArgs'}, + 'Result': {'$ref': '#/definitions/DeployFromRepositoryResults'}}, + 'type': 'object'}, + 'DestroyApplication': {'description': 'DestroyApplication ' + 'removes a given set of ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationsParams'}, + 'Result': {'$ref': '#/definitions/DestroyApplicationResults'}}, + 'type': 'object'}, + 'DestroyConsumedApplications': {'description': 'DestroyConsumedApplications ' + 'removes a ' + 'given set of ' + 'consumed ' + '(remote) ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyConsumedApplicationsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyRelation': {'description': 'DestroyRelation removes ' + 'the relation between the\n' + 'specified endpoints or an ' + 'id.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyRelation'}}, + 'type': 'object'}, + 'DestroyUnit': {'description': 'DestroyUnit removes a given ' + 'set of application units.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyUnitsParams'}, + 'Result': {'$ref': '#/definitions/DestroyUnitResults'}}, + 'type': 'object'}, + 'Expose': {'description': 'Expose changes the juju-managed ' + 'firewall to expose any ports that\n' + 'were also explicitly marked by ' + 'units as open.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationExpose'}}, + 'type': 'object'}, + 'Get': {'description': 'Get returns the charm configuration ' + 'for an application.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/ApplicationGetResults'}}, + 'type': 'object'}, + 'GetCharmURLOrigin': {'description': 'GetCharmURLOrigin ' + 'returns the charm URL ' + 'and charm origin the ' + 'given\n' + 'application is running ' + 'at present.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/CharmURLOriginResult'}}, + 'type': 'object'}, + 'GetConfig': {'description': 'GetConfig returns the charm ' + 'config for each of the input ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'GetConstraints': {'description': 'GetConstraints returns the ' + 'constraints for a given ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConstraintsResults'}}, + 'type': 'object'}, + 'Leader': {'description': 'Leader returns the unit name of the ' + 'leader for the given application.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'MergeBindings': {'description': 'MergeBindings merges ' + 'operator-defined bindings ' + 'with the current bindings ' + 'for\n' + 'one or more applications.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationMergeBindingsArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ResolveUnitErrors': {'description': 'ResolveUnitErrors marks ' + 'errors on the specified ' + 'units as resolved.', + 'properties': {'Params': {'$ref': '#/definitions/UnitsResolved'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ScaleApplications': {'description': 'ScaleApplications scales ' + 'the specified ' + 'application to the ' + 'requested number of ' + 'units.', + 'properties': {'Params': {'$ref': '#/definitions/ScaleApplicationsParams'}, + 'Result': {'$ref': '#/definitions/ScaleApplicationResults'}}, + 'type': 'object'}, + 'SetCharm': {'description': 'SetCharm sets the charm for a ' + 'given for the application.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, + 'type': 'object'}, + 'SetConfigs': {'description': 'SetConfigs implements the ' + 'server side of ' + 'Application.SetConfig. Both\n' + 'application and charm config ' + 'are set. It does not unset ' + 'values in\n' + 'Config map that are set to an ' + 'empty string. Unset should be ' + 'used for that.', + 'properties': {'Params': {'$ref': '#/definitions/ConfigSetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetConstraints': {'description': 'SetConstraints sets the ' + 'constraints for a given ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetMetricCredentials': {'description': 'SetMetricCredentials ' + 'sets credentials on ' + 'the application.\n' + 'TODO (cderici) only ' + 'used for metered ' + 'charms in cmd ' + 'MeteredDeployAPI,\n' + 'kept for client ' + 'compatibility, remove ' + 'in juju 4.0', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationMetricCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRelationsSuspended': {'description': 'SetRelationsSuspended ' + 'sets the suspended ' + 'status of the ' + 'specified relations.', + 'properties': {'Params': {'$ref': '#/definitions/RelationSuspendedArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Unexpose': {'description': 'Unexpose changes the juju-managed ' + 'firewall to unexpose any ports ' + 'that\n' + 'were also explicitly marked by ' + 'units as open.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationUnexpose'}}, + 'type': 'object'}, + 'UnitsInfo': {'description': 'UnitsInfo returns unit ' + 'information for the given ' + 'entities (units or\n' + 'applications).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitInfoResults'}}, + 'type': 'object'}, + 'UnsetApplicationsConfig': {'description': 'UnsetApplicationsConfig ' + 'implements the ' + 'server side of ' + 'Application.UnsetApplicationsConfig.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigUnsetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateApplicationBase': {'description': 'UpdateApplicationBase ' + 'updates the ' + 'application base.\n' + 'Base for ' + 'subordinates is ' + 'updated too.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateChannelArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddRelationResults) + async def AddRelation(self, endpoints=None, via_cidrs=None): + ''' + AddRelation adds a relation between the specified endpoints and returns the relation info. + + endpoints : typing.Sequence[str] + via_cidrs : typing.Sequence[str] + Returns -> AddRelationResults + ''' + if endpoints is not None and not isinstance(endpoints, (bytes, str, list)): + raise Exception("Expected endpoints to be a Sequence, received: {}".format(type(endpoints))) + + if via_cidrs is not None and not isinstance(via_cidrs, (bytes, str, list)): + raise Exception("Expected via_cidrs to be a Sequence, received: {}".format(type(via_cidrs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddRelation', + version=20, + params=_params) + _params['endpoints'] = endpoints + _params['via-cidrs'] = via_cidrs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddApplicationUnitsResults) + async def AddUnits(self, application=None, attach_storage=None, num_units=None, placement=None, policy=None): + ''' + AddUnits adds a given number of units to an application. + + application : str + attach_storage : typing.Sequence[str] + num_units : int + placement : typing.Sequence[~Placement] + policy : str + Returns -> AddApplicationUnitsResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if attach_storage is not None and not isinstance(attach_storage, (bytes, str, list)): + raise Exception("Expected attach_storage to be a Sequence, received: {}".format(type(attach_storage))) + + if num_units is not None and not isinstance(num_units, int): + raise Exception("Expected num_units to be a int, received: {}".format(type(num_units))) + + if placement is not None and not isinstance(placement, (bytes, str, list)): + raise Exception("Expected placement to be a Sequence, received: {}".format(type(placement))) + + if policy is not None and not isinstance(policy, (bytes, str)): + raise Exception("Expected policy to be a str, received: {}".format(type(policy))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddUnits', + version=20, + params=_params) + _params['application'] = application + _params['attach-storage'] = attach_storage + _params['num-units'] = num_units + _params['placement'] = placement + _params['policy'] = policy + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationInfoResults) + async def ApplicationsInfo(self, entities=None): + ''' + ApplicationsInfo returns applications information. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ApplicationsInfo', + version=20, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def CharmConfig(self, args=None): + ''' + CharmConfig returns charm config for the input list of applications and + model generations. + + args : typing.Sequence[~ApplicationGet] + Returns -> ApplicationGetConfigResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='CharmConfig', + version=20, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationCharmRelationsResults) + async def CharmRelations(self, application=None): + ''' + CharmRelations implements the server side of Application.CharmRelations. + + application : str + Returns -> ApplicationCharmRelationsResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='CharmRelations', + version=20, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Consume(self, args=None): + ''' + Consume adds remote applications to the model without creating any + relations. + + args : typing.Sequence[~ConsumeApplicationArgV5] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Consume', + version=20, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Deploy(self, applications=None): + ''' + Deploy fetches the charms from the charm store and deploys them + using the specified placement directives. + + applications : typing.Sequence[~ApplicationDeploy] + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Deploy', + version=20, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DeployFromRepositoryResults) + async def DeployFromRepository(self, args=None): + ''' + DeployFromRepository is a one-stop deployment method for repository + charms. Only a charm name is required to deploy. If argument validation + fails, a list of all errors found in validation will be returned. If a + local resource is provided, details required for uploading the validated + resource will be returned. + + args : typing.Sequence[~DeployFromRepositoryArg] + Returns -> DeployFromRepositoryResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DeployFromRepository', + version=20, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyApplicationResults) + async def DestroyApplication(self, applications=None): + ''' + DestroyApplication removes a given set of applications. + + applications : typing.Sequence[~DestroyApplicationParams] + Returns -> DestroyApplicationResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyApplication', + version=20, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyConsumedApplications(self, applications=None): + ''' + DestroyConsumedApplications removes a given set of consumed (remote) applications. + + applications : typing.Sequence[~DestroyConsumedApplicationParams] + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyConsumedApplications', + version=20, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyRelation(self, endpoints=None, force=None, max_wait=None, relation_id=None): + ''' + DestroyRelation removes the relation between the + specified endpoints or an id. + + endpoints : typing.Sequence[str] + force : bool + max_wait : int + relation_id : int + Returns -> None + ''' + if endpoints is not None and not isinstance(endpoints, (bytes, str, list)): + raise Exception("Expected endpoints to be a Sequence, received: {}".format(type(endpoints))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if max_wait is not None and not isinstance(max_wait, int): + raise Exception("Expected max_wait to be a int, received: {}".format(type(max_wait))) + + if relation_id is not None and not isinstance(relation_id, int): + raise Exception("Expected relation_id to be a int, received: {}".format(type(relation_id))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyRelation', + version=20, + params=_params) + _params['endpoints'] = endpoints + _params['force'] = force + _params['max-wait'] = max_wait + _params['relation-id'] = relation_id + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyUnitResults) + async def DestroyUnit(self, units=None): + ''' + DestroyUnit removes a given set of application units. + + units : typing.Sequence[~DestroyUnitParams] + Returns -> DestroyUnitResults + ''' + if units is not None and not isinstance(units, (bytes, str, list)): + raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnit', + version=20, + params=_params) + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Expose(self, application=None, exposed_endpoints=None): + ''' + Expose changes the juju-managed firewall to expose any ports that + were also explicitly marked by units as open. + + application : str + exposed_endpoints : typing.Mapping[str, ~ExposedEndpoint] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if exposed_endpoints is not None and not isinstance(exposed_endpoints, dict): + raise Exception("Expected exposed_endpoints to be a Mapping, received: {}".format(type(exposed_endpoints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=20, + params=_params) + _params['application'] = application + _params['exposed-endpoints'] = exposed_endpoints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetResults) + async def Get(self, application=None, branch=None): + ''' + Get returns the charm configuration for an application. + + application : str + branch : str + Returns -> ApplicationGetResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Get', + version=20, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CharmURLOriginResult) + async def GetCharmURLOrigin(self, application=None, branch=None): + ''' + GetCharmURLOrigin returns the charm URL and charm origin the given + application is running at present. + + application : str + branch : str + Returns -> CharmURLOriginResult + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetCharmURLOrigin', + version=20, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def GetConfig(self, entities=None): + ''' + GetConfig returns the charm config for each of the input applications. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetConfig', + version=20, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConstraintsResults) + async def GetConstraints(self, entities=None): + ''' + GetConstraints returns the constraints for a given application. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConstraintsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetConstraints', + version=20, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def Leader(self, tag=None): + ''' + Leader returns the unit name of the leader for the given application. + + tag : str + Returns -> StringResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Leader', + version=20, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def MergeBindings(self, args=None): + ''' + MergeBindings merges operator-defined bindings with the current bindings for + one or more applications. + + args : typing.Sequence[~ApplicationMergeBindings] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='MergeBindings', + version=20, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): + ''' + ResolveUnitErrors marks errors on the specified units as resolved. + + all_ : bool + retry : bool + tags : Entities + Returns -> ErrorResults + ''' + if all_ is not None and not isinstance(all_, bool): + raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + + if retry is not None and not isinstance(retry, bool): + raise Exception("Expected retry to be a bool, received: {}".format(type(retry))) + + if tags is not None and not isinstance(tags, (dict, Entities)): + raise Exception("Expected tags to be a Entities, received: {}".format(type(tags))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ResolveUnitErrors', + version=20, + params=_params) + _params['all'] = all_ + _params['retry'] = retry + _params['tags'] = tags + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ScaleApplicationResults) + async def ScaleApplications(self, applications=None): + ''' + ScaleApplications scales the specified application to the requested number of units. + + applications : typing.Sequence[~ScaleApplicationParams] + Returns -> ScaleApplicationResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ScaleApplications', + version=20, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetCharm(self, application=None, channel=None, charm_origin=None, charm_url=None, config_settings=None, config_settings_yaml=None, endpoint_bindings=None, force=None, force_base=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None): + ''' + SetCharm sets the charm for a given for the application. + + application : str + channel : str + charm_origin : CharmOrigin + charm_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + endpoint_bindings : typing.Mapping[str, str] + force : bool + force_base : bool + force_units : bool + generation : str + resource_ids : typing.Mapping[str, str] + storage_constraints : typing.Mapping[str, ~StorageConstraints] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if channel is not None and not isinstance(channel, (bytes, str)): + raise Exception("Expected channel to be a str, received: {}".format(type(channel))) + + if charm_origin is not None and not isinstance(charm_origin, (dict, CharmOrigin)): + raise Exception("Expected charm_origin to be a CharmOrigin, received: {}".format(type(charm_origin))) + + if charm_url is not None and not isinstance(charm_url, (bytes, str)): + raise Exception("Expected charm_url to be a str, received: {}".format(type(charm_url))) + + if config_settings is not None and not isinstance(config_settings, dict): + raise Exception("Expected config_settings to be a Mapping, received: {}".format(type(config_settings))) + + if config_settings_yaml is not None and not isinstance(config_settings_yaml, (bytes, str)): + raise Exception("Expected config_settings_yaml to be a str, received: {}".format(type(config_settings_yaml))) + + if endpoint_bindings is not None and not isinstance(endpoint_bindings, dict): + raise Exception("Expected endpoint_bindings to be a Mapping, received: {}".format(type(endpoint_bindings))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if force_base is not None and not isinstance(force_base, bool): + raise Exception("Expected force_base to be a bool, received: {}".format(type(force_base))) + + if force_units is not None and not isinstance(force_units, bool): + raise Exception("Expected force_units to be a bool, received: {}".format(type(force_units))) + + if generation is not None and not isinstance(generation, (bytes, str)): + raise Exception("Expected generation to be a str, received: {}".format(type(generation))) + + if resource_ids is not None and not isinstance(resource_ids, dict): + raise Exception("Expected resource_ids to be a Mapping, received: {}".format(type(resource_ids))) + + if storage_constraints is not None and not isinstance(storage_constraints, dict): + raise Exception("Expected storage_constraints to be a Mapping, received: {}".format(type(storage_constraints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetCharm', + version=20, + params=_params) + _params['application'] = application + _params['channel'] = channel + _params['charm-origin'] = charm_origin + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['endpoint-bindings'] = endpoint_bindings + _params['force'] = force + _params['force-base'] = force_base + _params['force-units'] = force_units + _params['generation'] = generation + _params['resource-ids'] = resource_ids + _params['storage-constraints'] = storage_constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetConfigs(self, args=None): + ''' + SetConfigs implements the server side of Application.SetConfig. Both + application and charm config are set. It does not unset values in + Config map that are set to an empty string. Unset should be used for that. + + args : typing.Sequence[~ConfigSet] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetConfigs', + version=20, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetConstraints(self, application=None, constraints=None): + ''' + SetConstraints sets the constraints for a given application. + + application : str + constraints : Value + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetConstraints', + version=20, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMetricCredentials(self, creds=None): + ''' + SetMetricCredentials sets credentials on the application. + TODO (cderici) only used for metered charms in cmd MeteredDeployAPI, + kept for client compatibility, remove in juju 4.0 + + creds : typing.Sequence[~ApplicationMetricCredential] + Returns -> ErrorResults + ''' + if creds is not None and not isinstance(creds, (bytes, str, list)): + raise Exception("Expected creds to be a Sequence, received: {}".format(type(creds))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetMetricCredentials', + version=20, + params=_params) + _params['creds'] = creds + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationsSuspended(self, args=None): + ''' + SetRelationsSuspended sets the suspended status of the specified relations. + + args : typing.Sequence[~RelationSuspendedArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetRelationsSuspended', + version=20, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unexpose(self, application=None, exposed_endpoints=None): + ''' + Unexpose changes the juju-managed firewall to unexpose any ports that + were also explicitly marked by units as open. + + application : str + exposed_endpoints : typing.Sequence[str] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if exposed_endpoints is not None and not isinstance(exposed_endpoints, (bytes, str, list)): + raise Exception("Expected exposed_endpoints to be a Sequence, received: {}".format(type(exposed_endpoints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=20, + params=_params) + _params['application'] = application + _params['exposed-endpoints'] = exposed_endpoints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitInfoResults) + async def UnitsInfo(self, entities=None): + ''' + UnitsInfo returns unit information for the given entities (units or + applications). + + entities : typing.Sequence[~Entity] + Returns -> UnitInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UnitsInfo', + version=20, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UnsetApplicationsConfig(self, args=None): + ''' + UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig. + + args : typing.Sequence[~ApplicationUnset] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UnsetApplicationsConfig', + version=20, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateApplicationBase(self, args=None): + ''' + UpdateApplicationBase updates the application base. + Base for subordinates is updated too. + + args : typing.Sequence[~UpdateChannelArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UpdateApplicationBase', + version=20, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/_client3.py b/juju/client/_client3.py index 3da26b13..f7879810 100644 --- a/juju/client/_client3.py +++ b/juju/client/_client3.py @@ -899,6 +899,561 @@ async def Create(self, no_download=None, notes=None): +class CrossModelRelationsFacade(Type): + name = 'CrossModelRelations' + version = 3 + 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': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + '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': {'bakery-version': {'type': 'integer'}, + 'ingress-required': {'type': 'boolean'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'networks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}}, + 'required': ['relation-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': {'bakery-version': {'type': 'integer'}, + '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'}, + 'bakery-version': {'type': 'integer'}, + 'consume-version': {'type': 'integer'}, + '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'}, + 'source-model-tag': {'type': 'string'}}, + 'required': ['application-token', + 'source-model-tag', + 'relation-token', + 'remote-endpoint', + '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'}, + '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': {'bakery-version': {'type': 'integer'}, + '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-settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'application-token': {'type': 'string'}, + 'bakery-version': {'type': 'integer'}, + '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'}, + 'unit-count': {'type': 'integer'}}, + 'required': ['relation-token', + 'application-token', + 'life', + 'unit-count'], + 'type': 'object'}, + 'RemoteRelationDetails': {'additionalProperties': False, + 'properties': {'bakery-version': {'type': 'integer'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'relation-token': {'type': 'string'}}, + 'required': ['relation-token'], + 'type': 'object'}, + 'RemoteRelationUnitChange': {'additionalProperties': False, + 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'unit-id': {'type': 'integer'}}, + 'required': ['unit-id'], + 'type': 'object'}, + 'RemoteRelationWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RemoteRelationWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteRelationWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteRelationsChanges': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SecretRevisionChange': {'additionalProperties': False, + 'properties': {'revision': {'type': 'integer'}, + 'uri': {'type': 'string'}}, + 'required': ['uri', 'revision'], + 'type': 'object'}, + 'SecretRevisionWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/SecretRevisionChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'SecretRevisionWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SecretRevisionWatchResult'}, + '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'}, + 'WatchRemoteSecretChangesArg': {'additionalProperties': False, + 'properties': {'application-token': {'type': 'string'}, + 'bakery-version': {'type': 'integer'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}}, + 'required': ['application-token', + 'relation-token'], + 'type': 'object'}, + 'WatchRemoteSecretChangesArgs': {'additionalProperties': False, + 'properties': {'relations': {'items': {'$ref': '#/definitions/WatchRemoteSecretChangesArg'}, + 'type': 'array'}}, + 'required': ['relations'], + 'type': 'object'}}, + 'properties': {'PublishIngressNetworkChanges': {'description': 'PublishIngressNetworkChanges ' + 'publishes ' + 'changes to ' + 'the required\n' + 'ingress ' + 'addresses to ' + 'the model ' + 'hosting the ' + 'offer in the ' + 'relation.', + 'properties': {'Params': {'$ref': '#/definitions/IngressNetworksChanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'PublishRelationChanges': {'description': 'PublishRelationChanges ' + 'publishes relation ' + 'changes to the\n' + 'model hosting the ' + 'remote application ' + 'involved in the ' + 'relation.', + 'properties': {'Params': {'$ref': '#/definitions/RemoteRelationsChanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RegisterRemoteRelations': {'description': 'RegisterRemoteRelations ' + 'sets up the model ' + 'to participate\n' + 'in the specified ' + 'relations. This ' + 'operation is ' + 'idempotent.', + 'properties': {'Params': {'$ref': '#/definitions/RegisterRemoteRelationArgs'}, + 'Result': {'$ref': '#/definitions/RegisterRemoteRelationResults'}}, + 'type': 'object'}, + 'WatchConsumedSecretsChanges': {'description': 'WatchConsumedSecretsChanges ' + 'returns a ' + 'watcher which ' + 'notifies of ' + 'changes to any ' + 'secrets\n' + 'for the ' + 'specified ' + 'remote ' + 'consumers.', + 'properties': {'Params': {'$ref': '#/definitions/WatchRemoteSecretChangesArgs'}, + 'Result': {'$ref': '#/definitions/SecretRevisionWatchResults'}}, + 'type': 'object'}, + 'WatchEgressAddressesForRelations': {'description': 'WatchEgressAddressesForRelations ' + 'creates a ' + 'watcher ' + 'that ' + 'notifies ' + 'when ' + 'addresses, ' + 'from ' + 'which\n' + 'connections ' + 'will ' + 'originate ' + 'for the ' + 'relation, ' + 'change.\n' + 'Each ' + 'event ' + 'contains ' + 'the ' + 'entire ' + 'set of ' + 'addresses ' + 'which are ' + 'required ' + 'for ' + 'ingress ' + 'for the ' + 'relation.', + 'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchOfferStatus': {'description': 'WatchOfferStatus starts ' + 'an OfferStatusWatcher ' + 'for\n' + 'watching the status of an ' + 'offer.', + 'properties': {'Params': {'$ref': '#/definitions/OfferArgs'}, + 'Result': {'$ref': '#/definitions/OfferStatusWatchResults'}}, + 'type': 'object'}, + 'WatchRelationChanges': {'description': 'WatchRelationChanges ' + 'starts a ' + 'RemoteRelationChangesWatcher ' + 'for each\n' + 'specified relation, ' + 'returning the watcher ' + 'IDs and initial ' + 'values,\n' + 'or an error if the ' + 'remote relations ' + "couldn't be watched.", + 'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, + 'Result': {'$ref': '#/definitions/RemoteRelationWatchResults'}}, + 'type': 'object'}, + 'WatchRelationsSuspendedStatus': {'description': 'WatchRelationsSuspendedStatus ' + 'starts a ' + 'RelationStatusWatcher ' + 'for\n' + 'watching the ' + 'life and ' + 'suspended ' + 'status of a ' + 'relation.', + 'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, + 'Result': {'$ref': '#/definitions/RelationStatusWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def PublishIngressNetworkChanges(self, changes=None): + ''' + PublishIngressNetworkChanges publishes changes to the required + ingress addresses to the model hosting the offer in the relation. + + changes : typing.Sequence[~IngressNetworksChangeEvent] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='PublishIngressNetworkChanges', + version=3, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def PublishRelationChanges(self, changes=None): + ''' + PublishRelationChanges publishes relation changes to the + model hosting the remote application involved in the relation. + + changes : typing.Sequence[~RemoteRelationChangeEvent] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='PublishRelationChanges', + version=3, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RegisterRemoteRelationResults) + async def RegisterRemoteRelations(self, relations=None): + ''' + RegisterRemoteRelations sets up the model to participate + in the specified relations. This operation is idempotent. + + relations : typing.Sequence[~RegisterRemoteRelationArg] + Returns -> RegisterRemoteRelationResults + ''' + if relations is not None and not isinstance(relations, (bytes, str, list)): + raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='RegisterRemoteRelations', + version=3, + params=_params) + _params['relations'] = relations + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretRevisionWatchResults) + async def WatchConsumedSecretsChanges(self, relations=None): + ''' + WatchConsumedSecretsChanges returns a watcher which notifies of changes to any secrets + for the specified remote consumers. + + relations : typing.Sequence[~WatchRemoteSecretChangesArg] + Returns -> SecretRevisionWatchResults + ''' + if relations is not None and not isinstance(relations, (bytes, str, list)): + raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchConsumedSecretsChanges', + version=3, + params=_params) + _params['relations'] = relations + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchEgressAddressesForRelations(self, args=None): + ''' + WatchEgressAddressesForRelations creates a watcher that notifies when addresses, from which + connections will originate for the relation, change. + Each event contains the entire set of addresses which are required for ingress for the relation. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> StringsWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchEgressAddressesForRelations', + version=3, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OfferStatusWatchResults) + async def WatchOfferStatus(self, args=None): + ''' + WatchOfferStatus starts an OfferStatusWatcher for + watching the status of an offer. + + args : typing.Sequence[~OfferArg] + Returns -> OfferStatusWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchOfferStatus', + version=3, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoteRelationWatchResults) + async def WatchRelationChanges(self, args=None): + ''' + WatchRelationChanges starts a RemoteRelationChangesWatcher for each + specified relation, returning the watcher IDs and initial values, + or an error if the remote relations couldn't be watched. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> RemoteRelationWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchRelationChanges', + version=3, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationStatusWatchResults) + async def WatchRelationsSuspendedStatus(self, args=None): + ''' + WatchRelationsSuspendedStatus starts a RelationStatusWatcher for + watching the life and suspended status of a relation. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> RelationStatusWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchRelationsSuspendedStatus', + version=3, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + class ImageMetadataFacade(Type): name = 'ImageMetadata' version = 3 @@ -1397,6 +1952,9 @@ class MigrationMasterFacade(Type): 'MigrationModelInfo': {'additionalProperties': False, 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, 'controller-agent-version': {'$ref': '#/definitions/Number'}, + 'facade-versions': {'patternProperties': {'.*': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'type': 'object'}, 'name': {'type': 'string'}, 'owner-tag': {'type': 'string'}, 'uuid': {'type': 'string'}}, @@ -1941,6 +2499,513 @@ async def WatchMinionReports(self): +class MigrationTargetFacade(Type): + name = 'MigrationTarget' + version = 3 + schema = {'definitions': {'ActivateModelArgs': {'additionalProperties': False, + 'properties': {'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}, + 'cross-model-uuids': {'items': {'type': 'string'}, + 'type': 'array'}, + 'model-tag': {'type': 'string'}, + 'source-api-addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'source-ca-cert': {'type': 'string'}}, + 'required': ['model-tag', + 'controller-tag', + 'source-api-addrs', + 'source-ca-cert', + 'cross-model-uuids'], + 'type': 'object'}, + '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': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + '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'}, + 'MigrationModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'controller-agent-version': {'$ref': '#/definitions/Number'}, + 'facade-versions': {'patternProperties': {'.*': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'type': 'object'}, + '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': {'description': 'Abort removes the specified model ' + 'from the database. It is an error ' + 'to\n' + 'attempt to Abort a model that has a ' + 'migration mode other than importing.', + 'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}}, + 'type': 'object'}, + 'Activate': {'description': 'Activate sets the migration mode ' + 'of the model to "none", meaning ' + 'it\n' + 'is ready for use. It is an error ' + 'to attempt to Abort a model that\n' + 'has a migration mode other than ' + 'importing. It also adds any ' + 'required\n' + 'external controller records for ' + 'those controllers hosting offers ' + 'used\n' + 'by the model.', + 'properties': {'Params': {'$ref': '#/definitions/ActivateModelArgs'}}, + 'type': 'object'}, + 'AdoptResources': {'description': 'AdoptResources asks the ' + 'cloud provider to update ' + 'the controller\n' + "tags for a model's " + 'resources. This prevents ' + 'the resources from\n' + 'being destroyed if the ' + 'source controller is ' + 'destroyed after the\n' + 'model is migrated away.', + 'properties': {'Params': {'$ref': '#/definitions/AdoptResourcesArgs'}}, + 'type': 'object'}, + 'CACert': {'description': 'CACert returns the certificate used ' + 'to validate the state connection.', + 'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'CheckMachines': {'description': 'CheckMachines compares the ' + 'machines in state with the ' + 'ones reported\n' + 'by the provider and reports ' + 'any discrepancies.', + 'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Import': {'description': 'Import takes a serialized Juju ' + 'model, deserializes it, and\n' + 'recreates it in the receiving ' + 'controller.', + 'properties': {'Params': {'$ref': '#/definitions/SerializedModel'}}, + 'type': 'object'}, + 'LatestLogTime': {'description': 'LatestLogTime returns the ' + 'time of the most recent log ' + 'record\n' + 'received by the logtransfer ' + 'endpoint. This can be used ' + 'as the start\n' + 'point for streaming logs ' + 'from the source if the ' + 'transfer was\n' + 'interrupted.\n' + '\n' + 'For performance reasons, not ' + 'every time is tracked, so if ' + 'the\n' + 'target controller died ' + 'during the transfer the ' + 'latest log time\n' + 'might be up to 2 minutes ' + 'earlier. If the transfer was ' + 'interrupted\n' + 'in some other way (like the ' + 'source controller going away ' + 'or a\n' + 'network partition) the time ' + 'will be up-to-date.\n' + '\n' + 'Log messages are assumed to ' + 'be sent in time order (which ' + 'is how\n' + 'debug-log emits them). If ' + "that isn't the case then " + 'this mechanism\n' + "can't be used to avoid " + 'duplicates when logtransfer ' + 'is restarted.\n' + '\n' + 'Returns the zero time if no ' + 'logs have been transferred.', + 'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}, + 'Result': {'format': 'date-time', + 'type': 'string'}}, + 'type': 'object'}, + 'Prechecks': {'description': 'Prechecks ensure that the target ' + 'controller is ready to accept a\n' + 'model migration.', + 'properties': {'Params': {'$ref': '#/definitions/MigrationModelInfo'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def Abort(self, model_tag=None): + ''' + Abort removes the specified model from the database. It is an error to + attempt to Abort a model that has a migration mode other than importing. + + model_tag : str + Returns -> None + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Abort', + version=3, + params=_params) + _params['model-tag'] = model_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Activate(self, controller_alias=None, controller_tag=None, cross_model_uuids=None, model_tag=None, source_api_addrs=None, source_ca_cert=None): + ''' + Activate sets the migration mode of the model to "none", meaning it + is ready for use. It is an error to attempt to Abort a model that + has a migration mode other than importing. It also adds any required + external controller records for those controllers hosting offers used + by the model. + + controller_alias : str + controller_tag : str + cross_model_uuids : typing.Sequence[str] + model_tag : str + source_api_addrs : typing.Sequence[str] + source_ca_cert : str + Returns -> None + ''' + if controller_alias is not None and not isinstance(controller_alias, (bytes, str)): + raise Exception("Expected controller_alias to be a str, received: {}".format(type(controller_alias))) + + if controller_tag is not None and not isinstance(controller_tag, (bytes, str)): + raise Exception("Expected controller_tag to be a str, received: {}".format(type(controller_tag))) + + if cross_model_uuids is not None and not isinstance(cross_model_uuids, (bytes, str, list)): + raise Exception("Expected cross_model_uuids to be a Sequence, received: {}".format(type(cross_model_uuids))) + + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + if source_api_addrs is not None and not isinstance(source_api_addrs, (bytes, str, list)): + raise Exception("Expected source_api_addrs to be a Sequence, received: {}".format(type(source_api_addrs))) + + if source_ca_cert is not None and not isinstance(source_ca_cert, (bytes, str)): + raise Exception("Expected source_ca_cert to be a str, received: {}".format(type(source_ca_cert))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Activate', + version=3, + params=_params) + _params['controller-alias'] = controller_alias + _params['controller-tag'] = controller_tag + _params['cross-model-uuids'] = cross_model_uuids + _params['model-tag'] = model_tag + _params['source-api-addrs'] = source_api_addrs + _params['source-ca-cert'] = source_ca_cert + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AdoptResources(self, model_tag=None, source_controller_version=None): + ''' + AdoptResources asks the cloud provider to update the controller + tags for a model's resources. This prevents the resources from + being destroyed if the source controller is destroyed after the + model is migrated away. + + model_tag : str + source_controller_version : Number + Returns -> None + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + if source_controller_version is not None and not isinstance(source_controller_version, (dict, Number)): + raise Exception("Expected source_controller_version to be a Number, received: {}".format(type(source_controller_version))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='AdoptResources', + version=3, + 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): + ''' + CACert returns the certificate used to validate the state connection. + + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='CACert', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def CheckMachines(self, model_tag=None): + ''' + CheckMachines compares the machines in state with the ones reported + by the provider and reports any discrepancies. + + model_tag : str + Returns -> ErrorResults + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='CheckMachines', + version=3, + params=_params) + _params['model-tag'] = model_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Import(self, bytes_=None, charms=None, resources=None, tools=None): + ''' + Import takes a serialized Juju model, deserializes it, and + recreates it in the receiving controller. + + bytes_ : typing.Sequence[int] + charms : typing.Sequence[str] + resources : typing.Sequence[~SerializedModelResource] + tools : typing.Sequence[~SerializedModelTools] + Returns -> None + ''' + if bytes_ is not None and not isinstance(bytes_, (bytes, str, list)): + raise Exception("Expected bytes_ to be a Sequence, received: {}".format(type(bytes_))) + + if charms is not None and not isinstance(charms, (bytes, str, list)): + raise Exception("Expected charms to be a Sequence, received: {}".format(type(charms))) + + if resources is not None and not isinstance(resources, (bytes, str, list)): + raise Exception("Expected resources to be a Sequence, received: {}".format(type(resources))) + + if tools is not None and not isinstance(tools, (bytes, str, list)): + raise Exception("Expected tools to be a Sequence, received: {}".format(type(tools))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Import', + version=3, + params=_params) + _params['bytes'] = bytes_ + _params['charms'] = charms + _params['resources'] = resources + _params['tools'] = tools + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(str) + async def LatestLogTime(self, model_tag=None): + ''' + LatestLogTime returns the time of the most recent log record + received by the logtransfer endpoint. This can be used as the start + point for streaming logs from the source if the transfer was + interrupted. + + For performance reasons, not every time is tracked, so if the + target controller died during the transfer the latest log time + might be up to 2 minutes earlier. If the transfer was interrupted + in some other way (like the source controller going away or a + network partition) the time will be up-to-date. + + Log messages are assumed to be sent in time order (which is how + debug-log emits them). If that isn't the case then this mechanism + can't be used to avoid duplicates when logtransfer is restarted. + + Returns the zero time if no logs have been transferred. + + model_tag : str + Returns -> str + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='LatestLogTime', + version=3, + params=_params) + _params['model-tag'] = model_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Prechecks(self, agent_version=None, controller_agent_version=None, facade_versions=None, name=None, owner_tag=None, uuid=None): + ''' + Prechecks ensure that the target controller is ready to accept a + model migration. + + agent_version : Number + controller_agent_version : Number + facade_versions : typing.Mapping[str, typing.Sequence[int]] + name : str + owner_tag : str + uuid : str + Returns -> None + ''' + if agent_version is not None and not isinstance(agent_version, (dict, Number)): + raise Exception("Expected agent_version to be a Number, received: {}".format(type(agent_version))) + + if controller_agent_version is not None and not isinstance(controller_agent_version, (dict, Number)): + raise Exception("Expected controller_agent_version to be a Number, received: {}".format(type(controller_agent_version))) + + if facade_versions is not None and not isinstance(facade_versions, dict): + raise Exception("Expected facade_versions to be a Mapping, received: {}".format(type(facade_versions))) + + if name is not None and not isinstance(name, (bytes, str)): + raise Exception("Expected name to be a str, received: {}".format(type(name))) + + if owner_tag is not None and not isinstance(owner_tag, (bytes, str)): + raise Exception("Expected owner_tag to be a str, received: {}".format(type(owner_tag))) + + if uuid is not None and not isinstance(uuid, (bytes, str)): + raise Exception("Expected uuid to be a str, received: {}".format(type(uuid))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Prechecks', + version=3, + params=_params) + _params['agent-version'] = agent_version + _params['controller-agent-version'] = controller_agent_version + _params['facade-versions'] = facade_versions + _params['name'] = name + _params['owner-tag'] = owner_tag + _params['uuid'] = uuid + reply = await self.rpc(msg) + return reply + + + class ModelConfigFacade(Type): name = 'ModelConfig' version = 3 diff --git a/juju/client/_client5.py b/juju/client/_client5.py index 0ea7f5cb..8e3ca348 100644 --- a/juju/client/_client5.py +++ b/juju/client/_client5.py @@ -5,6 +5,543 @@ from juju.client._definitions import * +class ApplicationOffersFacade(Type): + name = 'ApplicationOffers' + version = 5 + 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'}, + 'owner-tag': {'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'}, + 'ApplicationOfferAdminDetailsV5': {'additionalProperties': False, + 'properties': {'ApplicationOfferDetailsV5': {'$ref': '#/definitions/ApplicationOfferDetailsV5'}, + 'application-description': {'type': 'string'}, + 'application-name': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'connections': {'items': {'$ref': '#/definitions/OfferConnection'}, + 'type': 'array'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description', + 'ApplicationOfferDetailsV5', + 'application-name', + 'charm-url'], + 'type': 'object'}, + 'ApplicationOfferDetailsV5': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + '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/ApplicationOfferAdminDetailsV5'}}, + '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/ApplicationOfferDetailsV5'}}, + 'type': 'object'}, + 'ConsumeOfferDetailsArg': {'additionalProperties': False, + 'properties': {'offer-urls': {'$ref': '#/definitions/OfferURLs'}, + 'user-tag': {'type': 'string'}}, + 'required': ['offer-urls'], + 'type': 'object'}, + 'ConsumeOfferDetailsResult': {'additionalProperties': False, + 'properties': {'ConsumeOfferDetails': {'$ref': '#/definitions/ConsumeOfferDetails'}, + 'error': {'$ref': '#/definitions/Error'}, + 'external-controller': {'$ref': '#/definitions/ExternalControllerInfo'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'offer': {'$ref': '#/definitions/ApplicationOfferDetailsV5'}}, + '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': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + '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': {'bakery-version': {'type': 'integer'}, + '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'}, + 'QueryApplicationOffersResultsV5': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationOfferAdminDetailsV5'}, + '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'}}, + 'properties': {'ApplicationOffers': {'description': 'ApplicationOffers gets ' + 'details about remote ' + 'applications that match ' + 'given URLs.', + 'properties': {'Params': {'$ref': '#/definitions/OfferURLs'}, + 'Result': {'$ref': '#/definitions/ApplicationOffersResults'}}, + 'type': 'object'}, + 'DestroyOffers': {'description': 'DestroyOffers removes the ' + 'offers specified by the ' + 'given URLs, forcing if ' + 'necessary.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationOffers'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FindApplicationOffers': {'description': 'FindApplicationOffers ' + 'gets details about ' + 'remote applications ' + 'that match given ' + 'filter.', + 'properties': {'Params': {'$ref': '#/definitions/OfferFilters'}, + 'Result': {'$ref': '#/definitions/QueryApplicationOffersResultsV5'}}, + 'type': 'object'}, + 'GetConsumeDetails': {'description': 'GetConsumeDetails ' + 'returns the details ' + 'necessary to pass to ' + 'another model\n' + 'to allow the specified ' + 'args user to consume the ' + 'offers represented by ' + 'the args URLs.', + 'properties': {'Params': {'$ref': '#/definitions/ConsumeOfferDetailsArg'}, + 'Result': {'$ref': '#/definitions/ConsumeOfferDetailsResults'}}, + 'type': 'object'}, + 'ListApplicationOffers': {'description': 'ListApplicationOffers ' + 'gets deployed ' + 'details about ' + 'application offers ' + 'that match given ' + 'filter.\n' + 'The results contain ' + 'details about the ' + 'deployed ' + 'applications such as ' + 'connection count.', + 'properties': {'Params': {'$ref': '#/definitions/OfferFilters'}, + 'Result': {'$ref': '#/definitions/QueryApplicationOffersResultsV5'}}, + 'type': 'object'}, + 'ModifyOfferAccess': {'description': 'ModifyOfferAccess ' + 'changes the application ' + 'offer access granted to ' + 'users.', + 'properties': {'Params': {'$ref': '#/definitions/ModifyOfferAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Offer': {'description': 'Offer makes application endpoints ' + 'available for consumption at a ' + 'specified URL.', + 'properties': {'Params': {'$ref': '#/definitions/AddApplicationOffers'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoteApplicationInfo': {'description': 'RemoteApplicationInfo ' + 'returns information ' + 'about the requested ' + 'remote application.\n' + 'This call currently ' + 'has no client side ' + 'API, only there for ' + 'the Dashboard at ' + 'this stage.', + 'properties': {'Params': {'$ref': '#/definitions/OfferURLs'}, + 'Result': {'$ref': '#/definitions/RemoteApplicationInfoResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ApplicationOffersResults) + async def ApplicationOffers(self, bakery_version=None, offer_urls=None): + ''' + ApplicationOffers gets details about remote applications that match given URLs. + + bakery_version : int + offer_urls : typing.Sequence[str] + Returns -> ApplicationOffersResults + ''' + if bakery_version is not None and not isinstance(bakery_version, int): + raise Exception("Expected bakery_version to be a int, received: {}".format(type(bakery_version))) + + if offer_urls is not None and not isinstance(offer_urls, (bytes, str, list)): + raise Exception("Expected offer_urls to be a Sequence, received: {}".format(type(offer_urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='ApplicationOffers', + version=5, + params=_params) + _params['bakery-version'] = bakery_version + _params['offer-urls'] = offer_urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyOffers(self, force=None, offer_urls=None): + ''' + DestroyOffers removes the offers specified by the given URLs, forcing if necessary. + + force : bool + offer_urls : typing.Sequence[str] + Returns -> ErrorResults + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if offer_urls is not None and not isinstance(offer_urls, (bytes, str, list)): + raise Exception("Expected offer_urls to be a Sequence, received: {}".format(type(offer_urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='DestroyOffers', + version=5, + params=_params) + _params['force'] = force + _params['offer-urls'] = offer_urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(QueryApplicationOffersResultsV5) + async def FindApplicationOffers(self, filters=None): + ''' + FindApplicationOffers gets details about remote applications that match given filter. + + filters : typing.Sequence[~OfferFilter] + Returns -> QueryApplicationOffersResultsV5 + ''' + if filters is not None and not isinstance(filters, (bytes, str, list)): + raise Exception("Expected filters to be a Sequence, received: {}".format(type(filters))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='FindApplicationOffers', + version=5, + params=_params) + _params['Filters'] = filters + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConsumeOfferDetailsResults) + async def GetConsumeDetails(self, offer_urls=None, user_tag=None): + ''' + GetConsumeDetails returns the details necessary to pass to another model + to allow the specified args user to consume the offers represented by the args URLs. + + offer_urls : OfferURLs + user_tag : str + Returns -> ConsumeOfferDetailsResults + ''' + if offer_urls is not None and not isinstance(offer_urls, (dict, OfferURLs)): + raise Exception("Expected offer_urls to be a OfferURLs, received: {}".format(type(offer_urls))) + + if user_tag is not None and not isinstance(user_tag, (bytes, str)): + raise Exception("Expected user_tag to be a str, received: {}".format(type(user_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='GetConsumeDetails', + version=5, + params=_params) + _params['offer-urls'] = offer_urls + _params['user-tag'] = user_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(QueryApplicationOffersResultsV5) + async def ListApplicationOffers(self, filters=None): + ''' + ListApplicationOffers gets deployed details about application offers that match given filter. + The results contain details about the deployed applications such as connection count. + + filters : typing.Sequence[~OfferFilter] + Returns -> QueryApplicationOffersResultsV5 + ''' + if filters is not None and not isinstance(filters, (bytes, str, list)): + raise Exception("Expected filters to be a Sequence, received: {}".format(type(filters))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='ListApplicationOffers', + version=5, + params=_params) + _params['Filters'] = filters + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyOfferAccess(self, changes=None): + ''' + ModifyOfferAccess changes the application offer access granted to users. + + changes : typing.Sequence[~ModifyOfferAccess] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='ModifyOfferAccess', + version=5, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Offer(self, offers=None): + ''' + Offer makes application endpoints available for consumption at a specified URL. + + offers : typing.Sequence[~AddApplicationOffer] + Returns -> ErrorResults + ''' + if offers is not None and not isinstance(offers, (bytes, str, list)): + raise Exception("Expected offers to be a Sequence, received: {}".format(type(offers))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='Offer', + version=5, + params=_params) + _params['Offers'] = offers + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoteApplicationInfoResults) + async def RemoteApplicationInfo(self, bakery_version=None, offer_urls=None): + ''' + RemoteApplicationInfo returns information about the requested remote application. + This call currently has no client side API, only there for the Dashboard at this stage. + + bakery_version : int + offer_urls : typing.Sequence[str] + Returns -> RemoteApplicationInfoResults + ''' + if bakery_version is not None and not isinstance(bakery_version, int): + raise Exception("Expected bakery_version to be a int, received: {}".format(type(bakery_version))) + + if offer_urls is not None and not isinstance(offer_urls, (bytes, str, list)): + raise Exception("Expected offer_urls to be a Sequence, received: {}".format(type(offer_urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='RemoteApplicationInfo', + version=5, + params=_params) + _params['bakery-version'] = bakery_version + _params['offer-urls'] = offer_urls + reply = await self.rpc(msg) + return reply + + + class MachinerFacade(Type): name = 'Machiner' version = 5 diff --git a/juju/client/_client7.py b/juju/client/_client7.py index 7b54560a..66fe3815 100644 --- a/juju/client/_client7.py +++ b/juju/client/_client7.py @@ -588,9 +588,11 @@ class CharmsFacade(Type): 'name': {'type': 'string'}}, 'type': 'object'}, 'CharmContainer': {'additionalProperties': False, - 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'properties': {'gid': {'type': 'integer'}, + 'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, 'type': 'array'}, - 'resource': {'type': 'string'}}, + 'resource': {'type': 'string'}, + 'uid': {'type': 'integer'}}, 'type': 'object'}, 'CharmDeployment': {'additionalProperties': False, 'properties': {'min-version': {'type': 'string'}, @@ -633,6 +635,7 @@ class CharmsFacade(Type): 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, 'categories': {'items': {'type': 'string'}, 'type': 'array'}, + 'charm-user': {'type': 'string'}, 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, 'type': 'object'}, 'deployment': {'$ref': '#/definitions/CharmDeployment'}, diff --git a/juju/client/_definitions.py b/juju/client/_definitions.py index 8fca18cf..3877c8be 100644 --- a/juju/client/_definitions.py +++ b/juju/client/_definitions.py @@ -22,6 +22,36 @@ def __init__(self, servers=None, **unknown_fields): +class AccessInfo(Type): + _toSchema = {'role': 'role', 'scope_tag': 'scope-tag', 'target_tag': 'target-tag'} + _toPy = {'role': 'role', 'scope-tag': 'scope_tag', 'target-tag': 'target_tag'} + def __init__(self, role=None, scope_tag=None, target_tag=None, **unknown_fields): + ''' + role : str + scope_tag : str + target_tag : str + ''' + role_ = role + scope_tag_ = scope_tag + target_tag_ = target_tag + + # Validate arguments against known Juju API types. + if role_ is not None and not isinstance(role_, (bytes, str)): + raise Exception("Expected role_ to be a str, received: {}".format(type(role_))) + + if scope_tag_ is not None and not isinstance(scope_tag_, (bytes, str)): + raise Exception("Expected scope_tag_ to be a str, received: {}".format(type(scope_tag_))) + + if target_tag_ is not None and not isinstance(target_tag_, (bytes, str)): + raise Exception("Expected target_tag_ to be a str, received: {}".format(type(target_tag_))) + + self.role = role_ + self.scope_tag = scope_tag_ + self.target_tag = target_tag_ + self.unknown_fields = unknown_fields + + + class Action(Type): _toSchema = {'execution_group': 'execution-group', 'name': 'name', 'parallel': 'parallel', 'parameters': 'parameters', 'receiver': 'receiver', 'tag': 'tag'} _toPy = {'execution-group': 'execution_group', 'name': 'name', 'parallel': 'parallel', 'parameters': 'parameters', 'receiver': 'receiver', 'tag': 'tag'} @@ -2044,6 +2074,84 @@ def __init__(self, applicationofferdetails=None, application_description=None, a +class ApplicationOfferAdminDetailsV5(Type): + _toSchema = {'application_description': 'application-description', 'application_name': 'application-name', 'applicationofferdetailsv5': 'ApplicationOfferDetailsV5', 'charm_url': 'charm-url', 'connections': 'connections', 'endpoints': 'endpoints', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'offer_uuid': 'offer-uuid', 'source_model_tag': 'source-model-tag', 'users': 'users'} + _toPy = {'ApplicationOfferDetailsV5': 'applicationofferdetailsv5', 'application-description': 'application_description', 'application-name': 'application_name', 'charm-url': 'charm_url', 'connections': 'connections', 'endpoints': 'endpoints', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'offer-uuid': 'offer_uuid', 'source-model-tag': 'source_model_tag', 'users': 'users'} + def __init__(self, applicationofferdetailsv5=None, application_description=None, application_name=None, charm_url=None, connections=None, endpoints=None, offer_name=None, offer_url=None, offer_uuid=None, source_model_tag=None, users=None, **unknown_fields): + ''' + applicationofferdetailsv5 : ApplicationOfferDetailsV5 + application_description : str + application_name : str + charm_url : str + connections : typing.Sequence[~OfferConnection] + endpoints : typing.Sequence[~RemoteEndpoint] + offer_name : str + offer_url : str + offer_uuid : str + source_model_tag : str + users : typing.Sequence[~OfferUserDetails] + ''' + applicationofferdetailsv5_ = ApplicationOfferDetailsV5.from_json(applicationofferdetailsv5) if applicationofferdetailsv5 else None + application_description_ = application_description + application_name_ = application_name + charm_url_ = charm_url + connections_ = [OfferConnection.from_json(o) for o in connections or []] + endpoints_ = [RemoteEndpoint.from_json(o) for o in endpoints or []] + offer_name_ = offer_name + offer_url_ = offer_url + offer_uuid_ = offer_uuid + source_model_tag_ = source_model_tag + users_ = [OfferUserDetails.from_json(o) for o in users or []] + + # Validate arguments against known Juju API types. + if applicationofferdetailsv5_ is not None and not isinstance(applicationofferdetailsv5_, (dict, ApplicationOfferDetailsV5)): + raise Exception("Expected applicationofferdetailsv5_ to be a ApplicationOfferDetailsV5, received: {}".format(type(applicationofferdetailsv5_))) + + if application_description_ is not None and not isinstance(application_description_, (bytes, str)): + raise Exception("Expected application_description_ to be a str, received: {}".format(type(application_description_))) + + if application_name_ is not None and not isinstance(application_name_, (bytes, str)): + raise Exception("Expected application_name_ to be a str, received: {}".format(type(application_name_))) + + if charm_url_ is not None and not isinstance(charm_url_, (bytes, str)): + raise Exception("Expected charm_url_ to be a str, received: {}".format(type(charm_url_))) + + if connections_ is not None and not isinstance(connections_, (bytes, str, list)): + raise Exception("Expected connections_ to be a Sequence, received: {}".format(type(connections_))) + + if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): + raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) + + if offer_name_ is not None and not isinstance(offer_name_, (bytes, str)): + raise Exception("Expected offer_name_ to be a str, received: {}".format(type(offer_name_))) + + if offer_url_ is not None and not isinstance(offer_url_, (bytes, str)): + raise Exception("Expected offer_url_ to be a str, received: {}".format(type(offer_url_))) + + if offer_uuid_ is not None and not isinstance(offer_uuid_, (bytes, str)): + raise Exception("Expected offer_uuid_ to be a str, received: {}".format(type(offer_uuid_))) + + if source_model_tag_ is not None and not isinstance(source_model_tag_, (bytes, str)): + raise Exception("Expected source_model_tag_ to be a str, received: {}".format(type(source_model_tag_))) + + if users_ is not None and not isinstance(users_, (bytes, str, list)): + raise Exception("Expected users_ to be a Sequence, received: {}".format(type(users_))) + + self.applicationofferdetailsv5 = applicationofferdetailsv5_ + self.application_description = application_description_ + self.application_name = application_name_ + self.charm_url = charm_url_ + self.connections = connections_ + self.endpoints = endpoints_ + self.offer_name = offer_name_ + self.offer_url = offer_url_ + self.offer_uuid = offer_uuid_ + self.source_model_tag = source_model_tag_ + self.users = users_ + self.unknown_fields = unknown_fields + + + class ApplicationOfferDetails(Type): _toSchema = {'application_description': 'application-description', 'bindings': 'bindings', 'endpoints': 'endpoints', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'offer_uuid': 'offer-uuid', 'source_model_tag': 'source-model-tag', 'spaces': 'spaces', 'users': 'users'} _toPy = {'application-description': 'application_description', 'bindings': 'bindings', 'endpoints': 'endpoints', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'offer-uuid': 'offer_uuid', 'source-model-tag': 'source_model_tag', 'spaces': 'spaces', 'users': 'users'} @@ -2110,23 +2218,77 @@ def __init__(self, application_description=None, bindings=None, endpoints=None, +class ApplicationOfferDetailsV5(Type): + _toSchema = {'application_description': 'application-description', 'endpoints': 'endpoints', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'offer_uuid': 'offer-uuid', 'source_model_tag': 'source-model-tag', 'users': 'users'} + _toPy = {'application-description': 'application_description', 'endpoints': 'endpoints', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'offer-uuid': 'offer_uuid', 'source-model-tag': 'source_model_tag', 'users': 'users'} + def __init__(self, application_description=None, endpoints=None, offer_name=None, offer_url=None, offer_uuid=None, source_model_tag=None, users=None, **unknown_fields): + ''' + application_description : str + endpoints : typing.Sequence[~RemoteEndpoint] + offer_name : str + offer_url : str + offer_uuid : str + source_model_tag : str + users : typing.Sequence[~OfferUserDetails] + ''' + application_description_ = application_description + endpoints_ = [RemoteEndpoint.from_json(o) for o in endpoints or []] + offer_name_ = offer_name + offer_url_ = offer_url + offer_uuid_ = offer_uuid + source_model_tag_ = source_model_tag + users_ = [OfferUserDetails.from_json(o) for o in users or []] + + # Validate arguments against known Juju API types. + if application_description_ is not None and not isinstance(application_description_, (bytes, str)): + raise Exception("Expected application_description_ to be a str, received: {}".format(type(application_description_))) + + if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): + raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) + + if offer_name_ is not None and not isinstance(offer_name_, (bytes, str)): + raise Exception("Expected offer_name_ to be a str, received: {}".format(type(offer_name_))) + + if offer_url_ is not None and not isinstance(offer_url_, (bytes, str)): + raise Exception("Expected offer_url_ to be a str, received: {}".format(type(offer_url_))) + + if offer_uuid_ is not None and not isinstance(offer_uuid_, (bytes, str)): + raise Exception("Expected offer_uuid_ to be a str, received: {}".format(type(offer_uuid_))) + + if source_model_tag_ is not None and not isinstance(source_model_tag_, (bytes, str)): + raise Exception("Expected source_model_tag_ to be a str, received: {}".format(type(source_model_tag_))) + + if users_ is not None and not isinstance(users_, (bytes, str, list)): + raise Exception("Expected users_ to be a Sequence, received: {}".format(type(users_))) + + self.application_description = application_description_ + self.endpoints = endpoints_ + self.offer_name = offer_name_ + self.offer_url = offer_url_ + self.offer_uuid = offer_uuid_ + self.source_model_tag = source_model_tag_ + self.users = users_ + self.unknown_fields = unknown_fields + + + class ApplicationOfferResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error - result : ApplicationOfferAdminDetails + result : ApplicationOfferAdminDetailsV5 ''' error_ = Error.from_json(error) if error else None - result_ = ApplicationOfferAdminDetails.from_json(result) if result else None + result_ = ApplicationOfferAdminDetailsV5.from_json(result) if result else None # Validate arguments against known Juju API types. if error_ is not None and not isinstance(error_, (dict, Error)): raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) - if result_ is not None and not isinstance(result_, (dict, ApplicationOfferAdminDetails)): - raise Exception("Expected result_ to be a ApplicationOfferAdminDetails, received: {}".format(type(result_))) + if result_ is not None and not isinstance(result_, (dict, ApplicationOfferAdminDetailsV5)): + raise Exception("Expected result_ to be a ApplicationOfferAdminDetailsV5, received: {}".format(type(result_))) self.error = error_ self.result = result_ @@ -4463,25 +4625,37 @@ def __init__(self, architectures=None, channel=None, name=None, **unknown_fields class CharmContainer(Type): - _toSchema = {'mounts': 'mounts', 'resource': 'resource'} - _toPy = {'mounts': 'mounts', 'resource': 'resource'} - def __init__(self, mounts=None, resource=None, **unknown_fields): + _toSchema = {'gid': 'gid', 'mounts': 'mounts', 'resource': 'resource', 'uid': 'uid'} + _toPy = {'gid': 'gid', 'mounts': 'mounts', 'resource': 'resource', 'uid': 'uid'} + def __init__(self, gid=None, mounts=None, resource=None, uid=None, **unknown_fields): ''' + gid : int mounts : typing.Sequence[~CharmMount] resource : str + uid : int ''' + gid_ = gid mounts_ = [CharmMount.from_json(o) for o in mounts or []] resource_ = resource + uid_ = uid # Validate arguments against known Juju API types. + if gid_ is not None and not isinstance(gid_, int): + raise Exception("Expected gid_ to be a int, received: {}".format(type(gid_))) + if mounts_ is not None and not isinstance(mounts_, (bytes, str, list)): raise Exception("Expected mounts_ to be a Sequence, received: {}".format(type(mounts_))) if resource_ is not None and not isinstance(resource_, (bytes, str)): raise Exception("Expected resource_ to be a str, received: {}".format(type(resource_))) + if uid_ is not None and not isinstance(uid_, int): + raise Exception("Expected uid_ to be a int, received: {}".format(type(uid_))) + + self.gid = gid_ self.mounts = mounts_ self.resource = resource_ + self.uid = uid_ self.unknown_fields = unknown_fields @@ -4613,12 +4787,13 @@ def __init__(self, bases=None, **unknown_fields): class CharmMeta(Type): - _toSchema = {'assumes_expr': 'assumes-expr', 'categories': 'categories', 'containers': 'containers', 'deployment': 'deployment', 'description': 'description', 'devices': 'devices', 'extra_bindings': 'extra-bindings', 'min_juju_version': 'min-juju-version', 'name': 'name', 'payload_classes': 'payload-classes', 'peers': 'peers', 'provides': 'provides', 'requires': 'requires', 'resources': 'resources', 'series': 'series', 'storage': 'storage', 'subordinate': 'subordinate', 'summary': 'summary', 'tags': 'tags', 'terms': 'terms'} - _toPy = {'assumes-expr': 'assumes_expr', 'categories': 'categories', 'containers': 'containers', 'deployment': 'deployment', 'description': 'description', 'devices': 'devices', 'extra-bindings': 'extra_bindings', 'min-juju-version': 'min_juju_version', 'name': 'name', 'payload-classes': 'payload_classes', 'peers': 'peers', 'provides': 'provides', 'requires': 'requires', 'resources': 'resources', 'series': 'series', 'storage': 'storage', 'subordinate': 'subordinate', 'summary': 'summary', 'tags': 'tags', 'terms': 'terms'} - def __init__(self, assumes_expr=None, categories=None, containers=None, deployment=None, description=None, devices=None, extra_bindings=None, min_juju_version=None, name=None, payload_classes=None, peers=None, provides=None, requires=None, resources=None, series=None, storage=None, subordinate=None, summary=None, tags=None, terms=None, **unknown_fields): + _toSchema = {'assumes_expr': 'assumes-expr', 'categories': 'categories', 'charm_user': 'charm-user', 'containers': 'containers', 'deployment': 'deployment', 'description': 'description', 'devices': 'devices', 'extra_bindings': 'extra-bindings', 'min_juju_version': 'min-juju-version', 'name': 'name', 'payload_classes': 'payload-classes', 'peers': 'peers', 'provides': 'provides', 'requires': 'requires', 'resources': 'resources', 'series': 'series', 'storage': 'storage', 'subordinate': 'subordinate', 'summary': 'summary', 'tags': 'tags', 'terms': 'terms'} + _toPy = {'assumes-expr': 'assumes_expr', 'categories': 'categories', 'charm-user': 'charm_user', 'containers': 'containers', 'deployment': 'deployment', 'description': 'description', 'devices': 'devices', 'extra-bindings': 'extra_bindings', 'min-juju-version': 'min_juju_version', 'name': 'name', 'payload-classes': 'payload_classes', 'peers': 'peers', 'provides': 'provides', 'requires': 'requires', 'resources': 'resources', 'series': 'series', 'storage': 'storage', 'subordinate': 'subordinate', 'summary': 'summary', 'tags': 'tags', 'terms': 'terms'} + def __init__(self, assumes_expr=None, categories=None, charm_user=None, containers=None, deployment=None, description=None, devices=None, extra_bindings=None, min_juju_version=None, name=None, payload_classes=None, peers=None, provides=None, requires=None, resources=None, series=None, storage=None, subordinate=None, summary=None, tags=None, terms=None, **unknown_fields): ''' assumes_expr : ExpressionTree categories : typing.Sequence[str] + charm_user : str containers : typing.Mapping[str, ~CharmContainer] deployment : CharmDeployment description : str @@ -4640,6 +4815,7 @@ def __init__(self, assumes_expr=None, categories=None, containers=None, deployme ''' assumes_expr_ = ExpressionTree.from_json(assumes_expr) if assumes_expr else None categories_ = categories + charm_user_ = charm_user containers_ = {k: CharmContainer.from_json(v) for k, v in (containers or dict()).items()} deployment_ = CharmDeployment.from_json(deployment) if deployment else None description_ = description @@ -4666,6 +4842,9 @@ def __init__(self, assumes_expr=None, categories=None, containers=None, deployme if categories_ is not None and not isinstance(categories_, (bytes, str, list)): raise Exception("Expected categories_ to be a Sequence, received: {}".format(type(categories_))) + if charm_user_ is not None and not isinstance(charm_user_, (bytes, str)): + raise Exception("Expected charm_user_ to be a str, received: {}".format(type(charm_user_))) + if containers_ is not None and not isinstance(containers_, dict): raise Exception("Expected containers_ to be a Mapping, received: {}".format(type(containers_))) @@ -4722,6 +4901,7 @@ def __init__(self, assumes_expr=None, categories=None, containers=None, deployme self.assumes_expr = assumes_expr_ self.categories = categories_ + self.charm_user = charm_user_ self.containers = containers_ self.deployment = deployment_ self.description = description_ @@ -6254,9 +6434,9 @@ def __init__(self, clouds=None, **unknown_fields): class CommitHookChangesArg(Type): - _toSchema = {'add_storage': 'add-storage', 'close_ports': 'close-ports', 'open_ports': 'open-ports', 'pod_spec': 'pod-spec', 'relation_unit_settings': 'relation-unit-settings', 'secret_creates': 'secret-creates', 'secret_deletes': 'secret-deletes', 'secret_grants': 'secret-grants', 'secret_revokes': 'secret-revokes', 'secret_updates': 'secret-updates', 'set_raw_k8s_spec': 'set-raw-k8s-spec', 'tag': 'tag', 'unit_state': 'unit-state', 'update_network_info': 'update-network-info'} - _toPy = {'add-storage': 'add_storage', 'close-ports': 'close_ports', 'open-ports': 'open_ports', 'pod-spec': 'pod_spec', 'relation-unit-settings': 'relation_unit_settings', 'secret-creates': 'secret_creates', 'secret-deletes': 'secret_deletes', 'secret-grants': 'secret_grants', 'secret-revokes': 'secret_revokes', 'secret-updates': 'secret_updates', 'set-raw-k8s-spec': 'set_raw_k8s_spec', 'tag': 'tag', 'unit-state': 'unit_state', 'update-network-info': 'update_network_info'} - def __init__(self, add_storage=None, close_ports=None, open_ports=None, pod_spec=None, relation_unit_settings=None, secret_creates=None, secret_deletes=None, secret_grants=None, secret_revokes=None, secret_updates=None, set_raw_k8s_spec=None, tag=None, unit_state=None, update_network_info=None, **unknown_fields): + _toSchema = {'add_storage': 'add-storage', 'close_ports': 'close-ports', 'open_ports': 'open-ports', 'pod_spec': 'pod-spec', 'relation_unit_settings': 'relation-unit-settings', 'secret_creates': 'secret-creates', 'secret_deletes': 'secret-deletes', 'secret_grants': 'secret-grants', 'secret_revokes': 'secret-revokes', 'secret_track_latest': 'secret-track-latest', 'secret_updates': 'secret-updates', 'set_raw_k8s_spec': 'set-raw-k8s-spec', 'tag': 'tag', 'unit_state': 'unit-state', 'update_network_info': 'update-network-info'} + _toPy = {'add-storage': 'add_storage', 'close-ports': 'close_ports', 'open-ports': 'open_ports', 'pod-spec': 'pod_spec', 'relation-unit-settings': 'relation_unit_settings', 'secret-creates': 'secret_creates', 'secret-deletes': 'secret_deletes', 'secret-grants': 'secret_grants', 'secret-revokes': 'secret_revokes', 'secret-track-latest': 'secret_track_latest', 'secret-updates': 'secret_updates', 'set-raw-k8s-spec': 'set_raw_k8s_spec', 'tag': 'tag', 'unit-state': 'unit_state', 'update-network-info': 'update_network_info'} + def __init__(self, add_storage=None, close_ports=None, open_ports=None, pod_spec=None, relation_unit_settings=None, secret_creates=None, secret_deletes=None, secret_grants=None, secret_revokes=None, secret_track_latest=None, secret_updates=None, set_raw_k8s_spec=None, tag=None, unit_state=None, update_network_info=None, **unknown_fields): ''' add_storage : typing.Sequence[~StorageAddParams] close_ports : typing.Sequence[~EntityPortRange] @@ -6267,6 +6447,7 @@ def __init__(self, add_storage=None, close_ports=None, open_ports=None, pod_spec secret_deletes : typing.Sequence[~DeleteSecretArg] secret_grants : typing.Sequence[~GrantRevokeSecretArg] secret_revokes : typing.Sequence[~GrantRevokeSecretArg] + secret_track_latest : typing.Sequence[str] secret_updates : typing.Sequence[~UpdateSecretArg] set_raw_k8s_spec : PodSpec tag : str @@ -6282,6 +6463,7 @@ def __init__(self, add_storage=None, close_ports=None, open_ports=None, pod_spec secret_deletes_ = [DeleteSecretArg.from_json(o) for o in secret_deletes or []] secret_grants_ = [GrantRevokeSecretArg.from_json(o) for o in secret_grants or []] secret_revokes_ = [GrantRevokeSecretArg.from_json(o) for o in secret_revokes or []] + secret_track_latest_ = secret_track_latest secret_updates_ = [UpdateSecretArg.from_json(o) for o in secret_updates or []] set_raw_k8s_spec_ = PodSpec.from_json(set_raw_k8s_spec) if set_raw_k8s_spec else None tag_ = tag @@ -6316,6 +6498,9 @@ def __init__(self, add_storage=None, close_ports=None, open_ports=None, pod_spec if secret_revokes_ is not None and not isinstance(secret_revokes_, (bytes, str, list)): raise Exception("Expected secret_revokes_ to be a Sequence, received: {}".format(type(secret_revokes_))) + if secret_track_latest_ is not None and not isinstance(secret_track_latest_, (bytes, str, list)): + raise Exception("Expected secret_track_latest_ to be a Sequence, received: {}".format(type(secret_track_latest_))) + if secret_updates_ is not None and not isinstance(secret_updates_, (bytes, str, list)): raise Exception("Expected secret_updates_ to be a Sequence, received: {}".format(type(secret_updates_))) @@ -6340,6 +6525,7 @@ def __init__(self, add_storage=None, close_ports=None, open_ports=None, pod_spec self.secret_deletes = secret_deletes_ self.secret_grants = secret_grants_ self.secret_revokes = secret_revokes_ + self.secret_track_latest = secret_track_latest_ self.secret_updates = secret_updates_ self.set_raw_k8s_spec = set_raw_k8s_spec_ self.tag = tag_ @@ -6670,6 +6856,84 @@ def __init__(self, applicationofferdetails=None, application_alias=None, applica +class ConsumeApplicationArgV5(Type): + _toSchema = {'application_alias': 'application-alias', 'application_description': 'application-description', 'applicationofferdetailsv5': 'ApplicationOfferDetailsV5', 'endpoints': 'endpoints', 'external_controller': 'external-controller', 'macaroon': 'macaroon', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'offer_uuid': 'offer-uuid', 'source_model_tag': 'source-model-tag', 'users': 'users'} + _toPy = {'ApplicationOfferDetailsV5': 'applicationofferdetailsv5', 'application-alias': 'application_alias', 'application-description': 'application_description', 'endpoints': 'endpoints', 'external-controller': 'external_controller', 'macaroon': 'macaroon', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'offer-uuid': 'offer_uuid', 'source-model-tag': 'source_model_tag', 'users': 'users'} + def __init__(self, applicationofferdetailsv5=None, application_alias=None, application_description=None, endpoints=None, external_controller=None, macaroon=None, offer_name=None, offer_url=None, offer_uuid=None, source_model_tag=None, users=None, **unknown_fields): + ''' + applicationofferdetailsv5 : ApplicationOfferDetailsV5 + application_alias : str + application_description : str + endpoints : typing.Sequence[~RemoteEndpoint] + external_controller : ExternalControllerInfo + macaroon : Macaroon + offer_name : str + offer_url : str + offer_uuid : str + source_model_tag : str + users : typing.Sequence[~OfferUserDetails] + ''' + applicationofferdetailsv5_ = ApplicationOfferDetailsV5.from_json(applicationofferdetailsv5) if applicationofferdetailsv5 else None + application_alias_ = application_alias + application_description_ = application_description + endpoints_ = [RemoteEndpoint.from_json(o) for o in endpoints or []] + external_controller_ = ExternalControllerInfo.from_json(external_controller) if external_controller else None + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + offer_name_ = offer_name + offer_url_ = offer_url + offer_uuid_ = offer_uuid + source_model_tag_ = source_model_tag + users_ = [OfferUserDetails.from_json(o) for o in users or []] + + # Validate arguments against known Juju API types. + if applicationofferdetailsv5_ is not None and not isinstance(applicationofferdetailsv5_, (dict, ApplicationOfferDetailsV5)): + raise Exception("Expected applicationofferdetailsv5_ to be a ApplicationOfferDetailsV5, received: {}".format(type(applicationofferdetailsv5_))) + + if application_alias_ is not None and not isinstance(application_alias_, (bytes, str)): + raise Exception("Expected application_alias_ to be a str, received: {}".format(type(application_alias_))) + + if application_description_ is not None and not isinstance(application_description_, (bytes, str)): + raise Exception("Expected application_description_ to be a str, received: {}".format(type(application_description_))) + + if endpoints_ is not None and not isinstance(endpoints_, (bytes, str, list)): + raise Exception("Expected endpoints_ to be a Sequence, received: {}".format(type(endpoints_))) + + if external_controller_ is not None and not isinstance(external_controller_, (dict, ExternalControllerInfo)): + raise Exception("Expected external_controller_ to be a ExternalControllerInfo, received: {}".format(type(external_controller_))) + + if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + + if offer_name_ is not None and not isinstance(offer_name_, (bytes, str)): + raise Exception("Expected offer_name_ to be a str, received: {}".format(type(offer_name_))) + + if offer_url_ is not None and not isinstance(offer_url_, (bytes, str)): + raise Exception("Expected offer_url_ to be a str, received: {}".format(type(offer_url_))) + + if offer_uuid_ is not None and not isinstance(offer_uuid_, (bytes, str)): + raise Exception("Expected offer_uuid_ to be a str, received: {}".format(type(offer_uuid_))) + + if source_model_tag_ is not None and not isinstance(source_model_tag_, (bytes, str)): + raise Exception("Expected source_model_tag_ to be a str, received: {}".format(type(source_model_tag_))) + + if users_ is not None and not isinstance(users_, (bytes, str, list)): + raise Exception("Expected users_ to be a Sequence, received: {}".format(type(users_))) + + self.applicationofferdetailsv5 = applicationofferdetailsv5_ + self.application_alias = application_alias_ + self.application_description = application_description_ + self.endpoints = endpoints_ + self.external_controller = external_controller_ + self.macaroon = macaroon_ + self.offer_name = offer_name_ + self.offer_url = offer_url_ + self.offer_uuid = offer_uuid_ + self.source_model_tag = source_model_tag_ + self.users = users_ + self.unknown_fields = unknown_fields + + + class ConsumeApplicationArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} @@ -6688,6 +6952,24 @@ def __init__(self, args=None, **unknown_fields): +class ConsumeApplicationArgsV5(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~ConsumeApplicationArgV5] + ''' + args_ = [ConsumeApplicationArgV5.from_json(o) for o in args or []] + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, (bytes, str, list)): + raise Exception("Expected args_ to be a Sequence, received: {}".format(type(args_))) + + self.args = args_ + self.unknown_fields = unknown_fields + + + class ConsumeOfferDetails(Type): _toSchema = {'external_controller': 'external-controller', 'macaroon': 'macaroon', 'offer': 'offer'} _toPy = {'external-controller': 'external_controller', 'macaroon': 'macaroon', 'offer': 'offer'} @@ -6695,11 +6977,11 @@ def __init__(self, external_controller=None, macaroon=None, offer=None, **unknow ''' external_controller : ExternalControllerInfo macaroon : Macaroon - offer : ApplicationOfferDetails + offer : ApplicationOfferDetailsV5 ''' external_controller_ = ExternalControllerInfo.from_json(external_controller) if external_controller else None macaroon_ = Macaroon.from_json(macaroon) if macaroon else None - offer_ = ApplicationOfferDetails.from_json(offer) if offer else None + offer_ = ApplicationOfferDetailsV5.from_json(offer) if offer else None # Validate arguments against known Juju API types. if external_controller_ is not None and not isinstance(external_controller_, (dict, ExternalControllerInfo)): @@ -6708,8 +6990,8 @@ def __init__(self, external_controller=None, macaroon=None, offer=None, **unknow if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) - if offer_ is not None and not isinstance(offer_, (dict, ApplicationOfferDetails)): - raise Exception("Expected offer_ to be a ApplicationOfferDetails, received: {}".format(type(offer_))) + if offer_ is not None and not isinstance(offer_, (dict, ApplicationOfferDetailsV5)): + raise Exception("Expected offer_ to be a ApplicationOfferDetailsV5, received: {}".format(type(offer_))) self.external_controller = external_controller_ self.macaroon = macaroon_ @@ -6751,13 +7033,13 @@ def __init__(self, consumeofferdetails=None, error=None, external_controller=Non error : Error external_controller : ExternalControllerInfo macaroon : Macaroon - offer : ApplicationOfferDetails + offer : ApplicationOfferDetailsV5 ''' consumeofferdetails_ = ConsumeOfferDetails.from_json(consumeofferdetails) if consumeofferdetails else None error_ = Error.from_json(error) if error else None external_controller_ = ExternalControllerInfo.from_json(external_controller) if external_controller else None macaroon_ = Macaroon.from_json(macaroon) if macaroon else None - offer_ = ApplicationOfferDetails.from_json(offer) if offer else None + offer_ = ApplicationOfferDetailsV5.from_json(offer) if offer else None # Validate arguments against known Juju API types. if consumeofferdetails_ is not None and not isinstance(consumeofferdetails_, (dict, ConsumeOfferDetails)): @@ -6772,8 +7054,8 @@ def __init__(self, consumeofferdetails=None, error=None, external_controller=Non if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) - if offer_ is not None and not isinstance(offer_, (dict, ApplicationOfferDetails)): - raise Exception("Expected offer_ to be a ApplicationOfferDetails, received: {}".format(type(offer_))) + if offer_ is not None and not isinstance(offer_, (dict, ApplicationOfferDetailsV5)): + raise Exception("Expected offer_ to be a ApplicationOfferDetailsV5, received: {}".format(type(offer_))) self.consumeofferdetails = consumeofferdetails_ self.error = error_ @@ -10757,9 +11039,9 @@ def __init__(self, relations=None, **unknown_fields): class GetRemoteSecretContentArg(Type): - _toSchema = {'application_token': 'application-token', 'bakery_version': 'bakery-version', 'macaroons': 'macaroons', 'peek': 'peek', 'refresh': 'refresh', 'revision': 'revision', 'unit_id': 'unit-id', 'uri': 'uri'} - _toPy = {'application-token': 'application_token', 'bakery-version': 'bakery_version', 'macaroons': 'macaroons', 'peek': 'peek', 'refresh': 'refresh', 'revision': 'revision', 'unit-id': 'unit_id', 'uri': 'uri'} - def __init__(self, application_token=None, bakery_version=None, macaroons=None, peek=None, refresh=None, revision=None, unit_id=None, uri=None, **unknown_fields): + _toSchema = {'application_token': 'application-token', 'bakery_version': 'bakery-version', 'macaroons': 'macaroons', 'peek': 'peek', 'refresh': 'refresh', 'revision': 'revision', 'source_controller_uuid': 'source-controller-uuid', 'unit_id': 'unit-id', 'uri': 'uri'} + _toPy = {'application-token': 'application_token', 'bakery-version': 'bakery_version', 'macaroons': 'macaroons', 'peek': 'peek', 'refresh': 'refresh', 'revision': 'revision', 'source-controller-uuid': 'source_controller_uuid', 'unit-id': 'unit_id', 'uri': 'uri'} + def __init__(self, application_token=None, bakery_version=None, macaroons=None, peek=None, refresh=None, revision=None, source_controller_uuid=None, unit_id=None, uri=None, **unknown_fields): ''' application_token : str bakery_version : int @@ -10767,6 +11049,7 @@ def __init__(self, application_token=None, bakery_version=None, macaroons=None, peek : bool refresh : bool revision : int + source_controller_uuid : str unit_id : int uri : str ''' @@ -10776,6 +11059,7 @@ def __init__(self, application_token=None, bakery_version=None, macaroons=None, peek_ = peek refresh_ = refresh revision_ = revision + source_controller_uuid_ = source_controller_uuid unit_id_ = unit_id uri_ = uri @@ -10798,6 +11082,9 @@ def __init__(self, application_token=None, bakery_version=None, macaroons=None, if revision_ is not None and not isinstance(revision_, int): raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + if source_controller_uuid_ is not None and not isinstance(source_controller_uuid_, (bytes, str)): + raise Exception("Expected source_controller_uuid_ to be a str, received: {}".format(type(source_controller_uuid_))) + if unit_id_ is not None and not isinstance(unit_id_, int): raise Exception("Expected unit_id_ to be a int, received: {}".format(type(unit_id_))) @@ -10810,6 +11097,7 @@ def __init__(self, application_token=None, bakery_version=None, macaroons=None, self.peek = peek_ self.refresh = refresh_ self.revision = revision_ + self.source_controller_uuid = source_controller_uuid_ self.unit_id = unit_id_ self.uri = uri_ self.unknown_fields = unknown_fields @@ -13007,10 +13295,11 @@ def __init__(self, results=None, **unknown_fields): class ListSecretResult(Type): - _toSchema = {'create_time': 'create-time', 'description': 'description', 'label': 'label', 'latest_expire_time': 'latest-expire-time', 'latest_revision': 'latest-revision', 'next_rotate_time': 'next-rotate-time', 'owner_tag': 'owner-tag', 'revisions': 'revisions', 'rotate_policy': 'rotate-policy', 'update_time': 'update-time', 'uri': 'uri', 'value': 'value', 'version': 'version'} - _toPy = {'create-time': 'create_time', 'description': 'description', 'label': 'label', 'latest-expire-time': 'latest_expire_time', 'latest-revision': 'latest_revision', 'next-rotate-time': 'next_rotate_time', 'owner-tag': 'owner_tag', 'revisions': 'revisions', 'rotate-policy': 'rotate_policy', 'update-time': 'update_time', 'uri': 'uri', 'value': 'value', 'version': 'version'} - def __init__(self, create_time=None, description=None, label=None, latest_expire_time=None, latest_revision=None, next_rotate_time=None, owner_tag=None, revisions=None, rotate_policy=None, update_time=None, uri=None, value=None, version=None, **unknown_fields): + _toSchema = {'access': 'access', 'create_time': 'create-time', 'description': 'description', 'label': 'label', 'latest_expire_time': 'latest-expire-time', 'latest_revision': 'latest-revision', 'next_rotate_time': 'next-rotate-time', 'owner_tag': 'owner-tag', 'revisions': 'revisions', 'rotate_policy': 'rotate-policy', 'update_time': 'update-time', 'uri': 'uri', 'value': 'value', 'version': 'version'} + _toPy = {'access': 'access', 'create-time': 'create_time', 'description': 'description', 'label': 'label', 'latest-expire-time': 'latest_expire_time', 'latest-revision': 'latest_revision', 'next-rotate-time': 'next_rotate_time', 'owner-tag': 'owner_tag', 'revisions': 'revisions', 'rotate-policy': 'rotate_policy', 'update-time': 'update_time', 'uri': 'uri', 'value': 'value', 'version': 'version'} + def __init__(self, access=None, create_time=None, description=None, label=None, latest_expire_time=None, latest_revision=None, next_rotate_time=None, owner_tag=None, revisions=None, rotate_policy=None, update_time=None, uri=None, value=None, version=None, **unknown_fields): ''' + access : typing.Sequence[~AccessInfo] create_time : str description : str label : str @@ -13025,6 +13314,7 @@ def __init__(self, create_time=None, description=None, label=None, latest_expire value : SecretValueResult version : int ''' + access_ = [AccessInfo.from_json(o) for o in access or []] create_time_ = create_time description_ = description label_ = label @@ -13040,6 +13330,9 @@ def __init__(self, create_time=None, description=None, label=None, latest_expire version_ = version # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str, list)): + raise Exception("Expected access_ to be a Sequence, received: {}".format(type(access_))) + if create_time_ is not None and not isinstance(create_time_, (bytes, str)): raise Exception("Expected create_time_ to be a str, received: {}".format(type(create_time_))) @@ -13079,6 +13372,7 @@ def __init__(self, create_time=None, description=None, label=None, latest_expire if version_ is not None and not isinstance(version_, int): raise Exception("Expected version_ to be a int, received: {}".format(type(version_))) + self.access = access_ self.create_time = create_time_ self.description = description_ self.label = label_ @@ -14530,18 +14824,20 @@ def __init__(self, results=None, **unknown_fields): class MigrationModelInfo(Type): - _toSchema = {'agent_version': 'agent-version', 'controller_agent_version': 'controller-agent-version', 'name': 'name', 'owner_tag': 'owner-tag', 'uuid': 'uuid'} - _toPy = {'agent-version': 'agent_version', 'controller-agent-version': 'controller_agent_version', 'name': 'name', 'owner-tag': 'owner_tag', 'uuid': 'uuid'} - def __init__(self, agent_version=None, controller_agent_version=None, name=None, owner_tag=None, uuid=None, **unknown_fields): + _toSchema = {'agent_version': 'agent-version', 'controller_agent_version': 'controller-agent-version', 'facade_versions': 'facade-versions', 'name': 'name', 'owner_tag': 'owner-tag', 'uuid': 'uuid'} + _toPy = {'agent-version': 'agent_version', 'controller-agent-version': 'controller_agent_version', 'facade-versions': 'facade_versions', 'name': 'name', 'owner-tag': 'owner_tag', 'uuid': 'uuid'} + def __init__(self, agent_version=None, controller_agent_version=None, facade_versions=None, name=None, owner_tag=None, uuid=None, **unknown_fields): ''' agent_version : Number controller_agent_version : Number + facade_versions : typing.Mapping[str, typing.Sequence[int]] name : str owner_tag : str uuid : str ''' agent_version_ = Number.from_json(agent_version) if agent_version else None controller_agent_version_ = Number.from_json(controller_agent_version) if controller_agent_version else None + facade_versions_ = facade_versions name_ = name owner_tag_ = owner_tag uuid_ = uuid @@ -14553,6 +14849,9 @@ def __init__(self, agent_version=None, controller_agent_version=None, name=None, if controller_agent_version_ is not None and not isinstance(controller_agent_version_, (dict, Number)): raise Exception("Expected controller_agent_version_ to be a Number, received: {}".format(type(controller_agent_version_))) + if facade_versions_ is not None and not isinstance(facade_versions_, dict): + raise Exception("Expected facade_versions_ to be a Mapping, received: {}".format(type(facade_versions_))) + if name_ is not None and not isinstance(name_, (bytes, str)): raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) @@ -14564,6 +14863,7 @@ def __init__(self, agent_version=None, controller_agent_version=None, name=None, self.agent_version = agent_version_ self.controller_agent_version = controller_agent_version_ + self.facade_versions = facade_versions_ self.name = name_ self.owner_tag = owner_tag_ self.uuid = uuid_ @@ -18890,6 +19190,24 @@ def __init__(self, results=None, **unknown_fields): +class QueryApplicationOffersResultsV5(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ApplicationOfferAdminDetailsV5] + ''' + results_ = [ApplicationOfferAdminDetailsV5.from_json(o) for o in results or []] + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = unknown_fields + + + class RebootActionResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} @@ -19020,9 +19338,9 @@ def __init__(self, region_name=None, value=None, **unknown_fields): class RegisterRemoteRelationArg(Type): - _toSchema = {'application_token': 'application-token', 'bakery_version': 'bakery-version', 'consume_version': 'consume-version', 'local_endpoint_name': 'local-endpoint-name', 'macaroons': 'macaroons', 'offer_uuid': 'offer-uuid', 'relation_token': 'relation-token', 'remote_endpoint': 'remote-endpoint', 'remote_space': 'remote-space', 'source_model_tag': 'source-model-tag'} - _toPy = {'application-token': 'application_token', 'bakery-version': 'bakery_version', 'consume-version': 'consume_version', 'local-endpoint-name': 'local_endpoint_name', 'macaroons': 'macaroons', 'offer-uuid': 'offer_uuid', 'relation-token': 'relation_token', 'remote-endpoint': 'remote_endpoint', 'remote-space': 'remote_space', 'source-model-tag': 'source_model_tag'} - def __init__(self, application_token=None, bakery_version=None, consume_version=None, local_endpoint_name=None, macaroons=None, offer_uuid=None, relation_token=None, remote_endpoint=None, remote_space=None, source_model_tag=None, **unknown_fields): + _toSchema = {'application_token': 'application-token', 'bakery_version': 'bakery-version', 'consume_version': 'consume-version', 'local_endpoint_name': 'local-endpoint-name', 'macaroons': 'macaroons', 'offer_uuid': 'offer-uuid', 'relation_token': 'relation-token', 'remote_endpoint': 'remote-endpoint', 'source_model_tag': 'source-model-tag'} + _toPy = {'application-token': 'application_token', 'bakery-version': 'bakery_version', 'consume-version': 'consume_version', 'local-endpoint-name': 'local_endpoint_name', 'macaroons': 'macaroons', 'offer-uuid': 'offer_uuid', 'relation-token': 'relation_token', 'remote-endpoint': 'remote_endpoint', 'source-model-tag': 'source_model_tag'} + def __init__(self, application_token=None, bakery_version=None, consume_version=None, local_endpoint_name=None, macaroons=None, offer_uuid=None, relation_token=None, remote_endpoint=None, source_model_tag=None, **unknown_fields): ''' application_token : str bakery_version : int @@ -19032,7 +19350,6 @@ def __init__(self, application_token=None, bakery_version=None, consume_version= offer_uuid : str relation_token : str remote_endpoint : RemoteEndpoint - remote_space : RemoteSpace source_model_tag : str ''' application_token_ = application_token @@ -19043,7 +19360,6 @@ def __init__(self, application_token=None, bakery_version=None, consume_version= offer_uuid_ = offer_uuid relation_token_ = relation_token remote_endpoint_ = RemoteEndpoint.from_json(remote_endpoint) if remote_endpoint else None - remote_space_ = RemoteSpace.from_json(remote_space) if remote_space else None source_model_tag_ = source_model_tag # Validate arguments against known Juju API types. @@ -19071,9 +19387,6 @@ def __init__(self, application_token=None, bakery_version=None, consume_version= if remote_endpoint_ is not None and not isinstance(remote_endpoint_, (dict, RemoteEndpoint)): raise Exception("Expected remote_endpoint_ to be a RemoteEndpoint, received: {}".format(type(remote_endpoint_))) - if remote_space_ is not None and not isinstance(remote_space_, (dict, RemoteSpace)): - raise Exception("Expected remote_space_ to be a RemoteSpace, received: {}".format(type(remote_space_))) - if source_model_tag_ is not None and not isinstance(source_model_tag_, (bytes, str)): raise Exception("Expected source_model_tag_ to be a str, received: {}".format(type(source_model_tag_))) @@ -19085,7 +19398,6 @@ def __init__(self, application_token=None, bakery_version=None, consume_version= self.offer_uuid = offer_uuid_ self.relation_token = relation_token_ self.remote_endpoint = remote_endpoint_ - self.remote_space = remote_space_ self.source_model_tag = source_model_tag_ self.unknown_fields = unknown_fields diff --git a/juju/client/facade.py b/juju/client/facade.py index 8211ee5b..40b82d4c 100644 --- a/juju/client/facade.py +++ b/juju/client/facade.py @@ -636,10 +636,10 @@ class {name}Facade(Type): class TypeEncoder(json.JSONEncoder): - def default(self, obj): - if isinstance(obj, Type): - return obj.serialize() - return json.JSONEncoder.default(self, obj) + def default(self, o): + if isinstance(o, Type): + return o.serialize() + return json.JSONEncoder.default(self, o) class Type: diff --git a/juju/client/schemas-juju-3.5.2.json b/juju/client/schemas-juju-3.5.2.json new file mode 100644 index 00000000..125a074e --- /dev/null +++ b/juju/client/schemas-juju-3.5.2.json @@ -0,0 +1,53484 @@ +[ + { + "Name": "Action", + "Description": "APIv7 provides the Action API facade for version 7.", + "Version": 7, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Actions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionResults" + } + }, + "description": "Actions takes a list of ActionTags, and returns the full Action for\neach ID." + }, + "ApplicationsCharmsActions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationsCharmActionsResults" + } + }, + "description": "ApplicationsCharmsActions returns a slice of charm Actions for a slice of\nservices." + }, + "Cancel": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionResults" + } + }, + "description": "Cancel attempts to cancel enqueued Actions from running." + }, + "EnqueueOperation": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Actions" + }, + "Result": { + "$ref": "#/definitions/EnqueuedActions" + } + }, + "description": "EnqueueOperation takes a list of Actions and queues them up to be executed as\nan operation, each action running as a task on the designated ActionReceiver.\nWe return the ID of the overall operation and each individual task." + }, + "ListOperations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/OperationQueryArgs" + }, + "Result": { + "$ref": "#/definitions/OperationResults" + } + }, + "description": "ListOperations fetches the called actions for specified apps/units." + }, + "Operations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/OperationResults" + } + }, + "description": "Operations fetches the specified operation ids." + }, + "Run": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RunParams" + }, + "Result": { + "$ref": "#/definitions/EnqueuedActions" + } + }, + "description": "Run the commands specified on the machines identified through the\nlist of machines, units and services." + }, + "RunOnAllMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RunParams" + }, + "Result": { + "$ref": "#/definitions/EnqueuedActions" + } + }, + "description": "RunOnAllMachines attempts to run the specified command on all the machines." + }, + "WatchActionsProgress": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchActionsProgress creates a watcher that reports on action log messages." + } + }, + "definitions": { + "Action": { + "type": "object", + "properties": { + "execution-group": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parallel": { + "type": "boolean" + }, + "parameters": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "receiver": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "receiver", + "name" + ] + }, + "ActionMessage": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "required": [ + "timestamp", + "message" + ] + }, + "ActionResult": { + "type": "object", + "properties": { + "action": { + "$ref": "#/definitions/Action" + }, + "completed": { + "type": "string", + "format": "date-time" + }, + "enqueued": { + "type": "string", + "format": "date-time" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "log": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionMessage" + } + }, + "message": { + "type": "string" + }, + "output": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "started": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ActionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionResult" + } + } + }, + "additionalProperties": false + }, + "ActionSpec": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "description", + "params" + ] + }, + "Actions": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/Action" + } + } + }, + "additionalProperties": false + }, + "ApplicationCharmActionsResult": { + "type": "object", + "properties": { + "actions": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ActionSpec" + } + } + }, + "application-tag": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ApplicationsCharmActionsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationCharmActionsResult" + } + } + }, + "additionalProperties": false + }, + "EnqueuedActions": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionResult" + } + }, + "operation": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "operation" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "OperationQueryArgs": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "type": "string" + } + }, + "applications": { + "type": "array", + "items": { + "type": "string" + } + }, + "limit": { + "type": "integer" + }, + "machines": { + "type": "array", + "items": { + "type": "string" + } + }, + "offset": { + "type": "integer" + }, + "status": { + "type": "array", + "items": { + "type": "string" + } + }, + "units": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "OperationResult": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionResult" + } + }, + "completed": { + "type": "string", + "format": "date-time" + }, + "enqueued": { + "type": "string", + "format": "date-time" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "fail": { + "type": "string" + }, + "operation": { + "type": "string" + }, + "started": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + }, + "summary": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "operation", + "summary" + ] + }, + "OperationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/OperationResult" + } + }, + "truncated": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "RunParams": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "type": "string" + } + }, + "commands": { + "type": "string" + }, + "execution-group": { + "type": "string" + }, + "machines": { + "type": "array", + "items": { + "type": "string" + } + }, + "parallel": { + "type": "boolean" + }, + "timeout": { + "type": "integer" + }, + "units": { + "type": "array", + "items": { + "type": "string" + } + }, + "workload-context": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "commands", + "timeout" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "ActionPruner", + "Description": "API provides access to the action pruner API.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + }, + "description": "ModelConfig returns the current model's configuration." + }, + "Prune": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ActionPruneArgs" + } + }, + "description": "Prune endpoint removes action entries until\nonly the ones newer than now - p.MaxHistoryTime remain and\nthe history is smaller than p.MaxHistoryMB." + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchForModelConfigChanges returns a NotifyWatcher that observes\nchanges to the model configuration.\nNote that although the NotifyWatchResult contains an Error field,\nit's not used because we are only returning a single watcher,\nso we use the regular error return." + } + }, + "definitions": { + "ActionPruneArgs": { + "type": "object", + "properties": { + "max-history-mb": { + "type": "integer" + }, + "max-history-time": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "max-history-time", + "max-history-mb" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + } + } + } + }, + { + "Name": "Admin", + "Description": "admin is the only object that unlogged-in clients can access. It holds any\nmethods that are needed to log in.", + "Version": 3, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "controller-user", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Login": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/LoginRequest" + }, + "Result": { + "$ref": "#/definitions/LoginResult" + } + }, + "description": "Login logs in with the provided credentials. All subsequent requests on the\nconnection will act as the authenticated user." + }, + "RedirectInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/RedirectInfoResult" + } + }, + "description": "RedirectInfo returns redirected host information for the model.\nIn Juju it always returns an error because the Juju controller\ndoes not multiplex controllers." + } + }, + "definitions": { + "Address": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "AuthUserInfo": { + "type": "object", + "properties": { + "controller-access": { + "type": "string" + }, + "credentials": { + "type": "string" + }, + "display-name": { + "type": "string" + }, + "identity": { + "type": "string" + }, + "last-connection": { + "type": "string", + "format": "date-time" + }, + "model-access": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "display-name", + "identity", + "controller-access", + "model-access" + ] + }, + "FacadeVersions": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "versions": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "name", + "versions" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "port": { + "type": "integer" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope", + "Address", + "port" + ] + }, + "LoginRequest": { + "type": "object", + "properties": { + "auth-tag": { + "type": "string" + }, + "bakery-version": { + "type": "integer" + }, + "cli-args": { + "type": "string" + }, + "client-version": { + "type": "string" + }, + "credentials": { + "type": "string" + }, + "macaroons": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + } + }, + "nonce": { + "type": "string" + }, + "token": { + "type": "string" + }, + "user-data": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "auth-tag", + "credentials", + "nonce", + "macaroons", + "user-data" + ] + }, + "LoginResult": { + "type": "object", + "properties": { + "bakery-discharge-required": { + "$ref": "#/definitions/Macaroon" + }, + "controller-tag": { + "type": "string" + }, + "discharge-required": { + "$ref": "#/definitions/Macaroon" + }, + "discharge-required-error": { + "type": "string" + }, + "facades": { + "type": "array", + "items": { + "$ref": "#/definitions/FacadeVersions" + } + }, + "model-tag": { + "type": "string" + }, + "public-dns-name": { + "type": "string" + }, + "server-version": { + "type": "string" + }, + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + }, + "user-info": { + "$ref": "#/definitions/AuthUserInfo" + } + }, + "additionalProperties": false + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "RedirectInfoResult": { + "type": "object", + "properties": { + "ca-cert": { + "type": "string" + }, + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers", + "ca-cert" + ] + } + } + } + }, + { + "Name": "Agent", + "Description": "AgentAPI implements the version 3 of the API provided to an agent.", + "Version": 3, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent" + ], + "Schema": { + "type": "object", + "properties": { + "ClearReboot": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ClearReboot will clear the reboot flag on provided machines, if it exists." + }, + "CloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResults" + } + }, + "description": "CloudSpec returns the model's cloud spec." + }, + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + }, + "description": "ControllerAPIInfoForModels returns the controller api connection details for the specified models." + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + }, + "description": "ControllerConfig returns the controller's configuration." + }, + "GetCloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelTag" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResult" + } + }, + "description": "GetCloudSpec constructs the CloudSpec for a validated and authorized model." + }, + "GetEntities": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/AgentGetEntitiesResults" + } + } + }, + "IsMaster": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/IsMasterResult" + } + } + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + }, + "description": "ModelConfig returns the current model's configuration." + }, + "SetPasswords": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityPasswords" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetPasswords sets the given password for each supplied entity, if possible." + }, + "StateServingInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StateServingInfo" + } + } + }, + "WatchCloudSpecsChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchCloudSpecsChanges returns a watcher for cloud spec changes." + }, + "WatchCredentials": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchCredentials watches for changes to the specified credentials." + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchForModelConfigChanges returns a NotifyWatcher that observes\nchanges to the model configuration.\nNote that although the NotifyWatchResult contains an Error field,\nit's not used because we are only returning a single watcher,\nso we use the regular error return." + } + }, + "definitions": { + "AgentGetEntitiesResult": { + "type": "object", + "properties": { + "container-type": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "jobs": { + "type": "array", + "items": { + "type": "string" + } + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life", + "jobs", + "container-type" + ] + }, + "AgentGetEntitiesResults": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/AgentGetEntitiesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudSpec": { + "type": "object", + "properties": { + "cacertificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "is-controller-cloud": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "skip-tls-verify": { + "type": "boolean" + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "name" + ] + }, + "CloudSpecResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudSpec" + } + }, + "additionalProperties": false + }, + "CloudSpecResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "additionalProperties": false + }, + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityPassword": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "password" + ] + }, + "EntityPasswords": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPassword" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "IsMasterResult": { + "type": "object", + "properties": { + "master": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "master" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelTag": { + "type": "object", + "additionalProperties": false + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StateServingInfo": { + "type": "object", + "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" + } + }, + "additionalProperties": false, + "required": [ + "api-port", + "state-port", + "cert", + "private-key", + "ca-private-key", + "shared-secret", + "system-identity" + ] + } + } + } + }, + { + "Name": "AgentLifeFlag", + "Description": "", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "Watch starts an NotifyWatcher for each given entity." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "AgentTools", + "Description": "AgentToolsAPI implements the API used by the machine model worker.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "UpdateToolsAvailable": { + "type": "object", + "description": "UpdateToolsAvailable invokes a lookup and further update in environ\nfor new patches of the current tool versions." + } + } + } + }, + { + "Name": "AllModelWatcher", + "Description": "SrvAllWatcher defines the API methods on a state.Multiwatcher.\nwhich watches any changes to the state. Each client has its own\ncurrent set of watchers, stored in resources. It is used by both\nthe AllWatcher and AllModelWatcher facades.", + "Version": 4, + "AvailableTo": [ + "controller-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/AllWatcherNextResults" + } + }, + "description": "Next will return the current state of everything on the first call\nand subsequent calls will" + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "AllWatcherNextResults": { + "type": "object", + "properties": { + "deltas": { + "type": "array", + "items": { + "$ref": "#/definitions/Delta" + } + } + }, + "additionalProperties": false, + "required": [ + "deltas" + ] + }, + "Delta": { + "type": "object", + "properties": { + "entity": { + "type": "object", + "additionalProperties": true + }, + "removed": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "removed", + "entity" + ] + } + } + } + }, + { + "Name": "AllWatcher", + "Description": "SrvAllWatcher defines the API methods on a state.Multiwatcher.\nwhich watches any changes to the state. Each client has its own\ncurrent set of watchers, stored in resources. It is used by both\nthe AllWatcher and AllModelWatcher facades.", + "Version": 3, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/AllWatcherNextResults" + } + }, + "description": "Next will return the current state of everything on the first call\nand subsequent calls will" + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "AllWatcherNextResults": { + "type": "object", + "properties": { + "deltas": { + "type": "array", + "items": { + "$ref": "#/definitions/Delta" + } + } + }, + "additionalProperties": false, + "required": [ + "deltas" + ] + }, + "Delta": { + "type": "object", + "properties": { + "entity": { + "type": "object", + "additionalProperties": true + }, + "removed": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "removed", + "entity" + ] + } + } + } + }, + { + "Name": "Annotations", + "Description": "API implements the service interface and is the concrete\nimplementation of the api end point.", + "Version": 2, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Get": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/AnnotationsGetResults" + } + }, + "description": "Get returns annotations for given entities.\nIf annotations cannot be retrieved for a given entity, an error is returned.\nEach entity is treated independently and, hence, will fail or succeed independently." + }, + "Set": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AnnotationsSet" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Set stores annotations for given entities" + } + }, + "definitions": { + "AnnotationsGetResult": { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "entity": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/ErrorResult" + } + }, + "additionalProperties": false, + "required": [ + "entity", + "annotations" + ] + }, + "AnnotationsGetResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/AnnotationsGetResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "AnnotationsSet": { + "type": "object", + "properties": { + "annotations": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityAnnotations" + } + } + }, + "additionalProperties": false, + "required": [ + "annotations" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityAnnotations": { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "entity": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entity", + "annotations" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "Application", + "Description": "APIv20 provides the Application API facade for version 20.", + "Version": 20, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AddRelation": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddRelation" + }, + "Result": { + "$ref": "#/definitions/AddRelationResults" + } + }, + "description": "AddRelation adds a relation between the specified endpoints and returns the relation info." + }, + "AddUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddApplicationUnits" + }, + "Result": { + "$ref": "#/definitions/AddApplicationUnitsResults" + } + }, + "description": "AddUnits adds a given number of units to an application." + }, + "ApplicationsInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationInfoResults" + } + }, + "description": "ApplicationsInfo returns applications information." + }, + "CharmConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationGetArgs" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetConfigResults" + } + }, + "description": "CharmConfig returns charm config for the input list of applications and\nmodel generations." + }, + "CharmRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationCharmRelations" + }, + "Result": { + "$ref": "#/definitions/ApplicationCharmRelationsResults" + } + }, + "description": "CharmRelations implements the server side of Application.CharmRelations." + }, + "Consume": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ConsumeApplicationArgsV5" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Consume adds remote applications to the model without creating any\nrelations." + }, + "Deploy": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationsDeploy" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Deploy fetches the charms from the charm store and deploys them\nusing the specified placement directives." + }, + "DeployFromRepository": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DeployFromRepositoryArgs" + }, + "Result": { + "$ref": "#/definitions/DeployFromRepositoryResults" + } + }, + "description": "DeployFromRepository is a one-stop deployment method for repository\ncharms. Only a charm name is required to deploy. If argument validation\nfails, a list of all errors found in validation will be returned. If a\nlocal resource is provided, details required for uploading the validated\nresource will be returned." + }, + "DestroyApplication": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyApplicationsParams" + }, + "Result": { + "$ref": "#/definitions/DestroyApplicationResults" + } + }, + "description": "DestroyApplication removes a given set of applications." + }, + "DestroyConsumedApplications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyConsumedApplicationsParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "DestroyConsumedApplications removes a given set of consumed (remote) applications." + }, + "DestroyRelation": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyRelation" + } + }, + "description": "DestroyRelation removes the relation between the\nspecified endpoints or an id." + }, + "DestroyUnit": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyUnitsParams" + }, + "Result": { + "$ref": "#/definitions/DestroyUnitResults" + } + }, + "description": "DestroyUnit removes a given set of application units." + }, + "Expose": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationExpose" + } + }, + "description": "Expose changes the juju-managed firewall to expose any ports that\nwere also explicitly marked by units as open." + }, + "Get": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationGet" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetResults" + } + }, + "description": "Get returns the charm configuration for an application." + }, + "GetCharmURLOrigin": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationGet" + }, + "Result": { + "$ref": "#/definitions/CharmURLOriginResult" + } + }, + "description": "GetCharmURLOrigin returns the charm URL and charm origin the given\napplication is running at present." + }, + "GetConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetConfigResults" + } + }, + "description": "GetConfig returns the charm config for each of the input applications." + }, + "GetConstraints": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetConstraintsResults" + } + }, + "description": "GetConstraints returns the constraints for a given application." + }, + "Leader": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "Leader returns the unit name of the leader for the given application." + }, + "MergeBindings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationMergeBindingsArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "MergeBindings merges operator-defined bindings with the current bindings for\none or more applications." + }, + "ResolveUnitErrors": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UnitsResolved" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ResolveUnitErrors marks errors on the specified units as resolved." + }, + "ScaleApplications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ScaleApplicationsParams" + }, + "Result": { + "$ref": "#/definitions/ScaleApplicationResults" + } + }, + "description": "ScaleApplications scales the specified application to the requested number of units." + }, + "SetCharm": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationSetCharm" + } + }, + "description": "SetCharm sets the charm for a given for the application." + }, + "SetConfigs": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ConfigSetArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetConfigs implements the server side of Application.SetConfig. Both\napplication and charm config are set. It does not unset values in\nConfig map that are set to an empty string. Unset should be used for that." + }, + "SetConstraints": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetConstraints" + } + }, + "description": "SetConstraints sets the constraints for a given application." + }, + "SetMetricCredentials": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationMetricCredentials" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetMetricCredentials sets credentials on the application.\nTODO (cderici) only used for metered charms in cmd MeteredDeployAPI,\nkept for client compatibility, remove in juju 4.0" + }, + "SetRelationsSuspended": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationSuspendedArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetRelationsSuspended sets the suspended status of the specified relations." + }, + "Unexpose": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationUnexpose" + } + }, + "description": "Unexpose changes the juju-managed firewall to unexpose any ports that\nwere also explicitly marked by units as open." + }, + "UnitsInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UnitInfoResults" + } + }, + "description": "UnitsInfo returns unit information for the given entities (units or\napplications)." + }, + "UnsetApplicationsConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationConfigUnsetArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig." + }, + "UpdateApplicationBase": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateChannelArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdateApplicationBase updates the application base.\nBase for subordinates is updated too." + } + }, + "definitions": { + "AddApplicationUnits": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "attach-storage": { + "type": "array", + "items": { + "type": "string" + } + }, + "num-units": { + "type": "integer" + }, + "placement": { + "type": "array", + "items": { + "$ref": "#/definitions/Placement" + } + }, + "policy": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "num-units", + "placement" + ] + }, + "AddApplicationUnitsResults": { + "type": "object", + "properties": { + "units": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "units" + ] + }, + "AddRelation": { + "type": "object", + "properties": { + "endpoints": { + "type": "array", + "items": { + "type": "string" + } + }, + "via-cidrs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "endpoints" + ] + }, + "AddRelationResults": { + "type": "object", + "properties": { + "endpoints": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + } + }, + "additionalProperties": false, + "required": [ + "endpoints" + ] + }, + "ApplicationCharmRelations": { + "type": "object", + "properties": { + "application": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application" + ] + }, + "ApplicationCharmRelationsResults": { + "type": "object", + "properties": { + "charm-relations": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "charm-relations" + ] + }, + "ApplicationConfigUnsetArgs": { + "type": "object", + "properties": { + "Args": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationUnset" + } + } + }, + "additionalProperties": false, + "required": [ + "Args" + ] + }, + "ApplicationConstraint": { + "type": "object", + "properties": { + "constraints": { + "$ref": "#/definitions/Value" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "constraints" + ] + }, + "ApplicationDeploy": { + "type": "object", + "properties": { + "Force": { + "type": "boolean" + }, + "application": { + "type": "string" + }, + "attach-storage": { + "type": "array", + "items": { + "type": "string" + } + }, + "channel": { + "type": "string" + }, + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "charm-url": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "config-yaml": { + "type": "string" + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/Constraints" + } + } + }, + "endpoint-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "num-units": { + "type": "integer" + }, + "placement": { + "type": "array", + "items": { + "$ref": "#/definitions/Placement" + } + }, + "policy": { + "type": "string" + }, + "resources": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "storage": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/Constraints" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "charm-url", + "channel", + "num-units", + "config-yaml", + "constraints", + "Force" + ] + }, + "ApplicationExpose": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "exposed-endpoints": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ExposedEndpoint" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application" + ] + }, + "ApplicationGet": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "branch": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "branch" + ] + }, + "ApplicationGetArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationGet" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "ApplicationGetConfigResults": { + "type": "object", + "properties": { + "Results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigResult" + } + } + }, + "additionalProperties": false, + "required": [ + "Results" + ] + }, + "ApplicationGetConstraintsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationConstraint" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ApplicationGetResults": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "application-config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "base": { + "$ref": "#/definitions/Base" + }, + "channel": { + "type": "string" + }, + "charm": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "endpoint-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "charm", + "config", + "constraints", + "base", + "channel" + ] + }, + "ApplicationInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ApplicationResult" + } + }, + "additionalProperties": false + }, + "ApplicationInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ApplicationMergeBindings": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + }, + "bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "force": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "application-tag", + "bindings", + "force" + ] + }, + "ApplicationMergeBindingsArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationMergeBindings" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "ApplicationMetricCredential": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "metrics-credentials": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "metrics-credentials" + ] + }, + "ApplicationMetricCredentials": { + "type": "object", + "properties": { + "creds": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationMetricCredential" + } + } + }, + "additionalProperties": false, + "required": [ + "creds" + ] + }, + "ApplicationOfferDetailsV5": { + "type": "object", + "properties": { + "application-description": { + "type": "string" + }, + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEndpoint" + } + }, + "offer-name": { + "type": "string" + }, + "offer-url": { + "type": "string" + }, + "offer-uuid": { + "type": "string" + }, + "source-model-tag": { + "type": "string" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferUserDetails" + } + } + }, + "additionalProperties": false, + "required": [ + "source-model-tag", + "offer-uuid", + "offer-url", + "offer-name", + "application-description" + ] + }, + "ApplicationResult": { + "type": "object", + "properties": { + "base": { + "$ref": "#/definitions/Base" + }, + "channel": { + "type": "string" + }, + "charm": { + "type": "string" + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "endpoint-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "exposed": { + "type": "boolean" + }, + "exposed-endpoints": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ExposedEndpoint" + } + } + }, + "life": { + "type": "string" + }, + "principal": { + "type": "boolean" + }, + "remote": { + "type": "boolean" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "principal", + "exposed", + "remote", + "life" + ] + }, + "ApplicationSetCharm": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "channel": { + "type": "string" + }, + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "charm-url": { + "type": "string" + }, + "config-settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "config-settings-yaml": { + "type": "string" + }, + "endpoint-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "force": { + "type": "boolean" + }, + "force-base": { + "type": "boolean" + }, + "force-units": { + "type": "boolean" + }, + "generation": { + "type": "string" + }, + "resource-ids": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "storage-constraints": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/StorageConstraints" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "generation", + "charm-url", + "channel", + "force", + "force-units", + "force-base" + ] + }, + "ApplicationUnexpose": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "exposed-endpoints": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "exposed-endpoints" + ] + }, + "ApplicationUnset": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "options": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "branch", + "options" + ] + }, + "ApplicationsDeploy": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationDeploy" + } + } + }, + "additionalProperties": false, + "required": [ + "applications" + ] + }, + "Base": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "channel" + ] + }, + "CharmOrigin": { + "type": "object", + "properties": { + "architecture": { + "type": "string" + }, + "base": { + "$ref": "#/definitions/Base" + }, + "branch": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "id": { + "type": "string" + }, + "instance-key": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "risk": { + "type": "string" + }, + "source": { + "type": "string" + }, + "track": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "source", + "type", + "id" + ] + }, + "CharmRelation": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "optional", + "limit", + "scope" + ] + }, + "CharmURLOriginResult": { + "type": "object", + "properties": { + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "charm-origin" + ] + }, + "ConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ConfigSet": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "config-yaml": { + "type": "string" + }, + "generation": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "generation", + "config", + "config-yaml" + ] + }, + "ConfigSetArgs": { + "type": "object", + "properties": { + "Args": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigSet" + } + } + }, + "additionalProperties": false, + "required": [ + "Args" + ] + }, + "Constraints": { + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Pool": { + "type": "string" + }, + "Size": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Pool", + "Size", + "Count" + ] + }, + "ConsumeApplicationArgV5": { + "type": "object", + "properties": { + "ApplicationOfferDetailsV5": { + "$ref": "#/definitions/ApplicationOfferDetailsV5" + }, + "application-alias": { + "type": "string" + }, + "application-description": { + "type": "string" + }, + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEndpoint" + } + }, + "external-controller": { + "$ref": "#/definitions/ExternalControllerInfo" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "offer-name": { + "type": "string" + }, + "offer-url": { + "type": "string" + }, + "offer-uuid": { + "type": "string" + }, + "source-model-tag": { + "type": "string" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferUserDetails" + } + } + }, + "additionalProperties": false, + "required": [ + "source-model-tag", + "offer-uuid", + "offer-url", + "offer-name", + "application-description", + "ApplicationOfferDetailsV5" + ] + }, + "ConsumeApplicationArgsV5": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/ConsumeApplicationArgV5" + } + } + }, + "additionalProperties": false + }, + "DeployFromRepositoryArg": { + "type": "object", + "properties": { + "ApplicationName": { + "type": "string" + }, + "AttachStorage": { + "type": "array", + "items": { + "type": "string" + } + }, + "CharmName": { + "type": "string" + }, + "ConfigYAML": { + "type": "string" + }, + "Cons": { + "$ref": "#/definitions/Value" + }, + "Devices": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/Constraints" + } + } + }, + "DryRun": { + "type": "boolean" + }, + "Placement": { + "type": "array", + "items": { + "$ref": "#/definitions/Placement" + } + }, + "Storage": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/Constraints" + } + } + }, + "Trust": { + "type": "boolean" + }, + "base": { + "$ref": "#/definitions/Base" + }, + "channel": { + "type": "string" + }, + "endpoint-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "force": { + "type": "boolean" + }, + "num-units": { + "type": "integer" + }, + "resources": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "revision": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "CharmName", + "ApplicationName", + "AttachStorage", + "ConfigYAML", + "Cons", + "Devices", + "DryRun", + "Placement", + "Storage", + "Trust" + ] + }, + "DeployFromRepositoryArgs": { + "type": "object", + "properties": { + "Args": { + "type": "array", + "items": { + "$ref": "#/definitions/DeployFromRepositoryArg" + } + } + }, + "additionalProperties": false, + "required": [ + "Args" + ] + }, + "DeployFromRepositoryInfo": { + "type": "object", + "properties": { + "architecture": { + "type": "string" + }, + "base": { + "$ref": "#/definitions/Base" + }, + "channel": { + "type": "string" + }, + "effective-channel": { + "type": "string" + }, + "name": { + "type": "string" + }, + "revision": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "architecture", + "channel", + "name", + "revision" + ] + }, + "DeployFromRepositoryResult": { + "type": "object", + "properties": { + "Errors": { + "type": "array", + "items": { + "$ref": "#/definitions/Error" + } + }, + "Info": { + "$ref": "#/definitions/DeployFromRepositoryInfo" + }, + "PendingResourceUploads": { + "type": "array", + "items": { + "$ref": "#/definitions/PendingResourceUpload" + } + } + }, + "additionalProperties": false, + "required": [ + "Errors", + "Info", + "PendingResourceUploads" + ] + }, + "DeployFromRepositoryResults": { + "type": "object", + "properties": { + "Results": { + "type": "array", + "items": { + "$ref": "#/definitions/DeployFromRepositoryResult" + } + } + }, + "additionalProperties": false, + "required": [ + "Results" + ] + }, + "DestroyApplicationInfo": { + "type": "object", + "properties": { + "destroyed-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "destroyed-units": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "detached-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false + }, + "DestroyApplicationParams": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + }, + "destroy-storage": { + "type": "boolean" + }, + "dry-run": { + "type": "boolean" + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "application-tag", + "force" + ] + }, + "DestroyApplicationResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "$ref": "#/definitions/DestroyApplicationInfo" + } + }, + "additionalProperties": false + }, + "DestroyApplicationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyApplicationResult" + } + } + }, + "additionalProperties": false + }, + "DestroyApplicationsParams": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyApplicationParams" + } + } + }, + "additionalProperties": false, + "required": [ + "applications" + ] + }, + "DestroyConsumedApplicationParams": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "application-tag" + ] + }, + "DestroyConsumedApplicationsParams": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyConsumedApplicationParams" + } + } + }, + "additionalProperties": false, + "required": [ + "applications" + ] + }, + "DestroyRelation": { + "type": "object", + "properties": { + "endpoints": { + "type": "array", + "items": { + "type": "string" + } + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + }, + "relation-id": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "relation-id" + ] + }, + "DestroyUnitInfo": { + "type": "object", + "properties": { + "destroyed-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "detached-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false + }, + "DestroyUnitParams": { + "type": "object", + "properties": { + "destroy-storage": { + "type": "boolean" + }, + "dry-run": { + "type": "boolean" + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit-tag" + ] + }, + "DestroyUnitResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "$ref": "#/definitions/DestroyUnitInfo" + } + }, + "additionalProperties": false + }, + "DestroyUnitResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyUnitResult" + } + } + }, + "additionalProperties": false + }, + "DestroyUnitsParams": { + "type": "object", + "properties": { + "units": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyUnitParams" + } + } + }, + "additionalProperties": false, + "required": [ + "units" + ] + }, + "EndpointRelationData": { + "type": "object", + "properties": { + "ApplicationData": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "cross-model": { + "type": "boolean" + }, + "endpoint": { + "type": "string" + }, + "related-endpoint": { + "type": "string" + }, + "relation-id": { + "type": "integer" + }, + "unit-relation-data": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/RelationData" + } + } + } + }, + "additionalProperties": false, + "required": [ + "relation-id", + "endpoint", + "cross-model", + "related-endpoint", + "ApplicationData", + "unit-relation-data" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ExposedEndpoint": { + "type": "object", + "properties": { + "expose-to-cidrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "expose-to-spaces": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "ExternalControllerInfo": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "ca-cert": { + "type": "string" + }, + "controller-alias": { + "type": "string" + }, + "controller-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "controller-tag", + "controller-alias", + "addrs", + "ca-cert" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "OfferUserDetails": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "display-name": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user", + "display-name", + "access" + ] + }, + "PendingResourceUpload": { + "type": "object", + "properties": { + "Filename": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Name", + "Filename", + "Type" + ] + }, + "Placement": { + "type": "object", + "properties": { + "directive": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "scope", + "directive" + ] + }, + "RelationData": { + "type": "object", + "properties": { + "InScope": { + "type": "boolean" + }, + "UnitData": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "InScope", + "UnitData" + ] + }, + "RelationSuspendedArg": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "relation-id": { + "type": "integer" + }, + "suspended": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "relation-id", + "message", + "suspended" + ] + }, + "RelationSuspendedArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationSuspendedArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "RemoteEndpoint": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "limit" + ] + }, + "ScaleApplicationInfo": { + "type": "object", + "properties": { + "num-units": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "num-units" + ] + }, + "ScaleApplicationParams": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "scale": { + "type": "integer" + }, + "scale-change": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "application-tag", + "scale", + "force" + ] + }, + "ScaleApplicationResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "$ref": "#/definitions/ScaleApplicationInfo" + } + }, + "additionalProperties": false + }, + "ScaleApplicationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ScaleApplicationResult" + } + } + }, + "additionalProperties": false + }, + "ScaleApplicationsParams": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "$ref": "#/definitions/ScaleApplicationParams" + } + } + }, + "additionalProperties": false, + "required": [ + "applications" + ] + }, + "SetConstraints": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "constraints": { + "$ref": "#/definitions/Value" + } + }, + "additionalProperties": false, + "required": [ + "application", + "constraints" + ] + }, + "StorageConstraints": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "UnitInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/UnitResult" + } + }, + "additionalProperties": false + }, + "UnitInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UnitInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UnitResult": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "charm": { + "type": "string" + }, + "leader": { + "type": "boolean" + }, + "life": { + "type": "string" + }, + "machine": { + "type": "string" + }, + "opened-ports": { + "type": "array", + "items": { + "type": "string" + } + }, + "provider-id": { + "type": "string" + }, + "public-address": { + "type": "string" + }, + "relation-data": { + "type": "array", + "items": { + "$ref": "#/definitions/EndpointRelationData" + } + }, + "tag": { + "type": "string" + }, + "workload-version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "workload-version", + "opened-ports", + "charm" + ] + }, + "UnitsResolved": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + }, + "retry": { + "type": "boolean" + }, + "tags": { + "$ref": "#/definitions/Entities" + } + }, + "additionalProperties": false + }, + "UpdateChannelArg": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "tag": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force", + "channel" + ] + }, + "UpdateChannelArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateChannelArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "Value": { + "type": "object", + "properties": { + "allocate-public-ip": { + "type": "boolean" + }, + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "image-id": { + "type": "string" + }, + "instance-role": { + "type": "string" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "ApplicationOffers", + "Description": "OffersAPIv5 implements the cross model interface and is the concrete\nimplementation of the api end point.", + "Version": 5, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "controller-user" + ], + "Schema": { + "type": "object", + "properties": { + "ApplicationOffers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/OfferURLs" + }, + "Result": { + "$ref": "#/definitions/ApplicationOffersResults" + } + }, + "description": "ApplicationOffers gets details about remote applications that match given URLs." + }, + "DestroyOffers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyApplicationOffers" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "DestroyOffers removes the offers specified by the given URLs, forcing if necessary." + }, + "FindApplicationOffers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/OfferFilters" + }, + "Result": { + "$ref": "#/definitions/QueryApplicationOffersResultsV5" + } + }, + "description": "FindApplicationOffers gets details about remote applications that match given filter." + }, + "GetConsumeDetails": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ConsumeOfferDetailsArg" + }, + "Result": { + "$ref": "#/definitions/ConsumeOfferDetailsResults" + } + }, + "description": "GetConsumeDetails returns the details necessary to pass to another model\nto allow the specified args user to consume the offers represented by the args URLs." + }, + "ListApplicationOffers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/OfferFilters" + }, + "Result": { + "$ref": "#/definitions/QueryApplicationOffersResultsV5" + } + }, + "description": "ListApplicationOffers gets deployed details about application offers that match given filter.\nThe results contain details about the deployed applications such as connection count." + }, + "ModifyOfferAccess": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyOfferAccessRequest" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ModifyOfferAccess changes the application offer access granted to users." + }, + "Offer": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddApplicationOffers" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Offer makes application endpoints available for consumption at a specified URL." + }, + "RemoteApplicationInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/OfferURLs" + }, + "Result": { + "$ref": "#/definitions/RemoteApplicationInfoResults" + } + }, + "description": "RemoteApplicationInfo returns information about the requested remote application.\nThis call currently has no client side API, only there for the Dashboard at this stage." + } + }, + "definitions": { + "AddApplicationOffer": { + "type": "object", + "properties": { + "application-description": { + "type": "string" + }, + "application-name": { + "type": "string" + }, + "endpoints": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "model-tag": { + "type": "string" + }, + "offer-name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "offer-name", + "application-name", + "application-description", + "endpoints" + ] + }, + "AddApplicationOffers": { + "type": "object", + "properties": { + "Offers": { + "type": "array", + "items": { + "$ref": "#/definitions/AddApplicationOffer" + } + } + }, + "additionalProperties": false, + "required": [ + "Offers" + ] + }, + "ApplicationOfferAdminDetailsV5": { + "type": "object", + "properties": { + "ApplicationOfferDetailsV5": { + "$ref": "#/definitions/ApplicationOfferDetailsV5" + }, + "application-description": { + "type": "string" + }, + "application-name": { + "type": "string" + }, + "charm-url": { + "type": "string" + }, + "connections": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferConnection" + } + }, + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEndpoint" + } + }, + "offer-name": { + "type": "string" + }, + "offer-url": { + "type": "string" + }, + "offer-uuid": { + "type": "string" + }, + "source-model-tag": { + "type": "string" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferUserDetails" + } + } + }, + "additionalProperties": false, + "required": [ + "source-model-tag", + "offer-uuid", + "offer-url", + "offer-name", + "application-description", + "ApplicationOfferDetailsV5", + "application-name", + "charm-url" + ] + }, + "ApplicationOfferDetailsV5": { + "type": "object", + "properties": { + "application-description": { + "type": "string" + }, + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEndpoint" + } + }, + "offer-name": { + "type": "string" + }, + "offer-url": { + "type": "string" + }, + "offer-uuid": { + "type": "string" + }, + "source-model-tag": { + "type": "string" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferUserDetails" + } + } + }, + "additionalProperties": false, + "required": [ + "source-model-tag", + "offer-uuid", + "offer-url", + "offer-name", + "application-description" + ] + }, + "ApplicationOfferResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ApplicationOfferAdminDetailsV5" + } + }, + "additionalProperties": false + }, + "ApplicationOffersResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationOfferResult" + } + } + }, + "additionalProperties": false + }, + "ConsumeOfferDetails": { + "type": "object", + "properties": { + "external-controller": { + "$ref": "#/definitions/ExternalControllerInfo" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "offer": { + "$ref": "#/definitions/ApplicationOfferDetailsV5" + } + }, + "additionalProperties": false + }, + "ConsumeOfferDetailsArg": { + "type": "object", + "properties": { + "offer-urls": { + "$ref": "#/definitions/OfferURLs" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "offer-urls" + ] + }, + "ConsumeOfferDetailsResult": { + "type": "object", + "properties": { + "ConsumeOfferDetails": { + "$ref": "#/definitions/ConsumeOfferDetails" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "external-controller": { + "$ref": "#/definitions/ExternalControllerInfo" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "offer": { + "$ref": "#/definitions/ApplicationOfferDetailsV5" + } + }, + "additionalProperties": false, + "required": [ + "ConsumeOfferDetails" + ] + }, + "ConsumeOfferDetailsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConsumeOfferDetailsResult" + } + } + }, + "additionalProperties": false + }, + "DestroyApplicationOffers": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "offer-urls": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "offer-urls" + ] + }, + "EndpointFilterAttributes": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "role", + "interface", + "name" + ] + }, + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ExternalControllerInfo": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "ca-cert": { + "type": "string" + }, + "controller-alias": { + "type": "string" + }, + "controller-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "controller-tag", + "controller-alias", + "addrs", + "ca-cert" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "ModifyOfferAccess": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "action": { + "type": "string" + }, + "offer-url": { + "type": "string" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag", + "action", + "access", + "offer-url" + ] + }, + "ModifyOfferAccessRequest": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/ModifyOfferAccess" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "OfferConnection": { + "type": "object", + "properties": { + "endpoint": { + "type": "string" + }, + "ingress-subnets": { + "type": "array", + "items": { + "type": "string" + } + }, + "relation-id": { + "type": "integer" + }, + "source-model-tag": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "source-model-tag", + "relation-id", + "username", + "endpoint", + "status", + "ingress-subnets" + ] + }, + "OfferFilter": { + "type": "object", + "properties": { + "allowed-users": { + "type": "array", + "items": { + "type": "string" + } + }, + "application-description": { + "type": "string" + }, + "application-name": { + "type": "string" + }, + "application-user": { + "type": "string" + }, + "connected-users": { + "type": "array", + "items": { + "type": "string" + } + }, + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/EndpointFilterAttributes" + } + }, + "model-name": { + "type": "string" + }, + "offer-name": { + "type": "string" + }, + "owner-name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "owner-name", + "model-name", + "offer-name", + "application-name", + "application-description", + "application-user", + "endpoints", + "connected-users", + "allowed-users" + ] + }, + "OfferFilters": { + "type": "object", + "properties": { + "Filters": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferFilter" + } + } + }, + "additionalProperties": false, + "required": [ + "Filters" + ] + }, + "OfferURLs": { + "type": "object", + "properties": { + "bakery-version": { + "type": "integer" + }, + "offer-urls": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "OfferUserDetails": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "display-name": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user", + "display-name", + "access" + ] + }, + "QueryApplicationOffersResultsV5": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationOfferAdminDetailsV5" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoteApplicationInfo": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEndpoint" + } + }, + "icon-url-path": { + "type": "string" + }, + "model-tag": { + "type": "string" + }, + "name": { + "type": "string" + }, + "offer-url": { + "type": "string" + }, + "source-model-label": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "name", + "description", + "offer-url", + "endpoints", + "icon-url-path" + ] + }, + "RemoteApplicationInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RemoteApplicationInfo" + } + }, + "additionalProperties": false + }, + "RemoteApplicationInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteApplicationInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoteEndpoint": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "limit" + ] + } + } + } + }, + { + "Name": "ApplicationScaler", + "Description": "Facade allows model-manager clients to watch and rescale services.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "Rescale": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Rescale causes any supplied services to be scaled up to their\nminimum size." + }, + "Watch": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "Watch returns a watcher that sends the names of services whose\nunit count may be below their configured minimum." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "Backups", + "Description": "API provides backup-specific API methods.", + "Version": 3, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Create": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BackupsCreateArgs" + }, + "Result": { + "$ref": "#/definitions/BackupsMetadataResult" + } + }, + "description": "Create is the API method that requests juju to create a new backup\nof its state." + } + }, + "definitions": { + "BackupsCreateArgs": { + "type": "object", + "properties": { + "no-download": { + "type": "boolean" + }, + "notes": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "notes", + "no-download" + ] + }, + "BackupsMetadataResult": { + "type": "object", + "properties": { + "base": { + "type": "string" + }, + "checksum": { + "type": "string" + }, + "checksum-format": { + "type": "string" + }, + "controller-machine-id": { + "type": "string" + }, + "controller-machine-inst-id": { + "type": "string" + }, + "controller-uuid": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "finished": { + "type": "string", + "format": "date-time" + }, + "format-version": { + "type": "integer" + }, + "ha-nodes": { + "type": "integer" + }, + "hostname": { + "type": "string" + }, + "id": { + "type": "string" + }, + "machine": { + "type": "string" + }, + "model": { + "type": "string" + }, + "notes": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "started": { + "type": "string", + "format": "date-time" + }, + "stored": { + "type": "string", + "format": "date-time" + }, + "version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "id", + "checksum", + "checksum-format", + "size", + "stored", + "started", + "finished", + "notes", + "model", + "machine", + "hostname", + "version", + "base", + "filename", + "format-version", + "controller-uuid", + "controller-machine-id", + "controller-machine-inst-id", + "ha-nodes" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + } + } + } + }, + { + "Name": "Block", + "Description": "API implements Block interface and is the concrete\nimplementation of the api end point.", + "Version": 2, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "List": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/BlockResults" + } + }, + "description": "List implements Block.List()." + }, + "SwitchBlockOff": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BlockSwitchParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "SwitchBlockOff implements Block.SwitchBlockOff()." + }, + "SwitchBlockOn": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BlockSwitchParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "SwitchBlockOn implements Block.SwitchBlockOn()." + } + }, + "definitions": { + "Block": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "tag", + "type" + ] + }, + "BlockResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/Block" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BlockResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BlockResult" + } + } + }, + "additionalProperties": false + }, + "BlockSwitchParams": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "Bundle", + "Description": "APIv6 provides the Bundle API facade for version 6. It is otherwise\nidentical to V5 with the exception that the V6 adds the support for\nmulti-part yaml handling to GetChanges and GetChangesMapArgs.", + "Version": 6, + "AvailableTo": [ + "controller-user", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ExportBundle": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ExportBundleParams" + }, + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "ExportBundle exports the current model configuration as bundle." + }, + "GetChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BundleChangesParams" + }, + "Result": { + "$ref": "#/definitions/BundleChangesResults" + } + }, + "description": "GetChanges returns the list of changes required to deploy the given bundle\ndata. The changes are sorted by requirements, so that they can be applied in\norder.\nGetChanges has been superseded in favour of GetChangesMapArgs. It's\npreferable to use that new method to add new functionality and move clients\naway from this one." + }, + "GetChangesMapArgs": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BundleChangesParams" + }, + "Result": { + "$ref": "#/definitions/BundleChangesMapArgsResults" + } + }, + "description": "GetChangesMapArgs returns the list of changes required to deploy the given\nbundle data. The changes are sorted by requirements, so that they can be\napplied in order.\nV4 GetChangesMapArgs is not supported on anything less than v4" + } + }, + "definitions": { + "BundleChange": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "id": { + "type": "string" + }, + "method": { + "type": "string" + }, + "requires": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "id", + "method", + "args", + "requires" + ] + }, + "BundleChangesMapArgs": { + "type": "object", + "properties": { + "args": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "id": { + "type": "string" + }, + "method": { + "type": "string" + }, + "requires": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "id", + "method", + "args", + "requires" + ] + }, + "BundleChangesMapArgsResults": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/BundleChangesMapArgs" + } + }, + "errors": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "BundleChangesParams": { + "type": "object", + "properties": { + "bundleURL": { + "type": "string" + }, + "yaml": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "yaml", + "bundleURL" + ] + }, + "BundleChangesResults": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/BundleChange" + } + }, + "errors": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ExportBundleParams": { + "type": "object", + "properties": { + "include-charm-defaults": { + "type": "boolean" + }, + "include-series": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + } + } + } + }, + { + "Name": "CAASAdmission", + "Description": "", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + }, + "description": "ControllerAPIInfoForModels returns the controller api connection details for the specified models." + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + }, + "description": "ControllerConfig returns the controller's configuration." + } + }, + "definitions": { + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + } + } + } + }, + { + "Name": "CAASAgent", + "Description": "FacadeV2 is the V2 facade of the caas agent", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "CloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResults" + } + }, + "description": "CloudSpec returns the model's cloud spec." + }, + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + }, + "description": "ControllerAPIInfoForModels returns the controller api connection details for the specified models." + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + }, + "description": "ControllerConfig returns the controller's configuration." + }, + "GetCloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelTag" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResult" + } + }, + "description": "GetCloudSpec constructs the CloudSpec for a validated and authorized model." + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + }, + "description": "ModelConfig returns the current model's configuration." + }, + "WatchCloudSpecsChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchCloudSpecsChanges returns a watcher for cloud spec changes." + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchForModelConfigChanges returns a NotifyWatcher that observes\nchanges to the model configuration.\nNote that although the NotifyWatchResult contains an Error field,\nit's not used because we are only returning a single watcher,\nso we use the regular error return." + } + }, + "definitions": { + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudSpec": { + "type": "object", + "properties": { + "cacertificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "is-controller-cloud": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "skip-tls-verify": { + "type": "boolean" + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "name" + ] + }, + "CloudSpecResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudSpec" + } + }, + "additionalProperties": false + }, + "CloudSpecResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "additionalProperties": false + }, + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelTag": { + "type": "object", + "additionalProperties": false + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "CAASApplication", + "Description": "", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "UnitIntroduction": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CAASUnitIntroductionArgs" + }, + "Result": { + "$ref": "#/definitions/CAASUnitIntroductionResult" + } + }, + "description": "UnitIntroduction sets the status of each given entity." + }, + "UnitTerminating": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/CAASUnitTerminationResult" + } + }, + "description": "UnitTerminating should be called by the CAASUnitTerminationWorker when\nthe agent receives a signal to exit. UnitTerminating will return how\nthe agent should shutdown." + } + }, + "definitions": { + "CAASUnitIntroduction": { + "type": "object", + "properties": { + "agent-conf": { + "type": "array", + "items": { + "type": "integer" + } + }, + "unit-name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit-name", + "agent-conf" + ] + }, + "CAASUnitIntroductionArgs": { + "type": "object", + "properties": { + "pod-name": { + "type": "string" + }, + "pod-uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "pod-name", + "pod-uuid" + ] + }, + "CAASUnitIntroductionResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CAASUnitIntroduction" + } + }, + "additionalProperties": false + }, + "CAASUnitTerminationResult": { + "type": "object", + "properties": { + "Error": { + "$ref": "#/definitions/Error" + }, + "WillRestart": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "WillRestart", + "Error" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + } + } + } + }, + { + "Name": "CAASApplicationProvisioner", + "Description": "", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ApplicationCharmInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/Charm" + } + }, + "description": "ApplicationCharmInfo returns information about an application's charm." + }, + "ApplicationOCIResources": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CAASApplicationOCIResourceResults" + } + }, + "description": "ApplicationOCIResources returns the OCI image resources for an application." + }, + "CharmInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURL" + }, + "Result": { + "$ref": "#/definitions/Charm" + } + }, + "description": "CharmInfo returns information about the requested charm." + }, + "ClearApplicationsResources": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ClearApplicationsResources clears the flags which indicate\napplications still have resources in the cluster." + }, + "DestroyUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyUnitsParams" + }, + "Result": { + "$ref": "#/definitions/DestroyUnitResults" + } + }, + "description": "DestroyUnits is responsible for scaling down a set of units on the this\nApplication." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "ProvisionerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/CAASApplicationProvisionerConfigResult" + } + }, + "description": "ProvisionerConfig returns the provisioner's configuration." + }, + "ProvisioningInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CAASApplicationProvisioningInfoResults" + } + }, + "description": "ProvisioningInfo returns the info needed to provision a caas application." + }, + "ProvisioningState": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/CAASApplicationProvisioningStateResult" + } + }, + "description": "ProvisioningState returns the provisioning state for the application." + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Remove removes every given entity from state, calling EnsureDead\nfirst, then Remove. It will fail if the entity is not present." + }, + "SetOperatorStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetOperatorStatus sets the status of each given entity." + }, + "SetPasswords": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityPasswords" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetPasswords sets the given password for each supplied entity, if possible." + }, + "SetProvisioningState": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CAASApplicationProvisioningStateArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "SetProvisioningState sets the provisioning state for the application." + }, + "Units": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CAASUnitsResults" + } + }, + "description": "Units returns all the units for each application specified." + }, + "UpdateApplicationsUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateApplicationUnitArgs" + }, + "Result": { + "$ref": "#/definitions/UpdateApplicationUnitResults" + } + }, + "description": "UpdateApplicationsUnits updates the Juju data model to reflect the given\nunits of the specified application." + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "Watch starts an NotifyWatcher for each given entity." + }, + "WatchApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchApplications starts a StringsWatcher to watch applications\ndeployed to this model." + }, + "WatchProvisioningInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchProvisioningInfo provides a watcher for changes that affect the\ninformation returned by ProvisioningInfo. This is useful for ensuring the\nlatest application stated is ensured." + }, + "WatchUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchUnits starts a StringsWatcher to watch changes to the\nlifecycle states of units for the specified applications in\nthis model." + } + }, + "definitions": { + "ApplicationUnitInfo": { + "type": "object", + "properties": { + "provider-id": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "provider-id", + "unit-tag" + ] + }, + "ApplicationUnitParams": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "filesystem-info": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesFilesystemInfo" + } + }, + "info": { + "type": "string" + }, + "ports": { + "type": "array", + "items": { + "type": "string" + } + }, + "provider-id": { + "type": "string" + }, + "stateful": { + "type": "boolean" + }, + "status": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "provider-id", + "unit-tag", + "address", + "ports", + "status", + "info" + ] + }, + "Base": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "channel" + ] + }, + "CAASApplicationOCIResourceResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CAASApplicationOCIResources" + } + }, + "additionalProperties": false + }, + "CAASApplicationOCIResourceResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CAASApplicationOCIResourceResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "CAASApplicationOCIResources": { + "type": "object", + "properties": { + "images": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/DockerImageInfo" + } + } + } + }, + "additionalProperties": false, + "required": [ + "images" + ] + }, + "CAASApplicationProvisionerConfig": { + "type": "object", + "properties": { + "unmanaged-applications": { + "$ref": "#/definitions/Entities" + } + }, + "additionalProperties": false + }, + "CAASApplicationProvisionerConfigResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "provisioner-config": { + "$ref": "#/definitions/CAASApplicationProvisionerConfig" + } + }, + "additionalProperties": false + }, + "CAASApplicationProvisioningInfo": { + "type": "object", + "properties": { + "api-addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "base": { + "$ref": "#/definitions/Base" + }, + "ca-cert": { + "type": "string" + }, + "charm-modified-version": { + "type": "integer" + }, + "charm-url": { + "type": "string" + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "devices": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesDeviceParams" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "filesystems": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesFilesystemParams" + } + }, + "image-repo": { + "$ref": "#/definitions/DockerImageInfo" + }, + "scale": { + "type": "integer" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "trust": { + "type": "boolean" + }, + "version": { + "$ref": "#/definitions/Number" + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesVolumeParams" + } + } + }, + "additionalProperties": false, + "required": [ + "version", + "api-addresses", + "ca-cert", + "constraints" + ] + }, + "CAASApplicationProvisioningInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CAASApplicationProvisioningInfo" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "CAASApplicationProvisioningState": { + "type": "object", + "properties": { + "scale-target": { + "type": "integer" + }, + "scaling": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "scaling", + "scale-target" + ] + }, + "CAASApplicationProvisioningStateArg": { + "type": "object", + "properties": { + "application": { + "$ref": "#/definitions/Entity" + }, + "provisioning-state": { + "$ref": "#/definitions/CAASApplicationProvisioningState" + } + }, + "additionalProperties": false, + "required": [ + "application", + "provisioning-state" + ] + }, + "CAASApplicationProvisioningStateResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "provisioning-state": { + "$ref": "#/definitions/CAASApplicationProvisioningState" + } + }, + "additionalProperties": false + }, + "CAASUnitInfo": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "unit-status": { + "$ref": "#/definitions/UnitStatus" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "CAASUnitsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "units": { + "type": "array", + "items": { + "$ref": "#/definitions/CAASUnitInfo" + } + } + }, + "additionalProperties": false + }, + "CAASUnitsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CAASUnitsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Charm": { + "type": "object", + "properties": { + "actions": { + "$ref": "#/definitions/CharmActions" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmOption" + } + } + }, + "lxd-profile": { + "$ref": "#/definitions/CharmLXDProfile" + }, + "manifest": { + "$ref": "#/definitions/CharmManifest" + }, + "meta": { + "$ref": "#/definitions/CharmMeta" + }, + "metrics": { + "$ref": "#/definitions/CharmMetrics" + }, + "revision": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "url", + "config" + ] + }, + "CharmActionSpec": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "description", + "params" + ] + }, + "CharmActions": { + "type": "object", + "properties": { + "specs": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmActionSpec" + } + } + } + }, + "additionalProperties": false + }, + "CharmBase": { + "type": "object", + "properties": { + "architectures": { + "type": "array", + "items": { + "type": "string" + } + }, + "channel": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CharmContainer": { + "type": "object", + "properties": { + "gid": { + "type": "integer" + }, + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + }, + "uid": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "CharmDeployment": { + "type": "object", + "properties": { + "min-version": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "service": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "mode", + "service", + "min-version" + ] + }, + "CharmDevice": { + "type": "object", + "properties": { + "CountMax": { + "type": "integer" + }, + "CountMin": { + "type": "integer" + }, + "Description": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Name", + "Description", + "Type", + "CountMin", + "CountMax" + ] + }, + "CharmLXDProfile": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "description", + "devices" + ] + }, + "CharmManifest": { + "type": "object", + "properties": { + "bases": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmBase" + } + } + }, + "additionalProperties": false + }, + "CharmMeta": { + "type": "object", + "properties": { + "assumes-expr": { + "$ref": "#/definitions/ExpressionTree" + }, + "categories": { + "type": "array", + "items": { + "type": "string" + } + }, + "charm-user": { + "type": "string" + }, + "containers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmContainer" + } + } + }, + "deployment": { + "$ref": "#/definitions/CharmDeployment" + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmDevice" + } + } + }, + "extra-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "min-juju-version": { + "type": "string" + }, + "name": { + "type": "string" + }, + "payload-classes": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmPayloadClass" + } + } + }, + "peers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "provides": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "requires": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "resources": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmResourceMeta" + } + } + }, + "series": { + "type": "array", + "items": { + "type": "string" + } + }, + "storage": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmStorage" + } + } + }, + "subordinate": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "terms": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "name", + "summary", + "description", + "subordinate" + ] + }, + "CharmMetric": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "description" + ] + }, + "CharmMetrics": { + "type": "object", + "properties": { + "metrics": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmMetric" + } + } + }, + "plan": { + "$ref": "#/definitions/CharmPlan" + } + }, + "additionalProperties": false, + "required": [ + "metrics", + "plan" + ] + }, + "CharmMount": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "storage": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CharmOption": { + "type": "object", + "properties": { + "default": { + "type": "object", + "additionalProperties": true + }, + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "CharmPayloadClass": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type" + ] + }, + "CharmPlan": { + "type": "object", + "properties": { + "required": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "required" + ] + }, + "CharmRelation": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "optional", + "limit", + "scope" + ] + }, + "CharmResourceMeta": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "description" + ] + }, + "CharmStorage": { + "type": "object", + "properties": { + "count-max": { + "type": "integer" + }, + "count-min": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "location": { + "type": "string" + }, + "minimum-size": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "properties": { + "type": "array", + "items": { + "type": "string" + } + }, + "read-only": { + "type": "boolean" + }, + "shared": { + "type": "boolean" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "description", + "type", + "shared", + "read-only", + "count-min", + "count-max", + "minimum-size" + ] + }, + "CharmURL": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url" + ] + }, + "DestroyUnitInfo": { + "type": "object", + "properties": { + "destroyed-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "detached-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false + }, + "DestroyUnitParams": { + "type": "object", + "properties": { + "destroy-storage": { + "type": "boolean" + }, + "dry-run": { + "type": "boolean" + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit-tag" + ] + }, + "DestroyUnitResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "$ref": "#/definitions/DestroyUnitInfo" + } + }, + "additionalProperties": false + }, + "DestroyUnitResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyUnitResult" + } + } + }, + "additionalProperties": false + }, + "DestroyUnitsParams": { + "type": "object", + "properties": { + "units": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyUnitParams" + } + } + }, + "additionalProperties": false, + "required": [ + "units" + ] + }, + "DetailedStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "err": { + "$ref": "#/definitions/Error" + }, + "info": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "life": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "data", + "since", + "kind", + "version", + "life" + ] + }, + "DockerImageInfo": { + "type": "object", + "properties": { + "auth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "identitytoken": { + "type": "string" + }, + "image-name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "registrytoken": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "serveraddress": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "image-name" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityPassword": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "password" + ] + }, + "EntityPasswords": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPassword" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ExpressionTree": { + "type": "object", + "properties": { + "Expression": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "Expression" + ] + }, + "KubernetesDeviceParams": { + "type": "object", + "properties": { + "Attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "Count": { + "type": "integer" + }, + "Type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Type", + "Count", + "Attributes" + ] + }, + "KubernetesFilesystemAttachmentParams": { + "type": "object", + "properties": { + "mount-point": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "provider" + ] + }, + "KubernetesFilesystemInfo": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "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" + } + }, + "additionalProperties": false, + "required": [ + "storagename", + "pool", + "size", + "filesystem-id", + "status", + "info", + "volume" + ] + }, + "KubernetesFilesystemParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/KubernetesFilesystemAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "storagename": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "storagename", + "size", + "provider" + ] + }, + "KubernetesVolumeAttachmentParams": { + "type": "object", + "properties": { + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "provider" + ] + }, + "KubernetesVolumeInfo": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "persistent": { + "type": "boolean" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "volume-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-id", + "size", + "persistent", + "status", + "info" + ] + }, + "KubernetesVolumeParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/KubernetesVolumeAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "storagename": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "storagename", + "size", + "provider" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UnitStatus": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "agent-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "charm": { + "type": "string" + }, + "leader": { + "type": "boolean" + }, + "machine": { + "type": "string" + }, + "opened-ports": { + "type": "array", + "items": { + "type": "string" + } + }, + "provider-id": { + "type": "string" + }, + "public-address": { + "type": "string" + }, + "subordinates": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/UnitStatus" + } + } + }, + "workload-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "workload-version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "agent-status", + "workload-status", + "workload-version", + "machine", + "opened-ports", + "public-address", + "charm", + "subordinates" + ] + }, + "UpdateApplicationUnitArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateApplicationUnits" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UpdateApplicationUnitResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "$ref": "#/definitions/UpdateApplicationUnitsInfo" + } + }, + "additionalProperties": false + }, + "UpdateApplicationUnitResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateApplicationUnitResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UpdateApplicationUnits": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + }, + "generation": { + "type": "integer" + }, + "scale": { + "type": "integer" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "units": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationUnitParams" + } + } + }, + "additionalProperties": false, + "required": [ + "application-tag", + "units" + ] + }, + "UpdateApplicationUnitsInfo": { + "type": "object", + "properties": { + "units": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationUnitInfo" + } + } + }, + "additionalProperties": false, + "required": [ + "units" + ] + }, + "Value": { + "type": "object", + "properties": { + "allocate-public-ip": { + "type": "boolean" + }, + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "image-id": { + "type": "string" + }, + "instance-role": { + "type": "string" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "CAASFirewaller", + "Description": "", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "ApplicationCharmInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/Charm" + } + }, + "description": "ApplicationCharmInfo returns information about an application's charm." + }, + "ApplicationsConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetConfigResults" + } + }, + "description": "ApplicationsConfig returns the config for the specified applications." + }, + "CharmInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURL" + }, + "Result": { + "$ref": "#/definitions/Charm" + } + }, + "description": "CharmInfo returns information about the requested charm." + }, + "IsExposed": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + }, + "description": "IsExposed returns whether the specified applications are exposed." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "Watch starts an NotifyWatcher for each given entity." + }, + "WatchApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchApplications starts a StringsWatcher to watch applications\ndeployed to this model." + } + }, + "definitions": { + "ApplicationGetConfigResults": { + "type": "object", + "properties": { + "Results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigResult" + } + } + }, + "additionalProperties": false, + "required": [ + "Results" + ] + }, + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Charm": { + "type": "object", + "properties": { + "actions": { + "$ref": "#/definitions/CharmActions" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmOption" + } + } + }, + "lxd-profile": { + "$ref": "#/definitions/CharmLXDProfile" + }, + "manifest": { + "$ref": "#/definitions/CharmManifest" + }, + "meta": { + "$ref": "#/definitions/CharmMeta" + }, + "metrics": { + "$ref": "#/definitions/CharmMetrics" + }, + "revision": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "url", + "config" + ] + }, + "CharmActionSpec": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "description", + "params" + ] + }, + "CharmActions": { + "type": "object", + "properties": { + "specs": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmActionSpec" + } + } + } + }, + "additionalProperties": false + }, + "CharmBase": { + "type": "object", + "properties": { + "architectures": { + "type": "array", + "items": { + "type": "string" + } + }, + "channel": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CharmContainer": { + "type": "object", + "properties": { + "gid": { + "type": "integer" + }, + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + }, + "uid": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "CharmDeployment": { + "type": "object", + "properties": { + "min-version": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "service": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "mode", + "service", + "min-version" + ] + }, + "CharmDevice": { + "type": "object", + "properties": { + "CountMax": { + "type": "integer" + }, + "CountMin": { + "type": "integer" + }, + "Description": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Name", + "Description", + "Type", + "CountMin", + "CountMax" + ] + }, + "CharmLXDProfile": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "description", + "devices" + ] + }, + "CharmManifest": { + "type": "object", + "properties": { + "bases": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmBase" + } + } + }, + "additionalProperties": false + }, + "CharmMeta": { + "type": "object", + "properties": { + "assumes-expr": { + "$ref": "#/definitions/ExpressionTree" + }, + "categories": { + "type": "array", + "items": { + "type": "string" + } + }, + "charm-user": { + "type": "string" + }, + "containers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmContainer" + } + } + }, + "deployment": { + "$ref": "#/definitions/CharmDeployment" + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmDevice" + } + } + }, + "extra-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "min-juju-version": { + "type": "string" + }, + "name": { + "type": "string" + }, + "payload-classes": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmPayloadClass" + } + } + }, + "peers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "provides": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "requires": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "resources": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmResourceMeta" + } + } + }, + "series": { + "type": "array", + "items": { + "type": "string" + } + }, + "storage": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmStorage" + } + } + }, + "subordinate": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "terms": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "name", + "summary", + "description", + "subordinate" + ] + }, + "CharmMetric": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "description" + ] + }, + "CharmMetrics": { + "type": "object", + "properties": { + "metrics": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmMetric" + } + } + }, + "plan": { + "$ref": "#/definitions/CharmPlan" + } + }, + "additionalProperties": false, + "required": [ + "metrics", + "plan" + ] + }, + "CharmMount": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "storage": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CharmOption": { + "type": "object", + "properties": { + "default": { + "type": "object", + "additionalProperties": true + }, + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "CharmPayloadClass": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type" + ] + }, + "CharmPlan": { + "type": "object", + "properties": { + "required": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "required" + ] + }, + "CharmRelation": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "optional", + "limit", + "scope" + ] + }, + "CharmResourceMeta": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "description" + ] + }, + "CharmStorage": { + "type": "object", + "properties": { + "count-max": { + "type": "integer" + }, + "count-min": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "location": { + "type": "string" + }, + "minimum-size": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "properties": { + "type": "array", + "items": { + "type": "string" + } + }, + "read-only": { + "type": "boolean" + }, + "shared": { + "type": "boolean" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "description", + "type", + "shared", + "read-only", + "count-min", + "count-max", + "minimum-size" + ] + }, + "CharmURL": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url" + ] + }, + "ConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ExpressionTree": { + "type": "object", + "properties": { + "Expression": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "Expression" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "CAASFirewallerSidecar", + "Description": "FacadeSidecar provides access to the CAASFirewaller API facade for sidecar applications.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "ApplicationCharmInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/Charm" + } + }, + "description": "ApplicationCharmInfo returns information about an application's charm." + }, + "ApplicationsConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetConfigResults" + } + }, + "description": "ApplicationsConfig returns the config for the specified applications." + }, + "CharmInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURL" + }, + "Result": { + "$ref": "#/definitions/Charm" + } + }, + "description": "CharmInfo returns information about the requested charm." + }, + "GetOpenedPorts": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/ApplicationOpenedPortsResults" + } + }, + "description": "GetOpenedPorts returns all the opened ports for each given application tag." + }, + "IsExposed": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + }, + "description": "IsExposed returns whether the specified applications are exposed." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "Watch starts an NotifyWatcher for each given entity." + }, + "WatchApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchApplications starts a StringsWatcher to watch applications\ndeployed to this model." + }, + "WatchOpenedPorts": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchOpenedPorts returns a new StringsWatcher for each given\nmodel tag." + } + }, + "definitions": { + "ApplicationGetConfigResults": { + "type": "object", + "properties": { + "Results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigResult" + } + } + }, + "additionalProperties": false, + "required": [ + "Results" + ] + }, + "ApplicationOpenedPorts": { + "type": "object", + "properties": { + "endpoint": { + "type": "string" + }, + "port-ranges": { + "type": "array", + "items": { + "$ref": "#/definitions/PortRange" + } + } + }, + "additionalProperties": false, + "required": [ + "endpoint", + "port-ranges" + ] + }, + "ApplicationOpenedPortsResult": { + "type": "object", + "properties": { + "application-port-ranges": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationOpenedPorts" + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "application-port-ranges" + ] + }, + "ApplicationOpenedPortsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationOpenedPortsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Charm": { + "type": "object", + "properties": { + "actions": { + "$ref": "#/definitions/CharmActions" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmOption" + } + } + }, + "lxd-profile": { + "$ref": "#/definitions/CharmLXDProfile" + }, + "manifest": { + "$ref": "#/definitions/CharmManifest" + }, + "meta": { + "$ref": "#/definitions/CharmMeta" + }, + "metrics": { + "$ref": "#/definitions/CharmMetrics" + }, + "revision": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "url", + "config" + ] + }, + "CharmActionSpec": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "description", + "params" + ] + }, + "CharmActions": { + "type": "object", + "properties": { + "specs": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmActionSpec" + } + } + } + }, + "additionalProperties": false + }, + "CharmBase": { + "type": "object", + "properties": { + "architectures": { + "type": "array", + "items": { + "type": "string" + } + }, + "channel": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CharmContainer": { + "type": "object", + "properties": { + "gid": { + "type": "integer" + }, + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + }, + "uid": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "CharmDeployment": { + "type": "object", + "properties": { + "min-version": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "service": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "mode", + "service", + "min-version" + ] + }, + "CharmDevice": { + "type": "object", + "properties": { + "CountMax": { + "type": "integer" + }, + "CountMin": { + "type": "integer" + }, + "Description": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Name", + "Description", + "Type", + "CountMin", + "CountMax" + ] + }, + "CharmLXDProfile": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "description", + "devices" + ] + }, + "CharmManifest": { + "type": "object", + "properties": { + "bases": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmBase" + } + } + }, + "additionalProperties": false + }, + "CharmMeta": { + "type": "object", + "properties": { + "assumes-expr": { + "$ref": "#/definitions/ExpressionTree" + }, + "categories": { + "type": "array", + "items": { + "type": "string" + } + }, + "charm-user": { + "type": "string" + }, + "containers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmContainer" + } + } + }, + "deployment": { + "$ref": "#/definitions/CharmDeployment" + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmDevice" + } + } + }, + "extra-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "min-juju-version": { + "type": "string" + }, + "name": { + "type": "string" + }, + "payload-classes": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmPayloadClass" + } + } + }, + "peers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "provides": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "requires": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "resources": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmResourceMeta" + } + } + }, + "series": { + "type": "array", + "items": { + "type": "string" + } + }, + "storage": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmStorage" + } + } + }, + "subordinate": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "terms": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "name", + "summary", + "description", + "subordinate" + ] + }, + "CharmMetric": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "description" + ] + }, + "CharmMetrics": { + "type": "object", + "properties": { + "metrics": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmMetric" + } + } + }, + "plan": { + "$ref": "#/definitions/CharmPlan" + } + }, + "additionalProperties": false, + "required": [ + "metrics", + "plan" + ] + }, + "CharmMount": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "storage": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CharmOption": { + "type": "object", + "properties": { + "default": { + "type": "object", + "additionalProperties": true + }, + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "CharmPayloadClass": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type" + ] + }, + "CharmPlan": { + "type": "object", + "properties": { + "required": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "required" + ] + }, + "CharmRelation": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "optional", + "limit", + "scope" + ] + }, + "CharmResourceMeta": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "description" + ] + }, + "CharmStorage": { + "type": "object", + "properties": { + "count-max": { + "type": "integer" + }, + "count-min": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "location": { + "type": "string" + }, + "minimum-size": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "properties": { + "type": "array", + "items": { + "type": "string" + } + }, + "read-only": { + "type": "boolean" + }, + "shared": { + "type": "boolean" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "description", + "type", + "shared", + "read-only", + "count-min", + "count-max", + "minimum-size" + ] + }, + "CharmURL": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url" + ] + }, + "ConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ExpressionTree": { + "type": "object", + "properties": { + "Expression": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "Expression" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "PortRange": { + "type": "object", + "properties": { + "from-port": { + "type": "integer" + }, + "protocol": { + "type": "string" + }, + "to-port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "from-port", + "to-port", + "protocol" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "CAASModelConfigManager", + "Description": "Facade allows model config manager clients to watch controller config changes and fetch controller config.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + } + }, + "WatchControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + } + }, + "definitions": { + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + } + } + } + }, + { + "Name": "CAASModelOperator", + "Description": "API represents the controller model operator facade.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + }, + "description": "APIAddresses returns the list of addresses used to connect to the API." + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + }, + "description": "APIHostPorts returns the API server addresses." + }, + "ModelOperatorProvisioningInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelOperatorInfo" + } + }, + "description": "ModelOperatorProvisioningInfo returns the information needed for provisioning\na new model operator into a caas cluster." + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "ModelUUID returns the model UUID that this facade is used to operate.\nIt is implemented here directly as a result of removing it from\nembedded APIAddresser *without* bumping the facade version.\nIt should be blanked when this facade version is next incremented." + }, + "SetPasswords": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityPasswords" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetPasswords sets the given password for each supplied entity, if possible." + }, + "WatchAPIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchAPIHostPorts watches the API server addresses." + }, + "WatchModelOperatorProvisioningInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchModelOperatorProvisioningInfo provides a watcher for changes that affect the\ninformation returned by ModelOperatorProvisioningInfo." + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "Address": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "DockerImageInfo": { + "type": "object", + "properties": { + "auth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "identitytoken": { + "type": "string" + }, + "image-name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "registrytoken": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "serveraddress": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "image-name" + ] + }, + "EntityPassword": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "password" + ] + }, + "EntityPasswords": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPassword" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "port": { + "type": "integer" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope", + "Address", + "port" + ] + }, + "ModelOperatorInfo": { + "type": "object", + "properties": { + "api-addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "image-details": { + "$ref": "#/definitions/DockerImageInfo" + }, + "version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "api-addresses", + "image-details", + "version" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "CAASOperator", + "Description": "Facade is the CAAS operator API facade.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + }, + "description": "APIAddresses returns the list of addresses used to connect to the API." + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + }, + "description": "APIHostPorts returns the API server addresses." + }, + "Charm": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationCharmResults" + } + }, + "description": "Charm returns the charm info for all given applications." + }, + "CurrentModel": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelResult" + } + }, + "description": "CurrentModel returns the name and UUID for the current juju model." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "ModelUUID returns the model UUID that this facade is used to operate.\nIt is implemented here directly as a result of removing it from\nembedded APIAddresser *without* bumping the facade version.\nIt should be blanked when this facade version is next incremented." + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Remove removes every given entity from state, calling EnsureDead\nfirst, then Remove. It will fail if the entity is not present." + }, + "SetPodSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetPodSpecParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetPodSpec sets the container specs for a set of applications.\nTODO(juju3) - remove" + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetStatus sets the status of each given entity." + }, + "SetTools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntitiesVersion" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetTools updates the recorded tools version for the agents." + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "Watch starts an NotifyWatcher for each given entity." + }, + "WatchAPIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchAPIHostPorts watches the API server addresses." + }, + "WatchContainerStart": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/WatchContainerStartArgs" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchContainerStart starts a StringWatcher to watch for container start events\non the CAAS api for a specific application and container." + }, + "WatchUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchUnits starts a StringsWatcher to watch changes to the\nlifecycle states of units for the specified applications in\nthis model." + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "Address": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "ApplicationCharm": { + "type": "object", + "properties": { + "charm-modified-version": { + "type": "integer" + }, + "deployment-mode": { + "type": "string" + }, + "force-upgrade": { + "type": "boolean" + }, + "sha256": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "sha256", + "charm-modified-version" + ] + }, + "ApplicationCharmResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ApplicationCharm" + } + }, + "additionalProperties": false + }, + "ApplicationCharmResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationCharmResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Binary": { + "type": "object", + "properties": { + "Arch": { + "type": "string" + }, + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Number": { + "$ref": "#/definitions/Number" + }, + "Patch": { + "type": "integer" + }, + "Release": { + "type": "string" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build", + "Number", + "Release", + "Arch" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesVersion": { + "type": "object", + "properties": { + "agent-tools": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityVersion" + } + } + }, + "additionalProperties": false, + "required": [ + "agent-tools" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "EntityString": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "value" + ] + }, + "EntityVersion": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "tools": { + "$ref": "#/definitions/Version" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "tools" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "port": { + "type": "integer" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope", + "Address", + "port" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "uuid", + "type" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "SetPodSpecParams": { + "type": "object", + "properties": { + "specs": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityString" + } + } + }, + "additionalProperties": false, + "required": [ + "specs" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Version": { + "type": "object", + "properties": { + "version": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + }, + "WatchContainerStartArg": { + "type": "object", + "properties": { + "container": { + "type": "string" + }, + "entity": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "entity" + ] + }, + "WatchContainerStartArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/WatchContainerStartArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + } + } + } + }, + { + "Name": "CAASOperatorProvisioner", + "Description": "", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + }, + "description": "APIAddresses returns the list of addresses used to connect to the API." + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + }, + "description": "APIHostPorts returns the API server addresses." + }, + "ApplicationCharmInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/Charm" + } + }, + "description": "ApplicationCharmInfo returns information about an application's charm." + }, + "CharmInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURL" + }, + "Result": { + "$ref": "#/definitions/Charm" + } + }, + "description": "CharmInfo returns information about the requested charm." + }, + "IssueOperatorCertificate": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/IssueOperatorCertificateResults" + } + }, + "description": "IssueOperatorCertificate issues an x509 certificate for use by the specified application operator." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "ModelUUID returns the model UUID that this facade is used to operate.\nIt is implemented here directly as a result of removing it from\nembedded APIAddresser *without* bumping the facade version.\nIt should be blanked when this facade version is next incremented." + }, + "OperatorProvisioningInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/OperatorProvisioningInfoResults" + } + }, + "description": "OperatorProvisioningInfo returns the info needed to provision an operator." + }, + "SetPasswords": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityPasswords" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetPasswords sets the given password for each supplied entity, if possible." + }, + "WatchAPIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchAPIHostPorts watches the API server addresses." + }, + "WatchApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchApplications starts a StringsWatcher to watch applications\ndeployed to this model." + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "Address": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "Charm": { + "type": "object", + "properties": { + "actions": { + "$ref": "#/definitions/CharmActions" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmOption" + } + } + }, + "lxd-profile": { + "$ref": "#/definitions/CharmLXDProfile" + }, + "manifest": { + "$ref": "#/definitions/CharmManifest" + }, + "meta": { + "$ref": "#/definitions/CharmMeta" + }, + "metrics": { + "$ref": "#/definitions/CharmMetrics" + }, + "revision": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "url", + "config" + ] + }, + "CharmActionSpec": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "description", + "params" + ] + }, + "CharmActions": { + "type": "object", + "properties": { + "specs": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmActionSpec" + } + } + } + }, + "additionalProperties": false + }, + "CharmBase": { + "type": "object", + "properties": { + "architectures": { + "type": "array", + "items": { + "type": "string" + } + }, + "channel": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CharmContainer": { + "type": "object", + "properties": { + "gid": { + "type": "integer" + }, + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + }, + "uid": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "CharmDeployment": { + "type": "object", + "properties": { + "min-version": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "service": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "mode", + "service", + "min-version" + ] + }, + "CharmDevice": { + "type": "object", + "properties": { + "CountMax": { + "type": "integer" + }, + "CountMin": { + "type": "integer" + }, + "Description": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Name", + "Description", + "Type", + "CountMin", + "CountMax" + ] + }, + "CharmLXDProfile": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "description", + "devices" + ] + }, + "CharmManifest": { + "type": "object", + "properties": { + "bases": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmBase" + } + } + }, + "additionalProperties": false + }, + "CharmMeta": { + "type": "object", + "properties": { + "assumes-expr": { + "$ref": "#/definitions/ExpressionTree" + }, + "categories": { + "type": "array", + "items": { + "type": "string" + } + }, + "charm-user": { + "type": "string" + }, + "containers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmContainer" + } + } + }, + "deployment": { + "$ref": "#/definitions/CharmDeployment" + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmDevice" + } + } + }, + "extra-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "min-juju-version": { + "type": "string" + }, + "name": { + "type": "string" + }, + "payload-classes": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmPayloadClass" + } + } + }, + "peers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "provides": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "requires": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "resources": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmResourceMeta" + } + } + }, + "series": { + "type": "array", + "items": { + "type": "string" + } + }, + "storage": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmStorage" + } + } + }, + "subordinate": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "terms": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "name", + "summary", + "description", + "subordinate" + ] + }, + "CharmMetric": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "description" + ] + }, + "CharmMetrics": { + "type": "object", + "properties": { + "metrics": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmMetric" + } + } + }, + "plan": { + "$ref": "#/definitions/CharmPlan" + } + }, + "additionalProperties": false, + "required": [ + "metrics", + "plan" + ] + }, + "CharmMount": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "storage": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CharmOption": { + "type": "object", + "properties": { + "default": { + "type": "object", + "additionalProperties": true + }, + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "CharmPayloadClass": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type" + ] + }, + "CharmPlan": { + "type": "object", + "properties": { + "required": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "required" + ] + }, + "CharmRelation": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "optional", + "limit", + "scope" + ] + }, + "CharmResourceMeta": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "description" + ] + }, + "CharmStorage": { + "type": "object", + "properties": { + "count-max": { + "type": "integer" + }, + "count-min": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "location": { + "type": "string" + }, + "minimum-size": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "properties": { + "type": "array", + "items": { + "type": "string" + } + }, + "read-only": { + "type": "boolean" + }, + "shared": { + "type": "boolean" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "description", + "type", + "shared", + "read-only", + "count-min", + "count-max", + "minimum-size" + ] + }, + "CharmURL": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url" + ] + }, + "DockerImageInfo": { + "type": "object", + "properties": { + "auth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "identitytoken": { + "type": "string" + }, + "image-name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "registrytoken": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "serveraddress": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "image-name" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityPassword": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "password" + ] + }, + "EntityPasswords": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPassword" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ExpressionTree": { + "type": "object", + "properties": { + "Expression": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "Expression" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "port": { + "type": "integer" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope", + "Address", + "port" + ] + }, + "IssueOperatorCertificateResult": { + "type": "object", + "properties": { + "ca-cert": { + "type": "string" + }, + "cert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "private-key": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "ca-cert", + "cert", + "private-key" + ] + }, + "IssueOperatorCertificateResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/IssueOperatorCertificateResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "KubernetesFilesystemAttachmentParams": { + "type": "object", + "properties": { + "mount-point": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "provider" + ] + }, + "KubernetesFilesystemParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/KubernetesFilesystemAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "storagename": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "storagename", + "size", + "provider" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "OperatorProvisioningInfo": { + "type": "object", + "properties": { + "api-addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "base-image-details": { + "$ref": "#/definitions/DockerImageInfo" + }, + "charm-storage": { + "$ref": "#/definitions/KubernetesFilesystemParams" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "image-details": { + "$ref": "#/definitions/DockerImageInfo" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "image-details", + "base-image-details", + "version", + "api-addresses" + ] + }, + "OperatorProvisioningInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/OperatorProvisioningInfo" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "CAASOperatorUpgrader", + "Description": "", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "UpgradeOperator": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/KubernetesUpgradeArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "UpgradeOperator upgrades the operator for the specified agents." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "KubernetesUpgradeArg": { + "type": "object", + "properties": { + "agent-tag": { + "type": "string" + }, + "version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "agent-tag", + "version" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + } + } + } + }, + { + "Name": "CAASUnitProvisioner", + "Description": "", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ApplicationCharmInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/Charm" + } + }, + "description": "ApplicationCharmInfo returns information about an application's charm." + }, + "ApplicationsConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetConfigResults" + } + }, + "description": "ApplicationsConfig returns the config for the specified applications." + }, + "ApplicationsScale": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/IntResults" + } + }, + "description": "ApplicationsScale returns the scaling info for specified applications in this model." + }, + "ApplicationsTrust": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + }, + "description": "ApplicationsTrust returns the trust status for specified applications in this model." + }, + "CharmInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURL" + }, + "Result": { + "$ref": "#/definitions/Charm" + } + }, + "description": "CharmInfo returns information about the requested charm." + }, + "ClearApplicationsResources": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ClearApplicationsResources clears the flags which indicate\napplications still have resources in the cluster." + }, + "DeploymentMode": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "DeploymentMode returns the deployment mode of the given applications' charms." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "ProvisioningInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/KubernetesProvisioningInfoResults" + } + }, + "description": "ProvisioningInfo returns the provisioning info for specified applications in this model." + }, + "SetOperatorStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetOperatorStatus updates the operator status for each given application." + }, + "UpdateApplicationsService": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateApplicationServiceArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdateApplicationsService updates the Juju data model to reflect the given\nservice details of the specified application." + }, + "UpdateApplicationsUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateApplicationUnitArgs" + }, + "Result": { + "$ref": "#/definitions/UpdateApplicationUnitResults" + } + }, + "description": "UpdateApplicationsUnits updates the Juju data model to reflect the given\nunits of the specified application." + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "Watch starts a NotifyWatcher for each entity given." + }, + "WatchApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchApplications starts a StringsWatcher to watch applications\ndeployed to this model." + }, + "WatchApplicationsScale": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchApplicationsScale starts a NotifyWatcher to watch changes\nto the applications' scale." + }, + "WatchApplicationsTrustHash": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchApplicationsTrustHash starts a StringsWatcher to watch changes\nto the applications' trust status." + }, + "WatchPodSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchPodSpec starts a NotifyWatcher to watch changes to the\npod spec for specified units in this model." + } + }, + "definitions": { + "Address": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "ApplicationGetConfigResults": { + "type": "object", + "properties": { + "Results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigResult" + } + } + }, + "additionalProperties": false, + "required": [ + "Results" + ] + }, + "ApplicationUnitInfo": { + "type": "object", + "properties": { + "provider-id": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "provider-id", + "unit-tag" + ] + }, + "ApplicationUnitParams": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "filesystem-info": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesFilesystemInfo" + } + }, + "info": { + "type": "string" + }, + "ports": { + "type": "array", + "items": { + "type": "string" + } + }, + "provider-id": { + "type": "string" + }, + "stateful": { + "type": "boolean" + }, + "status": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "provider-id", + "unit-tag", + "address", + "ports", + "status", + "info" + ] + }, + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Charm": { + "type": "object", + "properties": { + "actions": { + "$ref": "#/definitions/CharmActions" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmOption" + } + } + }, + "lxd-profile": { + "$ref": "#/definitions/CharmLXDProfile" + }, + "manifest": { + "$ref": "#/definitions/CharmManifest" + }, + "meta": { + "$ref": "#/definitions/CharmMeta" + }, + "metrics": { + "$ref": "#/definitions/CharmMetrics" + }, + "revision": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "url", + "config" + ] + }, + "CharmActionSpec": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "description", + "params" + ] + }, + "CharmActions": { + "type": "object", + "properties": { + "specs": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmActionSpec" + } + } + } + }, + "additionalProperties": false + }, + "CharmBase": { + "type": "object", + "properties": { + "architectures": { + "type": "array", + "items": { + "type": "string" + } + }, + "channel": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CharmContainer": { + "type": "object", + "properties": { + "gid": { + "type": "integer" + }, + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + }, + "uid": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "CharmDeployment": { + "type": "object", + "properties": { + "min-version": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "service": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "mode", + "service", + "min-version" + ] + }, + "CharmDevice": { + "type": "object", + "properties": { + "CountMax": { + "type": "integer" + }, + "CountMin": { + "type": "integer" + }, + "Description": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Name", + "Description", + "Type", + "CountMin", + "CountMax" + ] + }, + "CharmLXDProfile": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "description", + "devices" + ] + }, + "CharmManifest": { + "type": "object", + "properties": { + "bases": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmBase" + } + } + }, + "additionalProperties": false + }, + "CharmMeta": { + "type": "object", + "properties": { + "assumes-expr": { + "$ref": "#/definitions/ExpressionTree" + }, + "categories": { + "type": "array", + "items": { + "type": "string" + } + }, + "charm-user": { + "type": "string" + }, + "containers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmContainer" + } + } + }, + "deployment": { + "$ref": "#/definitions/CharmDeployment" + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmDevice" + } + } + }, + "extra-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "min-juju-version": { + "type": "string" + }, + "name": { + "type": "string" + }, + "payload-classes": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmPayloadClass" + } + } + }, + "peers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "provides": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "requires": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "resources": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmResourceMeta" + } + } + }, + "series": { + "type": "array", + "items": { + "type": "string" + } + }, + "storage": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmStorage" + } + } + }, + "subordinate": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "terms": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "name", + "summary", + "description", + "subordinate" + ] + }, + "CharmMetric": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "description" + ] + }, + "CharmMetrics": { + "type": "object", + "properties": { + "metrics": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmMetric" + } + } + }, + "plan": { + "$ref": "#/definitions/CharmPlan" + } + }, + "additionalProperties": false, + "required": [ + "metrics", + "plan" + ] + }, + "CharmMount": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "storage": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CharmOption": { + "type": "object", + "properties": { + "default": { + "type": "object", + "additionalProperties": true + }, + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "CharmPayloadClass": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type" + ] + }, + "CharmPlan": { + "type": "object", + "properties": { + "required": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "required" + ] + }, + "CharmRelation": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "optional", + "limit", + "scope" + ] + }, + "CharmResourceMeta": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "description" + ] + }, + "CharmStorage": { + "type": "object", + "properties": { + "count-max": { + "type": "integer" + }, + "count-min": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "location": { + "type": "string" + }, + "minimum-size": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "properties": { + "type": "array", + "items": { + "type": "string" + } + }, + "read-only": { + "type": "boolean" + }, + "shared": { + "type": "boolean" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "description", + "type", + "shared", + "read-only", + "count-min", + "count-max", + "minimum-size" + ] + }, + "CharmURL": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url" + ] + }, + "ConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "DockerImageInfo": { + "type": "object", + "properties": { + "auth": { + "type": "string" + }, + "email": { + "type": "string" + }, + "identitytoken": { + "type": "string" + }, + "image-name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "registrytoken": { + "type": "string" + }, + "repository": { + "type": "string" + }, + "serveraddress": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "image-name" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ExpressionTree": { + "type": "object", + "properties": { + "Expression": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "Expression" + ] + }, + "IntResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "IntResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/IntResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "KubernetesDeploymentInfo": { + "type": "object", + "properties": { + "deployment-type": { + "type": "string" + }, + "service-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "deployment-type", + "service-type" + ] + }, + "KubernetesDeviceParams": { + "type": "object", + "properties": { + "Attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "Count": { + "type": "integer" + }, + "Type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Type", + "Count", + "Attributes" + ] + }, + "KubernetesFilesystemAttachmentParams": { + "type": "object", + "properties": { + "mount-point": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "provider" + ] + }, + "KubernetesFilesystemInfo": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "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" + } + }, + "additionalProperties": false, + "required": [ + "storagename", + "pool", + "size", + "filesystem-id", + "status", + "info", + "volume" + ] + }, + "KubernetesFilesystemParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/KubernetesFilesystemAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "storagename": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "storagename", + "size", + "provider" + ] + }, + "KubernetesProvisioningInfo": { + "type": "object", + "properties": { + "charm-modified-version": { + "type": "integer" + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "deployment-info": { + "$ref": "#/definitions/KubernetesDeploymentInfo" + }, + "devices": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesDeviceParams" + } + }, + "filesystems": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesFilesystemParams" + } + }, + "image-repo": { + "$ref": "#/definitions/DockerImageInfo" + }, + "pod-spec": { + "type": "string" + }, + "raw-k8s-spec": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesVolumeParams" + } + } + }, + "additionalProperties": false, + "required": [ + "pod-spec", + "constraints" + ] + }, + "KubernetesProvisioningInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/KubernetesProvisioningInfo" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "KubernetesProvisioningInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/KubernetesProvisioningInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "KubernetesVolumeAttachmentParams": { + "type": "object", + "properties": { + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "provider" + ] + }, + "KubernetesVolumeInfo": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "persistent": { + "type": "boolean" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "volume-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-id", + "size", + "persistent", + "status", + "info" + ] + }, + "KubernetesVolumeParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/KubernetesVolumeAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "storagename": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "storagename", + "size", + "provider" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UpdateApplicationServiceArg": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "application-tag": { + "type": "string" + }, + "generation": { + "type": "integer" + }, + "provider-id": { + "type": "string" + }, + "scale": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "application-tag", + "provider-id", + "addresses" + ] + }, + "UpdateApplicationServiceArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateApplicationServiceArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UpdateApplicationUnitArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateApplicationUnits" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UpdateApplicationUnitResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "$ref": "#/definitions/UpdateApplicationUnitsInfo" + } + }, + "additionalProperties": false + }, + "UpdateApplicationUnitResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateApplicationUnitResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UpdateApplicationUnits": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + }, + "generation": { + "type": "integer" + }, + "scale": { + "type": "integer" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "units": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationUnitParams" + } + } + }, + "additionalProperties": false, + "required": [ + "application-tag", + "units" + ] + }, + "UpdateApplicationUnitsInfo": { + "type": "object", + "properties": { + "units": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationUnitInfo" + } + } + }, + "additionalProperties": false, + "required": [ + "units" + ] + }, + "Value": { + "type": "object", + "properties": { + "allocate-public-ip": { + "type": "boolean" + }, + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "image-id": { + "type": "string" + }, + "instance-role": { + "type": "string" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "CharmDownloader", + "Description": "CharmDownloaderAPI implements an API for watching the charms collection for\nany entries that have not been yet downloaded to the blobstore and for\ntriggering their download.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "DownloadApplicationCharms": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "DownloadApplicationCharms iterates the list of provided applications and\ndownloads any referenced charms that have not yet been persisted to the\nblob store." + }, + "WatchApplicationsWithPendingCharms": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchApplicationsWithPendingCharms registers and returns a watcher instance\nthat reports the ID of applications that reference a charm which has not yet\nbeen downloaded." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "CharmRevisionUpdater", + "Description": "CharmRevisionUpdaterAPI implements the CharmRevisionUpdater interface and is the concrete\nimplementation of the api end point.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "UpdateLatestRevisions": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "UpdateLatestRevisions retrieves the latest revision information from the charm store for all deployed charms\nand records this information in state." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "Charms", + "Description": "APIv7 provides the Charms API facade for version 7.\nv7 guarantees SupportedBases will be provided in ResolveCharms", + "Version": 7, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AddCharm": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddCharmWithOrigin" + }, + "Result": { + "$ref": "#/definitions/CharmOriginResult" + } + }, + "description": "AddCharm adds the given charm URL (which must include revision) to the\nenvironment, if it does not exist yet. Local charms are not supported,\nonly charm store and charm hub URLs. See also AddLocalCharm()." + }, + "CharmInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURL" + }, + "Result": { + "$ref": "#/definitions/Charm" + } + }, + "description": "CharmInfo returns information about the requested charm." + }, + "CheckCharmPlacement": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationCharmPlacements" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "CheckCharmPlacement checks if a charm is allowed to be placed with in a\ngiven application." + }, + "GetDownloadInfos": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURLAndOrigins" + }, + "Result": { + "$ref": "#/definitions/DownloadInfoResults" + } + }, + "description": "GetDownloadInfos attempts to get the bundle corresponding to the charm url\nand origin." + }, + "IsMetered": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURL" + }, + "Result": { + "$ref": "#/definitions/IsMeteredResult" + } + }, + "description": "IsMetered returns whether or not the charm is metered.\nTODO (cderici) only used for metered charms in cmd MeteredDeployAPI,\nkept for client compatibility, remove in juju 4.0" + }, + "List": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmsList" + }, + "Result": { + "$ref": "#/definitions/CharmsListResult" + } + }, + "description": "List returns a list of charm URLs currently in the state.\nIf supplied parameter contains any names, the result will\nbe filtered to return only the charms with supplied names." + }, + "ListCharmResources": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURLAndOrigins" + }, + "Result": { + "$ref": "#/definitions/CharmResourcesResults" + } + }, + "description": "ListCharmResources returns a series of resources for a given charm." + }, + "ResolveCharms": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ResolveCharmsWithChannel" + }, + "Result": { + "$ref": "#/definitions/ResolveCharmWithChannelResults" + } + }, + "description": "ResolveCharms resolves the given charm URLs with an optionally specified\npreferred channel. Channel provided via CharmOrigin." + } + }, + "definitions": { + "AddCharmWithOrigin": { + "type": "object", + "properties": { + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "force": { + "type": "boolean" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "charm-origin", + "force" + ] + }, + "ApplicationCharmPlacement": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "charm-url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "charm-url" + ] + }, + "ApplicationCharmPlacements": { + "type": "object", + "properties": { + "placements": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationCharmPlacement" + } + } + }, + "additionalProperties": false, + "required": [ + "placements" + ] + }, + "Base": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "channel" + ] + }, + "Charm": { + "type": "object", + "properties": { + "actions": { + "$ref": "#/definitions/CharmActions" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmOption" + } + } + }, + "lxd-profile": { + "$ref": "#/definitions/CharmLXDProfile" + }, + "manifest": { + "$ref": "#/definitions/CharmManifest" + }, + "meta": { + "$ref": "#/definitions/CharmMeta" + }, + "metrics": { + "$ref": "#/definitions/CharmMetrics" + }, + "revision": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "url", + "config" + ] + }, + "CharmActionSpec": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "description", + "params" + ] + }, + "CharmActions": { + "type": "object", + "properties": { + "specs": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmActionSpec" + } + } + } + }, + "additionalProperties": false + }, + "CharmBase": { + "type": "object", + "properties": { + "architectures": { + "type": "array", + "items": { + "type": "string" + } + }, + "channel": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CharmContainer": { + "type": "object", + "properties": { + "gid": { + "type": "integer" + }, + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + }, + "uid": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "CharmDeployment": { + "type": "object", + "properties": { + "min-version": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "service": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "mode", + "service", + "min-version" + ] + }, + "CharmDevice": { + "type": "object", + "properties": { + "CountMax": { + "type": "integer" + }, + "CountMin": { + "type": "integer" + }, + "Description": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "Type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Name", + "Description", + "Type", + "CountMin", + "CountMax" + ] + }, + "CharmLXDProfile": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "description", + "devices" + ] + }, + "CharmManifest": { + "type": "object", + "properties": { + "bases": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmBase" + } + } + }, + "additionalProperties": false + }, + "CharmMeta": { + "type": "object", + "properties": { + "assumes-expr": { + "$ref": "#/definitions/ExpressionTree" + }, + "categories": { + "type": "array", + "items": { + "type": "string" + } + }, + "charm-user": { + "type": "string" + }, + "containers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmContainer" + } + } + }, + "deployment": { + "$ref": "#/definitions/CharmDeployment" + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmDevice" + } + } + }, + "extra-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "min-juju-version": { + "type": "string" + }, + "name": { + "type": "string" + }, + "payload-classes": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmPayloadClass" + } + } + }, + "peers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "provides": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "requires": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmRelation" + } + } + }, + "resources": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmResourceMeta" + } + } + }, + "series": { + "type": "array", + "items": { + "type": "string" + } + }, + "storage": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmStorage" + } + } + }, + "subordinate": { + "type": "boolean" + }, + "summary": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "terms": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "name", + "summary", + "description", + "subordinate" + ] + }, + "CharmMetric": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "description" + ] + }, + "CharmMetrics": { + "type": "object", + "properties": { + "metrics": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmMetric" + } + } + }, + "plan": { + "$ref": "#/definitions/CharmPlan" + } + }, + "additionalProperties": false, + "required": [ + "metrics", + "plan" + ] + }, + "CharmMount": { + "type": "object", + "properties": { + "location": { + "type": "string" + }, + "storage": { + "type": "string" + } + }, + "additionalProperties": false + }, + "CharmOption": { + "type": "object", + "properties": { + "default": { + "type": "object", + "additionalProperties": true + }, + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "CharmOrigin": { + "type": "object", + "properties": { + "architecture": { + "type": "string" + }, + "base": { + "$ref": "#/definitions/Base" + }, + "branch": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "id": { + "type": "string" + }, + "instance-key": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "risk": { + "type": "string" + }, + "source": { + "type": "string" + }, + "track": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "source", + "type", + "id" + ] + }, + "CharmOriginResult": { + "type": "object", + "properties": { + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "charm-origin" + ] + }, + "CharmPayloadClass": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type" + ] + }, + "CharmPlan": { + "type": "object", + "properties": { + "required": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "required" + ] + }, + "CharmRelation": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "optional", + "limit", + "scope" + ] + }, + "CharmResource": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "fingerprint": { + "type": "array", + "items": { + "type": "integer" + } + }, + "name": { + "type": "string" + }, + "origin": { + "type": "string" + }, + "path": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "origin", + "revision", + "fingerprint", + "size" + ] + }, + "CharmResourceMeta": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "path": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "description" + ] + }, + "CharmResourceResult": { + "type": "object", + "properties": { + "CharmResource": { + "$ref": "#/definitions/CharmResource" + }, + "ErrorResult": { + "$ref": "#/definitions/ErrorResult" + }, + "description": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "fingerprint": { + "type": "array", + "items": { + "type": "integer" + } + }, + "name": { + "type": "string" + }, + "origin": { + "type": "string" + }, + "path": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "ErrorResult", + "name", + "type", + "path", + "origin", + "revision", + "fingerprint", + "size", + "CharmResource" + ] + }, + "CharmResourcesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmResourceResult" + } + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "CharmStorage": { + "type": "object", + "properties": { + "count-max": { + "type": "integer" + }, + "count-min": { + "type": "integer" + }, + "description": { + "type": "string" + }, + "location": { + "type": "string" + }, + "minimum-size": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "properties": { + "type": "array", + "items": { + "type": "string" + } + }, + "read-only": { + "type": "boolean" + }, + "shared": { + "type": "boolean" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "description", + "type", + "shared", + "read-only", + "count-min", + "count-max", + "minimum-size" + ] + }, + "CharmURL": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url" + ] + }, + "CharmURLAndOrigin": { + "type": "object", + "properties": { + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "charm-url": { + "type": "string" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + } + }, + "additionalProperties": false, + "required": [ + "charm-url", + "charm-origin" + ] + }, + "CharmURLAndOrigins": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmURLAndOrigin" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "CharmsList": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "names" + ] + }, + "CharmsListResult": { + "type": "object", + "properties": { + "charm-urls": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "charm-urls" + ] + }, + "DownloadInfoResult": { + "type": "object", + "properties": { + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "charm-origin" + ] + }, + "DownloadInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/DownloadInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ExpressionTree": { + "type": "object", + "properties": { + "Expression": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "Expression" + ] + }, + "IsMeteredResult": { + "type": "object", + "properties": { + "metered": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "metered" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "ResolveCharmWithChannel": { + "type": "object", + "properties": { + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "reference": { + "type": "string" + }, + "switch-charm": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "reference", + "charm-origin" + ] + }, + "ResolveCharmWithChannelResult": { + "type": "object", + "properties": { + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "supported-bases": { + "type": "array", + "items": { + "$ref": "#/definitions/Base" + } + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "charm-origin", + "supported-bases" + ] + }, + "ResolveCharmWithChannelResults": { + "type": "object", + "properties": { + "Results": { + "type": "array", + "items": { + "$ref": "#/definitions/ResolveCharmWithChannelResult" + } + } + }, + "additionalProperties": false, + "required": [ + "Results" + ] + }, + "ResolveCharmsWithChannel": { + "type": "object", + "properties": { + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "resolve": { + "type": "array", + "items": { + "$ref": "#/definitions/ResolveCharmWithChannel" + } + } + }, + "additionalProperties": false, + "required": [ + "resolve" + ] + } + } + } + }, + { + "Name": "Cleaner", + "Description": "CleanerAPI implements the API used by the cleaner worker.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "Cleanup": { + "type": "object", + "description": "Cleanup triggers a state cleanup" + }, + "WatchCleanups": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchCleanups watches for cleanups to be performed in state." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + } + } + } + }, + { + "Name": "Client", + "Description": "Client serves client-specific API methods.", + "Version": 7, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "FindTools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FindToolsParams" + }, + "Result": { + "$ref": "#/definitions/FindToolsResult" + } + }, + "description": "FindTools returns a List containing all tools matching the given parameters.\nTODO(juju 3.1) - remove, used by 2.9 client only" + }, + "FullStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StatusParams" + }, + "Result": { + "$ref": "#/definitions/FullStatus" + } + }, + "description": "FullStatus gives the information needed for juju status over the api" + }, + "StatusHistory": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StatusHistoryRequests" + }, + "Result": { + "$ref": "#/definitions/StatusHistoryResults" + } + }, + "description": "StatusHistory returns a slice of past statuses for several entities." + }, + "WatchAll": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/AllWatcherId" + } + }, + "description": "WatchAll initiates a watcher for entities in the connected model." + } + }, + "definitions": { + "AllWatcherId": { + "type": "object", + "properties": { + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "ApplicationOfferStatus": { + "type": "object", + "properties": { + "active-connected-count": { + "type": "integer" + }, + "application-name": { + "type": "string" + }, + "charm": { + "type": "string" + }, + "endpoints": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/RemoteEndpoint" + } + } + }, + "err": { + "$ref": "#/definitions/Error" + }, + "offer-name": { + "type": "string" + }, + "total-connected-count": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "offer-name", + "application-name", + "charm", + "endpoints", + "active-connected-count", + "total-connected-count" + ] + }, + "ApplicationStatus": { + "type": "object", + "properties": { + "base": { + "$ref": "#/definitions/Base" + }, + "can-upgrade-to": { + "type": "string" + }, + "charm": { + "type": "string" + }, + "charm-channel": { + "type": "string" + }, + "charm-profile": { + "type": "string" + }, + "charm-version": { + "type": "string" + }, + "endpoint-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "err": { + "$ref": "#/definitions/Error" + }, + "exposed": { + "type": "boolean" + }, + "exposed-endpoints": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ExposedEndpoint" + } + } + }, + "int": { + "type": "integer" + }, + "life": { + "type": "string" + }, + "meter-statuses": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/MeterStatus" + } + } + }, + "provider-id": { + "type": "string" + }, + "public-address": { + "type": "string" + }, + "relations": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "status": { + "$ref": "#/definitions/DetailedStatus" + }, + "subordinate-to": { + "type": "array", + "items": { + "type": "string" + } + }, + "units": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/UnitStatus" + } + } + }, + "workload-version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "charm", + "charm-version", + "charm-profile", + "base", + "exposed", + "life", + "relations", + "can-upgrade-to", + "subordinate-to", + "units", + "meter-statuses", + "status", + "workload-version", + "endpoint-bindings", + "public-address" + ] + }, + "Base": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "channel" + ] + }, + "Binary": { + "type": "object", + "properties": { + "Arch": { + "type": "string" + }, + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Number": { + "$ref": "#/definitions/Number" + }, + "Patch": { + "type": "integer" + }, + "Release": { + "type": "string" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build", + "Number", + "Release", + "Arch" + ] + }, + "BranchStatus": { + "type": "object", + "properties": { + "assigned-units": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "created": { + "type": "integer" + }, + "created-by": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "assigned-units", + "created", + "created-by" + ] + }, + "DetailedStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "err": { + "$ref": "#/definitions/Error" + }, + "info": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "life": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "data", + "since", + "kind", + "version", + "life" + ] + }, + "EndpointStatus": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + }, + "subordinate": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "application", + "name", + "role", + "subordinate" + ] + }, + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ExposedEndpoint": { + "type": "object", + "properties": { + "expose-to-cidrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "expose-to-spaces": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "FilesystemAttachmentDetails": { + "type": "object", + "properties": { + "FilesystemAttachmentInfo": { + "$ref": "#/definitions/FilesystemAttachmentInfo" + }, + "life": { + "type": "string" + }, + "mount-point": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "FilesystemAttachmentInfo" + ] + }, + "FilesystemAttachmentInfo": { + "type": "object", + "properties": { + "mount-point": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "FilesystemDetails": { + "type": "object", + "properties": { + "filesystem-tag": { + "type": "string" + }, + "info": { + "$ref": "#/definitions/FilesystemInfo" + }, + "life": { + "type": "string" + }, + "machine-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/FilesystemAttachmentDetails" + } + } + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "storage": { + "$ref": "#/definitions/StorageDetails" + }, + "unit-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/FilesystemAttachmentDetails" + } + } + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-tag", + "info", + "status" + ] + }, + "FilesystemInfo": { + "type": "object", + "properties": { + "filesystem-id": { + "type": "string" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-id", + "pool", + "size" + ] + }, + "FindToolsParams": { + "type": "object", + "properties": { + "agentstream": { + "type": "string" + }, + "arch": { + "type": "string" + }, + "major": { + "type": "integer" + }, + "number": { + "$ref": "#/definitions/Number" + }, + "os-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "number", + "major", + "arch", + "os-type", + "agentstream" + ] + }, + "FindToolsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/Tools" + } + } + }, + "additionalProperties": false, + "required": [ + "list" + ] + }, + "FullStatus": { + "type": "object", + "properties": { + "applications": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ApplicationStatus" + } + } + }, + "branches": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/BranchStatus" + } + } + }, + "controller-timestamp": { + "type": "string", + "format": "date-time" + }, + "filesystems": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemDetails" + } + }, + "machines": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/MachineStatus" + } + } + }, + "model": { + "$ref": "#/definitions/ModelStatusInfo" + }, + "offers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ApplicationOfferStatus" + } + } + }, + "relations": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationStatus" + } + }, + "remote-applications": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/RemoteApplicationStatus" + } + } + }, + "storage": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageDetails" + } + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeDetails" + } + } + }, + "additionalProperties": false, + "required": [ + "model", + "machines", + "applications", + "remote-applications", + "offers", + "relations", + "controller-timestamp", + "branches" + ] + }, + "History": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "statuses": { + "type": "array", + "items": { + "$ref": "#/definitions/DetailedStatus" + } + } + }, + "additionalProperties": false, + "required": [ + "statuses" + ] + }, + "LXDProfile": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "description", + "devices" + ] + }, + "MachineStatus": { + "type": "object", + "properties": { + "agent-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "base": { + "$ref": "#/definitions/Base" + }, + "constraints": { + "type": "string" + }, + "containers": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/MachineStatus" + } + } + }, + "display-name": { + "type": "string" + }, + "dns-name": { + "type": "string" + }, + "hardware": { + "type": "string" + }, + "has-vote": { + "type": "boolean" + }, + "hostname": { + "type": "string" + }, + "id": { + "type": "string" + }, + "instance-id": { + "type": "string" + }, + "instance-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "ip-addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "jobs": { + "type": "array", + "items": { + "type": "string" + } + }, + "lxd-profiles": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/LXDProfile" + } + } + }, + "modification-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "network-interfaces": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/NetworkInterface" + } + } + }, + "primary-controller-machine": { + "type": "boolean" + }, + "wants-vote": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "agent-status", + "instance-status", + "modification-status", + "dns-name", + "instance-id", + "display-name", + "base", + "id", + "containers", + "constraints", + "hardware", + "jobs", + "has-vote", + "wants-vote" + ] + }, + "MeterStatus": { + "type": "object", + "properties": { + "color": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "color", + "message" + ] + }, + "ModelStatusInfo": { + "type": "object", + "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" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "cloud-tag", + "version", + "available-version", + "model-status", + "meter-status", + "sla" + ] + }, + "NetworkInterface": { + "type": "object", + "properties": { + "dns-nameservers": { + "type": "array", + "items": { + "type": "string" + } + }, + "gateway": { + "type": "string" + }, + "ip-addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "is-up": { + "type": "boolean" + }, + "mac-address": { + "type": "string" + }, + "space": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "ip-addresses", + "mac-address", + "is-up" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "RelationStatus": { + "type": "object", + "properties": { + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/EndpointStatus" + } + }, + "id": { + "type": "integer" + }, + "interface": { + "type": "string" + }, + "key": { + "type": "string" + }, + "scope": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/DetailedStatus" + } + }, + "additionalProperties": false, + "required": [ + "id", + "key", + "interface", + "scope", + "endpoints", + "status" + ] + }, + "RemoteApplicationStatus": { + "type": "object", + "properties": { + "endpoints": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEndpoint" + } + }, + "err": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + }, + "offer-name": { + "type": "string" + }, + "offer-url": { + "type": "string" + }, + "relations": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "status": { + "$ref": "#/definitions/DetailedStatus" + } + }, + "additionalProperties": false, + "required": [ + "offer-url", + "offer-name", + "endpoints", + "life", + "relations", + "status" + ] + }, + "RemoteEndpoint": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "limit" + ] + }, + "StatusHistoryFilter": { + "type": "object", + "properties": { + "date": { + "type": "string", + "format": "date-time" + }, + "delta": { + "type": "integer" + }, + "exclude": { + "type": "array", + "items": { + "type": "string" + } + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "size", + "date", + "delta", + "exclude" + ] + }, + "StatusHistoryRequest": { + "type": "object", + "properties": { + "filter": { + "$ref": "#/definitions/StatusHistoryFilter" + }, + "historyKind": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "historyKind", + "size", + "filter", + "tag" + ] + }, + "StatusHistoryRequests": { + "type": "object", + "properties": { + "requests": { + "type": "array", + "items": { + "$ref": "#/definitions/StatusHistoryRequest" + } + } + }, + "additionalProperties": false, + "required": [ + "requests" + ] + }, + "StatusHistoryResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "history": { + "$ref": "#/definitions/History" + } + }, + "additionalProperties": false, + "required": [ + "history" + ] + }, + "StatusHistoryResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StatusHistoryResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StatusParams": { + "type": "object", + "properties": { + "include-storage": { + "type": "boolean" + }, + "patterns": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "patterns" + ] + }, + "StorageAttachmentDetails": { + "type": "object", + "properties": { + "life": { + "type": "string" + }, + "location": { + "type": "string" + }, + "machine-tag": { + "type": "string" + }, + "storage-tag": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag", + "unit-tag", + "machine-tag" + ] + }, + "StorageDetails": { + "type": "object", + "properties": { + "attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/StorageAttachmentDetails" + } + } + }, + "kind": { + "type": "integer" + }, + "life": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "persistent": { + "type": "boolean" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "storage-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag", + "owner-tag", + "kind", + "status", + "persistent" + ] + }, + "Tools": { + "type": "object", + "properties": { + "sha256": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "version": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false, + "required": [ + "version", + "url", + "size" + ] + }, + "UnitStatus": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "agent-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "charm": { + "type": "string" + }, + "leader": { + "type": "boolean" + }, + "machine": { + "type": "string" + }, + "opened-ports": { + "type": "array", + "items": { + "type": "string" + } + }, + "provider-id": { + "type": "string" + }, + "public-address": { + "type": "string" + }, + "subordinates": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/UnitStatus" + } + } + }, + "workload-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "workload-version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "agent-status", + "workload-status", + "workload-version", + "machine", + "opened-ports", + "public-address", + "charm", + "subordinates" + ] + }, + "VolumeAttachmentDetails": { + "type": "object", + "properties": { + "VolumeAttachmentInfo": { + "$ref": "#/definitions/VolumeAttachmentInfo" + }, + "bus-address": { + "type": "string" + }, + "device-link": { + "type": "string" + }, + "device-name": { + "type": "string" + }, + "life": { + "type": "string" + }, + "plan-info": { + "$ref": "#/definitions/VolumeAttachmentPlanInfo" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "VolumeAttachmentInfo" + ] + }, + "VolumeAttachmentInfo": { + "type": "object", + "properties": { + "bus-address": { + "type": "string" + }, + "device-link": { + "type": "string" + }, + "device-name": { + "type": "string" + }, + "plan-info": { + "$ref": "#/definitions/VolumeAttachmentPlanInfo" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "VolumeAttachmentPlanInfo": { + "type": "object", + "properties": { + "device-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "device-type": { + "type": "string" + } + }, + "additionalProperties": false + }, + "VolumeDetails": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/VolumeInfo" + }, + "life": { + "type": "string" + }, + "machine-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/VolumeAttachmentDetails" + } + } + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "storage": { + "$ref": "#/definitions/StorageDetails" + }, + "unit-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/VolumeAttachmentDetails" + } + } + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "info", + "status" + ] + }, + "VolumeInfo": { + "type": "object", + "properties": { + "hardware-id": { + "type": "string" + }, + "persistent": { + "type": "boolean" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "volume-id": { + "type": "string" + }, + "wwn": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-id", + "size", + "persistent" + ] + } + } + } + }, + { + "Name": "Cloud", + "Description": "CloudAPI implements the cloud interface and is the concrete implementation\nof the api end point.", + "Version": 7, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "controller-user" + ], + "Schema": { + "type": "object", + "properties": { + "AddCloud": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddCloudArgs" + } + }, + "description": "AddCloud adds a new cloud, different from the one managed by the controller." + }, + "AddCredentials": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/TaggedCredentials" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "AddCredentials adds new credentials.\nIn contrast to UpdateCredentials() below, the new credentials can be\nfor a cloud that the controller does not manage (this is required\nfor CAAS models)" + }, + "CheckCredentialsModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/TaggedCredentials" + }, + "Result": { + "$ref": "#/definitions/UpdateCredentialResults" + } + }, + "description": "CheckCredentialsModels validates supplied cloud credentials' content against\nmodels that currently use these credentials.\nIf there are any models that are using a credential and these models or their\ncloud instances are not going to be accessible with corresponding credential,\nthere will be detailed validation errors per model.\nThere's no Juju API client which uses this, but JAAS does," + }, + "Cloud": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudResults" + } + }, + "description": "Cloud returns the cloud definitions for the specified clouds." + }, + "CloudInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudInfoResults" + } + }, + "description": "CloudInfo returns information about the specified clouds." + }, + "Clouds": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/CloudsResult" + } + }, + "description": "Clouds returns the definitions of all clouds supported by the controller\nthat the logged in user can see." + }, + "Credential": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudCredentialResults" + } + }, + "description": "Credential returns the specified cloud credential for each tag, minus secrets." + }, + "CredentialContents": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CloudCredentialArgs" + }, + "Result": { + "$ref": "#/definitions/CredentialContentResults" + } + }, + "description": "CredentialContents returns the specified cloud credentials,\nincluding the secrets if requested.\nIf no specific credential name/cloud was passed in, all credentials for this user\nare returned.\nOnly credential owner can see its contents as well as what models use it.\nController admin has no special superpowers here and is treated the same as all other users." + }, + "InstanceTypes": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CloudInstanceTypesConstraints" + }, + "Result": { + "$ref": "#/definitions/InstanceTypesResults" + } + }, + "description": "InstanceTypes returns instance type information for the cloud and region\nin which the current model is deployed." + }, + "ListCloudInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ListCloudsRequest" + }, + "Result": { + "$ref": "#/definitions/ListCloudInfoResults" + } + }, + "description": "ListCloudInfo returns clouds that the specified user has access to.\nController admins (superuser) can list clouds for any user.\nOther users can only ask about their own clouds." + }, + "ModifyCloudAccess": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyCloudAccessRequest" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ModifyCloudAccess changes the model access granted to users." + }, + "RemoveClouds": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RemoveClouds removes the specified clouds from the controller.\nIf a cloud is in use (has models deployed to it), the removal will fail." + }, + "RevokeCredentialsCheckModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RevokeCredentialArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RevokeCredentialsCheckModels revokes a set of cloud credentials.\nIf the credentials are used by any of the models, the credential deletion will be aborted.\nIf credential-in-use needs to be revoked nonetheless, this method allows the use of force." + }, + "UpdateCloud": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateCloudArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdateCloud updates an existing cloud that the controller knows about." + }, + "UpdateCredentialsCheckModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateCredentialArgs" + }, + "Result": { + "$ref": "#/definitions/UpdateCredentialResults" + } + }, + "description": "UpdateCredentialsCheckModels updates a set of cloud credentials' content.\nIf there are any models that are using a credential and these models\nare not going to be visible with updated credential content,\nthere will be detailed validation errors per model. Such model errors are returned\nseparately and do not contribute to the overall method error status.\nController admins can 'force' an update of the credential\nregardless of whether it is deemed valid or not." + }, + "UserCredentials": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UserClouds" + }, + "Result": { + "$ref": "#/definitions/StringsResults" + } + }, + "description": "UserCredentials returns the cloud credentials for a set of users." + } + }, + "definitions": { + "AddCloudArgs": { + "type": "object", + "properties": { + "cloud": { + "$ref": "#/definitions/Cloud" + }, + "force": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "cloud", + "name" + ] + }, + "Cloud": { + "type": "object", + "properties": { + "auth-types": { + "type": "array", + "items": { + "type": "string" + } + }, + "ca-certificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "endpoint": { + "type": "string" + }, + "host-cloud-region": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "is-controller-cloud": { + "type": "boolean" + }, + "region-config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + } + }, + "regions": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudRegion" + } + }, + "skip-tls-verify": { + "type": "boolean" + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudCredentialArg": { + "type": "object", + "properties": { + "cloud-name": { + "type": "string" + }, + "credential-name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "cloud-name", + "credential-name" + ] + }, + "CloudCredentialArgs": { + "type": "object", + "properties": { + "credentials": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudCredentialArg" + } + }, + "include-secrets": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "include-secrets" + ] + }, + "CloudCredentialResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudCredential" + } + }, + "additionalProperties": false + }, + "CloudCredentialResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudCredentialResult" + } + } + }, + "additionalProperties": false + }, + "CloudDetails": { + "type": "object", + "properties": { + "auth-types": { + "type": "array", + "items": { + "type": "string" + } + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "regions": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudRegion" + } + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "CloudInfo": { + "type": "object", + "properties": { + "CloudDetails": { + "$ref": "#/definitions/CloudDetails" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudUserInfo" + } + } + }, + "additionalProperties": false, + "required": [ + "CloudDetails", + "users" + ] + }, + "CloudInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudInfo" + } + }, + "additionalProperties": false + }, + "CloudInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "CloudInstanceTypesConstraint": { + "type": "object", + "properties": { + "cloud-tag": { + "type": "string" + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "region": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "cloud-tag", + "region" + ] + }, + "CloudInstanceTypesConstraints": { + "type": "object", + "properties": { + "constraints": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudInstanceTypesConstraint" + } + } + }, + "additionalProperties": false, + "required": [ + "constraints" + ] + }, + "CloudRegion": { + "type": "object", + "properties": { + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "name": { + "type": "string" + }, + "storage-endpoint": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + "CloudResult": { + "type": "object", + "properties": { + "cloud": { + "$ref": "#/definitions/Cloud" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "CloudResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudResult" + } + } + }, + "additionalProperties": false + }, + "CloudUserInfo": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "display-name": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user", + "display-name", + "access" + ] + }, + "CloudsResult": { + "type": "object", + "properties": { + "clouds": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/Cloud" + } + } + } + }, + "additionalProperties": false + }, + "ControllerCredentialInfo": { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/CredentialContent" + }, + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelAccess" + } + } + }, + "additionalProperties": false + }, + "CredentialContent": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "cloud": { + "type": "string" + }, + "name": { + "type": "string" + }, + "valid": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "name", + "cloud", + "auth-type" + ] + }, + "CredentialContentResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ControllerCredentialInfo" + } + }, + "additionalProperties": false + }, + "CredentialContentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CredentialContentResult" + } + } + }, + "additionalProperties": false + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "InstanceType": { + "type": "object", + "properties": { + "arches": { + "type": "array", + "items": { + "type": "string" + } + }, + "cost": { + "type": "integer" + }, + "cpu-cores": { + "type": "integer" + }, + "memory": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "root-disk": { + "type": "integer" + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "arches", + "cpu-cores", + "memory" + ] + }, + "InstanceTypesResult": { + "type": "object", + "properties": { + "cost-currency": { + "type": "string" + }, + "cost-divisor": { + "type": "integer" + }, + "cost-unit": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "instance-types": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceType" + } + } + }, + "additionalProperties": false + }, + "InstanceTypesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceTypesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListCloudInfo": { + "type": "object", + "properties": { + "CloudDetails": { + "$ref": "#/definitions/CloudDetails" + }, + "user-access": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "CloudDetails", + "user-access" + ] + }, + "ListCloudInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ListCloudInfo" + } + }, + "additionalProperties": false + }, + "ListCloudInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ListCloudInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListCloudsRequest": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag" + ] + }, + "ModelAccess": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "model": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ModifyCloudAccess": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "action": { + "type": "string" + }, + "cloud-tag": { + "type": "string" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag", + "cloud-tag", + "action", + "access" + ] + }, + "ModifyCloudAccessRequest": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/ModifyCloudAccess" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "RevokeCredentialArg": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force" + ] + }, + "RevokeCredentialArgs": { + "type": "object", + "properties": { + "credentials": { + "type": "array", + "items": { + "$ref": "#/definitions/RevokeCredentialArg" + } + } + }, + "additionalProperties": false, + "required": [ + "credentials" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "TaggedCredential": { + "type": "object", + "properties": { + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "credential" + ] + }, + "TaggedCredentials": { + "type": "object", + "properties": { + "credentials": { + "type": "array", + "items": { + "$ref": "#/definitions/TaggedCredential" + } + } + }, + "additionalProperties": false + }, + "UpdateCloudArgs": { + "type": "object", + "properties": { + "clouds": { + "type": "array", + "items": { + "$ref": "#/definitions/AddCloudArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "clouds" + ] + }, + "UpdateCredentialArgs": { + "type": "object", + "properties": { + "credentials": { + "type": "array", + "items": { + "$ref": "#/definitions/TaggedCredential" + } + }, + "force": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "credentials", + "force" + ] + }, + "UpdateCredentialModelResult": { + "type": "object", + "properties": { + "errors": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + }, + "name": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "name" + ] + }, + "UpdateCredentialResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateCredentialModelResult" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "UpdateCredentialResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateCredentialResult" + } + } + }, + "additionalProperties": false + }, + "UserCloud": { + "type": "object", + "properties": { + "cloud-tag": { + "type": "string" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag", + "cloud-tag" + ] + }, + "UserClouds": { + "type": "object", + "properties": { + "user-clouds": { + "type": "array", + "items": { + "$ref": "#/definitions/UserCloud" + } + } + }, + "additionalProperties": false + }, + "Value": { + "type": "object", + "properties": { + "allocate-public-ip": { + "type": "boolean" + }, + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "image-id": { + "type": "string" + }, + "instance-role": { + "type": "string" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "Controller", + "Description": "ControllerAPI provides the Controller API.", + "Version": 11, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "controller-user" + ], + "Schema": { + "type": "object", + "properties": { + "AllModels": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/UserModelList" + } + }, + "description": "AllModels allows controller administrators to get the list of all the\nmodels in the controller." + }, + "CloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResults" + } + }, + "description": "CloudSpec returns the model's cloud spec." + }, + "ConfigSet": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ControllerConfigSet" + } + }, + "description": "ConfigSet changes the value of specified controller configuration\nsettings. Only some settings can be changed after bootstrap.\nSettings that aren't specified in the params are left unchanged." + }, + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + }, + "description": "ControllerAPIInfoForModels returns the controller api connection details for the specified models." + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + }, + "description": "ControllerConfig returns the controller's configuration." + }, + "ControllerVersion": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerVersionResults" + } + }, + "description": "ControllerVersion returns the version information associated with this\ncontroller binary.\n\nNOTE: the implementation intentionally does not check for SuperuserAccess\nas the Version is known even to users with login access." + }, + "DashboardConnectionInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/DashboardConnectionInfo" + } + }, + "description": "DashboardConnectionInfo returns the connection information for a client to\nconnect to the Juju Dashboard including any proxying information." + }, + "DestroyController": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyControllerArgs" + } + }, + "description": "DestroyController destroys the controller.\n\nIf the args specify the destruction of the models, this method will\nattempt to do so. Otherwise, if the controller has any non-empty,\nnon-Dead hosted models, then an error with the code\nparams.CodeHasHostedModels will be transmitted." + }, + "GetCloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelTag" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResult" + } + }, + "description": "GetCloudSpec constructs the CloudSpec for a validated and authorized model." + }, + "GetControllerAccess": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UserAccessResults" + } + }, + "description": "GetControllerAccess returns the level of access the specified users\nhave on the controller." + }, + "HostedModelConfigs": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/HostedModelConfigsResults" + } + }, + "description": "HostedModelConfigs returns all the information that the client needs in\norder to connect directly with the host model's provider and destroy it\ndirectly." + }, + "IdentityProviderURL": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "IdentityProviderURL returns the URL of the configured external identity\nprovider for this controller or an empty string if no external identity\nprovider has been configured when the controller was bootstrapped.\n\nNOTE: the implementation intentionally does not check for SuperuserAccess\nas the URL is known even to users with login access." + }, + "InitiateMigration": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/InitiateMigrationArgs" + }, + "Result": { + "$ref": "#/definitions/InitiateMigrationResults" + } + }, + "description": "InitiateMigration attempts to begin the migration of one or\nmore models to other controllers." + }, + "ListBlockedModels": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelBlockInfoList" + } + }, + "description": "ListBlockedModels returns a list of all models on the controller\nwhich have a block in place. The resulting slice is sorted by model\nname, then owner. Callers must be controller administrators to retrieve the\nlist." + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResults" + } + }, + "description": "ModelConfig returns the model config for the controller\nmodel. For information on the current model, use\nclient.ModelGet" + }, + "ModelStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ModelStatusResults" + } + }, + "description": "ModelStatus returns a summary of the model." + }, + "ModifyControllerAccess": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyControllerAccessRequest" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ModifyControllerAccess changes the model access granted to users." + }, + "MongoVersion": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "MongoVersion allows the introspection of the mongo version per controller" + }, + "RemoveBlocks": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoveBlocksArgs" + } + }, + "description": "RemoveBlocks removes all the blocks in the controller." + }, + "WatchAllModelSummaries": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SummaryWatcherID" + } + }, + "description": "WatchAllModelSummaries starts watching the summary updates from the cache.\nThis method is superuser access only, and watches all models in the\ncontroller." + }, + "WatchAllModels": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/AllWatcherId" + } + }, + "description": "WatchAllModels starts watching events for all models in the\ncontroller. The returned AllWatcherId should be used with Next on the\nAllModelWatcher endpoint to receive deltas." + }, + "WatchCloudSpecsChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchCloudSpecsChanges returns a watcher for cloud spec changes." + }, + "WatchModelSummaries": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SummaryWatcherID" + } + }, + "description": "WatchModelSummaries starts watching the summary updates from the cache.\nOnly models that the user has access to are returned." + } + }, + "definitions": { + "AllWatcherId": { + "type": "object", + "properties": { + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudSpec": { + "type": "object", + "properties": { + "cacertificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "is-controller-cloud": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "skip-tls-verify": { + "type": "boolean" + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "name" + ] + }, + "CloudSpecResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudSpec" + } + }, + "additionalProperties": false + }, + "CloudSpecResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "additionalProperties": false + }, + "ConfigValue": { + "type": "object", + "properties": { + "source": { + "type": "string" + }, + "value": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "value", + "source" + ] + }, + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ControllerConfigSet": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ControllerVersionResults": { + "type": "object", + "properties": { + "git-commit": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "version", + "git-commit" + ] + }, + "DashboardConnectionInfo": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "proxy-connection": { + "$ref": "#/definitions/Proxy" + }, + "ssh-connection": { + "$ref": "#/definitions/DashboardConnectionSSHTunnel" + } + }, + "additionalProperties": false, + "required": [ + "proxy-connection", + "ssh-connection" + ] + }, + "DashboardConnectionSSHTunnel": { + "type": "object", + "properties": { + "entity": { + "type": "string" + }, + "host": { + "type": "string" + }, + "model": { + "type": "string" + }, + "port": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "host", + "port" + ] + }, + "DestroyControllerArgs": { + "type": "object", + "properties": { + "destroy-models": { + "type": "boolean" + }, + "destroy-storage": { + "type": "boolean" + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + }, + "model-timeout": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "destroy-models" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "HostedModelConfig": { + "type": "object", + "properties": { + "cloud-spec": { + "$ref": "#/definitions/CloudSpec" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "name": { + "type": "string" + }, + "owner": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "owner" + ] + }, + "HostedModelConfigsResults": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/HostedModelConfig" + } + } + }, + "additionalProperties": false, + "required": [ + "models" + ] + }, + "InitiateMigrationArgs": { + "type": "object", + "properties": { + "specs": { + "type": "array", + "items": { + "$ref": "#/definitions/MigrationSpec" + } + } + }, + "additionalProperties": false, + "required": [ + "specs" + ] + }, + "InitiateMigrationResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "migration-id": { + "type": "string" + }, + "model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "migration-id" + ] + }, + "InitiateMigrationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/InitiateMigrationResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineHardware": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "availability-zone": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false + }, + "MigrationSpec": { + "type": "object", + "properties": { + "model-tag": { + "type": "string" + }, + "target-info": { + "$ref": "#/definitions/MigrationTargetInfo" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "target-info" + ] + }, + "MigrationTargetInfo": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "auth-tag": { + "type": "string" + }, + "ca-cert": { + "type": "string" + }, + "controller-alias": { + "type": "string" + }, + "controller-tag": { + "type": "string" + }, + "macaroons": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "controller-tag", + "addrs", + "ca-cert", + "auth-tag" + ] + }, + "Model": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "type": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "uuid", + "type", + "owner-tag" + ] + }, + "ModelApplicationInfo": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + "ModelBlockInfo": { + "type": "object", + "properties": { + "blocks": { + "type": "array", + "items": { + "type": "string" + } + }, + "model-uuid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "model-uuid", + "owner-tag", + "blocks" + ] + }, + "ModelBlockInfoList": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelBlockInfo" + } + } + }, + "additionalProperties": false + }, + "ModelConfigResults": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ConfigValue" + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelFilesystemInfo": { + "type": "object", + "properties": { + "detachable": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "ModelMachineInfo": { + "type": "object", + "properties": { + "display-name": { + "type": "string" + }, + "ha-primary": { + "type": "boolean" + }, + "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" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "ModelStatus": { + "type": "object", + "properties": { + "application-count": { + "type": "integer" + }, + "applications": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelApplicationInfo" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "filesystems": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelFilesystemInfo" + } + }, + "hosted-machine-count": { + "type": "integer" + }, + "life": { + "type": "string" + }, + "machines": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelMachineInfo" + } + }, + "model-tag": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "type": { + "type": "string" + }, + "unit-count": { + "type": "integer" + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelVolumeInfo" + } + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "life", + "type", + "hosted-machine-count", + "application-count", + "unit-count", + "owner-tag" + ] + }, + "ModelStatusResults": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelStatus" + } + } + }, + "additionalProperties": false, + "required": [ + "models" + ] + }, + "ModelTag": { + "type": "object", + "additionalProperties": false + }, + "ModelVolumeInfo": { + "type": "object", + "properties": { + "detachable": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "ModifyControllerAccess": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "action": { + "type": "string" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag", + "action", + "access" + ] + }, + "ModifyControllerAccessRequest": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/ModifyControllerAccess" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Proxy": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "config", + "type" + ] + }, + "RemoveBlocksArgs": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "all" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "SummaryWatcherID": { + "type": "object", + "properties": { + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "UserAccess": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag", + "access" + ] + }, + "UserAccessResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/UserAccess" + } + }, + "additionalProperties": false + }, + "UserAccessResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UserAccessResult" + } + } + }, + "additionalProperties": false + }, + "UserModel": { + "type": "object", + "properties": { + "last-connection": { + "type": "string", + "format": "date-time" + }, + "model": { + "$ref": "#/definitions/Model" + } + }, + "additionalProperties": false, + "required": [ + "model", + "last-connection" + ] + }, + "UserModelList": { + "type": "object", + "properties": { + "user-models": { + "type": "array", + "items": { + "$ref": "#/definitions/UserModel" + } + } + }, + "additionalProperties": false, + "required": [ + "user-models" + ] + } + } + } + }, + { + "Name": "CredentialManager", + "Description": "", + "Version": 1, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "InvalidateModelCredential": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/InvalidateCredentialArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "InvalidateModelCredential marks the cloud credential for this model as invalid." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "InvalidateCredentialArg": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "CredentialValidator", + "Description": "", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "InvalidateModelCredential": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/InvalidateCredentialArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "InvalidateModelCredential marks the cloud credential for this model as invalid." + }, + "ModelCredential": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelCredential" + } + }, + "description": "ModelCredential returns cloud credential information for a model." + }, + "WatchCredential": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchCredential returns a NotifyWatcher that observes\nchanges to a given cloud credential." + }, + "WatchModelCredential": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchModelCredential returns a NotifyWatcher that watches what cloud credential a model uses." + } + }, + "definitions": { + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "InvalidateCredentialArg": { + "type": "object", + "properties": { + "reason": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ModelCredential": { + "type": "object", + "properties": { + "credential-tag": { + "type": "string" + }, + "exists": { + "type": "boolean" + }, + "model-tag": { + "type": "string" + }, + "valid": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "credential-tag" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + } + } + } + }, + { + "Name": "CrossController", + "Description": "CrossControllerAPI provides access to the CrossModelRelations API facade.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "controller-user" + ], + "Schema": { + "type": "object", + "properties": { + "ControllerInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + }, + "description": "ControllerInfo returns the API info for the controller." + }, + "WatchControllerInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchControllerInfo creates a watcher that notifies when the API info\nfor the controller changes." + } + }, + "definitions": { + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "CrossModelRelations", + "Description": "CrossModelRelationsAPIv3 provides access to the CrossModelRelations API facade.", + "Version": 3, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "PublishIngressNetworkChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/IngressNetworksChanges" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "PublishIngressNetworkChanges publishes changes to the required\ningress addresses to the model hosting the offer in the relation." + }, + "PublishRelationChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoteRelationsChanges" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "PublishRelationChanges publishes relation changes to the\nmodel hosting the remote application involved in the relation." + }, + "RegisterRemoteRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RegisterRemoteRelationArgs" + }, + "Result": { + "$ref": "#/definitions/RegisterRemoteRelationResults" + } + }, + "description": "RegisterRemoteRelations sets up the model to participate\nin the specified relations. This operation is idempotent." + }, + "WatchConsumedSecretsChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/WatchRemoteSecretChangesArgs" + }, + "Result": { + "$ref": "#/definitions/SecretRevisionWatchResults" + } + }, + "description": "WatchConsumedSecretsChanges returns a watcher which notifies of changes to any secrets\nfor the specified remote consumers." + }, + "WatchEgressAddressesForRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoteEntityArgs" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchEgressAddressesForRelations creates a watcher that notifies when addresses, from which\nconnections will originate for the relation, change.\nEach event contains the entire set of addresses which are required for ingress for the relation." + }, + "WatchOfferStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/OfferArgs" + }, + "Result": { + "$ref": "#/definitions/OfferStatusWatchResults" + } + }, + "description": "WatchOfferStatus starts an OfferStatusWatcher for\nwatching the status of an offer." + }, + "WatchRelationChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoteEntityArgs" + }, + "Result": { + "$ref": "#/definitions/RemoteRelationWatchResults" + } + }, + "description": "WatchRelationChanges starts a RemoteRelationChangesWatcher for each\nspecified relation, returning the watcher IDs and initial values,\nor an error if the remote relations couldn't be watched." + }, + "WatchRelationsSuspendedStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoteEntityArgs" + }, + "Result": { + "$ref": "#/definitions/RelationStatusWatchResults" + } + }, + "description": "WatchRelationsSuspendedStatus starts a RelationStatusWatcher for\nwatching the life and suspended status of a relation." + } + }, + "definitions": { + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "IngressNetworksChangeEvent": { + "type": "object", + "properties": { + "bakery-version": { + "type": "integer" + }, + "ingress-required": { + "type": "boolean" + }, + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "networks": { + "type": "array", + "items": { + "type": "string" + } + }, + "relation-token": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation-token", + "ingress-required" + ] + }, + "IngressNetworksChanges": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/IngressNetworksChangeEvent" + } + } + }, + "additionalProperties": false + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "OfferArg": { + "type": "object", + "properties": { + "bakery-version": { + "type": "integer" + }, + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "offer-uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "offer-uuid" + ] + }, + "OfferArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "OfferStatusChange": { + "type": "object", + "properties": { + "offer-name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + } + }, + "additionalProperties": false, + "required": [ + "offer-name", + "status" + ] + }, + "OfferStatusWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferStatusChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "OfferStatusWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferStatusWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RegisterRemoteRelationArg": { + "type": "object", + "properties": { + "application-token": { + "type": "string" + }, + "bakery-version": { + "type": "integer" + }, + "consume-version": { + "type": "integer" + }, + "local-endpoint-name": { + "type": "string" + }, + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "offer-uuid": { + "type": "string" + }, + "relation-token": { + "type": "string" + }, + "remote-endpoint": { + "$ref": "#/definitions/RemoteEndpoint" + }, + "source-model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application-token", + "source-model-tag", + "relation-token", + "remote-endpoint", + "offer-uuid", + "local-endpoint-name" + ] + }, + "RegisterRemoteRelationArgs": { + "type": "object", + "properties": { + "relations": { + "type": "array", + "items": { + "$ref": "#/definitions/RegisterRemoteRelationArg" + } + } + }, + "additionalProperties": false, + "required": [ + "relations" + ] + }, + "RegisterRemoteRelationResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RemoteRelationDetails" + } + }, + "additionalProperties": false + }, + "RegisterRemoteRelationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RegisterRemoteRelationResult" + } + } + }, + "additionalProperties": false + }, + "RelationLifeSuspendedStatusChange": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "life": { + "type": "string" + }, + "suspended": { + "type": "boolean" + }, + "suspended-reason": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "key", + "life", + "suspended", + "suspended-reason" + ] + }, + "RelationLifeSuspendedStatusWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationLifeSuspendedStatusChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "RelationStatusWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationLifeSuspendedStatusWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoteEndpoint": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "limit" + ] + }, + "RemoteEntityArg": { + "type": "object", + "properties": { + "bakery-version": { + "type": "integer" + }, + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "relation-token": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation-token" + ] + }, + "RemoteEntityArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEntityArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "RemoteRelationChangeEvent": { + "type": "object", + "properties": { + "application-settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "application-token": { + "type": "string" + }, + "bakery-version": { + "type": "integer" + }, + "changed-units": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationUnitChange" + } + }, + "departed-units": { + "type": "array", + "items": { + "type": "integer" + } + }, + "force-cleanup": { + "type": "boolean" + }, + "life": { + "type": "string" + }, + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "relation-token": { + "type": "string" + }, + "suspended": { + "type": "boolean" + }, + "suspended-reason": { + "type": "string" + }, + "unit-count": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "relation-token", + "application-token", + "life", + "unit-count" + ] + }, + "RemoteRelationDetails": { + "type": "object", + "properties": { + "bakery-version": { + "type": "integer" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "relation-token": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation-token" + ] + }, + "RemoteRelationUnitChange": { + "type": "object", + "properties": { + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "unit-id": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "unit-id" + ] + }, + "RemoteRelationWatchResult": { + "type": "object", + "properties": { + "changes": { + "$ref": "#/definitions/RemoteRelationChangeEvent" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "RemoteRelationWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoteRelationsChanges": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationChangeEvent" + } + } + }, + "additionalProperties": false + }, + "SecretRevisionChange": { + "type": "object", + "properties": { + "revision": { + "type": "integer" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "revision" + ] + }, + "SecretRevisionWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRevisionChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "SecretRevisionWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRevisionWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "WatchRemoteSecretChangesArg": { + "type": "object", + "properties": { + "application-token": { + "type": "string" + }, + "bakery-version": { + "type": "integer" + }, + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "relation-token": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application-token", + "relation-token" + ] + }, + "WatchRemoteSecretChangesArgs": { + "type": "object", + "properties": { + "relations": { + "type": "array", + "items": { + "$ref": "#/definitions/WatchRemoteSecretChangesArg" + } + } + }, + "additionalProperties": false, + "required": [ + "relations" + ] + } + } + } + }, + { + "Name": "CrossModelSecrets", + "Description": "CrossModelSecretsAPI provides access to the CrossModelSecrets API facade.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "GetSecretAccessScope": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GetRemoteSecretAccessArgs" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "GetSecretAccessScope returns the tokens for the access scope of the specified secrets and consumers." + }, + "GetSecretContentInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GetRemoteSecretContentArgs" + }, + "Result": { + "$ref": "#/definitions/SecretContentResults" + } + }, + "description": "GetSecretContentInfo returns the secret values for the specified secrets." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "GetRemoteSecretAccessArg": { + "type": "object", + "properties": { + "application-token": { + "type": "string" + }, + "unit-id": { + "type": "integer" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application-token", + "unit-id", + "uri" + ] + }, + "GetRemoteSecretAccessArgs": { + "type": "object", + "properties": { + "relations": { + "type": "array", + "items": { + "$ref": "#/definitions/GetRemoteSecretAccessArg" + } + } + }, + "additionalProperties": false, + "required": [ + "relations" + ] + }, + "GetRemoteSecretContentArg": { + "type": "object", + "properties": { + "application-token": { + "type": "string" + }, + "bakery-version": { + "type": "integer" + }, + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "peek": { + "type": "boolean" + }, + "refresh": { + "type": "boolean" + }, + "revision": { + "type": "integer" + }, + "source-controller-uuid": { + "type": "string" + }, + "unit-id": { + "type": "integer" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "source-controller-uuid", + "application-token", + "unit-id", + "uri" + ] + }, + "GetRemoteSecretContentArgs": { + "type": "object", + "properties": { + "relations": { + "type": "array", + "items": { + "$ref": "#/definitions/GetRemoteSecretContentArg" + } + } + }, + "additionalProperties": false, + "required": [ + "relations" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "SecretBackendConfig": { + "type": "object", + "properties": { + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "SecretBackendConfigResult": { + "type": "object", + "properties": { + "config": { + "$ref": "#/definitions/SecretBackendConfig" + }, + "draining": { + "type": "boolean" + }, + "model-controller": { + "type": "string" + }, + "model-name": { + "type": "string" + }, + "model-uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-controller", + "model-uuid", + "model-name", + "draining" + ] + }, + "SecretContentParams": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "value-ref": { + "$ref": "#/definitions/SecretValueRef" + } + }, + "additionalProperties": false + }, + "SecretContentResult": { + "type": "object", + "properties": { + "backend-config": { + "$ref": "#/definitions/SecretBackendConfigResult" + }, + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "latest-revision": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "content" + ] + }, + "SecretContentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretContentResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SecretValueRef": { + "type": "object", + "properties": { + "backend-id": { + "type": "string" + }, + "revision-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "backend-id", + "revision-id" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "Deployer", + "Description": "DeployerAPI provides access to the Deployer API facade.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + }, + "description": "APIAddresses returns the list of addresses used to connect to the API." + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + }, + "description": "APIHostPorts returns the API server addresses." + }, + "ConnectionInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/DeployerConnectionValues" + } + }, + "description": "ConnectionInfo returns all the address information that the\ndeployer task needs in one call." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "ModelUUID returns the model UUID that this facade is deploying into.\nIt is implemented here directly as a result of removing it from\nembedded APIAddresser *without* bumping the facade version.\nIt should be blanked when this facade version is next incremented." + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Remove removes every given entity from state, calling EnsureDead\nfirst, then Remove. It will fail if the entity is not present." + }, + "SetPasswords": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityPasswords" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetPasswords sets the given password for each supplied entity, if possible." + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetStatus sets the status of the specified entities." + }, + "WatchAPIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchAPIHostPorts watches the API server addresses." + }, + "WatchUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchUnits starts a StringsWatcher to watch all units belonging to\nto any entity (machine or service) passed in args." + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "Address": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "DeployerConnectionValues": { + "type": "object", + "properties": { + "api-addresses": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "api-addresses" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityPassword": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "password" + ] + }, + "EntityPasswords": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPassword" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "port": { + "type": "integer" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope", + "Address", + "port" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "DiskManager", + "Description": "DiskManagerAPI provides access to the DiskManager API facade.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "SetMachineBlockDevices": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMachineBlockDevices" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "definitions": { + "BlockDevice": { + "type": "object", + "properties": { + "BusAddress": { + "type": "string" + }, + "DeviceLinks": { + "type": "array", + "items": { + "type": "string" + } + }, + "DeviceName": { + "type": "string" + }, + "FilesystemType": { + "type": "string" + }, + "HardwareId": { + "type": "string" + }, + "InUse": { + "type": "boolean" + }, + "Label": { + "type": "string" + }, + "MountPoint": { + "type": "string" + }, + "SerialId": { + "type": "string" + }, + "Size": { + "type": "integer" + }, + "UUID": { + "type": "string" + }, + "WWN": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "DeviceName", + "DeviceLinks", + "Label", + "UUID", + "HardwareId", + "WWN", + "BusAddress", + "Size", + "FilesystemType", + "InUse", + "MountPoint", + "SerialId" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineBlockDevices": { + "type": "object", + "properties": { + "block-devices": { + "type": "array", + "items": { + "$ref": "#/definitions/BlockDevice" + } + }, + "machine": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine" + ] + }, + "SetMachineBlockDevices": { + "type": "object", + "properties": { + "machine-block-devices": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineBlockDevices" + } + } + }, + "additionalProperties": false, + "required": [ + "machine-block-devices" + ] + } + } + } + }, + { + "Name": "EntityWatcher", + "Description": "srvEntitiesWatcher defines the API for methods on a state.StringsWatcher.\nEach client has its own current set of watchers, stored in resources.\nsrvEntitiesWatcher notifies about changes for all entities of a given kind,\nsending the changes as a list of strings, which could be transformed\nfrom state entity ids to their corresponding entity tags.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/EntitiesWatchResult" + } + }, + "description": "Next returns when a change has occurred to an entity of the\ncollection being watched since the most recent call to Next\nor the Watch call that created the srvEntitiesWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "EntitiesWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + } + } + } + }, + { + "Name": "EnvironUpgrader", + "Description": "", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "ModelEnvironVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/IntResults" + } + }, + "description": "ModelEnvironVersion returns the current version of the environ corresponding\nto each specified model." + }, + "ModelTargetEnvironVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/IntResults" + } + }, + "description": "ModelTargetEnvironVersion returns the target version of the environ\ncorresponding to each specified model. The target version is the\nenviron provider's version." + }, + "SetModelEnvironVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetModelEnvironVersions" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetModelEnvironVersion sets the current version of the environ corresponding\nto each specified model." + }, + "SetModelStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetModelStatus sets the status of each given model." + }, + "WatchModelEnvironVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchModelEnvironVersion watches for changes to the environ version of the\nspecified models.\n\nNOTE(axw) this is currently implemented in terms of state.Model.Watch, so\nthe client may be notified of changes unrelated to the environ version." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "IntResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "IntResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/IntResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetModelEnvironVersion": { + "type": "object", + "properties": { + "model-tag": { + "type": "string" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "version" + ] + }, + "SetModelEnvironVersions": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/SetModelEnvironVersion" + } + } + }, + "additionalProperties": false + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + } + } + } + }, + { + "Name": "ExternalControllerUpdater", + "Description": "ExternalControllerUpdaterAPI provides access to the CrossModelRelations API facade.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "ExternalControllerInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ExternalControllerInfoResults" + } + }, + "description": "ExternalControllerInfo returns the info for the specified external controllers." + }, + "SetExternalControllerInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetExternalControllersInfoParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetExternalControllerInfo saves the info for the specified external controllers." + }, + "WatchExternalControllers": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchExternalControllers watches for the addition and removal of external\ncontroller records to the local controller's database." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ExternalControllerInfo": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "ca-cert": { + "type": "string" + }, + "controller-alias": { + "type": "string" + }, + "controller-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "controller-tag", + "controller-alias", + "addrs", + "ca-cert" + ] + }, + "ExternalControllerInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ExternalControllerInfo" + } + }, + "additionalProperties": false, + "required": [ + "result", + "error" + ] + }, + "ExternalControllerInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ExternalControllerInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetExternalControllerInfoParams": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/ExternalControllerInfo" + } + }, + "additionalProperties": false, + "required": [ + "info" + ] + }, + "SetExternalControllersInfoParams": { + "type": "object", + "properties": { + "controllers": { + "type": "array", + "items": { + "$ref": "#/definitions/SetExternalControllerInfoParams" + } + } + }, + "additionalProperties": false, + "required": [ + "controllers" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "FanConfigurer", + "Description": "", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "FanConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/FanConfigResult" + } + }, + "description": "FanConfig returns current FAN configuration." + }, + "WatchForFanConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchForFanConfigChanges returns a NotifyWatcher that observes\nchanges to the FAN configuration.\nso we use the regular error return.\nTODO(wpk) 2017-09-21 We should use Model directly, and watch only for FanConfig changes." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "FanConfigEntry": { + "type": "object", + "properties": { + "overlay": { + "type": "string" + }, + "underlay": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "underlay", + "overlay" + ] + }, + "FanConfigResult": { + "type": "object", + "properties": { + "fans": { + "type": "array", + "items": { + "$ref": "#/definitions/FanConfigEntry" + } + } + }, + "additionalProperties": false, + "required": [ + "fans" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + } + } + } + }, + { + "Name": "FilesystemAttachmentsWatcher", + "Description": "srvMachineStorageIdsWatcher defines the API wrapping a state.StringsWatcher\nwatching machine/storage attachments. This watcher notifies about storage\nentities (volumes/filesystems) being attached to and detached from machines.\n\nTODO(axw) state needs a new watcher, this is a bt of a hack. State watchers\ncould do with some deduplication of logic, and I don't want to add to that\nspaghetti right now.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MachineStorageIdsWatchResult" + } + }, + "description": "Next returns when a change has occurred to an entity of the\ncollection being watched since the most recent call to Next\nor the Watch call that created the srvMachineStorageIdsWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "MachineStorageId": { + "type": "object", + "properties": { + "attachment-tag": { + "type": "string" + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "attachment-tag" + ] + }, + "MachineStorageIdsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineStorageId" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "Firewaller", + "Description": "FirewallerAPI provides access to the Firewaller API facade.", + "Version": 7, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AreManuallyProvisioned": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + }, + "description": "AreManuallyProvisioned returns whether each given entity is\nmanually provisioned or not. Only machine tags are accepted." + }, + "CloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResults" + } + }, + "description": "CloudSpec returns the model's cloud spec." + }, + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + }, + "description": "ControllerAPIInfoForModels returns the controller api connection details for the specified models." + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + }, + "description": "ControllerConfig returns the controller's configuration." + }, + "GetAssignedMachine": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "GetAssignedMachine returns the assigned machine tag (if any) for\neach given unit." + }, + "GetCloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelTag" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResult" + } + }, + "description": "GetCloudSpec constructs the CloudSpec for a validated and authorized model." + }, + "GetExposeInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ExposeInfoResults" + } + }, + "description": "GetExposeInfo returns the expose flag and per-endpoint expose settings\nfor the specified applications." + }, + "InstanceId": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "InstanceId returns the provider specific instance id for each given\nmachine or an CodeNotProvisioned error, if not set." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "MacaroonForRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MacaroonResults" + } + }, + "description": "MacaroonForRelations returns the macaroon for the specified relations." + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + }, + "description": "ModelConfig returns the current model's configuration." + }, + "ModelFirewallRules": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/IngressRulesResult" + } + }, + "description": "ModelFirewallRules returns the firewall rules that this model is\nconfigured to open" + }, + "OpenedMachinePortRanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/OpenMachinePortRangesResults" + } + }, + "description": "OpenedMachinePortRanges returns a list of the opened port ranges for the\nspecified machines where each result is broken down by unit. The list of\nopened ports for each unit is further grouped by endpoint name and includes\nthe subnet CIDRs that belong to the space that each endpoint is bound to." + }, + "SetRelationsStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetRelationsStatus sets the status for the specified relations." + }, + "SpaceInfos": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SpaceInfosParams" + }, + "Result": { + "$ref": "#/definitions/SpaceInfos" + } + }, + "description": "SpaceInfos returns a comprehensive representation of either all spaces or\na filtered subset of the known spaces and their associated subnet details." + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "Watch starts an NotifyWatcher for each given entity." + }, + "WatchCloudSpecsChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchCloudSpecsChanges returns a watcher for cloud spec changes." + }, + "WatchEgressAddressesForRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchEgressAddressesForRelations creates a watcher that notifies when addresses, from which\nconnections will originate for the relation, change.\nEach event contains the entire set of addresses which are required for ingress for the relation." + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchForModelConfigChanges returns a NotifyWatcher that observes\nchanges to the model configuration.\nNote that although the NotifyWatchResult contains an Error field,\nit's not used because we are only returning a single watcher,\nso we use the regular error return." + }, + "WatchIngressAddressesForRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchIngressAddressesForRelations creates a watcher that returns the ingress networks\nthat have been recorded against the specified relations." + }, + "WatchModelFirewallRules": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchModelFirewallRules returns a NotifyWatcher that notifies of\npotential changes to a model's configured firewall rules" + }, + "WatchModelMachineStartTimes": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchModelMachineStartTimes watches the non-container machines in the model\nfor changes to the Life or AgentStartTime fields and reports them as a batch." + }, + "WatchModelMachines": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchModelMachines returns a StringsWatcher that notifies of\nchanges to the life cycles of the top level machines in the current\nmodel." + }, + "WatchOpenedPorts": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchOpenedPorts returns a new StringsWatcher for each given\nmodel tag." + }, + "WatchSubnets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchSubnets returns a new StringsWatcher that watches the specified\nsubnet tags or all tags if no entities are specified." + }, + "WatchUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchUnits starts a StringsWatcher to watch all units belonging to\nto any entity (machine or service) passed in args." + } + }, + "definitions": { + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudSpec": { + "type": "object", + "properties": { + "cacertificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "is-controller-cloud": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "skip-tls-verify": { + "type": "boolean" + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "name" + ] + }, + "CloudSpecResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudSpec" + } + }, + "additionalProperties": false + }, + "CloudSpecResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "additionalProperties": false + }, + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ExposeInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "exposed": { + "type": "boolean" + }, + "exposed-endpoints": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ExposedEndpoint" + } + } + } + }, + "additionalProperties": false + }, + "ExposeInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ExposeInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ExposedEndpoint": { + "type": "object", + "properties": { + "expose-to-cidrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "expose-to-spaces": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "FanConfigEntry": { + "type": "object", + "properties": { + "overlay": { + "type": "string" + }, + "underlay": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "underlay", + "overlay" + ] + }, + "IngressRule": { + "type": "object", + "properties": { + "port-range": { + "$ref": "#/definitions/PortRange" + }, + "source-cidrs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "port-range", + "source-cidrs" + ] + }, + "IngressRulesResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "rules": { + "type": "array", + "items": { + "$ref": "#/definitions/IngressRule" + } + } + }, + "additionalProperties": false, + "required": [ + "rules" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "MacaroonResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/Macaroon" + } + }, + "additionalProperties": false + }, + "MacaroonResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MacaroonResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelTag": { + "type": "object", + "additionalProperties": false + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "OpenMachinePortRangesResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "unit-port-ranges": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "$ref": "#/definitions/OpenUnitPortRanges" + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "unit-port-ranges" + ] + }, + "OpenMachinePortRangesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/OpenMachinePortRangesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "OpenUnitPortRanges": { + "type": "object", + "properties": { + "endpoint": { + "type": "string" + }, + "port-ranges": { + "type": "array", + "items": { + "$ref": "#/definitions/PortRange" + } + }, + "subnet-cidrs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "endpoint", + "port-ranges", + "subnet-cidrs" + ] + }, + "PortRange": { + "type": "object", + "properties": { + "from-port": { + "type": "integer" + }, + "protocol": { + "type": "string" + }, + "to-port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "from-port", + "to-port", + "protocol" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "SpaceInfo": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/SubnetV3" + } + } + }, + "additionalProperties": false, + "required": [ + "id", + "name" + ] + }, + "SpaceInfos": { + "type": "object", + "properties": { + "space-infos": { + "type": "array", + "items": { + "$ref": "#/definitions/SpaceInfo" + } + } + }, + "additionalProperties": false + }, + "SpaceInfosParams": { + "type": "object", + "properties": { + "space-ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Subnet": { + "type": "object", + "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": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "cidr", + "vlan-tag", + "life", + "space-tag", + "zones" + ] + }, + "SubnetV2": { + "type": "object", + "properties": { + "Subnet": { + "$ref": "#/definitions/Subnet" + }, + "cidr": { + "type": "string" + }, + "id": { + "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": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "cidr", + "vlan-tag", + "life", + "space-tag", + "zones", + "Subnet" + ] + }, + "SubnetV3": { + "type": "object", + "properties": { + "Subnet": { + "$ref": "#/definitions/Subnet" + }, + "SubnetV2": { + "$ref": "#/definitions/SubnetV2" + }, + "cidr": { + "type": "string" + }, + "fan-info": { + "$ref": "#/definitions/FanConfigEntry" + }, + "id": { + "type": "string" + }, + "is-public": { + "type": "boolean" + }, + "life": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "provider-network-id": { + "type": "string" + }, + "provider-space-id": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-tag": { + "type": "string" + }, + "status": { + "type": "string" + }, + "vlan-tag": { + "type": "integer" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "cidr", + "vlan-tag", + "life", + "space-tag", + "zones", + "Subnet", + "SubnetV2", + "space-id" + ] + } + } + } + }, + { + "Name": "HighAvailability", + "Description": "HighAvailabilityAPI implements the HighAvailability interface and is the concrete\nimplementation of the api end point.", + "Version": 2, + "AvailableTo": [ + "controller-user", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "EnableHA": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ControllersSpecs" + }, + "Result": { + "$ref": "#/definitions/ControllersChangeResults" + } + }, + "description": "EnableHA adds controller machines as necessary to ensure the\ncontroller has the number of machines specified." + } + }, + "definitions": { + "ControllersChangeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ControllersChanges" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "ControllersChangeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllersChangeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllersChanges": { + "type": "object", + "properties": { + "added": { + "type": "array", + "items": { + "type": "string" + } + }, + "converted": { + "type": "array", + "items": { + "type": "string" + } + }, + "maintained": { + "type": "array", + "items": { + "type": "string" + } + }, + "removed": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "ControllersSpec": { + "type": "object", + "properties": { + "constraints": { + "$ref": "#/definitions/Value" + }, + "num-controllers": { + "type": "integer" + }, + "placement": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "num-controllers" + ] + }, + "ControllersSpecs": { + "type": "object", + "properties": { + "specs": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllersSpec" + } + } + }, + "additionalProperties": false, + "required": [ + "specs" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "Value": { + "type": "object", + "properties": { + "allocate-public-ip": { + "type": "boolean" + }, + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "image-id": { + "type": "string" + }, + "instance-role": { + "type": "string" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "HostKeyReporter", + "Description": "Facade implements the API required by the hostkeyreporter worker.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ReportKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SSHHostKeySet" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ReportKeys sets the SSH host keys for one or more entities." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SSHHostKeySet": { + "type": "object", + "properties": { + "entity-keys": { + "type": "array", + "items": { + "$ref": "#/definitions/SSHHostKeys" + } + } + }, + "additionalProperties": false, + "required": [ + "entity-keys" + ] + }, + "SSHHostKeys": { + "type": "object", + "properties": { + "public-keys": { + "type": "array", + "items": { + "type": "string" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "public-keys" + ] + } + } + } + }, + { + "Name": "ImageMetadata", + "Description": "API is a dummy struct for compatibility.", + "Version": 3, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "UpdateFromPublishedImages": { + "type": "object", + "description": "UpdateFromPublishedImages is now a no-op.\nIt is retained for compatibility." + } + } + } + }, + { + "Name": "ImageMetadataManager", + "Description": "API is the concrete implementation of the api end point\nfor loud image metadata manipulations.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Delete": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MetadataImageIds" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Delete deletes cloud image metadata for given image ids.\nIt supports bulk calls." + }, + "List": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ImageMetadataFilter" + }, + "Result": { + "$ref": "#/definitions/ListCloudImageMetadataResult" + } + }, + "description": "List returns all found cloud image metadata that satisfy\ngiven filter.\nReturned list contains metadata ordered by priority." + }, + "Save": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MetadataSaveParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Save stores given cloud image metadata.\nIt supports bulk calls." + } + }, + "definitions": { + "CloudImageMetadata": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "image-id": { + "type": "string" + }, + "priority": { + "type": "integer" + }, + "region": { + "type": "string" + }, + "root-storage-size": { + "type": "integer" + }, + "root-storage-type": { + "type": "string" + }, + "source": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "version": { + "type": "string" + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "image-id", + "region", + "version", + "arch", + "source", + "priority" + ] + }, + "CloudImageMetadataList": { + "type": "object", + "properties": { + "metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudImageMetadata" + } + } + }, + "additionalProperties": false + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ImageMetadataFilter": { + "type": "object", + "properties": { + "arches": { + "type": "array", + "items": { + "type": "string" + } + }, + "region": { + "type": "string" + }, + "root-storage-type": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "versions": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ListCloudImageMetadataResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudImageMetadata" + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "MetadataImageIds": { + "type": "object", + "properties": { + "image-ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "image-ids" + ] + }, + "MetadataSaveParams": { + "type": "object", + "properties": { + "metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudImageMetadataList" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "InstanceMutater", + "Description": "", + "Version": 3, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "CharmProfilingInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/CharmProfilingInfoResult" + } + }, + "description": "CharmProfilingInfo returns info to update lxd profiles on the machine. If\nthe machine is not provisioned, no profile change info will be returned,\nnor will an error." + }, + "ContainerType": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/ContainerTypeResult" + } + }, + "description": "ContainerType returns the container type of a machine." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "SetCharmProfiles": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetProfileArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetCharmProfiles records the given slice of charm profile names." + }, + "SetModificationStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetModificationStatus updates the instance whilst changes are occurring. This\nis different from SetStatus and SetInstanceStatus, by the fact this holds\ninformation about the ongoing changes that are happening to instances.\nConsider LXD Profile updates that can modify a instance, but may not cause\nthe instance to be placed into a error state. This modification status\nserves the purpose of highlighting that to the operator.\nOnly machine tags are accepted." + }, + "WatchContainers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchContainers starts a watcher to track Containers on a given\nmachine." + }, + "WatchLXDProfileVerificationNeeded": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchLXDProfileVerificationNeeded starts a watcher to track Applications with\nLXD Profiles." + }, + "WatchMachines": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchMachines starts a watcher to track machines.\nWatchMachines does not consume the initial event of the watch response, as\nthat returns the initial set of machines that are currently available." + }, + "WatchModelMachines": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchModelMachines starts a watcher to track machines, but not containers.\nWatchModelMachines does not consume the initial event of the watch response, as\nthat returns the initial set of machines that are currently available." + } + }, + "definitions": { + "CharmLXDProfile": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "description", + "devices" + ] + }, + "CharmProfilingInfoResult": { + "type": "object", + "properties": { + "current-profiles": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "instance-id": { + "type": "string" + }, + "model-name": { + "type": "string" + }, + "profile-changes": { + "type": "array", + "items": { + "$ref": "#/definitions/ProfileInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "instance-id", + "model-name", + "profile-changes", + "current-profiles", + "error" + ] + }, + "ContainerTypeResult": { + "type": "object", + "properties": { + "container-type": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "container-type", + "error" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ProfileInfoResult": { + "type": "object", + "properties": { + "application-name": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "profile": { + "$ref": "#/definitions/CharmLXDProfile" + }, + "revision": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "SetProfileArg": { + "type": "object", + "properties": { + "entity": { + "$ref": "#/definitions/Entity" + }, + "profiles": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "entity", + "profiles" + ] + }, + "SetProfileArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SetProfileArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "InstancePoller", + "Description": "InstancePollerAPI provides access to the InstancePoller API facade.", + "Version": 4, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AreManuallyProvisioned": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + }, + "description": "AreManuallyProvisioned returns whether each given entity is\nmanually provisioned or not. Only machine tags are accepted." + }, + "InstanceId": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "InstanceId returns the provider specific instance id for each given\nmachine or an CodeNotProvisioned error, if not set." + }, + "InstanceStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StatusResults" + } + }, + "description": "InstanceStatus returns the instance status for each given entity.\nOnly machine tags are accepted." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + }, + "description": "ModelConfig returns the current model's configuration." + }, + "ProviderAddresses": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineAddressesResults" + } + }, + "description": "ProviderAddresses returns the list of all known provider addresses\nfor each given entity. Only machine tags are accepted." + }, + "SetInstanceStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetInstanceStatus updates the instance status for each given entity.\nOnly machine tags are accepted." + }, + "SetProviderAddresses": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMachinesAddresses" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetProviderAddresses updates the list of known provider addresses\nfor each given entity. Only machine tags are accepted." + }, + "SetProviderNetworkConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetProviderNetworkConfig" + }, + "Result": { + "$ref": "#/definitions/SetProviderNetworkConfigResults" + } + }, + "description": "SetProviderNetworkConfig updates the provider addresses for one or more\nmachines.\n\nWhat's more, if the client request includes provider-specific IDs (e.g.\nnetwork, subnet or address IDs), this method will also iterate any present\nlink layer devices (and their addresses) and merge in any missing\nprovider-specific information." + }, + "Status": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StatusResults" + } + }, + "description": "Status returns the status of each given entity." + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchForModelConfigChanges returns a NotifyWatcher that observes\nchanges to the model configuration.\nNote that although the NotifyWatchResult contains an Error field,\nit's not used because we are only returning a single watcher,\nso we use the regular error return." + }, + "WatchModelMachineStartTimes": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchModelMachineStartTimes watches the non-container machines in the model\nfor changes to the Life or AgentStartTime fields and reports them as a batch." + }, + "WatchModelMachines": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchModelMachines returns a StringsWatcher that notifies of\nchanges to the life cycles of the top level machines in the current\nmodel." + } + }, + "definitions": { + "Address": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineAddresses": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "addresses" + ] + }, + "MachineAddressesResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses" + ] + }, + "MachineAddressesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineAddressesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "NetworkConfig": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "device-index": { + "type": "integer" + }, + "disabled": { + "type": "boolean" + }, + "dns-search-domains": { + "type": "array", + "items": { + "type": "string" + } + }, + "dns-servers": { + "type": "array", + "items": { + "type": "string" + } + }, + "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" + }, + "origin": { + "type": "string" + }, + "parent-interface-name": { + "type": "string" + }, + "provider-address-id": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "provider-network-id": { + "type": "string" + }, + "provider-space-id": { + "type": "string" + }, + "provider-subnet-id": { + "type": "string" + }, + "provider-vlan-id": { + "type": "string" + }, + "routes": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkRoute" + } + }, + "shadow-addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "virtual-port-type": { + "type": "string" + }, + "vlan-tag": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "device-index", + "mac-address", + "cidr", + "mtu", + "provider-id", + "provider-network-id", + "provider-subnet-id", + "provider-space-id", + "provider-address-id", + "provider-vlan-id", + "vlan-tag", + "interface-name", + "parent-interface-name", + "interface-type", + "disabled" + ] + }, + "NetworkRoute": { + "type": "object", + "properties": { + "destination-cidr": { + "type": "string" + }, + "gateway-ip": { + "type": "string" + }, + "metric": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "destination-cidr", + "gateway-ip", + "metric" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "ProviderNetworkConfig": { + "type": "object", + "properties": { + "config": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkConfig" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "config" + ] + }, + "SetMachinesAddresses": { + "type": "object", + "properties": { + "machine-addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineAddresses" + } + } + }, + "additionalProperties": false, + "required": [ + "machine-addresses" + ] + }, + "SetProviderNetworkConfig": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/ProviderNetworkConfig" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "SetProviderNetworkConfigResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "modified": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "modified" + ] + }, + "SetProviderNetworkConfigResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SetProviderNetworkConfigResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StatusResult": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "id": { + "type": "string" + }, + "info": { + "type": "string" + }, + "life": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "life", + "status", + "info", + "data", + "since" + ] + }, + "StatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "KeyManager", + "Description": "KeyManagerAPI provides api endpoints for manipulating ssh keys", + "Version": 1, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AddKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyUserSSHKeys" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "AddKeys adds new authorised ssh keys for the specified user." + }, + "DeleteKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyUserSSHKeys" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "DeleteKeys deletes the authorised ssh keys for the specified user." + }, + "ImportKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyUserSSHKeys" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ImportKeys imports new authorised ssh keys from the specified key ids for the specified user." + }, + "ListKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ListSSHKeys" + }, + "Result": { + "$ref": "#/definitions/StringsResults" + } + }, + "description": "ListKeys returns the authorised ssh keys for the specified users." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListSSHKeys": { + "type": "object", + "properties": { + "entities": { + "$ref": "#/definitions/Entities" + }, + "mode": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "entities", + "mode" + ] + }, + "ModifyUserSSHKeys": { + "type": "object", + "properties": { + "ssh-keys": { + "type": "array", + "items": { + "type": "string" + } + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user", + "ssh-keys" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "KeyUpdater", + "Description": "KeyUpdaterAPI implements the KeyUpdater interface and is the concrete\nimplementation of the api end point.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "AuthorisedKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsResults" + } + }, + "description": "AuthorisedKeys reports the authorised ssh keys for the specified machines.\nThe current implementation relies on global authorised keys being stored in the model config.\nThis will change as new user management and authorisation functionality is added." + }, + "WatchAuthorisedKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchAuthorisedKeys starts a watcher to track changes to the authorised ssh keys\nfor the specified machines.\nThe current implementation relies on global authorised keys being stored in the model config.\nThis will change as new user management and authorisation functionality is added." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "LeadershipService", + "Description": "LeadershipService implements a variant of leadership.Claimer for consumption\nover the API.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "BlockUntilLeadershipReleased": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationTag" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "BlockUntilLeadershipReleased blocks the caller until leadership is\nreleased for the given service." + }, + "ClaimLeadership": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ClaimLeadershipBulkParams" + }, + "Result": { + "$ref": "#/definitions/ClaimLeadershipBulkResults" + } + }, + "description": "ClaimLeadership makes a leadership claim with the given parameters." + } + }, + "definitions": { + "ApplicationTag": { + "type": "object", + "properties": { + "Name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Name" + ] + }, + "ClaimLeadershipBulkParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/ClaimLeadershipParams" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "ClaimLeadershipBulkResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ClaimLeadershipParams": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + }, + "duration": { + "type": "number" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application-tag", + "unit-tag", + "duration" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "LifeFlag", + "Description": "", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "Watch starts an NotifyWatcher for each given entity." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "LogForwarding", + "Description": "LogForwardingAPI is the concrete implementation of the api end point.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "GetLastSent": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/LogForwardingGetLastSentParams" + }, + "Result": { + "$ref": "#/definitions/LogForwardingGetLastSentResults" + } + }, + "description": "GetLastSent is a bulk call that gets the log forwarding \"last sent\"\nrecord ID for each requested target." + }, + "SetLastSent": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/LogForwardingSetLastSentParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetLastSent is a bulk call that sets the log forwarding \"last sent\"\nrecord ID for each requested target." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "LogForwardingGetLastSentParams": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "$ref": "#/definitions/LogForwardingID" + } + } + }, + "additionalProperties": false, + "required": [ + "ids" + ] + }, + "LogForwardingGetLastSentResult": { + "type": "object", + "properties": { + "err": { + "$ref": "#/definitions/Error" + }, + "record-id": { + "type": "integer" + }, + "record-timestamp": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "record-id", + "record-timestamp", + "err" + ] + }, + "LogForwardingGetLastSentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LogForwardingGetLastSentResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "LogForwardingID": { + "type": "object", + "properties": { + "model": { + "type": "string" + }, + "sink": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model", + "sink" + ] + }, + "LogForwardingSetLastSentParam": { + "type": "object", + "properties": { + "LogForwardingID": { + "$ref": "#/definitions/LogForwardingID" + }, + "model": { + "type": "string" + }, + "record-id": { + "type": "integer" + }, + "record-timestamp": { + "type": "integer" + }, + "sink": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model", + "sink", + "LogForwardingID", + "record-id", + "record-timestamp" + ] + }, + "LogForwardingSetLastSentParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/LogForwardingSetLastSentParam" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + } + } + } + }, + { + "Name": "Logger", + "Description": "LoggerAPI implements the Logger interface and is the concrete\nimplementation of the api end point.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "LoggingConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "LoggingConfig reports the logging configuration for the agents specified." + }, + "WatchLoggingConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchLoggingConfig starts a watcher to track changes to the logging config\nfor the agents specified.. Unfortunately the current infrastructure makes\nwatching parts of the config non-trivial, so currently any change to the\nconfig will cause the watcher to notify the client." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "MachineActions", + "Description": "Facade implements the machineactions interface and is the concrete\nimplementation of the api end point.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "Actions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionResults" + } + }, + "description": "Actions returns the Actions by Tags passed and ensures that the machine asking\nfor them is the machine that has the actions" + }, + "BeginActions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "BeginActions marks the actions represented by the passed in Tags as running." + }, + "FinishActions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ActionExecutionResults" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "FinishActions saves the result of a completed Action" + }, + "RunningActions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionsByReceivers" + } + }, + "description": "RunningActions lists the actions running for the entities passed in.\nIf we end up needing more than ListRunning at some point we could follow/abstract\nwhat's done in the client actions package." + }, + "WatchActionNotifications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchActionNotifications returns a StringsWatcher for observing\nincoming action calls to a machine." + } + }, + "definitions": { + "Action": { + "type": "object", + "properties": { + "execution-group": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parallel": { + "type": "boolean" + }, + "parameters": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "receiver": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "receiver", + "name" + ] + }, + "ActionExecutionResult": { + "type": "object", + "properties": { + "action-tag": { + "type": "string" + }, + "message": { + "type": "string" + }, + "results": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "action-tag", + "status" + ] + }, + "ActionExecutionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionExecutionResult" + } + } + }, + "additionalProperties": false + }, + "ActionMessage": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "required": [ + "timestamp", + "message" + ] + }, + "ActionResult": { + "type": "object", + "properties": { + "action": { + "$ref": "#/definitions/Action" + }, + "completed": { + "type": "string", + "format": "date-time" + }, + "enqueued": { + "type": "string", + "format": "date-time" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "log": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionMessage" + } + }, + "message": { + "type": "string" + }, + "output": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "started": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ActionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionResult" + } + } + }, + "additionalProperties": false + }, + "ActionsByReceiver": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionResult" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "receiver": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ActionsByReceivers": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionsByReceiver" + } + } + }, + "additionalProperties": false + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "MachineManager", + "Description": "MachineManagerAPI provides access to the MachineManager API facade.", + "Version": 10, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AddMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddMachines" + }, + "Result": { + "$ref": "#/definitions/AddMachinesResults" + } + }, + "description": "AddMachines adds new machines with the supplied parameters.\nThe args will contain Base info." + }, + "DestroyMachineWithParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyMachinesParams" + }, + "Result": { + "$ref": "#/definitions/DestroyMachineResults" + } + }, + "description": "DestroyMachineWithParams removes a set of machines from the model." + }, + "GetUpgradeSeriesMessages": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpgradeSeriesNotificationParams" + }, + "Result": { + "$ref": "#/definitions/StringsResults" + } + }, + "description": "GetUpgradeSeriesMessages returns all new messages associated with upgrade\nseries events. Messages that have already been retrieved once are not\nreturned by this method." + }, + "InstanceTypes": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelInstanceTypesConstraints" + }, + "Result": { + "$ref": "#/definitions/InstanceTypesResults" + } + }, + "description": "InstanceTypes returns instance type information for the cloud and region\nin which the current model is deployed." + }, + "ProvisioningScript": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ProvisioningScriptParams" + }, + "Result": { + "$ref": "#/definitions/ProvisioningScriptResult" + } + }, + "description": "ProvisioningScript returns a shell script that, when run,\nprovisions a machine agent on the machine executing the script." + }, + "RetryProvisioning": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RetryProvisioningArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RetryProvisioning marks a provisioning error as transient on the machines." + }, + "UpgradeSeriesComplete": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateChannelArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "UpgradeSeriesComplete marks a machine as having completed a managed series\nupgrade." + }, + "UpgradeSeriesPrepare": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateChannelArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "UpgradeSeriesPrepare prepares a machine for a OS series upgrade." + }, + "UpgradeSeriesValidate": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateChannelArgs" + }, + "Result": { + "$ref": "#/definitions/UpgradeSeriesUnitsResults" + } + }, + "description": "UpgradeSeriesValidate validates that the incoming arguments correspond to a\nvalid series upgrade for the target machine.\nIf they do, a list of the machine's current units is returned for use in\nsoliciting user confirmation of the command." + }, + "WatchUpgradeSeriesNotifications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchUpgradeSeriesNotifications returns a watcher that fires on upgrade\nseries events." + } + }, + "definitions": { + "AddMachineParams": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "base": { + "$ref": "#/definitions/Base" + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "container-type": { + "type": "string" + }, + "disks": { + "type": "array", + "items": { + "$ref": "#/definitions/Constraints" + } + }, + "hardware-characteristics": { + "$ref": "#/definitions/HardwareCharacteristics" + }, + "instance-id": { + "type": "string" + }, + "jobs": { + "type": "array", + "items": { + "type": "string" + } + }, + "nonce": { + "type": "string" + }, + "parent-id": { + "type": "string" + }, + "placement": { + "$ref": "#/definitions/Placement" + } + }, + "additionalProperties": false, + "required": [ + "constraints", + "jobs", + "parent-id", + "container-type", + "instance-id", + "nonce", + "hardware-characteristics", + "addresses" + ] + }, + "AddMachines": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/AddMachineParams" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "AddMachinesResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "machine": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine" + ] + }, + "AddMachinesResults": { + "type": "object", + "properties": { + "machines": { + "type": "array", + "items": { + "$ref": "#/definitions/AddMachinesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "machines" + ] + }, + "Address": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "Base": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "channel" + ] + }, + "Constraints": { + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Pool": { + "type": "string" + }, + "Size": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Pool", + "Size", + "Count" + ] + }, + "DestroyMachineInfo": { + "type": "object", + "properties": { + "destroyed-containers": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyMachineResult" + } + }, + "destroyed-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "destroyed-units": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "detached-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "machine-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-id" + ] + }, + "DestroyMachineResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "$ref": "#/definitions/DestroyMachineInfo" + } + }, + "additionalProperties": false + }, + "DestroyMachineResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyMachineResult" + } + } + }, + "additionalProperties": false + }, + "DestroyMachinesParams": { + "type": "object", + "properties": { + "dry-run": { + "type": "boolean" + }, + "force": { + "type": "boolean" + }, + "keep": { + "type": "boolean" + }, + "machine-tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "max-wait": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "machine-tags" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "HardwareCharacteristics": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "availability-zone": { + "type": "string" + }, + "cpu-cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false + }, + "InstanceType": { + "type": "object", + "properties": { + "arches": { + "type": "array", + "items": { + "type": "string" + } + }, + "cost": { + "type": "integer" + }, + "cpu-cores": { + "type": "integer" + }, + "memory": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "root-disk": { + "type": "integer" + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "arches", + "cpu-cores", + "memory" + ] + }, + "InstanceTypesResult": { + "type": "object", + "properties": { + "cost-currency": { + "type": "string" + }, + "cost-divisor": { + "type": "integer" + }, + "cost-unit": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "instance-types": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceType" + } + } + }, + "additionalProperties": false + }, + "InstanceTypesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceTypesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelInstanceTypesConstraint": { + "type": "object", + "properties": { + "value": { + "$ref": "#/definitions/Value" + } + }, + "additionalProperties": false + }, + "ModelInstanceTypesConstraints": { + "type": "object", + "properties": { + "constraints": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelInstanceTypesConstraint" + } + } + }, + "additionalProperties": false, + "required": [ + "constraints" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Placement": { + "type": "object", + "properties": { + "directive": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "scope", + "directive" + ] + }, + "ProvisioningScriptParams": { + "type": "object", + "properties": { + "data-dir": { + "type": "string" + }, + "disable-package-commands": { + "type": "boolean" + }, + "machine-id": { + "type": "string" + }, + "nonce": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-id", + "nonce", + "data-dir", + "disable-package-commands" + ] + }, + "ProvisioningScriptResult": { + "type": "object", + "properties": { + "script": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "script" + ] + }, + "RetryProvisioningArgs": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + }, + "machines": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "all" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UpdateChannelArg": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "tag": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force", + "channel" + ] + }, + "UpdateChannelArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateChannelArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UpgradeSeriesNotificationParam": { + "type": "object", + "properties": { + "entity": { + "$ref": "#/definitions/Entity" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entity", + "watcher-id" + ] + }, + "UpgradeSeriesNotificationParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/UpgradeSeriesNotificationParam" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "UpgradeSeriesUnitsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "unit-names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "unit-names" + ] + }, + "UpgradeSeriesUnitsResults": { + "type": "object", + "properties": { + "Results": { + "type": "array", + "items": { + "$ref": "#/definitions/UpgradeSeriesUnitsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "Results" + ] + }, + "Value": { + "type": "object", + "properties": { + "allocate-public-ip": { + "type": "boolean" + }, + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "image-id": { + "type": "string" + }, + "instance-role": { + "type": "string" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "MachineUndertaker", + "Description": "API implements the API facade used by the machine undertaker.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "AllMachineRemovals": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/EntitiesResults" + } + }, + "description": "AllMachineRemovals returns tags for all of the machines that have\nbeen marked for removal in the requested model." + }, + "CompleteMachineRemovals": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + } + }, + "description": "CompleteMachineRemovals removes the specified machines from the\nmodel database. It should only be called once any provider-level\ncleanup has been done for those machines." + }, + "GetMachineProviderInterfaceInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ProviderInterfaceInfoResults" + } + }, + "description": "GetMachineProviderInterfaceInfo returns the provider details for\nall network interfaces attached to the machines requested." + }, + "WatchMachineRemovals": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchMachineRemovals returns a watcher that will signal each time a\nmachine is marked for removal." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesResult": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/EntitiesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ProviderInterfaceInfo": { + "type": "object", + "properties": { + "interface-name": { + "type": "string" + }, + "mac-address": { + "type": "string" + }, + "provider-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "interface-name", + "mac-address", + "provider-id" + ] + }, + "ProviderInterfaceInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "interfaces": { + "type": "array", + "items": { + "$ref": "#/definitions/ProviderInterfaceInfo" + } + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "interfaces" + ] + }, + "ProviderInterfaceInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ProviderInterfaceInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "Machiner", + "Description": "MachinerAPI implements the API used by the machiner worker.", + "Version": 5, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + }, + "description": "APIAddresses returns the list of addresses used to connect to the API." + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + }, + "description": "APIHostPorts returns the API server addresses." + }, + "EnsureDead": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "EnsureDead calls EnsureDead on each given entity from state. It\nwill fail if the entity is not present. If it's Alive, nothing will\nhappen (see state/EnsureDead() for units or machines)." + }, + "Jobs": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/JobsResults" + } + }, + "description": "Jobs returns the jobs assigned to the given entities." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "RecordAgentStartInformation": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RecordAgentStartInformationArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RecordAgentStartInformation syncs the machine model with information\nreported by a machine agent when it starts." + }, + "RecordAgentStartTime": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RecordAgentStartTime updates the agent start time field in the machine doc." + }, + "SetMachineAddresses": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMachinesAddresses" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetObservedNetworkConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMachineNetworkConfig" + } + }, + "description": "SetObservedNetworkConfig reads the network config for the machine\nidentified by the input args.\nThis config is merged with the new network config supplied in the\nsame args and updated if it has changed." + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetStatus sets the status of each given entity." + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "Watch starts an NotifyWatcher for each given entity." + }, + "WatchAPIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchAPIHostPorts watches the API server addresses." + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "Address": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "port": { + "type": "integer" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope", + "Address", + "port" + ] + }, + "JobsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "jobs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "jobs" + ] + }, + "JobsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/JobsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineAddresses": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "addresses" + ] + }, + "NetworkConfig": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "device-index": { + "type": "integer" + }, + "disabled": { + "type": "boolean" + }, + "dns-search-domains": { + "type": "array", + "items": { + "type": "string" + } + }, + "dns-servers": { + "type": "array", + "items": { + "type": "string" + } + }, + "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" + }, + "origin": { + "type": "string" + }, + "parent-interface-name": { + "type": "string" + }, + "provider-address-id": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "provider-network-id": { + "type": "string" + }, + "provider-space-id": { + "type": "string" + }, + "provider-subnet-id": { + "type": "string" + }, + "provider-vlan-id": { + "type": "string" + }, + "routes": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkRoute" + } + }, + "shadow-addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "virtual-port-type": { + "type": "string" + }, + "vlan-tag": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "device-index", + "mac-address", + "cidr", + "mtu", + "provider-id", + "provider-network-id", + "provider-subnet-id", + "provider-space-id", + "provider-address-id", + "provider-vlan-id", + "vlan-tag", + "interface-name", + "parent-interface-name", + "interface-type", + "disabled" + ] + }, + "NetworkRoute": { + "type": "object", + "properties": { + "destination-cidr": { + "type": "string" + }, + "gateway-ip": { + "type": "string" + }, + "metric": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "destination-cidr", + "gateway-ip", + "metric" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RecordAgentStartInformationArg": { + "type": "object", + "properties": { + "hostname": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "RecordAgentStartInformationArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/RecordAgentStartInformationArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "SetMachineNetworkConfig": { + "type": "object", + "properties": { + "config": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkConfig" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "config" + ] + }, + "SetMachinesAddresses": { + "type": "object", + "properties": { + "machine-addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineAddresses" + } + } + }, + "additionalProperties": false, + "required": [ + "machine-addresses" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "MeterStatus", + "Description": "MeterStatusAPI implements the MeterStatus interface and is the concrete\nimplementation of the API endpoint. Additionally, it embeds\ncommon.UnitStateAPI to allow meter status workers to access their\ncontroller-backed internal state.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "GetMeterStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MeterStatusResults" + } + }, + "description": "GetMeterStatus returns meter status information for each unit." + }, + "SetState": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetUnitStateArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetState sets the state persisted by the charm running in this unit\nand the state internal to the uniter for this unit." + }, + "State": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UnitStateResults" + } + }, + "description": "State returns the state persisted by the charm running in this unit\nand the state internal to the uniter for this unit." + }, + "WatchMeterStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchMeterStatus returns a NotifyWatcher for observing changes\nto each unit's meter status." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MeterStatusResult": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "info" + ] + }, + "MeterStatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MeterStatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetUnitStateArg": { + "type": "object", + "properties": { + "charm-state": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "meter-status-state": { + "type": "string" + }, + "relation-state": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "secret-state": { + "type": "string" + }, + "storage-state": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "uniter-state": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "SetUnitStateArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SetUnitStateArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UnitStateResult": { + "type": "object", + "properties": { + "charm-state": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "meter-status-state": { + "type": "string" + }, + "relation-state": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "secret-state": { + "type": "string" + }, + "storage-state": { + "type": "string" + }, + "uniter-state": { + "type": "string" + } + }, + "additionalProperties": false + }, + "UnitStateResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UnitStateResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "MetricsAdder", + "Description": "MetricsAdderAPI implements the metrics adder interface and is the concrete\nimplementation of the API end point.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent" + ], + "Schema": { + "type": "object", + "properties": { + "AddMetricBatches": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MetricBatchParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "AddMetricBatches implements the MetricsAdder interface." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Metric": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "labels": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "time": { + "type": "string", + "format": "date-time" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "key", + "value", + "time" + ] + }, + "MetricBatch": { + "type": "object", + "properties": { + "charm-url": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time" + }, + "metrics": { + "type": "array", + "items": { + "$ref": "#/definitions/Metric" + } + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "charm-url", + "created", + "metrics" + ] + }, + "MetricBatchParam": { + "type": "object", + "properties": { + "batch": { + "$ref": "#/definitions/MetricBatch" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "batch" + ] + }, + "MetricBatchParams": { + "type": "object", + "properties": { + "batches": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricBatchParam" + } + } + }, + "additionalProperties": false, + "required": [ + "batches" + ] + } + } + } + }, + { + "Name": "MetricsDebug", + "Description": "MetricsDebugAPI implements the metricsdebug interface and is the concrete\nimplementation of the api end point.", + "Version": 2, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "GetMetrics": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MetricResults" + } + }, + "description": "GetMetrics returns all metrics stored by the state server." + }, + "SetMeterStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MeterStatusParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetMeterStatus sets meter statuses for entities." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityMetrics": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "metrics": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricResult" + } + } + }, + "additionalProperties": false + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MeterStatusParam": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "code" + ] + }, + "MeterStatusParams": { + "type": "object", + "properties": { + "statues": { + "type": "array", + "items": { + "$ref": "#/definitions/MeterStatusParam" + } + } + }, + "additionalProperties": false, + "required": [ + "statues" + ] + }, + "MetricResult": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "labels": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "time": { + "type": "string", + "format": "date-time" + }, + "unit": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "time", + "key", + "value", + "unit", + "labels" + ] + }, + "MetricResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityMetrics" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "MetricsManager", + "Description": "MetricsManagerAPI implements the metrics manager interface and is the concrete\nimplementation of the api end point.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "AddJujuMachineMetrics": { + "type": "object", + "description": "AddJujuMachineMetrics adds a metric that counts the number of\nnon-container machines in the current model." + }, + "CleanupOldMetrics": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "CleanupOldMetrics removes old metrics from the collection.\nThe single arg params is expected to contain and model uuid.\nEven though the call will delete all metrics across models\nit serves to validate that the connection has access to at least one model." + }, + "SendMetrics": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SendMetrics will send any unsent metrics onto the metric collection service." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "MigrationFlag", + "Description": "Facade lets clients watch and get models' migration phases.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Phase": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/PhaseResults" + } + }, + "description": "Phase returns the current migration phase or an error for every\nsupplied entity." + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "Watch returns an id for use with the NotifyWatcher facade, or an\nerror, for every supplied entity." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "PhaseResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "phase": { + "type": "string" + } + }, + "additionalProperties": false + }, + "PhaseResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/PhaseResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "MigrationMaster", + "Description": "API implements the API required for the model migration\nmaster worker.", + "Version": 3, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Export": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SerializedModel" + } + }, + "description": "Export serializes the model associated with the API connection." + }, + "MigrationStatus": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MasterMigrationStatus" + } + }, + "description": "MigrationStatus returns the details and progress of the latest\nmodel migration." + }, + "MinionReportTimeout": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "MinionReportTimeout returns the configuration value for this controller that\nindicates how long the migration master worker should wait for minions to\nreported on phases of a migration." + }, + "MinionReports": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MinionReports" + } + }, + "description": "MinionReports returns details of the reports made by migration\nminions to the controller for the current migration phase." + }, + "ModelInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MigrationModelInfo" + } + }, + "description": "ModelInfo returns essential information about the model to be\nmigrated." + }, + "Prechecks": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/PrechecksArgs" + } + }, + "description": "Prechecks performs pre-migration checks on the model and\n(source) controller." + }, + "ProcessRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ProcessRelations" + } + }, + "description": "ProcessRelations processes any relations that need updating after an export.\nThis should help fix any remoteApplications that have been migrated." + }, + "Reap": { + "type": "object", + "description": "Reap removes all documents for the model associated with the API\nconnection." + }, + "SetPhase": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMigrationPhaseArgs" + } + }, + "description": "SetPhase sets the phase of the active model migration. The provided\nphase must be a valid phase value, for example QUIESCE\" or\n\"ABORT\". See the core/migration package for the complete list." + }, + "SetStatusMessage": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMigrationStatusMessageArgs" + } + }, + "description": "SetStatusMessage sets a human readable status message containing\ninformation about the migration's progress. This will be shown in\nstatus output shown to the end user." + }, + "SourceControllerInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MigrationSourceInfo" + } + }, + "description": "SourceControllerInfo returns the details required to connect to\nthe source controller for model migration." + }, + "Watch": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "Watch starts watching for an active migration for the model\nassociated with the API connection. The returned id should be used\nwith the NotifyWatcher facade to receive events." + }, + "WatchMinionReports": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchMinionReports sets up a watcher which reports when a report\nfor a migration minion has arrived." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "MasterMigrationStatus": { + "type": "object", + "properties": { + "migration-id": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "phase-changed-time": { + "type": "string", + "format": "date-time" + }, + "spec": { + "$ref": "#/definitions/MigrationSpec" + } + }, + "additionalProperties": false, + "required": [ + "spec", + "migration-id", + "phase", + "phase-changed-time" + ] + }, + "MigrationModelInfo": { + "type": "object", + "properties": { + "agent-version": { + "$ref": "#/definitions/Number" + }, + "controller-agent-version": { + "$ref": "#/definitions/Number" + }, + "facade-versions": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "name", + "owner-tag", + "agent-version", + "controller-agent-version" + ] + }, + "MigrationSourceInfo": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "ca-cert": { + "type": "string" + }, + "controller-alias": { + "type": "string" + }, + "controller-tag": { + "type": "string" + }, + "local-related-models": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "local-related-models", + "controller-tag", + "addrs", + "ca-cert" + ] + }, + "MigrationSpec": { + "type": "object", + "properties": { + "model-tag": { + "type": "string" + }, + "target-info": { + "$ref": "#/definitions/MigrationTargetInfo" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "target-info" + ] + }, + "MigrationTargetInfo": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "auth-tag": { + "type": "string" + }, + "ca-cert": { + "type": "string" + }, + "controller-alias": { + "type": "string" + }, + "controller-tag": { + "type": "string" + }, + "macaroons": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "controller-tag", + "addrs", + "ca-cert", + "auth-tag" + ] + }, + "MinionReports": { + "type": "object", + "properties": { + "failed": { + "type": "array", + "items": { + "type": "string" + } + }, + "migration-id": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "success-count": { + "type": "integer" + }, + "unknown-count": { + "type": "integer" + }, + "unknown-sample": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "migration-id", + "phase", + "success-count", + "unknown-count", + "unknown-sample", + "failed" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "PrechecksArgs": { + "type": "object", + "properties": { + "target-controller-version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "target-controller-version" + ] + }, + "ProcessRelations": { + "type": "object", + "properties": { + "controller-alias": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "controller-alias" + ] + }, + "SerializedModel": { + "type": "object", + "properties": { + "bytes": { + "type": "array", + "items": { + "type": "integer" + } + }, + "charms": { + "type": "array", + "items": { + "type": "string" + } + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/SerializedModelResource" + } + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/SerializedModelTools" + } + } + }, + "additionalProperties": false, + "required": [ + "bytes", + "charms", + "tools", + "resources" + ] + }, + "SerializedModelResource": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "application-revision": { + "$ref": "#/definitions/SerializedModelResourceRevision" + }, + "charmstore-revision": { + "$ref": "#/definitions/SerializedModelResourceRevision" + }, + "name": { + "type": "string" + }, + "unit-revisions": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/SerializedModelResourceRevision" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "name", + "application-revision", + "charmstore-revision", + "unit-revisions" + ] + }, + "SerializedModelResourceRevision": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "fingerprint": { + "type": "string" + }, + "origin": { + "type": "string" + }, + "path": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "type": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "type", + "path", + "description", + "origin", + "fingerprint", + "size", + "timestamp" + ] + }, + "SerializedModelTools": { + "type": "object", + "properties": { + "uri": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "version", + "uri" + ] + }, + "SetMigrationPhaseArgs": { + "type": "object", + "properties": { + "phase": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "phase" + ] + }, + "SetMigrationStatusMessageArgs": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + } + } + } + }, + { + "Name": "MigrationMinion", + "Description": "API implements the API required for the model migration\nmaster worker.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Report": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MinionReport" + } + }, + "description": "Report allows a migration minion to submit whether it succeeded or\nfailed for a specific migration phase." + }, + "Watch": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "Watch starts watching for status updates for a migration attempt\nfor the model. It will report when a migration starts and when its\nstatus changes (including when it finishes). An initial event will\nbe fired if there has ever been a migration attempt for the model.\n\nThe MigrationStatusWatcher facade must be used to receive events\nfrom the watcher." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "MinionReport": { + "type": "object", + "properties": { + "migration-id": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "success": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "migration-id", + "phase", + "success" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + } + } + } + }, + { + "Name": "MigrationStatusWatcher", + "Description": "", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MigrationStatus" + } + }, + "description": "Next returns when the status for a model migration for the\nassociated model changes. The current details for the active\nmigration are returned." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "MigrationStatus": { + "type": "object", + "properties": { + "attempt": { + "type": "integer" + }, + "migration-id": { + "type": "string" + }, + "phase": { + "type": "string" + }, + "source-api-addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "source-ca-cert": { + "type": "string" + }, + "target-api-addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "target-ca-cert": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "migration-id", + "attempt", + "phase", + "source-api-addrs", + "source-ca-cert", + "target-api-addrs", + "target-ca-cert" + ] + } + } + } + }, + { + "Name": "MigrationTarget", + "Description": "API implements the API required for the model migration\nmaster worker when communicating with the target controller.", + "Version": 3, + "AvailableTo": [ + "controller-user" + ], + "Schema": { + "type": "object", + "properties": { + "Abort": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelArgs" + } + }, + "description": "Abort removes the specified model from the database. It is an error to\nattempt to Abort a model that has a migration mode other than importing." + }, + "Activate": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ActivateModelArgs" + } + }, + "description": "Activate sets the migration mode of the model to \"none\", meaning it\nis ready for use. It is an error to attempt to Abort a model that\nhas a migration mode other than importing. It also adds any required\nexternal controller records for those controllers hosting offers used\nby the model." + }, + "AdoptResources": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AdoptResourcesArgs" + } + }, + "description": "AdoptResources asks the cloud provider to update the controller\ntags for a model's resources. This prevents the resources from\nbeing destroyed if the source controller is destroyed after the\nmodel is migrated away." + }, + "CACert": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/BytesResult" + } + }, + "description": "CACert returns the certificate used to validate the state connection." + }, + "CheckMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "CheckMachines compares the machines in state with the ones reported\nby the provider and reports any discrepancies." + }, + "Import": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SerializedModel" + } + }, + "description": "Import takes a serialized Juju model, deserializes it, and\nrecreates it in the receiving controller." + }, + "LatestLogTime": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelArgs" + }, + "Result": { + "type": "string", + "format": "date-time" + } + }, + "description": "LatestLogTime returns the time of the most recent log record\nreceived by the logtransfer endpoint. This can be used as the start\npoint for streaming logs from the source if the transfer was\ninterrupted.\n\nFor performance reasons, not every time is tracked, so if the\ntarget controller died during the transfer the latest log time\nmight be up to 2 minutes earlier. If the transfer was interrupted\nin some other way (like the source controller going away or a\nnetwork partition) the time will be up-to-date.\n\nLog messages are assumed to be sent in time order (which is how\ndebug-log emits them). If that isn't the case then this mechanism\ncan't be used to avoid duplicates when logtransfer is restarted.\n\nReturns the zero time if no logs have been transferred." + }, + "Prechecks": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MigrationModelInfo" + } + }, + "description": "Prechecks ensure that the target controller is ready to accept a\nmodel migration." + } + }, + "definitions": { + "ActivateModelArgs": { + "type": "object", + "properties": { + "controller-alias": { + "type": "string" + }, + "controller-tag": { + "type": "string" + }, + "cross-model-uuids": { + "type": "array", + "items": { + "type": "string" + } + }, + "model-tag": { + "type": "string" + }, + "source-api-addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "source-ca-cert": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "controller-tag", + "source-api-addrs", + "source-ca-cert", + "cross-model-uuids" + ] + }, + "AdoptResourcesArgs": { + "type": "object", + "properties": { + "model-tag": { + "type": "string" + }, + "source-controller-version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "source-controller-version" + ] + }, + "BytesResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MigrationModelInfo": { + "type": "object", + "properties": { + "agent-version": { + "$ref": "#/definitions/Number" + }, + "controller-agent-version": { + "$ref": "#/definitions/Number" + }, + "facade-versions": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "integer" + } + } + } + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "name", + "owner-tag", + "agent-version", + "controller-agent-version" + ] + }, + "ModelArgs": { + "type": "object", + "properties": { + "model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "SerializedModel": { + "type": "object", + "properties": { + "bytes": { + "type": "array", + "items": { + "type": "integer" + } + }, + "charms": { + "type": "array", + "items": { + "type": "string" + } + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/SerializedModelResource" + } + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/SerializedModelTools" + } + } + }, + "additionalProperties": false, + "required": [ + "bytes", + "charms", + "tools", + "resources" + ] + }, + "SerializedModelResource": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "application-revision": { + "$ref": "#/definitions/SerializedModelResourceRevision" + }, + "charmstore-revision": { + "$ref": "#/definitions/SerializedModelResourceRevision" + }, + "name": { + "type": "string" + }, + "unit-revisions": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/SerializedModelResourceRevision" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "name", + "application-revision", + "charmstore-revision", + "unit-revisions" + ] + }, + "SerializedModelResourceRevision": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "fingerprint": { + "type": "string" + }, + "origin": { + "type": "string" + }, + "path": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "type": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "type", + "path", + "description", + "origin", + "fingerprint", + "size", + "timestamp" + ] + }, + "SerializedModelTools": { + "type": "object", + "properties": { + "uri": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "version", + "uri" + ] + } + } + } + }, + { + "Name": "ModelConfig", + "Description": "ModelConfigAPIV3 is currently the latest.", + "Version": 3, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "controller-user", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "GetModelConstraints": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/GetConstraintsResults" + } + }, + "description": "GetModelConstraints returns the constraints for the model." + }, + "ModelGet": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResults" + } + }, + "description": "ModelGet implements the server-side part of the\nmodel-config CLI command." + }, + "ModelSet": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelSet" + } + }, + "description": "ModelSet implements the server-side part of the\nset-model-config CLI command." + }, + "ModelUnset": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelUnset" + } + }, + "description": "ModelUnset implements the server-side part of the\nset-model-config CLI command." + }, + "SLALevel": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "SLALevel returns the current sla level for the model." + }, + "Sequences": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelSequencesResult" + } + }, + "description": "Sequences returns the model's sequence names and next values." + }, + "SetModelConstraints": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetConstraints" + } + }, + "description": "SetModelConstraints sets the constraints for the model." + }, + "SetSLALevel": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelSLA" + } + }, + "description": "SetSLALevel sets the sla level on the model." + } + }, + "definitions": { + "ConfigValue": { + "type": "object", + "properties": { + "source": { + "type": "string" + }, + "value": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "value", + "source" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "GetConstraintsResults": { + "type": "object", + "properties": { + "constraints": { + "$ref": "#/definitions/Value" + } + }, + "additionalProperties": false, + "required": [ + "constraints" + ] + }, + "ModelConfigResults": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ConfigValue" + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelSLA": { + "type": "object", + "properties": { + "ModelSLAInfo": { + "$ref": "#/definitions/ModelSLAInfo" + }, + "creds": { + "type": "array", + "items": { + "type": "integer" + } + }, + "level": { + "type": "string" + }, + "owner": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "level", + "owner", + "ModelSLAInfo", + "creds" + ] + }, + "ModelSLAInfo": { + "type": "object", + "properties": { + "level": { + "type": "string" + }, + "owner": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "level", + "owner" + ] + }, + "ModelSequencesResult": { + "type": "object", + "properties": { + "sequences": { + "type": "object", + "patternProperties": { + ".*": { + "type": "integer" + } + } + } + }, + "additionalProperties": false, + "required": [ + "sequences" + ] + }, + "ModelSet": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelUnset": { + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "keys" + ] + }, + "SetConstraints": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "constraints": { + "$ref": "#/definitions/Value" + } + }, + "additionalProperties": false, + "required": [ + "application", + "constraints" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "Value": { + "type": "object", + "properties": { + "allocate-public-ip": { + "type": "boolean" + }, + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "image-id": { + "type": "string" + }, + "instance-role": { + "type": "string" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "ModelGeneration", + "Description": "API is the concrete implementation of the API endpoint.", + "Version": 4, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AbortBranch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BranchArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "AbortBranch aborts the input branch, marking it complete. However no\nchanges are made applicable to the whole model. No units may be assigned\nto the branch when aborting." + }, + "AddBranch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BranchArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "AddBranch adds a new branch with the input name to the model." + }, + "BranchInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BranchInfoArgs" + }, + "Result": { + "$ref": "#/definitions/BranchResults" + } + }, + "description": "BranchInfo will return details of branch identified by the input argument,\nincluding units on the branch and the configuration disjoint with the\nmaster generation.\nAn error is returned if no in-flight branch matching in input is found." + }, + "CommitBranch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BranchArg" + }, + "Result": { + "$ref": "#/definitions/IntResult" + } + }, + "description": "CommitBranch commits the input branch, making its changes applicable to\nthe whole model and marking it complete." + }, + "HasActiveBranch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BranchArg" + }, + "Result": { + "$ref": "#/definitions/BoolResult" + } + }, + "description": "HasActiveBranch returns a true result if the input model has an \"in-flight\"\nbranch matching the input name." + }, + "ListCommits": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/BranchResults" + } + }, + "description": "ListCommits will return the commits, hence only branches with generation_id higher than 0" + }, + "ShowCommit": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GenerationId" + }, + "Result": { + "$ref": "#/definitions/GenerationResult" + } + }, + "description": "ShowCommit will return details a commit given by its generationId\nAn error is returned if either no branch can be found corresponding to the generation id.\nOr the generation id given is below 1." + }, + "TrackBranch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BranchTrackArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "TrackBranch marks the input units and/or applications as tracking the input\nbranch, causing them to realise changes made under that branch." + } + }, + "definitions": { + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BranchArg": { + "type": "object", + "properties": { + "branch": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "branch" + ] + }, + "BranchInfoArgs": { + "type": "object", + "properties": { + "branches": { + "type": "array", + "items": { + "type": "string" + } + }, + "detailed": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "branches", + "detailed" + ] + }, + "BranchResults": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "generations": { + "type": "array", + "items": { + "$ref": "#/definitions/Generation" + } + } + }, + "additionalProperties": false, + "required": [ + "generations" + ] + }, + "BranchTrackArg": { + "type": "object", + "properties": { + "branch": { + "type": "string" + }, + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "num-units": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "branch", + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Generation": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "$ref": "#/definitions/GenerationApplication" + } + }, + "branch": { + "type": "string" + }, + "completed": { + "type": "integer" + }, + "completed-by": { + "type": "string" + }, + "created": { + "type": "integer" + }, + "created-by": { + "type": "string" + }, + "generation-id": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "branch", + "created", + "created-by", + "applications" + ] + }, + "GenerationApplication": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "pending": { + "type": "array", + "items": { + "type": "string" + } + }, + "progress": { + "type": "string" + }, + "tracking": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "progress", + "config" + ] + }, + "GenerationId": { + "type": "object", + "properties": { + "generation-id": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "generation-id" + ] + }, + "GenerationResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "generation": { + "$ref": "#/definitions/Generation" + } + }, + "additionalProperties": false, + "required": [ + "generation" + ] + }, + "IntResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + } + } + } + }, + { + "Name": "ModelManager", + "Description": "ModelManagerAPI implements the model manager interface and is\nthe concrete implementation of the api end point.\nV10 of the facade does not return default-series or default-base\nin model info", + "Version": 10, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "controller-user" + ], + "Schema": { + "type": "object", + "properties": { + "ChangeModelCredential": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ChangeModelCredentialsParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ChangeModelCredential changes cloud credential reference for models.\nThese new cloud credentials must already exist on the controller." + }, + "CreateModel": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelCreateArgs" + }, + "Result": { + "$ref": "#/definitions/ModelInfo" + } + }, + "description": "CreateModel creates a new model using the account and\nmodel config specified in the args." + }, + "DestroyModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyModelsParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "DestroyModels will try to destroy the specified models.\nIf there is a block on destruction, this method will return an error.\nFrom ModelManager v7 onwards, DestroyModels gains 'force' and 'max-wait' parameters." + }, + "DumpModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DumpModelRequest" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "DumpModels will export the models into the database agnostic\nrepresentation. The user needs to either be a controller admin, or have\nadmin privileges on the model itself." + }, + "DumpModelsDB": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MapResults" + } + }, + "description": "DumpModelsDB will gather all documents from all model collections\nfor the specified model. The map result contains a map of collection\nnames to lists of documents represented as maps." + }, + "ListModelSummaries": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelSummariesRequest" + }, + "Result": { + "$ref": "#/definitions/ModelSummaryResults" + } + }, + "description": "ListModelSummaries returns models that the specified user\nhas access to in the current server. Controller admins (superuser)\ncan list models for any user. Other users\ncan only ask about their own models." + }, + "ListModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/UserModelList" + } + }, + "description": "ListModels returns the models that the specified user\nhas access to in the current server. Controller admins (superuser)\ncan list models for any user. Other users\ncan only ask about their own models." + }, + "ModelDefaultsForClouds": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ModelDefaultsResults" + } + }, + "description": "ModelDefaultsForClouds returns the default config values for the specified\nclouds." + }, + "ModelInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ModelInfoResults" + } + }, + "description": "ModelInfo returns information about the specified models." + }, + "ModelStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ModelStatusResults" + } + }, + "description": "ModelStatus returns a summary of the model." + }, + "ModifyModelAccess": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModifyModelAccessRequest" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ModifyModelAccess changes the model access granted to users." + }, + "SetModelDefaults": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetModelDefaults" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetModelDefaults writes new values for the specified default model settings." + }, + "UnsetModelDefaults": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UnsetModelDefaults" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UnsetModelDefaults removes the specified default model settings." + } + }, + "definitions": { + "ChangeModelCredentialParams": { + "type": "object", + "properties": { + "credential-tag": { + "type": "string" + }, + "model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "credential-tag" + ] + }, + "ChangeModelCredentialsParams": { + "type": "object", + "properties": { + "model-credentials": { + "type": "array", + "items": { + "$ref": "#/definitions/ChangeModelCredentialParams" + } + } + }, + "additionalProperties": false, + "required": [ + "model-credentials" + ] + }, + "DestroyModelParams": { + "type": "object", + "properties": { + "destroy-storage": { + "type": "boolean" + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + }, + "model-tag": { + "type": "string" + }, + "timeout": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "model-tag" + ] + }, + "DestroyModelsParams": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/DestroyModelParams" + } + } + }, + "additionalProperties": false, + "required": [ + "models" + ] + }, + "DumpModelRequest": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "simplified": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "entities", + "simplified" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineHardware": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "availability-zone": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false + }, + "MapResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "MapResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MapResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Model": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "type": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "uuid", + "type", + "owner-tag" + ] + }, + "ModelApplicationInfo": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + "ModelCreateArgs": { + "type": "object", + "properties": { + "cloud-tag": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "credential": { + "type": "string" + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "region": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "owner-tag" + ] + }, + "ModelDefaultValues": { + "type": "object", + "properties": { + "cloud-region": { + "type": "string" + }, + "cloud-tag": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelDefaults": { + "type": "object", + "properties": { + "controller": { + "type": "object", + "additionalProperties": true + }, + "default": { + "type": "object", + "additionalProperties": true + }, + "regions": { + "type": "array", + "items": { + "$ref": "#/definitions/RegionDefaults" + } + } + }, + "additionalProperties": false + }, + "ModelDefaultsResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ModelDefaults" + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelDefaultsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelDefaultsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelEntityCount": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "entity": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entity", + "count" + ] + }, + "ModelFilesystemInfo": { + "type": "object", + "properties": { + "detachable": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "ModelInfo": { + "type": "object", + "properties": { + "agent-version": { + "$ref": "#/definitions/Number" + }, + "cloud-credential-tag": { + "type": "string" + }, + "cloud-credential-validity": { + "type": "boolean" + }, + "cloud-region": { + "type": "string" + }, + "cloud-tag": { + "type": "string" + }, + "controller-uuid": { + "type": "string" + }, + "default-base": { + "type": "string" + }, + "default-series": { + "type": "string" + }, + "is-controller": { + "type": "boolean" + }, + "life": { + "type": "string" + }, + "machines": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelMachineInfo" + } + }, + "migration": { + "$ref": "#/definitions/ModelMigrationStatus" + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "provider-type": { + "type": "string" + }, + "secret-backends": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretBackendResult" + } + }, + "sla": { + "$ref": "#/definitions/ModelSLAInfo" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "supported-features": { + "type": "array", + "items": { + "$ref": "#/definitions/SupportedFeature" + } + }, + "type": { + "type": "string" + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelUserInfo" + } + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "uuid", + "controller-uuid", + "is-controller", + "cloud-tag", + "owner-tag", + "life", + "users", + "machines", + "secret-backends", + "sla", + "agent-version" + ] + }, + "ModelInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ModelInfo" + } + }, + "additionalProperties": false + }, + "ModelInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelMachineInfo": { + "type": "object", + "properties": { + "display-name": { + "type": "string" + }, + "ha-primary": { + "type": "boolean" + }, + "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" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "ModelMigrationStatus": { + "type": "object", + "properties": { + "end": { + "type": "string", + "format": "date-time" + }, + "start": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "start" + ] + }, + "ModelSLAInfo": { + "type": "object", + "properties": { + "level": { + "type": "string" + }, + "owner": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "level", + "owner" + ] + }, + "ModelStatus": { + "type": "object", + "properties": { + "application-count": { + "type": "integer" + }, + "applications": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelApplicationInfo" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "filesystems": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelFilesystemInfo" + } + }, + "hosted-machine-count": { + "type": "integer" + }, + "life": { + "type": "string" + }, + "machines": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelMachineInfo" + } + }, + "model-tag": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "type": { + "type": "string" + }, + "unit-count": { + "type": "integer" + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelVolumeInfo" + } + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "life", + "type", + "hosted-machine-count", + "application-count", + "unit-count", + "owner-tag" + ] + }, + "ModelStatusResults": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelStatus" + } + } + }, + "additionalProperties": false, + "required": [ + "models" + ] + }, + "ModelSummariesRequest": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag" + ] + }, + "ModelSummary": { + "type": "object", + "properties": { + "agent-version": { + "$ref": "#/definitions/Number" + }, + "cloud-credential-tag": { + "type": "string" + }, + "cloud-region": { + "type": "string" + }, + "cloud-tag": { + "type": "string" + }, + "controller-uuid": { + "type": "string" + }, + "counts": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelEntityCount" + } + }, + "default-series": { + "type": "string" + }, + "is-controller": { + "type": "boolean" + }, + "last-connection": { + "type": "string", + "format": "date-time" + }, + "life": { + "type": "string" + }, + "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" + }, + "user-access": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "uuid", + "type", + "controller-uuid", + "is-controller", + "cloud-tag", + "owner-tag", + "life", + "user-access", + "last-connection", + "counts", + "sla", + "agent-version" + ] + }, + "ModelSummaryResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ModelSummary" + } + }, + "additionalProperties": false + }, + "ModelSummaryResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelSummaryResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelUnsetKeys": { + "type": "object", + "properties": { + "cloud-region": { + "type": "string" + }, + "cloud-tag": { + "type": "string" + }, + "keys": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "keys" + ] + }, + "ModelUserInfo": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "display-name": { + "type": "string" + }, + "last-connection": { + "type": "string", + "format": "date-time" + }, + "model-tag": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "user", + "display-name", + "last-connection", + "access" + ] + }, + "ModelVolumeInfo": { + "type": "object", + "properties": { + "detachable": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "ModifyModelAccess": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "action": { + "type": "string" + }, + "model-tag": { + "type": "string" + }, + "user-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "user-tag", + "action", + "access", + "model-tag" + ] + }, + "ModifyModelAccessRequest": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/ModifyModelAccess" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "RegionDefaults": { + "type": "object", + "properties": { + "region-name": { + "type": "string" + }, + "value": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "region-name", + "value" + ] + }, + "SecretBackend": { + "type": "object", + "properties": { + "backend-type": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "name": { + "type": "string" + }, + "token-rotate-interval": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "name", + "backend-type", + "config" + ] + }, + "SecretBackendResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "num-secrets": { + "type": "integer" + }, + "result": { + "$ref": "#/definitions/SecretBackend" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result", + "id", + "num-secrets", + "status" + ] + }, + "SetModelDefaults": { + "type": "object", + "properties": { + "config": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelDefaultValues" + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SupportedFeature": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "description" + ] + }, + "UnsetModelDefaults": { + "type": "object", + "properties": { + "keys": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelUnsetKeys" + } + } + }, + "additionalProperties": false, + "required": [ + "keys" + ] + }, + "UserModel": { + "type": "object", + "properties": { + "last-connection": { + "type": "string", + "format": "date-time" + }, + "model": { + "$ref": "#/definitions/Model" + } + }, + "additionalProperties": false, + "required": [ + "model", + "last-connection" + ] + }, + "UserModelList": { + "type": "object", + "properties": { + "user-models": { + "type": "array", + "items": { + "$ref": "#/definitions/UserModel" + } + } + }, + "additionalProperties": false, + "required": [ + "user-models" + ] + } + } + } + }, + { + "Name": "ModelSummaryWatcher", + "Description": "SrvModelSummaryWatcher defines the API methods on a ModelSummaryWatcher.", + "Version": 1, + "AvailableTo": [ + "controller-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SummaryWatcherNextResults" + } + }, + "description": "Next will return the current state of everything on the first call\nand subsequent calls will return just those model summaries that have\nchanged." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "ModelAbstract": { + "type": "object", + "properties": { + "admins": { + "type": "array", + "items": { + "type": "string" + } + }, + "annotations": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "cloud": { + "type": "string" + }, + "controller": { + "type": "string" + }, + "credential": { + "type": "string" + }, + "messages": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelSummaryMessage" + } + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "removed": { + "type": "boolean" + }, + "size": { + "$ref": "#/definitions/ModelSummarySize" + }, + "status": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid" + ] + }, + "ModelSummaryMessage": { + "type": "object", + "properties": { + "agent": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "agent", + "message" + ] + }, + "ModelSummarySize": { + "type": "object", + "properties": { + "applications": { + "type": "integer" + }, + "containers": { + "type": "integer" + }, + "machines": { + "type": "integer" + }, + "relations": { + "type": "integer" + }, + "units": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "SummaryWatcherNextResults": { + "type": "object", + "properties": { + "models": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelAbstract" + } + } + }, + "additionalProperties": false, + "required": [ + "models" + ] + } + } + } + }, + { + "Name": "ModelUpgrader", + "Description": "ModelUpgraderAPI implements the model upgrader interface and is\nthe concrete implementation of the api end point.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "controller-user" + ], + "Schema": { + "type": "object", + "properties": { + "AbortModelUpgrade": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelParam" + } + }, + "description": "AbortModelUpgrade aborts and archives the model upgrade\nsynchronisation record, if any." + }, + "UpgradeModel": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpgradeModelParams" + }, + "Result": { + "$ref": "#/definitions/UpgradeModelResult" + } + }, + "description": "UpgradeModel upgrades a model." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ModelParam": { + "type": "object", + "properties": { + "model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "UpgradeModelParams": { + "type": "object", + "properties": { + "agent-stream": { + "type": "string" + }, + "dry-run": { + "type": "boolean" + }, + "ignore-agent-versions": { + "type": "boolean" + }, + "model-tag": { + "type": "string" + }, + "target-version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "target-version" + ] + }, + "UpgradeModelResult": { + "type": "object", + "properties": { + "chosen-version": { + "$ref": "#/definitions/Number" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "chosen-version" + ] + } + } + } + }, + { + "Name": "NotifyWatcher", + "Description": "srvNotifyWatcher defines the API access to methods on a NotifyWatcher.\nEach client has its own current set of watchers, stored in resources.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "controller-user", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "description": "Next returns when a change has occurred to the\nentity being watched since the most recent call to Next\nor the Watch call that created the NotifyWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + } + } + }, + { + "Name": "OfferStatusWatcher", + "Description": "srvOfferStatusWatcher defines the API wrapping a crossmodelrelations.OfferStatusWatcher.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/OfferStatusWatchResult" + } + }, + "description": "Next returns when a change has occurred to an entity of the\ncollection being watched since the most recent call to Next\nor the Watch call that created the srvOfferStatusWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "OfferStatusChange": { + "type": "object", + "properties": { + "offer-name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + } + }, + "additionalProperties": false, + "required": [ + "offer-name", + "status" + ] + }, + "OfferStatusWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferStatusChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "Payloads", + "Description": "API serves payload-specific API methods.", + "Version": 1, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "List": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/PayloadListArgs" + }, + "Result": { + "$ref": "#/definitions/PayloadListResults" + } + }, + "description": "List builds the list of payloads being tracked for\nthe given unit and IDs. If no IDs are provided then all tracked\npayloads for the unit are returned." + } + }, + "definitions": { + "Payload": { + "type": "object", + "properties": { + "class": { + "type": "string" + }, + "id": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "machine": { + "type": "string" + }, + "status": { + "type": "string" + }, + "type": { + "type": "string" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "class", + "type", + "id", + "status", + "labels", + "unit", + "machine" + ] + }, + "PayloadListArgs": { + "type": "object", + "properties": { + "patterns": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "patterns" + ] + }, + "PayloadListResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Payload" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "PayloadsHookContext", + "Description": "UnitFacade serves payload-specific API methods.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "List": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + }, + "description": "List builds the list of payload being tracked for\nthe given unit and IDs. If no IDs are provided then all tracked\npayloads for the unit are returned." + }, + "LookUp": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/LookUpPayloadArgs" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + }, + "description": "LookUp identifies the payload with the provided name and raw ID." + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetPayloadStatusArgs" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + }, + "description": "SetStatus sets the raw status of a payload." + }, + "Track": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/TrackPayloadArgs" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + }, + "description": "Track stores a payload to be tracked in state." + }, + "Untrack": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + }, + "description": "Untrack marks the identified payload as no longer being tracked." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "LookUpPayloadArg": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "id" + ] + }, + "LookUpPayloadArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/LookUpPayloadArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "Payload": { + "type": "object", + "properties": { + "class": { + "type": "string" + }, + "id": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "machine": { + "type": "string" + }, + "status": { + "type": "string" + }, + "type": { + "type": "string" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "class", + "type", + "id", + "status", + "labels", + "unit", + "machine" + ] + }, + "PayloadResult": { + "type": "object", + "properties": { + "Entity": { + "$ref": "#/definitions/Entity" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "not-found": { + "type": "boolean" + }, + "payload": { + "$ref": "#/definitions/Payload" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "Entity", + "payload", + "not-found" + ] + }, + "PayloadResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/PayloadResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetPayloadStatusArg": { + "type": "object", + "properties": { + "Entity": { + "$ref": "#/definitions/Entity" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "Entity", + "status" + ] + }, + "SetPayloadStatusArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SetPayloadStatusArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "TrackPayloadArgs": { + "type": "object", + "properties": { + "payloads": { + "type": "array", + "items": { + "$ref": "#/definitions/Payload" + } + } + }, + "additionalProperties": false, + "required": [ + "payloads" + ] + } + } + } + }, + { + "Name": "Pinger", + "Description": "pinger describes a resource that can be pinged and stopped.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "controller-user", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Ping": { + "type": "object" + }, + "Stop": { + "type": "object" + } + } + } + }, + { + "Name": "Provisioner", + "Description": "ProvisionerAPIV11 provides v10 of the provisioner facade.\nIt relies on agent-set origin when calling SetHostMachineNetworkConfig.", + "Version": 11, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + }, + "description": "APIAddresses returns the list of addresses used to connect to the API." + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + }, + "description": "APIHostPorts returns the API server addresses." + }, + "AvailabilityZone": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "AvailabilityZone returns a provider-specific availability zone for each given machine entity" + }, + "CACert": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/BytesResult" + } + }, + "description": "CACert returns the certificate used to validate the state connection." + }, + "Constraints": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ConstraintsResults" + } + }, + "description": "Constraints returns the constraints for each given machine entity." + }, + "ContainerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ContainerConfig" + } + }, + "description": "ContainerConfig returns information from the model config that is\nneeded for container cloud-init." + }, + "ContainerManagerConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ContainerManagerConfigParams" + }, + "Result": { + "$ref": "#/definitions/ContainerManagerConfig" + } + }, + "description": "ContainerManagerConfig returns information from the model config that is\nneeded for configuring the container manager." + }, + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + }, + "description": "ControllerAPIInfoForModels returns the controller api connection details for the specified models." + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + }, + "description": "ControllerConfig returns the controller's configuration." + }, + "DistributionGroup": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/DistributionGroupResults" + } + }, + "description": "DistributionGroup returns, for each given machine entity,\na slice of instance.Ids that belong to the same distribution\ngroup as that machine. This information may be used to\ndistribute instances for high availability." + }, + "DistributionGroupByMachineId": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsResults" + } + }, + "description": "DistributionGroupByMachineId returns, for each given machine entity,\na slice of machine.Ids that belong to the same distribution\ngroup as that machine. This information may be used to\ndistribute instances for high availability." + }, + "EnsureDead": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "EnsureDead calls EnsureDead on each given entity from state. It\nwill fail if the entity is not present. If it's Alive, nothing will\nhappen (see state/EnsureDead() for units or machines)." + }, + "FindTools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FindToolsParams" + }, + "Result": { + "$ref": "#/definitions/FindToolsResult" + } + }, + "description": "FindTools returns a List containing all tools matching the given parameters." + }, + "GetContainerInterfaceInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineNetworkConfigResults" + } + }, + "description": "GetContainerInterfaceInfo returns information to configure networking for a\ncontainer. It accepts container tags as arguments." + }, + "GetContainerProfileInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ContainerProfileResults" + } + }, + "description": "GetContainerProfileInfo returns information to configure a lxd profile(s) for a\ncontainer based on the charms deployed to the container. It accepts container\ntags as arguments. Unlike machineLXDProfileNames which has the environ\nwrite the lxd profiles and returns the names of profiles already written." + }, + "HostChangesForContainers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/HostNetworkChangeResults" + } + }, + "description": "HostChangesForContainers returns the set of changes that need to be done\nto the host machine to prepare it for the containers to be created.\nPass in a list of the containers that you want the changes for." + }, + "InstanceId": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "InstanceId returns the provider specific instance id for each given\nmachine or an CodeNotProvisioned error, if not set." + }, + "InstanceStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StatusResults" + } + }, + "description": "InstanceStatus returns the instance status for each given entity.\nOnly machine tags are accepted." + }, + "KeepInstance": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + }, + "description": "KeepInstance returns the keep-instance value for each given machine entity." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "MachinesWithTransientErrors": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StatusResults" + } + }, + "description": "MachinesWithTransientErrors returns status data for machines with provisioning\nerrors which are transient." + }, + "MarkMachinesForRemoval": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "MarkMachinesForRemoval indicates that the specified machines are\nready to have any provider-level resources cleaned up and then be\nremoved." + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + }, + "description": "ModelConfig returns the current model's configuration." + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "ModelUUID returns the model UUID that the current connection is for." + }, + "PrepareContainerInterfaceInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineNetworkConfigResults" + } + }, + "description": "PrepareContainerInterfaceInfo allocates an address and returns information to\nconfigure networking for a container. It accepts container tags as arguments." + }, + "ProvisioningInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ProvisioningInfoResults" + } + }, + "description": "ProvisioningInfo returns the provisioning information for each given machine entity.\nIt supports all positive space constraints." + }, + "ReleaseContainerAddresses": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ReleaseContainerAddresses finds addresses allocated to a container and marks\nthem as Dead, to be released and removed. It accepts container tags as\narguments." + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Remove removes every given entity from state, calling EnsureDead\nfirst, then Remove. It will fail if the entity is not present." + }, + "SetCharmProfiles": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetProfileArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetCharmProfiles records the given slice of charm profile names." + }, + "SetHostMachineNetworkConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMachineNetworkConfig" + } + } + }, + "SetInstanceInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/InstancesInfo" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetInstanceInfo sets the provider specific machine id, nonce,\nmetadata and network info for each given machine. Once set, the\ninstance id cannot be changed." + }, + "SetInstanceStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetInstanceStatus updates the instance status for each given\nentity. Only machine tags are accepted." + }, + "SetModificationStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetModificationStatus updates the instance whilst changes are occurring. This\nis different from SetStatus and SetInstanceStatus, by the fact this holds\ninformation about the ongoing changes that are happening to instances.\nConsider LXD Profile updates that can modify a instance, but may not cause\nthe instance to be placed into a error state. This modification status\nserves the purpose of highlighting that to the operator.\nOnly machine tags are accepted." + }, + "SetObservedNetworkConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetMachineNetworkConfig" + } + }, + "description": "SetObservedNetworkConfig reads the network config for the machine\nidentified by the input args.\nThis config is merged with the new network config supplied in the\nsame args and updated if it has changed." + }, + "SetPasswords": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityPasswords" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetPasswords sets the given password for each supplied entity, if possible." + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetStatus sets the status of each given entity." + }, + "SetSupportedContainers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineContainersParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetSupportedContainers updates the list of containers supported by the machines passed in args." + }, + "Status": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StatusResults" + } + }, + "description": "Status returns the status of each given entity." + }, + "SupportedContainers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineContainerResults" + } + }, + "description": "SupportedContainers returns the list of containers supported by the machines passed in args." + }, + "Tools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ToolsResults" + } + }, + "description": "Tools finds the tools necessary for the given agents." + }, + "WatchAPIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchAPIHostPorts watches the API server addresses." + }, + "WatchAllContainers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/WatchContainers" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchAllContainers starts a StringsWatcher to watch all containers deployed to\nany machine passed in args." + }, + "WatchContainers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/WatchContainers" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchContainers starts a StringsWatcher to watch containers deployed to\nany machine passed in args." + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchForModelConfigChanges returns a NotifyWatcher that observes\nchanges to the model configuration.\nNote that although the NotifyWatchResult contains an Error field,\nit's not used because we are only returning a single watcher,\nso we use the regular error return." + }, + "WatchMachineErrorRetry": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchMachineErrorRetry returns a NotifyWatcher that notifies when\nthe provisioner should retry provisioning machines with transient errors." + }, + "WatchModelMachineStartTimes": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchModelMachineStartTimes watches the non-container machines in the model\nfor changes to the Life or AgentStartTime fields and reports them as a batch." + }, + "WatchModelMachines": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchModelMachines returns a StringsWatcher that notifies of\nchanges to the life cycles of the top level machines in the current\nmodel." + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "Address": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "Base": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "channel" + ] + }, + "Binary": { + "type": "object", + "properties": { + "Arch": { + "type": "string" + }, + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Number": { + "$ref": "#/definitions/Number" + }, + "Patch": { + "type": "integer" + }, + "Release": { + "type": "string" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build", + "Number", + "Release", + "Arch" + ] + }, + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "BytesResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "CharmLXDProfile": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "devices": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "description", + "devices" + ] + }, + "CloudImageMetadata": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "image-id": { + "type": "string" + }, + "priority": { + "type": "integer" + }, + "region": { + "type": "string" + }, + "root-storage-size": { + "type": "integer" + }, + "root-storage-type": { + "type": "string" + }, + "source": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "version": { + "type": "string" + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "image-id", + "region", + "version", + "arch", + "source", + "priority" + ] + }, + "ConstraintsResult": { + "type": "object", + "properties": { + "constraints": { + "$ref": "#/definitions/Value" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "constraints" + ] + }, + "ConstraintsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConstraintsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ContainerConfig": { + "type": "object", + "properties": { + "UpdateBehavior": { + "$ref": "#/definitions/UpdateBehavior" + }, + "apt-mirror": { + "type": "string" + }, + "apt-proxy": { + "$ref": "#/definitions/Settings" + }, + "authorized-keys": { + "type": "string" + }, + "cloudinit-userdata": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "container-inherit-properties": { + "type": "string" + }, + "juju-proxy": { + "$ref": "#/definitions/Settings" + }, + "legacy-proxy": { + "$ref": "#/definitions/Settings" + }, + "provider-type": { + "type": "string" + }, + "snap-proxy": { + "$ref": "#/definitions/Settings" + }, + "snap-store-assertions": { + "type": "string" + }, + "snap-store-proxy-id": { + "type": "string" + }, + "snap-store-proxy-url": { + "type": "string" + }, + "ssl-hostname-verification": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "provider-type", + "authorized-keys", + "ssl-hostname-verification", + "legacy-proxy", + "juju-proxy", + "apt-proxy", + "snap-proxy", + "snap-store-assertions", + "snap-store-proxy-id", + "snap-store-proxy-url", + "UpdateBehavior" + ] + }, + "ContainerLXDProfile": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "profile": { + "$ref": "#/definitions/CharmLXDProfile" + } + }, + "additionalProperties": false, + "required": [ + "profile", + "name" + ] + }, + "ContainerManagerConfig": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ContainerManagerConfigParams": { + "type": "object", + "properties": { + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "ContainerProfileResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "lxd-profiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ContainerLXDProfile" + } + } + }, + "additionalProperties": false + }, + "ContainerProfileResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ContainerProfileResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "DeviceBridgeInfo": { + "type": "object", + "properties": { + "bridge-name": { + "type": "string" + }, + "host-device-name": { + "type": "string" + }, + "mac-address": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "host-device-name", + "bridge-name", + "mac-address" + ] + }, + "DistributionGroupResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "DistributionGroupResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/DistributionGroupResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityPassword": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "password" + ] + }, + "EntityPasswords": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPassword" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "FindToolsParams": { + "type": "object", + "properties": { + "agentstream": { + "type": "string" + }, + "arch": { + "type": "string" + }, + "major": { + "type": "integer" + }, + "number": { + "$ref": "#/definitions/Number" + }, + "os-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "number", + "major", + "arch", + "os-type", + "agentstream" + ] + }, + "FindToolsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/Tools" + } + } + }, + "additionalProperties": false, + "required": [ + "list" + ] + }, + "HardwareCharacteristics": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "availability-zone": { + "type": "string" + }, + "cpu-cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false + }, + "HostNetworkChange": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "new-bridges": { + "type": "array", + "items": { + "$ref": "#/definitions/DeviceBridgeInfo" + } + }, + "reconfigure-delay": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "new-bridges", + "reconfigure-delay" + ] + }, + "HostNetworkChangeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/HostNetworkChange" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "port": { + "type": "integer" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope", + "Address", + "port" + ] + }, + "InstanceInfo": { + "type": "object", + "properties": { + "characteristics": { + "$ref": "#/definitions/HardwareCharacteristics" + }, + "charm-profiles": { + "type": "array", + "items": { + "type": "string" + } + }, + "display-name": { + "type": "string" + }, + "instance-id": { + "type": "string" + }, + "network-config": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkConfig" + } + }, + "nonce": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "volume-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/VolumeAttachmentInfo" + } + } + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/Volume" + } + } + }, + "additionalProperties": false, + "required": [ + "tag", + "instance-id", + "display-name", + "nonce", + "characteristics", + "volumes", + "volume-attachments", + "network-config", + "charm-profiles" + ] + }, + "InstancesInfo": { + "type": "object", + "properties": { + "machines": { + "type": "array", + "items": { + "$ref": "#/definitions/InstanceInfo" + } + } + }, + "additionalProperties": false, + "required": [ + "machines" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineContainerResult": { + "type": "object", + "properties": { + "container-types": { + "type": "array", + "items": { + "type": "string" + } + }, + "determined": { + "type": "boolean" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "container-types", + "determined" + ] + }, + "MachineContainerResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineContainerResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineContainers": { + "type": "object", + "properties": { + "container-types": { + "type": "array", + "items": { + "type": "string" + } + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "container-types" + ] + }, + "MachineContainersParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineContainers" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "MachineNetworkConfigResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkConfig" + } + } + }, + "additionalProperties": false, + "required": [ + "info" + ] + }, + "MachineNetworkConfigResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineNetworkConfigResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "NetworkConfig": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "device-index": { + "type": "integer" + }, + "disabled": { + "type": "boolean" + }, + "dns-search-domains": { + "type": "array", + "items": { + "type": "string" + } + }, + "dns-servers": { + "type": "array", + "items": { + "type": "string" + } + }, + "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" + }, + "origin": { + "type": "string" + }, + "parent-interface-name": { + "type": "string" + }, + "provider-address-id": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "provider-network-id": { + "type": "string" + }, + "provider-space-id": { + "type": "string" + }, + "provider-subnet-id": { + "type": "string" + }, + "provider-vlan-id": { + "type": "string" + }, + "routes": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkRoute" + } + }, + "shadow-addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "virtual-port-type": { + "type": "string" + }, + "vlan-tag": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "device-index", + "mac-address", + "cidr", + "mtu", + "provider-id", + "provider-network-id", + "provider-subnet-id", + "provider-space-id", + "provider-address-id", + "provider-vlan-id", + "vlan-tag", + "interface-name", + "parent-interface-name", + "interface-type", + "disabled" + ] + }, + "NetworkRoute": { + "type": "object", + "properties": { + "destination-cidr": { + "type": "string" + }, + "gateway-ip": { + "type": "string" + }, + "metric": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "destination-cidr", + "gateway-ip", + "metric" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "ProvisioningInfo": { + "type": "object", + "properties": { + "ProvisioningNetworkTopology": { + "$ref": "#/definitions/ProvisioningNetworkTopology" + }, + "base": { + "$ref": "#/definitions/Base" + }, + "charm-lxd-profiles": { + "type": "array", + "items": { + "type": "string" + } + }, + "cloudinit-userdata": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "constraints": { + "$ref": "#/definitions/Value" + }, + "controller-config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "endpoint-bindings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "image-metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudImageMetadata" + } + }, + "jobs": { + "type": "array", + "items": { + "type": "string" + } + }, + "placement": { + "type": "string" + }, + "root-disk": { + "$ref": "#/definitions/VolumeParams" + }, + "space-subnets": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "subnet-zones": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "volume-attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeAttachmentParams" + } + }, + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeParams" + } + } + }, + "additionalProperties": false, + "required": [ + "constraints", + "base", + "placement", + "jobs", + "subnet-zones", + "space-subnets", + "ProvisioningNetworkTopology" + ] + }, + "ProvisioningInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ProvisioningInfo" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "ProvisioningInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ProvisioningInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ProvisioningNetworkTopology": { + "type": "object", + "properties": { + "space-subnets": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "subnet-zones": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "subnet-zones", + "space-subnets" + ] + }, + "SetMachineNetworkConfig": { + "type": "object", + "properties": { + "config": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkConfig" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "config" + ] + }, + "SetProfileArg": { + "type": "object", + "properties": { + "entity": { + "$ref": "#/definitions/Entity" + }, + "profiles": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "entity", + "profiles" + ] + }, + "SetProfileArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SetProfileArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Settings": { + "type": "object", + "properties": { + "AutoNoProxy": { + "type": "string" + }, + "Ftp": { + "type": "string" + }, + "Http": { + "type": "string" + }, + "Https": { + "type": "string" + }, + "NoProxy": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Http", + "Https", + "Ftp", + "NoProxy", + "AutoNoProxy" + ] + }, + "StatusResult": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "id": { + "type": "string" + }, + "info": { + "type": "string" + }, + "life": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "life", + "status", + "info", + "data", + "since" + ] + }, + "StatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Tools": { + "type": "object", + "properties": { + "sha256": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "version": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false, + "required": [ + "version", + "url", + "size" + ] + }, + "ToolsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/Tools" + } + } + }, + "additionalProperties": false, + "required": [ + "tools" + ] + }, + "ToolsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ToolsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UpdateBehavior": { + "type": "object", + "properties": { + "enable-os-refresh-update": { + "type": "boolean" + }, + "enable-os-upgrade": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "enable-os-refresh-update", + "enable-os-upgrade" + ] + }, + "Value": { + "type": "object", + "properties": { + "allocate-public-ip": { + "type": "boolean" + }, + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "image-id": { + "type": "string" + }, + "instance-role": { + "type": "string" + }, + "instance-type": { + "type": "string" + }, + "mem": { + "type": "integer" + }, + "root-disk": { + "type": "integer" + }, + "root-disk-source": { + "type": "string" + }, + "spaces": { + "type": "array", + "items": { + "type": "string" + } + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "virt-type": { + "type": "string" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "Volume": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/VolumeInfo" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "info" + ] + }, + "VolumeAttachmentInfo": { + "type": "object", + "properties": { + "bus-address": { + "type": "string" + }, + "device-link": { + "type": "string" + }, + "device-name": { + "type": "string" + }, + "plan-info": { + "$ref": "#/definitions/VolumeAttachmentPlanInfo" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "VolumeAttachmentParams": { + "type": "object", + "properties": { + "instance-id": { + "type": "string" + }, + "machine-tag": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + }, + "volume-id": { + "type": "string" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "machine-tag", + "provider" + ] + }, + "VolumeAttachmentPlanInfo": { + "type": "object", + "properties": { + "device-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "device-type": { + "type": "string" + } + }, + "additionalProperties": false + }, + "VolumeInfo": { + "type": "object", + "properties": { + "hardware-id": { + "type": "string" + }, + "persistent": { + "type": "boolean" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "volume-id": { + "type": "string" + }, + "wwn": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-id", + "size", + "persistent" + ] + }, + "VolumeParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/VolumeAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "size", + "provider" + ] + }, + "WatchContainer": { + "type": "object", + "properties": { + "container-type": { + "type": "string" + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "container-type" + ] + }, + "WatchContainers": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/WatchContainer" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + } + } + } + }, + { + "Name": "ProxyUpdater", + "Description": "API provides the ProxyUpdater version 2 facade.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ProxyConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ProxyConfigResults" + } + }, + "description": "ProxyConfig returns the proxy settings for the current model." + }, + "WatchForProxyConfigAndAPIHostPortChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchForProxyConfigAndAPIHostPortChanges watches for changes to the proxy and api host port settings." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ProxyConfig": { + "type": "object", + "properties": { + "ftp": { + "type": "string" + }, + "http": { + "type": "string" + }, + "https": { + "type": "string" + }, + "no-proxy": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "http", + "https", + "ftp", + "no-proxy" + ] + }, + "ProxyConfigResult": { + "type": "object", + "properties": { + "apt-mirror": { + "type": "string" + }, + "apt-proxy-settings": { + "$ref": "#/definitions/ProxyConfig" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "juju-proxy-settings": { + "$ref": "#/definitions/ProxyConfig" + }, + "legacy-proxy-settings": { + "$ref": "#/definitions/ProxyConfig" + }, + "snap-proxy-settings": { + "$ref": "#/definitions/ProxyConfig" + }, + "snap-store-assertions": { + "type": "string" + }, + "snap-store-id": { + "type": "string" + }, + "snap-store-proxy-url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "legacy-proxy-settings", + "juju-proxy-settings" + ] + }, + "ProxyConfigResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ProxyConfigResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "Reboot", + "Description": "RebootAPI provides access to the Upgrader API facade.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "ClearReboot": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ClearReboot will clear the reboot flag on provided machines, if it exists." + }, + "GetRebootAction": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RebootActionResults" + } + }, + "description": "GetRebootAction returns the action a machine agent should take.\nIf a reboot flag is set on the machine, then that machine is\nexpected to reboot (params.ShouldReboot).\na reboot flag set on the machine parent or grandparent, will\ncause the machine to shutdown (params.ShouldShutdown).\nIf no reboot flag is set, the machine should do nothing (params.ShouldDoNothing)." + }, + "RequestReboot": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RequestReboot sets the reboot flag on the provided machines" + }, + "WatchForRebootEvent": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchForRebootEvent starts a watcher to track if there is a new\nreboot request on the machines ID or any of its parents (in case we are a container)." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "RebootActionResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false + }, + "RebootActionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RebootActionResult" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "RelationStatusWatcher", + "Description": "srvRelationStatusWatcher defines the API wrapping a state.RelationStatusWatcher.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/RelationLifeSuspendedStatusWatchResult" + } + }, + "description": "Next returns when a change has occurred to an entity of the\ncollection being watched since the most recent call to Next\nor the Watch call that created the srvRelationStatusWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "RelationLifeSuspendedStatusChange": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "life": { + "type": "string" + }, + "suspended": { + "type": "boolean" + }, + "suspended-reason": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "key", + "life", + "suspended", + "suspended-reason" + ] + }, + "RelationLifeSuspendedStatusWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationLifeSuspendedStatusChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "RelationUnitsWatcher", + "Description": "srvRelationUnitsWatcher defines the API wrapping a state.RelationUnitsWatcher.\nIt notifies about units entering and leaving the scope of a RelationUnit,\nand changes to the settings of those units known to have entered.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/RelationUnitsWatchResult" + } + }, + "description": "Next returns when a change has occurred to an entity of the\ncollection being watched since the most recent call to Next\nor the Watch call that created the srvRelationUnitsWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "RelationUnitsChange": { + "type": "object", + "properties": { + "app-changed": { + "type": "object", + "patternProperties": { + ".*": { + "type": "integer" + } + } + }, + "changed": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/UnitSettings" + } + } + }, + "departed": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "changed" + ] + }, + "RelationUnitsWatchResult": { + "type": "object", + "properties": { + "changes": { + "$ref": "#/definitions/RelationUnitsChange" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "UnitSettings": { + "type": "object", + "properties": { + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + } + } + } + }, + { + "Name": "RemoteRelationWatcher", + "Description": "srvRemoteRelationWatcher defines the API wrapping a\nstate.RelationUnitsWatcher but serving the events it emits as\nfully-expanded params.RemoteRelationChangeEvents so they can be\nused across model/controller boundaries.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/RemoteRelationWatchResult" + } + } + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "RemoteRelationChangeEvent": { + "type": "object", + "properties": { + "application-settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "application-token": { + "type": "string" + }, + "bakery-version": { + "type": "integer" + }, + "changed-units": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationUnitChange" + } + }, + "departed-units": { + "type": "array", + "items": { + "type": "integer" + } + }, + "force-cleanup": { + "type": "boolean" + }, + "life": { + "type": "string" + }, + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "relation-token": { + "type": "string" + }, + "suspended": { + "type": "boolean" + }, + "suspended-reason": { + "type": "string" + }, + "unit-count": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "relation-token", + "application-token", + "life", + "unit-count" + ] + }, + "RemoteRelationUnitChange": { + "type": "object", + "properties": { + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "unit-id": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "unit-id" + ] + }, + "RemoteRelationWatchResult": { + "type": "object", + "properties": { + "changes": { + "$ref": "#/definitions/RemoteRelationChangeEvent" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "RemoteRelations", + "Description": "API provides access to the remote relations API facade.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ConsumeRemoteRelationChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoteRelationsChanges" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ConsumeRemoteRelationChanges consumes changes to settings originating\nfrom the remote/offering side of relations." + }, + "ConsumeRemoteSecretChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/LatestSecretRevisionChanges" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ConsumeRemoteSecretChanges updates the local model with secret revision changes\noriginating from the remote/offering model." + }, + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + }, + "description": "ControllerAPIInfoForModels returns the controller api connection details for the specified models." + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + }, + "description": "ControllerConfig returns the controller's configuration." + }, + "ExportEntities": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/TokenResults" + } + }, + "description": "ExportEntities allocates unique, remote entity IDs for the given entities in the local model." + }, + "GetTokens": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GetTokenArgs" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "GetTokens returns the token associated with the entities with the given tags for the given models." + }, + "ImportRemoteEntities": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoteEntityTokenArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ImportRemoteEntities adds entities to the remote entities collection with the specified opaque tokens." + }, + "Relations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RemoteRelationResults" + } + }, + "description": "Relations returns information about the cross-model relations with the specified keys\nin the local model." + }, + "RemoteApplications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RemoteApplicationResults" + } + }, + "description": "RemoteApplications returns the current state of the remote applications with\nthe specified names in the local model." + }, + "SaveMacaroons": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityMacaroonArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SaveMacaroons saves the macaroons for the given entities." + }, + "SetRemoteApplicationsStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetRemoteApplicationsStatus sets the status for the specified remote applications." + }, + "UpdateControllersForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateControllersForModelsParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdateControllersForModels changes the external controller records for the\nassociated model entities. This is used when the remote relations worker gets\nredirected following migration of an offering model." + }, + "WatchLocalRelationChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RemoteRelationWatchResults" + } + }, + "description": "WatchLocalRelationChanges starts a RemoteRelationWatcher for each\nspecified relation, returning the watcher IDs and initial values,\nor an error if the remote relations couldn't be watched." + }, + "WatchRemoteApplicationRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchRemoteApplicationRelations starts a StringsWatcher for watching the relations of\neach specified application in the local model, and returns the watcher IDs\nand initial values, or an error if the services' relations could not be\nwatched." + }, + "WatchRemoteApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchRemoteApplications starts a strings watcher that notifies of the addition,\nremoval, and lifecycle changes of remote applications in the model; and\nreturns the watcher ID and initial IDs of remote applications, or an error if\nwatching failed." + }, + "WatchRemoteRelations": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchRemoteRelations starts a strings watcher that notifies of the addition,\nremoval, and lifecycle changes of remote relations in the model; and\nreturns the watcher ID and initial IDs of remote relations, or an error if\nwatching failed." + } + }, + "definitions": { + "ControllerAPIInfoResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "cacert": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses", + "cacert" + ] + }, + "ControllerAPIInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ControllerAPIInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityMacaroonArg": { + "type": "object", + "properties": { + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "macaroon", + "tag" + ] + }, + "EntityMacaroonArgs": { + "type": "object", + "properties": { + "Args": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityMacaroonArg" + } + } + }, + "additionalProperties": false, + "required": [ + "Args" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ExternalControllerInfo": { + "type": "object", + "properties": { + "addrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "ca-cert": { + "type": "string" + }, + "controller-alias": { + "type": "string" + }, + "controller-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "controller-tag", + "controller-alias", + "addrs", + "ca-cert" + ] + }, + "GetTokenArg": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "GetTokenArgs": { + "type": "object", + "properties": { + "Args": { + "type": "array", + "items": { + "$ref": "#/definitions/GetTokenArg" + } + } + }, + "additionalProperties": false, + "required": [ + "Args" + ] + }, + "LatestSecretRevisionChanges": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRevisionChange" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "RemoteApplication": { + "type": "object", + "properties": { + "consume-version": { + "type": "integer" + }, + "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" + } + }, + "additionalProperties": false, + "required": [ + "name", + "offer-uuid", + "model-uuid", + "is-consumer-proxy" + ] + }, + "RemoteApplicationResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RemoteApplication" + } + }, + "additionalProperties": false + }, + "RemoteApplicationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteApplicationResult" + } + } + }, + "additionalProperties": false + }, + "RemoteEndpoint": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "role": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "limit" + ] + }, + "RemoteEntityTokenArg": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "token": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "RemoteEntityTokenArgs": { + "type": "object", + "properties": { + "Args": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteEntityTokenArg" + } + } + }, + "additionalProperties": false, + "required": [ + "Args" + ] + }, + "RemoteRelation": { + "type": "object", + "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" + }, + "unit-count": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "life", + "suspended", + "id", + "key", + "application-name", + "endpoint", + "unit-count", + "remote-application-name", + "remote-endpoint-name", + "source-model-uuid" + ] + }, + "RemoteRelationChangeEvent": { + "type": "object", + "properties": { + "application-settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "application-token": { + "type": "string" + }, + "bakery-version": { + "type": "integer" + }, + "changed-units": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationUnitChange" + } + }, + "departed-units": { + "type": "array", + "items": { + "type": "integer" + } + }, + "force-cleanup": { + "type": "boolean" + }, + "life": { + "type": "string" + }, + "macaroons": { + "type": "array", + "items": { + "$ref": "#/definitions/Macaroon" + } + }, + "relation-token": { + "type": "string" + }, + "suspended": { + "type": "boolean" + }, + "suspended-reason": { + "type": "string" + }, + "unit-count": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "relation-token", + "application-token", + "life", + "unit-count" + ] + }, + "RemoteRelationResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RemoteRelation" + } + }, + "additionalProperties": false + }, + "RemoteRelationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoteRelationUnitChange": { + "type": "object", + "properties": { + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "unit-id": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "unit-id" + ] + }, + "RemoteRelationWatchResult": { + "type": "object", + "properties": { + "changes": { + "$ref": "#/definitions/RemoteRelationChangeEvent" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "RemoteRelationWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoteRelationsChanges": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteRelationChangeEvent" + } + } + }, + "additionalProperties": false + }, + "SecretRevisionChange": { + "type": "object", + "properties": { + "revision": { + "type": "integer" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "revision" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "TokenResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "token": { + "type": "string" + } + }, + "additionalProperties": false + }, + "TokenResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/TokenResult" + } + } + }, + "additionalProperties": false + }, + "UpdateControllerForModel": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/ExternalControllerInfo" + }, + "model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "info" + ] + }, + "UpdateControllersForModelsParams": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateControllerForModel" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + } + } + } + }, + { + "Name": "Resources", + "Description": "API is the public API facade for resources.", + "Version": 3, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AddPendingResources": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddPendingResourcesArgsV2" + }, + "Result": { + "$ref": "#/definitions/AddPendingResourcesResult" + } + }, + "description": "AddPendingResources adds the provided resources (info) to the Juju\nmodel in a pending state, meaning they are not available until\nresolved. Handles CharmHub and Local charms." + }, + "ListResources": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ListResourcesArgs" + }, + "Result": { + "$ref": "#/definitions/ResourcesResults" + } + }, + "description": "ListResources returns the list of resources for the given application." + } + }, + "definitions": { + "AddPendingResourcesArgsV2": { + "type": "object", + "properties": { + "Entity": { + "$ref": "#/definitions/Entity" + }, + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmResource" + } + }, + "tag": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "Entity", + "url", + "charm-origin", + "macaroon", + "resources" + ] + }, + "AddPendingResourcesResult": { + "type": "object", + "properties": { + "ErrorResult": { + "$ref": "#/definitions/ErrorResult" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "pending-ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "ErrorResult", + "pending-ids" + ] + }, + "Base": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "channel" + ] + }, + "CharmOrigin": { + "type": "object", + "properties": { + "architecture": { + "type": "string" + }, + "base": { + "$ref": "#/definitions/Base" + }, + "branch": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "id": { + "type": "string" + }, + "instance-key": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "risk": { + "type": "string" + }, + "source": { + "type": "string" + }, + "track": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "source", + "type", + "id" + ] + }, + "CharmResource": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "fingerprint": { + "type": "array", + "items": { + "type": "integer" + } + }, + "name": { + "type": "string" + }, + "origin": { + "type": "string" + }, + "path": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "origin", + "revision", + "fingerprint", + "size" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ListResourcesArgs": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "Resource": { + "type": "object", + "properties": { + "CharmResource": { + "$ref": "#/definitions/CharmResource" + }, + "application": { + "type": "string" + }, + "description": { + "type": "string" + }, + "fingerprint": { + "type": "array", + "items": { + "type": "integer" + } + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "origin": { + "type": "string" + }, + "path": { + "type": "string" + }, + "pending-id": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "type": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "origin", + "revision", + "fingerprint", + "size", + "CharmResource", + "id", + "pending-id", + "application", + "username", + "timestamp" + ] + }, + "ResourcesResult": { + "type": "object", + "properties": { + "ErrorResult": { + "$ref": "#/definitions/ErrorResult" + }, + "charm-store-resources": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmResource" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/Resource" + } + }, + "unit-resources": { + "type": "array", + "items": { + "$ref": "#/definitions/UnitResources" + } + } + }, + "additionalProperties": false, + "required": [ + "ErrorResult", + "resources", + "charm-store-resources", + "unit-resources" + ] + }, + "ResourcesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourcesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UnitResources": { + "type": "object", + "properties": { + "Entity": { + "$ref": "#/definitions/Entity" + }, + "download-progress": { + "type": "object", + "patternProperties": { + ".*": { + "type": "integer" + } + } + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/Resource" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "Entity", + "resources", + "download-progress" + ] + } + } + } + }, + { + "Name": "ResourcesHookContext", + "Description": "UnitFacade is the resources portion of the uniter's API facade.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "GetResourceInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ListUnitResourcesArgs" + }, + "Result": { + "$ref": "#/definitions/UnitResourcesResult" + } + }, + "description": "GetResourceInfo returns the resource info for each of the given\nresource names (for the implicit application). If any one is missing then\nthe corresponding result is set with errors.NotFound." + } + }, + "definitions": { + "CharmResource": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "fingerprint": { + "type": "array", + "items": { + "type": "integer" + } + }, + "name": { + "type": "string" + }, + "origin": { + "type": "string" + }, + "path": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "origin", + "revision", + "fingerprint", + "size" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ListUnitResourcesArgs": { + "type": "object", + "properties": { + "resource-names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "resource-names" + ] + }, + "Resource": { + "type": "object", + "properties": { + "CharmResource": { + "$ref": "#/definitions/CharmResource" + }, + "application": { + "type": "string" + }, + "description": { + "type": "string" + }, + "fingerprint": { + "type": "array", + "items": { + "type": "integer" + } + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "origin": { + "type": "string" + }, + "path": { + "type": "string" + }, + "pending-id": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "size": { + "type": "integer" + }, + "timestamp": { + "type": "string", + "format": "date-time" + }, + "type": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "type", + "path", + "origin", + "revision", + "fingerprint", + "size", + "CharmResource", + "id", + "pending-id", + "application", + "username", + "timestamp" + ] + }, + "UnitResourceResult": { + "type": "object", + "properties": { + "ErrorResult": { + "$ref": "#/definitions/ErrorResult" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "resource": { + "$ref": "#/definitions/Resource" + } + }, + "additionalProperties": false, + "required": [ + "ErrorResult", + "resource" + ] + }, + "UnitResourcesResult": { + "type": "object", + "properties": { + "ErrorResult": { + "$ref": "#/definitions/ErrorResult" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "resources": { + "type": "array", + "items": { + "$ref": "#/definitions/UnitResourceResult" + } + } + }, + "additionalProperties": false, + "required": [ + "ErrorResult", + "resources" + ] + } + } + } + }, + { + "Name": "RetryStrategy", + "Description": "RetryStrategyAPI implements RetryStrategy", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "RetryStrategy": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RetryStrategyResults" + } + }, + "description": "RetryStrategy returns RetryStrategyResults that can be used by any code that uses\nto configure the retry timer that's currently in juju utils." + }, + "WatchRetryStrategy": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchRetryStrategy watches for changes to the model. Currently we only allow\nchanges to the boolean that determines whether retries should be attempted or not." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RetryStrategy": { + "type": "object", + "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" + } + }, + "additionalProperties": false, + "required": [ + "should-retry", + "min-retry-time", + "max-retry-time", + "jitter-retry-time", + "retry-time-factor" + ] + }, + "RetryStrategyResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RetryStrategy" + } + }, + "additionalProperties": false + }, + "RetryStrategyResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RetryStrategyResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "SSHClient", + "Description": "Facade implements the API required by the sshclient worker.", + "Version": 4, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AllAddresses": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SSHAddressesResults" + } + }, + "description": "AllAddresses reports all addresses that might have SSH listening for each\nentity in args. The result is sorted with public addresses first.\nMachines and units are supported as entity types." + }, + "ModelCredentialForSSH": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/CloudSpecResult" + } + }, + "description": "ModelCredentialForSSH returns a cloud spec for ssh purpose.\nThis facade call is only used for k8s model." + }, + "PrivateAddress": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SSHAddressResults" + } + }, + "description": "PrivateAddress reports the preferred private network address for one or\nmore entities. Machines and units are supported." + }, + "Proxy": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SSHProxyResult" + } + }, + "description": "Proxy returns whether SSH connections should be proxied through the\ncontroller hosts for the model associated with the API connection." + }, + "PublicAddress": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SSHAddressResults" + } + }, + "description": "PublicAddress reports the preferred public network address for one\nor more entities. Machines and units are supported." + }, + "PublicKeys": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SSHPublicKeysResults" + } + }, + "description": "PublicKeys returns the public SSH hosts for one or more\nentities. Machines and units are supported." + } + }, + "definitions": { + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudSpec": { + "type": "object", + "properties": { + "cacertificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "is-controller-cloud": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "skip-tls-verify": { + "type": "boolean" + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "name" + ] + }, + "CloudSpecResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudSpec" + } + }, + "additionalProperties": false + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "SSHAddressResult": { + "type": "object", + "properties": { + "address": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "SSHAddressResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SSHAddressResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SSHAddressesResult": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "addresses" + ] + }, + "SSHAddressesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SSHAddressesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SSHProxyResult": { + "type": "object", + "properties": { + "use-proxy": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "use-proxy" + ] + }, + "SSHPublicKeysResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "public-keys": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "SSHPublicKeysResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SSHPublicKeysResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "SecretBackends", + "Description": "SecretBackendsAPI is the server implementation for the SecretBackends facade.", + "Version": 1, + "AvailableTo": [ + "controller-user" + ], + "Schema": { + "type": "object", + "properties": { + "AddSecretBackends": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddSecretBackendArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "AddSecretBackends adds new secret backends." + }, + "ListSecretBackends": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ListSecretBackendsArgs" + }, + "Result": { + "$ref": "#/definitions/ListSecretBackendsResults" + } + }, + "description": "ListSecretBackends lists available secret backends." + }, + "RemoveSecretBackends": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoveSecretBackendArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RemoveSecretBackends removes secret backends." + }, + "UpdateSecretBackends": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSecretBackendArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdateSecretBackends updates secret backends." + } + }, + "definitions": { + "AddSecretBackendArg": { + "type": "object", + "properties": { + "SecretBackend": { + "$ref": "#/definitions/SecretBackend" + }, + "backend-type": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "token-rotate-interval": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "name", + "backend-type", + "config", + "SecretBackend" + ] + }, + "AddSecretBackendArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/AddSecretBackendArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListSecretBackendsArgs": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + } + }, + "reveal": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "names", + "reveal" + ] + }, + "ListSecretBackendsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretBackendResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoveSecretBackendArg": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + "RemoveSecretBackendArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoveSecretBackendArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "SecretBackend": { + "type": "object", + "properties": { + "backend-type": { + "type": "string" + }, + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "name": { + "type": "string" + }, + "token-rotate-interval": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "name", + "backend-type", + "config" + ] + }, + "SecretBackendResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "id": { + "type": "string" + }, + "message": { + "type": "string" + }, + "num-secrets": { + "type": "integer" + }, + "result": { + "$ref": "#/definitions/SecretBackend" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result", + "id", + "num-secrets", + "status" + ] + }, + "UpdateSecretBackendArg": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "force": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "name-change": { + "type": "string" + }, + "reset": { + "type": "array", + "items": { + "type": "string" + } + }, + "token-rotate-interval": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "name", + "token-rotate-interval", + "config", + "reset" + ] + }, + "UpdateSecretBackendArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSecretBackendArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + } + } + } + }, + { + "Name": "SecretBackendsManager", + "Description": "SecretBackendsManagerAPI is the implementation for the SecretsManager facade.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "RotateBackendTokens": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RotateSecretBackendArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RotateBackendTokens rotates the tokens for the specified backends." + }, + "WatchSecretBackendsRotateChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SecretBackendRotateWatchResult" + } + }, + "description": "WatchSecretBackendsRotateChanges sets up a watcher to notify of changes to secret backend rotations." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RotateSecretBackendArgs": { + "type": "object", + "properties": { + "backend-ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "backend-ids" + ] + }, + "SecretBackendRotateChange": { + "type": "object", + "properties": { + "backend-name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "next-trigger-time": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "required": [ + "id", + "backend-name", + "next-trigger-time" + ] + }, + "SecretBackendRotateWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretBackendRotateChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "SecretBackendsRotateWatcher", + "Description": "srvSecretBackendsRotateWatcher defines the API wrapping a SecretBackendsRotateWatcher.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SecretBackendRotateWatchResult" + } + }, + "description": "Next returns when a change has occurred to an entity of the\ncollection being watched since the most recent call to Next\nor the Watch call that created the srvSecretRotationWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "SecretBackendRotateChange": { + "type": "object", + "properties": { + "backend-name": { + "type": "string" + }, + "id": { + "type": "string" + }, + "next-trigger-time": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "required": [ + "id", + "backend-name", + "next-trigger-time" + ] + }, + "SecretBackendRotateWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretBackendRotateChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "Secrets", + "Description": "SecretsAPI is the backend for the Secrets facade.", + "Version": 2, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "CreateSecrets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CreateSecretArgs" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "CreateSecrets creates new secrets." + }, + "GrantSecret": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GrantRevokeUserSecretArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "GrantSecret grants access to a user secret." + }, + "ListSecrets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ListSecretsArgs" + }, + "Result": { + "$ref": "#/definitions/ListSecretResults" + } + }, + "description": "ListSecrets lists available secrets." + }, + "RemoveSecrets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DeleteSecretArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RemoveSecrets remove user secret." + }, + "RevokeSecret": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GrantRevokeUserSecretArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RevokeSecret revokes access to a user secret." + }, + "UpdateSecrets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateUserSecretArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdateSecrets creates new secrets." + } + }, + "definitions": { + "AccessInfo": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "scope-tag": { + "type": "string" + }, + "target-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "target-tag", + "scope-tag", + "role" + ] + }, + "CreateSecretArg": { + "type": "object", + "properties": { + "UpsertSecretArg": { + "$ref": "#/definitions/UpsertSecretArg" + }, + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "description": { + "type": "string" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-policy": { + "type": "string" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "UpsertSecretArg", + "owner-tag" + ] + }, + "CreateSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/CreateSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "DeleteSecretArg": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "type": "integer" + } + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "label" + ] + }, + "DeleteSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/DeleteSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "GrantRevokeUserSecretArg": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "type": "string" + } + }, + "label": { + "type": "string" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "label", + "applications" + ] + }, + "ListSecretResult": { + "type": "object", + "properties": { + "access": { + "type": "array", + "items": { + "$ref": "#/definitions/AccessInfo" + } + }, + "create-time": { + "type": "string", + "format": "date-time" + }, + "description": { + "type": "string" + }, + "label": { + "type": "string" + }, + "latest-expire-time": { + "type": "string", + "format": "date-time" + }, + "latest-revision": { + "type": "integer" + }, + "next-rotate-time": { + "type": "string", + "format": "date-time" + }, + "owner-tag": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRevision" + } + }, + "rotate-policy": { + "type": "string" + }, + "update-time": { + "type": "string", + "format": "date-time" + }, + "uri": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/SecretValueResult" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "version", + "owner-tag", + "latest-revision", + "create-time", + "update-time", + "revisions" + ] + }, + "ListSecretResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ListSecretResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListSecretsArgs": { + "type": "object", + "properties": { + "filter": { + "$ref": "#/definitions/SecretsFilter" + }, + "show-secrets": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "show-secrets", + "filter" + ] + }, + "SecretContentParams": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "value-ref": { + "$ref": "#/definitions/SecretValueRef" + } + }, + "additionalProperties": false + }, + "SecretRevision": { + "type": "object", + "properties": { + "backend-name": { + "type": "string" + }, + "create-time": { + "type": "string", + "format": "date-time" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "revision": { + "type": "integer" + }, + "update-time": { + "type": "string", + "format": "date-time" + }, + "value-ref": { + "$ref": "#/definitions/SecretValueRef" + } + }, + "additionalProperties": false, + "required": [ + "revision" + ] + }, + "SecretValueRef": { + "type": "object", + "properties": { + "backend-id": { + "type": "string" + }, + "revision-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "backend-id", + "revision-id" + ] + }, + "SecretValueResult": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "SecretsFilter": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UpdateUserSecretArg": { + "type": "object", + "properties": { + "UpsertSecretArg": { + "$ref": "#/definitions/UpsertSecretArg" + }, + "auto-prune": { + "type": "boolean" + }, + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "description": { + "type": "string" + }, + "existing-label": { + "type": "string" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-policy": { + "type": "string" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "UpsertSecretArg", + "uri", + "existing-label" + ] + }, + "UpdateUserSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateUserSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UpsertSecretArg": { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "description": { + "type": "string" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-policy": { + "type": "string" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "SecretsDrain", + "Description": "SecretsDrainAPI is the implementation for the SecretsDrain facade.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ChangeSecretBackend": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ChangeSecretBackendArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ChangeSecretBackend updates the backend for the specified secret after migration done." + }, + "GetSecretsToDrain": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ListSecretResults" + } + }, + "description": "GetSecretsToDrain returns metadata for the secrets that need to be drained." + }, + "WatchSecretBackendChanged": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchSecretBackendChanged sets up a watcher to notify of changes to the secret backend." + } + }, + "definitions": { + "AccessInfo": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "scope-tag": { + "type": "string" + }, + "target-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "target-tag", + "scope-tag", + "role" + ] + }, + "ChangeSecretBackendArg": { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "revision": { + "type": "integer" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "revision" + ] + }, + "ChangeSecretBackendArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/ChangeSecretBackendArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListSecretResult": { + "type": "object", + "properties": { + "access": { + "type": "array", + "items": { + "$ref": "#/definitions/AccessInfo" + } + }, + "create-time": { + "type": "string", + "format": "date-time" + }, + "description": { + "type": "string" + }, + "label": { + "type": "string" + }, + "latest-expire-time": { + "type": "string", + "format": "date-time" + }, + "latest-revision": { + "type": "integer" + }, + "next-rotate-time": { + "type": "string", + "format": "date-time" + }, + "owner-tag": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRevision" + } + }, + "rotate-policy": { + "type": "string" + }, + "update-time": { + "type": "string", + "format": "date-time" + }, + "uri": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/SecretValueResult" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "version", + "owner-tag", + "latest-revision", + "create-time", + "update-time", + "revisions" + ] + }, + "ListSecretResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ListSecretResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "SecretContentParams": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "value-ref": { + "$ref": "#/definitions/SecretValueRef" + } + }, + "additionalProperties": false + }, + "SecretRevision": { + "type": "object", + "properties": { + "backend-name": { + "type": "string" + }, + "create-time": { + "type": "string", + "format": "date-time" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "revision": { + "type": "integer" + }, + "update-time": { + "type": "string", + "format": "date-time" + }, + "value-ref": { + "$ref": "#/definitions/SecretValueRef" + } + }, + "additionalProperties": false, + "required": [ + "revision" + ] + }, + "SecretValueRef": { + "type": "object", + "properties": { + "backend-id": { + "type": "string" + }, + "revision-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "backend-id", + "revision-id" + ] + }, + "SecretValueResult": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "SecretsManager", + "Description": "SecretsManagerAPI is the implementation for the SecretsManager facade.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "CreateSecretURIs": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CreateSecretURIsArg" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "CreateSecretURIs creates new secret URIs." + }, + "CreateSecrets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CreateSecretArgs" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "CreateSecrets creates new secrets." + }, + "GetConsumerSecretsRevisionInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GetSecretConsumerInfoArgs" + }, + "Result": { + "$ref": "#/definitions/SecretConsumerInfoResults" + } + }, + "description": "GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets.\nThis facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook." + }, + "GetSecretBackendConfigs": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SecretBackendArgs" + }, + "Result": { + "$ref": "#/definitions/SecretBackendConfigResults" + } + }, + "description": "GetSecretBackendConfigs gets the config needed to create a client to secret backends." + }, + "GetSecretContentInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GetSecretContentArgs" + }, + "Result": { + "$ref": "#/definitions/SecretContentResults" + } + }, + "description": "GetSecretContentInfo returns the secret values for the specified secrets." + }, + "GetSecretMetadata": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ListSecretResults" + } + }, + "description": "GetSecretMetadata returns metadata for the caller's secrets." + }, + "GetSecretRevisionContentInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SecretRevisionArg" + }, + "Result": { + "$ref": "#/definitions/SecretContentResults" + } + }, + "description": "GetSecretRevisionContentInfo returns the secret values for the specified secret revisions." + }, + "RemoveSecrets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DeleteSecretArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RemoveSecrets removes the specified secrets." + }, + "SecretsGrant": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GrantRevokeSecretArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SecretsGrant grants access to a secret for the specified subjects." + }, + "SecretsRevoke": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GrantRevokeSecretArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SecretsRevoke revokes access to a secret for the specified subjects." + }, + "SecretsRotated": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SecretRotatedArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SecretsRotated records when secrets were last rotated." + }, + "UpdateSecrets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSecretArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdateSecrets updates the specified secrets." + }, + "WatchConsumedSecretsChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers." + }, + "WatchObsolete": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchObsolete returns a watcher for notifying when:\n - a secret owned by the entity is deleted\n - a secret revision owed by the entity no longer\n has any consumers\n\nObsolete revisions results are \"uri/revno\" and deleted\nsecret results are \"uri\"." + }, + "WatchSecretRevisionsExpiryChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SecretTriggerWatchResult" + } + }, + "description": "WatchSecretRevisionsExpiryChanges sets up a watcher to notify of changes to secret revision expiry config." + }, + "WatchSecretsRotationChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SecretTriggerWatchResult" + } + }, + "description": "WatchSecretsRotationChanges sets up a watcher to notify of changes to secret rotation config." + } + }, + "definitions": { + "AccessInfo": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "scope-tag": { + "type": "string" + }, + "target-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "target-tag", + "scope-tag", + "role" + ] + }, + "CreateSecretArg": { + "type": "object", + "properties": { + "UpsertSecretArg": { + "$ref": "#/definitions/UpsertSecretArg" + }, + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "description": { + "type": "string" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-policy": { + "type": "string" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "UpsertSecretArg", + "owner-tag" + ] + }, + "CreateSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/CreateSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "CreateSecretURIsArg": { + "type": "object", + "properties": { + "count": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "count" + ] + }, + "DeleteSecretArg": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "type": "integer" + } + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "label" + ] + }, + "DeleteSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/DeleteSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "GetSecretConsumerInfoArgs": { + "type": "object", + "properties": { + "consumer-tag": { + "type": "string" + }, + "uris": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "consumer-tag", + "uris" + ] + }, + "GetSecretContentArg": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "peek": { + "type": "boolean" + }, + "refresh": { + "type": "boolean" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri" + ] + }, + "GetSecretContentArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/GetSecretContentArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "GrantRevokeSecretArg": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "scope-tag": { + "type": "string" + }, + "subject-tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "scope-tag", + "subject-tags", + "role" + ] + }, + "GrantRevokeSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/GrantRevokeSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "ListSecretResult": { + "type": "object", + "properties": { + "access": { + "type": "array", + "items": { + "$ref": "#/definitions/AccessInfo" + } + }, + "create-time": { + "type": "string", + "format": "date-time" + }, + "description": { + "type": "string" + }, + "label": { + "type": "string" + }, + "latest-expire-time": { + "type": "string", + "format": "date-time" + }, + "latest-revision": { + "type": "integer" + }, + "next-rotate-time": { + "type": "string", + "format": "date-time" + }, + "owner-tag": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRevision" + } + }, + "rotate-policy": { + "type": "string" + }, + "update-time": { + "type": "string", + "format": "date-time" + }, + "uri": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/SecretValueResult" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "version", + "owner-tag", + "latest-revision", + "create-time", + "update-time", + "revisions" + ] + }, + "ListSecretResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ListSecretResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SecretBackendArgs": { + "type": "object", + "properties": { + "backend-ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "for-drain": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "for-drain", + "backend-ids" + ] + }, + "SecretBackendConfig": { + "type": "object", + "properties": { + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "SecretBackendConfigResult": { + "type": "object", + "properties": { + "config": { + "$ref": "#/definitions/SecretBackendConfig" + }, + "draining": { + "type": "boolean" + }, + "model-controller": { + "type": "string" + }, + "model-name": { + "type": "string" + }, + "model-uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-controller", + "model-uuid", + "model-name", + "draining" + ] + }, + "SecretBackendConfigResults": { + "type": "object", + "properties": { + "active-id": { + "type": "string" + }, + "results": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/SecretBackendConfigResult" + } + } + } + }, + "additionalProperties": false, + "required": [ + "active-id" + ] + }, + "SecretConsumerInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "label": { + "type": "string" + }, + "revision": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "label" + ] + }, + "SecretConsumerInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretConsumerInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SecretContentParams": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "value-ref": { + "$ref": "#/definitions/SecretValueRef" + } + }, + "additionalProperties": false + }, + "SecretContentResult": { + "type": "object", + "properties": { + "backend-config": { + "$ref": "#/definitions/SecretBackendConfigResult" + }, + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "latest-revision": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "content" + ] + }, + "SecretContentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretContentResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SecretRevision": { + "type": "object", + "properties": { + "backend-name": { + "type": "string" + }, + "create-time": { + "type": "string", + "format": "date-time" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "revision": { + "type": "integer" + }, + "update-time": { + "type": "string", + "format": "date-time" + }, + "value-ref": { + "$ref": "#/definitions/SecretValueRef" + } + }, + "additionalProperties": false, + "required": [ + "revision" + ] + }, + "SecretRevisionArg": { + "type": "object", + "properties": { + "pending-delete": { + "type": "boolean" + }, + "revisions": { + "type": "array", + "items": { + "type": "integer" + } + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "revisions", + "pending-delete" + ] + }, + "SecretRotatedArg": { + "type": "object", + "properties": { + "original-revision": { + "type": "integer" + }, + "skip": { + "type": "boolean" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "original-revision", + "skip" + ] + }, + "SecretRotatedArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRotatedArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "SecretTriggerChange": { + "type": "object", + "properties": { + "next-trigger-time": { + "type": "string", + "format": "date-time" + }, + "revision": { + "type": "integer" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "next-trigger-time" + ] + }, + "SecretTriggerWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretTriggerChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "SecretValueRef": { + "type": "object", + "properties": { + "backend-id": { + "type": "string" + }, + "revision-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "backend-id", + "revision-id" + ] + }, + "SecretValueResult": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UpdateSecretArg": { + "type": "object", + "properties": { + "UpsertSecretArg": { + "$ref": "#/definitions/UpsertSecretArg" + }, + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "description": { + "type": "string" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-policy": { + "type": "string" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "UpsertSecretArg", + "uri" + ] + }, + "UpdateSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UpsertSecretArg": { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "description": { + "type": "string" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-policy": { + "type": "string" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "SecretsRevisionWatcher", + "Description": "srvSecretsRevisionWatcher defines the API wrapping a SecretsRevisionWatcher.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SecretRevisionWatchResult" + } + }, + "description": "Next returns when a change has occurred to an entity of the\ncollection being watched since the most recent call to Next\nor the Watch call that created the srvSecretRotationWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "SecretRevisionChange": { + "type": "object", + "properties": { + "revision": { + "type": "integer" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "revision" + ] + }, + "SecretRevisionWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRevisionChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "SecretsTriggerWatcher", + "Description": "srvSecretTriggerWatcher defines the API wrapping a SecretsTriggerWatcher.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SecretTriggerWatchResult" + } + }, + "description": "Next returns when a change has occurred to an entity of the\ncollection being watched since the most recent call to Next\nor the Watch call that created the srvSecretRotationWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "SecretTriggerChange": { + "type": "object", + "properties": { + "next-trigger-time": { + "type": "string", + "format": "date-time" + }, + "revision": { + "type": "integer" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "next-trigger-time" + ] + }, + "SecretTriggerWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretTriggerChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "Singular", + "Description": "Facade allows controller machines to request exclusive rights to administer\nsome specific model or controller for a limited time.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Claim": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SingularClaims" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Claim makes the supplied singular-controller lease requests. (In practice,\nany requests not for the connection's model or controller, or not on behalf\nof the connected ModelManager machine, will be rejected.)" + }, + "Wait": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Wait waits for the singular-controller lease to expire for all supplied\nentities. (In practice, any requests that do not refer to the connection's\nmodel or controller will be rejected.)" + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SingularClaim": { + "type": "object", + "properties": { + "claimant-tag": { + "type": "string" + }, + "duration": { + "type": "integer" + }, + "entity-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entity-tag", + "claimant-tag", + "duration" + ] + }, + "SingularClaims": { + "type": "object", + "properties": { + "claims": { + "type": "array", + "items": { + "$ref": "#/definitions/SingularClaim" + } + } + }, + "additionalProperties": false, + "required": [ + "claims" + ] + } + } + } + }, + { + "Name": "Spaces", + "Description": "API provides the spaces API facade for version 6.", + "Version": 6, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "CreateSpaces": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CreateSpacesParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "CreateSpaces creates a new Juju network space, associating the\nspecified subnets with it (optional; can be empty)." + }, + "ListSpaces": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ListSpacesResults" + } + }, + "description": "ListSpaces lists all the available spaces and their associated subnets." + }, + "MoveSubnets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MoveSubnetsParams" + }, + "Result": { + "$ref": "#/definitions/MoveSubnetsResults" + } + }, + "description": "MoveSubnets ensures that the input subnets are in the input space." + }, + "ReloadSpaces": { + "type": "object", + "description": "ReloadSpaces refreshes spaces from substrate" + }, + "RemoveSpace": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoveSpaceParams" + }, + "Result": { + "$ref": "#/definitions/RemoveSpaceResults" + } + }, + "description": "RemoveSpace removes a space.\nReturns SpaceResults if entities/settings are found which makes the deletion not possible." + }, + "RenameSpace": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RenameSpacesParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RenameSpace renames a space." + }, + "ShowSpace": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ShowSpaceResults" + } + }, + "description": "ShowSpace shows the spaces for a set of given entities." + } + }, + "definitions": { + "CreateSpaceParams": { + "type": "object", + "properties": { + "cidrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "provider-id": { + "type": "string" + }, + "public": { + "type": "boolean" + }, + "space-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "cidrs", + "space-tag", + "public" + ] + }, + "CreateSpacesParams": { + "type": "object", + "properties": { + "spaces": { + "type": "array", + "items": { + "$ref": "#/definitions/CreateSpaceParams" + } + } + }, + "additionalProperties": false, + "required": [ + "spaces" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListSpacesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Space" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MoveSubnetsParam": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "space-tag": { + "type": "string" + }, + "subnets": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "subnets", + "space-tag", + "force" + ] + }, + "MoveSubnetsParams": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveSubnetsParam" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "MoveSubnetsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "moved-subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/MovedSubnet" + } + }, + "new-space": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "new-space" + ] + }, + "MoveSubnetsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveSubnetsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MovedSubnet": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "old-space": { + "type": "string" + }, + "subnet": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "subnet", + "old-space", + "cidr" + ] + }, + "RemoveSpaceParam": { + "type": "object", + "properties": { + "dry-run": { + "type": "boolean" + }, + "force": { + "type": "boolean" + }, + "space": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "space" + ] + }, + "RemoveSpaceParams": { + "type": "object", + "properties": { + "space-param": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoveSpaceParam" + } + } + }, + "additionalProperties": false, + "required": [ + "space-param" + ] + }, + "RemoveSpaceResult": { + "type": "object", + "properties": { + "bindings": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "constraints": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "controller-settings": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "RemoveSpaceResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoveSpaceResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RenameSpaceParams": { + "type": "object", + "properties": { + "from-space-tag": { + "type": "string" + }, + "to-space-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "from-space-tag", + "to-space-tag" + ] + }, + "RenameSpacesParams": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/RenameSpaceParams" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "ShowSpaceResult": { + "type": "object", + "properties": { + "applications": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "machine-count": { + "type": "integer" + }, + "space": { + "$ref": "#/definitions/Space" + } + }, + "additionalProperties": false, + "required": [ + "space", + "applications", + "machine-count" + ] + }, + "ShowSpaceResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ShowSpaceResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Space": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/Subnet" + } + } + }, + "additionalProperties": false, + "required": [ + "id", + "name", + "subnets" + ] + }, + "Subnet": { + "type": "object", + "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": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "cidr", + "vlan-tag", + "life", + "space-tag", + "zones" + ] + } + } + } + }, + { + "Name": "StatusHistory", + "Description": "API is the concrete implementation of the Pruner endpoint.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + }, + "description": "ModelConfig returns the current model's configuration." + }, + "Prune": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StatusHistoryPruneArgs" + } + }, + "description": "Prune endpoint removes status history entries until\nonly the ones newer than now - p.MaxHistoryTime remain and\nthe history is smaller than p.MaxHistoryMB." + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchForModelConfigChanges returns a NotifyWatcher that observes\nchanges to the model configuration.\nNote that although the NotifyWatchResult contains an Error field,\nit's not used because we are only returning a single watcher,\nso we use the regular error return." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "StatusHistoryPruneArgs": { + "type": "object", + "properties": { + "max-history-mb": { + "type": "integer" + }, + "max-history-time": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "max-history-time", + "max-history-mb" + ] + } + } + } + }, + { + "Name": "Storage", + "Description": "StorageAPI implements the latest version (v6) of the Storage API.", + "Version": 6, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AddToUnit": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StoragesAddParams" + }, + "Result": { + "$ref": "#/definitions/AddStorageResults" + } + }, + "description": "AddToUnit validates and creates additional storage instances for units.\nA \"CHANGE\" block can block this operation." + }, + "Attach": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageAttachmentIds" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Attach attaches existing storage instances to units.\nA \"CHANGE\" block can block this operation." + }, + "CreatePool": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StoragePoolArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "CreatePool creates a new pool with specified parameters." + }, + "DetachStorage": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageDetachmentParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "DetachStorage sets the specified storage attachments to Dying, unless they are\nalready Dying or Dead. Any associated, persistent storage will remain\nalive. This call can be forced." + }, + "Import": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BulkImportStorageParams" + }, + "Result": { + "$ref": "#/definitions/ImportStorageResults" + } + }, + "description": "Import imports existing storage into the model.\nA \"CHANGE\" block can block this operation." + }, + "ListFilesystems": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FilesystemFilters" + }, + "Result": { + "$ref": "#/definitions/FilesystemDetailsListResults" + } + }, + "description": "ListFilesystems returns a list of filesystems in the environment matching\nthe provided filter. Each result describes a filesystem in detail, including\nthe filesystem's attachments." + }, + "ListPools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StoragePoolFilters" + }, + "Result": { + "$ref": "#/definitions/StoragePoolsResults" + } + }, + "description": "ListPools returns a list of pools.\nIf filter is provided, returned list only contains pools that match\nthe filter.\nPools can be filtered on names and provider types.\nIf both names and types are provided as filter,\npools that match either are returned.\nThis method lists union of pools and environment provider types.\nIf no filter is provided, all pools are returned." + }, + "ListStorageDetails": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageFilters" + }, + "Result": { + "$ref": "#/definitions/StorageDetailsListResults" + } + }, + "description": "ListStorageDetails returns storage matching a filter." + }, + "ListVolumes": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/VolumeFilters" + }, + "Result": { + "$ref": "#/definitions/VolumeDetailsListResults" + } + }, + "description": "ListVolumes lists volumes with the given filters. Each filter produces\nan independent list of volumes, or an error if the filter is invalid\nor the volumes could not be listed." + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RemoveStorage" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Remove sets the specified storage entities to Dying, unless they are\nalready Dying or Dead, such that the storage will eventually be removed\nfrom the model. If the arguments specify that the storage should be\ndestroyed, then the associated cloud storage will be destroyed first;\notherwise it will only be released from Juju's control." + }, + "RemovePool": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StoragePoolDeleteArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RemovePool deletes the named pool" + }, + "StorageDetails": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StorageDetailsResults" + } + }, + "description": "StorageDetails retrieves and returns detailed information about desired\nstorage identified by supplied tags. If specified storage cannot be\nretrieved, individual error is returned instead of storage information." + }, + "UpdatePool": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StoragePoolArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdatePool deletes the named pool" + } + }, + "definitions": { + "AddStorageDetails": { + "type": "object", + "properties": { + "storage-tags": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "storage-tags" + ] + }, + "AddStorageResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/AddStorageDetails" + } + }, + "additionalProperties": false + }, + "AddStorageResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/AddStorageResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "BulkImportStorageParams": { + "type": "object", + "properties": { + "storage": { + "type": "array", + "items": { + "$ref": "#/definitions/ImportStorageParams" + } + } + }, + "additionalProperties": false, + "required": [ + "storage" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "FilesystemAttachmentDetails": { + "type": "object", + "properties": { + "FilesystemAttachmentInfo": { + "$ref": "#/definitions/FilesystemAttachmentInfo" + }, + "life": { + "type": "string" + }, + "mount-point": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "FilesystemAttachmentInfo" + ] + }, + "FilesystemAttachmentInfo": { + "type": "object", + "properties": { + "mount-point": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "FilesystemDetails": { + "type": "object", + "properties": { + "filesystem-tag": { + "type": "string" + }, + "info": { + "$ref": "#/definitions/FilesystemInfo" + }, + "life": { + "type": "string" + }, + "machine-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/FilesystemAttachmentDetails" + } + } + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "storage": { + "$ref": "#/definitions/StorageDetails" + }, + "unit-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/FilesystemAttachmentDetails" + } + } + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-tag", + "info", + "status" + ] + }, + "FilesystemDetailsListResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemDetails" + } + } + }, + "additionalProperties": false + }, + "FilesystemDetailsListResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemDetailsListResult" + } + } + }, + "additionalProperties": false + }, + "FilesystemFilter": { + "type": "object", + "properties": { + "machines": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "FilesystemFilters": { + "type": "object", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemFilter" + } + } + }, + "additionalProperties": false + }, + "FilesystemInfo": { + "type": "object", + "properties": { + "filesystem-id": { + "type": "string" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-id", + "pool", + "size" + ] + }, + "ImportStorageDetails": { + "type": "object", + "properties": { + "storage-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag" + ] + }, + "ImportStorageParams": { + "type": "object", + "properties": { + "kind": { + "type": "integer" + }, + "pool": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "storage-name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "kind", + "pool", + "provider-id", + "storage-name" + ] + }, + "ImportStorageResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ImportStorageDetails" + } + }, + "additionalProperties": false + }, + "ImportStorageResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ImportStorageResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoveStorage": { + "type": "object", + "properties": { + "storage": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoveStorageInstance" + } + } + }, + "additionalProperties": false, + "required": [ + "storage" + ] + }, + "RemoveStorageInstance": { + "type": "object", + "properties": { + "destroy-attachments": { + "type": "boolean" + }, + "destroy-storage": { + "type": "boolean" + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "StorageAddParams": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "storage": { + "$ref": "#/definitions/StorageConstraints" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit", + "name", + "storage" + ] + }, + "StorageAttachmentDetails": { + "type": "object", + "properties": { + "life": { + "type": "string" + }, + "location": { + "type": "string" + }, + "machine-tag": { + "type": "string" + }, + "storage-tag": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag", + "unit-tag", + "machine-tag" + ] + }, + "StorageAttachmentId": { + "type": "object", + "properties": { + "storage-tag": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag", + "unit-tag" + ] + }, + "StorageAttachmentIds": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAttachmentId" + } + } + }, + "additionalProperties": false, + "required": [ + "ids" + ] + }, + "StorageConstraints": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "StorageDetachmentParams": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "ids": { + "$ref": "#/definitions/StorageAttachmentIds" + }, + "max-wait": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "ids" + ] + }, + "StorageDetails": { + "type": "object", + "properties": { + "attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/StorageAttachmentDetails" + } + } + }, + "kind": { + "type": "integer" + }, + "life": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "persistent": { + "type": "boolean" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "storage-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag", + "owner-tag", + "kind", + "status", + "persistent" + ] + }, + "StorageDetailsListResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageDetails" + } + } + }, + "additionalProperties": false + }, + "StorageDetailsListResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageDetailsListResult" + } + } + }, + "additionalProperties": false + }, + "StorageDetailsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/StorageDetails" + } + }, + "additionalProperties": false + }, + "StorageDetailsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageDetailsResult" + } + } + }, + "additionalProperties": false + }, + "StorageFilter": { + "type": "object", + "additionalProperties": false + }, + "StorageFilters": { + "type": "object", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageFilter" + } + } + }, + "additionalProperties": false + }, + "StoragePool": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "name": { + "type": "string" + }, + "provider": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "provider", + "attrs" + ] + }, + "StoragePoolArgs": { + "type": "object", + "properties": { + "pools": { + "type": "array", + "items": { + "$ref": "#/definitions/StoragePool" + } + } + }, + "additionalProperties": false, + "required": [ + "pools" + ] + }, + "StoragePoolDeleteArg": { + "type": "object", + "properties": { + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name" + ] + }, + "StoragePoolDeleteArgs": { + "type": "object", + "properties": { + "pools": { + "type": "array", + "items": { + "$ref": "#/definitions/StoragePoolDeleteArg" + } + } + }, + "additionalProperties": false, + "required": [ + "pools" + ] + }, + "StoragePoolFilter": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + } + }, + "providers": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StoragePoolFilters": { + "type": "object", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/definitions/StoragePoolFilter" + } + } + }, + "additionalProperties": false + }, + "StoragePoolsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "storage-pools": { + "type": "array", + "items": { + "$ref": "#/definitions/StoragePool" + } + } + }, + "additionalProperties": false + }, + "StoragePoolsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StoragePoolsResult" + } + } + }, + "additionalProperties": false + }, + "StoragesAddParams": { + "type": "object", + "properties": { + "storages": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAddParams" + } + } + }, + "additionalProperties": false, + "required": [ + "storages" + ] + }, + "VolumeAttachmentDetails": { + "type": "object", + "properties": { + "VolumeAttachmentInfo": { + "$ref": "#/definitions/VolumeAttachmentInfo" + }, + "bus-address": { + "type": "string" + }, + "device-link": { + "type": "string" + }, + "device-name": { + "type": "string" + }, + "life": { + "type": "string" + }, + "plan-info": { + "$ref": "#/definitions/VolumeAttachmentPlanInfo" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "VolumeAttachmentInfo" + ] + }, + "VolumeAttachmentInfo": { + "type": "object", + "properties": { + "bus-address": { + "type": "string" + }, + "device-link": { + "type": "string" + }, + "device-name": { + "type": "string" + }, + "plan-info": { + "$ref": "#/definitions/VolumeAttachmentPlanInfo" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "VolumeAttachmentPlanInfo": { + "type": "object", + "properties": { + "device-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "device-type": { + "type": "string" + } + }, + "additionalProperties": false + }, + "VolumeDetails": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/VolumeInfo" + }, + "life": { + "type": "string" + }, + "machine-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/VolumeAttachmentDetails" + } + } + }, + "status": { + "$ref": "#/definitions/EntityStatus" + }, + "storage": { + "$ref": "#/definitions/StorageDetails" + }, + "unit-attachments": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/VolumeAttachmentDetails" + } + } + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "info", + "status" + ] + }, + "VolumeDetailsListResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeDetails" + } + } + }, + "additionalProperties": false + }, + "VolumeDetailsListResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeDetailsListResult" + } + } + }, + "additionalProperties": false + }, + "VolumeFilter": { + "type": "object", + "properties": { + "machines": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "VolumeFilters": { + "type": "object", + "properties": { + "filters": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeFilter" + } + } + }, + "additionalProperties": false + }, + "VolumeInfo": { + "type": "object", + "properties": { + "hardware-id": { + "type": "string" + }, + "persistent": { + "type": "boolean" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "volume-id": { + "type": "string" + }, + "wwn": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-id", + "size", + "persistent" + ] + } + } + } + }, + { + "Name": "StorageProvisioner", + "Description": "StorageProvisionerAPIv4 provides the StorageProvisioner API v4 facade.", + "Version": 4, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AttachmentLife": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "AttachmentLife returns the lifecycle state of each specified machine\nstorage attachment." + }, + "CreateVolumeAttachmentPlans": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/VolumeAttachmentPlans" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "EnsureDead": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "EnsureDead calls EnsureDead on each given entity from state. It\nwill fail if the entity is not present. If it's Alive, nothing will\nhappen (see state/EnsureDead() for units or machines)." + }, + "FilesystemAttachmentParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/FilesystemAttachmentParamsResults" + } + }, + "description": "FilesystemAttachmentParams returns the parameters for creating the filesystem\nattachments with the specified IDs." + }, + "FilesystemAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/FilesystemAttachmentResults" + } + }, + "description": "FilesystemAttachments returns details of filesystem attachments with the specified IDs." + }, + "FilesystemParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/FilesystemParamsResults" + } + }, + "description": "FilesystemParams returns the parameters for creating the filesystems\nwith the specified tags." + }, + "Filesystems": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/FilesystemResults" + } + }, + "description": "Filesystems returns details of filesystems with the specified tags." + }, + "InstanceId": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "InstanceId returns the provider specific instance id for each given\nmachine or an CodeNotProvisioned error, if not set." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Remove removes volumes and filesystems from state." + }, + "RemoveAttachment": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RemoveAttachment removes the specified machine storage attachments\nfrom state." + }, + "RemoveFilesystemParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RemoveFilesystemParamsResults" + } + }, + "description": "RemoveFilesystemParams returns the parameters for destroying or\nreleasing the filesystems with the specified tags." + }, + "RemoveVolumeAttachmentPlan": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "RemoveVolumeParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RemoveVolumeParamsResults" + } + }, + "description": "RemoveVolumeParams returns the parameters for destroying\nor releasing the volumes with the specified tags." + }, + "SetFilesystemAttachmentInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FilesystemAttachments" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetFilesystemAttachmentInfo records the details of newly provisioned filesystem\nattachments." + }, + "SetFilesystemInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Filesystems" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetFilesystemInfo records the details of newly provisioned filesystems." + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetStatus sets the status of each given entity." + }, + "SetVolumeAttachmentInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/VolumeAttachments" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetVolumeAttachmentInfo records the details of newly provisioned volume\nattachments." + }, + "SetVolumeAttachmentPlanBlockInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/VolumeAttachmentPlans" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "SetVolumeInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Volumes" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetVolumeInfo records the details of newly provisioned volumes." + }, + "VolumeAttachmentParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/VolumeAttachmentParamsResults" + } + }, + "description": "VolumeAttachmentParams returns the parameters for creating the volume\nattachments with the specified IDs." + }, + "VolumeAttachmentPlans": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/VolumeAttachmentPlanResults" + } + }, + "description": "VolumeAttachmentPlans returns details of volume attachment plans with the specified IDs." + }, + "VolumeAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/VolumeAttachmentResults" + } + }, + "description": "VolumeAttachments returns details of volume attachments with the specified IDs." + }, + "VolumeBlockDevices": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MachineStorageIds" + }, + "Result": { + "$ref": "#/definitions/BlockDeviceResults" + } + }, + "description": "VolumeBlockDevices returns details of the block devices corresponding to the\nvolume attachments with the specified IDs." + }, + "VolumeParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/VolumeParamsResults" + } + }, + "description": "VolumeParams returns the parameters for creating or destroying\nthe volumes with the specified tags." + }, + "Volumes": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/VolumeResults" + } + }, + "description": "Volumes returns details of volumes with the specified tags." + }, + "WatchApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchApplications starts a StringsWatcher to watch CAAS applications\ndeployed to this model." + }, + "WatchBlockDevices": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchBlockDevices watches for changes to the specified machines' block devices." + }, + "WatchFilesystemAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineStorageIdsWatchResults" + } + }, + "description": "WatchFilesystemAttachments watches for changes to filesystem attachments\nscoped to the entity with the tag passed to NewState." + }, + "WatchFilesystems": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchFilesystems watches for changes to filesystems scoped\nto the entity with the tag passed to NewState." + }, + "WatchMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchMachines watches for changes to the specified machines." + }, + "WatchVolumeAttachmentPlans": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineStorageIdsWatchResults" + } + }, + "description": "WatchVolumeAttachmentPlans watches for changes to volume attachments for a machine for the purpose of allowing\nthat machine to run any initialization needed, for that volume to actually appear as a block device (ie: iSCSI)" + }, + "WatchVolumeAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineStorageIdsWatchResults" + } + }, + "description": "WatchVolumeAttachments watches for changes to volume attachments scoped to\nthe entity with the tag passed to NewState." + }, + "WatchVolumes": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchVolumes watches for changes to volumes scoped to the\nentity with the tag passed to NewState." + } + }, + "definitions": { + "BlockDevice": { + "type": "object", + "properties": { + "BusAddress": { + "type": "string" + }, + "DeviceLinks": { + "type": "array", + "items": { + "type": "string" + } + }, + "DeviceName": { + "type": "string" + }, + "FilesystemType": { + "type": "string" + }, + "HardwareId": { + "type": "string" + }, + "InUse": { + "type": "boolean" + }, + "Label": { + "type": "string" + }, + "MountPoint": { + "type": "string" + }, + "SerialId": { + "type": "string" + }, + "Size": { + "type": "integer" + }, + "UUID": { + "type": "string" + }, + "WWN": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "DeviceName", + "DeviceLinks", + "Label", + "UUID", + "HardwareId", + "WWN", + "BusAddress", + "Size", + "FilesystemType", + "InUse", + "MountPoint", + "SerialId" + ] + }, + "BlockDeviceResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/BlockDevice" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BlockDeviceResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BlockDeviceResult" + } + } + }, + "additionalProperties": false + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Filesystem": { + "type": "object", + "properties": { + "filesystem-tag": { + "type": "string" + }, + "info": { + "$ref": "#/definitions/FilesystemInfo" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-tag", + "info" + ] + }, + "FilesystemAttachment": { + "type": "object", + "properties": { + "filesystem-tag": { + "type": "string" + }, + "info": { + "$ref": "#/definitions/FilesystemAttachmentInfo" + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-tag", + "machine-tag", + "info" + ] + }, + "FilesystemAttachmentInfo": { + "type": "object", + "properties": { + "mount-point": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "FilesystemAttachmentParams": { + "type": "object", + "properties": { + "filesystem-id": { + "type": "string" + }, + "filesystem-tag": { + "type": "string" + }, + "instance-id": { + "type": "string" + }, + "machine-tag": { + "type": "string" + }, + "mount-point": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-tag", + "machine-tag", + "provider" + ] + }, + "FilesystemAttachmentParamsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/FilesystemAttachmentParams" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "FilesystemAttachmentParamsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemAttachmentParamsResult" + } + } + }, + "additionalProperties": false + }, + "FilesystemAttachmentResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/FilesystemAttachment" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "FilesystemAttachmentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemAttachmentResult" + } + } + }, + "additionalProperties": false + }, + "FilesystemAttachments": { + "type": "object", + "properties": { + "filesystem-attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemAttachment" + } + } + }, + "additionalProperties": false, + "required": [ + "filesystem-attachments" + ] + }, + "FilesystemInfo": { + "type": "object", + "properties": { + "filesystem-id": { + "type": "string" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-id", + "pool", + "size" + ] + }, + "FilesystemParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/FilesystemAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "filesystem-tag": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "filesystem-tag", + "size", + "provider" + ] + }, + "FilesystemParamsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/FilesystemParams" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "FilesystemParamsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemParamsResult" + } + } + }, + "additionalProperties": false + }, + "FilesystemResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/Filesystem" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "FilesystemResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/FilesystemResult" + } + } + }, + "additionalProperties": false + }, + "Filesystems": { + "type": "object", + "properties": { + "filesystems": { + "type": "array", + "items": { + "$ref": "#/definitions/Filesystem" + } + } + }, + "additionalProperties": false, + "required": [ + "filesystems" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MachineStorageId": { + "type": "object", + "properties": { + "attachment-tag": { + "type": "string" + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "attachment-tag" + ] + }, + "MachineStorageIds": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineStorageId" + } + } + }, + "additionalProperties": false, + "required": [ + "ids" + ] + }, + "MachineStorageIdsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineStorageId" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "MachineStorageIdsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineStorageIdsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RemoveFilesystemParams": { + "type": "object", + "properties": { + "destroy": { + "type": "boolean" + }, + "filesystem-id": { + "type": "string" + }, + "provider": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "provider", + "filesystem-id" + ] + }, + "RemoveFilesystemParamsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RemoveFilesystemParams" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "RemoveFilesystemParamsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoveFilesystemParamsResult" + } + } + }, + "additionalProperties": false + }, + "RemoveVolumeParams": { + "type": "object", + "properties": { + "destroy": { + "type": "boolean" + }, + "provider": { + "type": "string" + }, + "volume-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "provider", + "volume-id" + ] + }, + "RemoveVolumeParamsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/RemoveVolumeParams" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "RemoveVolumeParamsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoveVolumeParamsResult" + } + } + }, + "additionalProperties": false + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Volume": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/VolumeInfo" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "info" + ] + }, + "VolumeAttachment": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/VolumeAttachmentInfo" + }, + "machine-tag": { + "type": "string" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "machine-tag", + "info" + ] + }, + "VolumeAttachmentInfo": { + "type": "object", + "properties": { + "bus-address": { + "type": "string" + }, + "device-link": { + "type": "string" + }, + "device-name": { + "type": "string" + }, + "plan-info": { + "$ref": "#/definitions/VolumeAttachmentPlanInfo" + }, + "read-only": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "VolumeAttachmentParams": { + "type": "object", + "properties": { + "instance-id": { + "type": "string" + }, + "machine-tag": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "read-only": { + "type": "boolean" + }, + "volume-id": { + "type": "string" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "machine-tag", + "provider" + ] + }, + "VolumeAttachmentParamsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/VolumeAttachmentParams" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "VolumeAttachmentParamsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeAttachmentParamsResult" + } + } + }, + "additionalProperties": false + }, + "VolumeAttachmentPlan": { + "type": "object", + "properties": { + "block-device": { + "$ref": "#/definitions/BlockDevice" + }, + "life": { + "type": "string" + }, + "machine-tag": { + "type": "string" + }, + "plan-info": { + "$ref": "#/definitions/VolumeAttachmentPlanInfo" + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "machine-tag", + "plan-info" + ] + }, + "VolumeAttachmentPlanInfo": { + "type": "object", + "properties": { + "device-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "device-type": { + "type": "string" + } + }, + "additionalProperties": false + }, + "VolumeAttachmentPlanResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/VolumeAttachmentPlan" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "VolumeAttachmentPlanResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeAttachmentPlanResult" + } + } + }, + "additionalProperties": false + }, + "VolumeAttachmentPlans": { + "type": "object", + "properties": { + "volume-plans": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeAttachmentPlan" + } + } + }, + "additionalProperties": false, + "required": [ + "volume-plans" + ] + }, + "VolumeAttachmentResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/VolumeAttachment" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "VolumeAttachmentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeAttachmentResult" + } + } + }, + "additionalProperties": false + }, + "VolumeAttachments": { + "type": "object", + "properties": { + "volume-attachments": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeAttachment" + } + } + }, + "additionalProperties": false, + "required": [ + "volume-attachments" + ] + }, + "VolumeInfo": { + "type": "object", + "properties": { + "hardware-id": { + "type": "string" + }, + "persistent": { + "type": "boolean" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "volume-id": { + "type": "string" + }, + "wwn": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-id", + "size", + "persistent" + ] + }, + "VolumeParams": { + "type": "object", + "properties": { + "attachment": { + "$ref": "#/definitions/VolumeAttachmentParams" + }, + "attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "volume-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "volume-tag", + "size", + "provider" + ] + }, + "VolumeParamsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/VolumeParams" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "VolumeParamsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeParamsResult" + } + } + }, + "additionalProperties": false + }, + "VolumeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/Volume" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "VolumeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VolumeResult" + } + } + }, + "additionalProperties": false + }, + "Volumes": { + "type": "object", + "properties": { + "volumes": { + "type": "array", + "items": { + "$ref": "#/definitions/Volume" + } + } + }, + "additionalProperties": false, + "required": [ + "volumes" + ] + } + } + } + }, + { + "Name": "StringsWatcher", + "Description": "srvStringsWatcher defines the API for methods on a state.StringsWatcher.\nEach client has its own current set of watchers, stored in resources.\nsrvStringsWatcher notifies about changes for all entities of a given kind,\nsending the changes as a list of strings.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "Next returns when a change has occurred to an entity of the\ncollection being watched since the most recent call to Next\nor the Watch call that created the srvStringsWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "Subnets", + "Description": "API provides the subnets API facade for version 5.", + "Version": 5, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AllZones": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ZoneResults" + } + }, + "description": "AllZones returns all availability zones known to Juju. If a\nzone is unusable, unavailable, or deprecated the Available\nfield will be false." + }, + "ListSubnets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SubnetsFilters" + }, + "Result": { + "$ref": "#/definitions/ListSubnetsResults" + } + }, + "description": "ListSubnets returns the matching subnets after applying\noptional filters." + }, + "SubnetsByCIDR": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CIDRParams" + }, + "Result": { + "$ref": "#/definitions/SubnetsResults" + } + }, + "description": "SubnetsByCIDR returns the collection of subnets matching each CIDR in the input." + } + }, + "definitions": { + "CIDRParams": { + "type": "object", + "properties": { + "cidrs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "cidrs" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ListSubnetsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Subnet" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Subnet": { + "type": "object", + "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": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "cidr", + "vlan-tag", + "life", + "space-tag", + "zones" + ] + }, + "SubnetV2": { + "type": "object", + "properties": { + "Subnet": { + "$ref": "#/definitions/Subnet" + }, + "cidr": { + "type": "string" + }, + "id": { + "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": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "cidr", + "vlan-tag", + "life", + "space-tag", + "zones", + "Subnet" + ] + }, + "SubnetsFilters": { + "type": "object", + "properties": { + "space-tag": { + "type": "string" + }, + "zone": { + "type": "string" + } + }, + "additionalProperties": false + }, + "SubnetsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/SubnetV2" + } + } + }, + "additionalProperties": false + }, + "SubnetsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SubnetsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ZoneResult": { + "type": "object", + "properties": { + "available": { + "type": "boolean" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "available" + ] + }, + "ZoneResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ZoneResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "Undertaker", + "Description": "UndertakerAPI implements the API used by the model undertaker worker.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "CloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResults" + } + }, + "description": "CloudSpec returns the model's cloud spec." + }, + "GetCloudSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelTag" + }, + "Result": { + "$ref": "#/definitions/CloudSpecResult" + } + }, + "description": "GetCloudSpec constructs the CloudSpec for a validated and authorized model." + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + }, + "description": "ModelConfig returns the current model's configuration." + }, + "ModelInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/UndertakerModelInfoResult" + } + }, + "description": "ModelInfo returns information on the model needed by the undertaker worker." + }, + "ProcessDyingModel": { + "type": "object", + "description": "ProcessDyingModel checks if a dying model has any machines or applications.\nIf there are none, the model's life is changed from dying to dead." + }, + "RemoveModel": { + "type": "object", + "description": "RemoveModel removes any records of this model from Juju." + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetStatus sets the status of each given entity." + }, + "WatchCloudSpecsChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchCloudSpecsChanges returns a watcher for cloud spec changes." + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchForModelConfigChanges returns a NotifyWatcher that observes\nchanges to the model configuration.\nNote that although the NotifyWatchResult contains an Error field,\nit's not used because we are only returning a single watcher,\nso we use the regular error return." + }, + "WatchModel": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchModel creates a watcher for the current model." + }, + "WatchModelResources": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchModelResources creates watchers for changes to the lifecycle of an\nmodel's machines and applications and storage." + } + }, + "definitions": { + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudSpec": { + "type": "object", + "properties": { + "cacertificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "is-controller-cloud": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "skip-tls-verify": { + "type": "boolean" + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "name" + ] + }, + "CloudSpecResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudSpec" + } + }, + "additionalProperties": false + }, + "CloudSpecResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/CloudSpecResult" + } + } + }, + "additionalProperties": false + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelTag": { + "type": "object", + "additionalProperties": false + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "UndertakerModelInfo": { + "type": "object", + "properties": { + "destroy-timeout": { + "type": "integer" + }, + "force-destroyed": { + "type": "boolean" + }, + "global-name": { + "type": "string" + }, + "is-system": { + "type": "boolean" + }, + "life": { + "type": "string" + }, + "name": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "name", + "global-name", + "is-system", + "life" + ] + }, + "UndertakerModelInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/UndertakerModelInfo" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + } + } + } + }, + { + "Name": "UnitAssigner", + "Description": "API implements the functionality for assigning units to machines.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AssignUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "AssignUnits assigns the units with the given ids to the correct machine. The\nerror results are returned in the same order as the given entities." + }, + "SetAgentStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetAgentStatus will set status for agents of Units passed in args, if one\nof the args is not an Unit it will fail." + }, + "WatchUnitAssignments": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchUnitAssignments returns a strings watcher that is notified when new unit\nassignments are added to the db." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "Uniter", + "Description": "UniterAPI implements the latest version (v18) of the Uniter API.", + "Version": 19, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + }, + "description": "APIAddresses returns the list of addresses used to connect to the API." + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + }, + "description": "APIHostPorts returns the API server addresses." + }, + "ActionStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "ActionStatus returns the status of Actions by Tags passed in." + }, + "Actions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionResults" + } + }, + "description": "Actions returns the Actions by Tags passed and ensures that the Unit asking\nfor them is the same Unit that has the Actions." + }, + "AddMetricBatches": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MetricBatchParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "AddMetricBatches adds the metrics for the specified unit." + }, + "ApplicationStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationStatusResults" + } + }, + "description": "ApplicationStatus returns the status of the Applications and its workloads\nif the given unit is the leader." + }, + "AssignedMachine": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "AssignedMachine returns the machine tag for each given unit tag, or\nan error satisfying params.IsCodeNotAssigned when a unit has no\nassigned machine." + }, + "AvailabilityZone": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "AvailabilityZone returns the availability zone for each given unit, if applicable." + }, + "BeginActions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "BeginActions marks the actions represented by the passed in Tags as running." + }, + "CanApplyLXDProfile": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + }, + "description": "CanApplyLXDProfile is a shim to call the LXDProfileAPIv2 version of this method." + }, + "CharmArchiveSha256": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURLs" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "CharmArchiveSha256 returns the SHA256 digest of the charm archive\n(bundle) data for each charm url in the given parameters." + }, + "CharmModifiedVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/IntResults" + } + }, + "description": "CharmModifiedVersion returns the most CharmModifiedVersion for all given\nunits or applications." + }, + "CharmURL": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringBoolResults" + } + }, + "description": "CharmURL returns the charm URL for all given units or applications." + }, + "ClearResolved": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ClearResolved removes any resolved setting from each given unit." + }, + "CloudAPIVersion": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "CloudAPIVersion returns the cloud API version, if available." + }, + "CloudSpec": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/CloudSpecResult" + } + }, + "description": "CloudSpec returns the cloud spec used by the model in which the\nauthenticated unit or application resides.\nA check is made beforehand to ensure that the request is made by an entity\nthat has been granted the appropriate trust." + }, + "CommitHookChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CommitHookChangesArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "CommitHookChanges batches together all required API calls for applying\na set of changes after a hook successfully completes and executes them in a\nsingle transaction." + }, + "ConfigSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ConfigSettingsResults" + } + }, + "description": "ConfigSettings returns the complete set of application charm config\nsettings available to each given unit." + }, + "CreateSecretURIs": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CreateSecretURIsArg" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "CreateSecretURIs creates new secret URIs." + }, + "CreateSecrets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CreateSecretArgs" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "CreateSecrets creates new secrets." + }, + "CurrentModel": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelResult" + } + }, + "description": "CurrentModel returns the name and UUID for the current juju model." + }, + "Destroy": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Destroy advances all given Alive units' lifecycles as far as\npossible. See state/Unit.Destroy()." + }, + "DestroyAllSubordinates": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "DestroyAllSubordinates destroys all subordinates of each given unit." + }, + "DestroyUnitStorageAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "DestroyUnitStorageAttachments marks each storage attachment of the\nspecified units as Dying." + }, + "EnsureDead": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "EnsureDead calls EnsureDead on each given entity from state. It\nwill fail if the entity is not present. If it's Alive, nothing will\nhappen (see state/EnsureDead() for units or machines)." + }, + "EnterScope": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnits" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "EnterScope ensures each unit has entered its scope in the relation,\nfor all of the given relation/unit pairs. See also\nstate.RelationUnit.EnterScope()." + }, + "FinishActions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ActionExecutionResults" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "FinishActions saves the result of a completed Action" + }, + "GetConsumerSecretsRevisionInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GetSecretConsumerInfoArgs" + }, + "Result": { + "$ref": "#/definitions/SecretConsumerInfoResults" + } + }, + "description": "GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets.\nThis facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook." + }, + "GetMeterStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MeterStatusResults" + } + } + }, + "GetPodSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "GetPodSpec gets the pod specs for a set of applications." + }, + "GetPrincipal": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringBoolResults" + } + }, + "description": "GetPrincipal returns the result of calling PrincipalName() and\nconverting it to a tag, on each given unit." + }, + "GetRawK8sSpec": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "GetRawK8sSpec gets the raw k8s specs for a set of applications." + }, + "GetSecretBackendConfigs": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SecretBackendArgs" + }, + "Result": { + "$ref": "#/definitions/SecretBackendConfigResults" + } + }, + "description": "GetSecretBackendConfigs gets the config needed to create a client to secret backends." + }, + "GetSecretContentInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GetSecretContentArgs" + }, + "Result": { + "$ref": "#/definitions/SecretContentResults" + } + }, + "description": "GetSecretContentInfo returns the secret values for the specified secrets." + }, + "GetSecretMetadata": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ListSecretResults" + } + }, + "description": "GetSecretMetadata returns metadata for the caller's secrets." + }, + "GetSecretRevisionContentInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SecretRevisionArg" + }, + "Result": { + "$ref": "#/definitions/SecretContentResults" + } + }, + "description": "GetSecretRevisionContentInfo returns the secret values for the specified secret revisions." + }, + "GoalStates": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/GoalStateResults" + } + }, + "description": "GoalStates returns information of charm units and relations." + }, + "HasSubordinates": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + }, + "description": "HasSubordinates returns the whether each given unit has any subordinates." + }, + "LXDProfileName": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "LXDProfileName is a shim to call the LXDProfileAPIv2 version of this method." + }, + "LXDProfileRequired": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CharmURLs" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + }, + "description": "LXDProfileRequired is a shim to call the LXDProfileAPIv2 version of this method." + }, + "LeaveScope": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnits" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "LeaveScope signals each unit has left its scope in the relation,\nfor all of the given relation/unit pairs. See also\nstate.RelationUnit.LeaveScope()." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "LogActionsMessages": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ActionMessageParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "LogActionsMessages records the log messages against the specified actions." + }, + "Merge": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/MergeLeadershipSettingsBulkParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Merge merges in the provided leadership settings. Only leaders for\nthe given service may perform this operation." + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + }, + "description": "ModelConfig returns the current model's configuration." + }, + "NetworkInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/NetworkInfoParams" + }, + "Result": { + "$ref": "#/definitions/NetworkInfoResults" + } + }, + "description": "NetworkInfo returns network interfaces/addresses for specified bindings." + }, + "OpenedMachinePortRangesByEndpoint": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/OpenPortRangesByEndpointResults" + } + }, + "description": "OpenedMachinePortRangesByEndpoint returns the port ranges opened by each\nunit on the provided machines grouped by application endpoint." + }, + "OpenedPortRangesByEndpoint": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/OpenPortRangesByEndpointResults" + } + }, + "description": "OpenedPortRangesByEndpoint returns the port ranges opened by the unit." + }, + "PrivateAddress": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "PrivateAddress returns the private address for each given unit, if set." + }, + "ProviderType": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "ProviderType returns the provider type used by the current juju\nmodel.\n\nTODO(dimitern): Refactor the uniter to call this instead of calling\nModelConfig() just to get the provider type. Once we have machine\naddresses, this might be completely unnecessary though." + }, + "PublicAddress": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "PublicAddress returns the public address for each given unit, if set." + }, + "Read": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/GetLeadershipSettingsBulkResults" + } + }, + "description": "Read reads leadership settings for the provided service ID. Any\nunit of the service may perform this operation." + }, + "ReadLocalApplicationSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnit" + }, + "Result": { + "$ref": "#/definitions/SettingsResult" + } + }, + "description": "ReadLocalApplicationSettings returns the local application settings for a\nparticular relation when invoked by the leader unit." + }, + "ReadRemoteSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnitPairs" + }, + "Result": { + "$ref": "#/definitions/SettingsResults" + } + }, + "description": "ReadRemoteSettings returns the remote settings of each given set of\nrelation/local unit/remote unit." + }, + "ReadSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnits" + }, + "Result": { + "$ref": "#/definitions/SettingsResults" + } + }, + "description": "ReadSettings returns the local settings of each given set of\nrelation/unit.\n\nNOTE(achilleasa): Using this call to read application data is deprecated\nand will not work for k8s charms (see LP1876097). Instead, clients should\nuse ReadLocalApplicationSettings." + }, + "Refresh": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UnitRefreshResults" + } + }, + "description": "Refresh retrieves the latest values for attributes on this unit." + }, + "Relation": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnits" + }, + "Result": { + "$ref": "#/definitions/RelationResults" + } + }, + "description": "Relation returns information about all given relation/unit pairs,\nincluding their id, key and the local endpoint." + }, + "RelationById": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationIds" + }, + "Result": { + "$ref": "#/definitions/RelationResults" + } + }, + "description": "RelationById returns information about all given relations,\nspecified by their ids, including their key and the local\nendpoint." + }, + "RelationsStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/RelationUnitStatusResults" + } + }, + "description": "RelationsStatus returns for each unit the corresponding relation and status information." + }, + "RemoveSecrets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DeleteSecretArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RemoveSecrets removes the specified secrets." + }, + "RemoveStorageAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageAttachmentIds" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RemoveStorageAttachments removes the specified storage\nattachments from state." + }, + "RequestReboot": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RequestReboot sets the reboot flag on the provided machines" + }, + "Resolved": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ResolvedModeResults" + } + }, + "description": "Resolved returns the current resolved setting for each given unit." + }, + "SLALevel": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "SLALevel returns the model's SLA level." + }, + "SecretsGrant": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GrantRevokeSecretArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SecretsGrant grants access to a secret for the specified subjects." + }, + "SecretsRevoke": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GrantRevokeSecretArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SecretsRevoke revokes access to a secret for the specified subjects." + }, + "SecretsRotated": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SecretRotatedArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SecretsRotated records when secrets were last rotated." + }, + "SetAgentStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetAgentStatus will set status for agents of Units passed in args, if one\nof the args is not an Unit it will fail." + }, + "SetApplicationStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetApplicationStatus sets the status for all the Applications in args if the given Unit is\nthe leader." + }, + "SetCharmURL": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntitiesCharmURL" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetCharmURL sets the charm URL for each given unit. An error will\nbe returned if a unit is dead, or the charm URL is not known." + }, + "SetRelationStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationStatusArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetRelationStatus updates the status of the specified relations." + }, + "SetState": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetUnitStateArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetState sets the state persisted by the charm running in this unit\nand the state internal to the uniter for this unit." + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetStatus will set status for a entities passed in args. If the entity is\na Unit it will instead set status to its agent, to emulate backwards\ncompatibility." + }, + "SetUnitStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetUnitStatus sets status for all elements passed in args, the difference\nwith SetStatus is that if an entity is a Unit it will set its status instead\nof its agent." + }, + "SetUpgradeSeriesUnitStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpgradeSeriesStatusParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit.\nIf no upgrade is in progress an error is returned instead." + }, + "SetWorkloadVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityWorkloadVersions" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetWorkloadVersion sets the workload version for each given unit. An error will\nbe returned if a unit is dead." + }, + "State": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UnitStateResults" + } + }, + "description": "State returns the state persisted by the charm running in this unit\nand the state internal to the uniter for this unit." + }, + "StorageAttachmentLife": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageAttachmentIds" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "StorageAttachmentLife returns the lifecycle state of the storage attachments\nwith the specified tags." + }, + "StorageAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageAttachmentIds" + }, + "Result": { + "$ref": "#/definitions/StorageAttachmentResults" + } + }, + "description": "StorageAttachments returns the storage attachments with the specified tags." + }, + "UnitStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StatusResults" + } + }, + "description": "UnitStatus returns the workload status information for the unit." + }, + "UnitStorageAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StorageAttachmentIdsResults" + } + }, + "description": "UnitStorageAttachments returns the IDs of storage attachments for a collection of units." + }, + "UpdateNetworkInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdateNetworkInfo refreshes the network settings for a unit's bound\nendpoints." + }, + "UpdateSecrets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSecretArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdateSecrets updates the specified secrets." + }, + "UpgradeSeriesUnitStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UpgradeSeriesStatusResults" + } + }, + "description": "UpgradeSeriesUnitStatus returns the current preparation status of an\nupgrading unit.\nIf no series upgrade is in progress an error is returned instead." + }, + "Watch": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "Watch starts an NotifyWatcher for each given entity." + }, + "WatchAPIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchAPIHostPorts watches the API server addresses." + }, + "WatchActionNotifications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchActionNotifications returns a StringsWatcher for observing\nincoming action calls to a unit. See also state/watcher.go\nUnit.WatchActionNotifications(). This method is called from\napi/uniter/uniter.go WatchActionNotifications()." + }, + "WatchConfigSettingsHash": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchConfigSettingsHash returns a StringsWatcher that yields a hash\nof the config values every time the config changes. The uniter can\nsave this hash and use it to decide whether the config-changed hook\nneeds to be run (or whether this was just an agent restart with no\nsubstantive config change)." + }, + "WatchConsumedSecretsChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers." + }, + "WatchForModelConfigChanges": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchForModelConfigChanges returns a NotifyWatcher that observes\nchanges to the model configuration.\nNote that although the NotifyWatchResult contains an Error field,\nit's not used because we are only returning a single watcher,\nso we use the regular error return." + }, + "WatchInstanceData": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchInstanceData is a shim to call the LXDProfileAPIv2 version of this method." + }, + "WatchLeadershipSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchLeadershipSettings will block the caller until leadership settings\nfor the given service ID change." + }, + "WatchMeterStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + }, + "WatchObsolete": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchObsolete returns a watcher for notifying when:\n - a secret owned by the entity is deleted\n - a secret revision owed by the entity no longer\n has any consumers\n\nObsolete revisions results are \"uri/revno\" and deleted\nsecret results are \"uri\"." + }, + "WatchRelationUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnits" + }, + "Result": { + "$ref": "#/definitions/RelationUnitsWatchResults" + } + }, + "description": "WatchRelationUnits returns a RelationUnitsWatcher for observing\nchanges to every unit in the supplied relation that is visible to\nthe supplied unit. See also state/watcher.go:RelationUnit.Watch()." + }, + "WatchSecretRevisionsExpiryChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SecretTriggerWatchResult" + } + }, + "description": "WatchSecretRevisionsExpiryChanges sets up a watcher to notify of changes to secret revision expiry config." + }, + "WatchSecretsRotationChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SecretTriggerWatchResult" + } + }, + "description": "WatchSecretsRotationChanges sets up a watcher to notify of changes to secret rotation config." + }, + "WatchStorageAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StorageAttachmentIds" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchStorageAttachments creates watchers for a collection of storage\nattachments, each of which can be used to watch changes to storage\nattachment info." + }, + "WatchTrustConfigSettingsHash": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchTrustConfigSettingsHash returns a StringsWatcher that yields a\nhash of the application config values whenever they change. The\nuniter can use the hash to determine whether the actual values have\nchanged since it last saw the config." + }, + "WatchUnitAddressesHash": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchUnitAddressesHash returns a StringsWatcher that yields the\nhashes of the addresses for the unit whenever the addresses\nchange. The uniter can use the hash to determine whether the actual\naddress values have changed since it last saw the config." + }, + "WatchUnitRelations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchUnitRelations returns a StringsWatcher, for each given\nunit, that notifies of changes to the lifecycles of relations\nrelevant to that unit. For principal units, this will be all of the\nrelations for the application. For subordinate units, only\nrelations with the principal unit's application will be monitored." + }, + "WatchUnitStorageAttachments": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsWatchResults" + } + }, + "description": "WatchUnitStorageAttachments creates watchers for a collection of units,\neach of which can be used to watch for lifecycle changes to the corresponding\nunit's storage attachments." + }, + "WatchUpgradeSeriesNotifications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks." + }, + "WorkloadVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "WorkloadVersion returns the workload version for all given units or applications." + } + }, + "definitions": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "AccessInfo": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "scope-tag": { + "type": "string" + }, + "target-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "target-tag", + "scope-tag", + "role" + ] + }, + "Action": { + "type": "object", + "properties": { + "execution-group": { + "type": "string" + }, + "name": { + "type": "string" + }, + "parallel": { + "type": "boolean" + }, + "parameters": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "receiver": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "receiver", + "name" + ] + }, + "ActionExecutionResult": { + "type": "object", + "properties": { + "action-tag": { + "type": "string" + }, + "message": { + "type": "string" + }, + "results": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "action-tag", + "status" + ] + }, + "ActionExecutionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionExecutionResult" + } + } + }, + "additionalProperties": false + }, + "ActionMessage": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "timestamp": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "required": [ + "timestamp", + "message" + ] + }, + "ActionMessageParams": { + "type": "object", + "properties": { + "messages": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityString" + } + } + }, + "additionalProperties": false, + "required": [ + "messages" + ] + }, + "ActionResult": { + "type": "object", + "properties": { + "action": { + "$ref": "#/definitions/Action" + }, + "completed": { + "type": "string", + "format": "date-time" + }, + "enqueued": { + "type": "string", + "format": "date-time" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "log": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionMessage" + } + }, + "message": { + "type": "string" + }, + "output": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "started": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ActionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionResult" + } + } + }, + "additionalProperties": false + }, + "Address": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope" + ] + }, + "ApplicationStatusResult": { + "type": "object", + "properties": { + "application": { + "$ref": "#/definitions/StatusResult" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "units": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/StatusResult" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "units" + ] + }, + "ApplicationStatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationStatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "BoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "BoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/BoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "CharmRelation": { + "type": "object", + "properties": { + "interface": { + "type": "string" + }, + "limit": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "optional": { + "type": "boolean" + }, + "role": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "role", + "interface", + "optional", + "limit", + "scope" + ] + }, + "CharmURL": { + "type": "object", + "properties": { + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url" + ] + }, + "CharmURLs": { + "type": "object", + "properties": { + "urls": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmURL" + } + } + }, + "additionalProperties": false, + "required": [ + "urls" + ] + }, + "CloudCredential": { + "type": "object", + "properties": { + "attrs": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "auth-type": { + "type": "string" + }, + "redacted": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "auth-type" + ] + }, + "CloudSpec": { + "type": "object", + "properties": { + "cacertificates": { + "type": "array", + "items": { + "type": "string" + } + }, + "credential": { + "$ref": "#/definitions/CloudCredential" + }, + "endpoint": { + "type": "string" + }, + "identity-endpoint": { + "type": "string" + }, + "is-controller-cloud": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "region": { + "type": "string" + }, + "skip-tls-verify": { + "type": "boolean" + }, + "storage-endpoint": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "name" + ] + }, + "CloudSpecResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/CloudSpec" + } + }, + "additionalProperties": false + }, + "CommitHookChangesArg": { + "type": "object", + "properties": { + "add-storage": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAddParams" + } + }, + "close-ports": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPortRange" + } + }, + "open-ports": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPortRange" + } + }, + "pod-spec": { + "$ref": "#/definitions/PodSpec" + }, + "relation-unit-settings": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitSettings" + } + }, + "secret-creates": { + "type": "array", + "items": { + "$ref": "#/definitions/CreateSecretArg" + } + }, + "secret-deletes": { + "type": "array", + "items": { + "$ref": "#/definitions/DeleteSecretArg" + } + }, + "secret-grants": { + "type": "array", + "items": { + "$ref": "#/definitions/GrantRevokeSecretArg" + } + }, + "secret-revokes": { + "type": "array", + "items": { + "$ref": "#/definitions/GrantRevokeSecretArg" + } + }, + "secret-track-latest": { + "type": "array", + "items": { + "type": "string" + } + }, + "secret-updates": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSecretArg" + } + }, + "set-raw-k8s-spec": { + "$ref": "#/definitions/PodSpec" + }, + "tag": { + "type": "string" + }, + "unit-state": { + "$ref": "#/definitions/SetUnitStateArg" + }, + "update-network-info": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "update-network-info" + ] + }, + "CommitHookChangesArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/CommitHookChangesArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "ConfigSettingsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "settings" + ] + }, + "ConfigSettingsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConfigSettingsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "CreateSecretArg": { + "type": "object", + "properties": { + "UpsertSecretArg": { + "$ref": "#/definitions/UpsertSecretArg" + }, + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "description": { + "type": "string" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-policy": { + "type": "string" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "UpsertSecretArg", + "owner-tag" + ] + }, + "CreateSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/CreateSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "CreateSecretURIsArg": { + "type": "object", + "properties": { + "count": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "count" + ] + }, + "DeleteSecretArg": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "type": "integer" + } + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "label" + ] + }, + "DeleteSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/DeleteSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "Endpoint": { + "type": "object", + "properties": { + "application-name": { + "type": "string" + }, + "relation": { + "$ref": "#/definitions/CharmRelation" + } + }, + "additionalProperties": false, + "required": [ + "application-name", + "relation" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesCharmURL": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityCharmURL" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityCharmURL": { + "type": "object", + "properties": { + "charm-url": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "charm-url" + ] + }, + "EntityPortRange": { + "type": "object", + "properties": { + "endpoint": { + "type": "string" + }, + "from-port": { + "type": "integer" + }, + "protocol": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "to-port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "protocol", + "from-port", + "to-port", + "endpoint" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "EntityString": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "value" + ] + }, + "EntityWorkloadVersion": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "workload-version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "workload-version" + ] + }, + "EntityWorkloadVersions": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityWorkloadVersion" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "GetLeadershipSettingsBulkResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/GetLeadershipSettingsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "GetLeadershipSettingsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "settings" + ] + }, + "GetSecretConsumerInfoArgs": { + "type": "object", + "properties": { + "consumer-tag": { + "type": "string" + }, + "uris": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "consumer-tag", + "uris" + ] + }, + "GetSecretContentArg": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "peek": { + "type": "boolean" + }, + "refresh": { + "type": "boolean" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri" + ] + }, + "GetSecretContentArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/GetSecretContentArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "GoalState": { + "type": "object", + "properties": { + "relations": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/GoalStateStatus" + } + } + } + } + }, + "units": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/GoalStateStatus" + } + } + } + }, + "additionalProperties": false, + "required": [ + "units", + "relations" + ] + }, + "GoalStateResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/GoalState" + } + }, + "additionalProperties": false, + "required": [ + "result", + "error" + ] + }, + "GoalStateResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/GoalStateResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "GoalStateStatus": { + "type": "object", + "properties": { + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "since" + ] + }, + "GrantRevokeSecretArg": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "scope-tag": { + "type": "string" + }, + "subject-tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "scope-tag", + "subject-tags", + "role" + ] + }, + "GrantRevokeSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/GrantRevokeSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "HostPort": { + "type": "object", + "properties": { + "Address": { + "$ref": "#/definitions/Address" + }, + "cidr": { + "type": "string" + }, + "config-type": { + "type": "string" + }, + "is-secondary": { + "type": "boolean" + }, + "port": { + "type": "integer" + }, + "scope": { + "type": "string" + }, + "space-id": { + "type": "string" + }, + "space-name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "value", + "type", + "scope", + "Address", + "port" + ] + }, + "IntResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "IntResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/IntResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "InterfaceAddress": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "hostname": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "hostname", + "value", + "cidr" + ] + }, + "LifeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "life": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life" + ] + }, + "LifeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/LifeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListSecretResult": { + "type": "object", + "properties": { + "access": { + "type": "array", + "items": { + "$ref": "#/definitions/AccessInfo" + } + }, + "create-time": { + "type": "string", + "format": "date-time" + }, + "description": { + "type": "string" + }, + "label": { + "type": "string" + }, + "latest-expire-time": { + "type": "string", + "format": "date-time" + }, + "latest-revision": { + "type": "integer" + }, + "next-rotate-time": { + "type": "string", + "format": "date-time" + }, + "owner-tag": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRevision" + } + }, + "rotate-policy": { + "type": "string" + }, + "update-time": { + "type": "string", + "format": "date-time" + }, + "uri": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/SecretValueResult" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "version", + "owner-tag", + "latest-revision", + "create-time", + "update-time", + "revisions" + ] + }, + "ListSecretResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ListSecretResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "MergeLeadershipSettingsBulkParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/MergeLeadershipSettingsParam" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "MergeLeadershipSettingsParam": { + "type": "object", + "properties": { + "application-tag": { + "type": "string" + }, + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "settings" + ] + }, + "MeterStatusResult": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "info": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "info" + ] + }, + "MeterStatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MeterStatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Metric": { + "type": "object", + "properties": { + "key": { + "type": "string" + }, + "labels": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "time": { + "type": "string", + "format": "date-time" + }, + "value": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "key", + "value", + "time" + ] + }, + "MetricBatch": { + "type": "object", + "properties": { + "charm-url": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time" + }, + "metrics": { + "type": "array", + "items": { + "$ref": "#/definitions/Metric" + } + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "charm-url", + "created", + "metrics" + ] + }, + "MetricBatchParam": { + "type": "object", + "properties": { + "batch": { + "$ref": "#/definitions/MetricBatch" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "batch" + ] + }, + "MetricBatchParams": { + "type": "object", + "properties": { + "batches": { + "type": "array", + "items": { + "$ref": "#/definitions/MetricBatchParam" + } + } + }, + "additionalProperties": false, + "required": [ + "batches" + ] + }, + "ModelConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "ModelResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "uuid", + "type" + ] + }, + "NetworkInfo": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/InterfaceAddress" + } + }, + "interface-name": { + "type": "string" + }, + "mac-address": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "mac-address", + "interface-name", + "addresses" + ] + }, + "NetworkInfoParams": { + "type": "object", + "properties": { + "bindings": { + "type": "array", + "items": { + "type": "string" + } + }, + "relation-id": { + "type": "integer" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit", + "bindings" + ] + }, + "NetworkInfoResult": { + "type": "object", + "properties": { + "bind-addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/NetworkInfo" + } + }, + "egress-subnets": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "ingress-addresses": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "NetworkInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/NetworkInfoResult" + } + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "OpenPortRangesByEndpointResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "unit-port-ranges": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "$ref": "#/definitions/OpenUnitPortRangesByEndpoint" + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "unit-port-ranges" + ] + }, + "OpenPortRangesByEndpointResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/OpenPortRangesByEndpointResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "OpenUnitPortRangesByEndpoint": { + "type": "object", + "properties": { + "endpoint": { + "type": "string" + }, + "port-ranges": { + "type": "array", + "items": { + "$ref": "#/definitions/PortRange" + } + } + }, + "additionalProperties": false, + "required": [ + "endpoint", + "port-ranges" + ] + }, + "PodSpec": { + "type": "object", + "properties": { + "spec": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "PortRange": { + "type": "object", + "properties": { + "from-port": { + "type": "integer" + }, + "protocol": { + "type": "string" + }, + "to-port": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "from-port", + "to-port", + "protocol" + ] + }, + "RelationIds": { + "type": "object", + "properties": { + "relation-ids": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "relation-ids" + ] + }, + "RelationResult": { + "type": "object", + "properties": { + "bool": { + "type": "boolean" + }, + "endpoint": { + "$ref": "#/definitions/Endpoint" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "id": { + "type": "integer" + }, + "key": { + "type": "string" + }, + "life": { + "type": "string" + }, + "other-application": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "life", + "id", + "key", + "endpoint" + ] + }, + "RelationResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RelationStatusArg": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "relation-id": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit-tag", + "relation-id", + "status", + "message" + ] + }, + "RelationStatusArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationStatusArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "RelationUnit": { + "type": "object", + "properties": { + "relation": { + "type": "string" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation", + "unit" + ] + }, + "RelationUnitPair": { + "type": "object", + "properties": { + "local-unit": { + "type": "string" + }, + "relation": { + "type": "string" + }, + "remote-unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation", + "local-unit", + "remote-unit" + ] + }, + "RelationUnitPairs": { + "type": "object", + "properties": { + "relation-unit-pairs": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitPair" + } + } + }, + "additionalProperties": false, + "required": [ + "relation-unit-pairs" + ] + }, + "RelationUnitSettings": { + "type": "object", + "properties": { + "application-settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "relation": { + "type": "string" + }, + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "relation", + "unit", + "settings", + "application-settings" + ] + }, + "RelationUnitStatus": { + "type": "object", + "properties": { + "in-scope": { + "type": "boolean" + }, + "relation-tag": { + "type": "string" + }, + "suspended": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "relation-tag", + "in-scope", + "suspended" + ] + }, + "RelationUnitStatusResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitStatus" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RelationUnitStatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitStatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "RelationUnits": { + "type": "object", + "properties": { + "relation-units": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnit" + } + } + }, + "additionalProperties": false, + "required": [ + "relation-units" + ] + }, + "RelationUnitsChange": { + "type": "object", + "properties": { + "app-changed": { + "type": "object", + "patternProperties": { + ".*": { + "type": "integer" + } + } + }, + "changed": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/UnitSettings" + } + } + }, + "departed": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "changed" + ] + }, + "RelationUnitsWatchResult": { + "type": "object", + "properties": { + "changes": { + "$ref": "#/definitions/RelationUnitsChange" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "RelationUnitsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ResolvedModeResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "mode": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "mode" + ] + }, + "ResolvedModeResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ResolvedModeResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SecretBackendArgs": { + "type": "object", + "properties": { + "backend-ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "for-drain": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "for-drain", + "backend-ids" + ] + }, + "SecretBackendConfig": { + "type": "object", + "properties": { + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "SecretBackendConfigResult": { + "type": "object", + "properties": { + "config": { + "$ref": "#/definitions/SecretBackendConfig" + }, + "draining": { + "type": "boolean" + }, + "model-controller": { + "type": "string" + }, + "model-name": { + "type": "string" + }, + "model-uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-controller", + "model-uuid", + "model-name", + "draining" + ] + }, + "SecretBackendConfigResults": { + "type": "object", + "properties": { + "active-id": { + "type": "string" + }, + "results": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/SecretBackendConfigResult" + } + } + } + }, + "additionalProperties": false, + "required": [ + "active-id" + ] + }, + "SecretConsumerInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "label": { + "type": "string" + }, + "revision": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "revision", + "label" + ] + }, + "SecretConsumerInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretConsumerInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SecretContentParams": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "value-ref": { + "$ref": "#/definitions/SecretValueRef" + } + }, + "additionalProperties": false + }, + "SecretContentResult": { + "type": "object", + "properties": { + "backend-config": { + "$ref": "#/definitions/SecretBackendConfigResult" + }, + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "latest-revision": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "content" + ] + }, + "SecretContentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretContentResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SecretRevision": { + "type": "object", + "properties": { + "backend-name": { + "type": "string" + }, + "create-time": { + "type": "string", + "format": "date-time" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "revision": { + "type": "integer" + }, + "update-time": { + "type": "string", + "format": "date-time" + }, + "value-ref": { + "$ref": "#/definitions/SecretValueRef" + } + }, + "additionalProperties": false, + "required": [ + "revision" + ] + }, + "SecretRevisionArg": { + "type": "object", + "properties": { + "pending-delete": { + "type": "boolean" + }, + "revisions": { + "type": "array", + "items": { + "type": "integer" + } + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "revisions", + "pending-delete" + ] + }, + "SecretRotatedArg": { + "type": "object", + "properties": { + "original-revision": { + "type": "integer" + }, + "skip": { + "type": "boolean" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "original-revision", + "skip" + ] + }, + "SecretRotatedArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRotatedArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "SecretTriggerChange": { + "type": "object", + "properties": { + "next-trigger-time": { + "type": "string", + "format": "date-time" + }, + "revision": { + "type": "integer" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "next-trigger-time" + ] + }, + "SecretTriggerWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretTriggerChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "SecretValueRef": { + "type": "object", + "properties": { + "backend-id": { + "type": "string" + }, + "revision-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "backend-id", + "revision-id" + ] + }, + "SecretValueResult": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "SetUnitStateArg": { + "type": "object", + "properties": { + "charm-state": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "meter-status-state": { + "type": "string" + }, + "relation-state": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "secret-state": { + "type": "string" + }, + "storage-state": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "uniter-state": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "SetUnitStateArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SetUnitStateArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "SettingsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "settings": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "settings" + ] + }, + "SettingsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SettingsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StatusResult": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "id": { + "type": "string" + }, + "info": { + "type": "string" + }, + "life": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id", + "life", + "status", + "info", + "data", + "since" + ] + }, + "StatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StatusResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StorageAddParams": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "storage": { + "$ref": "#/definitions/StorageConstraints" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit", + "name", + "storage" + ] + }, + "StorageAttachment": { + "type": "object", + "properties": { + "kind": { + "type": "integer" + }, + "life": { + "type": "string" + }, + "location": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "storage-tag": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag", + "owner-tag", + "unit-tag", + "kind", + "location", + "life" + ] + }, + "StorageAttachmentId": { + "type": "object", + "properties": { + "storage-tag": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "storage-tag", + "unit-tag" + ] + }, + "StorageAttachmentIds": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAttachmentId" + } + } + }, + "additionalProperties": false, + "required": [ + "ids" + ] + }, + "StorageAttachmentIdsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/StorageAttachmentIds" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StorageAttachmentIdsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAttachmentIdsResult" + } + } + }, + "additionalProperties": false + }, + "StorageAttachmentResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/StorageAttachment" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StorageAttachmentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAttachmentResult" + } + } + }, + "additionalProperties": false + }, + "StorageConstraints": { + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "pool": { + "type": "string" + }, + "size": { + "type": "integer" + } + }, + "additionalProperties": false + }, + "StringBoolResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "ok": { + "type": "boolean" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result", + "ok" + ] + }, + "StringBoolResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringBoolResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + }, + "StringsWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UnitRefreshResult": { + "type": "object", + "properties": { + "Error": { + "$ref": "#/definitions/Error" + }, + "Life": { + "type": "string" + }, + "Resolved": { + "type": "string" + }, + "provider-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Life", + "Resolved", + "Error" + ] + }, + "UnitRefreshResults": { + "type": "object", + "properties": { + "Results": { + "type": "array", + "items": { + "$ref": "#/definitions/UnitRefreshResult" + } + } + }, + "additionalProperties": false, + "required": [ + "Results" + ] + }, + "UnitSettings": { + "type": "object", + "properties": { + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + }, + "UnitStateResult": { + "type": "object", + "properties": { + "charm-state": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "meter-status-state": { + "type": "string" + }, + "relation-state": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "secret-state": { + "type": "string" + }, + "storage-state": { + "type": "string" + }, + "uniter-state": { + "type": "string" + } + }, + "additionalProperties": false + }, + "UnitStateResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UnitStateResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UpdateSecretArg": { + "type": "object", + "properties": { + "UpsertSecretArg": { + "$ref": "#/definitions/UpsertSecretArg" + }, + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "description": { + "type": "string" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-policy": { + "type": "string" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "UpsertSecretArg", + "uri" + ] + }, + "UpdateSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UpgradeSeriesStatusParam": { + "type": "object", + "properties": { + "entity": { + "$ref": "#/definitions/Entity" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entity", + "status", + "message" + ] + }, + "UpgradeSeriesStatusParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/UpgradeSeriesStatusParam" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "UpgradeSeriesStatusResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "status": { + "type": "string" + }, + "target": { + "type": "string" + } + }, + "additionalProperties": false + }, + "UpgradeSeriesStatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UpgradeSeriesStatusResult" + } + } + }, + "additionalProperties": false + }, + "UpsertSecretArg": { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "description": { + "type": "string" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-policy": { + "type": "string" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "UpgradeSeries", + "Description": "API serves methods required by the machine agent upgrade-machine worker.", + "Version": 3, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "CurrentSeries": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "CurrentSeries returns what Juju thinks the current series of the machine is.\nNote that a machine could have been upgraded out-of-band by running\ndo-release-upgrade outside of the upgrade-machine workflow,\nmaking this value incorrect." + }, + "FinishUpgradeSeries": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateChannelArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "FinishUpgradeSeries is the last action in the upgrade workflow and is\ncalled after all machine and unit statuses are \"completed\".\nIt updates the machine series to reflect the completed upgrade, then\nremoves the upgrade-machine lock." + }, + "MachineStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UpgradeSeriesStatusResults" + } + }, + "description": "MachineStatus gets the current upgrade-machine status of a machine." + }, + "PinMachineApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/PinApplicationsResults" + } + }, + "description": "PinMachineApplications pins leadership for applications represented by units\nrunning on the auth'd machine." + }, + "PinnedLeadership": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/PinnedLeadershipResult" + } + }, + "description": "PinnedLeadership returns all pinned applications and the entities that\nrequire their pinned behaviour, for leadership in the current model." + }, + "SetInstanceStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetStatus" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetInstanceStatus sets the status of the machine." + }, + "SetMachineStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpgradeSeriesStatusParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetMachineStatus sets the current upgrade-machine status of a machine." + }, + "SetUpgradeSeriesUnitStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpgradeSeriesStatusParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit.\nIf no upgrade is in progress an error is returned instead." + }, + "StartUnitCompletion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpgradeSeriesStartUnitCompletionParam" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "StartUnitCompletion starts the upgrade series completion phase for all subordinate\nunits of a given machine." + }, + "TargetSeries": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "TargetSeries returns the series that a machine has been locked\nfor upgrading to." + }, + "UnitsCompleted": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/EntitiesResults" + } + }, + "description": "UnitsCompleted returns the units running on this machine that have completed\nthe upgrade-machine workflow and are in their normal running state." + }, + "UnitsPrepared": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/EntitiesResults" + } + }, + "description": "UnitsPrepared returns the units running on this machine that have completed\ntheir upgrade-machine preparation, and are ready to be stopped and have their\nunit agent services converted for the target series." + }, + "UnpinMachineApplications": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/PinApplicationsResults" + } + }, + "description": "UnpinMachineApplications unpins leadership for applications represented by\nunits running on the auth'd machine." + }, + "UpgradeSeriesUnitStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UpgradeSeriesStatusResults" + } + }, + "description": "UpgradeSeriesUnitStatus returns the current preparation status of an\nupgrading unit.\nIf no series upgrade is in progress an error is returned instead." + }, + "WatchUpgradeSeriesNotifications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + }, + "description": "WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesResult": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/EntitiesResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityStatusArgs": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "status", + "info", + "data" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "PinApplicationResult": { + "type": "object", + "properties": { + "application-name": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "application-name" + ] + }, + "PinApplicationsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/PinApplicationResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "PinnedLeadershipResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "additionalProperties": false + }, + "SetStatus": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityStatusArgs" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "StringResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UpdateChannelArg": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "tag": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force", + "channel" + ] + }, + "UpdateChannelArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateChannelArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UpgradeSeriesStartUnitCompletionParam": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entities", + "message" + ] + }, + "UpgradeSeriesStatusParam": { + "type": "object", + "properties": { + "entity": { + "$ref": "#/definitions/Entity" + }, + "message": { + "type": "string" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "entity", + "status", + "message" + ] + }, + "UpgradeSeriesStatusParams": { + "type": "object", + "properties": { + "params": { + "type": "array", + "items": { + "$ref": "#/definitions/UpgradeSeriesStatusParam" + } + } + }, + "additionalProperties": false, + "required": [ + "params" + ] + }, + "UpgradeSeriesStatusResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "status": { + "type": "string" + }, + "target": { + "type": "string" + } + }, + "additionalProperties": false + }, + "UpgradeSeriesStatusResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UpgradeSeriesStatusResult" + } + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "UpgradeSteps", + "Description": "UpgradeStepsAPI implements version 2 of the Upgrade Steps API,\nwhich adds WriteUniterState.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent" + ], + "Schema": { + "type": "object", + "properties": { + "ResetKVMMachineModificationStatusIdle": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "ResetKVMMachineModificationStatusIdle sets the modification status\nof a kvm machine to idle if it is in an error state before upgrade.\nRelated to lp:1829393." + }, + "WriteAgentState": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetUnitStateArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "WriteAgentState writes the agent state for the set of units provided. This\ncall presently deals with the state for the unit agent." + } + }, + "definitions": { + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetUnitStateArg": { + "type": "object", + "properties": { + "charm-state": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "meter-status-state": { + "type": "string" + }, + "relation-state": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "secret-state": { + "type": "string" + }, + "storage-state": { + "type": "string" + }, + "tag": { + "type": "string" + }, + "uniter-state": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "SetUnitStateArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SetUnitStateArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + } + } + } + }, + { + "Name": "Upgrader", + "Description": "", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "DesiredVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/VersionResults" + } + } + }, + "SetTools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntitiesVersion" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "Tools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ToolsResults" + } + } + }, + "WatchAPIVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/NotifyWatchResults" + } + } + } + }, + "definitions": { + "Binary": { + "type": "object", + "properties": { + "Arch": { + "type": "string" + }, + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Number": { + "$ref": "#/definitions/Number" + }, + "Patch": { + "type": "integer" + }, + "Release": { + "type": "string" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build", + "Number", + "Release", + "Arch" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "EntitiesVersion": { + "type": "object", + "properties": { + "agent-tools": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityVersion" + } + } + }, + "additionalProperties": false, + "required": [ + "agent-tools" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityVersion": { + "type": "object", + "properties": { + "tag": { + "type": "string" + }, + "tools": { + "$ref": "#/definitions/Version" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "tools" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "NotifyWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/NotifyWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "Tools": { + "type": "object", + "properties": { + "sha256": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "version": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false, + "required": [ + "version", + "url", + "size" + ] + }, + "ToolsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "tools": { + "type": "array", + "items": { + "$ref": "#/definitions/Tools" + } + } + }, + "additionalProperties": false, + "required": [ + "tools" + ] + }, + "ToolsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ToolsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "Version": { + "type": "object", + "properties": { + "version": { + "$ref": "#/definitions/Binary" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + }, + "VersionResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false + }, + "VersionResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VersionResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "UserManager", + "Description": "UserManagerAPI implements the user manager interface and is the concrete\nimplementation of the api end point.", + "Version": 3, + "AvailableTo": [ + "controller-user" + ], + "Schema": { + "type": "object", + "properties": { + "AddUser": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddUsers" + }, + "Result": { + "$ref": "#/definitions/AddUserResults" + } + }, + "description": "AddUser adds a user with a username, and either a password or\na randomly generated secret key which will be returned." + }, + "DisableUser": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "DisableUser disables one or more users. If the user is already disabled,\nthe action is considered a success." + }, + "EnableUser": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "EnableUser enables one or more users. If the user is already enabled,\nthe action is considered a success." + }, + "ModelUserInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ModelUserInfoResults" + } + }, + "description": "ModelUserInfo returns information on all users in the model." + }, + "RemoveUser": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RemoveUser permanently removes a user from the current controller for each\nentity provided. While the user is permanently removed we keep it's\ninformation around for auditing purposes.\nTODO(redir): Add information about getting deleted user information when we\nadd that capability." + }, + "ResetPassword": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/AddUserResults" + } + }, + "description": "ResetPassword resets password for supplied users by\ninvalidating current passwords (if any) and generating\nnew random secret keys which will be returned.\nUsers cannot reset their own password." + }, + "SetPassword": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntityPasswords" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetPassword changes the stored password for the specified users." + }, + "UserInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UserInfoRequest" + }, + "Result": { + "$ref": "#/definitions/UserInfoResults" + } + }, + "description": "UserInfo returns information on a user." + } + }, + "definitions": { + "AddUser": { + "type": "object", + "properties": { + "display-name": { + "type": "string" + }, + "password": { + "type": "string" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "username", + "display-name" + ] + }, + "AddUserResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "secret-key": { + "type": "array", + "items": { + "type": "integer" + } + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false + }, + "AddUserResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/AddUserResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "AddUsers": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/AddUser" + } + } + }, + "additionalProperties": false, + "required": [ + "users" + ] + }, + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "EntityPassword": { + "type": "object", + "properties": { + "password": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "password" + ] + }, + "EntityPasswords": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPassword" + } + } + }, + "additionalProperties": false, + "required": [ + "changes" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ModelUserInfo": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "display-name": { + "type": "string" + }, + "last-connection": { + "type": "string", + "format": "date-time" + }, + "model-tag": { + "type": "string" + }, + "user": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "user", + "display-name", + "last-connection", + "access" + ] + }, + "ModelUserInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ModelUserInfo" + } + }, + "additionalProperties": false + }, + "ModelUserInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelUserInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "UserInfo": { + "type": "object", + "properties": { + "access": { + "type": "string" + }, + "created-by": { + "type": "string" + }, + "date-created": { + "type": "string", + "format": "date-time" + }, + "disabled": { + "type": "boolean" + }, + "display-name": { + "type": "string" + }, + "last-connection": { + "type": "string", + "format": "date-time" + }, + "username": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "username", + "display-name", + "access", + "created-by", + "date-created", + "disabled" + ] + }, + "UserInfoRequest": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + }, + "include-disabled": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "entities", + "include-disabled" + ] + }, + "UserInfoResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/UserInfo" + } + }, + "additionalProperties": false + }, + "UserInfoResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UserInfoResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "UserSecretsDrain", + "Description": "SecretsDrainAPI is the implementation for the SecretsDrain facade.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "ChangeSecretBackend": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ChangeSecretBackendArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ChangeSecretBackend updates the backend for the specified secret after migration done." + }, + "GetSecretBackendConfigs": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SecretBackendArgs" + }, + "Result": { + "$ref": "#/definitions/SecretBackendConfigResults" + } + }, + "description": "GetSecretBackendConfigs gets the config needed to create a client to secret backends for the drain worker." + }, + "GetSecretContentInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GetSecretContentArgs" + }, + "Result": { + "$ref": "#/definitions/SecretContentResults" + } + }, + "description": "GetSecretContentInfo returns the secret values for the specified secrets." + }, + "GetSecretRevisionContentInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SecretRevisionArg" + }, + "Result": { + "$ref": "#/definitions/SecretContentResults" + } + }, + "description": "GetSecretRevisionContentInfo returns the secret values for the specified secret revisions." + }, + "GetSecretsToDrain": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ListSecretResults" + } + }, + "description": "GetSecretsToDrain returns metadata for the secrets that need to be drained." + }, + "WatchSecretBackendChanged": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/NotifyWatchResult" + } + }, + "description": "WatchSecretBackendChanged sets up a watcher to notify of changes to the secret backend." + } + }, + "definitions": { + "AccessInfo": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "scope-tag": { + "type": "string" + }, + "target-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "target-tag", + "scope-tag", + "role" + ] + }, + "ChangeSecretBackendArg": { + "type": "object", + "properties": { + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "revision": { + "type": "integer" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "revision" + ] + }, + "ChangeSecretBackendArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/ChangeSecretBackendArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "GetSecretContentArg": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "peek": { + "type": "boolean" + }, + "refresh": { + "type": "boolean" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri" + ] + }, + "GetSecretContentArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/GetSecretContentArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "ListSecretResult": { + "type": "object", + "properties": { + "access": { + "type": "array", + "items": { + "$ref": "#/definitions/AccessInfo" + } + }, + "create-time": { + "type": "string", + "format": "date-time" + }, + "description": { + "type": "string" + }, + "label": { + "type": "string" + }, + "latest-expire-time": { + "type": "string", + "format": "date-time" + }, + "latest-revision": { + "type": "integer" + }, + "next-rotate-time": { + "type": "string", + "format": "date-time" + }, + "owner-tag": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRevision" + } + }, + "rotate-policy": { + "type": "string" + }, + "update-time": { + "type": "string", + "format": "date-time" + }, + "uri": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/SecretValueResult" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "version", + "owner-tag", + "latest-revision", + "create-time", + "update-time", + "revisions" + ] + }, + "ListSecretResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ListSecretResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "NotifyWatchResult": { + "type": "object", + "properties": { + "NotifyWatcherId": { + "type": "string" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "NotifyWatcherId" + ] + }, + "SecretBackendArgs": { + "type": "object", + "properties": { + "backend-ids": { + "type": "array", + "items": { + "type": "string" + } + }, + "for-drain": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "for-drain", + "backend-ids" + ] + }, + "SecretBackendConfig": { + "type": "object", + "properties": { + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "SecretBackendConfigResult": { + "type": "object", + "properties": { + "config": { + "$ref": "#/definitions/SecretBackendConfig" + }, + "draining": { + "type": "boolean" + }, + "model-controller": { + "type": "string" + }, + "model-name": { + "type": "string" + }, + "model-uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-controller", + "model-uuid", + "model-name", + "draining" + ] + }, + "SecretBackendConfigResults": { + "type": "object", + "properties": { + "active-id": { + "type": "string" + }, + "results": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/SecretBackendConfigResult" + } + } + } + }, + "additionalProperties": false, + "required": [ + "active-id" + ] + }, + "SecretContentParams": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "value-ref": { + "$ref": "#/definitions/SecretValueRef" + } + }, + "additionalProperties": false + }, + "SecretContentResult": { + "type": "object", + "properties": { + "backend-config": { + "$ref": "#/definitions/SecretBackendConfigResult" + }, + "content": { + "$ref": "#/definitions/SecretContentParams" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "latest-revision": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "content" + ] + }, + "SecretContentResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretContentResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SecretRevision": { + "type": "object", + "properties": { + "backend-name": { + "type": "string" + }, + "create-time": { + "type": "string", + "format": "date-time" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "revision": { + "type": "integer" + }, + "update-time": { + "type": "string", + "format": "date-time" + }, + "value-ref": { + "$ref": "#/definitions/SecretValueRef" + } + }, + "additionalProperties": false, + "required": [ + "revision" + ] + }, + "SecretRevisionArg": { + "type": "object", + "properties": { + "pending-delete": { + "type": "boolean" + }, + "revisions": { + "type": "array", + "items": { + "type": "integer" + } + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "revisions", + "pending-delete" + ] + }, + "SecretValueRef": { + "type": "object", + "properties": { + "backend-id": { + "type": "string" + }, + "revision-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "backend-id", + "revision-id" + ] + }, + "SecretValueResult": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "UserSecretsManager", + "Description": "UserSecretsManager is the implementation for the usersecrets facade.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "DeleteRevisions": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DeleteSecretArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "DeleteRevisions deletes the specified revisions of the specified secret." + }, + "WatchRevisionsToPrune": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsWatchResult" + } + }, + "description": "WatchRevisionsToPrune returns a watcher for notifying when:\n - a secret revision owned by the model no longer\n has any consumers and should be pruned." + } + }, + "definitions": { + "DeleteSecretArg": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "type": "integer" + } + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "label" + ] + }, + "DeleteSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/DeleteSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ErrorResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "ErrorResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ErrorResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "StringsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "type": "string" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id" + ] + } + } + } + }, + { + "Name": "VolumeAttachmentPlansWatcher", + "Description": "srvMachineStorageIdsWatcher defines the API wrapping a state.StringsWatcher\nwatching machine/storage attachments. This watcher notifies about storage\nentities (volumes/filesystems) being attached to and detached from machines.\n\nTODO(axw) state needs a new watcher, this is a bt of a hack. State watchers\ncould do with some deduplication of logic, and I don't want to add to that\nspaghetti right now.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MachineStorageIdsWatchResult" + } + }, + "description": "Next returns when a change has occurred to an entity of the\ncollection being watched since the most recent call to Next\nor the Watch call that created the srvMachineStorageIdsWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "MachineStorageId": { + "type": "object", + "properties": { + "attachment-tag": { + "type": "string" + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "attachment-tag" + ] + }, + "MachineStorageIdsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineStorageId" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "VolumeAttachmentsWatcher", + "Description": "srvMachineStorageIdsWatcher defines the API wrapping a state.StringsWatcher\nwatching machine/storage attachments. This watcher notifies about storage\nentities (volumes/filesystems) being attached to and detached from machines.\n\nTODO(axw) state needs a new watcher, this is a bt of a hack. State watchers\ncould do with some deduplication of logic, and I don't want to add to that\nspaghetti right now.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/MachineStorageIdsWatchResult" + } + }, + "description": "Next returns when a change has occurred to an entity of the\ncollection being watched since the most recent call to Next\nor the Watch call that created the srvMachineStorageIdsWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "MachineStorageId": { + "type": "object", + "properties": { + "attachment-tag": { + "type": "string" + }, + "machine-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "machine-tag", + "attachment-tag" + ] + }, + "MachineStorageIdsWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/MachineStorageId" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + } +] \ No newline at end of file From 2abd42fe82bbf689369f6f8831d419959f058703 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Fri, 30 Aug 2024 17:33:40 +0900 Subject: [PATCH 03/29] simplify --- juju/client/connection.py | 6 ++++++ juju/jasyncio.py | 2 +- juju/utils.py | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/juju/client/connection.py b/juju/client/connection.py index 45ee6d95..8186a8ec 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -570,6 +570,9 @@ async def _receiver(self): break if result is not None: result = json.loads(result) + with open("/tmp/ws-log.jsonl", "a") as f: + # Top-level key "response": means incoming message + f.write(json.dumps(result) + "\n") await self.messages.put(result['request-id'], result) except jasyncio.CancelledError: log.debug('Receiver: Cancelled') @@ -647,6 +650,9 @@ async def rpc(self, msg, encoder=None): 'websocket closed')) try: await self._ws.send(outgoing) + with open("/tmp/ws-log.jsonl", "a") as f: + # Top-level key "request": means outgoing message + f.write(json.dumps(msg, cls=encoder) + "\n") break except websockets.ConnectionClosed: if attempt == 2: diff --git a/juju/jasyncio.py b/juju/jasyncio.py index d45f8dbd..40eda4f1 100644 --- a/juju/jasyncio.py +++ b/juju/jasyncio.py @@ -17,7 +17,7 @@ ROOT_LOGGER = logging.getLogger() -from asyncio import Event, TimeoutError, Queue, ensure_future, \ +from asyncio import Event, TimeoutError, ensure_future, \ gather, sleep, wait_for, create_subprocess_exec, subprocess, \ wait, FIRST_COMPLETED, Lock, as_completed, new_event_loop, \ get_event_loop_policy, CancelledError, get_running_loop, \ diff --git a/juju/utils.py b/juju/utils.py index c4f4780a..94615601 100644 --- a/juju/utils.py +++ b/juju/utils.py @@ -1,6 +1,7 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +import asyncio import os import textwrap from collections import defaultdict @@ -100,8 +101,8 @@ class IdQueue: Wrapper around asyncio.Queue that maintains a separate queue for each ID. """ - def __init__(self, maxsize=0): - self._queues = defaultdict(partial(jasyncio.Queue, maxsize)) + def __init__(self): + self._queues = defaultdict(asyncio.Queue) async def get(self, id): value = await self._queues[id].get() From cc07d5eada72556095af7fe284e36a03cf10862c Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Fri, 30 Aug 2024 17:38:14 +0900 Subject: [PATCH 04/29] note queue bugs --- juju/utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/juju/utils.py b/juju/utils.py index 94615601..f71d5291 100644 --- a/juju/utils.py +++ b/juju/utils.py @@ -103,6 +103,15 @@ class IdQueue: def __init__(self): self._queues = defaultdict(asyncio.Queue) + # FIXME cleanup needed. + # in some cases an Exception is put into the queue. + # if the main coro exits, this exception will be logged as "never awaited" + # we gotta do something about that to keep the output clean. + # + # Additionally, it's conceivable that a response is put in the queue + # and then an exception is put via put_all() + # the reader only ever fetches one item, and exception is "never awaited" + # rewrite put_all to replace the pending response instead. async def get(self, id): value = await self._queues[id].get() From 7fb530645128cdb39e5e011e443f667d9254fe6a Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Mon, 2 Sep 2024 17:29:52 +0900 Subject: [PATCH 05/29] number connections for debug --- juju/client/connection.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/juju/client/connection.py b/juju/client/connection.py index 8186a8ec..30df0c05 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -2,6 +2,7 @@ # Licensed under the Apache V2, see LICENCE file for details. import base64 +import itertools import json import logging import ssl @@ -240,6 +241,7 @@ class Connection: MAX_FRAME_SIZE = 2**22 "Maximum size for a single frame. Defaults to 4MB." + _count = itertools.count() @classmethod async def connect( @@ -305,6 +307,7 @@ async def connect( self.usertag = tag.user(username) self.password = password + self.name = f"{cls.__name__}-{next(cls._count)}" self.__request_id__ = 0 # The following instance variables are initialized by the @@ -572,7 +575,7 @@ async def _receiver(self): result = json.loads(result) with open("/tmp/ws-log.jsonl", "a") as f: # Top-level key "response": means incoming message - f.write(json.dumps(result) + "\n") + f.write(json.dumps({**result, "_connection": self.name}) + "\n") await self.messages.put(result['request-id'], result) except jasyncio.CancelledError: log.debug('Receiver: Cancelled') @@ -652,7 +655,7 @@ async def rpc(self, msg, encoder=None): await self._ws.send(outgoing) with open("/tmp/ws-log.jsonl", "a") as f: # Top-level key "request": means outgoing message - f.write(json.dumps(msg, cls=encoder) + "\n") + f.write(json.dumps({**msg, "_connection": self.name}, cls=encoder) + "\n") break except websockets.ConnectionClosed: if attempt == 2: From 1dfdbbd4dab465b2451f849c68f9568025a25a69 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Tue, 3 Sep 2024 14:47:33 +0900 Subject: [PATCH 06/29] wip codegen --- Makefile | 4 +- juju/client/_client1.py | 6557 +++++++++++++++++++++++++++++++++++-- juju/client/_client10.py | 649 ++++ juju/client/_client11.py | 1790 +++++++++- juju/client/_client17.py | 818 ++++- juju/client/_client18.py | 4921 +++++++++++++++++++++++----- juju/client/_client19.py | 4846 ++++++++++++++++++++++----- juju/client/_client2.py | 3374 +++++++++++++++++-- juju/client/_client20.py | 939 +++++- juju/client/_client3.py | 2523 +++++++++++++- juju/client/_client4.py | 1877 ++++++++++- juju/client/_client5.py | 593 +++- juju/client/_client6.py | 931 +++++- juju/client/_client7.py | 2038 ++++++++++-- juju/client/_client9.py | 349 ++ juju/client/codegen.py | 22 +- juju/client/connection.py | 4 +- juju/client/facade.py | 83 +- 18 files changed, 29674 insertions(+), 2644 deletions(-) diff --git a/Makefile b/Makefile index 81b1cbb3..a6c46854 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,9 @@ clean: .PHONY: client client: - tox -r --notest -e lint,py3 + # FIXME temporarily commented out + # tox -r --notest -e lint,py3 + # why abuse tox venv this way? $(PY) -m juju.client.facade -s "juju/client/schemas*" -o juju/client/ .PHONY: run-unit-tests diff --git a/juju/client/_client1.py b/juju/client/_client1.py index a4887fe4..6ef3da19 100644 --- a/juju/client/_client1.py +++ b/juju/client/_client1.py @@ -70,6 +70,27 @@ class ActionPrunerFacade(Type): 'type': 'object'} + @ReturnMapping(ModelConfigResult) + def sync_ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ActionPruner', + request='ModelConfig', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelConfigResult) async def ModelConfig(self): ''' @@ -91,6 +112,36 @@ async def ModelConfig(self): + @ReturnMapping(None) + def sync_Prune(self, max_history_mb=None, max_history_time=None): + ''' + Prune endpoint removes action entries until + only the ones newer than now - p.MaxHistoryTime remain and + the history is smaller than p.MaxHistoryMB. + + max_history_mb : int + max_history_time : int + Returns -> None + ''' + if max_history_mb is not None and not isinstance(max_history_mb, int): + raise Exception("Expected max_history_mb to be a int, received: {}".format(type(max_history_mb))) + + if max_history_time is not None and not isinstance(max_history_time, int): + raise Exception("Expected max_history_time to be a int, received: {}".format(type(max_history_time))) + + # 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 = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Prune(self, max_history_mb=None, max_history_time=None): ''' @@ -121,6 +172,31 @@ async def Prune(self, max_history_mb=None, max_history_time=None): + @ReturnMapping(NotifyWatchResult) + def sync_WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ActionPruner', + request='WatchForModelConfigChanges', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchForModelConfigChanges(self): ''' @@ -199,6 +275,29 @@ class AgentLifeFlagFacade(Type): 'type': 'object'} + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='AgentLifeFlag', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' @@ -222,6 +321,29 @@ async def Life(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='AgentLifeFlag', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def Watch(self, entities=None): ''' @@ -259,6 +381,28 @@ class AgentToolsFacade(Type): 'type': 'object'} + @ReturnMapping(None) + def sync_UpdateToolsAvailable(self): + ''' + UpdateToolsAvailable invokes a lookup and further update in environ + for new patches of the current tool versions. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='AgentTools', + request='UpdateToolsAvailable', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def UpdateToolsAvailable(self): ''' @@ -331,6 +475,30 @@ class ApplicationScalerFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_Rescale(self, entities=None): + ''' + Rescale causes any supplied services to be scaled up to their + minimum size. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationScaler', + request='Rescale', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Rescale(self, entities=None): ''' @@ -355,6 +523,28 @@ async def Rescale(self, entities=None): + @ReturnMapping(StringsWatchResult) + def sync_Watch(self): + ''' + Watch returns a watcher that sends the names of services whose + unit count may be below their configured minimum. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationScaler', + request='Watch', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def Watch(self): ''' @@ -434,6 +624,29 @@ class CAASAdmissionFacade(Type): 'type': 'object'} + @ReturnMapping(ControllerAPIInfoResults) + def sync_ControllerAPIInfoForModels(self, entities=None): + ''' + ControllerAPIInfoForModels returns the controller api connection details for the specified models. + + entities : typing.Sequence[~Entity] + Returns -> ControllerAPIInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASAdmission', + request='ControllerAPIInfoForModels', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ControllerAPIInfoResults) async def ControllerAPIInfoForModels(self, entities=None): ''' @@ -457,6 +670,27 @@ async def ControllerAPIInfoForModels(self, entities=None): + @ReturnMapping(ControllerConfigResult) + def sync_ControllerConfig(self): + ''' + ControllerConfig returns the controller's configuration. + + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASAdmission', + request='ControllerConfig', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ControllerConfigResult) async def ControllerConfig(self): ''' @@ -537,6 +771,34 @@ class CAASApplicationFacade(Type): 'type': 'object'} + @ReturnMapping(CAASUnitIntroductionResult) + def sync_UnitIntroduction(self, pod_name=None, pod_uuid=None): + ''' + UnitIntroduction sets the status of each given entity. + + pod_name : str + pod_uuid : str + Returns -> CAASUnitIntroductionResult + ''' + if pod_name is not None and not isinstance(pod_name, (bytes, str)): + raise Exception("Expected pod_name to be a str, received: {}".format(type(pod_name))) + + if pod_uuid is not None and not isinstance(pod_uuid, (bytes, str)): + raise Exception("Expected pod_uuid to be a str, received: {}".format(type(pod_uuid))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplication', + request='UnitIntroduction', + version=1, + params=_params) + _params['pod-name'] = pod_name + _params['pod-uuid'] = pod_uuid + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CAASUnitIntroductionResult) async def UnitIntroduction(self, pod_name=None, pod_uuid=None): ''' @@ -566,7 +828,7 @@ async def UnitIntroduction(self, pod_name=None, pod_uuid=None): @ReturnMapping(CAASUnitTerminationResult) - async def UnitTerminating(self, tag=None): + def sync_UnitTerminating(self, tag=None): ''' UnitTerminating should be called by the CAASUnitTerminationWorker when the agent receives a signal to exit. UnitTerminating will return how @@ -585,25 +847,50 @@ async def UnitTerminating(self, tag=None): version=1, params=_params) _params['tag'] = tag - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply -class CAASApplicationProvisionerFacade(Type): - name = 'CAASApplicationProvisioner' - version = 1 - schema = {'definitions': {'ApplicationUnitInfo': {'additionalProperties': False, - 'properties': {'provider-id': {'type': 'string'}, - 'unit-tag': {'type': 'string'}}, - 'required': ['provider-id', - 'unit-tag'], - 'type': 'object'}, - 'ApplicationUnitParams': {'additionalProperties': False, - 'properties': {'address': {'type': 'string'}, - 'data': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, + @ReturnMapping(CAASUnitTerminationResult) + async def UnitTerminating(self, tag=None): + ''' + UnitTerminating should be called by the CAASUnitTerminationWorker when + the agent receives a signal to exit. UnitTerminating will return how + the agent should shutdown. + + tag : str + Returns -> CAASUnitTerminationResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplication', + request='UnitTerminating', + version=1, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + +class CAASApplicationProvisionerFacade(Type): + name = 'CAASApplicationProvisioner' + version = 1 + schema = {'definitions': {'ApplicationUnitInfo': {'additionalProperties': False, + 'properties': {'provider-id': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['provider-id', + 'unit-tag'], + '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'}, @@ -1368,6 +1655,29 @@ class CAASApplicationProvisionerFacade(Type): 'type': 'object'} + @ReturnMapping(Charm) + def sync_ApplicationCharmInfo(self, tag=None): + ''' + ApplicationCharmInfo returns information about an application's charm. + + tag : str + Returns -> Charm + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='ApplicationCharmInfo', + version=1, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(Charm) async def ApplicationCharmInfo(self, tag=None): ''' @@ -1391,6 +1701,29 @@ async def ApplicationCharmInfo(self, tag=None): + @ReturnMapping(CAASApplicationOCIResourceResults) + def sync_ApplicationOCIResources(self, entities=None): + ''' + ApplicationOCIResources returns the OCI image resources for an application. + + entities : typing.Sequence[~Entity] + Returns -> CAASApplicationOCIResourceResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='ApplicationOCIResources', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CAASApplicationOCIResourceResults) async def ApplicationOCIResources(self, entities=None): ''' @@ -1414,6 +1747,29 @@ async def ApplicationOCIResources(self, entities=None): + @ReturnMapping(Charm) + def sync_CharmInfo(self, url=None): + ''' + CharmInfo returns information about the requested charm. + + url : str + Returns -> Charm + ''' + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='CharmInfo', + version=1, + params=_params) + _params['url'] = url + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(Charm) async def CharmInfo(self, url=None): ''' @@ -1437,6 +1793,30 @@ async def CharmInfo(self, url=None): + @ReturnMapping(ErrorResults) + def sync_ClearApplicationsResources(self, entities=None): + ''' + ClearApplicationsResources clears the flags which indicate + applications still have resources in the cluster. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='ClearApplicationsResources', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ClearApplicationsResources(self, entities=None): ''' @@ -1461,6 +1841,30 @@ async def ClearApplicationsResources(self, entities=None): + @ReturnMapping(DestroyUnitResults) + def sync_DestroyUnits(self, units=None): + ''' + DestroyUnits is responsible for scaling down a set of units on the this + Application. + + units : typing.Sequence[~DestroyUnitParams] + Returns -> DestroyUnitResults + ''' + if units is not None and not isinstance(units, (bytes, str, list)): + raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='DestroyUnits', + version=1, + params=_params) + _params['units'] = units + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(DestroyUnitResults) async def DestroyUnits(self, units=None): ''' @@ -1485,6 +1889,29 @@ async def DestroyUnits(self, units=None): + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' @@ -1508,6 +1935,27 @@ async def Life(self, entities=None): + @ReturnMapping(CAASApplicationProvisionerConfigResult) + def sync_ProvisionerConfig(self): + ''' + ProvisionerConfig returns the provisioner's configuration. + + + Returns -> CAASApplicationProvisionerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='ProvisionerConfig', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CAASApplicationProvisionerConfigResult) async def ProvisionerConfig(self): ''' @@ -1529,6 +1977,29 @@ async def ProvisionerConfig(self): + @ReturnMapping(CAASApplicationProvisioningInfoResults) + def sync_ProvisioningInfo(self, entities=None): + ''' + ProvisioningInfo returns the info needed to provision a caas application. + + entities : typing.Sequence[~Entity] + Returns -> CAASApplicationProvisioningInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='ProvisioningInfo', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CAASApplicationProvisioningInfoResults) async def ProvisioningInfo(self, entities=None): ''' @@ -1552,6 +2023,29 @@ async def ProvisioningInfo(self, entities=None): + @ReturnMapping(CAASApplicationProvisioningStateResult) + def sync_ProvisioningState(self, tag=None): + ''' + ProvisioningState returns the provisioning state for the application. + + tag : str + Returns -> CAASApplicationProvisioningStateResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='ProvisioningState', + version=1, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CAASApplicationProvisioningStateResult) async def ProvisioningState(self, tag=None): ''' @@ -1576,7 +2070,7 @@ async def ProvisioningState(self, tag=None): @ReturnMapping(ErrorResults) - async def Remove(self, entities=None): + def sync_Remove(self, entities=None): ''' Remove removes every given entity from state, calling EnsureDead first, then Remove. It will fail if the entity is not present. @@ -1594,17 +2088,18 @@ async def Remove(self, entities=None): version=1, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetOperatorStatus(self, entities=None): + async def Remove(self, entities=None): ''' - SetOperatorStatus sets the status of each given entity. + Remove removes every given entity from state, calling EnsureDead + first, then Remove. It will fail if the entity is not present. - entities : typing.Sequence[~EntityStatusArgs] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): @@ -1613,7 +2108,7 @@ async def SetOperatorStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='CAASApplicationProvisioner', - request='SetOperatorStatus', + request='Remove', version=1, params=_params) _params['entities'] = entities @@ -1623,31 +2118,128 @@ async def SetOperatorStatus(self, entities=None): @ReturnMapping(ErrorResults) - async def SetPasswords(self, changes=None): + def sync_SetOperatorStatus(self, entities=None): ''' - SetPasswords sets the given password for each supplied entity, if possible. + SetOperatorStatus sets the status of each given entity. - changes : typing.Sequence[~EntityPassword] + entities : typing.Sequence[~EntityStatusArgs] Returns -> ErrorResults ''' - if changes is not None and not isinstance(changes, (bytes, str, list)): - raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='CAASApplicationProvisioner', - request='SetPasswords', + request='SetOperatorStatus', version=1, params=_params) - _params['changes'] = changes - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResult) - async def SetProvisioningState(self, application=None, provisioning_state=None): - ''' + @ReturnMapping(ErrorResults) + async def SetOperatorStatus(self, entities=None): + ''' + SetOperatorStatus sets the status of each given entity. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='SetOperatorStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetPasswords(self, changes=None): + ''' + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='SetPasswords', + version=1, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): + ''' + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='SetPasswords', + version=1, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + def sync_SetProvisioningState(self, application=None, provisioning_state=None): + ''' + SetProvisioningState sets the provisioning state for the application. + + application : Entity + provisioning_state : CAASApplicationProvisioningState + Returns -> ErrorResult + ''' + if application is not None and not isinstance(application, (dict, Entity)): + raise Exception("Expected application to be a Entity, received: {}".format(type(application))) + + if provisioning_state is not None and not isinstance(provisioning_state, (dict, CAASApplicationProvisioningState)): + raise Exception("Expected provisioning_state to be a CAASApplicationProvisioningState, received: {}".format(type(provisioning_state))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='SetProvisioningState', + version=1, + params=_params) + _params['application'] = application + _params['provisioning-state'] = provisioning_state + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + async def SetProvisioningState(self, application=None, provisioning_state=None): + ''' SetProvisioningState sets the provisioning state for the application. application : Entity @@ -1673,6 +2265,29 @@ async def SetProvisioningState(self, application=None, provisioning_state=None): + @ReturnMapping(CAASUnitsResults) + def sync_Units(self, entities=None): + ''' + Units returns all the units for each application specified. + + entities : typing.Sequence[~Entity] + Returns -> CAASUnitsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='Units', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CAASUnitsResults) async def Units(self, entities=None): ''' @@ -1696,6 +2311,30 @@ async def Units(self, entities=None): + @ReturnMapping(UpdateApplicationUnitResults) + def sync_UpdateApplicationsUnits(self, args=None): + ''' + UpdateApplicationsUnits updates the Juju data model to reflect the given + units of the specified application. + + args : typing.Sequence[~UpdateApplicationUnits] + Returns -> UpdateApplicationUnitResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='UpdateApplicationsUnits', + version=1, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UpdateApplicationUnitResults) async def UpdateApplicationsUnits(self, args=None): ''' @@ -1720,6 +2359,29 @@ async def UpdateApplicationsUnits(self, args=None): + @ReturnMapping(NotifyWatchResults) + def sync_Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def Watch(self, entities=None): ''' @@ -1743,6 +2405,28 @@ async def Watch(self, entities=None): + @ReturnMapping(StringsWatchResult) + def sync_WatchApplications(self): + ''' + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='WatchApplications', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchApplications(self): ''' @@ -1765,6 +2449,31 @@ async def WatchApplications(self): + @ReturnMapping(NotifyWatchResults) + def sync_WatchProvisioningInfo(self, entities=None): + ''' + WatchProvisioningInfo provides a watcher for changes that affect the + information returned by ProvisioningInfo. This is useful for ensuring the + latest application stated is ensured. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='WatchProvisioningInfo', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchProvisioningInfo(self, entities=None): ''' @@ -1790,6 +2499,31 @@ async def WatchProvisioningInfo(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchUnits(self, entities=None): + ''' + WatchUnits starts a StringsWatcher to watch changes to the + lifecycle states of units for the specified applications in + this model. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASApplicationProvisioner', + request='WatchUnits', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchUnits(self, entities=None): ''' @@ -2126,6 +2860,29 @@ class CAASFirewallerFacade(Type): 'type': 'object'} + @ReturnMapping(Charm) + def sync_ApplicationCharmInfo(self, tag=None): + ''' + ApplicationCharmInfo returns information about an application's charm. + + tag : str + Returns -> Charm + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewaller', + request='ApplicationCharmInfo', + version=1, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(Charm) async def ApplicationCharmInfo(self, tag=None): ''' @@ -2150,7 +2907,7 @@ async def ApplicationCharmInfo(self, tag=None): @ReturnMapping(ApplicationGetConfigResults) - async def ApplicationsConfig(self, entities=None): + def sync_ApplicationsConfig(self, entities=None): ''' ApplicationsConfig returns the config for the specified applications. @@ -2167,17 +2924,63 @@ async def ApplicationsConfig(self, entities=None): version=1, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(Charm) - async def CharmInfo(self, url=None): + @ReturnMapping(ApplicationGetConfigResults) + async def ApplicationsConfig(self, entities=None): ''' - CharmInfo returns information about the requested charm. + ApplicationsConfig returns the config for the specified applications. - url : str + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # 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(Charm) + def sync_CharmInfo(self, url=None): + ''' + CharmInfo returns information about the requested charm. + + url : str + Returns -> Charm + ''' + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewaller', + request='CharmInfo', + version=1, + params=_params) + _params['url'] = url + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(Charm) + async def CharmInfo(self, url=None): + ''' + CharmInfo returns information about the requested charm. + + url : str Returns -> Charm ''' if url is not None and not isinstance(url, (bytes, str)): @@ -2195,6 +2998,29 @@ async def CharmInfo(self, url=None): + @ReturnMapping(BoolResults) + def sync_IsExposed(self, entities=None): + ''' + IsExposed returns whether the specified applications are exposed. + + entities : typing.Sequence[~Entity] + Returns -> BoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewaller', + request='IsExposed', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(BoolResults) async def IsExposed(self, entities=None): ''' @@ -2218,6 +3044,29 @@ async def IsExposed(self, entities=None): + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewaller', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' @@ -2241,6 +3090,29 @@ async def Life(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewaller', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def Watch(self, entities=None): ''' @@ -2264,6 +3136,28 @@ async def Watch(self, entities=None): + @ReturnMapping(StringsWatchResult) + def sync_WatchApplications(self): + ''' + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewaller', + request='WatchApplications', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchApplications(self): ''' @@ -2639,6 +3533,29 @@ class CAASFirewallerSidecarFacade(Type): 'type': 'object'} + @ReturnMapping(Charm) + def sync_ApplicationCharmInfo(self, tag=None): + ''' + ApplicationCharmInfo returns information about an application's charm. + + tag : str + Returns -> Charm + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewallerSidecar', + request='ApplicationCharmInfo', + version=1, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(Charm) async def ApplicationCharmInfo(self, tag=None): ''' @@ -2662,6 +3579,29 @@ async def ApplicationCharmInfo(self, tag=None): + @ReturnMapping(ApplicationGetConfigResults) + def sync_ApplicationsConfig(self, entities=None): + ''' + ApplicationsConfig returns the config for the specified applications. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewallerSidecar', + request='ApplicationsConfig', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetConfigResults) async def ApplicationsConfig(self, entities=None): ''' @@ -2685,6 +3625,29 @@ async def ApplicationsConfig(self, entities=None): + @ReturnMapping(Charm) + def sync_CharmInfo(self, url=None): + ''' + CharmInfo returns information about the requested charm. + + url : str + Returns -> Charm + ''' + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewallerSidecar', + request='CharmInfo', + version=1, + params=_params) + _params['url'] = url + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(Charm) async def CharmInfo(self, url=None): ''' @@ -2708,6 +3671,29 @@ async def CharmInfo(self, url=None): + @ReturnMapping(ApplicationOpenedPortsResults) + def sync_GetOpenedPorts(self, tag=None): + ''' + GetOpenedPorts returns all the opened ports for each given application tag. + + tag : str + Returns -> ApplicationOpenedPortsResults + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewallerSidecar', + request='GetOpenedPorts', + version=1, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationOpenedPortsResults) async def GetOpenedPorts(self, tag=None): ''' @@ -2732,7 +3718,7 @@ async def GetOpenedPorts(self, tag=None): @ReturnMapping(BoolResults) - async def IsExposed(self, entities=None): + def sync_IsExposed(self, entities=None): ''' IsExposed returns whether the specified applications are exposed. @@ -2749,18 +3735,18 @@ async def IsExposed(self, entities=None): version=1, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(LifeResults) - async def Life(self, entities=None): + @ReturnMapping(BoolResults) + async def IsExposed(self, entities=None): ''' - Life returns the life status of every supplied entity, where available. + IsExposed returns whether the specified applications are exposed. entities : typing.Sequence[~Entity] - Returns -> LifeResults + Returns -> BoolResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -2768,7 +3754,7 @@ async def Life(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='CAASFirewallerSidecar', - request='Life', + request='IsExposed', version=1, params=_params) _params['entities'] = entities @@ -2777,13 +3763,13 @@ async def Life(self, entities=None): - @ReturnMapping(NotifyWatchResults) - async def Watch(self, entities=None): + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): ''' - Watch starts an NotifyWatcher for each given entity. + Life returns the life status of every supplied entity, where available. entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + Returns -> LifeResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -2791,42 +3777,157 @@ async def Watch(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='CAASFirewallerSidecar', - request='Watch', + request='Life', version=1, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringsWatchResult) - async def WatchApplications(self): + @ReturnMapping(LifeResults) + async def Life(self, entities=None): ''' - WatchApplications starts a StringsWatcher to watch applications - deployed to this model. - + Life returns the life status of every supplied entity, where available. - Returns -> StringsWatchResult + entities : typing.Sequence[~Entity] + Returns -> LifeResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='CAASFirewallerSidecar', - request='WatchApplications', + request='Life', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResults) - async def WatchOpenedPorts(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_Watch(self, entities=None): ''' - WatchOpenedPorts returns a new StringsWatcher for each given - model tag. + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewallerSidecar', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewallerSidecar', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + def sync_WatchApplications(self): + ''' + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewallerSidecar', + request='WatchApplications', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchApplications(self): + ''' + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewallerSidecar', + request='WatchApplications', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + def sync_WatchOpenedPorts(self, entities=None): + ''' + WatchOpenedPorts returns a new StringsWatcher for each given + model tag. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewallerSidecar', + request='WatchOpenedPorts', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchOpenedPorts(self, entities=None): + ''' + WatchOpenedPorts returns a new StringsWatcher for each given + model tag. entities : typing.Sequence[~Entity] Returns -> StringsWatchResults @@ -2875,6 +3976,25 @@ class CAASModelConfigManagerFacade(Type): 'type': 'object'} + @ReturnMapping(ControllerConfigResult) + def sync_ControllerConfig(self): + ''' + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelConfigManager', + request='ControllerConfig', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ControllerConfigResult) async def ControllerConfig(self): ''' @@ -2894,6 +4014,25 @@ async def ControllerConfig(self): + @ReturnMapping(NotifyWatchResult) + def sync_WatchControllerConfig(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelConfigManager', + request='WatchControllerConfig', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchControllerConfig(self): ''' @@ -3085,6 +4224,27 @@ class CAASModelOperatorFacade(Type): 'type': 'object'} + @ReturnMapping(StringsResult) + def sync_APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='APIAddresses', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsResult) async def APIAddresses(self): ''' @@ -3106,6 +4266,27 @@ async def APIAddresses(self): + @ReturnMapping(APIHostPortsResult) + def sync_APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='APIHostPorts', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(APIHostPortsResult) async def APIHostPorts(self): ''' @@ -3127,6 +4308,28 @@ async def APIHostPorts(self): + @ReturnMapping(ModelOperatorInfo) + def sync_ModelOperatorProvisioningInfo(self): + ''' + ModelOperatorProvisioningInfo returns the information needed for provisioning + a new model operator into a caas cluster. + + + Returns -> ModelOperatorInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='ModelOperatorProvisioningInfo', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelOperatorInfo) async def ModelOperatorProvisioningInfo(self): ''' @@ -3149,6 +4352,30 @@ async def ModelOperatorProvisioningInfo(self): + @ReturnMapping(StringResult) + def sync_ModelUUID(self): + ''' + ModelUUID returns the model UUID that this facade is used to operate. + It is implemented here directly as a result of removing it from + embedded APIAddresser *without* bumping the facade version. + It should be blanked when this facade version is next incremented. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='ModelUUID', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResult) async def ModelUUID(self): ''' @@ -3173,6 +4400,29 @@ async def ModelUUID(self): + @ReturnMapping(ErrorResults) + def sync_SetPasswords(self, changes=None): + ''' + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='SetPasswords', + version=1, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetPasswords(self, changes=None): ''' @@ -3197,7 +4447,7 @@ async def SetPasswords(self, changes=None): @ReturnMapping(NotifyWatchResult) - async def WatchAPIHostPorts(self): + def sync_WatchAPIHostPorts(self): ''' WatchAPIHostPorts watches the API server addresses. @@ -3212,16 +4462,15 @@ async def WatchAPIHostPorts(self): version=1, params=_params) - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(NotifyWatchResult) - async def WatchModelOperatorProvisioningInfo(self): + async def WatchAPIHostPorts(self): ''' - WatchModelOperatorProvisioningInfo provides a watcher for changes that affect the - information returned by ModelOperatorProvisioningInfo. + WatchAPIHostPorts watches the API server addresses. Returns -> NotifyWatchResult @@ -3230,7 +4479,7 @@ async def WatchModelOperatorProvisioningInfo(self): # map input types to rpc msg _params = dict() msg = dict(type='CAASModelOperator', - request='WatchModelOperatorProvisioningInfo', + request='WatchAPIHostPorts', version=1, params=_params) @@ -3239,7 +4488,51 @@ async def WatchModelOperatorProvisioningInfo(self): -class CAASOperatorFacade(Type): + @ReturnMapping(NotifyWatchResult) + def sync_WatchModelOperatorProvisioningInfo(self): + ''' + WatchModelOperatorProvisioningInfo provides a watcher for changes that affect the + information returned by ModelOperatorProvisioningInfo. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='WatchModelOperatorProvisioningInfo', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchModelOperatorProvisioningInfo(self): + ''' + WatchModelOperatorProvisioningInfo provides a watcher for changes that affect the + information returned by ModelOperatorProvisioningInfo. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='WatchModelOperatorProvisioningInfo', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CAASOperatorFacade(Type): name = 'CAASOperator' version = 1 schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, @@ -3542,6 +4835,27 @@ class CAASOperatorFacade(Type): 'type': 'object'} + @ReturnMapping(StringsResult) + def sync_APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='APIAddresses', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsResult) async def APIAddresses(self): ''' @@ -3563,6 +4877,27 @@ async def APIAddresses(self): + @ReturnMapping(APIHostPortsResult) + def sync_APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='APIHostPorts', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(APIHostPortsResult) async def APIHostPorts(self): ''' @@ -3584,6 +4919,29 @@ async def APIHostPorts(self): + @ReturnMapping(ApplicationCharmResults) + def sync_Charm(self, entities=None): + ''' + Charm returns the charm info for all given applications. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationCharmResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='Charm', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationCharmResults) async def Charm(self, entities=None): ''' @@ -3607,6 +4965,27 @@ async def Charm(self, entities=None): + @ReturnMapping(ModelResult) + def sync_CurrentModel(self): + ''' + CurrentModel returns the name and UUID for the current juju model. + + + Returns -> ModelResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='CurrentModel', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelResult) async def CurrentModel(self): ''' @@ -3628,6 +5007,29 @@ async def CurrentModel(self): + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' @@ -3651,6 +5053,30 @@ async def Life(self, entities=None): + @ReturnMapping(StringResult) + def sync_ModelUUID(self): + ''' + ModelUUID returns the model UUID that this facade is used to operate. + It is implemented here directly as a result of removing it from + embedded APIAddresser *without* bumping the facade version. + It should be blanked when this facade version is next incremented. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='ModelUUID', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResult) async def ModelUUID(self): ''' @@ -3675,6 +5101,30 @@ async def ModelUUID(self): + @ReturnMapping(ErrorResults) + def sync_Remove(self, entities=None): + ''' + Remove removes every given entity from state, calling EnsureDead + first, then Remove. It will fail if the entity is not present. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='Remove', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Remove(self, entities=None): ''' @@ -3699,6 +5149,30 @@ async def Remove(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetPodSpec(self, specs=None): + ''' + SetPodSpec sets the container specs for a set of applications. + TODO(juju3) - remove + + specs : typing.Sequence[~EntityString] + Returns -> ErrorResults + ''' + if specs is not None and not isinstance(specs, (bytes, str, list)): + raise Exception("Expected specs to be a Sequence, received: {}".format(type(specs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='SetPodSpec', + version=1, + params=_params) + _params['specs'] = specs + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetPodSpec(self, specs=None): ''' @@ -3723,6 +5197,29 @@ async def SetPodSpec(self, specs=None): + @ReturnMapping(ErrorResults) + def sync_SetStatus(self, entities=None): + ''' + SetStatus sets the status of each given entity. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='SetStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetStatus(self, entities=None): ''' @@ -3746,6 +5243,29 @@ async def SetStatus(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetTools(self, agent_tools=None): + ''' + SetTools updates the recorded tools version for the agents. + + agent_tools : typing.Sequence[~EntityVersion] + Returns -> ErrorResults + ''' + if agent_tools is not None and not isinstance(agent_tools, (bytes, str, list)): + raise Exception("Expected agent_tools to be a Sequence, received: {}".format(type(agent_tools))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='SetTools', + version=1, + params=_params) + _params['agent-tools'] = agent_tools + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetTools(self, agent_tools=None): ''' @@ -3770,7 +5290,7 @@ async def SetTools(self, agent_tools=None): @ReturnMapping(NotifyWatchResults) - async def Watch(self, entities=None): + def sync_Watch(self, entities=None): ''' Watch starts an NotifyWatcher for each given entity. @@ -3787,13 +5307,57 @@ async def Watch(self, entities=None): version=1, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def WatchAPIHostPorts(self): + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # 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) + def sync_WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='WatchAPIHostPorts', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): ''' WatchAPIHostPorts watches the API server addresses. @@ -3813,6 +5377,30 @@ async def WatchAPIHostPorts(self): + @ReturnMapping(StringsWatchResults) + def sync_WatchContainerStart(self, args=None): + ''' + WatchContainerStart starts a StringWatcher to watch for container start events + on the CAAS api for a specific application and container. + + args : typing.Sequence[~WatchContainerStartArg] + Returns -> StringsWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='WatchContainerStart', + version=1, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchContainerStart(self, args=None): ''' @@ -3837,6 +5425,31 @@ async def WatchContainerStart(self, args=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchUnits(self, entities=None): + ''' + WatchUnits starts a StringsWatcher to watch changes to the + lifecycle states of units for the specified applications in + this model. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperator', + request='WatchUnits', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchUnits(self, entities=None): ''' @@ -4318,6 +5931,27 @@ class CAASOperatorProvisionerFacade(Type): 'type': 'object'} + @ReturnMapping(StringsResult) + def sync_APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='APIAddresses', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsResult) async def APIAddresses(self): ''' @@ -4339,6 +5973,27 @@ async def APIAddresses(self): + @ReturnMapping(APIHostPortsResult) + def sync_APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='APIHostPorts', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(APIHostPortsResult) async def APIHostPorts(self): ''' @@ -4360,6 +6015,29 @@ async def APIHostPorts(self): + @ReturnMapping(Charm) + def sync_ApplicationCharmInfo(self, tag=None): + ''' + ApplicationCharmInfo returns information about an application's charm. + + tag : str + Returns -> Charm + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='ApplicationCharmInfo', + version=1, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(Charm) async def ApplicationCharmInfo(self, tag=None): ''' @@ -4383,6 +6061,29 @@ async def ApplicationCharmInfo(self, tag=None): + @ReturnMapping(Charm) + def sync_CharmInfo(self, url=None): + ''' + CharmInfo returns information about the requested charm. + + url : str + Returns -> Charm + ''' + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='CharmInfo', + version=1, + params=_params) + _params['url'] = url + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(Charm) async def CharmInfo(self, url=None): ''' @@ -4406,6 +6107,29 @@ async def CharmInfo(self, url=None): + @ReturnMapping(IssueOperatorCertificateResults) + def sync_IssueOperatorCertificate(self, entities=None): + ''' + IssueOperatorCertificate issues an x509 certificate for use by the specified application operator. + + entities : typing.Sequence[~Entity] + Returns -> IssueOperatorCertificateResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='IssueOperatorCertificate', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(IssueOperatorCertificateResults) async def IssueOperatorCertificate(self, entities=None): ''' @@ -4429,6 +6153,29 @@ async def IssueOperatorCertificate(self, entities=None): + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' @@ -4452,6 +6199,30 @@ async def Life(self, entities=None): + @ReturnMapping(StringResult) + def sync_ModelUUID(self): + ''' + ModelUUID returns the model UUID that this facade is used to operate. + It is implemented here directly as a result of removing it from + embedded APIAddresser *without* bumping the facade version. + It should be blanked when this facade version is next incremented. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='ModelUUID', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResult) async def ModelUUID(self): ''' @@ -4476,6 +6247,29 @@ async def ModelUUID(self): + @ReturnMapping(OperatorProvisioningInfoResults) + def sync_OperatorProvisioningInfo(self, entities=None): + ''' + OperatorProvisioningInfo returns the info needed to provision an operator. + + entities : typing.Sequence[~Entity] + Returns -> OperatorProvisioningInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='OperatorProvisioningInfo', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(OperatorProvisioningInfoResults) async def OperatorProvisioningInfo(self, entities=None): ''' @@ -4500,7 +6294,7 @@ async def OperatorProvisioningInfo(self, entities=None): @ReturnMapping(ErrorResults) - async def SetPasswords(self, changes=None): + def sync_SetPasswords(self, changes=None): ''' SetPasswords sets the given password for each supplied entity, if possible. @@ -4517,13 +6311,57 @@ async def SetPasswords(self, changes=None): version=1, params=_params) _params['changes'] = changes - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def WatchAPIHostPorts(self): + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): + ''' + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # 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) + def sync_WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='WatchAPIHostPorts', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): ''' WatchAPIHostPorts watches the API server addresses. @@ -4543,6 +6381,28 @@ async def WatchAPIHostPorts(self): + @ReturnMapping(StringsWatchResult) + def sync_WatchApplications(self): + ''' + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorProvisioner', + request='WatchApplications', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchApplications(self): ''' @@ -4605,6 +6465,34 @@ class CAASOperatorUpgraderFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResult) + def sync_UpgradeOperator(self, agent_tag=None, version=None): + ''' + UpgradeOperator upgrades the operator for the specified agents. + + agent_tag : str + version : Number + Returns -> ErrorResult + ''' + if agent_tag is not None and not isinstance(agent_tag, (bytes, str)): + raise Exception("Expected agent_tag to be a str, received: {}".format(type(agent_tag))) + + if version is not None and not isinstance(version, (dict, Number)): + raise Exception("Expected version to be a Number, received: {}".format(type(version))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASOperatorUpgrader', + request='UpgradeOperator', + version=1, + params=_params) + _params['agent-tag'] = agent_tag + _params['version'] = version + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResult) async def UpgradeOperator(self, agent_tag=None, version=None): ''' @@ -4708,6 +6596,31 @@ class CharmDownloaderFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_DownloadApplicationCharms(self, entities=None): + ''' + DownloadApplicationCharms iterates the list of provided applications and + downloads any referenced charms that have not yet been persisted to the + blob store. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CharmDownloader', + request='DownloadApplicationCharms', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def DownloadApplicationCharms(self, entities=None): ''' @@ -4733,6 +6646,29 @@ async def DownloadApplicationCharms(self, entities=None): + @ReturnMapping(StringsWatchResult) + def sync_WatchApplicationsWithPendingCharms(self): + ''' + WatchApplicationsWithPendingCharms registers and returns a watcher instance + that reports the ID of applications that reference a charm which has not yet + been downloaded. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CharmDownloader', + request='WatchApplicationsWithPendingCharms', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchApplicationsWithPendingCharms(self): ''' @@ -4784,6 +6720,29 @@ class CredentialManagerFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResult) + def sync_InvalidateModelCredential(self, reason=None): + ''' + InvalidateModelCredential marks the cloud credential for this model as invalid. + + reason : str + Returns -> ErrorResult + ''' + if reason is not None and not isinstance(reason, (bytes, str)): + raise Exception("Expected reason to be a str, received: {}".format(type(reason))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CredentialManager', + request='InvalidateModelCredential', + version=1, + params=_params) + _params['reason'] = reason + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResult) async def InvalidateModelCredential(self, reason=None): ''' @@ -4857,6 +6816,27 @@ class CrossControllerFacade(Type): 'type': 'object'} + @ReturnMapping(ControllerAPIInfoResults) + def sync_ControllerInfo(self): + ''' + ControllerInfo returns the API info for the controller. + + + Returns -> ControllerAPIInfoResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossController', + request='ControllerInfo', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ControllerAPIInfoResults) async def ControllerInfo(self): ''' @@ -4878,6 +6858,28 @@ async def ControllerInfo(self): + @ReturnMapping(NotifyWatchResults) + def sync_WatchControllerInfo(self): + ''' + WatchControllerInfo creates a watcher that notifies when the API info + for the controller changes. + + + Returns -> NotifyWatchResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossController', + request='WatchControllerInfo', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchControllerInfo(self): ''' @@ -5015,6 +7017,29 @@ class CrossModelSecretsFacade(Type): 'type': 'object'} + @ReturnMapping(StringResults) + def sync_GetSecretAccessScope(self, relations=None): + ''' + GetSecretAccessScope returns the tokens for the access scope of the specified secrets and consumers. + + relations : typing.Sequence[~GetRemoteSecretAccessArg] + Returns -> StringResults + ''' + if relations is not None and not isinstance(relations, (bytes, str, list)): + raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelSecrets', + request='GetSecretAccessScope', + version=1, + params=_params) + _params['relations'] = relations + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def GetSecretAccessScope(self, relations=None): ''' @@ -5038,6 +7063,29 @@ async def GetSecretAccessScope(self, relations=None): + @ReturnMapping(SecretContentResults) + def sync_GetSecretContentInfo(self, relations=None): + ''' + GetSecretContentInfo returns the secret values for the specified secrets. + + relations : typing.Sequence[~GetRemoteSecretContentArg] + Returns -> SecretContentResults + ''' + if relations is not None and not isinstance(relations, (bytes, str, list)): + raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelSecrets', + request='GetSecretContentInfo', + version=1, + params=_params) + _params['relations'] = relations + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretContentResults) async def GetSecretContentInfo(self, relations=None): ''' @@ -5260,7 +7308,7 @@ class DeployerFacade(Type): @ReturnMapping(StringsResult) - async def APIAddresses(self): + def sync_APIAddresses(self): ''' APIAddresses returns the list of addresses used to connect to the API. @@ -5275,24 +7323,24 @@ async def APIAddresses(self): version=1, params=_params) - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(APIHostPortsResult) - async def APIHostPorts(self): + @ReturnMapping(StringsResult) + async def APIAddresses(self): ''' - APIHostPorts returns the API server addresses. + APIAddresses returns the list of addresses used to connect to the API. - Returns -> APIHostPortsResult + Returns -> StringsResult ''' # map input types to rpc msg _params = dict() msg = dict(type='Deployer', - request='APIHostPorts', + request='APIAddresses', version=1, params=_params) @@ -5301,14 +7349,78 @@ async def APIHostPorts(self): - @ReturnMapping(DeployerConnectionValues) - async def ConnectionInfo(self): + @ReturnMapping(APIHostPortsResult) + def sync_APIHostPorts(self): ''' - ConnectionInfo returns all the address information that the - deployer task needs in one call. + APIHostPorts returns the API server addresses. - Returns -> DeployerConnectionValues + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='APIHostPorts', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # 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) + def sync_ConnectionInfo(self): + ''' + ConnectionInfo returns all the address information that the + deployer task needs in one call. + + + Returns -> DeployerConnectionValues + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='ConnectionInfo', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(DeployerConnectionValues) + async def ConnectionInfo(self): + ''' + ConnectionInfo returns all the address information that the + deployer task needs in one call. + + + Returns -> DeployerConnectionValues ''' # map input types to rpc msg @@ -5323,6 +7435,29 @@ async def ConnectionInfo(self): + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' @@ -5346,6 +7481,30 @@ async def Life(self, entities=None): + @ReturnMapping(StringResult) + def sync_ModelUUID(self): + ''' + ModelUUID returns the model UUID that this facade is deploying into. + It is implemented here directly as a result of removing it from + embedded APIAddresser *without* bumping the facade version. + It should be blanked when this facade version is next incremented. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='ModelUUID', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResult) async def ModelUUID(self): ''' @@ -5370,6 +7529,30 @@ async def ModelUUID(self): + @ReturnMapping(ErrorResults) + def sync_Remove(self, entities=None): + ''' + Remove removes every given entity from state, calling EnsureDead + first, then Remove. It will fail if the entity is not present. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='Remove', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Remove(self, entities=None): ''' @@ -5394,6 +7577,29 @@ async def Remove(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetPasswords(self, changes=None): + ''' + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='SetPasswords', + version=1, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetPasswords(self, changes=None): ''' @@ -5417,6 +7623,29 @@ async def SetPasswords(self, changes=None): + @ReturnMapping(ErrorResults) + def sync_SetStatus(self, entities=None): + ''' + SetStatus sets the status of the specified entities. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='SetStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetStatus(self, entities=None): ''' @@ -5440,6 +7669,27 @@ async def SetStatus(self, entities=None): + @ReturnMapping(NotifyWatchResult) + def sync_WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='WatchAPIHostPorts', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchAPIHostPorts(self): ''' @@ -5461,6 +7711,30 @@ async def WatchAPIHostPorts(self): + @ReturnMapping(StringsWatchResults) + def sync_WatchUnits(self, entities=None): + ''' + WatchUnits starts a StringsWatcher to watch all units belonging to + to any entity (machine or service) passed in args. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Deployer', + request='WatchUnits', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchUnits(self, entities=None): ''' @@ -5625,7 +7899,7 @@ class EnvironUpgraderFacade(Type): @ReturnMapping(IntResults) - async def ModelEnvironVersion(self, entities=None): + def sync_ModelEnvironVersion(self, entities=None): ''' ModelEnvironVersion returns the current version of the environ corresponding to each specified model. @@ -5643,17 +7917,16 @@ async def ModelEnvironVersion(self, entities=None): version=1, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(IntResults) - async def ModelTargetEnvironVersion(self, entities=None): + async def ModelEnvironVersion(self, entities=None): ''' - ModelTargetEnvironVersion returns the target version of the environ - corresponding to each specified model. The target version is the - environ provider's version. + ModelEnvironVersion returns the current version of the environ corresponding + to each specified model. entities : typing.Sequence[~Entity] Returns -> IntResults @@ -5664,7 +7937,7 @@ async def ModelTargetEnvironVersion(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='EnvironUpgrader', - request='ModelTargetEnvironVersion', + request='ModelEnvironVersion', version=1, params=_params) _params['entities'] = entities @@ -5673,37 +7946,40 @@ async def ModelTargetEnvironVersion(self, entities=None): - @ReturnMapping(ErrorResults) - async def SetModelEnvironVersion(self, models=None): + @ReturnMapping(IntResults) + def sync_ModelTargetEnvironVersion(self, entities=None): ''' - SetModelEnvironVersion sets the current version of the environ corresponding - to each specified model. + ModelTargetEnvironVersion returns the target version of the environ + corresponding to each specified model. The target version is the + environ provider's version. - models : typing.Sequence[~SetModelEnvironVersion] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> IntResults ''' - if models is not None and not isinstance(models, (bytes, str, list)): - raise Exception("Expected models to be a Sequence, received: {}".format(type(models))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='EnvironUpgrader', - request='SetModelEnvironVersion', + request='ModelTargetEnvironVersion', version=1, params=_params) - _params['models'] = models - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetModelStatus(self, entities=None): + @ReturnMapping(IntResults) + async def ModelTargetEnvironVersion(self, entities=None): ''' - SetModelStatus sets the status of each given model. + ModelTargetEnvironVersion returns the target version of the environ + corresponding to each specified model. The target version is the + environ provider's version. - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> IntResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5711,7 +7987,7 @@ async def SetModelStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='EnvironUpgrader', - request='SetModelStatus', + request='ModelTargetEnvironVersion', version=1, params=_params) _params['entities'] = entities @@ -5720,6 +7996,127 @@ async def SetModelStatus(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetModelEnvironVersion(self, models=None): + ''' + SetModelEnvironVersion sets the current version of the environ corresponding + to each specified model. + + models : typing.Sequence[~SetModelEnvironVersion] + Returns -> ErrorResults + ''' + if models is not None and not isinstance(models, (bytes, str, list)): + raise Exception("Expected models to be a Sequence, received: {}".format(type(models))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='EnvironUpgrader', + request='SetModelEnvironVersion', + version=1, + params=_params) + _params['models'] = models + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModelEnvironVersion(self, models=None): + ''' + SetModelEnvironVersion sets the current version of the environ corresponding + to each specified model. + + models : typing.Sequence[~SetModelEnvironVersion] + Returns -> ErrorResults + ''' + if models is not None and not isinstance(models, (bytes, str, list)): + raise Exception("Expected models to be a Sequence, received: {}".format(type(models))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='EnvironUpgrader', + request='SetModelEnvironVersion', + version=1, + params=_params) + _params['models'] = models + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetModelStatus(self, entities=None): + ''' + SetModelStatus sets the status of each given model. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='EnvironUpgrader', + request='SetModelStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModelStatus(self, entities=None): + ''' + SetModelStatus sets the status of each given model. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='EnvironUpgrader', + request='SetModelStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + def sync_WatchModelEnvironVersion(self, entities=None): + ''' + WatchModelEnvironVersion watches for changes to the environ version of the + specified models. + + NOTE(axw) this is currently implemented in terms of state.Model.Watch, so + the client may be notified of changes unrelated to the environ version. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='EnvironUpgrader', + request='WatchModelEnvironVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchModelEnvironVersion(self, entities=None): ''' @@ -5850,6 +8247,29 @@ class ExternalControllerUpdaterFacade(Type): 'type': 'object'} + @ReturnMapping(ExternalControllerInfoResults) + def sync_ExternalControllerInfo(self, entities=None): + ''' + ExternalControllerInfo returns the info for the specified external controllers. + + entities : typing.Sequence[~Entity] + Returns -> ExternalControllerInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ExternalControllerUpdater', + request='ExternalControllerInfo', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ExternalControllerInfoResults) async def ExternalControllerInfo(self, entities=None): ''' @@ -5873,6 +8293,29 @@ async def ExternalControllerInfo(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetExternalControllerInfo(self, controllers=None): + ''' + SetExternalControllerInfo saves the info for the specified external controllers. + + controllers : typing.Sequence[~SetExternalControllerInfoParams] + Returns -> ErrorResults + ''' + if controllers is not None and not isinstance(controllers, (bytes, str, list)): + raise Exception("Expected controllers to be a Sequence, received: {}".format(type(controllers))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ExternalControllerUpdater', + request='SetExternalControllerInfo', + version=1, + params=_params) + _params['controllers'] = controllers + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetExternalControllerInfo(self, controllers=None): ''' @@ -5896,6 +8339,28 @@ async def SetExternalControllerInfo(self, controllers=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchExternalControllers(self): + ''' + WatchExternalControllers watches for the addition and removal of external + controller records to the local controller's database. + + + Returns -> StringsWatchResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ExternalControllerUpdater', + request='WatchExternalControllers', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchExternalControllers(self): ''' @@ -5970,6 +8435,27 @@ class FanConfigurerFacade(Type): 'type': 'object'} + @ReturnMapping(FanConfigResult) + def sync_FanConfig(self): + ''' + FanConfig returns current FAN configuration. + + + Returns -> FanConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='FanConfigurer', + request='FanConfig', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(FanConfigResult) async def FanConfig(self): ''' @@ -5991,6 +8477,30 @@ async def FanConfig(self): + @ReturnMapping(NotifyWatchResult) + def sync_WatchForFanConfigChanges(self): + ''' + WatchForFanConfigChanges returns a NotifyWatcher that observes + changes to the FAN configuration. + so we use the regular error return. + TODO(wpk) 2017-09-21 We should use Model directly, and watch only for FanConfig changes. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='FanConfigurer', + request='WatchForFanConfigChanges', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchForFanConfigChanges(self): ''' @@ -6064,6 +8574,27 @@ class FirewallRulesFacade(Type): 'type': 'object'} + @ReturnMapping(ListFirewallRulesResults) + def sync_ListFirewallRules(self): + ''' + ListFirewallRules returns all the firewall rules. + + + Returns -> ListFirewallRulesResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='FirewallRules', + request='ListFirewallRules', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ListFirewallRulesResults) async def ListFirewallRules(self): ''' @@ -6086,7 +8617,7 @@ async def ListFirewallRules(self): @ReturnMapping(ErrorResults) - async def SetFirewallRules(self, args=None): + def sync_SetFirewallRules(self, args=None): ''' SetFirewallRules creates or updates the specified firewall rules. @@ -6103,28 +8634,51 @@ async def SetFirewallRules(self, args=None): version=1, params=_params) _params['args'] = args - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply -class HostKeyReporterFacade(Type): - name = 'HostKeyReporter' - version = 1 - schema = {'definitions': {'Error': {'additionalProperties': False, - 'properties': {'code': {'type': 'string'}, - 'info': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'message': {'type': 'string'}}, - 'required': ['message', 'code'], - 'type': 'object'}, - 'ErrorResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}}, - 'type': 'object'}, - 'ErrorResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, - 'type': 'array'}}, + @ReturnMapping(ErrorResults) + async def SetFirewallRules(self, args=None): + ''' + SetFirewallRules creates or updates the specified firewall rules. + + args : typing.Sequence[~FirewallRule] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # 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': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + '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'}, 'SSHHostKeySet': {'additionalProperties': False, @@ -6146,6 +8700,29 @@ class HostKeyReporterFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_ReportKeys(self, entity_keys=None): + ''' + ReportKeys sets the SSH host keys for one or more entities. + + entity_keys : typing.Sequence[~SSHHostKeys] + Returns -> ErrorResults + ''' + if entity_keys is not None and not isinstance(entity_keys, (bytes, str, list)): + raise Exception("Expected entity_keys to be a Sequence, received: {}".format(type(entity_keys))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='HostKeyReporter', + request='ReportKeys', + version=1, + params=_params) + _params['entity-keys'] = entity_keys + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ReportKeys(self, entity_keys=None): ''' @@ -6257,6 +8834,30 @@ class ImageMetadataManagerFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_Delete(self, image_ids=None): + ''' + Delete deletes cloud image metadata for given image ids. + It supports bulk calls. + + image_ids : typing.Sequence[str] + Returns -> ErrorResults + ''' + if image_ids is not None and not isinstance(image_ids, (bytes, str, list)): + raise Exception("Expected image_ids to be a Sequence, received: {}".format(type(image_ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ImageMetadataManager', + request='Delete', + version=1, + params=_params) + _params['image-ids'] = image_ids + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Delete(self, image_ids=None): ''' @@ -6281,6 +8882,56 @@ async def Delete(self, image_ids=None): + @ReturnMapping(ListCloudImageMetadataResult) + def sync_List(self, arches=None, region=None, root_storage_type=None, stream=None, versions=None, virt_type=None): + ''' + List returns all found cloud image metadata that satisfy + given filter. + Returned list contains metadata ordered by priority. + + arches : typing.Sequence[str] + region : str + root_storage_type : str + stream : str + versions : typing.Sequence[str] + virt_type : str + Returns -> ListCloudImageMetadataResult + ''' + if arches is not None and not isinstance(arches, (bytes, str, list)): + raise Exception("Expected arches to be a Sequence, received: {}".format(type(arches))) + + if region is not None and not isinstance(region, (bytes, str)): + raise Exception("Expected region to be a str, received: {}".format(type(region))) + + if root_storage_type is not None and not isinstance(root_storage_type, (bytes, str)): + raise Exception("Expected root_storage_type to be a str, received: {}".format(type(root_storage_type))) + + if stream is not None and not isinstance(stream, (bytes, str)): + raise Exception("Expected stream to be a str, received: {}".format(type(stream))) + + if versions is not None and not isinstance(versions, (bytes, str, list)): + raise Exception("Expected versions to be a Sequence, received: {}".format(type(versions))) + + if virt_type is not None and not isinstance(virt_type, (bytes, str)): + raise Exception("Expected virt_type to be a str, received: {}".format(type(virt_type))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ImageMetadataManager', + request='List', + version=1, + params=_params) + _params['arches'] = arches + _params['region'] = region + _params['root-storage-type'] = root_storage_type + _params['stream'] = stream + _params['versions'] = versions + _params['virt-type'] = virt_type + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ListCloudImageMetadataResult) async def List(self, arches=None, region=None, root_storage_type=None, stream=None, versions=None, virt_type=None): ''' @@ -6331,6 +8982,30 @@ async def List(self, arches=None, region=None, root_storage_type=None, stream=No + @ReturnMapping(ErrorResults) + def sync_Save(self, metadata=None): + ''' + Save stores given cloud image metadata. + It supports bulk calls. + + metadata : typing.Sequence[~CloudImageMetadataList] + Returns -> ErrorResults + ''' + if metadata is not None and not isinstance(metadata, (bytes, str, list)): + raise Exception("Expected metadata to be a Sequence, received: {}".format(type(metadata))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ImageMetadataManager', + request='Save', + version=1, + params=_params) + _params['metadata'] = metadata + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Save(self, metadata=None): ''' @@ -6430,6 +9105,34 @@ class KeyManagerFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_AddKeys(self, ssh_keys=None, user=None): + ''' + AddKeys adds new authorised ssh keys for the specified user. + + ssh_keys : typing.Sequence[str] + user : str + Returns -> ErrorResults + ''' + if ssh_keys is not None and not isinstance(ssh_keys, (bytes, str, list)): + raise Exception("Expected ssh_keys to be a Sequence, received: {}".format(type(ssh_keys))) + + if user is not None and not isinstance(user, (bytes, str)): + raise Exception("Expected user to be a str, received: {}".format(type(user))) + + # 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 = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def AddKeys(self, ssh_keys=None, user=None): ''' @@ -6458,6 +9161,34 @@ async def AddKeys(self, ssh_keys=None, user=None): + @ReturnMapping(ErrorResults) + def sync_DeleteKeys(self, ssh_keys=None, user=None): + ''' + DeleteKeys deletes the authorised ssh keys for the specified user. + + ssh_keys : typing.Sequence[str] + user : str + Returns -> ErrorResults + ''' + if ssh_keys is not None and not isinstance(ssh_keys, (bytes, str, list)): + raise Exception("Expected ssh_keys to be a Sequence, received: {}".format(type(ssh_keys))) + + if user is not None and not isinstance(user, (bytes, str)): + raise Exception("Expected user to be a str, received: {}".format(type(user))) + + # 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 = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def DeleteKeys(self, ssh_keys=None, user=None): ''' @@ -6486,6 +9217,34 @@ async def DeleteKeys(self, ssh_keys=None, user=None): + @ReturnMapping(ErrorResults) + def sync_ImportKeys(self, ssh_keys=None, user=None): + ''' + ImportKeys imports new authorised ssh keys from the specified key ids for the specified user. + + ssh_keys : typing.Sequence[str] + user : str + Returns -> ErrorResults + ''' + if ssh_keys is not None and not isinstance(ssh_keys, (bytes, str, list)): + raise Exception("Expected ssh_keys to be a Sequence, received: {}".format(type(ssh_keys))) + + if user is not None and not isinstance(user, (bytes, str)): + raise Exception("Expected user to be a str, received: {}".format(type(user))) + + # 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 = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ImportKeys(self, ssh_keys=None, user=None): ''' @@ -6515,7 +9274,7 @@ async def ImportKeys(self, ssh_keys=None, user=None): @ReturnMapping(StringsResults) - async def ListKeys(self, entities=None, mode=None): + def sync_ListKeys(self, entities=None, mode=None): ''' ListKeys returns the authorised ssh keys for the specified users. @@ -6537,34 +9296,62 @@ async def ListKeys(self, entities=None, mode=None): params=_params) _params['entities'] = entities _params['mode'] = mode - reply = await self.rpc(msg) + reply = self.sync_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': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'message': {'type': 'string'}}, - 'required': ['message', 'code'], - 'type': 'object'}, - 'NotifyWatchResult': {'additionalProperties': False, - 'properties': {'NotifyWatcherId': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, + @ReturnMapping(StringsResults) + async def ListKeys(self, entities=None, mode=None): + ''' + ListKeys returns the authorised ssh keys for the specified users. + + entities : Entities + mode : bool + Returns -> StringsResults + ''' + if entities is not None and not isinstance(entities, (dict, Entities)): + raise Exception("Expected entities to be a Entities, received: {}".format(type(entities))) + + if mode is not None and not isinstance(mode, bool): + raise Exception("Expected mode to be a bool, received: {}".format(type(mode))) + + # 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': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, 'required': ['NotifyWatcherId'], 'type': 'object'}, 'NotifyWatchResults': {'additionalProperties': False, @@ -6618,6 +9405,31 @@ class KeyUpdaterFacade(Type): 'type': 'object'} + @ReturnMapping(StringsResults) + def sync_AuthorisedKeys(self, entities=None): + ''' + AuthorisedKeys reports the authorised ssh keys for the specified machines. + The current implementation relies on global authorised keys being stored in the model config. + This will change as new user management and authorisation functionality is added. + + entities : typing.Sequence[~Entity] + Returns -> StringsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='KeyUpdater', + request='AuthorisedKeys', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsResults) async def AuthorisedKeys(self, entities=None): ''' @@ -6643,6 +9455,32 @@ async def AuthorisedKeys(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchAuthorisedKeys(self, entities=None): + ''' + WatchAuthorisedKeys starts a watcher to track changes to the authorised ssh keys + for the specified machines. + The current implementation relies on global authorised keys being stored in the model config. + This will change as new user management and authorisation functionality is added. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='KeyUpdater', + request='WatchAuthorisedKeys', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchAuthorisedKeys(self, entities=None): ''' @@ -6722,6 +9560,29 @@ class LifeFlagFacade(Type): 'type': 'object'} + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='LifeFlag', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' @@ -6745,6 +9606,29 @@ async def Life(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='LifeFlag', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def Watch(self, entities=None): ''' @@ -6846,6 +9730,30 @@ class LogForwardingFacade(Type): 'type': 'object'} + @ReturnMapping(LogForwardingGetLastSentResults) + def sync_GetLastSent(self, ids=None): + ''' + GetLastSent is a bulk call that gets the log forwarding "last sent" + record ID for each requested target. + + ids : typing.Sequence[~LogForwardingID] + Returns -> LogForwardingGetLastSentResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='LogForwarding', + request='GetLastSent', + version=1, + params=_params) + _params['ids'] = ids + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LogForwardingGetLastSentResults) async def GetLastSent(self, ids=None): ''' @@ -6870,6 +9778,30 @@ async def GetLastSent(self, ids=None): + @ReturnMapping(ErrorResults) + def sync_SetLastSent(self, params=None): + ''' + SetLastSent is a bulk call that sets the log forwarding "last sent" + record ID for each requested target. + + params : typing.Sequence[~LogForwardingSetLastSentParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='LogForwarding', + request='SetLastSent', + version=1, + params=_params) + _params['params'] = params + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetLastSent(self, params=None): ''' @@ -6962,6 +9894,29 @@ class LoggerFacade(Type): 'type': 'object'} + @ReturnMapping(StringResults) + def sync_LoggingConfig(self, entities=None): + ''' + LoggingConfig reports the logging configuration for the agents specified. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Logger', + request='LoggingConfig', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def LoggingConfig(self, entities=None): ''' @@ -6985,6 +9940,32 @@ async def LoggingConfig(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchLoggingConfig(self, entities=None): + ''' + WatchLoggingConfig starts a watcher to track changes to the logging config + for the agents specified.. Unfortunately the current infrastructure makes + watching parts of the config non-trivial, so currently any change to the + config will cause the watcher to notify the client. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Logger', + request='WatchLoggingConfig', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchLoggingConfig(self, entities=None): ''' @@ -7157,7 +10138,7 @@ class MachineActionsFacade(Type): @ReturnMapping(ActionResults) - async def Actions(self, entities=None): + def sync_Actions(self, entities=None): ''' Actions returns the Actions by Tags passed and ensures that the machine asking for them is the machine that has the actions @@ -7175,18 +10156,19 @@ async def Actions(self, entities=None): version=1, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def BeginActions(self, entities=None): + @ReturnMapping(ActionResults) + async def Actions(self, entities=None): ''' - BeginActions marks the actions represented by the passed in Tags as running. + Actions returns the Actions by Tags passed and ensures that the machine asking + for them is the machine that has the actions entities : typing.Sequence[~Entity] - Returns -> ErrorResults + Returns -> ActionResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -7194,7 +10176,7 @@ async def BeginActions(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='MachineActions', - request='BeginActions', + request='Actions', version=1, params=_params) _params['entities'] = entities @@ -7204,24 +10186,118 @@ async def BeginActions(self, entities=None): @ReturnMapping(ErrorResults) - async def FinishActions(self, results=None): + def sync_BeginActions(self, entities=None): ''' - FinishActions saves the result of a completed Action + BeginActions marks the actions represented by the passed in Tags as running. - results : typing.Sequence[~ActionExecutionResult] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' - if results is not None and not isinstance(results, (bytes, str, list)): - raise Exception("Expected results to be a Sequence, received: {}".format(type(results))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='MachineActions', - request='FinishActions', + request='BeginActions', version=1, params=_params) - _params['results'] = results - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def BeginActions(self, entities=None): + ''' + BeginActions marks the actions represented by the passed in Tags as running. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # 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) + def sync_FinishActions(self, results=None): + ''' + FinishActions saves the result of a completed Action + + results : typing.Sequence[~ActionExecutionResult] + Returns -> ErrorResults + ''' + if results is not None and not isinstance(results, (bytes, str, list)): + raise Exception("Expected results to be a Sequence, received: {}".format(type(results))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineActions', + request='FinishActions', + version=1, + params=_params) + _params['results'] = results + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def FinishActions(self, results=None): + ''' + FinishActions saves the result of a completed Action + + results : typing.Sequence[~ActionExecutionResult] + Returns -> ErrorResults + ''' + if results is not None and not isinstance(results, (bytes, str, list)): + raise Exception("Expected results to be a Sequence, received: {}".format(type(results))) + + # 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) + def sync_RunningActions(self, entities=None): + ''' + RunningActions lists the actions running for the entities passed in. + If we end up needing more than ListRunning at some point we could follow/abstract + what's done in the client actions package. + + entities : typing.Sequence[~Entity] + Returns -> ActionsByReceivers + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineActions', + request='RunningActions', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply @@ -7251,6 +10327,30 @@ async def RunningActions(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchActionNotifications(self, entities=None): + ''' + WatchActionNotifications returns a StringsWatcher for observing + incoming action calls to a machine. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineActions', + request='WatchActionNotifications', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchActionNotifications(self, entities=None): ''' @@ -7386,6 +10486,30 @@ class MachineUndertakerFacade(Type): 'type': 'object'} + @ReturnMapping(EntitiesResults) + def sync_AllMachineRemovals(self, entities=None): + ''' + AllMachineRemovals returns tags for all of the machines that have + been marked for removal in the requested model. + + entities : typing.Sequence[~Entity] + Returns -> EntitiesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineUndertaker', + request='AllMachineRemovals', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(EntitiesResults) async def AllMachineRemovals(self, entities=None): ''' @@ -7410,6 +10534,31 @@ async def AllMachineRemovals(self, entities=None): + @ReturnMapping(None) + def sync_CompleteMachineRemovals(self, entities=None): + ''' + CompleteMachineRemovals removes the specified machines from the + model database. It should only be called once any provider-level + cleanup has been done for those machines. + + entities : typing.Sequence[~Entity] + Returns -> None + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineUndertaker', + request='CompleteMachineRemovals', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def CompleteMachineRemovals(self, entities=None): ''' @@ -7435,6 +10584,30 @@ async def CompleteMachineRemovals(self, entities=None): + @ReturnMapping(ProviderInterfaceInfoResults) + def sync_GetMachineProviderInterfaceInfo(self, entities=None): + ''' + GetMachineProviderInterfaceInfo returns the provider details for + all network interfaces attached to the machines requested. + + entities : typing.Sequence[~Entity] + Returns -> ProviderInterfaceInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineUndertaker', + request='GetMachineProviderInterfaceInfo', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ProviderInterfaceInfoResults) async def GetMachineProviderInterfaceInfo(self, entities=None): ''' @@ -7459,6 +10632,30 @@ async def GetMachineProviderInterfaceInfo(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchMachineRemovals(self, entities=None): + ''' + WatchMachineRemovals returns a watcher that will signal each time a + machine is marked for removal. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineUndertaker', + request='WatchMachineRemovals', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchMachineRemovals(self, entities=None): ''' @@ -7544,6 +10741,28 @@ class MetricsManagerFacade(Type): 'type': 'object'} + @ReturnMapping(None) + def sync_AddJujuMachineMetrics(self): + ''' + AddJujuMachineMetrics adds a metric that counts the number of + non-container machines in the current model. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MetricsManager', + request='AddJujuMachineMetrics', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def AddJujuMachineMetrics(self): ''' @@ -7566,6 +10785,32 @@ async def AddJujuMachineMetrics(self): + @ReturnMapping(ErrorResults) + def sync_CleanupOldMetrics(self, entities=None): + ''' + CleanupOldMetrics removes old metrics from the collection. + The single arg params is expected to contain and model uuid. + Even though the call will delete all metrics across models + it serves to validate that the connection has access to at least one model. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MetricsManager', + request='CleanupOldMetrics', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def CleanupOldMetrics(self, entities=None): ''' @@ -7593,7 +10838,7 @@ async def CleanupOldMetrics(self, entities=None): @ReturnMapping(ErrorResults) - async def SendMetrics(self, entities=None): + def sync_SendMetrics(self, entities=None): ''' SendMetrics will send any unsent metrics onto the metric collection service. @@ -7610,20 +10855,43 @@ async def SendMetrics(self, entities=None): version=1, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_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, + @ReturnMapping(ErrorResults) + async def SendMetrics(self, entities=None): + ''' + SendMetrics will send any unsent metrics onto the metric collection service. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # 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'}, @@ -7669,6 +10937,30 @@ class MigrationFlagFacade(Type): 'type': 'object'} + @ReturnMapping(PhaseResults) + def sync_Phase(self, entities=None): + ''' + Phase returns the current migration phase or an error for every + supplied entity. + + entities : typing.Sequence[~Entity] + Returns -> PhaseResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationFlag', + request='Phase', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(PhaseResults) async def Phase(self, entities=None): ''' @@ -7693,6 +10985,30 @@ async def Phase(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_Watch(self, entities=None): + ''' + Watch returns an id for use with the NotifyWatcher facade, or an + error, for every supplied entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationFlag', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def Watch(self, entities=None): ''' @@ -7764,6 +11080,40 @@ class MigrationMinionFacade(Type): 'type': 'object'} + @ReturnMapping(None) + def sync_Report(self, migration_id=None, phase=None, success=None): + ''' + Report allows a migration minion to submit whether it succeeded or + failed for a specific migration phase. + + migration_id : str + phase : str + success : bool + Returns -> None + ''' + if migration_id is not None and not isinstance(migration_id, (bytes, str)): + raise Exception("Expected migration_id to be a str, received: {}".format(type(migration_id))) + + if phase is not None and not isinstance(phase, (bytes, str)): + raise Exception("Expected phase to be a str, received: {}".format(type(phase))) + + if success is not None and not isinstance(success, bool): + raise Exception("Expected success to be a bool, received: {}".format(type(success))) + + # 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 = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Report(self, migration_id=None, phase=None, success=None): ''' @@ -7798,6 +11148,33 @@ async def Report(self, migration_id=None, phase=None, success=None): + @ReturnMapping(NotifyWatchResult) + def sync_Watch(self): + ''' + Watch starts watching for status updates for a migration attempt + for the model. It will report when a migration starts and when its + status changes (including when it finishes). An initial event will + be fired if there has ever been a migration attempt for the model. + + The MigrationStatusWatcher facade must be used to receive events + from the watcher. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMinion', + request='Watch', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def Watch(self): ''' @@ -7858,6 +11235,29 @@ class MigrationStatusWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(MigrationStatus) + def sync_Next(self): + ''' + Next returns when the status for a model migration for the + associated model changes. The current details for the active + migration are returned. + + + Returns -> MigrationStatus + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationStatusWatcher', + request='Next', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MigrationStatus) async def Next(self): ''' @@ -7881,6 +11281,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationStatusWatcher', + request='Stop', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -7914,6 +11335,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class MigrationTargetFacade(Type): @@ -8123,7 +11555,7 @@ class MigrationTargetFacade(Type): @ReturnMapping(None) - async def Abort(self, model_tag=None): + def sync_Abort(self, model_tag=None): ''' Abort removes the specified model from the database. It is an error to attempt to Abort a model that has a migration mode other than importing. @@ -8141,17 +11573,16 @@ async def Abort(self, model_tag=None): version=1, params=_params) _params['model-tag'] = model_tag - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(None) - async def Activate(self, model_tag=None): + async def Abort(self, model_tag=None): ''' - Activate sets the migration mode of the model to "none", meaning it - is ready for use. It is an error to attempt to Abort a model that - has a migration mode other than importing. + Abort removes the specified model from the database. It is an error to + attempt to Abort a model that has a migration mode other than importing. model_tag : str Returns -> None @@ -8162,7 +11593,7 @@ async def Activate(self, model_tag=None): # map input types to rpc msg _params = dict() msg = dict(type='MigrationTarget', - request='Activate', + request='Abort', version=1, params=_params) _params['model-tag'] = model_tag @@ -8172,89 +11603,254 @@ async def Activate(self, model_tag=None): @ReturnMapping(None) - async def AdoptResources(self, model_tag=None, source_controller_version=None): + def sync_Activate(self, model_tag=None): ''' - AdoptResources asks the cloud provider to update the controller - tags for a model's resources. This prevents the resources from - being destroyed if the source controller is destroyed after the - model is migrated away. + Activate sets the migration mode of the model to "none", meaning it + is ready for use. It is an error to attempt to Abort a model that + has a migration mode other than importing. model_tag : str - source_controller_version : Number Returns -> None ''' if model_tag is not None and not isinstance(model_tag, (bytes, str)): raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) - if source_controller_version is not None and not isinstance(source_controller_version, (dict, Number)): - raise Exception("Expected source_controller_version to be a Number, received: {}".format(type(source_controller_version))) - # map input types to rpc msg _params = dict() msg = dict(type='MigrationTarget', - request='AdoptResources', + request='Activate', version=1, params=_params) _params['model-tag'] = model_tag - _params['source-controller-version'] = source_controller_version - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(BytesResult) - async def CACert(self): + @ReturnMapping(None) + async def Activate(self, model_tag=None): ''' - CACert returns the certificate used to validate the state connection. - + Activate sets the migration mode of the model to "none", meaning it + is ready for use. It is an error to attempt to Abort a model that + has a migration mode other than importing. - Returns -> BytesResult + model_tag : str + Returns -> None ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) # map input types to rpc msg _params = dict() msg = dict(type='MigrationTarget', - request='CACert', + request='Activate', version=1, params=_params) - + _params['model-tag'] = model_tag reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def CheckMachines(self, model_tag=None): + @ReturnMapping(None) + def sync_AdoptResources(self, model_tag=None, source_controller_version=None): ''' - CheckMachines compares the machines in state with the ones reported - by the provider and reports any discrepancies. + AdoptResources asks the cloud provider to update the controller + tags for a model's resources. This prevents the resources from + being destroyed if the source controller is destroyed after the + model is migrated away. model_tag : str - Returns -> ErrorResults + source_controller_version : Number + Returns -> None ''' if model_tag is not None and not isinstance(model_tag, (bytes, str)): raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + if source_controller_version is not None and not isinstance(source_controller_version, (dict, Number)): + raise Exception("Expected source_controller_version to be a Number, received: {}".format(type(source_controller_version))) + # map input types to rpc msg _params = dict() msg = dict(type='MigrationTarget', - request='CheckMachines', + request='AdoptResources', version=1, params=_params) _params['model-tag'] = model_tag - reply = await self.rpc(msg) + _params['source-controller-version'] = source_controller_version + reply = self.sync_rpc(msg) return reply @ReturnMapping(None) - async def Import(self, bytes_=None, charms=None, resources=None, tools=None): + async def AdoptResources(self, model_tag=None, source_controller_version=None): ''' - Import takes a serialized Juju model, deserializes it, and - recreates it in the receiving controller. + AdoptResources asks the cloud provider to update the controller + tags for a model's resources. This prevents the resources from + being destroyed if the source controller is destroyed after the + model is migrated away. - bytes_ : typing.Sequence[int] - charms : typing.Sequence[str] + model_tag : str + source_controller_version : Number + Returns -> None + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + if source_controller_version is not None and not isinstance(source_controller_version, (dict, Number)): + raise Exception("Expected source_controller_version to be a Number, received: {}".format(type(source_controller_version))) + + # 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) + def sync_CACert(self): + ''' + CACert returns the certificate used to validate the state connection. + + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='CACert', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(BytesResult) + async def CACert(self): + ''' + CACert returns the certificate used to validate the state connection. + + + Returns -> BytesResult + ''' + + # 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) + def sync_CheckMachines(self, model_tag=None): + ''' + CheckMachines compares the machines in state with the ones reported + by the provider and reports any discrepancies. + + model_tag : str + Returns -> ErrorResults + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='CheckMachines', + version=1, + params=_params) + _params['model-tag'] = model_tag + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def CheckMachines(self, model_tag=None): + ''' + CheckMachines compares the machines in state with the ones reported + by the provider and reports any discrepancies. + + model_tag : str + Returns -> ErrorResults + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # 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) + def sync_Import(self, bytes_=None, charms=None, resources=None, tools=None): + ''' + Import takes a serialized Juju model, deserializes it, and + recreates it in the receiving controller. + + bytes_ : typing.Sequence[int] + charms : typing.Sequence[str] + resources : typing.Sequence[~SerializedModelResource] + tools : typing.Sequence[~SerializedModelTools] + Returns -> None + ''' + if bytes_ is not None and not isinstance(bytes_, (bytes, str, list)): + raise Exception("Expected bytes_ to be a Sequence, received: {}".format(type(bytes_))) + + if charms is not None and not isinstance(charms, (bytes, str, list)): + raise Exception("Expected charms to be a Sequence, received: {}".format(type(charms))) + + if resources is not None and not isinstance(resources, (bytes, str, list)): + raise Exception("Expected resources to be a Sequence, received: {}".format(type(resources))) + + if tools is not None and not isinstance(tools, (bytes, str, list)): + raise Exception("Expected tools to be a Sequence, received: {}".format(type(tools))) + + # 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['resources'] = resources + _params['tools'] = tools + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Import(self, bytes_=None, charms=None, resources=None, tools=None): + ''' + Import takes a serialized Juju model, deserializes it, and + recreates it in the receiving controller. + + bytes_ : typing.Sequence[int] + charms : typing.Sequence[str] resources : typing.Sequence[~SerializedModelResource] tools : typing.Sequence[~SerializedModelTools] Returns -> None @@ -8286,6 +11882,44 @@ async def Import(self, bytes_=None, charms=None, resources=None, tools=None): + @ReturnMapping(str) + def sync_LatestLogTime(self, model_tag=None): + ''' + LatestLogTime returns the time of the most recent log record + received by the logtransfer endpoint. This can be used as the start + point for streaming logs from the source if the transfer was + interrupted. + + For performance reasons, not every time is tracked, so if the + target controller died during the transfer the latest log time + might be up to 2 minutes earlier. If the transfer was interrupted + in some other way (like the source controller going away or a + network partition) the time will be up-to-date. + + Log messages are assumed to be sent in time order (which is how + debug-log emits them). If that isn't the case then this mechanism + can't be used to avoid duplicates when logtransfer is restarted. + + Returns the zero time if no logs have been transferred. + + model_tag : str + Returns -> str + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='LatestLogTime', + version=1, + params=_params) + _params['model-tag'] = model_tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(str) async def LatestLogTime(self, model_tag=None): ''' @@ -8324,6 +11958,50 @@ async def LatestLogTime(self, model_tag=None): + @ReturnMapping(None) + def sync_Prechecks(self, agent_version=None, controller_agent_version=None, name=None, owner_tag=None, uuid=None): + ''' + Prechecks ensure that the target controller is ready to accept a + model migration. + + agent_version : Number + controller_agent_version : Number + name : str + owner_tag : str + uuid : str + Returns -> None + ''' + if agent_version is not None and not isinstance(agent_version, (dict, Number)): + raise Exception("Expected agent_version to be a Number, received: {}".format(type(agent_version))) + + if controller_agent_version is not None and not isinstance(controller_agent_version, (dict, Number)): + raise Exception("Expected controller_agent_version to be a Number, received: {}".format(type(controller_agent_version))) + + if name is not None and not isinstance(name, (bytes, str)): + raise Exception("Expected name to be a str, received: {}".format(type(name))) + + if owner_tag is not None and not isinstance(owner_tag, (bytes, str)): + raise Exception("Expected owner_tag to be a str, received: {}".format(type(owner_tag))) + + if uuid is not None and not isinstance(uuid, (bytes, str)): + raise Exception("Expected uuid to be a str, received: {}".format(type(uuid))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Prechecks', + version=1, + params=_params) + _params['agent-version'] = agent_version + _params['controller-agent-version'] = controller_agent_version + _params['name'] = name + _params['owner-tag'] = owner_tag + _params['uuid'] = uuid + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Prechecks(self, agent_version=None, controller_agent_version=None, name=None, owner_tag=None, uuid=None): ''' @@ -8418,6 +12096,29 @@ class ModelSummaryWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(SummaryWatcherNextResults) + def sync_Next(self): + ''' + Next will return the current state of everything on the first call + and subsequent calls will return just those model summaries that have + changed. + + + Returns -> SummaryWatcherNextResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelSummaryWatcher', + request='Next', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SummaryWatcherNextResults) async def Next(self): ''' @@ -8442,7 +12143,7 @@ async def Next(self): @ReturnMapping(None) - async def Stop(self): + def sync_Stop(self): ''' Stop stops the watcher. @@ -8457,12 +12158,33 @@ async def Stop(self): version=1, params=_params) - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - async def rpc(self, msg): + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelSummaryWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -8474,6 +12196,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class ModelUpgraderFacade(Type): @@ -8532,6 +12265,30 @@ class ModelUpgraderFacade(Type): 'type': 'object'} + @ReturnMapping(None) + def sync_AbortModelUpgrade(self, model_tag=None): + ''' + AbortModelUpgrade aborts and archives the model upgrade + synchronisation record, if any. + + model_tag : str + Returns -> None + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelUpgrader', + request='AbortModelUpgrade', + version=1, + params=_params) + _params['model-tag'] = model_tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def AbortModelUpgrade(self, model_tag=None): ''' @@ -8556,6 +12313,49 @@ async def AbortModelUpgrade(self, model_tag=None): + @ReturnMapping(UpgradeModelResult) + def sync_UpgradeModel(self, agent_stream=None, dry_run=None, ignore_agent_versions=None, model_tag=None, target_version=None): + ''' + UpgradeModel upgrades a model. + + agent_stream : str + dry_run : bool + ignore_agent_versions : bool + model_tag : str + target_version : Number + Returns -> UpgradeModelResult + ''' + if agent_stream is not None and not isinstance(agent_stream, (bytes, str)): + raise Exception("Expected agent_stream to be a str, received: {}".format(type(agent_stream))) + + if dry_run is not None and not isinstance(dry_run, bool): + raise Exception("Expected dry_run to be a bool, received: {}".format(type(dry_run))) + + if ignore_agent_versions is not None and not isinstance(ignore_agent_versions, bool): + raise Exception("Expected ignore_agent_versions to be a bool, received: {}".format(type(ignore_agent_versions))) + + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + if target_version is not None and not isinstance(target_version, (dict, Number)): + raise Exception("Expected target_version to be a Number, received: {}".format(type(target_version))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelUpgrader', + request='UpgradeModel', + version=1, + params=_params) + _params['agent-stream'] = agent_stream + _params['dry-run'] = dry_run + _params['ignore-agent-versions'] = ignore_agent_versions + _params['model-tag'] = model_tag + _params['target-version'] = target_version + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UpgradeModelResult) async def UpgradeModel(self, agent_stream=None, dry_run=None, ignore_agent_versions=None, model_tag=None, target_version=None): ''' @@ -8614,6 +12414,29 @@ class NotifyWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(None) + def sync_Next(self): + ''' + Next returns when a change has occurred to the + entity being watched since the most recent call to Next + or the Watch call that created the NotifyWatcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='NotifyWatcher', + request='Next', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Next(self): ''' @@ -8637,6 +12460,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='NotifyWatcher', + request='Stop', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -8670,6 +12514,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class OfferStatusWatcherFacade(Type): @@ -8719,6 +12574,29 @@ class OfferStatusWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(OfferStatusWatchResult) + def sync_Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvOfferStatusWatcher. + + + Returns -> OfferStatusWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='OfferStatusWatcher', + request='Next', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(OfferStatusWatchResult) async def Next(self): ''' @@ -8742,6 +12620,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='OfferStatusWatcher', + request='Stop', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -8775,6 +12674,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class PayloadsFacade(Type): @@ -8818,6 +12728,31 @@ class PayloadsFacade(Type): 'type': 'object'} + @ReturnMapping(PayloadListResults) + def sync_List(self, patterns=None): + ''' + List builds the list of payloads being tracked for + the given unit and IDs. If no IDs are provided then all tracked + payloads for the unit are returned. + + patterns : typing.Sequence[str] + Returns -> PayloadListResults + ''' + if patterns is not None and not isinstance(patterns, (bytes, str, list)): + raise Exception("Expected patterns to be a Sequence, received: {}".format(type(patterns))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Payloads', + request='List', + version=1, + params=_params) + _params['patterns'] = patterns + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(PayloadListResults) async def List(self, patterns=None): ''' @@ -8957,7 +12892,7 @@ class PayloadsHookContextFacade(Type): @ReturnMapping(PayloadResults) - async def List(self, entities=None): + def sync_List(self, entities=None): ''' List builds the list of payload being tracked for the given unit and IDs. If no IDs are provided then all tracked @@ -8976,40 +12911,42 @@ async def List(self, entities=None): version=1, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(PayloadResults) - async def LookUp(self, args=None): + async def List(self, entities=None): ''' - LookUp identifies the payload with the provided name and raw ID. + List builds the list of payload being tracked for + the given unit and IDs. If no IDs are provided then all tracked + payloads for the unit are returned. - args : typing.Sequence[~LookUpPayloadArg] + entities : typing.Sequence[~Entity] Returns -> PayloadResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='PayloadsHookContext', - request='LookUp', + request='List', version=1, params=_params) - _params['args'] = args + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(PayloadResults) - async def SetStatus(self, args=None): + def sync_LookUp(self, args=None): ''' - SetStatus sets the raw status of a payload. + LookUp identifies the payload with the provided name and raw ID. - args : typing.Sequence[~SetPayloadStatusArg] + args : typing.Sequence[~LookUpPayloadArg] Returns -> PayloadResults ''' if args is not None and not isinstance(args, (bytes, str, list)): @@ -9018,40 +12955,155 @@ async def SetStatus(self, args=None): # map input types to rpc msg _params = dict() msg = dict(type='PayloadsHookContext', - request='SetStatus', + request='LookUp', version=1, params=_params) _params['args'] = args - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(PayloadResults) - async def Track(self, payloads=None): + async def LookUp(self, args=None): ''' - Track stores a payload to be tracked in state. + LookUp identifies the payload with the provided name and raw ID. - payloads : typing.Sequence[~Payload] + args : typing.Sequence[~LookUpPayloadArg] Returns -> PayloadResults ''' - if payloads is not None and not isinstance(payloads, (bytes, str, list)): - raise Exception("Expected payloads to be a Sequence, received: {}".format(type(payloads))) + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='PayloadsHookContext', - request='Track', + request='LookUp', version=1, params=_params) - _params['payloads'] = payloads + _params['args'] = args reply = await self.rpc(msg) return reply @ReturnMapping(PayloadResults) - async def Untrack(self, entities=None): + def sync_SetStatus(self, args=None): + ''' + SetStatus sets the raw status of a payload. + + args : typing.Sequence[~SetPayloadStatusArg] + Returns -> PayloadResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='PayloadsHookContext', + request='SetStatus', + version=1, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(PayloadResults) + async def SetStatus(self, args=None): + ''' + SetStatus sets the raw status of a payload. + + args : typing.Sequence[~SetPayloadStatusArg] + Returns -> PayloadResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # 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) + def sync_Track(self, payloads=None): + ''' + Track stores a payload to be tracked in state. + + payloads : typing.Sequence[~Payload] + Returns -> PayloadResults + ''' + if payloads is not None and not isinstance(payloads, (bytes, str, list)): + raise Exception("Expected payloads to be a Sequence, received: {}".format(type(payloads))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='PayloadsHookContext', + request='Track', + version=1, + params=_params) + _params['payloads'] = payloads + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(PayloadResults) + async def Track(self, payloads=None): + ''' + Track stores a payload to be tracked in state. + + payloads : typing.Sequence[~Payload] + Returns -> PayloadResults + ''' + if payloads is not None and not isinstance(payloads, (bytes, str, list)): + raise Exception("Expected payloads to be a Sequence, received: {}".format(type(payloads))) + + # 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) + def sync_Untrack(self, entities=None): + ''' + Untrack marks the identified payload as no longer being tracked. + + entities : typing.Sequence[~Entity] + Returns -> PayloadResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='PayloadsHookContext', + request='Untrack', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(PayloadResults) + async def Untrack(self, entities=None): ''' Untrack marks the identified payload as no longer being tracked. @@ -9080,6 +13132,25 @@ class PingerFacade(Type): 'type': 'object'} + @ReturnMapping(None) + def sync_Ping(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Pinger', + request='Ping', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Ping(self): ''' @@ -9099,6 +13170,25 @@ async def Ping(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Pinger', + request='Stop', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -9160,6 +13250,29 @@ class RelationStatusWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(RelationLifeSuspendedStatusWatchResult) + def sync_Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvRelationStatusWatcher. + + + Returns -> RelationLifeSuspendedStatusWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RelationStatusWatcher', + request='Next', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RelationLifeSuspendedStatusWatchResult) async def Next(self): ''' @@ -9183,6 +13296,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RelationStatusWatcher', + request='Stop', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -9216,6 +13350,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class RelationUnitsWatcherFacade(Type): @@ -9262,6 +13407,29 @@ class RelationUnitsWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(RelationUnitsWatchResult) + def sync_Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvRelationUnitsWatcher. + + + Returns -> RelationUnitsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RelationUnitsWatcher', + request='Next', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RelationUnitsWatchResult) async def Next(self): ''' @@ -9285,6 +13453,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RelationUnitsWatcher', + request='Stop', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -9318,6 +13507,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class RemoteRelationWatcherFacade(Type): @@ -9377,7 +13577,7 @@ class RemoteRelationWatcherFacade(Type): @ReturnMapping(RemoteRelationWatchResult) - async def Next(self): + def sync_Next(self): ''' Returns -> RemoteRelationWatchResult @@ -9390,24 +13590,22 @@ async def Next(self): version=1, params=_params) - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(None) - async def Stop(self): + @ReturnMapping(RemoteRelationWatchResult) + async def Next(self): ''' - Stop stops the watcher. - - Returns -> None + Returns -> RemoteRelationWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='RemoteRelationWatcher', - request='Stop', + request='Next', version=1, params=_params) @@ -9416,7 +13614,49 @@ async def Stop(self): - async def rpc(self, msg): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelationWatcher', + request='Stop', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelationWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -9428,6 +13668,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class ResourcesHookContextFacade(Type): @@ -9527,6 +13778,31 @@ class ResourcesHookContextFacade(Type): 'type': 'object'} + @ReturnMapping(UnitResourcesResult) + def sync_GetResourceInfo(self, resource_names=None): + ''' + GetResourceInfo returns the resource info for each of the given + resource names (for the implicit application). If any one is missing then + the corresponding result is set with errors.NotFound. + + resource_names : typing.Sequence[str] + Returns -> UnitResourcesResult + ''' + if resource_names is not None and not isinstance(resource_names, (bytes, str, list)): + raise Exception("Expected resource_names to be a Sequence, received: {}".format(type(resource_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ResourcesHookContext', + request='GetResourceInfo', + version=1, + params=_params) + _params['resource-names'] = resource_names + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UnitResourcesResult) async def GetResourceInfo(self, resource_names=None): ''' @@ -9627,6 +13903,30 @@ class RetryStrategyFacade(Type): 'type': 'object'} + @ReturnMapping(RetryStrategyResults) + def sync_RetryStrategy(self, entities=None): + ''' + RetryStrategy returns RetryStrategyResults that can be used by any code that uses + to configure the retry timer that's currently in juju utils. + + entities : typing.Sequence[~Entity] + Returns -> RetryStrategyResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RetryStrategy', + request='RetryStrategy', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RetryStrategyResults) async def RetryStrategy(self, entities=None): ''' @@ -9651,6 +13951,30 @@ async def RetryStrategy(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchRetryStrategy(self, entities=None): + ''' + WatchRetryStrategy watches for changes to the model. Currently we only allow + changes to the boolean that determines whether retries should be attempted or not. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RetryStrategy', + request='WatchRetryStrategy', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchRetryStrategy(self, entities=None): ''' @@ -9803,6 +14127,29 @@ class SecretBackendsFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_AddSecretBackends(self, args=None): + ''' + AddSecretBackends adds new secret backends. + + args : typing.Sequence[~AddSecretBackendArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretBackends', + request='AddSecretBackends', + version=1, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def AddSecretBackends(self, args=None): ''' @@ -9826,6 +14173,34 @@ async def AddSecretBackends(self, args=None): + @ReturnMapping(ListSecretBackendsResults) + def sync_ListSecretBackends(self, names=None, reveal=None): + ''' + ListSecretBackends lists available secret backends. + + names : typing.Sequence[str] + reveal : bool + Returns -> ListSecretBackendsResults + ''' + if names is not None and not isinstance(names, (bytes, str, list)): + raise Exception("Expected names to be a Sequence, received: {}".format(type(names))) + + if reveal is not None and not isinstance(reveal, bool): + raise Exception("Expected reveal to be a bool, received: {}".format(type(reveal))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretBackends', + request='ListSecretBackends', + version=1, + params=_params) + _params['names'] = names + _params['reveal'] = reveal + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ListSecretBackendsResults) async def ListSecretBackends(self, names=None, reveal=None): ''' @@ -9854,6 +14229,29 @@ async def ListSecretBackends(self, names=None, reveal=None): + @ReturnMapping(ErrorResults) + def sync_RemoveSecretBackends(self, args=None): + ''' + RemoveSecretBackends removes secret backends. + + args : typing.Sequence[~RemoveSecretBackendArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretBackends', + request='RemoveSecretBackends', + version=1, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def RemoveSecretBackends(self, args=None): ''' @@ -9877,6 +14275,29 @@ async def RemoveSecretBackends(self, args=None): + @ReturnMapping(ErrorResults) + def sync_UpdateSecretBackends(self, args=None): + ''' + UpdateSecretBackends updates secret backends. + + args : typing.Sequence[~UpdateSecretBackendArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretBackends', + request='UpdateSecretBackends', + version=1, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UpdateSecretBackends(self, args=None): ''' @@ -9962,6 +14383,29 @@ class SecretBackendsManagerFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_RotateBackendTokens(self, backend_ids=None): + ''' + RotateBackendTokens rotates the tokens for the specified backends. + + backend_ids : typing.Sequence[str] + Returns -> ErrorResults + ''' + if backend_ids is not None and not isinstance(backend_ids, (bytes, str, list)): + raise Exception("Expected backend_ids to be a Sequence, received: {}".format(type(backend_ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretBackendsManager', + request='RotateBackendTokens', + version=1, + params=_params) + _params['backend-ids'] = backend_ids + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def RotateBackendTokens(self, backend_ids=None): ''' @@ -9985,6 +14429,27 @@ async def RotateBackendTokens(self, backend_ids=None): + @ReturnMapping(SecretBackendRotateWatchResult) + def sync_WatchSecretBackendsRotateChanges(self): + ''' + WatchSecretBackendsRotateChanges sets up a watcher to notify of changes to secret backend rotations. + + + Returns -> SecretBackendRotateWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretBackendsManager', + request='WatchSecretBackendsRotateChanges', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretBackendRotateWatchResult) async def WatchSecretBackendsRotateChanges(self): ''' @@ -10048,7 +14513,7 @@ class SecretBackendsRotateWatcherFacade(Type): @ReturnMapping(SecretBackendRotateWatchResult) - async def Next(self): + def sync_Next(self): ''' Next returns when a change has occurred to an entity of the collection being watched since the most recent call to Next @@ -10065,18 +14530,62 @@ async def Next(self): version=1, params=_params) - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(None) - async def Stop(self): + @ReturnMapping(SecretBackendRotateWatchResult) + async def Next(self): ''' - Stop stops the watcher. + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvSecretRotationWatcher. - Returns -> None + Returns -> SecretBackendRotateWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretBackendsRotateWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretBackendsRotateWatcher', + request='Stop', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None ''' # map input types to rpc msg @@ -10103,6 +14612,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class SecretsDrainFacade(Type): @@ -10232,6 +14752,29 @@ class SecretsDrainFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_ChangeSecretBackend(self, args=None): + ''' + ChangeSecretBackend updates the backend for the specified secret after migration done. + + args : typing.Sequence[~ChangeSecretBackendArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsDrain', + request='ChangeSecretBackend', + version=1, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ChangeSecretBackend(self, args=None): ''' @@ -10255,6 +14798,27 @@ async def ChangeSecretBackend(self, args=None): + @ReturnMapping(ListSecretResults) + def sync_GetSecretsToDrain(self): + ''' + GetSecretsToDrain returns metadata for the secrets that need to be drained. + + + Returns -> ListSecretResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsDrain', + request='GetSecretsToDrain', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ListSecretResults) async def GetSecretsToDrain(self): ''' @@ -10276,6 +14840,27 @@ async def GetSecretsToDrain(self): + @ReturnMapping(NotifyWatchResult) + def sync_WatchSecretBackendChanged(self): + ''' + WatchSecretBackendChanged sets up a watcher to notify of changes to the secret backend. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsDrain', + request='WatchSecretBackendChanged', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchSecretBackendChanged(self): ''' @@ -10380,6 +14965,34 @@ class SecretsFacade(Type): 'type': 'object'} + @ReturnMapping(ListSecretResults) + def sync_ListSecrets(self, filter_=None, show_secrets=None): + ''' + ListSecrets lists available secrets. + + filter_ : SecretsFilter + show_secrets : bool + Returns -> ListSecretResults + ''' + if filter_ is not None and not isinstance(filter_, (dict, SecretsFilter)): + raise Exception("Expected filter_ to be a SecretsFilter, received: {}".format(type(filter_))) + + if show_secrets is not None and not isinstance(show_secrets, bool): + raise Exception("Expected show_secrets to be a bool, received: {}".format(type(show_secrets))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Secrets', + request='ListSecrets', + version=1, + params=_params) + _params['filter'] = filter_ + _params['show-secrets'] = show_secrets + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ListSecretResults) async def ListSecrets(self, filter_=None, show_secrets=None): ''' @@ -10851,6 +15464,29 @@ class SecretsManagerFacade(Type): 'type': 'object'} + @ReturnMapping(StringResults) + def sync_CreateSecretURIs(self, count=None): + ''' + CreateSecretURIs creates new secret URIs. + + count : int + Returns -> StringResults + ''' + if count is not None and not isinstance(count, int): + raise Exception("Expected count to be a int, received: {}".format(type(count))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='CreateSecretURIs', + version=1, + params=_params) + _params['count'] = count + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def CreateSecretURIs(self, count=None): ''' @@ -10874,6 +15510,29 @@ async def CreateSecretURIs(self, count=None): + @ReturnMapping(StringResults) + def sync_CreateSecrets(self, args=None): + ''' + CreateSecrets creates new secrets. + + args : typing.Sequence[~CreateSecretArg] + Returns -> StringResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='CreateSecrets', + version=1, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def CreateSecrets(self, args=None): ''' @@ -10888,57 +15547,305 @@ async def CreateSecrets(self, args=None): # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='CreateSecrets', + request='CreateSecrets', + version=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretConsumerInfoResults) + def sync_GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): + ''' + GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets. + This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook. + + consumer_tag : str + uris : typing.Sequence[str] + Returns -> SecretConsumerInfoResults + ''' + if consumer_tag is not None and not isinstance(consumer_tag, (bytes, str)): + raise Exception("Expected consumer_tag to be a str, received: {}".format(type(consumer_tag))) + + if uris is not None and not isinstance(uris, (bytes, str, list)): + raise Exception("Expected uris to be a Sequence, received: {}".format(type(uris))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetConsumerSecretsRevisionInfo', + version=1, + params=_params) + _params['consumer-tag'] = consumer_tag + _params['uris'] = uris + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SecretConsumerInfoResults) + async def GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): + ''' + GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets. + This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook. + + consumer_tag : str + uris : typing.Sequence[str] + Returns -> SecretConsumerInfoResults + ''' + if consumer_tag is not None and not isinstance(consumer_tag, (bytes, str)): + raise Exception("Expected consumer_tag to be a str, received: {}".format(type(consumer_tag))) + + if uris is not None and not isinstance(uris, (bytes, str, list)): + raise Exception("Expected uris to be a Sequence, received: {}".format(type(uris))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetConsumerSecretsRevisionInfo', + version=1, + params=_params) + _params['consumer-tag'] = consumer_tag + _params['uris'] = uris + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretBackendConfigResults) + def sync_GetSecretBackendConfig(self): + ''' + GetSecretBackendConfig gets the config needed to create a client to secret backends. + + + Returns -> SecretBackendConfigResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretBackendConfig', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SecretBackendConfigResults) + async def GetSecretBackendConfig(self): + ''' + GetSecretBackendConfig gets the config needed to create a client to secret backends. + + + Returns -> SecretBackendConfigResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretBackendConfig', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + def sync_GetSecretContentInfo(self, args=None): + ''' + GetSecretContentInfo returns the secret values for the specified secrets. + + args : typing.Sequence[~GetSecretContentArg] + Returns -> SecretContentResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretContentInfo', + version=1, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + async def GetSecretContentInfo(self, args=None): + ''' + GetSecretContentInfo returns the secret values for the specified secrets. + + args : typing.Sequence[~GetSecretContentArg] + Returns -> SecretContentResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretContentInfo', + version=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListSecretResults) + def sync_GetSecretMetadata(self): + ''' + GetSecretMetadata returns metadata for the caller's secrets. + + + Returns -> ListSecretResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretMetadata', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ListSecretResults) + async def GetSecretMetadata(self): + ''' + GetSecretMetadata returns metadata for the caller's secrets. + + + Returns -> ListSecretResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretMetadata', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + def sync_GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): + ''' + GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. + + pending_delete : bool + revisions : typing.Sequence[int] + uri : str + Returns -> SecretContentResults + ''' + if pending_delete is not None and not isinstance(pending_delete, bool): + raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) + + if revisions is not None and not isinstance(revisions, (bytes, str, list)): + raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretRevisionContentInfo', + version=1, + params=_params) + _params['pending-delete'] = pending_delete + _params['revisions'] = revisions + _params['uri'] = uri + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): + ''' + GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. + + pending_delete : bool + revisions : typing.Sequence[int] + uri : str + Returns -> SecretContentResults + ''' + if pending_delete is not None and not isinstance(pending_delete, bool): + raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) + + if revisions is not None and not isinstance(revisions, (bytes, str, list)): + raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretRevisionContentInfo', version=1, params=_params) - _params['args'] = args + _params['pending-delete'] = pending_delete + _params['revisions'] = revisions + _params['uri'] = uri reply = await self.rpc(msg) return reply - @ReturnMapping(SecretConsumerInfoResults) - async def GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): + @ReturnMapping(SecretBackendConfig) + def sync_GetSecretStoreConfig(self): ''' - GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets. - This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook. + GetSecretStoreConfig is for 3.0.x agents. + TODO(wallyworld) - remove when we auto upgrade migrated models. - consumer_tag : str - uris : typing.Sequence[str] - Returns -> SecretConsumerInfoResults - ''' - if consumer_tag is not None and not isinstance(consumer_tag, (bytes, str)): - raise Exception("Expected consumer_tag to be a str, received: {}".format(type(consumer_tag))) - if uris is not None and not isinstance(uris, (bytes, str, list)): - raise Exception("Expected uris to be a Sequence, received: {}".format(type(uris))) + Returns -> SecretBackendConfig + ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='GetConsumerSecretsRevisionInfo', + request='GetSecretStoreConfig', version=1, params=_params) - _params['consumer-tag'] = consumer_tag - _params['uris'] = uris - reply = await self.rpc(msg) + + reply = self.sync_rpc(msg) return reply - @ReturnMapping(SecretBackendConfigResults) - async def GetSecretBackendConfig(self): + @ReturnMapping(SecretBackendConfig) + async def GetSecretStoreConfig(self): ''' - GetSecretBackendConfig gets the config needed to create a client to secret backends. + GetSecretStoreConfig is for 3.0.x agents. + TODO(wallyworld) - remove when we auto upgrade migrated models. - Returns -> SecretBackendConfigResults + Returns -> SecretBackendConfig ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='GetSecretBackendConfig', + request='GetSecretStoreConfig', version=1, params=_params) @@ -10947,13 +15854,13 @@ async def GetSecretBackendConfig(self): - @ReturnMapping(SecretContentResults) - async def GetSecretContentInfo(self, args=None): + @ReturnMapping(ErrorResults) + def sync_RemoveSecrets(self, args=None): ''' - GetSecretContentInfo returns the secret values for the specified secrets. + RemoveSecrets removes the specified secrets. - args : typing.Sequence[~GetSecretContentArg] - Returns -> SecretContentResults + args : typing.Sequence[~DeleteSecretArg] + Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) @@ -10961,97 +15868,90 @@ async def GetSecretContentInfo(self, args=None): # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='GetSecretContentInfo', + request='RemoveSecrets', version=1, params=_params) _params['args'] = args - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ListSecretResults) - async def GetSecretMetadata(self): + @ReturnMapping(ErrorResults) + async def RemoveSecrets(self, args=None): ''' - GetSecretMetadata returns metadata for the caller's secrets. - + RemoveSecrets removes the specified secrets. - Returns -> ListSecretResults + args : typing.Sequence[~DeleteSecretArg] + Returns -> ErrorResults ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='GetSecretMetadata', + request='RemoveSecrets', version=1, params=_params) - + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(SecretContentResults) - async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): + @ReturnMapping(ErrorResults) + def sync_SecretsGrant(self, args=None): ''' - GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. + SecretsGrant grants access to a secret for the specified subjects. - pending_delete : bool - revisions : typing.Sequence[int] - uri : str - Returns -> SecretContentResults + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults ''' - if pending_delete is not None and not isinstance(pending_delete, bool): - raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) - - if revisions is not None and not isinstance(revisions, (bytes, str, list)): - raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) - - if uri is not None and not isinstance(uri, (bytes, str)): - raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='GetSecretRevisionContentInfo', + request='SecretsGrant', version=1, params=_params) - _params['pending-delete'] = pending_delete - _params['revisions'] = revisions - _params['uri'] = uri - reply = await self.rpc(msg) + _params['args'] = args + reply = self.sync_rpc(msg) return reply - @ReturnMapping(SecretBackendConfig) - async def GetSecretStoreConfig(self): + @ReturnMapping(ErrorResults) + async def SecretsGrant(self, args=None): ''' - GetSecretStoreConfig is for 3.0.x agents. - TODO(wallyworld) - remove when we auto upgrade migrated models. - + SecretsGrant grants access to a secret for the specified subjects. - Returns -> SecretBackendConfig + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='GetSecretStoreConfig', + request='SecretsGrant', version=1, params=_params) - + _params['args'] = args reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def RemoveSecrets(self, args=None): + def sync_SecretsRevoke(self, args=None): ''' - RemoveSecrets removes the specified secrets. + SecretsRevoke revokes access to a secret for the specified subjects. - args : typing.Sequence[~DeleteSecretArg] + args : typing.Sequence[~GrantRevokeSecretArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): @@ -11060,19 +15960,19 @@ async def RemoveSecrets(self, args=None): # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='RemoveSecrets', + request='SecretsRevoke', version=1, params=_params) _params['args'] = args - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SecretsGrant(self, args=None): + async def SecretsRevoke(self, args=None): ''' - SecretsGrant grants access to a secret for the specified subjects. + SecretsRevoke revokes access to a secret for the specified subjects. args : typing.Sequence[~GrantRevokeSecretArg] Returns -> ErrorResults @@ -11083,7 +15983,7 @@ async def SecretsGrant(self, args=None): # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='SecretsGrant', + request='SecretsRevoke', version=1, params=_params) _params['args'] = args @@ -11093,11 +15993,11 @@ async def SecretsGrant(self, args=None): @ReturnMapping(ErrorResults) - async def SecretsRevoke(self, args=None): + def sync_SecretsRotated(self, args=None): ''' - SecretsRevoke revokes access to a secret for the specified subjects. + SecretsRotated records when secrets were last rotated. - args : typing.Sequence[~GrantRevokeSecretArg] + args : typing.Sequence[~SecretRotatedArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): @@ -11106,11 +16006,11 @@ async def SecretsRevoke(self, args=None): # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='SecretsRevoke', + request='SecretsRotated', version=1, params=_params) _params['args'] = args - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @@ -11138,6 +16038,29 @@ async def SecretsRotated(self, args=None): + @ReturnMapping(ErrorResults) + def sync_UpdateSecrets(self, args=None): + ''' + UpdateSecrets updates the specified secrets. + + args : typing.Sequence[~UpdateSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='UpdateSecrets', + version=1, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UpdateSecrets(self, args=None): ''' @@ -11161,6 +16084,29 @@ async def UpdateSecrets(self, args=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchConsumedSecretsChanges(self, entities=None): + ''' + WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='WatchConsumedSecretsChanges', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchConsumedSecretsChanges(self, entities=None): ''' @@ -11184,6 +16130,35 @@ async def WatchConsumedSecretsChanges(self, entities=None): + @ReturnMapping(StringsWatchResult) + def sync_WatchObsolete(self, entities=None): + ''' + WatchObsolete returns a watcher for notifying when: + - a secret owned by the entity is deleted + - a secret revision owed by the entity no longer + has any consumers + + Obsolete revisions results are "uri/revno" and deleted + secret results are "uri". + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResult + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='WatchObsolete', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchObsolete(self, entities=None): ''' @@ -11213,6 +16188,29 @@ async def WatchObsolete(self, entities=None): + @ReturnMapping(SecretTriggerWatchResult) + def sync_WatchSecretRevisionsExpiryChanges(self, entities=None): + ''' + WatchSecretRevisionsExpiryChanges sets up a watcher to notify of changes to secret revision expiry config. + + entities : typing.Sequence[~Entity] + Returns -> SecretTriggerWatchResult + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='WatchSecretRevisionsExpiryChanges', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretTriggerWatchResult) async def WatchSecretRevisionsExpiryChanges(self, entities=None): ''' @@ -11236,6 +16234,29 @@ async def WatchSecretRevisionsExpiryChanges(self, entities=None): + @ReturnMapping(SecretTriggerWatchResult) + def sync_WatchSecretsRotationChanges(self, entities=None): + ''' + WatchSecretsRotationChanges sets up a watcher to notify of changes to secret rotation config. + + entities : typing.Sequence[~Entity] + Returns -> SecretTriggerWatchResult + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='WatchSecretsRotationChanges', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretTriggerWatchResult) async def WatchSecretsRotationChanges(self, entities=None): ''' @@ -11296,6 +16317,29 @@ class SecretsRevisionWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(SecretRevisionWatchResult) + def sync_Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvSecretRotationWatcher. + + + Returns -> SecretRevisionWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsRevisionWatcher', + request='Next', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretRevisionWatchResult) async def Next(self): ''' @@ -11319,6 +16363,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsRevisionWatcher', + request='Stop', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -11352,6 +16417,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class SecretsTriggerWatcherFacade(Type): @@ -11394,6 +16470,29 @@ class SecretsTriggerWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(SecretTriggerWatchResult) + def sync_Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvSecretRotationWatcher. + + + Returns -> SecretTriggerWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsTriggerWatcher', + request='Next', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretTriggerWatchResult) async def Next(self): ''' @@ -11417,6 +16516,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsTriggerWatcher', + request='Stop', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -11450,6 +16570,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class StringsWatcherFacade(Type): @@ -11483,6 +16614,29 @@ class StringsWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(StringsWatchResult) + def sync_Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvStringsWatcher. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='StringsWatcher', + request='Next', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def Next(self): ''' @@ -11506,6 +16660,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='StringsWatcher', + request='Stop', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -11539,6 +16714,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class UndertakerFacade(Type): @@ -11734,6 +16920,29 @@ class UndertakerFacade(Type): 'type': 'object'} + @ReturnMapping(CloudSpecResults) + def sync_CloudSpec(self, entities=None): + ''' + CloudSpec returns the model's cloud spec. + + entities : typing.Sequence[~Entity] + Returns -> CloudSpecResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='CloudSpec', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CloudSpecResults) async def CloudSpec(self, entities=None): ''' @@ -11757,6 +16966,27 @@ async def CloudSpec(self, entities=None): + @ReturnMapping(CloudSpecResult) + def sync_GetCloudSpec(self): + ''' + GetCloudSpec constructs the CloudSpec for a validated and authorized model. + + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='GetCloudSpec', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CloudSpecResult) async def GetCloudSpec(self): ''' @@ -11778,6 +17008,27 @@ async def GetCloudSpec(self): + @ReturnMapping(ModelConfigResult) + def sync_ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='ModelConfig', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelConfigResult) async def ModelConfig(self): ''' @@ -11799,6 +17050,27 @@ async def ModelConfig(self): + @ReturnMapping(UndertakerModelInfoResult) + def sync_ModelInfo(self): + ''' + ModelInfo returns information on the model needed by the undertaker worker. + + + Returns -> UndertakerModelInfoResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='ModelInfo', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UndertakerModelInfoResult) async def ModelInfo(self): ''' @@ -11811,7 +17083,51 @@ async def ModelInfo(self): # map input types to rpc msg _params = dict() msg = dict(type='Undertaker', - request='ModelInfo', + request='ModelInfo', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + def sync_ProcessDyingModel(self): + ''' + ProcessDyingModel checks if a dying model has any machines or applications. + If there are none, the model's life is changed from dying to dead. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='ProcessDyingModel', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ProcessDyingModel(self): + ''' + ProcessDyingModel checks if a dying model has any machines or applications. + If there are none, the model's life is changed from dying to dead. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='ProcessDyingModel', version=1, params=_params) @@ -11821,10 +17137,9 @@ async def ModelInfo(self): @ReturnMapping(None) - async def ProcessDyingModel(self): + def sync_RemoveModel(self): ''' - ProcessDyingModel checks if a dying model has any machines or applications. - If there are none, the model's life is changed from dying to dead. + RemoveModel removes any records of this model from Juju. Returns -> None @@ -11833,11 +17148,11 @@ async def ProcessDyingModel(self): # map input types to rpc msg _params = dict() msg = dict(type='Undertaker', - request='ProcessDyingModel', + request='RemoveModel', version=1, params=_params) - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @@ -11863,6 +17178,29 @@ async def RemoveModel(self): + @ReturnMapping(ErrorResults) + def sync_SetStatus(self, entities=None): + ''' + SetStatus sets the status of each given entity. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='SetStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetStatus(self, entities=None): ''' @@ -11886,6 +17224,29 @@ async def SetStatus(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchCloudSpecsChanges(self, entities=None): + ''' + WatchCloudSpecsChanges returns a watcher for cloud spec changes. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='WatchCloudSpecsChanges', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchCloudSpecsChanges(self, entities=None): ''' @@ -11909,6 +17270,31 @@ async def WatchCloudSpecsChanges(self, entities=None): + @ReturnMapping(NotifyWatchResult) + def sync_WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='WatchForModelConfigChanges', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchForModelConfigChanges(self): ''' @@ -11934,6 +17320,27 @@ async def WatchForModelConfigChanges(self): + @ReturnMapping(NotifyWatchResults) + def sync_WatchModel(self): + ''' + WatchModel creates a watcher for the current model. + + + Returns -> NotifyWatchResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='WatchModel', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchModel(self): ''' @@ -11955,6 +17362,28 @@ async def WatchModel(self): + @ReturnMapping(NotifyWatchResults) + def sync_WatchModelResources(self): + ''' + WatchModelResources creates watchers for changes to the lifecycle of an + model's machines and applications and storage. + + + Returns -> NotifyWatchResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='WatchModelResources', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchModelResources(self): ''' @@ -12058,6 +17487,30 @@ class UnitAssignerFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_AssignUnits(self, entities=None): + ''' + AssignUnits assigns the units with the given ids to the correct machine. The + error results are returned in the same order as the given entities. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UnitAssigner', + request='AssignUnits', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def AssignUnits(self, entities=None): ''' @@ -12082,6 +17535,30 @@ async def AssignUnits(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetAgentStatus(self, entities=None): + ''' + SetAgentStatus will set status for agents of Units passed in args, if one + of the args is not an Unit it will fail. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UnitAssigner', + request='SetAgentStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetAgentStatus(self, entities=None): ''' @@ -12106,6 +17583,28 @@ async def SetAgentStatus(self, entities=None): + @ReturnMapping(StringsWatchResult) + def sync_WatchUnitAssignments(self): + ''' + WatchUnitAssignments returns a strings watcher that is notified when new unit + assignments are added to the db. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='UnitAssigner', + request='WatchUnitAssignments', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchUnitAssignments(self): ''' @@ -12252,6 +17751,27 @@ class UpgraderFacade(Type): 'type': 'object'} + @ReturnMapping(VersionResults) + def sync_DesiredVersion(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> VersionResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Upgrader', + request='DesiredVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(VersionResults) async def DesiredVersion(self, entities=None): ''' @@ -12264,41 +17784,104 @@ async def DesiredVersion(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Upgrader', - request='DesiredVersion', + request='DesiredVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetTools(self, agent_tools=None): + ''' + agent_tools : typing.Sequence[~EntityVersion] + Returns -> ErrorResults + ''' + if agent_tools is not None and not isinstance(agent_tools, (bytes, str, list)): + raise Exception("Expected agent_tools to be a Sequence, received: {}".format(type(agent_tools))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Upgrader', + request='SetTools', + version=1, + params=_params) + _params['agent-tools'] = agent_tools + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetTools(self, agent_tools=None): + ''' + agent_tools : typing.Sequence[~EntityVersion] + Returns -> ErrorResults + ''' + if agent_tools is not None and not isinstance(agent_tools, (bytes, str, list)): + raise Exception("Expected agent_tools to be a Sequence, received: {}".format(type(agent_tools))) + + # 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) + def sync_Tools(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> ToolsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # 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) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetTools(self, agent_tools=None): + @ReturnMapping(ToolsResults) + async def Tools(self, entities=None): ''' - agent_tools : typing.Sequence[~EntityVersion] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> ToolsResults ''' - if agent_tools is not None and not isinstance(agent_tools, (bytes, str, list)): - raise Exception("Expected agent_tools to be a Sequence, received: {}".format(type(agent_tools))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Upgrader', - request='SetTools', + request='Tools', version=1, params=_params) - _params['agent-tools'] = agent_tools + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ToolsResults) - async def Tools(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchAPIVersion(self, entities=None): ''' entities : typing.Sequence[~Entity] - Returns -> ToolsResults + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -12306,11 +17889,11 @@ async def Tools(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Upgrader', - request='Tools', + request='WatchAPIVersion', version=1, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @@ -12552,6 +18135,29 @@ class UserSecretsDrainFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_ChangeSecretBackend(self, args=None): + ''' + ChangeSecretBackend updates the backend for the specified secret after migration done. + + args : typing.Sequence[~ChangeSecretBackendArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserSecretsDrain', + request='ChangeSecretBackend', + version=1, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ChangeSecretBackend(self, args=None): ''' @@ -12575,6 +18181,34 @@ async def ChangeSecretBackend(self, args=None): + @ReturnMapping(SecretBackendConfigResults) + def sync_GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): + ''' + GetSecretBackendConfigs gets the config needed to create a client to secret backends for the drain worker. + + backend_ids : typing.Sequence[str] + for_drain : bool + Returns -> SecretBackendConfigResults + ''' + if backend_ids is not None and not isinstance(backend_ids, (bytes, str, list)): + raise Exception("Expected backend_ids to be a Sequence, received: {}".format(type(backend_ids))) + + if for_drain is not None and not isinstance(for_drain, bool): + raise Exception("Expected for_drain to be a bool, received: {}".format(type(for_drain))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserSecretsDrain', + request='GetSecretBackendConfigs', + version=1, + params=_params) + _params['backend-ids'] = backend_ids + _params['for-drain'] = for_drain + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretBackendConfigResults) async def GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): ''' @@ -12603,6 +18237,29 @@ async def GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): + @ReturnMapping(SecretContentResults) + def sync_GetSecretContentInfo(self, args=None): + ''' + GetSecretContentInfo returns the secret values for the specified secrets. + + args : typing.Sequence[~GetSecretContentArg] + Returns -> SecretContentResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserSecretsDrain', + request='GetSecretContentInfo', + version=1, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretContentResults) async def GetSecretContentInfo(self, args=None): ''' @@ -12626,6 +18283,39 @@ async def GetSecretContentInfo(self, args=None): + @ReturnMapping(SecretContentResults) + def sync_GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): + ''' + GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. + + pending_delete : bool + revisions : typing.Sequence[int] + uri : str + Returns -> SecretContentResults + ''' + if pending_delete is not None and not isinstance(pending_delete, bool): + raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) + + if revisions is not None and not isinstance(revisions, (bytes, str, list)): + raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserSecretsDrain', + request='GetSecretRevisionContentInfo', + version=1, + params=_params) + _params['pending-delete'] = pending_delete + _params['revisions'] = revisions + _params['uri'] = uri + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretContentResults) async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): ''' @@ -12659,6 +18349,27 @@ async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None + @ReturnMapping(ListSecretResults) + def sync_GetSecretsToDrain(self): + ''' + GetSecretsToDrain returns metadata for the secrets that need to be drained. + + + Returns -> ListSecretResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserSecretsDrain', + request='GetSecretsToDrain', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ListSecretResults) async def GetSecretsToDrain(self): ''' @@ -12680,6 +18391,27 @@ async def GetSecretsToDrain(self): + @ReturnMapping(NotifyWatchResult) + def sync_WatchSecretBackendChanged(self): + ''' + WatchSecretBackendChanged sets up a watcher to notify of changes to the secret backend. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserSecretsDrain', + request='WatchSecretBackendChanged', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchSecretBackendChanged(self): ''' @@ -12759,6 +18491,29 @@ class UserSecretsManagerFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_DeleteRevisions(self, args=None): + ''' + DeleteRevisions deletes the specified revisions of the specified secret. + + args : typing.Sequence[~DeleteSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserSecretsManager', + request='DeleteRevisions', + version=1, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def DeleteRevisions(self, args=None): ''' @@ -12782,6 +18537,29 @@ async def DeleteRevisions(self, args=None): + @ReturnMapping(StringsWatchResult) + def sync_WatchRevisionsToPrune(self): + ''' + WatchRevisionsToPrune returns a watcher for notifying when: + - a secret revision owned by the model no longer + has any consumers and should be pruned. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserSecretsManager', + request='WatchRevisionsToPrune', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchRevisionsToPrune(self): ''' @@ -12843,6 +18621,29 @@ class VolumeAttachmentPlansWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(MachineStorageIdsWatchResult) + def sync_Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvMachineStorageIdsWatcher. + + + Returns -> MachineStorageIdsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='VolumeAttachmentPlansWatcher', + request='Next', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MachineStorageIdsWatchResult) async def Next(self): ''' @@ -12866,6 +18667,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='VolumeAttachmentPlansWatcher', + request='Stop', + version=1, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -12899,4 +18721,15 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + diff --git a/juju/client/_client10.py b/juju/client/_client10.py index 2700cef3..e357f857 100644 --- a/juju/client/_client10.py +++ b/juju/client/_client10.py @@ -364,6 +364,30 @@ class MachineManagerFacade(Type): 'type': 'object'} + @ReturnMapping(AddMachinesResults) + def sync_AddMachines(self, params=None): + ''' + AddMachines adds new machines with the supplied parameters. + The args will contain Base info. + + params : typing.Sequence[~AddMachineParams] + Returns -> AddMachinesResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineManager', + request='AddMachines', + version=10, + params=_params) + _params['params'] = params + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AddMachinesResults) async def AddMachines(self, params=None): ''' @@ -388,6 +412,49 @@ async def AddMachines(self, params=None): + @ReturnMapping(DestroyMachineResults) + def sync_DestroyMachineWithParams(self, dry_run=None, force=None, keep=None, machine_tags=None, max_wait=None): + ''' + DestroyMachineWithParams removes a set of machines from the model. + + dry_run : bool + force : bool + keep : bool + machine_tags : typing.Sequence[str] + max_wait : int + Returns -> DestroyMachineResults + ''' + if dry_run is not None and not isinstance(dry_run, bool): + raise Exception("Expected dry_run to be a bool, received: {}".format(type(dry_run))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if keep is not None and not isinstance(keep, bool): + raise Exception("Expected keep to be a bool, received: {}".format(type(keep))) + + if machine_tags is not None and not isinstance(machine_tags, (bytes, str, list)): + raise Exception("Expected machine_tags to be a Sequence, received: {}".format(type(machine_tags))) + + if max_wait is not None and not isinstance(max_wait, int): + raise Exception("Expected max_wait to be a int, received: {}".format(type(max_wait))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineManager', + request='DestroyMachineWithParams', + version=10, + params=_params) + _params['dry-run'] = dry_run + _params['force'] = force + _params['keep'] = keep + _params['machine-tags'] = machine_tags + _params['max-wait'] = max_wait + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(DestroyMachineResults) async def DestroyMachineWithParams(self, dry_run=None, force=None, keep=None, machine_tags=None, max_wait=None): ''' @@ -431,6 +498,31 @@ async def DestroyMachineWithParams(self, dry_run=None, force=None, keep=None, ma + @ReturnMapping(StringsResults) + def sync_GetUpgradeSeriesMessages(self, params=None): + ''' + GetUpgradeSeriesMessages returns all new messages associated with upgrade + series events. Messages that have already been retrieved once are not + returned by this method. + + params : typing.Sequence[~UpgradeSeriesNotificationParam] + Returns -> StringsResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineManager', + request='GetUpgradeSeriesMessages', + version=10, + params=_params) + _params['params'] = params + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsResults) async def GetUpgradeSeriesMessages(self, params=None): ''' @@ -456,6 +548,30 @@ async def GetUpgradeSeriesMessages(self, params=None): + @ReturnMapping(InstanceTypesResults) + def sync_InstanceTypes(self, constraints=None): + ''' + InstanceTypes returns instance type information for the cloud and region + in which the current model is deployed. + + constraints : typing.Sequence[~ModelInstanceTypesConstraint] + Returns -> InstanceTypesResults + ''' + if constraints is not None and not isinstance(constraints, (bytes, str, list)): + raise Exception("Expected constraints to be a Sequence, received: {}".format(type(constraints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineManager', + request='InstanceTypes', + version=10, + params=_params) + _params['constraints'] = constraints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(InstanceTypesResults) async def InstanceTypes(self, constraints=None): ''' @@ -480,6 +596,45 @@ async def InstanceTypes(self, constraints=None): + @ReturnMapping(ProvisioningScriptResult) + def sync_ProvisioningScript(self, data_dir=None, disable_package_commands=None, machine_id=None, nonce=None): + ''' + ProvisioningScript returns a shell script that, when run, + provisions a machine agent on the machine executing the script. + + data_dir : str + disable_package_commands : bool + machine_id : str + nonce : str + Returns -> ProvisioningScriptResult + ''' + if data_dir is not None and not isinstance(data_dir, (bytes, str)): + raise Exception("Expected data_dir to be a str, received: {}".format(type(data_dir))) + + if disable_package_commands is not None and not isinstance(disable_package_commands, bool): + raise Exception("Expected disable_package_commands to be a bool, received: {}".format(type(disable_package_commands))) + + if machine_id is not None and not isinstance(machine_id, (bytes, str)): + raise Exception("Expected machine_id to be a str, received: {}".format(type(machine_id))) + + if nonce is not None and not isinstance(nonce, (bytes, str)): + raise Exception("Expected nonce to be a str, received: {}".format(type(nonce))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineManager', + request='ProvisioningScript', + version=10, + params=_params) + _params['data-dir'] = data_dir + _params['disable-package-commands'] = disable_package_commands + _params['machine-id'] = machine_id + _params['nonce'] = nonce + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ProvisioningScriptResult) async def ProvisioningScript(self, data_dir=None, disable_package_commands=None, machine_id=None, nonce=None): ''' @@ -519,6 +674,34 @@ async def ProvisioningScript(self, data_dir=None, disable_package_commands=None, + @ReturnMapping(ErrorResults) + def sync_RetryProvisioning(self, all_=None, machines=None): + ''' + RetryProvisioning marks a provisioning error as transient on the machines. + + all_ : bool + machines : typing.Sequence[str] + Returns -> ErrorResults + ''' + if all_ is not None and not isinstance(all_, bool): + raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + + if machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineManager', + request='RetryProvisioning', + version=10, + params=_params) + _params['all'] = all_ + _params['machines'] = machines + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def RetryProvisioning(self, all_=None, machines=None): ''' @@ -547,6 +730,40 @@ async def RetryProvisioning(self, all_=None, machines=None): + @ReturnMapping(ErrorResult) + def sync_UpgradeSeriesComplete(self, channel=None, force=None, tag=None): + ''' + UpgradeSeriesComplete marks a machine as having completed a managed series + upgrade. + + channel : str + force : bool + tag : Entity + Returns -> ErrorResult + ''' + if channel is not None and not isinstance(channel, (bytes, str)): + raise Exception("Expected channel to be a str, received: {}".format(type(channel))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if tag is not None and not isinstance(tag, (dict, Entity)): + raise Exception("Expected tag to be a Entity, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineManager', + request='UpgradeSeriesComplete', + version=10, + params=_params) + _params['channel'] = channel + _params['force'] = force + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResult) async def UpgradeSeriesComplete(self, channel=None, force=None, tag=None): ''' @@ -581,6 +798,39 @@ async def UpgradeSeriesComplete(self, channel=None, force=None, tag=None): + @ReturnMapping(ErrorResult) + def sync_UpgradeSeriesPrepare(self, channel=None, force=None, tag=None): + ''' + UpgradeSeriesPrepare prepares a machine for a OS series upgrade. + + channel : str + force : bool + tag : Entity + Returns -> ErrorResult + ''' + if channel is not None and not isinstance(channel, (bytes, str)): + raise Exception("Expected channel to be a str, received: {}".format(type(channel))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if tag is not None and not isinstance(tag, (dict, Entity)): + raise Exception("Expected tag to be a Entity, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineManager', + request='UpgradeSeriesPrepare', + version=10, + params=_params) + _params['channel'] = channel + _params['force'] = force + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResult) async def UpgradeSeriesPrepare(self, channel=None, force=None, tag=None): ''' @@ -614,6 +864,32 @@ async def UpgradeSeriesPrepare(self, channel=None, force=None, tag=None): + @ReturnMapping(UpgradeSeriesUnitsResults) + def sync_UpgradeSeriesValidate(self, args=None): + ''' + UpgradeSeriesValidate validates that the incoming arguments correspond to a + valid series upgrade for the target machine. + If they do, a list of the machine's current units is returned for use in + soliciting user confirmation of the command. + + args : typing.Sequence[~UpdateChannelArg] + Returns -> UpgradeSeriesUnitsResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineManager', + request='UpgradeSeriesValidate', + version=10, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UpgradeSeriesUnitsResults) async def UpgradeSeriesValidate(self, args=None): ''' @@ -640,6 +916,30 @@ async def UpgradeSeriesValidate(self, args=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchUpgradeSeriesNotifications(self, entities=None): + ''' + WatchUpgradeSeriesNotifications returns a watcher that fires on upgrade + series events. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineManager', + request='WatchUpgradeSeriesNotifications', + version=10, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchUpgradeSeriesNotifications(self, entities=None): ''' @@ -1212,6 +1512,30 @@ class ModelManagerFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_ChangeModelCredential(self, model_credentials=None): + ''' + ChangeModelCredential changes cloud credential reference for models. + These new cloud credentials must already exist on the controller. + + model_credentials : typing.Sequence[~ChangeModelCredentialParams] + Returns -> ErrorResults + ''' + if model_credentials is not None and not isinstance(model_credentials, (bytes, str, list)): + raise Exception("Expected model_credentials to be a Sequence, received: {}".format(type(model_credentials))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ChangeModelCredential', + version=10, + params=_params) + _params['model-credentials'] = model_credentials + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ChangeModelCredential(self, model_credentials=None): ''' @@ -1236,6 +1560,55 @@ async def ChangeModelCredential(self, model_credentials=None): + @ReturnMapping(ModelInfo) + def sync_CreateModel(self, cloud_tag=None, config=None, credential=None, name=None, owner_tag=None, region=None): + ''' + CreateModel creates a new model using the account and + model config specified in the args. + + cloud_tag : str + config : typing.Mapping[str, typing.Any] + credential : str + name : str + owner_tag : str + region : str + Returns -> ModelInfo + ''' + if cloud_tag is not None and not isinstance(cloud_tag, (bytes, str)): + raise Exception("Expected cloud_tag to be a str, received: {}".format(type(cloud_tag))) + + if config is not None and not isinstance(config, dict): + raise Exception("Expected config to be a Mapping, received: {}".format(type(config))) + + if credential is not None and not isinstance(credential, (bytes, str)): + raise Exception("Expected credential to be a str, received: {}".format(type(credential))) + + if name is not None and not isinstance(name, (bytes, str)): + raise Exception("Expected name to be a str, received: {}".format(type(name))) + + if owner_tag is not None and not isinstance(owner_tag, (bytes, str)): + raise Exception("Expected owner_tag to be a str, received: {}".format(type(owner_tag))) + + if region is not None and not isinstance(region, (bytes, str)): + raise Exception("Expected region to be a str, received: {}".format(type(region))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='CreateModel', + version=10, + params=_params) + _params['cloud-tag'] = cloud_tag + _params['config'] = config + _params['credential'] = credential + _params['name'] = name + _params['owner-tag'] = owner_tag + _params['region'] = region + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelInfo) async def CreateModel(self, cloud_tag=None, config=None, credential=None, name=None, owner_tag=None, region=None): ''' @@ -1285,6 +1658,31 @@ async def CreateModel(self, cloud_tag=None, config=None, credential=None, name=N + @ReturnMapping(ErrorResults) + def sync_DestroyModels(self, models=None): + ''' + DestroyModels will try to destroy the specified models. + If there is a block on destruction, this method will return an error. + From ModelManager v7 onwards, DestroyModels gains 'force' and 'max-wait' parameters. + + models : typing.Sequence[~DestroyModelParams] + Returns -> ErrorResults + ''' + if models is not None and not isinstance(models, (bytes, str, list)): + raise Exception("Expected models to be a Sequence, received: {}".format(type(models))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='DestroyModels', + version=10, + params=_params) + _params['models'] = models + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def DestroyModels(self, models=None): ''' @@ -1310,6 +1708,36 @@ async def DestroyModels(self, models=None): + @ReturnMapping(StringResults) + def sync_DumpModels(self, entities=None, simplified=None): + ''' + DumpModels will export the models into the database agnostic + representation. The user needs to either be a controller admin, or have + admin privileges on the model itself. + + entities : typing.Sequence[~Entity] + simplified : bool + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + if simplified is not None and not isinstance(simplified, bool): + raise Exception("Expected simplified to be a bool, received: {}".format(type(simplified))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='DumpModels', + version=10, + params=_params) + _params['entities'] = entities + _params['simplified'] = simplified + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def DumpModels(self, entities=None, simplified=None): ''' @@ -1340,6 +1768,31 @@ async def DumpModels(self, entities=None, simplified=None): + @ReturnMapping(MapResults) + def sync_DumpModelsDB(self, entities=None): + ''' + DumpModelsDB will gather all documents from all model collections + for the specified model. The map result contains a map of collection + names to lists of documents represented as maps. + + entities : typing.Sequence[~Entity] + Returns -> MapResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='DumpModelsDB', + version=10, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MapResults) async def DumpModelsDB(self, entities=None): ''' @@ -1365,6 +1818,37 @@ async def DumpModelsDB(self, entities=None): + @ReturnMapping(ModelSummaryResults) + def sync_ListModelSummaries(self, all_=None, user_tag=None): + ''' + ListModelSummaries returns models that the specified user + has access to in the current server. Controller admins (superuser) + can list models for any user. Other users + can only ask about their own models. + + all_ : bool + user_tag : str + Returns -> ModelSummaryResults + ''' + if all_ is not None and not isinstance(all_, bool): + raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + + if user_tag is not None and not isinstance(user_tag, (bytes, str)): + raise Exception("Expected user_tag to be a str, received: {}".format(type(user_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ListModelSummaries', + version=10, + params=_params) + _params['all'] = all_ + _params['user-tag'] = user_tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelSummaryResults) async def ListModelSummaries(self, all_=None, user_tag=None): ''' @@ -1396,6 +1880,32 @@ async def ListModelSummaries(self, all_=None, user_tag=None): + @ReturnMapping(UserModelList) + def sync_ListModels(self, tag=None): + ''' + ListModels returns the models that the specified user + has access to in the current server. Controller admins (superuser) + can list models for any user. Other users + can only ask about their own models. + + tag : str + Returns -> UserModelList + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ListModels', + version=10, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UserModelList) async def ListModels(self, tag=None): ''' @@ -1422,6 +1932,30 @@ async def ListModels(self, tag=None): + @ReturnMapping(ModelDefaultsResults) + def sync_ModelDefaultsForClouds(self, entities=None): + ''' + ModelDefaultsForClouds returns the default config values for the specified + clouds. + + entities : typing.Sequence[~Entity] + Returns -> ModelDefaultsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModelDefaultsForClouds', + version=10, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelDefaultsResults) async def ModelDefaultsForClouds(self, entities=None): ''' @@ -1446,6 +1980,29 @@ async def ModelDefaultsForClouds(self, entities=None): + @ReturnMapping(ModelInfoResults) + def sync_ModelInfo(self, entities=None): + ''' + ModelInfo returns information about the specified models. + + entities : typing.Sequence[~Entity] + Returns -> ModelInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModelInfo', + version=10, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelInfoResults) async def ModelInfo(self, entities=None): ''' @@ -1469,6 +2026,29 @@ async def ModelInfo(self, entities=None): + @ReturnMapping(ModelStatusResults) + def sync_ModelStatus(self, entities=None): + ''' + ModelStatus returns a summary of the model. + + entities : typing.Sequence[~Entity] + Returns -> ModelStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModelStatus', + version=10, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelStatusResults) async def ModelStatus(self, entities=None): ''' @@ -1492,6 +2072,29 @@ async def ModelStatus(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_ModifyModelAccess(self, changes=None): + ''' + ModifyModelAccess changes the model access granted to users. + + changes : typing.Sequence[~ModifyModelAccess] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModifyModelAccess', + version=10, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ModifyModelAccess(self, changes=None): ''' @@ -1515,6 +2118,29 @@ async def ModifyModelAccess(self, changes=None): + @ReturnMapping(ErrorResults) + def sync_SetModelDefaults(self, config=None): + ''' + SetModelDefaults writes new values for the specified default model settings. + + config : typing.Sequence[~ModelDefaultValues] + Returns -> ErrorResults + ''' + if config is not None and not isinstance(config, (bytes, str, list)): + raise Exception("Expected config to be a Sequence, received: {}".format(type(config))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='SetModelDefaults', + version=10, + params=_params) + _params['config'] = config + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetModelDefaults(self, config=None): ''' @@ -1538,6 +2164,29 @@ async def SetModelDefaults(self, config=None): + @ReturnMapping(ErrorResults) + def sync_UnsetModelDefaults(self, keys=None): + ''' + UnsetModelDefaults removes the specified default model settings. + + keys : typing.Sequence[~ModelUnsetKeys] + Returns -> ErrorResults + ''' + if keys is not None and not isinstance(keys, (bytes, str, list)): + raise Exception("Expected keys to be a Sequence, received: {}".format(type(keys))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='UnsetModelDefaults', + version=10, + params=_params) + _params['keys'] = keys + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UnsetModelDefaults(self, keys=None): ''' diff --git a/juju/client/_client11.py b/juju/client/_client11.py index bdc5317b..7552b1dd 100644 --- a/juju/client/_client11.py +++ b/juju/client/_client11.py @@ -568,6 +568,28 @@ class ControllerFacade(Type): 'type': 'object'} + @ReturnMapping(UserModelList) + def sync_AllModels(self): + ''' + AllModels allows controller administrators to get the list of all the + models in the controller. + + + Returns -> UserModelList + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='AllModels', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UserModelList) async def AllModels(self): ''' @@ -590,6 +612,29 @@ async def AllModels(self): + @ReturnMapping(CloudSpecResults) + def sync_CloudSpec(self, entities=None): + ''' + CloudSpec returns the model's cloud spec. + + entities : typing.Sequence[~Entity] + Returns -> CloudSpecResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='CloudSpec', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CloudSpecResults) async def CloudSpec(self, entities=None): ''' @@ -613,6 +658,31 @@ async def CloudSpec(self, entities=None): + @ReturnMapping(None) + def sync_ConfigSet(self, config=None): + ''' + ConfigSet changes the value of specified controller configuration + settings. Only some settings can be changed after bootstrap. + Settings that aren't specified in the params are left unchanged. + + config : typing.Mapping[str, typing.Any] + Returns -> None + ''' + if config is not None and not isinstance(config, dict): + raise Exception("Expected config to be a Mapping, received: {}".format(type(config))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ConfigSet', + version=11, + params=_params) + _params['config'] = config + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def ConfigSet(self, config=None): ''' @@ -638,6 +708,29 @@ async def ConfigSet(self, config=None): + @ReturnMapping(ControllerAPIInfoResults) + def sync_ControllerAPIInfoForModels(self, entities=None): + ''' + ControllerAPIInfoForModels returns the controller api connection details for the specified models. + + entities : typing.Sequence[~Entity] + Returns -> ControllerAPIInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ControllerAPIInfoForModels', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ControllerAPIInfoResults) async def ControllerAPIInfoForModels(self, entities=None): ''' @@ -661,6 +754,27 @@ async def ControllerAPIInfoForModels(self, entities=None): + @ReturnMapping(ControllerConfigResult) + def sync_ControllerConfig(self): + ''' + ControllerConfig returns the controller's configuration. + + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ControllerConfig', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ControllerConfigResult) async def ControllerConfig(self): ''' @@ -682,6 +796,31 @@ async def ControllerConfig(self): + @ReturnMapping(ControllerVersionResults) + def sync_ControllerVersion(self): + ''' + ControllerVersion returns the version information associated with this + controller binary. + + NOTE: the implementation intentionally does not check for SuperuserAccess + as the Version is known even to users with login access. + + + Returns -> ControllerVersionResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ControllerVersion', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ControllerVersionResults) async def ControllerVersion(self): ''' @@ -707,6 +846,28 @@ async def ControllerVersion(self): + @ReturnMapping(DashboardConnectionInfo) + def sync_DashboardConnectionInfo(self): + ''' + DashboardConnectionInfo returns the connection information for a client to + connect to the Juju Dashboard including any proxying information. + + + Returns -> DashboardConnectionInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='DashboardConnectionInfo', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(DashboardConnectionInfo) async def DashboardConnectionInfo(self): ''' @@ -729,6 +890,54 @@ async def DashboardConnectionInfo(self): + @ReturnMapping(None) + def sync_DestroyController(self, destroy_models=None, destroy_storage=None, force=None, max_wait=None, model_timeout=None): + ''' + DestroyController destroys the controller. + + If the args specify the destruction of the models, this method will + attempt to do so. Otherwise, if the controller has any non-empty, + non-Dead hosted models, then an error with the code + params.CodeHasHostedModels will be transmitted. + + destroy_models : bool + destroy_storage : bool + force : bool + max_wait : int + model_timeout : int + Returns -> None + ''' + if destroy_models is not None and not isinstance(destroy_models, bool): + raise Exception("Expected destroy_models to be a bool, received: {}".format(type(destroy_models))) + + if destroy_storage is not None and not isinstance(destroy_storage, bool): + raise Exception("Expected destroy_storage to be a bool, received: {}".format(type(destroy_storage))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if max_wait is not None and not isinstance(max_wait, int): + raise Exception("Expected max_wait to be a int, received: {}".format(type(max_wait))) + + if model_timeout is not None and not isinstance(model_timeout, int): + raise Exception("Expected model_timeout to be a int, received: {}".format(type(model_timeout))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='DestroyController', + version=11, + params=_params) + _params['destroy-models'] = destroy_models + _params['destroy-storage'] = destroy_storage + _params['force'] = force + _params['max-wait'] = max_wait + _params['model-timeout'] = model_timeout + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def DestroyController(self, destroy_models=None, destroy_storage=None, force=None, max_wait=None, model_timeout=None): ''' @@ -777,6 +986,27 @@ async def DestroyController(self, destroy_models=None, destroy_storage=None, for + @ReturnMapping(CloudSpecResult) + def sync_GetCloudSpec(self): + ''' + GetCloudSpec constructs the CloudSpec for a validated and authorized model. + + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='GetCloudSpec', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CloudSpecResult) async def GetCloudSpec(self): ''' @@ -798,6 +1028,30 @@ async def GetCloudSpec(self): + @ReturnMapping(UserAccessResults) + def sync_GetControllerAccess(self, entities=None): + ''' + GetControllerAccess returns the level of access the specified users + have on the controller. + + entities : typing.Sequence[~Entity] + Returns -> UserAccessResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='GetControllerAccess', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UserAccessResults) async def GetControllerAccess(self, entities=None): ''' @@ -822,6 +1076,29 @@ async def GetControllerAccess(self, entities=None): + @ReturnMapping(HostedModelConfigsResults) + def sync_HostedModelConfigs(self): + ''' + HostedModelConfigs returns all the information that the client needs in + order to connect directly with the host model's provider and destroy it + directly. + + + Returns -> HostedModelConfigsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='HostedModelConfigs', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(HostedModelConfigsResults) async def HostedModelConfigs(self): ''' @@ -846,7 +1123,33 @@ async def HostedModelConfigs(self): @ReturnMapping(StringResult) - async def IdentityProviderURL(self): + def sync_IdentityProviderURL(self): + ''' + IdentityProviderURL returns the URL of the configured external identity + provider for this controller or an empty string if no external identity + provider has been configured when the controller was bootstrapped. + + NOTE: the implementation intentionally does not check for SuperuserAccess + as the URL is known even to users with login access. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='IdentityProviderURL', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def IdentityProviderURL(self): ''' IdentityProviderURL returns the URL of the configured external identity provider for this controller or an empty string if no external identity @@ -871,6 +1174,30 @@ async def IdentityProviderURL(self): + @ReturnMapping(InitiateMigrationResults) + def sync_InitiateMigration(self, specs=None): + ''' + InitiateMigration attempts to begin the migration of one or + more models to other controllers. + + specs : typing.Sequence[~MigrationSpec] + Returns -> InitiateMigrationResults + ''' + if specs is not None and not isinstance(specs, (bytes, str, list)): + raise Exception("Expected specs to be a Sequence, received: {}".format(type(specs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='InitiateMigration', + version=11, + params=_params) + _params['specs'] = specs + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(InitiateMigrationResults) async def InitiateMigration(self, specs=None): ''' @@ -895,6 +1222,30 @@ async def InitiateMigration(self, specs=None): + @ReturnMapping(ModelBlockInfoList) + def sync_ListBlockedModels(self): + ''' + ListBlockedModels returns a list of all models on the controller + which have a block in place. The resulting slice is sorted by model + name, then owner. Callers must be controller administrators to retrieve the + list. + + + Returns -> ModelBlockInfoList + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ListBlockedModels', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelBlockInfoList) async def ListBlockedModels(self): ''' @@ -919,6 +1270,29 @@ async def ListBlockedModels(self): + @ReturnMapping(ModelConfigResults) + def sync_ModelConfig(self): + ''' + ModelConfig returns the model config for the controller + model. For information on the current model, use + client.ModelGet + + + Returns -> ModelConfigResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ModelConfig', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelConfigResults) async def ModelConfig(self): ''' @@ -942,6 +1316,29 @@ async def ModelConfig(self): + @ReturnMapping(ModelStatusResults) + def sync_ModelStatus(self, entities=None): + ''' + ModelStatus returns a summary of the model. + + entities : typing.Sequence[~Entity] + Returns -> ModelStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ModelStatus', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelStatusResults) async def ModelStatus(self, entities=None): ''' @@ -965,6 +1362,29 @@ async def ModelStatus(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_ModifyControllerAccess(self, changes=None): + ''' + ModifyControllerAccess changes the model access granted to users. + + changes : typing.Sequence[~ModifyControllerAccess] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ModifyControllerAccess', + version=11, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ModifyControllerAccess(self, changes=None): ''' @@ -988,6 +1408,27 @@ async def ModifyControllerAccess(self, changes=None): + @ReturnMapping(StringResult) + def sync_MongoVersion(self): + ''' + MongoVersion allows the introspection of the mongo version per controller + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='MongoVersion', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResult) async def MongoVersion(self): ''' @@ -1009,6 +1450,29 @@ async def MongoVersion(self): + @ReturnMapping(None) + def sync_RemoveBlocks(self, all_=None): + ''' + RemoveBlocks removes all the blocks in the controller. + + all_ : bool + Returns -> None + ''' + if all_ is not None and not isinstance(all_, bool): + raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='RemoveBlocks', + version=11, + params=_params) + _params['all'] = all_ + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def RemoveBlocks(self, all_=None): ''' @@ -1032,6 +1496,29 @@ async def RemoveBlocks(self, all_=None): + @ReturnMapping(SummaryWatcherID) + def sync_WatchAllModelSummaries(self): + ''' + WatchAllModelSummaries starts watching the summary updates from the cache. + This method is superuser access only, and watches all models in the + controller. + + + Returns -> SummaryWatcherID + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='WatchAllModelSummaries', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SummaryWatcherID) async def WatchAllModelSummaries(self): ''' @@ -1055,6 +1542,29 @@ async def WatchAllModelSummaries(self): + @ReturnMapping(AllWatcherId) + def sync_WatchAllModels(self): + ''' + WatchAllModels starts watching events for all models in the + controller. The returned AllWatcherId should be used with Next on the + AllModelWatcher endpoint to receive deltas. + + + Returns -> AllWatcherId + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='WatchAllModels', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AllWatcherId) async def WatchAllModels(self): ''' @@ -1078,6 +1588,29 @@ async def WatchAllModels(self): + @ReturnMapping(NotifyWatchResults) + def sync_WatchCloudSpecsChanges(self, entities=None): + ''' + WatchCloudSpecsChanges returns a watcher for cloud spec changes. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='WatchCloudSpecsChanges', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchCloudSpecsChanges(self, entities=None): ''' @@ -1101,6 +1634,28 @@ async def WatchCloudSpecsChanges(self, entities=None): + @ReturnMapping(SummaryWatcherID) + def sync_WatchModelSummaries(self): + ''' + WatchModelSummaries starts watching the summary updates from the cache. + Only models that the user has access to are returned. + + + Returns -> SummaryWatcherID + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='WatchModelSummaries', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SummaryWatcherID) async def WatchModelSummaries(self): ''' @@ -2290,7 +2845,28 @@ class ProvisionerFacade(Type): @ReturnMapping(StringsResult) - async def APIAddresses(self): + def sync_APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='APIAddresses', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): ''' APIAddresses returns the list of addresses used to connect to the API. @@ -2310,6 +2886,27 @@ async def APIAddresses(self): + @ReturnMapping(APIHostPortsResult) + def sync_APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='APIHostPorts', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(APIHostPortsResult) async def APIHostPorts(self): ''' @@ -2331,6 +2928,29 @@ async def APIHostPorts(self): + @ReturnMapping(StringResults) + def sync_AvailabilityZone(self, entities=None): + ''' + AvailabilityZone returns a provider-specific availability zone for each given machine entity + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='AvailabilityZone', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def AvailabilityZone(self, entities=None): ''' @@ -2354,6 +2974,27 @@ async def AvailabilityZone(self, entities=None): + @ReturnMapping(BytesResult) + def sync_CACert(self): + ''' + CACert returns the certificate used to validate the state connection. + + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='CACert', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(BytesResult) async def CACert(self): ''' @@ -2375,6 +3016,29 @@ async def CACert(self): + @ReturnMapping(ConstraintsResults) + def sync_Constraints(self, entities=None): + ''' + Constraints returns the constraints for each given machine entity. + + entities : typing.Sequence[~Entity] + Returns -> ConstraintsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='Constraints', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ConstraintsResults) async def Constraints(self, entities=None): ''' @@ -2398,6 +3062,28 @@ async def Constraints(self, entities=None): + @ReturnMapping(ContainerConfig) + def sync_ContainerConfig(self): + ''' + ContainerConfig returns information from the model config that is + needed for container cloud-init. + + + Returns -> ContainerConfig + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ContainerConfig', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ContainerConfig) async def ContainerConfig(self): ''' @@ -2420,6 +3106,30 @@ async def ContainerConfig(self): + @ReturnMapping(ContainerManagerConfig) + def sync_ContainerManagerConfig(self, type_=None): + ''' + ContainerManagerConfig returns information from the model config that is + needed for configuring the container manager. + + type_ : str + Returns -> ContainerManagerConfig + ''' + if type_ is not None and not isinstance(type_, (bytes, str)): + raise Exception("Expected type_ to be a str, received: {}".format(type(type_))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ContainerManagerConfig', + version=11, + params=_params) + _params['type'] = type_ + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ContainerManagerConfig) async def ContainerManagerConfig(self, type_=None): ''' @@ -2444,6 +3154,29 @@ async def ContainerManagerConfig(self, type_=None): + @ReturnMapping(ControllerAPIInfoResults) + def sync_ControllerAPIInfoForModels(self, entities=None): + ''' + ControllerAPIInfoForModels returns the controller api connection details for the specified models. + + entities : typing.Sequence[~Entity] + Returns -> ControllerAPIInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ControllerAPIInfoForModels', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ControllerAPIInfoResults) async def ControllerAPIInfoForModels(self, entities=None): ''' @@ -2467,6 +3200,27 @@ async def ControllerAPIInfoForModels(self, entities=None): + @ReturnMapping(ControllerConfigResult) + def sync_ControllerConfig(self): + ''' + ControllerConfig returns the controller's configuration. + + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ControllerConfig', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ControllerConfigResult) async def ControllerConfig(self): ''' @@ -2488,6 +3242,32 @@ async def ControllerConfig(self): + @ReturnMapping(DistributionGroupResults) + def sync_DistributionGroup(self, entities=None): + ''' + DistributionGroup returns, for each given machine entity, + a slice of instance.Ids that belong to the same distribution + group as that machine. This information may be used to + distribute instances for high availability. + + entities : typing.Sequence[~Entity] + Returns -> DistributionGroupResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='DistributionGroup', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(DistributionGroupResults) async def DistributionGroup(self, entities=None): ''' @@ -2514,6 +3294,32 @@ async def DistributionGroup(self, entities=None): + @ReturnMapping(StringsResults) + def sync_DistributionGroupByMachineId(self, entities=None): + ''' + DistributionGroupByMachineId returns, for each given machine entity, + a slice of machine.Ids that belong to the same distribution + group as that machine. This information may be used to + distribute instances for high availability. + + entities : typing.Sequence[~Entity] + Returns -> StringsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='DistributionGroupByMachineId', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsResults) async def DistributionGroupByMachineId(self, entities=None): ''' @@ -2540,6 +3346,31 @@ async def DistributionGroupByMachineId(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_EnsureDead(self, entities=None): + ''' + EnsureDead calls EnsureDead on each given entity from state. It + will fail if the entity is not present. If it's Alive, nothing will + happen (see state/EnsureDead() for units or machines). + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='EnsureDead', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def EnsureDead(self, entities=None): ''' @@ -2566,7 +3397,7 @@ async def EnsureDead(self, entities=None): @ReturnMapping(FindToolsResult) - async def FindTools(self, agentstream=None, arch=None, major=None, number=None, os_type=None): + def sync_FindTools(self, agentstream=None, arch=None, major=None, number=None, os_type=None): ''' FindTools returns a List containing all tools matching the given parameters. @@ -2603,12 +3434,79 @@ async def FindTools(self, agentstream=None, arch=None, major=None, number=None, _params['major'] = major _params['number'] = number _params['os-type'] = os_type - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(MachineNetworkConfigResults) + @ReturnMapping(FindToolsResult) + async def FindTools(self, agentstream=None, arch=None, major=None, number=None, os_type=None): + ''' + FindTools returns a List containing all tools matching the given parameters. + + agentstream : str + arch : str + major : int + number : Number + os_type : str + Returns -> FindToolsResult + ''' + if agentstream is not None and not isinstance(agentstream, (bytes, str)): + raise Exception("Expected agentstream to be a str, received: {}".format(type(agentstream))) + + if arch is not None and not isinstance(arch, (bytes, str)): + raise Exception("Expected arch to be a str, received: {}".format(type(arch))) + + if major is not None and not isinstance(major, int): + raise Exception("Expected major to be a int, received: {}".format(type(major))) + + if number is not None and not isinstance(number, (dict, Number)): + raise Exception("Expected number to be a Number, received: {}".format(type(number))) + + if os_type is not None and not isinstance(os_type, (bytes, str)): + raise Exception("Expected os_type to be a str, received: {}".format(type(os_type))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='FindTools', + version=11, + params=_params) + _params['agentstream'] = agentstream + _params['arch'] = arch + _params['major'] = major + _params['number'] = number + _params['os-type'] = os_type + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) + def sync_GetContainerInterfaceInfo(self, entities=None): + ''' + GetContainerInterfaceInfo returns information to configure networking for a + container. It accepts container tags as arguments. + + entities : typing.Sequence[~Entity] + Returns -> MachineNetworkConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='GetContainerInterfaceInfo', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) async def GetContainerInterfaceInfo(self, entities=None): ''' GetContainerInterfaceInfo returns information to configure networking for a @@ -2632,6 +3530,32 @@ async def GetContainerInterfaceInfo(self, entities=None): + @ReturnMapping(ContainerProfileResults) + def sync_GetContainerProfileInfo(self, entities=None): + ''' + GetContainerProfileInfo returns information to configure a lxd profile(s) for a + container based on the charms deployed to the container. It accepts container + tags as arguments. Unlike machineLXDProfileNames which has the environ + write the lxd profiles and returns the names of profiles already written. + + entities : typing.Sequence[~Entity] + Returns -> ContainerProfileResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='GetContainerProfileInfo', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ContainerProfileResults) async def GetContainerProfileInfo(self, entities=None): ''' @@ -2658,6 +3582,31 @@ async def GetContainerProfileInfo(self, entities=None): + @ReturnMapping(HostNetworkChangeResults) + def sync_HostChangesForContainers(self, entities=None): + ''' + HostChangesForContainers returns the set of changes that need to be done + to the host machine to prepare it for the containers to be created. + Pass in a list of the containers that you want the changes for. + + entities : typing.Sequence[~Entity] + Returns -> HostNetworkChangeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='HostChangesForContainers', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(HostNetworkChangeResults) async def HostChangesForContainers(self, entities=None): ''' @@ -2683,6 +3632,30 @@ async def HostChangesForContainers(self, entities=None): + @ReturnMapping(StringResults) + def sync_InstanceId(self, entities=None): + ''' + InstanceId returns the provider specific instance id for each given + machine or an CodeNotProvisioned error, if not set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='InstanceId', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def InstanceId(self, entities=None): ''' @@ -2707,6 +3680,30 @@ async def InstanceId(self, entities=None): + @ReturnMapping(StatusResults) + def sync_InstanceStatus(self, entities=None): + ''' + InstanceStatus returns the instance status for each given entity. + Only machine tags are accepted. + + entities : typing.Sequence[~Entity] + Returns -> StatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='InstanceStatus', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StatusResults) async def InstanceStatus(self, entities=None): ''' @@ -2731,6 +3728,29 @@ async def InstanceStatus(self, entities=None): + @ReturnMapping(BoolResults) + def sync_KeepInstance(self, entities=None): + ''' + KeepInstance returns the keep-instance value for each given machine entity. + + entities : typing.Sequence[~Entity] + Returns -> BoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='KeepInstance', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(BoolResults) async def KeepInstance(self, entities=None): ''' @@ -2754,6 +3774,29 @@ async def KeepInstance(self, entities=None): + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='Life', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' @@ -2777,6 +3820,28 @@ async def Life(self, entities=None): + @ReturnMapping(StatusResults) + def sync_MachinesWithTransientErrors(self): + ''' + MachinesWithTransientErrors returns status data for machines with provisioning + errors which are transient. + + + Returns -> StatusResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='MachinesWithTransientErrors', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StatusResults) async def MachinesWithTransientErrors(self): ''' @@ -2790,24 +3855,181 @@ async def MachinesWithTransientErrors(self): # map input types to rpc msg _params = dict() msg = dict(type='Provisioner', - request='MachinesWithTransientErrors', + request='MachinesWithTransientErrors', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_MarkMachinesForRemoval(self, entities=None): + ''' + MarkMachinesForRemoval indicates that the specified machines are + ready to have any provider-level resources cleaned up and then be + removed. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='MarkMachinesForRemoval', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def MarkMachinesForRemoval(self, entities=None): + ''' + MarkMachinesForRemoval indicates that the specified machines are + ready to have any provider-level resources cleaned up and then be + removed. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='MarkMachinesForRemoval', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + def sync_ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelConfig', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelConfig', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + def sync_ModelUUID(self): + ''' + ModelUUID returns the model UUID that the current connection is for. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelUUID', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + ModelUUID returns the model UUID that the current connection is for. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelUUID', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) + def sync_PrepareContainerInterfaceInfo(self, entities=None): + ''' + PrepareContainerInterfaceInfo allocates an address and returns information to + configure networking for a container. It accepts container tags as arguments. + + entities : typing.Sequence[~Entity] + Returns -> MachineNetworkConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='PrepareContainerInterfaceInfo', version=11, params=_params) - - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def MarkMachinesForRemoval(self, entities=None): + @ReturnMapping(MachineNetworkConfigResults) + async def PrepareContainerInterfaceInfo(self, entities=None): ''' - MarkMachinesForRemoval indicates that the specified machines are - ready to have any provider-level resources cleaned up and then be - removed. + PrepareContainerInterfaceInfo allocates an address and returns information to + configure networking for a container. It accepts container tags as arguments. entities : typing.Sequence[~Entity] - Returns -> ErrorResults + Returns -> MachineNetworkConfigResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -2815,7 +4037,7 @@ async def MarkMachinesForRemoval(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Provisioner', - request='MarkMachinesForRemoval', + request='PrepareContainerInterfaceInfo', version=11, params=_params) _params['entities'] = entities @@ -2824,56 +4046,63 @@ async def MarkMachinesForRemoval(self, entities=None): - @ReturnMapping(ModelConfigResult) - async def ModelConfig(self): + @ReturnMapping(ProvisioningInfoResults) + def sync_ProvisioningInfo(self, entities=None): ''' - ModelConfig returns the current model's configuration. - + ProvisioningInfo returns the provisioning information for each given machine entity. + It supports all positive space constraints. - Returns -> ModelConfigResult + entities : typing.Sequence[~Entity] + Returns -> ProvisioningInfoResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Provisioner', - request='ModelConfig', + request='ProvisioningInfo', version=11, params=_params) - - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringResult) - async def ModelUUID(self): + @ReturnMapping(ProvisioningInfoResults) + async def ProvisioningInfo(self, entities=None): ''' - ModelUUID returns the model UUID that the current connection is for. - + ProvisioningInfo returns the provisioning information for each given machine entity. + It supports all positive space constraints. - Returns -> StringResult + entities : typing.Sequence[~Entity] + Returns -> ProvisioningInfoResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Provisioner', - request='ModelUUID', + request='ProvisioningInfo', version=11, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(MachineNetworkConfigResults) - async def PrepareContainerInterfaceInfo(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_ReleaseContainerAddresses(self, entities=None): ''' - PrepareContainerInterfaceInfo allocates an address and returns information to - configure networking for a container. It accepts container tags as arguments. + ReleaseContainerAddresses finds addresses allocated to a container and marks + them as Dead, to be released and removed. It accepts container tags as + arguments. entities : typing.Sequence[~Entity] - Returns -> MachineNetworkConfigResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -2881,23 +4110,24 @@ async def PrepareContainerInterfaceInfo(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Provisioner', - request='PrepareContainerInterfaceInfo', + request='ReleaseContainerAddresses', version=11, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ProvisioningInfoResults) - async def ProvisioningInfo(self, entities=None): + @ReturnMapping(ErrorResults) + async def ReleaseContainerAddresses(self, entities=None): ''' - ProvisioningInfo returns the provisioning information for each given machine entity. - It supports all positive space constraints. + ReleaseContainerAddresses finds addresses allocated to a container and marks + them as Dead, to be released and removed. It accepts container tags as + arguments. entities : typing.Sequence[~Entity] - Returns -> ProvisioningInfoResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -2905,7 +4135,7 @@ async def ProvisioningInfo(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Provisioner', - request='ProvisioningInfo', + request='ReleaseContainerAddresses', version=11, params=_params) _params['entities'] = entities @@ -2915,11 +4145,10 @@ async def ProvisioningInfo(self, entities=None): @ReturnMapping(ErrorResults) - async def ReleaseContainerAddresses(self, entities=None): + def sync_Remove(self, entities=None): ''' - ReleaseContainerAddresses finds addresses allocated to a container and marks - them as Dead, to be released and removed. It accepts container tags as - arguments. + Remove removes every given entity from state, calling EnsureDead + first, then Remove. It will fail if the entity is not present. entities : typing.Sequence[~Entity] Returns -> ErrorResults @@ -2930,11 +4159,11 @@ async def ReleaseContainerAddresses(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Provisioner', - request='ReleaseContainerAddresses', + request='Remove', version=11, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @@ -2963,6 +4192,29 @@ async def Remove(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetCharmProfiles(self, args=None): + ''' + SetCharmProfiles records the given slice of charm profile names. + + args : typing.Sequence[~SetProfileArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetCharmProfiles', + version=11, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetCharmProfiles(self, args=None): ''' @@ -2986,6 +4238,32 @@ async def SetCharmProfiles(self, args=None): + @ReturnMapping(None) + def sync_SetHostMachineNetworkConfig(self, config=None, tag=None): + ''' + config : typing.Sequence[~NetworkConfig] + tag : str + Returns -> None + ''' + if config is not None and not isinstance(config, (bytes, str, list)): + raise Exception("Expected config to be a Sequence, received: {}".format(type(config))) + + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetHostMachineNetworkConfig', + version=11, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetHostMachineNetworkConfig(self, config=None, tag=None): ''' @@ -3012,6 +4290,31 @@ async def SetHostMachineNetworkConfig(self, config=None, tag=None): + @ReturnMapping(ErrorResults) + def sync_SetInstanceInfo(self, machines=None): + ''' + SetInstanceInfo sets the provider specific machine id, nonce, + metadata and network info for each given machine. Once set, the + instance id cannot be changed. + + machines : typing.Sequence[~InstanceInfo] + Returns -> ErrorResults + ''' + if machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetInstanceInfo', + version=11, + params=_params) + _params['machines'] = machines + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetInstanceInfo(self, machines=None): ''' @@ -3037,6 +4340,30 @@ async def SetInstanceInfo(self, machines=None): + @ReturnMapping(ErrorResults) + def sync_SetInstanceStatus(self, entities=None): + ''' + SetInstanceStatus updates the instance status for each given + entity. Only machine tags are accepted. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetInstanceStatus', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetInstanceStatus(self, entities=None): ''' @@ -3061,6 +4388,35 @@ async def SetInstanceStatus(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetModificationStatus(self, entities=None): + ''' + SetModificationStatus updates the instance whilst changes are occurring. This + is different from SetStatus and SetInstanceStatus, by the fact this holds + information about the ongoing changes that are happening to instances. + Consider LXD Profile updates that can modify a instance, but may not cause + the instance to be placed into a error state. This modification status + serves the purpose of highlighting that to the operator. + Only machine tags are accepted. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetModificationStatus', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetModificationStatus(self, entities=None): ''' @@ -3090,6 +4446,37 @@ async def SetModificationStatus(self, entities=None): + @ReturnMapping(None) + def sync_SetObservedNetworkConfig(self, config=None, tag=None): + ''' + SetObservedNetworkConfig reads the network config for the machine + identified by the input args. + This config is merged with the new network config supplied in the + same args and updated if it has changed. + + config : typing.Sequence[~NetworkConfig] + tag : str + Returns -> None + ''' + if config is not None and not isinstance(config, (bytes, str, list)): + raise Exception("Expected config to be a Sequence, received: {}".format(type(config))) + + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetObservedNetworkConfig', + version=11, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetObservedNetworkConfig(self, config=None, tag=None): ''' @@ -3114,9 +4501,32 @@ async def SetObservedNetworkConfig(self, config=None, tag=None): request='SetObservedNetworkConfig', version=11, params=_params) - _params['config'] = config - _params['tag'] = tag - reply = await self.rpc(msg) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetPasswords(self, changes=None): + ''' + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetPasswords', + version=11, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) return reply @@ -3144,6 +4554,29 @@ async def SetPasswords(self, changes=None): + @ReturnMapping(ErrorResults) + def sync_SetStatus(self, entities=None): + ''' + SetStatus sets the status of each given entity. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetStatus', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetStatus(self, entities=None): ''' @@ -3167,6 +4600,29 @@ async def SetStatus(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetSupportedContainers(self, params=None): + ''' + SetSupportedContainers updates the list of containers supported by the machines passed in args. + + params : typing.Sequence[~MachineContainers] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SetSupportedContainers', + version=11, + params=_params) + _params['params'] = params + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetSupportedContainers(self, params=None): ''' @@ -3190,6 +4646,29 @@ async def SetSupportedContainers(self, params=None): + @ReturnMapping(StatusResults) + def sync_Status(self, entities=None): + ''' + Status returns the status of each given entity. + + entities : typing.Sequence[~Entity] + Returns -> StatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='Status', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StatusResults) async def Status(self, entities=None): ''' @@ -3213,6 +4692,29 @@ async def Status(self, entities=None): + @ReturnMapping(MachineContainerResults) + def sync_SupportedContainers(self, entities=None): + ''' + SupportedContainers returns the list of containers supported by the machines passed in args. + + entities : typing.Sequence[~Entity] + Returns -> MachineContainerResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='SupportedContainers', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MachineContainerResults) async def SupportedContainers(self, entities=None): ''' @@ -3236,6 +4738,29 @@ async def SupportedContainers(self, entities=None): + @ReturnMapping(ToolsResults) + def sync_Tools(self, entities=None): + ''' + Tools finds the tools necessary for the given agents. + + entities : typing.Sequence[~Entity] + Returns -> ToolsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='Tools', + version=11, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ToolsResults) async def Tools(self, entities=None): ''' @@ -3259,6 +4784,27 @@ async def Tools(self, entities=None): + @ReturnMapping(NotifyWatchResult) + def sync_WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchAPIHostPorts', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchAPIHostPorts(self): ''' @@ -3280,6 +4826,30 @@ async def WatchAPIHostPorts(self): + @ReturnMapping(StringsWatchResults) + def sync_WatchAllContainers(self, params=None): + ''' + WatchAllContainers starts a StringsWatcher to watch all containers deployed to + any machine passed in args. + + params : typing.Sequence[~WatchContainer] + Returns -> StringsWatchResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchAllContainers', + version=11, + params=_params) + _params['params'] = params + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchAllContainers(self, params=None): ''' @@ -3304,6 +4874,30 @@ async def WatchAllContainers(self, params=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchContainers(self, params=None): + ''' + WatchContainers starts a StringsWatcher to watch containers deployed to + any machine passed in args. + + params : typing.Sequence[~WatchContainer] + Returns -> StringsWatchResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchContainers', + version=11, + params=_params) + _params['params'] = params + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchContainers(self, params=None): ''' @@ -3328,6 +4922,31 @@ async def WatchContainers(self, params=None): + @ReturnMapping(NotifyWatchResult) + def sync_WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchForModelConfigChanges', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchForModelConfigChanges(self): ''' @@ -3353,6 +4972,28 @@ async def WatchForModelConfigChanges(self): + @ReturnMapping(NotifyWatchResult) + def sync_WatchMachineErrorRetry(self): + ''' + WatchMachineErrorRetry returns a NotifyWatcher that notifies when + the provisioner should retry provisioning machines with transient errors. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchMachineErrorRetry', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchMachineErrorRetry(self): ''' @@ -3375,6 +5016,28 @@ async def WatchMachineErrorRetry(self): + @ReturnMapping(StringsWatchResult) + def sync_WatchModelMachineStartTimes(self): + ''' + WatchModelMachineStartTimes watches the non-container machines in the model + for changes to the Life or AgentStartTime fields and reports them as a batch. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchModelMachineStartTimes', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchModelMachineStartTimes(self): ''' @@ -3397,6 +5060,29 @@ async def WatchModelMachineStartTimes(self): + @ReturnMapping(StringsWatchResult) + def sync_WatchModelMachines(self): + ''' + WatchModelMachines returns a StringsWatcher that notifies of + changes to the life cycles of the top level machines in the current + model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchModelMachines', + version=11, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchModelMachines(self): ''' diff --git a/juju/client/_client17.py b/juju/client/_client17.py index 68b2985f..38e1fe4d 100644 --- a/juju/client/_client17.py +++ b/juju/client/_client17.py @@ -864,6 +864,34 @@ class ApplicationFacade(Type): 'type': 'object'} + @ReturnMapping(AddRelationResults) + def sync_AddRelation(self, endpoints=None, via_cidrs=None): + ''' + AddRelation adds a relation between the specified endpoints and returns the relation info. + + endpoints : typing.Sequence[str] + via_cidrs : typing.Sequence[str] + Returns -> AddRelationResults + ''' + if endpoints is not None and not isinstance(endpoints, (bytes, str, list)): + raise Exception("Expected endpoints to be a Sequence, received: {}".format(type(endpoints))) + + if via_cidrs is not None and not isinstance(via_cidrs, (bytes, str, list)): + raise Exception("Expected via_cidrs to be a Sequence, received: {}".format(type(via_cidrs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddRelation', + version=17, + params=_params) + _params['endpoints'] = endpoints + _params['via-cidrs'] = via_cidrs + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AddRelationResults) async def AddRelation(self, endpoints=None, via_cidrs=None): ''' @@ -892,6 +920,49 @@ async def AddRelation(self, endpoints=None, via_cidrs=None): + @ReturnMapping(AddApplicationUnitsResults) + def sync_AddUnits(self, application=None, attach_storage=None, num_units=None, placement=None, policy=None): + ''' + AddUnits adds a given number of units to an application. + + application : str + attach_storage : typing.Sequence[str] + num_units : int + placement : typing.Sequence[~Placement] + policy : str + Returns -> AddApplicationUnitsResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if attach_storage is not None and not isinstance(attach_storage, (bytes, str, list)): + raise Exception("Expected attach_storage to be a Sequence, received: {}".format(type(attach_storage))) + + if num_units is not None and not isinstance(num_units, int): + raise Exception("Expected num_units to be a int, received: {}".format(type(num_units))) + + if placement is not None and not isinstance(placement, (bytes, str, list)): + raise Exception("Expected placement to be a Sequence, received: {}".format(type(placement))) + + if policy is not None and not isinstance(policy, (bytes, str)): + raise Exception("Expected policy to be a str, received: {}".format(type(policy))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddUnits', + version=17, + params=_params) + _params['application'] = application + _params['attach-storage'] = attach_storage + _params['num-units'] = num_units + _params['placement'] = placement + _params['policy'] = policy + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AddApplicationUnitsResults) async def AddUnits(self, application=None, attach_storage=None, num_units=None, placement=None, policy=None): ''' @@ -935,6 +1006,29 @@ async def AddUnits(self, application=None, attach_storage=None, num_units=None, + @ReturnMapping(ApplicationInfoResults) + def sync_ApplicationsInfo(self, entities=None): + ''' + ApplicationsInfo returns applications information. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ApplicationsInfo', + version=17, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationInfoResults) async def ApplicationsInfo(self, entities=None): ''' @@ -958,6 +1052,30 @@ async def ApplicationsInfo(self, entities=None): + @ReturnMapping(ApplicationGetConfigResults) + def sync_CharmConfig(self, args=None): + ''' + CharmConfig returns charm config for the input list of applications and + model generations. + + args : typing.Sequence[~ApplicationGet] + Returns -> ApplicationGetConfigResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='CharmConfig', + version=17, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetConfigResults) async def CharmConfig(self, args=None): ''' @@ -982,6 +1100,29 @@ async def CharmConfig(self, args=None): + @ReturnMapping(ApplicationCharmRelationsResults) + def sync_CharmRelations(self, application=None): + ''' + CharmRelations implements the server side of Application.CharmRelations. + + application : str + Returns -> ApplicationCharmRelationsResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='CharmRelations', + version=17, + params=_params) + _params['application'] = application + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationCharmRelationsResults) async def CharmRelations(self, application=None): ''' @@ -1005,6 +1146,30 @@ async def CharmRelations(self, application=None): + @ReturnMapping(ErrorResults) + def sync_Consume(self, args=None): + ''' + Consume adds remote applications to the model without creating any + relations. + + args : typing.Sequence[~ConsumeApplicationArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Consume', + version=17, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Consume(self, args=None): ''' @@ -1029,6 +1194,30 @@ async def Consume(self, args=None): + @ReturnMapping(ErrorResults) + def sync_Deploy(self, applications=None): + ''' + Deploy fetches the charms from the charm store and deploys them + using the specified placement directives. + + applications : typing.Sequence[~ApplicationDeploy] + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Deploy', + version=17, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Deploy(self, applications=None): ''' @@ -1053,6 +1242,29 @@ async def Deploy(self, applications=None): + @ReturnMapping(DestroyApplicationResults) + def sync_DestroyApplication(self, applications=None): + ''' + DestroyApplication removes a given set of applications. + + applications : typing.Sequence[~DestroyApplicationParams] + Returns -> DestroyApplicationResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyApplication', + version=17, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(DestroyApplicationResults) async def DestroyApplication(self, applications=None): ''' @@ -1076,6 +1288,29 @@ async def DestroyApplication(self, applications=None): + @ReturnMapping(ErrorResults) + def sync_DestroyConsumedApplications(self, applications=None): + ''' + DestroyConsumedApplications removes a given set of consumed (remote) applications. + + applications : typing.Sequence[~DestroyConsumedApplicationParams] + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyConsumedApplications', + version=17, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def DestroyConsumedApplications(self, applications=None): ''' @@ -1099,6 +1334,45 @@ async def DestroyConsumedApplications(self, applications=None): + @ReturnMapping(None) + def sync_DestroyRelation(self, endpoints=None, force=None, max_wait=None, relation_id=None): + ''' + DestroyRelation removes the relation between the + specified endpoints or an id. + + endpoints : typing.Sequence[str] + force : bool + max_wait : int + relation_id : int + Returns -> None + ''' + if endpoints is not None and not isinstance(endpoints, (bytes, str, list)): + raise Exception("Expected endpoints to be a Sequence, received: {}".format(type(endpoints))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if max_wait is not None and not isinstance(max_wait, int): + raise Exception("Expected max_wait to be a int, received: {}".format(type(max_wait))) + + if relation_id is not None and not isinstance(relation_id, int): + raise Exception("Expected relation_id to be a int, received: {}".format(type(relation_id))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyRelation', + version=17, + params=_params) + _params['endpoints'] = endpoints + _params['force'] = force + _params['max-wait'] = max_wait + _params['relation-id'] = relation_id + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def DestroyRelation(self, endpoints=None, force=None, max_wait=None, relation_id=None): ''' @@ -1139,7 +1413,7 @@ async def DestroyRelation(self, endpoints=None, force=None, max_wait=None, relat @ReturnMapping(DestroyUnitResults) - async def DestroyUnit(self, units=None): + def sync_DestroyUnit(self, units=None): ''' DestroyUnit removes a given set of application units. @@ -1156,7 +1430,59 @@ async def DestroyUnit(self, units=None): version=17, params=_params) _params['units'] = units - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(DestroyUnitResults) + async def DestroyUnit(self, units=None): + ''' + DestroyUnit removes a given set of application units. + + units : typing.Sequence[~DestroyUnitParams] + Returns -> DestroyUnitResults + ''' + if units is not None and not isinstance(units, (bytes, str, list)): + raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnit', + version=17, + params=_params) + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + def sync_Expose(self, application=None, exposed_endpoints=None): + ''' + Expose changes the juju-managed firewall to expose any ports that + were also explicitly marked by units as open. + + application : str + exposed_endpoints : typing.Mapping[str, ~ExposedEndpoint] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if exposed_endpoints is not None and not isinstance(exposed_endpoints, dict): + raise Exception("Expected exposed_endpoints to be a Mapping, received: {}".format(type(exposed_endpoints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=17, + params=_params) + _params['application'] = application + _params['exposed-endpoints'] = exposed_endpoints + reply = self.sync_rpc(msg) return reply @@ -1190,6 +1516,34 @@ async def Expose(self, application=None, exposed_endpoints=None): + @ReturnMapping(ApplicationGetResults) + def sync_Get(self, application=None, branch=None): + ''' + Get returns the charm configuration for an application. + + application : str + branch : str + Returns -> ApplicationGetResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Get', + version=17, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetResults) async def Get(self, application=None, branch=None): ''' @@ -1218,6 +1572,35 @@ async def Get(self, application=None, branch=None): + @ReturnMapping(CharmURLOriginResult) + def sync_GetCharmURLOrigin(self, application=None, branch=None): + ''' + GetCharmURLOrigin returns the charm URL and charm origin the given + application is running at present. + + application : str + branch : str + Returns -> CharmURLOriginResult + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetCharmURLOrigin', + version=17, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CharmURLOriginResult) async def GetCharmURLOrigin(self, application=None, branch=None): ''' @@ -1247,6 +1630,29 @@ async def GetCharmURLOrigin(self, application=None, branch=None): + @ReturnMapping(ApplicationGetConfigResults) + def sync_GetConfig(self, entities=None): + ''' + GetConfig returns the charm config for each of the input applications. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetConfig', + version=17, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetConfigResults) async def GetConfig(self, entities=None): ''' @@ -1270,6 +1676,29 @@ async def GetConfig(self, entities=None): + @ReturnMapping(ApplicationGetConstraintsResults) + def sync_GetConstraints(self, entities=None): + ''' + GetConstraints returns the constraints for a given application. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConstraintsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetConstraints', + version=17, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetConstraintsResults) async def GetConstraints(self, entities=None): ''' @@ -1293,6 +1722,29 @@ async def GetConstraints(self, entities=None): + @ReturnMapping(StringResult) + def sync_Leader(self, tag=None): + ''' + Leader returns the unit name of the leader for the given application. + + tag : str + Returns -> StringResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Leader', + version=17, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResult) async def Leader(self, tag=None): ''' @@ -1316,6 +1768,30 @@ async def Leader(self, tag=None): + @ReturnMapping(ErrorResults) + def sync_MergeBindings(self, args=None): + ''' + MergeBindings merges operator-defined bindings with the current bindings for + one or more applications. + + args : typing.Sequence[~ApplicationMergeBindings] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='MergeBindings', + version=17, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def MergeBindings(self, args=None): ''' @@ -1340,6 +1816,39 @@ async def MergeBindings(self, args=None): + @ReturnMapping(ErrorResults) + def sync_ResolveUnitErrors(self, all_=None, retry=None, tags=None): + ''' + ResolveUnitErrors marks errors on the specified units as resolved. + + all_ : bool + retry : bool + tags : Entities + Returns -> ErrorResults + ''' + if all_ is not None and not isinstance(all_, bool): + raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + + if retry is not None and not isinstance(retry, bool): + raise Exception("Expected retry to be a bool, received: {}".format(type(retry))) + + if tags is not None and not isinstance(tags, (dict, Entities)): + raise Exception("Expected tags to be a Entities, received: {}".format(type(tags))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ResolveUnitErrors', + version=17, + params=_params) + _params['all'] = all_ + _params['retry'] = retry + _params['tags'] = tags + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): ''' @@ -1373,6 +1882,29 @@ async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): + @ReturnMapping(ScaleApplicationResults) + def sync_ScaleApplications(self, applications=None): + ''' + ScaleApplications scales the specified application to the requested number of units. + + applications : typing.Sequence[~ScaleApplicationParams] + Returns -> ScaleApplicationResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ScaleApplications', + version=17, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ScaleApplicationResults) async def ScaleApplications(self, applications=None): ''' @@ -1396,6 +1928,89 @@ async def ScaleApplications(self, applications=None): + @ReturnMapping(None) + def sync_SetCharm(self, application=None, channel=None, charm_origin=None, charm_url=None, config_settings=None, config_settings_yaml=None, endpoint_bindings=None, force=None, force_base=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None): + ''' + SetCharm sets the charm for a given for the application. + + application : str + channel : str + charm_origin : CharmOrigin + charm_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + endpoint_bindings : typing.Mapping[str, str] + force : bool + force_base : bool + force_units : bool + generation : str + resource_ids : typing.Mapping[str, str] + storage_constraints : typing.Mapping[str, ~StorageConstraints] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if channel is not None and not isinstance(channel, (bytes, str)): + raise Exception("Expected channel to be a str, received: {}".format(type(channel))) + + if charm_origin is not None and not isinstance(charm_origin, (dict, CharmOrigin)): + raise Exception("Expected charm_origin to be a CharmOrigin, received: {}".format(type(charm_origin))) + + if charm_url is not None and not isinstance(charm_url, (bytes, str)): + raise Exception("Expected charm_url to be a str, received: {}".format(type(charm_url))) + + if config_settings is not None and not isinstance(config_settings, dict): + raise Exception("Expected config_settings to be a Mapping, received: {}".format(type(config_settings))) + + if config_settings_yaml is not None and not isinstance(config_settings_yaml, (bytes, str)): + raise Exception("Expected config_settings_yaml to be a str, received: {}".format(type(config_settings_yaml))) + + if endpoint_bindings is not None and not isinstance(endpoint_bindings, dict): + raise Exception("Expected endpoint_bindings to be a Mapping, received: {}".format(type(endpoint_bindings))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if force_base is not None and not isinstance(force_base, bool): + raise Exception("Expected force_base to be a bool, received: {}".format(type(force_base))) + + if force_units is not None and not isinstance(force_units, bool): + raise Exception("Expected force_units to be a bool, received: {}".format(type(force_units))) + + if generation is not None and not isinstance(generation, (bytes, str)): + raise Exception("Expected generation to be a str, received: {}".format(type(generation))) + + if resource_ids is not None and not isinstance(resource_ids, dict): + raise Exception("Expected resource_ids to be a Mapping, received: {}".format(type(resource_ids))) + + if storage_constraints is not None and not isinstance(storage_constraints, dict): + raise Exception("Expected storage_constraints to be a Mapping, received: {}".format(type(storage_constraints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetCharm', + version=17, + params=_params) + _params['application'] = application + _params['channel'] = channel + _params['charm-origin'] = charm_origin + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['endpoint-bindings'] = endpoint_bindings + _params['force'] = force + _params['force-base'] = force_base + _params['force-units'] = force_units + _params['generation'] = generation + _params['resource-ids'] = resource_ids + _params['storage-constraints'] = storage_constraints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetCharm(self, application=None, channel=None, charm_origin=None, charm_url=None, config_settings=None, config_settings_yaml=None, endpoint_bindings=None, force=None, force_base=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None): ''' @@ -1479,6 +2094,31 @@ async def SetCharm(self, application=None, channel=None, charm_origin=None, char + @ReturnMapping(ErrorResults) + def sync_SetConfigs(self, args=None): + ''' + SetConfigs implements the server side of Application.SetConfig. Both + application and charm config are set. It does not unset values in + Config map that are set to an empty string. Unset should be used for that. + + args : typing.Sequence[~ConfigSet] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetConfigs', + version=17, + params=_params) + _params['Args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetConfigs(self, args=None): ''' @@ -1504,6 +2144,34 @@ async def SetConfigs(self, args=None): + @ReturnMapping(None) + def sync_SetConstraints(self, application=None, constraints=None): + ''' + SetConstraints sets the constraints for a given application. + + application : str + constraints : Value + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetConstraints', + version=17, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetConstraints(self, application=None, constraints=None): ''' @@ -1532,6 +2200,29 @@ async def SetConstraints(self, application=None, constraints=None): + @ReturnMapping(ErrorResults) + def sync_SetMetricCredentials(self, creds=None): + ''' + SetMetricCredentials sets credentials on the application. + + creds : typing.Sequence[~ApplicationMetricCredential] + Returns -> ErrorResults + ''' + if creds is not None and not isinstance(creds, (bytes, str, list)): + raise Exception("Expected creds to be a Sequence, received: {}".format(type(creds))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetMetricCredentials', + version=17, + params=_params) + _params['creds'] = creds + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetMetricCredentials(self, creds=None): ''' @@ -1555,6 +2246,29 @@ async def SetMetricCredentials(self, creds=None): + @ReturnMapping(ErrorResults) + def sync_SetRelationsSuspended(self, args=None): + ''' + SetRelationsSuspended sets the suspended status of the specified relations. + + args : typing.Sequence[~RelationSuspendedArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetRelationsSuspended', + version=17, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetRelationsSuspended(self, args=None): ''' @@ -1578,6 +2292,35 @@ async def SetRelationsSuspended(self, args=None): + @ReturnMapping(None) + def sync_Unexpose(self, application=None, exposed_endpoints=None): + ''' + Unexpose changes the juju-managed firewall to unexpose any ports that + were also explicitly marked by units as open. + + application : str + exposed_endpoints : typing.Sequence[str] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if exposed_endpoints is not None and not isinstance(exposed_endpoints, (bytes, str, list)): + raise Exception("Expected exposed_endpoints to be a Sequence, received: {}".format(type(exposed_endpoints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=17, + params=_params) + _params['application'] = application + _params['exposed-endpoints'] = exposed_endpoints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Unexpose(self, application=None, exposed_endpoints=None): ''' @@ -1607,6 +2350,30 @@ async def Unexpose(self, application=None, exposed_endpoints=None): + @ReturnMapping(UnitInfoResults) + def sync_UnitsInfo(self, entities=None): + ''' + UnitsInfo returns unit information for the given entities (units or + applications). + + entities : typing.Sequence[~Entity] + Returns -> UnitInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UnitsInfo', + version=17, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UnitInfoResults) async def UnitsInfo(self, entities=None): ''' @@ -1631,6 +2398,29 @@ async def UnitsInfo(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_UnsetApplicationsConfig(self, args=None): + ''' + UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig. + + args : typing.Sequence[~ApplicationUnset] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UnsetApplicationsConfig', + version=17, + params=_params) + _params['Args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UnsetApplicationsConfig(self, args=None): ''' @@ -1654,6 +2444,30 @@ async def UnsetApplicationsConfig(self, args=None): + @ReturnMapping(ErrorResults) + def sync_UpdateApplicationBase(self, args=None): + ''' + UpdateApplicationBase updates the application base. + Base for subordinates is updated too. + + args : typing.Sequence[~UpdateChannelArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UpdateApplicationBase', + version=17, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UpdateApplicationBase(self, args=None): ''' diff --git a/juju/client/_client18.py b/juju/client/_client18.py index 5cade48c..3ae538cd 100644 --- a/juju/client/_client18.py +++ b/juju/client/_client18.py @@ -964,6 +964,34 @@ class ApplicationFacade(Type): 'type': 'object'} + @ReturnMapping(AddRelationResults) + def sync_AddRelation(self, endpoints=None, via_cidrs=None): + ''' + AddRelation adds a relation between the specified endpoints and returns the relation info. + + endpoints : typing.Sequence[str] + via_cidrs : typing.Sequence[str] + Returns -> AddRelationResults + ''' + if endpoints is not None and not isinstance(endpoints, (bytes, str, list)): + raise Exception("Expected endpoints to be a Sequence, received: {}".format(type(endpoints))) + + if via_cidrs is not None and not isinstance(via_cidrs, (bytes, str, list)): + raise Exception("Expected via_cidrs to be a Sequence, received: {}".format(type(via_cidrs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddRelation', + version=18, + params=_params) + _params['endpoints'] = endpoints + _params['via-cidrs'] = via_cidrs + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AddRelationResults) async def AddRelation(self, endpoints=None, via_cidrs=None): ''' @@ -992,6 +1020,49 @@ async def AddRelation(self, endpoints=None, via_cidrs=None): + @ReturnMapping(AddApplicationUnitsResults) + def sync_AddUnits(self, application=None, attach_storage=None, num_units=None, placement=None, policy=None): + ''' + AddUnits adds a given number of units to an application. + + application : str + attach_storage : typing.Sequence[str] + num_units : int + placement : typing.Sequence[~Placement] + policy : str + Returns -> AddApplicationUnitsResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if attach_storage is not None and not isinstance(attach_storage, (bytes, str, list)): + raise Exception("Expected attach_storage to be a Sequence, received: {}".format(type(attach_storage))) + + if num_units is not None and not isinstance(num_units, int): + raise Exception("Expected num_units to be a int, received: {}".format(type(num_units))) + + if placement is not None and not isinstance(placement, (bytes, str, list)): + raise Exception("Expected placement to be a Sequence, received: {}".format(type(placement))) + + if policy is not None and not isinstance(policy, (bytes, str)): + raise Exception("Expected policy to be a str, received: {}".format(type(policy))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddUnits', + version=18, + params=_params) + _params['application'] = application + _params['attach-storage'] = attach_storage + _params['num-units'] = num_units + _params['placement'] = placement + _params['policy'] = policy + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AddApplicationUnitsResults) async def AddUnits(self, application=None, attach_storage=None, num_units=None, placement=None, policy=None): ''' @@ -1035,6 +1106,29 @@ async def AddUnits(self, application=None, attach_storage=None, num_units=None, + @ReturnMapping(ApplicationInfoResults) + def sync_ApplicationsInfo(self, entities=None): + ''' + ApplicationsInfo returns applications information. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ApplicationsInfo', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationInfoResults) async def ApplicationsInfo(self, entities=None): ''' @@ -1058,6 +1152,30 @@ async def ApplicationsInfo(self, entities=None): + @ReturnMapping(ApplicationGetConfigResults) + def sync_CharmConfig(self, args=None): + ''' + CharmConfig returns charm config for the input list of applications and + model generations. + + args : typing.Sequence[~ApplicationGet] + Returns -> ApplicationGetConfigResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='CharmConfig', + version=18, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetConfigResults) async def CharmConfig(self, args=None): ''' @@ -1082,6 +1200,29 @@ async def CharmConfig(self, args=None): + @ReturnMapping(ApplicationCharmRelationsResults) + def sync_CharmRelations(self, application=None): + ''' + CharmRelations implements the server side of Application.CharmRelations. + + application : str + Returns -> ApplicationCharmRelationsResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='CharmRelations', + version=18, + params=_params) + _params['application'] = application + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationCharmRelationsResults) async def CharmRelations(self, application=None): ''' @@ -1105,6 +1246,30 @@ async def CharmRelations(self, application=None): + @ReturnMapping(ErrorResults) + def sync_Consume(self, args=None): + ''' + Consume adds remote applications to the model without creating any + relations. + + args : typing.Sequence[~ConsumeApplicationArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Consume', + version=18, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Consume(self, args=None): ''' @@ -1129,6 +1294,30 @@ async def Consume(self, args=None): + @ReturnMapping(ErrorResults) + def sync_Deploy(self, applications=None): + ''' + Deploy fetches the charms from the charm store and deploys them + using the specified placement directives. + + applications : typing.Sequence[~ApplicationDeploy] + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Deploy', + version=18, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Deploy(self, applications=None): ''' @@ -1153,6 +1342,33 @@ async def Deploy(self, applications=None): + @ReturnMapping(DeployFromRepositoryResults) + def sync_DeployFromRepository(self, args=None): + ''' + DeployFromRepository is a one-stop deployment method for repository + charms. Only a charm name is required to deploy. If argument validation + fails, a list of all errors found in validation will be returned. If a + local resource is provided, details required for uploading the validated + resource will be returned. + + args : typing.Sequence[~DeployFromRepositoryArg] + Returns -> DeployFromRepositoryResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DeployFromRepository', + version=18, + params=_params) + _params['Args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(DeployFromRepositoryResults) async def DeployFromRepository(self, args=None): ''' @@ -1180,6 +1396,29 @@ async def DeployFromRepository(self, args=None): + @ReturnMapping(DestroyApplicationResults) + def sync_DestroyApplication(self, applications=None): + ''' + DestroyApplication removes a given set of applications. + + applications : typing.Sequence[~DestroyApplicationParams] + Returns -> DestroyApplicationResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyApplication', + version=18, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(DestroyApplicationResults) async def DestroyApplication(self, applications=None): ''' @@ -1203,6 +1442,29 @@ async def DestroyApplication(self, applications=None): + @ReturnMapping(ErrorResults) + def sync_DestroyConsumedApplications(self, applications=None): + ''' + DestroyConsumedApplications removes a given set of consumed (remote) applications. + + applications : typing.Sequence[~DestroyConsumedApplicationParams] + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyConsumedApplications', + version=18, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def DestroyConsumedApplications(self, applications=None): ''' @@ -1227,7 +1489,7 @@ async def DestroyConsumedApplications(self, applications=None): @ReturnMapping(None) - async def DestroyRelation(self, endpoints=None, force=None, max_wait=None, relation_id=None): + def sync_DestroyRelation(self, endpoints=None, force=None, max_wait=None, relation_id=None): ''' DestroyRelation removes the relation between the specified endpoints or an id. @@ -1260,21 +1522,83 @@ async def DestroyRelation(self, endpoints=None, force=None, max_wait=None, relat _params['force'] = force _params['max-wait'] = max_wait _params['relation-id'] = relation_id - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(DestroyUnitResults) - async def DestroyUnit(self, units=None): + @ReturnMapping(None) + async def DestroyRelation(self, endpoints=None, force=None, max_wait=None, relation_id=None): ''' - DestroyUnit removes a given set of application units. + DestroyRelation removes the relation between the + specified endpoints or an id. - units : typing.Sequence[~DestroyUnitParams] - Returns -> DestroyUnitResults - ''' - if units is not None and not isinstance(units, (bytes, str, list)): - raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + endpoints : typing.Sequence[str] + force : bool + max_wait : int + relation_id : int + Returns -> None + ''' + if endpoints is not None and not isinstance(endpoints, (bytes, str, list)): + raise Exception("Expected endpoints to be a Sequence, received: {}".format(type(endpoints))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if max_wait is not None and not isinstance(max_wait, int): + raise Exception("Expected max_wait to be a int, received: {}".format(type(max_wait))) + + if relation_id is not None and not isinstance(relation_id, int): + raise Exception("Expected relation_id to be a int, received: {}".format(type(relation_id))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyRelation', + version=18, + params=_params) + _params['endpoints'] = endpoints + _params['force'] = force + _params['max-wait'] = max_wait + _params['relation-id'] = relation_id + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyUnitResults) + def sync_DestroyUnit(self, units=None): + ''' + DestroyUnit removes a given set of application units. + + units : typing.Sequence[~DestroyUnitParams] + Returns -> DestroyUnitResults + ''' + if units is not None and not isinstance(units, (bytes, str, list)): + raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnit', + version=18, + params=_params) + _params['units'] = units + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(DestroyUnitResults) + async def DestroyUnit(self, units=None): + ''' + DestroyUnit removes a given set of application units. + + units : typing.Sequence[~DestroyUnitParams] + Returns -> DestroyUnitResults + ''' + if units is not None and not isinstance(units, (bytes, str, list)): + raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) # map input types to rpc msg _params = dict() @@ -1288,6 +1612,35 @@ async def DestroyUnit(self, units=None): + @ReturnMapping(None) + def sync_Expose(self, application=None, exposed_endpoints=None): + ''' + Expose changes the juju-managed firewall to expose any ports that + were also explicitly marked by units as open. + + application : str + exposed_endpoints : typing.Mapping[str, ~ExposedEndpoint] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if exposed_endpoints is not None and not isinstance(exposed_endpoints, dict): + raise Exception("Expected exposed_endpoints to be a Mapping, received: {}".format(type(exposed_endpoints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=18, + params=_params) + _params['application'] = application + _params['exposed-endpoints'] = exposed_endpoints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Expose(self, application=None, exposed_endpoints=None): ''' @@ -1317,6 +1670,34 @@ async def Expose(self, application=None, exposed_endpoints=None): + @ReturnMapping(ApplicationGetResults) + def sync_Get(self, application=None, branch=None): + ''' + Get returns the charm configuration for an application. + + application : str + branch : str + Returns -> ApplicationGetResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Get', + version=18, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetResults) async def Get(self, application=None, branch=None): ''' @@ -1345,6 +1726,35 @@ async def Get(self, application=None, branch=None): + @ReturnMapping(CharmURLOriginResult) + def sync_GetCharmURLOrigin(self, application=None, branch=None): + ''' + GetCharmURLOrigin returns the charm URL and charm origin the given + application is running at present. + + application : str + branch : str + Returns -> CharmURLOriginResult + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetCharmURLOrigin', + version=18, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CharmURLOriginResult) async def GetCharmURLOrigin(self, application=None, branch=None): ''' @@ -1374,6 +1784,29 @@ async def GetCharmURLOrigin(self, application=None, branch=None): + @ReturnMapping(ApplicationGetConfigResults) + def sync_GetConfig(self, entities=None): + ''' + GetConfig returns the charm config for each of the input applications. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetConfig', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetConfigResults) async def GetConfig(self, entities=None): ''' @@ -1397,6 +1830,29 @@ async def GetConfig(self, entities=None): + @ReturnMapping(ApplicationGetConstraintsResults) + def sync_GetConstraints(self, entities=None): + ''' + GetConstraints returns the constraints for a given application. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConstraintsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetConstraints', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetConstraintsResults) async def GetConstraints(self, entities=None): ''' @@ -1420,6 +1876,29 @@ async def GetConstraints(self, entities=None): + @ReturnMapping(StringResult) + def sync_Leader(self, tag=None): + ''' + Leader returns the unit name of the leader for the given application. + + tag : str + Returns -> StringResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Leader', + version=18, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResult) async def Leader(self, tag=None): ''' @@ -1443,6 +1922,30 @@ async def Leader(self, tag=None): + @ReturnMapping(ErrorResults) + def sync_MergeBindings(self, args=None): + ''' + MergeBindings merges operator-defined bindings with the current bindings for + one or more applications. + + args : typing.Sequence[~ApplicationMergeBindings] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='MergeBindings', + version=18, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def MergeBindings(self, args=None): ''' @@ -1468,7 +1971,7 @@ async def MergeBindings(self, args=None): @ReturnMapping(ErrorResults) - async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): + def sync_ResolveUnitErrors(self, all_=None, retry=None, tags=None): ''' ResolveUnitErrors marks errors on the specified units as resolved. @@ -1495,34 +1998,173 @@ async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): _params['all'] = all_ _params['retry'] = retry _params['tags'] = tags - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ScaleApplicationResults) - async def ScaleApplications(self, applications=None): + @ReturnMapping(ErrorResults) + async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): ''' - ScaleApplications scales the specified application to the requested number of units. + ResolveUnitErrors marks errors on the specified units as resolved. - applications : typing.Sequence[~ScaleApplicationParams] - Returns -> ScaleApplicationResults + all_ : bool + retry : bool + tags : Entities + Returns -> ErrorResults ''' - if applications is not None and not isinstance(applications, (bytes, str, list)): - raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + if all_ is not None and not isinstance(all_, bool): + raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + + if retry is not None and not isinstance(retry, bool): + raise Exception("Expected retry to be a bool, received: {}".format(type(retry))) + + if tags is not None and not isinstance(tags, (dict, Entities)): + raise Exception("Expected tags to be a Entities, received: {}".format(type(tags))) # map input types to rpc msg _params = dict() msg = dict(type='Application', - request='ScaleApplications', + request='ResolveUnitErrors', version=18, params=_params) - _params['applications'] = applications + _params['all'] = all_ + _params['retry'] = retry + _params['tags'] = tags + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ScaleApplicationResults) + def sync_ScaleApplications(self, applications=None): + ''' + ScaleApplications scales the specified application to the requested number of units. + + applications : typing.Sequence[~ScaleApplicationParams] + Returns -> ScaleApplicationResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ScaleApplications', + version=18, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ScaleApplicationResults) + async def ScaleApplications(self, applications=None): + ''' + ScaleApplications scales the specified application to the requested number of units. + + applications : typing.Sequence[~ScaleApplicationParams] + Returns -> ScaleApplicationResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ScaleApplications', + version=18, + params=_params) + _params['applications'] = applications reply = await self.rpc(msg) return reply + @ReturnMapping(None) + def sync_SetCharm(self, application=None, channel=None, charm_origin=None, charm_url=None, config_settings=None, config_settings_yaml=None, endpoint_bindings=None, force=None, force_base=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None): + ''' + SetCharm sets the charm for a given for the application. + + application : str + channel : str + charm_origin : CharmOrigin + charm_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + endpoint_bindings : typing.Mapping[str, str] + force : bool + force_base : bool + force_units : bool + generation : str + resource_ids : typing.Mapping[str, str] + storage_constraints : typing.Mapping[str, ~StorageConstraints] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if channel is not None and not isinstance(channel, (bytes, str)): + raise Exception("Expected channel to be a str, received: {}".format(type(channel))) + + if charm_origin is not None and not isinstance(charm_origin, (dict, CharmOrigin)): + raise Exception("Expected charm_origin to be a CharmOrigin, received: {}".format(type(charm_origin))) + + if charm_url is not None and not isinstance(charm_url, (bytes, str)): + raise Exception("Expected charm_url to be a str, received: {}".format(type(charm_url))) + + if config_settings is not None and not isinstance(config_settings, dict): + raise Exception("Expected config_settings to be a Mapping, received: {}".format(type(config_settings))) + + if config_settings_yaml is not None and not isinstance(config_settings_yaml, (bytes, str)): + raise Exception("Expected config_settings_yaml to be a str, received: {}".format(type(config_settings_yaml))) + + if endpoint_bindings is not None and not isinstance(endpoint_bindings, dict): + raise Exception("Expected endpoint_bindings to be a Mapping, received: {}".format(type(endpoint_bindings))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if force_base is not None and not isinstance(force_base, bool): + raise Exception("Expected force_base to be a bool, received: {}".format(type(force_base))) + + if force_units is not None and not isinstance(force_units, bool): + raise Exception("Expected force_units to be a bool, received: {}".format(type(force_units))) + + if generation is not None and not isinstance(generation, (bytes, str)): + raise Exception("Expected generation to be a str, received: {}".format(type(generation))) + + if resource_ids is not None and not isinstance(resource_ids, dict): + raise Exception("Expected resource_ids to be a Mapping, received: {}".format(type(resource_ids))) + + if storage_constraints is not None and not isinstance(storage_constraints, dict): + raise Exception("Expected storage_constraints to be a Mapping, received: {}".format(type(storage_constraints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetCharm', + version=18, + params=_params) + _params['application'] = application + _params['channel'] = channel + _params['charm-origin'] = charm_origin + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['endpoint-bindings'] = endpoint_bindings + _params['force'] = force + _params['force-base'] = force_base + _params['force-units'] = force_units + _params['generation'] = generation + _params['resource-ids'] = resource_ids + _params['storage-constraints'] = storage_constraints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetCharm(self, application=None, channel=None, charm_origin=None, charm_url=None, config_settings=None, config_settings_yaml=None, endpoint_bindings=None, force=None, force_base=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None): ''' @@ -1606,6 +2248,31 @@ async def SetCharm(self, application=None, channel=None, charm_origin=None, char + @ReturnMapping(ErrorResults) + def sync_SetConfigs(self, args=None): + ''' + SetConfigs implements the server side of Application.SetConfig. Both + application and charm config are set. It does not unset values in + Config map that are set to an empty string. Unset should be used for that. + + args : typing.Sequence[~ConfigSet] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetConfigs', + version=18, + params=_params) + _params['Args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetConfigs(self, args=None): ''' @@ -1631,6 +2298,34 @@ async def SetConfigs(self, args=None): + @ReturnMapping(None) + def sync_SetConstraints(self, application=None, constraints=None): + ''' + SetConstraints sets the constraints for a given application. + + application : str + constraints : Value + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetConstraints', + version=18, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetConstraints(self, application=None, constraints=None): ''' @@ -1659,6 +2354,29 @@ async def SetConstraints(self, application=None, constraints=None): + @ReturnMapping(ErrorResults) + def sync_SetMetricCredentials(self, creds=None): + ''' + SetMetricCredentials sets credentials on the application. + + creds : typing.Sequence[~ApplicationMetricCredential] + Returns -> ErrorResults + ''' + if creds is not None and not isinstance(creds, (bytes, str, list)): + raise Exception("Expected creds to be a Sequence, received: {}".format(type(creds))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetMetricCredentials', + version=18, + params=_params) + _params['creds'] = creds + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetMetricCredentials(self, creds=None): ''' @@ -1682,6 +2400,29 @@ async def SetMetricCredentials(self, creds=None): + @ReturnMapping(ErrorResults) + def sync_SetRelationsSuspended(self, args=None): + ''' + SetRelationsSuspended sets the suspended status of the specified relations. + + args : typing.Sequence[~RelationSuspendedArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetRelationsSuspended', + version=18, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetRelationsSuspended(self, args=None): ''' @@ -1705,6 +2446,35 @@ async def SetRelationsSuspended(self, args=None): + @ReturnMapping(None) + def sync_Unexpose(self, application=None, exposed_endpoints=None): + ''' + Unexpose changes the juju-managed firewall to unexpose any ports that + were also explicitly marked by units as open. + + application : str + exposed_endpoints : typing.Sequence[str] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if exposed_endpoints is not None and not isinstance(exposed_endpoints, (bytes, str, list)): + raise Exception("Expected exposed_endpoints to be a Sequence, received: {}".format(type(exposed_endpoints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=18, + params=_params) + _params['application'] = application + _params['exposed-endpoints'] = exposed_endpoints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Unexpose(self, application=None, exposed_endpoints=None): ''' @@ -1735,7 +2505,7 @@ async def Unexpose(self, application=None, exposed_endpoints=None): @ReturnMapping(UnitInfoResults) - async def UnitsInfo(self, entities=None): + def sync_UnitsInfo(self, entities=None): ''' UnitsInfo returns unit information for the given entities (units or applications). @@ -1753,17 +2523,64 @@ async def UnitsInfo(self, entities=None): version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def UnsetApplicationsConfig(self, args=None): + @ReturnMapping(UnitInfoResults) + async def UnitsInfo(self, entities=None): ''' - UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig. + UnitsInfo returns unit information for the given entities (units or + applications). - args : typing.Sequence[~ApplicationUnset] + entities : typing.Sequence[~Entity] + Returns -> UnitInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UnitsInfo', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_UnsetApplicationsConfig(self, args=None): + ''' + UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig. + + args : typing.Sequence[~ApplicationUnset] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UnsetApplicationsConfig', + version=18, + params=_params) + _params['Args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UnsetApplicationsConfig(self, args=None): + ''' + UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig. + + args : typing.Sequence[~ApplicationUnset] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): @@ -1781,6 +2598,30 @@ async def UnsetApplicationsConfig(self, args=None): + @ReturnMapping(ErrorResults) + def sync_UpdateApplicationBase(self, args=None): + ''' + UpdateApplicationBase updates the application base. + Base for subordinates is updated too. + + args : typing.Sequence[~UpdateChannelArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UpdateApplicationBase', + version=18, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UpdateApplicationBase(self, args=None): ''' @@ -3847,6 +4688,27 @@ class UniterFacade(Type): 'type': 'object'} + @ReturnMapping(StringsResult) + def sync_APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIAddresses', + version=18, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsResult) async def APIAddresses(self): ''' @@ -3868,6 +4730,27 @@ async def APIAddresses(self): + @ReturnMapping(APIHostPortsResult) + def sync_APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIHostPorts', + version=18, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(APIHostPortsResult) async def APIHostPorts(self): ''' @@ -3889,6 +4772,29 @@ async def APIHostPorts(self): + @ReturnMapping(StringResults) + def sync_ActionStatus(self, entities=None): + ''' + ActionStatus returns the status of Actions by Tags passed in. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ActionStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def ActionStatus(self, entities=None): ''' @@ -3912,6 +4818,30 @@ async def ActionStatus(self, entities=None): + @ReturnMapping(ActionResults) + def sync_Actions(self, entities=None): + ''' + Actions returns the Actions by Tags passed and ensures that the Unit asking + for them is the same Unit that has the Actions. + + entities : typing.Sequence[~Entity] + Returns -> ActionResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Actions', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ActionResults) async def Actions(self, entities=None): ''' @@ -3936,6 +4866,29 @@ async def Actions(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_AddMetricBatches(self, batches=None): + ''' + AddMetricBatches adds the metrics for the specified unit. + + batches : typing.Sequence[~MetricBatchParam] + Returns -> ErrorResults + ''' + if batches is not None and not isinstance(batches, (bytes, str, list)): + raise Exception("Expected batches to be a Sequence, received: {}".format(type(batches))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='AddMetricBatches', + version=18, + params=_params) + _params['batches'] = batches + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def AddMetricBatches(self, batches=None): ''' @@ -3960,7 +4913,7 @@ async def AddMetricBatches(self, batches=None): @ReturnMapping(ApplicationStatusResults) - async def ApplicationStatus(self, entities=None): + def sync_ApplicationStatus(self, entities=None): ''' ApplicationStatus returns the status of the Applications and its workloads if the given unit is the leader. @@ -3978,20 +4931,19 @@ async def ApplicationStatus(self, entities=None): version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringResults) - async def AssignedMachine(self, entities=None): + @ReturnMapping(ApplicationStatusResults) + async def ApplicationStatus(self, entities=None): ''' - AssignedMachine returns the machine tag for each given unit tag, or - an error satisfying params.IsCodeNotAssigned when a unit has no - assigned machine. + ApplicationStatus returns the status of the Applications and its workloads + if the given unit is the leader. entities : typing.Sequence[~Entity] - Returns -> StringResults + Returns -> ApplicationStatusResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -3999,7 +4951,7 @@ async def AssignedMachine(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='AssignedMachine', + request='ApplicationStatus', version=18, params=_params) _params['entities'] = entities @@ -4009,9 +4961,11 @@ async def AssignedMachine(self, entities=None): @ReturnMapping(StringResults) - async def AvailabilityZone(self, entities=None): + def sync_AssignedMachine(self, entities=None): ''' - AvailabilityZone returns the availability zone for each given unit, if applicable. + AssignedMachine returns the machine tag for each given unit tag, or + an error satisfying params.IsCodeNotAssigned when a unit has no + assigned machine. entities : typing.Sequence[~Entity] Returns -> StringResults @@ -4022,22 +4976,24 @@ async def AvailabilityZone(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='AvailabilityZone', + request='AssignedMachine', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def BeginActions(self, entities=None): + @ReturnMapping(StringResults) + async def AssignedMachine(self, entities=None): ''' - BeginActions marks the actions represented by the passed in Tags as running. + AssignedMachine returns the machine tag for each given unit tag, or + an error satisfying params.IsCodeNotAssigned when a unit has no + assigned machine. entities : typing.Sequence[~Entity] - Returns -> ErrorResults + Returns -> StringResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4045,7 +5001,7 @@ async def BeginActions(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='BeginActions', + request='AssignedMachine', version=18, params=_params) _params['entities'] = entities @@ -4054,13 +5010,13 @@ async def BeginActions(self, entities=None): - @ReturnMapping(BoolResults) - async def CanApplyLXDProfile(self, entities=None): + @ReturnMapping(StringResults) + def sync_AvailabilityZone(self, entities=None): ''' - CanApplyLXDProfile is a shim to call the LXDProfileAPIv2 version of this method. + AvailabilityZone returns the availability zone for each given unit, if applicable. entities : typing.Sequence[~Entity] - Returns -> BoolResults + Returns -> StringResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4068,47 +5024,45 @@ async def CanApplyLXDProfile(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CanApplyLXDProfile', + request='AvailabilityZone', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(StringResults) - async def CharmArchiveSha256(self, urls=None): + async def AvailabilityZone(self, entities=None): ''' - CharmArchiveSha256 returns the SHA256 digest of the charm archive - (bundle) data for each charm url in the given parameters. + AvailabilityZone returns the availability zone for each given unit, if applicable. - urls : typing.Sequence[~CharmURL] + entities : typing.Sequence[~Entity] Returns -> StringResults ''' - if urls is not None and not isinstance(urls, (bytes, str, list)): - raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CharmArchiveSha256', + request='AvailabilityZone', version=18, params=_params) - _params['urls'] = urls + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(IntResults) - async def CharmModifiedVersion(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_BeginActions(self, entities=None): ''' - CharmModifiedVersion returns the most CharmModifiedVersion for all given - units or applications. + BeginActions marks the actions represented by the passed in Tags as running. entities : typing.Sequence[~Entity] - Returns -> IntResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4116,22 +5070,22 @@ async def CharmModifiedVersion(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CharmModifiedVersion', + request='BeginActions', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringBoolResults) - async def CharmURL(self, entities=None): + @ReturnMapping(ErrorResults) + async def BeginActions(self, entities=None): ''' - CharmURL returns the charm URL for all given units or applications. + BeginActions marks the actions represented by the passed in Tags as running. entities : typing.Sequence[~Entity] - Returns -> StringBoolResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4139,7 +5093,7 @@ async def CharmURL(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CharmURL', + request='BeginActions', version=18, params=_params) _params['entities'] = entities @@ -4148,13 +5102,13 @@ async def CharmURL(self, entities=None): - @ReturnMapping(ErrorResults) - async def ClearResolved(self, entities=None): + @ReturnMapping(BoolResults) + def sync_CanApplyLXDProfile(self, entities=None): ''' - ClearResolved removes any resolved setting from each given unit. + CanApplyLXDProfile is a shim to call the LXDProfileAPIv2 version of this method. entities : typing.Sequence[~Entity] - Returns -> ErrorResults + Returns -> BoolResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4162,93 +5116,94 @@ async def ClearResolved(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ClearResolved', + request='CanApplyLXDProfile', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringResult) - async def CloudAPIVersion(self): + @ReturnMapping(BoolResults) + async def CanApplyLXDProfile(self, entities=None): ''' - CloudAPIVersion returns the cloud API version, if available. - + CanApplyLXDProfile is a shim to call the LXDProfileAPIv2 version of this method. - Returns -> StringResult + entities : typing.Sequence[~Entity] + Returns -> BoolResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CloudAPIVersion', + request='CanApplyLXDProfile', version=18, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(CloudSpecResult) - async def CloudSpec(self): + @ReturnMapping(StringResults) + def sync_CharmArchiveSha256(self, urls=None): ''' - CloudSpec returns the cloud spec used by the model in which the - authenticated unit or application resides. - A check is made beforehand to ensure that the request is made by an entity - that has been granted the appropriate trust. - + CharmArchiveSha256 returns the SHA256 digest of the charm archive + (bundle) data for each charm url in the given parameters. - Returns -> CloudSpecResult + urls : typing.Sequence[~CharmURL] + Returns -> StringResults ''' + if urls is not None and not isinstance(urls, (bytes, str, list)): + raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CloudSpec', + request='CharmArchiveSha256', version=18, params=_params) - - reply = await self.rpc(msg) + _params['urls'] = urls + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def CommitHookChanges(self, args=None): + @ReturnMapping(StringResults) + async def CharmArchiveSha256(self, urls=None): ''' - CommitHookChanges batches together all required API calls for applying - a set of changes after a hook successfully completes and executes them in a - single transaction. + CharmArchiveSha256 returns the SHA256 digest of the charm archive + (bundle) data for each charm url in the given parameters. - args : typing.Sequence[~CommitHookChangesArg] - Returns -> ErrorResults + urls : typing.Sequence[~CharmURL] + Returns -> StringResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if urls is not None and not isinstance(urls, (bytes, str, list)): + raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CommitHookChanges', + request='CharmArchiveSha256', version=18, params=_params) - _params['args'] = args + _params['urls'] = urls reply = await self.rpc(msg) return reply - @ReturnMapping(ConfigSettingsResults) - async def ConfigSettings(self, entities=None): + @ReturnMapping(IntResults) + def sync_CharmModifiedVersion(self, entities=None): ''' - ConfigSettings returns the complete set of application charm config - settings available to each given unit. + CharmModifiedVersion returns the most CharmModifiedVersion for all given + units or applications. entities : typing.Sequence[~Entity] - Returns -> ConfigSettingsResults + Returns -> IntResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4256,87 +5211,89 @@ async def ConfigSettings(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ConfigSettings', + request='CharmModifiedVersion', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringResults) - async def CreateSecretURIs(self, count=None): + @ReturnMapping(IntResults) + async def CharmModifiedVersion(self, entities=None): ''' - CreateSecretURIs creates new secret URIs. + CharmModifiedVersion returns the most CharmModifiedVersion for all given + units or applications. - count : int - Returns -> StringResults + entities : typing.Sequence[~Entity] + Returns -> IntResults ''' - if count is not None and not isinstance(count, int): - raise Exception("Expected count to be a int, received: {}".format(type(count))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CreateSecretURIs', + request='CharmModifiedVersion', version=18, params=_params) - _params['count'] = count + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(StringResults) - async def CreateSecrets(self, args=None): + @ReturnMapping(StringBoolResults) + def sync_CharmURL(self, entities=None): ''' - CreateSecrets creates new secrets. + CharmURL returns the charm URL for all given units or applications. - args : typing.Sequence[~CreateSecretArg] - Returns -> StringResults + entities : typing.Sequence[~Entity] + Returns -> StringBoolResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CreateSecrets', + request='CharmURL', version=18, params=_params) - _params['args'] = args - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ModelResult) - async def CurrentModel(self): + @ReturnMapping(StringBoolResults) + async def CharmURL(self, entities=None): ''' - CurrentModel returns the name and UUID for the current juju model. - + CharmURL returns the charm URL for all given units or applications. - Returns -> ModelResult + entities : typing.Sequence[~Entity] + Returns -> StringBoolResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CurrentModel', + request='CharmURL', version=18, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def Destroy(self, entities=None): + def sync_ClearResolved(self, entities=None): ''' - Destroy advances all given Alive units' lifecycles as far as - possible. See state/Unit.Destroy(). + ClearResolved removes any resolved setting from each given unit. entities : typing.Sequence[~Entity] Returns -> ErrorResults @@ -4347,19 +5304,19 @@ async def Destroy(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Destroy', + request='ClearResolved', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def DestroyAllSubordinates(self, entities=None): + async def ClearResolved(self, entities=None): ''' - DestroyAllSubordinates destroys all subordinates of each given unit. + ClearResolved removes any resolved setting from each given unit. entities : typing.Sequence[~Entity] Returns -> ErrorResults @@ -4370,7 +5327,7 @@ async def DestroyAllSubordinates(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='DestroyAllSubordinates', + request='ClearResolved', version=18, params=_params) _params['entities'] = entities @@ -4379,160 +5336,154 @@ async def DestroyAllSubordinates(self, entities=None): - @ReturnMapping(ErrorResults) - async def DestroyUnitStorageAttachments(self, entities=None): + @ReturnMapping(StringResult) + def sync_CloudAPIVersion(self): ''' - DestroyUnitStorageAttachments marks each storage attachment of the - specified units as Dying. + CloudAPIVersion returns the cloud API version, if available. - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + + Returns -> StringResult ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='DestroyUnitStorageAttachments', + request='CloudAPIVersion', version=18, params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) + + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def EnsureDead(self, entities=None): + @ReturnMapping(StringResult) + async def CloudAPIVersion(self): ''' - EnsureDead calls EnsureDead on each given entity from state. It - will fail if the entity is not present. If it's Alive, nothing will - happen (see state/EnsureDead() for units or machines). + CloudAPIVersion returns the cloud API version, if available. - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + + Returns -> StringResult ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='EnsureDead', + request='CloudAPIVersion', version=18, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def EnterScope(self, relation_units=None): + @ReturnMapping(CloudSpecResult) + def sync_CloudSpec(self): ''' - EnterScope ensures each unit has entered its scope in the relation, - for all of the given relation/unit pairs. See also - state.RelationUnit.EnterScope(). + CloudSpec returns the cloud spec used by the model in which the + authenticated unit or application resides. + A check is made beforehand to ensure that the request is made by an entity + that has been granted the appropriate trust. - relation_units : typing.Sequence[~RelationUnit] - Returns -> ErrorResults + + Returns -> CloudSpecResult ''' - if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='EnterScope', + request='CloudSpec', version=18, params=_params) - _params['relation-units'] = relation_units - reply = await self.rpc(msg) + + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def FinishActions(self, results=None): + @ReturnMapping(CloudSpecResult) + async def CloudSpec(self): ''' - FinishActions saves the result of a completed Action + CloudSpec returns the cloud spec used by the model in which the + authenticated unit or application resides. + A check is made beforehand to ensure that the request is made by an entity + that has been granted the appropriate trust. - results : typing.Sequence[~ActionExecutionResult] - Returns -> ErrorResults + + Returns -> CloudSpecResult ''' - if results is not None and not isinstance(results, (bytes, str, list)): - raise Exception("Expected results to be a Sequence, received: {}".format(type(results))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='FinishActions', + request='CloudSpec', version=18, params=_params) - _params['results'] = results + reply = await self.rpc(msg) return reply - @ReturnMapping(SecretConsumerInfoResults) - async def GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): + @ReturnMapping(ErrorResults) + def sync_CommitHookChanges(self, args=None): ''' - GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets. - This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook. + CommitHookChanges batches together all required API calls for applying + a set of changes after a hook successfully completes and executes them in a + single transaction. - consumer_tag : str - uris : typing.Sequence[str] - Returns -> SecretConsumerInfoResults + args : typing.Sequence[~CommitHookChangesArg] + Returns -> ErrorResults ''' - if consumer_tag is not None and not isinstance(consumer_tag, (bytes, str)): - raise Exception("Expected consumer_tag to be a str, received: {}".format(type(consumer_tag))) - - if uris is not None and not isinstance(uris, (bytes, str, list)): - raise Exception("Expected uris to be a Sequence, received: {}".format(type(uris))) + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetConsumerSecretsRevisionInfo', + request='CommitHookChanges', version=18, params=_params) - _params['consumer-tag'] = consumer_tag - _params['uris'] = uris - reply = await self.rpc(msg) + _params['args'] = args + reply = self.sync_rpc(msg) return reply - @ReturnMapping(MeterStatusResults) - async def GetMeterStatus(self, entities=None): + @ReturnMapping(ErrorResults) + async def CommitHookChanges(self, args=None): ''' - entities : typing.Sequence[~Entity] - Returns -> MeterStatusResults + CommitHookChanges batches together all required API calls for applying + a set of changes after a hook successfully completes and executes them in a + single transaction. + + args : typing.Sequence[~CommitHookChangesArg] + Returns -> ErrorResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetMeterStatus', + request='CommitHookChanges', version=18, params=_params) - _params['entities'] = entities + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(StringResults) - async def GetPodSpec(self, entities=None): + @ReturnMapping(ConfigSettingsResults) + def sync_ConfigSettings(self, entities=None): ''' - GetPodSpec gets the pod specs for a set of applications. + ConfigSettings returns the complete set of application charm config + settings available to each given unit. entities : typing.Sequence[~Entity] - Returns -> StringResults + Returns -> ConfigSettingsResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4540,23 +5491,23 @@ async def GetPodSpec(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetPodSpec', + request='ConfigSettings', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringBoolResults) - async def GetPrincipal(self, entities=None): + @ReturnMapping(ConfigSettingsResults) + async def ConfigSettings(self, entities=None): ''' - GetPrincipal returns the result of calling PrincipalName() and - converting it to a tag, on each given unit. + ConfigSettings returns the complete set of application charm config + settings available to each given unit. entities : typing.Sequence[~Entity] - Returns -> StringBoolResults + Returns -> ConfigSettingsResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4564,7 +5515,7 @@ async def GetPrincipal(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetPrincipal', + request='ConfigSettings', version=18, params=_params) _params['entities'] = entities @@ -4574,63 +5525,58 @@ async def GetPrincipal(self, entities=None): @ReturnMapping(StringResults) - async def GetRawK8sSpec(self, entities=None): + def sync_CreateSecretURIs(self, count=None): ''' - GetRawK8sSpec gets the raw k8s specs for a set of applications. + CreateSecretURIs creates new secret URIs. - entities : typing.Sequence[~Entity] + count : int Returns -> StringResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if count is not None and not isinstance(count, int): + raise Exception("Expected count to be a int, received: {}".format(type(count))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetRawK8sSpec', + request='CreateSecretURIs', version=18, params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) + _params['count'] = count + reply = self.sync_rpc(msg) return reply - @ReturnMapping(SecretBackendConfigResults) - async def GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): + @ReturnMapping(StringResults) + async def CreateSecretURIs(self, count=None): ''' - GetSecretBackendConfigs gets the config needed to create a client to secret backends. + CreateSecretURIs creates new secret URIs. - backend_ids : typing.Sequence[str] - for_drain : bool - Returns -> SecretBackendConfigResults + count : int + Returns -> StringResults ''' - if backend_ids is not None and not isinstance(backend_ids, (bytes, str, list)): - raise Exception("Expected backend_ids to be a Sequence, received: {}".format(type(backend_ids))) - - if for_drain is not None and not isinstance(for_drain, bool): - raise Exception("Expected for_drain to be a bool, received: {}".format(type(for_drain))) + if count is not None and not isinstance(count, int): + raise Exception("Expected count to be a int, received: {}".format(type(count))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetSecretBackendConfigs', + request='CreateSecretURIs', version=18, params=_params) - _params['backend-ids'] = backend_ids - _params['for-drain'] = for_drain + _params['count'] = count reply = await self.rpc(msg) return reply - @ReturnMapping(SecretContentResults) - async def GetSecretContentInfo(self, args=None): + @ReturnMapping(StringResults) + def sync_CreateSecrets(self, args=None): ''' - GetSecretContentInfo returns the secret values for the specified secrets. + CreateSecrets creates new secrets. - args : typing.Sequence[~GetSecretContentArg] - Returns -> SecretContentResults + args : typing.Sequence[~CreateSecretArg] + Returns -> StringResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) @@ -4638,99 +5584,88 @@ async def GetSecretContentInfo(self, args=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetSecretContentInfo', + request='CreateSecrets', version=18, params=_params) _params['args'] = args - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ListSecretResults) - async def GetSecretMetadata(self): + @ReturnMapping(StringResults) + async def CreateSecrets(self, args=None): ''' - GetSecretMetadata returns metadata for the caller's secrets. - + CreateSecrets creates new secrets. - Returns -> ListSecretResults + args : typing.Sequence[~CreateSecretArg] + Returns -> StringResults ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetSecretMetadata', + request='CreateSecrets', version=18, params=_params) - + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(SecretContentResults) - async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): - ''' - GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. - - pending_delete : bool - revisions : typing.Sequence[int] - uri : str - Returns -> SecretContentResults + @ReturnMapping(ModelResult) + def sync_CurrentModel(self): ''' - if pending_delete is not None and not isinstance(pending_delete, bool): - raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) + CurrentModel returns the name and UUID for the current juju model. - if revisions is not None and not isinstance(revisions, (bytes, str, list)): - raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) - if uri is not None and not isinstance(uri, (bytes, str)): - raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + Returns -> ModelResult + ''' # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetSecretRevisionContentInfo', + request='CurrentModel', version=18, params=_params) - _params['pending-delete'] = pending_delete - _params['revisions'] = revisions - _params['uri'] = uri - reply = await self.rpc(msg) + + reply = self.sync_rpc(msg) return reply - @ReturnMapping(GoalStateResults) - async def GoalStates(self, entities=None): + @ReturnMapping(ModelResult) + async def CurrentModel(self): ''' - GoalStates returns information of charm units and relations. + CurrentModel returns the name and UUID for the current juju model. - entities : typing.Sequence[~Entity] - Returns -> GoalStateResults + + Returns -> ModelResult ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GoalStates', + request='CurrentModel', version=18, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(BoolResults) - async def HasSubordinates(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_Destroy(self, entities=None): ''' - HasSubordinates returns the whether each given unit has any subordinates. + Destroy advances all given Alive units' lifecycles as far as + possible. See state/Unit.Destroy(). entities : typing.Sequence[~Entity] - Returns -> BoolResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4738,22 +5673,23 @@ async def HasSubordinates(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='HasSubordinates', + request='Destroy', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringResults) - async def LXDProfileName(self, entities=None): + @ReturnMapping(ErrorResults) + async def Destroy(self, entities=None): ''' - LXDProfileName is a shim to call the LXDProfileAPIv2 version of this method. + Destroy advances all given Alive units' lifecycles as far as + possible. See state/Unit.Destroy(). entities : typing.Sequence[~Entity] - Returns -> StringResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4761,7 +5697,7 @@ async def LXDProfileName(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='LXDProfileName', + request='Destroy', version=18, params=_params) _params['entities'] = entities @@ -4770,61 +5706,60 @@ async def LXDProfileName(self, entities=None): - @ReturnMapping(BoolResults) - async def LXDProfileRequired(self, urls=None): + @ReturnMapping(ErrorResults) + def sync_DestroyAllSubordinates(self, entities=None): ''' - LXDProfileRequired is a shim to call the LXDProfileAPIv2 version of this method. + DestroyAllSubordinates destroys all subordinates of each given unit. - urls : typing.Sequence[~CharmURL] - Returns -> BoolResults + entities : typing.Sequence[~Entity] + Returns -> ErrorResults ''' - if urls is not None and not isinstance(urls, (bytes, str, list)): - raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='LXDProfileRequired', + request='DestroyAllSubordinates', version=18, params=_params) - _params['urls'] = urls - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def LeaveScope(self, relation_units=None): + async def DestroyAllSubordinates(self, entities=None): ''' - LeaveScope signals each unit has left its scope in the relation, - for all of the given relation/unit pairs. See also - state.RelationUnit.LeaveScope(). + DestroyAllSubordinates destroys all subordinates of each given unit. - relation_units : typing.Sequence[~RelationUnit] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' - if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='LeaveScope', + request='DestroyAllSubordinates', version=18, params=_params) - _params['relation-units'] = relation_units + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(LifeResults) - async def Life(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_DestroyUnitStorageAttachments(self, entities=None): ''' - Life returns the life status of every supplied entity, where available. + DestroyUnitStorageAttachments marks each storage attachment of the + specified units as Dying. entities : typing.Sequence[~Entity] - Returns -> LifeResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4832,215 +5767,248 @@ async def Life(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Life', + request='DestroyUnitStorageAttachments', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def LogActionsMessages(self, messages=None): + async def DestroyUnitStorageAttachments(self, entities=None): ''' - LogActionsMessages records the log messages against the specified actions. + DestroyUnitStorageAttachments marks each storage attachment of the + specified units as Dying. - messages : typing.Sequence[~EntityString] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' - if messages is not None and not isinstance(messages, (bytes, str, list)): - raise Exception("Expected messages to be a Sequence, received: {}".format(type(messages))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='LogActionsMessages', + request='DestroyUnitStorageAttachments', version=18, params=_params) - _params['messages'] = messages + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def Merge(self, params=None): + def sync_EnsureDead(self, entities=None): ''' - Merge merges in the provided leadership settings. Only leaders for - the given service may perform this operation. + EnsureDead calls EnsureDead on each given entity from state. It + will fail if the entity is not present. If it's Alive, nothing will + happen (see state/EnsureDead() for units or machines). - params : typing.Sequence[~MergeLeadershipSettingsParam] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' - if params is not None and not isinstance(params, (bytes, str, list)): - raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Merge', + request='EnsureDead', version=18, params=_params) - _params['params'] = params - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ModelConfigResult) - async def ModelConfig(self): + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): ''' - ModelConfig returns the current model's configuration. - + EnsureDead calls EnsureDead on each given entity from state. It + will fail if the entity is not present. If it's Alive, nothing will + happen (see state/EnsureDead() for units or machines). - Returns -> ModelConfigResult + entities : typing.Sequence[~Entity] + Returns -> ErrorResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ModelConfig', + request='EnsureDead', version=18, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(StringResult) - async def ModelUUID(self): + @ReturnMapping(ErrorResults) + def sync_EnterScope(self, relation_units=None): ''' - ModelUUID returns the model UUID that this unit resides in. - It is implemented here directly as a result of removing it from - embedded APIAddresser *without* bumping the facade version. - It should be blanked when this facade version is next incremented. - + EnterScope ensures each unit has entered its scope in the relation, + for all of the given relation/unit pairs. See also + state.RelationUnit.EnterScope(). - Returns -> StringResult + relation_units : typing.Sequence[~RelationUnit] + Returns -> ErrorResults ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ModelUUID', + request='EnterScope', version=18, params=_params) - - reply = await self.rpc(msg) + _params['relation-units'] = relation_units + reply = self.sync_rpc(msg) return reply - @ReturnMapping(NetworkInfoResults) - async def NetworkInfo(self, bindings=None, relation_id=None, unit=None): + @ReturnMapping(ErrorResults) + async def EnterScope(self, relation_units=None): ''' - NetworkInfo returns network interfaces/addresses for specified bindings. + EnterScope ensures each unit has entered its scope in the relation, + for all of the given relation/unit pairs. See also + state.RelationUnit.EnterScope(). - bindings : typing.Sequence[str] - relation_id : int - unit : str - Returns -> NetworkInfoResults + relation_units : typing.Sequence[~RelationUnit] + Returns -> ErrorResults ''' - if bindings is not None and not isinstance(bindings, (bytes, str, list)): - raise Exception("Expected bindings to be a Sequence, received: {}".format(type(bindings))) - - if relation_id is not None and not isinstance(relation_id, int): - raise Exception("Expected relation_id to be a int, received: {}".format(type(relation_id))) - - if unit is not None and not isinstance(unit, (bytes, str)): - raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='NetworkInfo', + request='EnterScope', version=18, params=_params) - _params['bindings'] = bindings - _params['relation-id'] = relation_id - _params['unit'] = unit + _params['relation-units'] = relation_units reply = await self.rpc(msg) return reply - @ReturnMapping(ApplicationOpenedPortsResults) - async def OpenedApplicationPortRangesByEndpoint(self, tag=None): + @ReturnMapping(ErrorResults) + def sync_FinishActions(self, results=None): ''' - OpenedApplicationPortRangesByEndpoint returns the port ranges opened by each application. + FinishActions saves the result of a completed Action - tag : str - Returns -> ApplicationOpenedPortsResults + results : typing.Sequence[~ActionExecutionResult] + Returns -> ErrorResults ''' - if tag is not None and not isinstance(tag, (bytes, str)): - raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + if results is not None and not isinstance(results, (bytes, str, list)): + raise Exception("Expected results to be a Sequence, received: {}".format(type(results))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='OpenedApplicationPortRangesByEndpoint', + request='FinishActions', version=18, params=_params) - _params['tag'] = tag - reply = await self.rpc(msg) + _params['results'] = results + reply = self.sync_rpc(msg) return reply - @ReturnMapping(OpenPortRangesByEndpointResults) - async def OpenedMachinePortRangesByEndpoint(self, entities=None): + @ReturnMapping(ErrorResults) + async def FinishActions(self, results=None): ''' - OpenedMachinePortRangesByEndpoint returns the port ranges opened by each - unit on the provided machines grouped by application endpoint. + FinishActions saves the result of a completed Action - entities : typing.Sequence[~Entity] - Returns -> OpenPortRangesByEndpointResults + results : typing.Sequence[~ActionExecutionResult] + Returns -> ErrorResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if results is not None and not isinstance(results, (bytes, str, list)): + raise Exception("Expected results to be a Sequence, received: {}".format(type(results))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='OpenedMachinePortRangesByEndpoint', + request='FinishActions', version=18, params=_params) - _params['entities'] = entities + _params['results'] = results reply = await self.rpc(msg) return reply - @ReturnMapping(OpenPortRangesByEndpointResults) - async def OpenedPortRangesByEndpoint(self): + @ReturnMapping(SecretConsumerInfoResults) + def sync_GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): ''' - OpenedPortRangesByEndpoint returns the port ranges opened by the unit. - + GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets. + This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook. - Returns -> OpenPortRangesByEndpointResults + consumer_tag : str + uris : typing.Sequence[str] + Returns -> SecretConsumerInfoResults ''' + if consumer_tag is not None and not isinstance(consumer_tag, (bytes, str)): + raise Exception("Expected consumer_tag to be a str, received: {}".format(type(consumer_tag))) + + if uris is not None and not isinstance(uris, (bytes, str, list)): + raise Exception("Expected uris to be a Sequence, received: {}".format(type(uris))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='OpenedPortRangesByEndpoint', + request='GetConsumerSecretsRevisionInfo', version=18, params=_params) + _params['consumer-tag'] = consumer_tag + _params['uris'] = uris + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SecretConsumerInfoResults) + async def GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): + ''' + GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets. + This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook. + consumer_tag : str + uris : typing.Sequence[str] + Returns -> SecretConsumerInfoResults + ''' + if consumer_tag is not None and not isinstance(consumer_tag, (bytes, str)): + raise Exception("Expected consumer_tag to be a str, received: {}".format(type(consumer_tag))) + + if uris is not None and not isinstance(uris, (bytes, str, list)): + raise Exception("Expected uris to be a Sequence, received: {}".format(type(uris))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetConsumerSecretsRevisionInfo', + version=18, + params=_params) + _params['consumer-tag'] = consumer_tag + _params['uris'] = uris reply = await self.rpc(msg) return reply - @ReturnMapping(StringResults) - async def PrivateAddress(self, entities=None): + @ReturnMapping(MeterStatusResults) + def sync_GetMeterStatus(self, entities=None): ''' - PrivateAddress returns the private address for each given unit, if set. - entities : typing.Sequence[~Entity] - Returns -> StringResults + Returns -> MeterStatusResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5048,45 +6016,40 @@ async def PrivateAddress(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='PrivateAddress', + request='GetMeterStatus', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringResult) - async def ProviderType(self): + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): ''' - ProviderType returns the provider type used by the current juju - model. - - TODO(dimitern): Refactor the uniter to call this instead of calling - ModelConfig() just to get the provider type. Once we have machine - addresses, this might be completely unnecessary though. - - - Returns -> StringResult + entities : typing.Sequence[~Entity] + Returns -> MeterStatusResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ProviderType', + request='GetMeterStatus', version=18, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(StringResults) - async def PublicAddress(self, entities=None): + def sync_GetPodSpec(self, entities=None): ''' - PublicAddress returns the public address for each given unit, if set. + GetPodSpec gets the pod specs for a set of applications. entities : typing.Sequence[~Entity] Returns -> StringResults @@ -5097,23 +6060,22 @@ async def PublicAddress(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='PublicAddress', + request='GetPodSpec', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(GetLeadershipSettingsBulkResults) - async def Read(self, entities=None): + @ReturnMapping(StringResults) + async def GetPodSpec(self, entities=None): ''' - Read reads leadership settings for the provided service ID. Any - unit of the service may perform this operation. + GetPodSpec gets the pod specs for a set of applications. entities : typing.Sequence[~Entity] - Returns -> GetLeadershipSettingsBulkResults + Returns -> StringResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5121,7 +6083,7 @@ async def Read(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Read', + request='GetPodSpec', version=18, params=_params) _params['entities'] = entities @@ -5130,94 +6092,84 @@ async def Read(self, entities=None): - @ReturnMapping(SettingsResult) - async def ReadLocalApplicationSettings(self, relation=None, unit=None): + @ReturnMapping(StringBoolResults) + def sync_GetPrincipal(self, entities=None): ''' - ReadLocalApplicationSettings returns the local application settings for a - particular relation when invoked by the leader unit. + GetPrincipal returns the result of calling PrincipalName() and + converting it to a tag, on each given unit. - relation : str - unit : str - Returns -> SettingsResult + entities : typing.Sequence[~Entity] + Returns -> StringBoolResults ''' - if relation is not None and not isinstance(relation, (bytes, str)): - raise Exception("Expected relation to be a str, received: {}".format(type(relation))) - - if unit is not None and not isinstance(unit, (bytes, str)): - raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ReadLocalApplicationSettings', + request='GetPrincipal', version=18, params=_params) - _params['relation'] = relation - _params['unit'] = unit - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(SettingsResults) - async def ReadRemoteSettings(self, relation_unit_pairs=None): + @ReturnMapping(StringBoolResults) + async def GetPrincipal(self, entities=None): ''' - ReadRemoteSettings returns the remote settings of each given set of - relation/local unit/remote unit. + GetPrincipal returns the result of calling PrincipalName() and + converting it to a tag, on each given unit. - relation_unit_pairs : typing.Sequence[~RelationUnitPair] - Returns -> SettingsResults + entities : typing.Sequence[~Entity] + Returns -> StringBoolResults ''' - if relation_unit_pairs is not None and not isinstance(relation_unit_pairs, (bytes, str, list)): - raise Exception("Expected relation_unit_pairs to be a Sequence, received: {}".format(type(relation_unit_pairs))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ReadRemoteSettings', + request='GetPrincipal', version=18, params=_params) - _params['relation-unit-pairs'] = relation_unit_pairs + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(SettingsResults) - async def ReadSettings(self, relation_units=None): + @ReturnMapping(StringResults) + def sync_GetRawK8sSpec(self, entities=None): ''' - ReadSettings returns the local settings of each given set of - relation/unit. - - NOTE(achilleasa): Using this call to read application data is deprecated - and will not work for k8s charms (see LP1876097). Instead, clients should - use ReadLocalApplicationSettings. + GetRawK8sSpec gets the raw k8s specs for a set of applications. - relation_units : typing.Sequence[~RelationUnit] - Returns -> SettingsResults + entities : typing.Sequence[~Entity] + Returns -> StringResults ''' - if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ReadSettings', + request='GetRawK8sSpec', version=18, params=_params) - _params['relation-units'] = relation_units - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(UnitRefreshResults) - async def Refresh(self, entities=None): + @ReturnMapping(StringResults) + async def GetRawK8sSpec(self, entities=None): ''' - Refresh retrieves the latest values for attributes on this unit. + GetRawK8sSpec gets the raw k8s specs for a set of applications. entities : typing.Sequence[~Entity] - Returns -> UnitRefreshResults + Returns -> StringResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5225,7 +6177,7 @@ async def Refresh(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Refresh', + request='GetRawK8sSpec', version=18, params=_params) _params['entities'] = entities @@ -5234,62 +6186,2210 @@ async def Refresh(self, entities=None): + @ReturnMapping(SecretBackendConfigResults) + def sync_GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): + ''' + GetSecretBackendConfigs gets the config needed to create a client to secret backends. + + backend_ids : typing.Sequence[str] + for_drain : bool + Returns -> SecretBackendConfigResults + ''' + if backend_ids is not None and not isinstance(backend_ids, (bytes, str, list)): + raise Exception("Expected backend_ids to be a Sequence, received: {}".format(type(backend_ids))) + + if for_drain is not None and not isinstance(for_drain, bool): + raise Exception("Expected for_drain to be a bool, received: {}".format(type(for_drain))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretBackendConfigs', + version=18, + params=_params) + _params['backend-ids'] = backend_ids + _params['for-drain'] = for_drain + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SecretBackendConfigResults) + async def GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): + ''' + GetSecretBackendConfigs gets the config needed to create a client to secret backends. + + backend_ids : typing.Sequence[str] + for_drain : bool + Returns -> SecretBackendConfigResults + ''' + if backend_ids is not None and not isinstance(backend_ids, (bytes, str, list)): + raise Exception("Expected backend_ids to be a Sequence, received: {}".format(type(backend_ids))) + + if for_drain is not None and not isinstance(for_drain, bool): + raise Exception("Expected for_drain to be a bool, received: {}".format(type(for_drain))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretBackendConfigs', + version=18, + params=_params) + _params['backend-ids'] = backend_ids + _params['for-drain'] = for_drain + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + def sync_GetSecretContentInfo(self, args=None): + ''' + GetSecretContentInfo returns the secret values for the specified secrets. + + args : typing.Sequence[~GetSecretContentArg] + Returns -> SecretContentResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretContentInfo', + version=18, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + async def GetSecretContentInfo(self, args=None): + ''' + GetSecretContentInfo returns the secret values for the specified secrets. + + args : typing.Sequence[~GetSecretContentArg] + Returns -> SecretContentResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretContentInfo', + version=18, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListSecretResults) + def sync_GetSecretMetadata(self): + ''' + GetSecretMetadata returns metadata for the caller's secrets. + + + Returns -> ListSecretResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretMetadata', + version=18, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ListSecretResults) + async def GetSecretMetadata(self): + ''' + GetSecretMetadata returns metadata for the caller's secrets. + + + Returns -> ListSecretResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretMetadata', + version=18, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + def sync_GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): + ''' + GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. + + pending_delete : bool + revisions : typing.Sequence[int] + uri : str + Returns -> SecretContentResults + ''' + if pending_delete is not None and not isinstance(pending_delete, bool): + raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) + + if revisions is not None and not isinstance(revisions, (bytes, str, list)): + raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretRevisionContentInfo', + version=18, + params=_params) + _params['pending-delete'] = pending_delete + _params['revisions'] = revisions + _params['uri'] = uri + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): + ''' + GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. + + pending_delete : bool + revisions : typing.Sequence[int] + uri : str + Returns -> SecretContentResults + ''' + if pending_delete is not None and not isinstance(pending_delete, bool): + raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) + + if revisions is not None and not isinstance(revisions, (bytes, str, list)): + raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretRevisionContentInfo', + version=18, + params=_params) + _params['pending-delete'] = pending_delete + _params['revisions'] = revisions + _params['uri'] = uri + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GoalStateResults) + def sync_GoalStates(self, entities=None): + ''' + GoalStates returns information of charm units and relations. + + entities : typing.Sequence[~Entity] + Returns -> GoalStateResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GoalStates', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(GoalStateResults) + async def GoalStates(self, entities=None): + ''' + GoalStates returns information of charm units and relations. + + entities : typing.Sequence[~Entity] + Returns -> GoalStateResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GoalStates', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + def sync_HasSubordinates(self, entities=None): + ''' + HasSubordinates returns the whether each given unit has any subordinates. + + entities : typing.Sequence[~Entity] + Returns -> BoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='HasSubordinates', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def HasSubordinates(self, entities=None): + ''' + HasSubordinates returns the whether each given unit has any subordinates. + + entities : typing.Sequence[~Entity] + Returns -> BoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='HasSubordinates', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + def sync_LXDProfileName(self, entities=None): + ''' + LXDProfileName is a shim to call the LXDProfileAPIv2 version of this method. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LXDProfileName', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def LXDProfileName(self, entities=None): + ''' + LXDProfileName is a shim to call the LXDProfileAPIv2 version of this method. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LXDProfileName', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + def sync_LXDProfileRequired(self, urls=None): + ''' + LXDProfileRequired is a shim to call the LXDProfileAPIv2 version of this method. + + urls : typing.Sequence[~CharmURL] + Returns -> BoolResults + ''' + if urls is not None and not isinstance(urls, (bytes, str, list)): + raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LXDProfileRequired', + version=18, + params=_params) + _params['urls'] = urls + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def LXDProfileRequired(self, urls=None): + ''' + LXDProfileRequired is a shim to call the LXDProfileAPIv2 version of this method. + + urls : typing.Sequence[~CharmURL] + Returns -> BoolResults + ''' + if urls is not None and not isinstance(urls, (bytes, str, list)): + raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LXDProfileRequired', + version=18, + params=_params) + _params['urls'] = urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_LeaveScope(self, relation_units=None): + ''' + LeaveScope signals each unit has left its scope in the relation, + for all of the given relation/unit pairs. See also + state.RelationUnit.LeaveScope(). + + relation_units : typing.Sequence[~RelationUnit] + Returns -> ErrorResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LeaveScope', + version=18, + params=_params) + _params['relation-units'] = relation_units + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LeaveScope(self, relation_units=None): + ''' + LeaveScope signals each unit has left its scope in the relation, + for all of the given relation/unit pairs. See also + state.RelationUnit.LeaveScope(). + + relation_units : typing.Sequence[~RelationUnit] + Returns -> ErrorResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LeaveScope', + version=18, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Life', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Life', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_LogActionsMessages(self, messages=None): + ''' + LogActionsMessages records the log messages against the specified actions. + + messages : typing.Sequence[~EntityString] + Returns -> ErrorResults + ''' + if messages is not None and not isinstance(messages, (bytes, str, list)): + raise Exception("Expected messages to be a Sequence, received: {}".format(type(messages))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LogActionsMessages', + version=18, + params=_params) + _params['messages'] = messages + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LogActionsMessages(self, messages=None): + ''' + LogActionsMessages records the log messages against the specified actions. + + messages : typing.Sequence[~EntityString] + Returns -> ErrorResults + ''' + if messages is not None and not isinstance(messages, (bytes, str, list)): + raise Exception("Expected messages to be a Sequence, received: {}".format(type(messages))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LogActionsMessages', + version=18, + params=_params) + _params['messages'] = messages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_Merge(self, params=None): + ''' + Merge merges in the provided leadership settings. Only leaders for + the given service may perform this operation. + + params : typing.Sequence[~MergeLeadershipSettingsParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Merge', + version=18, + params=_params) + _params['params'] = params + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Merge(self, params=None): + ''' + Merge merges in the provided leadership settings. Only leaders for + the given service may perform this operation. + + params : typing.Sequence[~MergeLeadershipSettingsParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Merge', + version=18, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + def sync_ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelConfig', + version=18, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelConfig', + version=18, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + def sync_ModelUUID(self): + ''' + ModelUUID returns the model UUID that this unit resides in. + It is implemented here directly as a result of removing it from + embedded APIAddresser *without* bumping the facade version. + It should be blanked when this facade version is next incremented. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelUUID', + version=18, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + ModelUUID returns the model UUID that this unit resides in. + It is implemented here directly as a result of removing it from + embedded APIAddresser *without* bumping the facade version. + It should be blanked when this facade version is next incremented. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelUUID', + version=18, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NetworkInfoResults) + def sync_NetworkInfo(self, bindings=None, relation_id=None, unit=None): + ''' + NetworkInfo returns network interfaces/addresses for specified bindings. + + bindings : typing.Sequence[str] + relation_id : int + unit : str + Returns -> NetworkInfoResults + ''' + if bindings is not None and not isinstance(bindings, (bytes, str, list)): + raise Exception("Expected bindings to be a Sequence, received: {}".format(type(bindings))) + + if relation_id is not None and not isinstance(relation_id, int): + raise Exception("Expected relation_id to be a int, received: {}".format(type(relation_id))) + + if unit is not None and not isinstance(unit, (bytes, str)): + raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='NetworkInfo', + version=18, + params=_params) + _params['bindings'] = bindings + _params['relation-id'] = relation_id + _params['unit'] = unit + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NetworkInfoResults) + async def NetworkInfo(self, bindings=None, relation_id=None, unit=None): + ''' + NetworkInfo returns network interfaces/addresses for specified bindings. + + bindings : typing.Sequence[str] + relation_id : int + unit : str + Returns -> NetworkInfoResults + ''' + if bindings is not None and not isinstance(bindings, (bytes, str, list)): + raise Exception("Expected bindings to be a Sequence, received: {}".format(type(bindings))) + + if relation_id is not None and not isinstance(relation_id, int): + raise Exception("Expected relation_id to be a int, received: {}".format(type(relation_id))) + + if unit is not None and not isinstance(unit, (bytes, str)): + raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='NetworkInfo', + version=18, + params=_params) + _params['bindings'] = bindings + _params['relation-id'] = relation_id + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationOpenedPortsResults) + def sync_OpenedApplicationPortRangesByEndpoint(self, tag=None): + ''' + OpenedApplicationPortRangesByEndpoint returns the port ranges opened by each application. + + tag : str + Returns -> ApplicationOpenedPortsResults + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='OpenedApplicationPortRangesByEndpoint', + version=18, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ApplicationOpenedPortsResults) + async def OpenedApplicationPortRangesByEndpoint(self, tag=None): + ''' + OpenedApplicationPortRangesByEndpoint returns the port ranges opened by each application. + + tag : str + Returns -> ApplicationOpenedPortsResults + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='OpenedApplicationPortRangesByEndpoint', + version=18, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OpenPortRangesByEndpointResults) + def sync_OpenedMachinePortRangesByEndpoint(self, entities=None): + ''' + OpenedMachinePortRangesByEndpoint returns the port ranges opened by each + unit on the provided machines grouped by application endpoint. + + entities : typing.Sequence[~Entity] + Returns -> OpenPortRangesByEndpointResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='OpenedMachinePortRangesByEndpoint', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(OpenPortRangesByEndpointResults) + async def OpenedMachinePortRangesByEndpoint(self, entities=None): + ''' + OpenedMachinePortRangesByEndpoint returns the port ranges opened by each + unit on the provided machines grouped by application endpoint. + + entities : typing.Sequence[~Entity] + Returns -> OpenPortRangesByEndpointResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='OpenedMachinePortRangesByEndpoint', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OpenPortRangesByEndpointResults) + def sync_OpenedPortRangesByEndpoint(self): + ''' + OpenedPortRangesByEndpoint returns the port ranges opened by the unit. + + + Returns -> OpenPortRangesByEndpointResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='OpenedPortRangesByEndpoint', + version=18, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(OpenPortRangesByEndpointResults) + async def OpenedPortRangesByEndpoint(self): + ''' + OpenedPortRangesByEndpoint returns the port ranges opened by the unit. + + + Returns -> OpenPortRangesByEndpointResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='OpenedPortRangesByEndpoint', + version=18, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + def sync_PrivateAddress(self, entities=None): + ''' + PrivateAddress returns the private address for each given unit, if set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='PrivateAddress', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PrivateAddress(self, entities=None): + ''' + PrivateAddress returns the private address for each given unit, if set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='PrivateAddress', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + def sync_ProviderType(self): + ''' + ProviderType returns the provider type used by the current juju + model. + + TODO(dimitern): Refactor the uniter to call this instead of calling + ModelConfig() just to get the provider type. Once we have machine + addresses, this might be completely unnecessary though. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ProviderType', + version=18, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ProviderType(self): + ''' + ProviderType returns the provider type used by the current juju + model. + + TODO(dimitern): Refactor the uniter to call this instead of calling + ModelConfig() just to get the provider type. Once we have machine + addresses, this might be completely unnecessary though. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ProviderType', + version=18, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + def sync_PublicAddress(self, entities=None): + ''' + PublicAddress returns the public address for each given unit, if set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='PublicAddress', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PublicAddress(self, entities=None): + ''' + PublicAddress returns the public address for each given unit, if set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='PublicAddress', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetLeadershipSettingsBulkResults) + def sync_Read(self, entities=None): + ''' + Read reads leadership settings for the provided service ID. Any + unit of the service may perform this operation. + + entities : typing.Sequence[~Entity] + Returns -> GetLeadershipSettingsBulkResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Read', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(GetLeadershipSettingsBulkResults) + async def Read(self, entities=None): + ''' + Read reads leadership settings for the provided service ID. Any + unit of the service may perform this operation. + + entities : typing.Sequence[~Entity] + Returns -> GetLeadershipSettingsBulkResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Read', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResult) + def sync_ReadLocalApplicationSettings(self, relation=None, unit=None): + ''' + ReadLocalApplicationSettings returns the local application settings for a + particular relation when invoked by the leader unit. + + relation : str + unit : str + Returns -> SettingsResult + ''' + if relation is not None and not isinstance(relation, (bytes, str)): + raise Exception("Expected relation to be a str, received: {}".format(type(relation))) + + if unit is not None and not isinstance(unit, (bytes, str)): + raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadLocalApplicationSettings', + version=18, + params=_params) + _params['relation'] = relation + _params['unit'] = unit + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SettingsResult) + async def ReadLocalApplicationSettings(self, relation=None, unit=None): + ''' + ReadLocalApplicationSettings returns the local application settings for a + particular relation when invoked by the leader unit. + + relation : str + unit : str + Returns -> SettingsResult + ''' + if relation is not None and not isinstance(relation, (bytes, str)): + raise Exception("Expected relation to be a str, received: {}".format(type(relation))) + + if unit is not None and not isinstance(unit, (bytes, str)): + raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadLocalApplicationSettings', + version=18, + params=_params) + _params['relation'] = relation + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + def sync_ReadRemoteSettings(self, relation_unit_pairs=None): + ''' + ReadRemoteSettings returns the remote settings of each given set of + relation/local unit/remote unit. + + relation_unit_pairs : typing.Sequence[~RelationUnitPair] + Returns -> SettingsResults + ''' + if relation_unit_pairs is not None and not isinstance(relation_unit_pairs, (bytes, str, list)): + raise Exception("Expected relation_unit_pairs to be a Sequence, received: {}".format(type(relation_unit_pairs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadRemoteSettings', + version=18, + params=_params) + _params['relation-unit-pairs'] = relation_unit_pairs + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadRemoteSettings(self, relation_unit_pairs=None): + ''' + ReadRemoteSettings returns the remote settings of each given set of + relation/local unit/remote unit. + + relation_unit_pairs : typing.Sequence[~RelationUnitPair] + Returns -> SettingsResults + ''' + if relation_unit_pairs is not None and not isinstance(relation_unit_pairs, (bytes, str, list)): + raise Exception("Expected relation_unit_pairs to be a Sequence, received: {}".format(type(relation_unit_pairs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadRemoteSettings', + version=18, + params=_params) + _params['relation-unit-pairs'] = relation_unit_pairs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + def sync_ReadSettings(self, relation_units=None): + ''' + ReadSettings returns the local settings of each given set of + relation/unit. + + NOTE(achilleasa): Using this call to read application data is deprecated + and will not work for k8s charms (see LP1876097). Instead, clients should + use ReadLocalApplicationSettings. + + relation_units : typing.Sequence[~RelationUnit] + Returns -> SettingsResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadSettings', + version=18, + params=_params) + _params['relation-units'] = relation_units + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadSettings(self, relation_units=None): + ''' + ReadSettings returns the local settings of each given set of + relation/unit. + + NOTE(achilleasa): Using this call to read application data is deprecated + and will not work for k8s charms (see LP1876097). Instead, clients should + use ReadLocalApplicationSettings. + + relation_units : typing.Sequence[~RelationUnit] + Returns -> SettingsResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadSettings', + version=18, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitRefreshResults) + def sync_Refresh(self, entities=None): + ''' + Refresh retrieves the latest values for attributes on this unit. + + entities : typing.Sequence[~Entity] + Returns -> UnitRefreshResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Refresh', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(UnitRefreshResults) + async def Refresh(self, entities=None): + ''' + Refresh retrieves the latest values for attributes on this unit. + + entities : typing.Sequence[~Entity] + Returns -> UnitRefreshResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Refresh', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + def sync_Relation(self, relation_units=None): + ''' + Relation returns information about all given relation/unit pairs, + including their id, key and the local endpoint. + + relation_units : typing.Sequence[~RelationUnit] + Returns -> RelationResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Relation', + version=18, + params=_params) + _params['relation-units'] = relation_units + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RelationResults) async def Relation(self, relation_units=None): ''' - Relation returns information about all given relation/unit pairs, - including their id, key and the local endpoint. + Relation returns information about all given relation/unit pairs, + including their id, key and the local endpoint. + + relation_units : typing.Sequence[~RelationUnit] + Returns -> RelationResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Relation', + version=18, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + def sync_RelationById(self, relation_ids=None): + ''' + RelationById returns information about all given relations, + specified by their ids, including their key and the local + endpoint. + + relation_ids : typing.Sequence[int] + Returns -> RelationResults + ''' + if relation_ids is not None and not isinstance(relation_ids, (bytes, str, list)): + raise Exception("Expected relation_ids to be a Sequence, received: {}".format(type(relation_ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RelationById', + version=18, + params=_params) + _params['relation-ids'] = relation_ids + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def RelationById(self, relation_ids=None): + ''' + RelationById returns information about all given relations, + specified by their ids, including their key and the local + endpoint. + + relation_ids : typing.Sequence[int] + Returns -> RelationResults + ''' + if relation_ids is not None and not isinstance(relation_ids, (bytes, str, list)): + raise Exception("Expected relation_ids to be a Sequence, received: {}".format(type(relation_ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RelationById', + version=18, + params=_params) + _params['relation-ids'] = relation_ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitStatusResults) + def sync_RelationsStatus(self, entities=None): + ''' + RelationsStatus returns for each unit the corresponding relation and status information. + + entities : typing.Sequence[~Entity] + Returns -> RelationUnitStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RelationsStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitStatusResults) + async def RelationsStatus(self, entities=None): + ''' + RelationsStatus returns for each unit the corresponding relation and status information. + + entities : typing.Sequence[~Entity] + Returns -> RelationUnitStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RelationsStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_RemoveSecrets(self, args=None): + ''' + RemoveSecrets removes the specified secrets. + + args : typing.Sequence[~DeleteSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RemoveSecrets', + version=18, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveSecrets(self, args=None): + ''' + RemoveSecrets removes the specified secrets. + + args : typing.Sequence[~DeleteSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RemoveSecrets', + version=18, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_RemoveStorageAttachments(self, ids=None): + ''' + RemoveStorageAttachments removes the specified storage + attachments from state. + + ids : typing.Sequence[~StorageAttachmentId] + Returns -> ErrorResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RemoveStorageAttachments', + version=18, + params=_params) + _params['ids'] = ids + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveStorageAttachments(self, ids=None): + ''' + RemoveStorageAttachments removes the specified storage + attachments from state. + + ids : typing.Sequence[~StorageAttachmentId] + Returns -> ErrorResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RemoveStorageAttachments', + version=18, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_RequestReboot(self, entities=None): + ''' + RequestReboot sets the reboot flag on the provided machines + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RequestReboot', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RequestReboot(self, entities=None): + ''' + RequestReboot sets the reboot flag on the provided machines + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RequestReboot', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolvedModeResults) + def sync_Resolved(self, entities=None): + ''' + Resolved returns the current resolved setting for each given unit. + + entities : typing.Sequence[~Entity] + Returns -> ResolvedModeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Resolved', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ResolvedModeResults) + async def Resolved(self, entities=None): + ''' + Resolved returns the current resolved setting for each given unit. + + entities : typing.Sequence[~Entity] + Returns -> ResolvedModeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Resolved', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + def sync_SLALevel(self): + ''' + SLALevel returns the model's SLA level. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SLALevel', + version=18, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + SLALevel returns the model's SLA level. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SLALevel', + version=18, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SecretsGrant(self, args=None): + ''' + SecretsGrant grants access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsGrant', + version=18, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SecretsGrant(self, args=None): + ''' + SecretsGrant grants access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsGrant', + version=18, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SecretsRevoke(self, args=None): + ''' + SecretsRevoke revokes access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsRevoke', + version=18, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SecretsRevoke(self, args=None): + ''' + SecretsRevoke revokes access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsRevoke', + version=18, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SecretsRotated(self, args=None): + ''' + SecretsRotated records when secrets were last rotated. + + args : typing.Sequence[~SecretRotatedArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsRotated', + version=18, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SecretsRotated(self, args=None): + ''' + SecretsRotated records when secrets were last rotated. + + args : typing.Sequence[~SecretRotatedArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsRotated', + version=18, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetAgentStatus(self, entities=None): + ''' + SetAgentStatus will set status for agents of Units passed in args, if one + of the args is not an Unit it will fail. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetAgentStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetAgentStatus(self, entities=None): + ''' + SetAgentStatus will set status for agents of Units passed in args, if one + of the args is not an Unit it will fail. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetAgentStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetApplicationStatus(self, entities=None): + ''' + SetApplicationStatus sets the status for all the Applications in args if the given Unit is + the leader. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetApplicationStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationStatus(self, entities=None): + ''' + SetApplicationStatus sets the status for all the Applications in args if the given Unit is + the leader. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetApplicationStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetCharmURL(self, entities=None): + ''' + SetCharmURL sets the charm URL for each given unit. An error will + be returned if a unit is dead, or the charm URL is not known. + + entities : typing.Sequence[~EntityCharmURL] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetCharmURL', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmURL(self, entities=None): + ''' + SetCharmURL sets the charm URL for each given unit. An error will + be returned if a unit is dead, or the charm URL is not known. + + entities : typing.Sequence[~EntityCharmURL] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetCharmURL', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetRelationStatus(self, args=None): + ''' + SetRelationStatus updates the status of the specified relations. - relation_units : typing.Sequence[~RelationUnit] - Returns -> RelationResults + args : typing.Sequence[~RelationStatusArg] + Returns -> ErrorResults ''' - if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Relation', + request='SetRelationStatus', version=18, params=_params) - _params['relation-units'] = relation_units + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationStatus(self, args=None): + ''' + SetRelationStatus updates the status of the specified relations. + + args : typing.Sequence[~RelationStatusArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetRelationStatus', + version=18, + params=_params) + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(RelationResults) - async def RelationById(self, relation_ids=None): + @ReturnMapping(ErrorResults) + def sync_SetState(self, args=None): ''' - RelationById returns information about all given relations, - specified by their ids, including their key and the local - endpoint. + SetState sets the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. - relation_ids : typing.Sequence[int] - Returns -> RelationResults + args : typing.Sequence[~SetUnitStateArg] + Returns -> ErrorResults ''' - if relation_ids is not None and not isinstance(relation_ids, (bytes, str, list)): - raise Exception("Expected relation_ids to be a Sequence, received: {}".format(type(relation_ids))) + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetState', + version=18, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetState(self, args=None): + ''' + SetState sets the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. + + args : typing.Sequence[~SetUnitStateArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetState', + version=18, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetStatus(self, entities=None): + ''' + SetStatus will set status for a entities passed in args. If the entity is + a Unit it will instead set status to its agent, to emulate backwards + compatibility. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + SetStatus will set status for a entities passed in args. If the entity is + a Unit it will instead set status to its agent, to emulate backwards + compatibility. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetUnitStatus(self, entities=None): + ''' + SetUnitStatus sets status for all elements passed in args, the difference + with SetStatus is that if an entity is a Unit it will set its status instead + of its agent. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetUnitStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUnitStatus(self, entities=None): + ''' + SetUnitStatus sets status for all elements passed in args, the difference + with SetStatus is that if an entity is a Unit it will set its status instead + of its agent. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetUnitStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetUpgradeSeriesUnitStatus(self, params=None): + ''' + SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit. + If no upgrade is in progress an error is returned instead. + + params : typing.Sequence[~UpgradeSeriesStatusParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetUpgradeSeriesUnitStatus', + version=18, + params=_params) + _params['params'] = params + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUpgradeSeriesUnitStatus(self, params=None): + ''' + SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit. + If no upgrade is in progress an error is returned instead. + + params : typing.Sequence[~UpgradeSeriesStatusParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetUpgradeSeriesUnitStatus', + version=18, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetWorkloadVersion(self, entities=None): + ''' + SetWorkloadVersion sets the workload version for each given unit. An error will + be returned if a unit is dead. + + entities : typing.Sequence[~EntityWorkloadVersion] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='RelationById', + request='SetWorkloadVersion', version=18, params=_params) - _params['relation-ids'] = relation_ids - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(RelationUnitStatusResults) - async def RelationsStatus(self, entities=None): + @ReturnMapping(ErrorResults) + async def SetWorkloadVersion(self, entities=None): ''' - RelationsStatus returns for each unit the corresponding relation and status information. + SetWorkloadVersion sets the workload version for each given unit. An error will + be returned if a unit is dead. - entities : typing.Sequence[~Entity] - Returns -> RelationUnitStatusResults + entities : typing.Sequence[~EntityWorkloadVersion] + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5297,7 +8397,7 @@ async def RelationsStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='RelationsStatus', + request='SetWorkloadVersion', version=18, params=_params) _params['entities'] = entities @@ -5306,197 +8406,201 @@ async def RelationsStatus(self, entities=None): - @ReturnMapping(ErrorResults) - async def RemoveSecrets(self, args=None): + @ReturnMapping(UnitStateResults) + def sync_State(self, entities=None): ''' - RemoveSecrets removes the specified secrets. + State returns the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. - args : typing.Sequence[~DeleteSecretArg] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> UnitStateResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='RemoveSecrets', + request='State', version=18, params=_params) - _params['args'] = args - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def RemoveStorageAttachments(self, ids=None): + @ReturnMapping(UnitStateResults) + async def State(self, entities=None): ''' - RemoveStorageAttachments removes the specified storage - attachments from state. + State returns the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. - ids : typing.Sequence[~StorageAttachmentId] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> UnitStateResults ''' - if ids is not None and not isinstance(ids, (bytes, str, list)): - raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='RemoveStorageAttachments', + request='State', version=18, params=_params) - _params['ids'] = ids + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def RequestReboot(self, entities=None): + @ReturnMapping(LifeResults) + def sync_StorageAttachmentLife(self, ids=None): ''' - RequestReboot sets the reboot flag on the provided machines + StorageAttachmentLife returns the lifecycle state of the storage attachments + with the specified tags. - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + ids : typing.Sequence[~StorageAttachmentId] + Returns -> LifeResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='RequestReboot', + request='StorageAttachmentLife', version=18, params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) + _params['ids'] = ids + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ResolvedModeResults) - async def Resolved(self, entities=None): + @ReturnMapping(LifeResults) + async def StorageAttachmentLife(self, ids=None): ''' - Resolved returns the current resolved setting for each given unit. + StorageAttachmentLife returns the lifecycle state of the storage attachments + with the specified tags. - entities : typing.Sequence[~Entity] - Returns -> ResolvedModeResults + ids : typing.Sequence[~StorageAttachmentId] + Returns -> LifeResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Resolved', + request='StorageAttachmentLife', version=18, params=_params) - _params['entities'] = entities + _params['ids'] = ids reply = await self.rpc(msg) return reply - @ReturnMapping(StringResult) - async def SLALevel(self): + @ReturnMapping(StorageAttachmentResults) + def sync_StorageAttachments(self, ids=None): ''' - SLALevel returns the model's SLA level. - + StorageAttachments returns the storage attachments with the specified tags. - Returns -> StringResult + ids : typing.Sequence[~StorageAttachmentId] + Returns -> StorageAttachmentResults ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SLALevel', + request='StorageAttachments', version=18, params=_params) - - reply = await self.rpc(msg) + _params['ids'] = ids + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SecretsGrant(self, args=None): + @ReturnMapping(StorageAttachmentResults) + async def StorageAttachments(self, ids=None): ''' - SecretsGrant grants access to a secret for the specified subjects. + StorageAttachments returns the storage attachments with the specified tags. - args : typing.Sequence[~GrantRevokeSecretArg] - Returns -> ErrorResults + ids : typing.Sequence[~StorageAttachmentId] + Returns -> StorageAttachmentResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SecretsGrant', + request='StorageAttachments', version=18, params=_params) - _params['args'] = args + _params['ids'] = ids reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SecretsRevoke(self, args=None): + @ReturnMapping(StatusResults) + def sync_UnitStatus(self, entities=None): ''' - SecretsRevoke revokes access to a secret for the specified subjects. + UnitStatus returns the workload status information for the unit. - args : typing.Sequence[~GrantRevokeSecretArg] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> StatusResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SecretsRevoke', + request='UnitStatus', version=18, params=_params) - _params['args'] = args - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SecretsRotated(self, args=None): + @ReturnMapping(StatusResults) + async def UnitStatus(self, entities=None): ''' - SecretsRotated records when secrets were last rotated. + UnitStatus returns the workload status information for the unit. - args : typing.Sequence[~SecretRotatedArg] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> StatusResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SecretsRotated', + request='UnitStatus', version=18, params=_params) - _params['args'] = args + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetAgentStatus(self, entities=None): + @ReturnMapping(StorageAttachmentIdsResults) + def sync_UnitStorageAttachments(self, entities=None): ''' - SetAgentStatus will set status for agents of Units passed in args, if one - of the args is not an Unit it will fail. + UnitStorageAttachments returns the IDs of storage attachments for a collection of units. - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> StorageAttachmentIdsResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5504,23 +8608,22 @@ async def SetAgentStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetAgentStatus', + request='UnitStorageAttachments', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetApplicationStatus(self, entities=None): + @ReturnMapping(StorageAttachmentIdsResults) + async def UnitStorageAttachments(self, entities=None): ''' - SetApplicationStatus sets the status for all the Applications in args if the given Unit is - the leader. + UnitStorageAttachments returns the IDs of storage attachments for a collection of units. - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> StorageAttachmentIdsResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5528,7 +8631,7 @@ async def SetApplicationStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetApplicationStatus', + request='UnitStorageAttachments', version=18, params=_params) _params['entities'] = entities @@ -5538,12 +8641,12 @@ async def SetApplicationStatus(self, entities=None): @ReturnMapping(ErrorResults) - async def SetCharmURL(self, entities=None): + def sync_UpdateNetworkInfo(self, entities=None): ''' - SetCharmURL sets the charm URL for each given unit. An error will - be returned if a unit is dead, or the charm URL is not known. + UpdateNetworkInfo refreshes the network settings for a unit's bound + endpoints. - entities : typing.Sequence[~EntityCharmURL] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): @@ -5552,45 +8655,45 @@ async def SetCharmURL(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetCharmURL', + request='UpdateNetworkInfo', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetRelationStatus(self, args=None): + async def UpdateNetworkInfo(self, entities=None): ''' - SetRelationStatus updates the status of the specified relations. + UpdateNetworkInfo refreshes the network settings for a unit's bound + endpoints. - args : typing.Sequence[~RelationStatusArg] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetRelationStatus', + request='UpdateNetworkInfo', version=18, params=_params) - _params['args'] = args + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetState(self, args=None): + def sync_UpdateSecrets(self, args=None): ''' - SetState sets the state persisted by the charm running in this unit - and the state internal to the uniter for this unit. + UpdateSecrets updates the specified secrets. - args : typing.Sequence[~SetUnitStateArg] + args : typing.Sequence[~UpdateSecretArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): @@ -5599,49 +8702,47 @@ async def SetState(self, args=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetState', + request='UpdateSecrets', version=18, params=_params) _params['args'] = args - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetStatus(self, entities=None): + async def UpdateSecrets(self, args=None): ''' - SetStatus will set status for a entities passed in args. If the entity is - a Unit it will instead set status to its agent, to emulate backwards - compatibility. + UpdateSecrets updates the specified secrets. - entities : typing.Sequence[~EntityStatusArgs] + args : typing.Sequence[~UpdateSecretArg] Returns -> ErrorResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetStatus', + request='UpdateSecrets', version=18, params=_params) - _params['entities'] = entities + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetUnitStatus(self, entities=None): + @ReturnMapping(UpgradeSeriesStatusResults) + def sync_UpgradeSeriesUnitStatus(self, entities=None): ''' - SetUnitStatus sets status for all elements passed in args, the difference - with SetStatus is that if an entity is a Unit it will set its status instead - of its agent. + UpgradeSeriesUnitStatus returns the current preparation status of an + upgrading unit. + If no series upgrade is in progress an error is returned instead. - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> UpgradeSeriesStatusResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5649,47 +8750,47 @@ async def SetUnitStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetUnitStatus', + request='UpgradeSeriesUnitStatus', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetUpgradeSeriesUnitStatus(self, params=None): + @ReturnMapping(UpgradeSeriesStatusResults) + async def UpgradeSeriesUnitStatus(self, entities=None): ''' - SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit. - If no upgrade is in progress an error is returned instead. + UpgradeSeriesUnitStatus returns the current preparation status of an + upgrading unit. + If no series upgrade is in progress an error is returned instead. - params : typing.Sequence[~UpgradeSeriesStatusParam] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> UpgradeSeriesStatusResults ''' - if params is not None and not isinstance(params, (bytes, str, list)): - raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetUpgradeSeriesUnitStatus', + request='UpgradeSeriesUnitStatus', version=18, params=_params) - _params['params'] = params + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetWorkloadVersion(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_Watch(self, entities=None): ''' - SetWorkloadVersion sets the workload version for each given unit. An error will - be returned if a unit is dead. + Watch starts an NotifyWatcher for each given entity. - entities : typing.Sequence[~EntityWorkloadVersion] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5697,23 +8798,22 @@ async def SetWorkloadVersion(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetWorkloadVersion', + request='Watch', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(UnitStateResults) - async def State(self, entities=None): + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): ''' - State returns the state persisted by the charm running in this unit - and the state internal to the uniter for this unit. + Watch starts an NotifyWatcher for each given entity. entities : typing.Sequence[~Entity] - Returns -> UnitStateResults + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5721,7 +8821,7 @@ async def State(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='State', + request='Watch', version=18, params=_params) _params['entities'] = entities @@ -5730,60 +8830,58 @@ async def State(self, entities=None): - @ReturnMapping(LifeResults) - async def StorageAttachmentLife(self, ids=None): + @ReturnMapping(NotifyWatchResult) + def sync_WatchAPIHostPorts(self): ''' - StorageAttachmentLife returns the lifecycle state of the storage attachments - with the specified tags. + WatchAPIHostPorts watches the API server addresses. - ids : typing.Sequence[~StorageAttachmentId] - Returns -> LifeResults + + Returns -> NotifyWatchResult ''' - if ids is not None and not isinstance(ids, (bytes, str, list)): - raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='StorageAttachmentLife', + request='WatchAPIHostPorts', version=18, params=_params) - _params['ids'] = ids - reply = await self.rpc(msg) + + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StorageAttachmentResults) - async def StorageAttachments(self, ids=None): + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): ''' - StorageAttachments returns the storage attachments with the specified tags. + WatchAPIHostPorts watches the API server addresses. - ids : typing.Sequence[~StorageAttachmentId] - Returns -> StorageAttachmentResults + + Returns -> NotifyWatchResult ''' - if ids is not None and not isinstance(ids, (bytes, str, list)): - raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='StorageAttachments', + request='WatchAPIHostPorts', version=18, params=_params) - _params['ids'] = ids + reply = await self.rpc(msg) return reply - @ReturnMapping(StatusResults) - async def UnitStatus(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchActionNotifications(self, entities=None): ''' - UnitStatus returns the workload status information for the unit. + WatchActionNotifications returns a StringsWatcher for observing + incoming action calls to a unit. See also state/watcher.go + Unit.WatchActionNotifications(). This method is called from + api/uniter/uniter.go WatchActionNotifications(). entities : typing.Sequence[~Entity] - Returns -> StatusResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5791,22 +8889,25 @@ async def UnitStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='UnitStatus', + request='WatchActionNotifications', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StorageAttachmentIdsResults) - async def UnitStorageAttachments(self, entities=None): + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(self, entities=None): ''' - UnitStorageAttachments returns the IDs of storage attachments for a collection of units. + WatchActionNotifications returns a StringsWatcher for observing + incoming action calls to a unit. See also state/watcher.go + Unit.WatchActionNotifications(). This method is called from + api/uniter/uniter.go WatchActionNotifications(). entities : typing.Sequence[~Entity] - Returns -> StorageAttachmentIdsResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5814,7 +8915,7 @@ async def UnitStorageAttachments(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='UnitStorageAttachments', + request='WatchActionNotifications', version=18, params=_params) _params['entities'] = entities @@ -5823,14 +8924,17 @@ async def UnitStorageAttachments(self, entities=None): - @ReturnMapping(ErrorResults) - async def UpdateNetworkInfo(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchConfigSettingsHash(self, entities=None): ''' - UpdateNetworkInfo refreshes the network settings for a unit's bound - endpoints. + WatchConfigSettingsHash returns a StringsWatcher that yields a hash + of the config values every time the config changes. The uniter can + save this hash and use it to decide whether the config-changed hook + needs to be run (or whether this was just an agent restart with no + substantive config change). entities : typing.Sequence[~Entity] - Returns -> ErrorResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5838,47 +8942,49 @@ async def UpdateNetworkInfo(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='UpdateNetworkInfo', + request='WatchConfigSettingsHash', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def UpdateSecrets(self, args=None): + @ReturnMapping(StringsWatchResults) + async def WatchConfigSettingsHash(self, entities=None): ''' - UpdateSecrets updates the specified secrets. + WatchConfigSettingsHash returns a StringsWatcher that yields a hash + of the config values every time the config changes. The uniter can + save this hash and use it to decide whether the config-changed hook + needs to be run (or whether this was just an agent restart with no + substantive config change). - args : typing.Sequence[~UpdateSecretArg] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='UpdateSecrets', + request='WatchConfigSettingsHash', version=18, params=_params) - _params['args'] = args + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(UpgradeSeriesStatusResults) - async def UpgradeSeriesUnitStatus(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchConsumedSecretsChanges(self, entities=None): ''' - UpgradeSeriesUnitStatus returns the current preparation status of an - upgrading unit. - If no series upgrade is in progress an error is returned instead. + WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers. entities : typing.Sequence[~Entity] - Returns -> UpgradeSeriesStatusResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5886,22 +8992,22 @@ async def UpgradeSeriesUnitStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='UpgradeSeriesUnitStatus', + request='WatchConsumedSecretsChanges', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def Watch(self, entities=None): + @ReturnMapping(StringsWatchResults) + async def WatchConsumedSecretsChanges(self, entities=None): ''' - Watch starts an NotifyWatcher for each given entity. + WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers. entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5909,7 +9015,7 @@ async def Watch(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Watch', + request='WatchConsumedSecretsChanges', version=18, params=_params) _params['entities'] = entities @@ -5919,9 +9025,13 @@ async def Watch(self, entities=None): @ReturnMapping(NotifyWatchResult) - async def WatchAPIHostPorts(self): + def sync_WatchForModelConfigChanges(self): ''' - WatchAPIHostPorts watches the API server addresses. + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. Returns -> NotifyWatchResult @@ -5930,7 +9040,32 @@ async def WatchAPIHostPorts(self): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchAPIHostPorts', + request='WatchForModelConfigChanges', + version=18, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchForModelConfigChanges', version=18, params=_params) @@ -5939,16 +9074,13 @@ async def WatchAPIHostPorts(self): - @ReturnMapping(StringsWatchResults) - async def WatchActionNotifications(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchInstanceData(self, entities=None): ''' - WatchActionNotifications returns a StringsWatcher for observing - incoming action calls to a unit. See also state/watcher.go - Unit.WatchActionNotifications(). This method is called from - api/uniter/uniter.go WatchActionNotifications(). + WatchInstanceData is a shim to call the LXDProfileAPIv2 version of this method. entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5956,26 +9088,22 @@ async def WatchActionNotifications(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchActionNotifications', + request='WatchInstanceData', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringsWatchResults) - async def WatchConfigSettingsHash(self, entities=None): + @ReturnMapping(NotifyWatchResults) + async def WatchInstanceData(self, entities=None): ''' - WatchConfigSettingsHash returns a StringsWatcher that yields a hash - of the config values every time the config changes. The uniter can - save this hash and use it to decide whether the config-changed hook - needs to be run (or whether this was just an agent restart with no - substantive config change). + WatchInstanceData is a shim to call the LXDProfileAPIv2 version of this method. entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5983,7 +9111,7 @@ async def WatchConfigSettingsHash(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchConfigSettingsHash', + request='WatchInstanceData', version=18, params=_params) _params['entities'] = entities @@ -5992,13 +9120,14 @@ async def WatchConfigSettingsHash(self, entities=None): - @ReturnMapping(StringsWatchResults) - async def WatchConsumedSecretsChanges(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchLeadershipSettings(self, entities=None): ''' - WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers. + WatchLeadershipSettings will block the caller until leadership settings + for the given service ID change. entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -6006,45 +9135,42 @@ async def WatchConsumedSecretsChanges(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchConsumedSecretsChanges', + request='WatchLeadershipSettings', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def WatchForModelConfigChanges(self): + @ReturnMapping(NotifyWatchResults) + async def WatchLeadershipSettings(self, entities=None): ''' - WatchForModelConfigChanges returns a NotifyWatcher that observes - changes to the model configuration. - Note that although the NotifyWatchResult contains an Error field, - it's not used because we are only returning a single watcher, - so we use the regular error return. - + WatchLeadershipSettings will block the caller until leadership settings + for the given service ID change. - Returns -> NotifyWatchResult + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchForModelConfigChanges', + request='WatchLeadershipSettings', version=18, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(NotifyWatchResults) - async def WatchInstanceData(self, entities=None): + def sync_WatchMeterStatus(self, entities=None): ''' - WatchInstanceData is a shim to call the LXDProfileAPIv2 version of this method. - entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' @@ -6054,21 +9180,18 @@ async def WatchInstanceData(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchInstanceData', + request='WatchMeterStatus', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(NotifyWatchResults) - async def WatchLeadershipSettings(self, entities=None): + async def WatchMeterStatus(self, entities=None): ''' - WatchLeadershipSettings will block the caller until leadership settings - for the given service ID change. - entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' @@ -6078,7 +9201,7 @@ async def WatchLeadershipSettings(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchLeadershipSettings', + request='WatchMeterStatus', version=18, params=_params) _params['entities'] = entities @@ -6087,11 +9210,19 @@ async def WatchLeadershipSettings(self, entities=None): - @ReturnMapping(NotifyWatchResults) - async def WatchMeterStatus(self, entities=None): + @ReturnMapping(StringsWatchResult) + def sync_WatchObsolete(self, entities=None): ''' + WatchObsolete returns a watcher for notifying when: + - a secret owned by the entity is deleted + - a secret revision owed by the entity no longer + has any consumers + + Obsolete revisions results are "uri/revno" and deleted + secret results are "uri". + entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + Returns -> StringsWatchResult ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -6099,11 +9230,11 @@ async def WatchMeterStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchMeterStatus', + request='WatchObsolete', version=18, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @@ -6137,6 +9268,31 @@ async def WatchObsolete(self, entities=None): + @ReturnMapping(RelationUnitsWatchResults) + def sync_WatchRelationUnits(self, relation_units=None): + ''' + WatchRelationUnits returns a RelationUnitsWatcher for observing + changes to every unit in the supplied relation that is visible to + the supplied unit. See also state/watcher.go:RelationUnit.Watch(). + + relation_units : typing.Sequence[~RelationUnit] + Returns -> RelationUnitsWatchResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchRelationUnits', + version=18, + params=_params) + _params['relation-units'] = relation_units + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RelationUnitsWatchResults) async def WatchRelationUnits(self, relation_units=None): ''' @@ -6162,6 +9318,29 @@ async def WatchRelationUnits(self, relation_units=None): + @ReturnMapping(SecretTriggerWatchResult) + def sync_WatchSecretRevisionsExpiryChanges(self, entities=None): + ''' + WatchSecretRevisionsExpiryChanges sets up a watcher to notify of changes to secret revision expiry config. + + entities : typing.Sequence[~Entity] + Returns -> SecretTriggerWatchResult + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchSecretRevisionsExpiryChanges', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretTriggerWatchResult) async def WatchSecretRevisionsExpiryChanges(self, entities=None): ''' @@ -6185,6 +9364,29 @@ async def WatchSecretRevisionsExpiryChanges(self, entities=None): + @ReturnMapping(SecretTriggerWatchResult) + def sync_WatchSecretsRotationChanges(self, entities=None): + ''' + WatchSecretsRotationChanges sets up a watcher to notify of changes to secret rotation config. + + entities : typing.Sequence[~Entity] + Returns -> SecretTriggerWatchResult + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchSecretsRotationChanges', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretTriggerWatchResult) async def WatchSecretsRotationChanges(self, entities=None): ''' @@ -6208,6 +9410,31 @@ async def WatchSecretsRotationChanges(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchStorageAttachments(self, ids=None): + ''' + WatchStorageAttachments creates watchers for a collection of storage + attachments, each of which can be used to watch changes to storage + attachment info. + + ids : typing.Sequence[~StorageAttachmentId] + Returns -> NotifyWatchResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchStorageAttachments', + version=18, + params=_params) + _params['ids'] = ids + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchStorageAttachments(self, ids=None): ''' @@ -6233,6 +9460,32 @@ async def WatchStorageAttachments(self, ids=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchTrustConfigSettingsHash(self, entities=None): + ''' + WatchTrustConfigSettingsHash returns a StringsWatcher that yields a + hash of the application config values whenever they change. The + uniter can use the hash to determine whether the actual values have + changed since it last saw the config. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchTrustConfigSettingsHash', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchTrustConfigSettingsHash(self, entities=None): ''' @@ -6259,6 +9512,32 @@ async def WatchTrustConfigSettingsHash(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchUnitAddressesHash(self, entities=None): + ''' + WatchUnitAddressesHash returns a StringsWatcher that yields the + hashes of the addresses for the unit whenever the addresses + change. The uniter can use the hash to determine whether the actual + address values have changed since it last saw the config. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchUnitAddressesHash', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchUnitAddressesHash(self, entities=None): ''' @@ -6285,6 +9564,33 @@ async def WatchUnitAddressesHash(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchUnitRelations(self, entities=None): + ''' + WatchUnitRelations returns a StringsWatcher, for each given + unit, that notifies of changes to the lifecycles of relations + relevant to that unit. For principal units, this will be all of the + relations for the application. For subordinate units, only + relations with the principal unit's application will be monitored. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchUnitRelations', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchUnitRelations(self, entities=None): ''' @@ -6312,6 +9618,31 @@ async def WatchUnitRelations(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchUnitStorageAttachments(self, entities=None): + ''' + WatchUnitStorageAttachments creates watchers for a collection of units, + each of which can be used to watch for lifecycle changes to the corresponding + unit's storage attachments. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchUnitStorageAttachments', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchUnitStorageAttachments(self, entities=None): ''' @@ -6337,6 +9668,29 @@ async def WatchUnitStorageAttachments(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchUpgradeSeriesNotifications(self, entities=None): + ''' + WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchUpgradeSeriesNotifications', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchUpgradeSeriesNotifications(self, entities=None): ''' @@ -6360,6 +9714,29 @@ async def WatchUpgradeSeriesNotifications(self, entities=None): + @ReturnMapping(StringResults) + def sync_WorkloadVersion(self, entities=None): + ''' + WorkloadVersion returns the workload version for all given units or applications. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WorkloadVersion', + version=18, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def WorkloadVersion(self, entities=None): ''' diff --git a/juju/client/_client19.py b/juju/client/_client19.py index 3171ef69..784b07d3 100644 --- a/juju/client/_client19.py +++ b/juju/client/_client19.py @@ -969,6 +969,34 @@ class ApplicationFacade(Type): 'type': 'object'} + @ReturnMapping(AddRelationResults) + def sync_AddRelation(self, endpoints=None, via_cidrs=None): + ''' + AddRelation adds a relation between the specified endpoints and returns the relation info. + + endpoints : typing.Sequence[str] + via_cidrs : typing.Sequence[str] + Returns -> AddRelationResults + ''' + if endpoints is not None and not isinstance(endpoints, (bytes, str, list)): + raise Exception("Expected endpoints to be a Sequence, received: {}".format(type(endpoints))) + + if via_cidrs is not None and not isinstance(via_cidrs, (bytes, str, list)): + raise Exception("Expected via_cidrs to be a Sequence, received: {}".format(type(via_cidrs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddRelation', + version=19, + params=_params) + _params['endpoints'] = endpoints + _params['via-cidrs'] = via_cidrs + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AddRelationResults) async def AddRelation(self, endpoints=None, via_cidrs=None): ''' @@ -997,6 +1025,49 @@ async def AddRelation(self, endpoints=None, via_cidrs=None): + @ReturnMapping(AddApplicationUnitsResults) + def sync_AddUnits(self, application=None, attach_storage=None, num_units=None, placement=None, policy=None): + ''' + AddUnits adds a given number of units to an application. + + application : str + attach_storage : typing.Sequence[str] + num_units : int + placement : typing.Sequence[~Placement] + policy : str + Returns -> AddApplicationUnitsResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if attach_storage is not None and not isinstance(attach_storage, (bytes, str, list)): + raise Exception("Expected attach_storage to be a Sequence, received: {}".format(type(attach_storage))) + + if num_units is not None and not isinstance(num_units, int): + raise Exception("Expected num_units to be a int, received: {}".format(type(num_units))) + + if placement is not None and not isinstance(placement, (bytes, str, list)): + raise Exception("Expected placement to be a Sequence, received: {}".format(type(placement))) + + if policy is not None and not isinstance(policy, (bytes, str)): + raise Exception("Expected policy to be a str, received: {}".format(type(policy))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddUnits', + version=19, + params=_params) + _params['application'] = application + _params['attach-storage'] = attach_storage + _params['num-units'] = num_units + _params['placement'] = placement + _params['policy'] = policy + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AddApplicationUnitsResults) async def AddUnits(self, application=None, attach_storage=None, num_units=None, placement=None, policy=None): ''' @@ -1040,6 +1111,29 @@ async def AddUnits(self, application=None, attach_storage=None, num_units=None, + @ReturnMapping(ApplicationInfoResults) + def sync_ApplicationsInfo(self, entities=None): + ''' + ApplicationsInfo returns applications information. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ApplicationsInfo', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationInfoResults) async def ApplicationsInfo(self, entities=None): ''' @@ -1063,6 +1157,30 @@ async def ApplicationsInfo(self, entities=None): + @ReturnMapping(ApplicationGetConfigResults) + def sync_CharmConfig(self, args=None): + ''' + CharmConfig returns charm config for the input list of applications and + model generations. + + args : typing.Sequence[~ApplicationGet] + Returns -> ApplicationGetConfigResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='CharmConfig', + version=19, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetConfigResults) async def CharmConfig(self, args=None): ''' @@ -1087,6 +1205,29 @@ async def CharmConfig(self, args=None): + @ReturnMapping(ApplicationCharmRelationsResults) + def sync_CharmRelations(self, application=None): + ''' + CharmRelations implements the server side of Application.CharmRelations. + + application : str + Returns -> ApplicationCharmRelationsResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='CharmRelations', + version=19, + params=_params) + _params['application'] = application + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationCharmRelationsResults) async def CharmRelations(self, application=None): ''' @@ -1110,6 +1251,30 @@ async def CharmRelations(self, application=None): + @ReturnMapping(ErrorResults) + def sync_Consume(self, args=None): + ''' + Consume adds remote applications to the model without creating any + relations. + + args : typing.Sequence[~ConsumeApplicationArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Consume', + version=19, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Consume(self, args=None): ''' @@ -1134,6 +1299,30 @@ async def Consume(self, args=None): + @ReturnMapping(ErrorResults) + def sync_Deploy(self, applications=None): + ''' + Deploy fetches the charms from the charm store and deploys them + using the specified placement directives. + + applications : typing.Sequence[~ApplicationDeploy] + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Deploy', + version=19, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Deploy(self, applications=None): ''' @@ -1158,6 +1347,33 @@ async def Deploy(self, applications=None): + @ReturnMapping(DeployFromRepositoryResults) + def sync_DeployFromRepository(self, args=None): + ''' + DeployFromRepository is a one-stop deployment method for repository + charms. Only a charm name is required to deploy. If argument validation + fails, a list of all errors found in validation will be returned. If a + local resource is provided, details required for uploading the validated + resource will be returned. + + args : typing.Sequence[~DeployFromRepositoryArg] + Returns -> DeployFromRepositoryResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DeployFromRepository', + version=19, + params=_params) + _params['Args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(DeployFromRepositoryResults) async def DeployFromRepository(self, args=None): ''' @@ -1185,6 +1401,29 @@ async def DeployFromRepository(self, args=None): + @ReturnMapping(DestroyApplicationResults) + def sync_DestroyApplication(self, applications=None): + ''' + DestroyApplication removes a given set of applications. + + applications : typing.Sequence[~DestroyApplicationParams] + Returns -> DestroyApplicationResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyApplication', + version=19, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(DestroyApplicationResults) async def DestroyApplication(self, applications=None): ''' @@ -1208,6 +1447,29 @@ async def DestroyApplication(self, applications=None): + @ReturnMapping(ErrorResults) + def sync_DestroyConsumedApplications(self, applications=None): + ''' + DestroyConsumedApplications removes a given set of consumed (remote) applications. + + applications : typing.Sequence[~DestroyConsumedApplicationParams] + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyConsumedApplications', + version=19, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def DestroyConsumedApplications(self, applications=None): ''' @@ -1232,7 +1494,7 @@ async def DestroyConsumedApplications(self, applications=None): @ReturnMapping(None) - async def DestroyRelation(self, endpoints=None, force=None, max_wait=None, relation_id=None): + def sync_DestroyRelation(self, endpoints=None, force=None, max_wait=None, relation_id=None): ''' DestroyRelation removes the relation between the specified endpoints or an id. @@ -1265,21 +1527,83 @@ async def DestroyRelation(self, endpoints=None, force=None, max_wait=None, relat _params['force'] = force _params['max-wait'] = max_wait _params['relation-id'] = relation_id - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(DestroyUnitResults) - async def DestroyUnit(self, units=None): + @ReturnMapping(None) + async def DestroyRelation(self, endpoints=None, force=None, max_wait=None, relation_id=None): ''' - DestroyUnit removes a given set of application units. + DestroyRelation removes the relation between the + specified endpoints or an id. - units : typing.Sequence[~DestroyUnitParams] - Returns -> DestroyUnitResults - ''' - if units is not None and not isinstance(units, (bytes, str, list)): - raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + endpoints : typing.Sequence[str] + force : bool + max_wait : int + relation_id : int + Returns -> None + ''' + if endpoints is not None and not isinstance(endpoints, (bytes, str, list)): + raise Exception("Expected endpoints to be a Sequence, received: {}".format(type(endpoints))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if max_wait is not None and not isinstance(max_wait, int): + raise Exception("Expected max_wait to be a int, received: {}".format(type(max_wait))) + + if relation_id is not None and not isinstance(relation_id, int): + raise Exception("Expected relation_id to be a int, received: {}".format(type(relation_id))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyRelation', + version=19, + params=_params) + _params['endpoints'] = endpoints + _params['force'] = force + _params['max-wait'] = max_wait + _params['relation-id'] = relation_id + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyUnitResults) + def sync_DestroyUnit(self, units=None): + ''' + DestroyUnit removes a given set of application units. + + units : typing.Sequence[~DestroyUnitParams] + Returns -> DestroyUnitResults + ''' + if units is not None and not isinstance(units, (bytes, str, list)): + raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnit', + version=19, + params=_params) + _params['units'] = units + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(DestroyUnitResults) + async def DestroyUnit(self, units=None): + ''' + DestroyUnit removes a given set of application units. + + units : typing.Sequence[~DestroyUnitParams] + Returns -> DestroyUnitResults + ''' + if units is not None and not isinstance(units, (bytes, str, list)): + raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) # map input types to rpc msg _params = dict() @@ -1293,6 +1617,35 @@ async def DestroyUnit(self, units=None): + @ReturnMapping(None) + def sync_Expose(self, application=None, exposed_endpoints=None): + ''' + Expose changes the juju-managed firewall to expose any ports that + were also explicitly marked by units as open. + + application : str + exposed_endpoints : typing.Mapping[str, ~ExposedEndpoint] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if exposed_endpoints is not None and not isinstance(exposed_endpoints, dict): + raise Exception("Expected exposed_endpoints to be a Mapping, received: {}".format(type(exposed_endpoints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=19, + params=_params) + _params['application'] = application + _params['exposed-endpoints'] = exposed_endpoints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Expose(self, application=None, exposed_endpoints=None): ''' @@ -1322,6 +1675,34 @@ async def Expose(self, application=None, exposed_endpoints=None): + @ReturnMapping(ApplicationGetResults) + def sync_Get(self, application=None, branch=None): + ''' + Get returns the charm configuration for an application. + + application : str + branch : str + Returns -> ApplicationGetResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Get', + version=19, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetResults) async def Get(self, application=None, branch=None): ''' @@ -1350,6 +1731,35 @@ async def Get(self, application=None, branch=None): + @ReturnMapping(CharmURLOriginResult) + def sync_GetCharmURLOrigin(self, application=None, branch=None): + ''' + GetCharmURLOrigin returns the charm URL and charm origin the given + application is running at present. + + application : str + branch : str + Returns -> CharmURLOriginResult + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetCharmURLOrigin', + version=19, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CharmURLOriginResult) async def GetCharmURLOrigin(self, application=None, branch=None): ''' @@ -1379,6 +1789,29 @@ async def GetCharmURLOrigin(self, application=None, branch=None): + @ReturnMapping(ApplicationGetConfigResults) + def sync_GetConfig(self, entities=None): + ''' + GetConfig returns the charm config for each of the input applications. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetConfig', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetConfigResults) async def GetConfig(self, entities=None): ''' @@ -1402,6 +1835,29 @@ async def GetConfig(self, entities=None): + @ReturnMapping(ApplicationGetConstraintsResults) + def sync_GetConstraints(self, entities=None): + ''' + GetConstraints returns the constraints for a given application. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConstraintsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetConstraints', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetConstraintsResults) async def GetConstraints(self, entities=None): ''' @@ -1425,6 +1881,29 @@ async def GetConstraints(self, entities=None): + @ReturnMapping(StringResult) + def sync_Leader(self, tag=None): + ''' + Leader returns the unit name of the leader for the given application. + + tag : str + Returns -> StringResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Leader', + version=19, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResult) async def Leader(self, tag=None): ''' @@ -1448,6 +1927,30 @@ async def Leader(self, tag=None): + @ReturnMapping(ErrorResults) + def sync_MergeBindings(self, args=None): + ''' + MergeBindings merges operator-defined bindings with the current bindings for + one or more applications. + + args : typing.Sequence[~ApplicationMergeBindings] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='MergeBindings', + version=19, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def MergeBindings(self, args=None): ''' @@ -1473,7 +1976,7 @@ async def MergeBindings(self, args=None): @ReturnMapping(ErrorResults) - async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): + def sync_ResolveUnitErrors(self, all_=None, retry=None, tags=None): ''' ResolveUnitErrors marks errors on the specified units as resolved. @@ -1500,34 +2003,173 @@ async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): _params['all'] = all_ _params['retry'] = retry _params['tags'] = tags - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ScaleApplicationResults) - async def ScaleApplications(self, applications=None): + @ReturnMapping(ErrorResults) + async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): ''' - ScaleApplications scales the specified application to the requested number of units. + ResolveUnitErrors marks errors on the specified units as resolved. - applications : typing.Sequence[~ScaleApplicationParams] - Returns -> ScaleApplicationResults + all_ : bool + retry : bool + tags : Entities + Returns -> ErrorResults ''' - if applications is not None and not isinstance(applications, (bytes, str, list)): - raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + if all_ is not None and not isinstance(all_, bool): + raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + + if retry is not None and not isinstance(retry, bool): + raise Exception("Expected retry to be a bool, received: {}".format(type(retry))) + + if tags is not None and not isinstance(tags, (dict, Entities)): + raise Exception("Expected tags to be a Entities, received: {}".format(type(tags))) # map input types to rpc msg _params = dict() msg = dict(type='Application', - request='ScaleApplications', + request='ResolveUnitErrors', version=19, params=_params) - _params['applications'] = applications + _params['all'] = all_ + _params['retry'] = retry + _params['tags'] = tags + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ScaleApplicationResults) + def sync_ScaleApplications(self, applications=None): + ''' + ScaleApplications scales the specified application to the requested number of units. + + applications : typing.Sequence[~ScaleApplicationParams] + Returns -> ScaleApplicationResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ScaleApplications', + version=19, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ScaleApplicationResults) + async def ScaleApplications(self, applications=None): + ''' + ScaleApplications scales the specified application to the requested number of units. + + applications : typing.Sequence[~ScaleApplicationParams] + Returns -> ScaleApplicationResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ScaleApplications', + version=19, + params=_params) + _params['applications'] = applications reply = await self.rpc(msg) return reply + @ReturnMapping(None) + def sync_SetCharm(self, application=None, channel=None, charm_origin=None, charm_url=None, config_settings=None, config_settings_yaml=None, endpoint_bindings=None, force=None, force_base=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None): + ''' + SetCharm sets the charm for a given for the application. + + application : str + channel : str + charm_origin : CharmOrigin + charm_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + endpoint_bindings : typing.Mapping[str, str] + force : bool + force_base : bool + force_units : bool + generation : str + resource_ids : typing.Mapping[str, str] + storage_constraints : typing.Mapping[str, ~StorageConstraints] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if channel is not None and not isinstance(channel, (bytes, str)): + raise Exception("Expected channel to be a str, received: {}".format(type(channel))) + + if charm_origin is not None and not isinstance(charm_origin, (dict, CharmOrigin)): + raise Exception("Expected charm_origin to be a CharmOrigin, received: {}".format(type(charm_origin))) + + if charm_url is not None and not isinstance(charm_url, (bytes, str)): + raise Exception("Expected charm_url to be a str, received: {}".format(type(charm_url))) + + if config_settings is not None and not isinstance(config_settings, dict): + raise Exception("Expected config_settings to be a Mapping, received: {}".format(type(config_settings))) + + if config_settings_yaml is not None and not isinstance(config_settings_yaml, (bytes, str)): + raise Exception("Expected config_settings_yaml to be a str, received: {}".format(type(config_settings_yaml))) + + if endpoint_bindings is not None and not isinstance(endpoint_bindings, dict): + raise Exception("Expected endpoint_bindings to be a Mapping, received: {}".format(type(endpoint_bindings))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if force_base is not None and not isinstance(force_base, bool): + raise Exception("Expected force_base to be a bool, received: {}".format(type(force_base))) + + if force_units is not None and not isinstance(force_units, bool): + raise Exception("Expected force_units to be a bool, received: {}".format(type(force_units))) + + if generation is not None and not isinstance(generation, (bytes, str)): + raise Exception("Expected generation to be a str, received: {}".format(type(generation))) + + if resource_ids is not None and not isinstance(resource_ids, dict): + raise Exception("Expected resource_ids to be a Mapping, received: {}".format(type(resource_ids))) + + if storage_constraints is not None and not isinstance(storage_constraints, dict): + raise Exception("Expected storage_constraints to be a Mapping, received: {}".format(type(storage_constraints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetCharm', + version=19, + params=_params) + _params['application'] = application + _params['channel'] = channel + _params['charm-origin'] = charm_origin + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['endpoint-bindings'] = endpoint_bindings + _params['force'] = force + _params['force-base'] = force_base + _params['force-units'] = force_units + _params['generation'] = generation + _params['resource-ids'] = resource_ids + _params['storage-constraints'] = storage_constraints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetCharm(self, application=None, channel=None, charm_origin=None, charm_url=None, config_settings=None, config_settings_yaml=None, endpoint_bindings=None, force=None, force_base=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None): ''' @@ -1611,6 +2253,31 @@ async def SetCharm(self, application=None, channel=None, charm_origin=None, char + @ReturnMapping(ErrorResults) + def sync_SetConfigs(self, args=None): + ''' + SetConfigs implements the server side of Application.SetConfig. Both + application and charm config are set. It does not unset values in + Config map that are set to an empty string. Unset should be used for that. + + args : typing.Sequence[~ConfigSet] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetConfigs', + version=19, + params=_params) + _params['Args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetConfigs(self, args=None): ''' @@ -1636,6 +2303,34 @@ async def SetConfigs(self, args=None): + @ReturnMapping(None) + def sync_SetConstraints(self, application=None, constraints=None): + ''' + SetConstraints sets the constraints for a given application. + + application : str + constraints : Value + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetConstraints', + version=19, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetConstraints(self, application=None, constraints=None): ''' @@ -1664,6 +2359,31 @@ async def SetConstraints(self, application=None, constraints=None): + @ReturnMapping(ErrorResults) + def sync_SetMetricCredentials(self, creds=None): + ''' + SetMetricCredentials sets credentials on the application. + TODO (cderici) only used for metered charms in cmd MeteredDeployAPI, + kept for client compatibility, remove in juju 4.0 + + creds : typing.Sequence[~ApplicationMetricCredential] + Returns -> ErrorResults + ''' + if creds is not None and not isinstance(creds, (bytes, str, list)): + raise Exception("Expected creds to be a Sequence, received: {}".format(type(creds))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetMetricCredentials', + version=19, + params=_params) + _params['creds'] = creds + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetMetricCredentials(self, creds=None): ''' @@ -1689,6 +2409,29 @@ async def SetMetricCredentials(self, creds=None): + @ReturnMapping(ErrorResults) + def sync_SetRelationsSuspended(self, args=None): + ''' + SetRelationsSuspended sets the suspended status of the specified relations. + + args : typing.Sequence[~RelationSuspendedArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetRelationsSuspended', + version=19, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetRelationsSuspended(self, args=None): ''' @@ -1712,6 +2455,35 @@ async def SetRelationsSuspended(self, args=None): + @ReturnMapping(None) + def sync_Unexpose(self, application=None, exposed_endpoints=None): + ''' + Unexpose changes the juju-managed firewall to unexpose any ports that + were also explicitly marked by units as open. + + application : str + exposed_endpoints : typing.Sequence[str] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if exposed_endpoints is not None and not isinstance(exposed_endpoints, (bytes, str, list)): + raise Exception("Expected exposed_endpoints to be a Sequence, received: {}".format(type(exposed_endpoints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=19, + params=_params) + _params['application'] = application + _params['exposed-endpoints'] = exposed_endpoints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Unexpose(self, application=None, exposed_endpoints=None): ''' @@ -1742,7 +2514,7 @@ async def Unexpose(self, application=None, exposed_endpoints=None): @ReturnMapping(UnitInfoResults) - async def UnitsInfo(self, entities=None): + def sync_UnitsInfo(self, entities=None): ''' UnitsInfo returns unit information for the given entities (units or applications). @@ -1760,16 +2532,63 @@ async def UnitsInfo(self, entities=None): version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def UnsetApplicationsConfig(self, args=None): + @ReturnMapping(UnitInfoResults) + async def UnitsInfo(self, entities=None): ''' - UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig. - + UnitsInfo returns unit information for the given entities (units or + applications). + + entities : typing.Sequence[~Entity] + Returns -> UnitInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UnitsInfo', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_UnsetApplicationsConfig(self, args=None): + ''' + UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig. + + args : typing.Sequence[~ApplicationUnset] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UnsetApplicationsConfig', + version=19, + params=_params) + _params['Args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UnsetApplicationsConfig(self, args=None): + ''' + UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig. + args : typing.Sequence[~ApplicationUnset] Returns -> ErrorResults ''' @@ -1788,6 +2607,30 @@ async def UnsetApplicationsConfig(self, args=None): + @ReturnMapping(ErrorResults) + def sync_UpdateApplicationBase(self, args=None): + ''' + UpdateApplicationBase updates the application base. + Base for subordinates is updated too. + + args : typing.Sequence[~UpdateChannelArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UpdateApplicationBase', + version=19, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UpdateApplicationBase(self, args=None): ''' @@ -3824,6 +4667,27 @@ class UniterFacade(Type): 'type': 'object'} + @ReturnMapping(StringsResult) + def sync_APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIAddresses', + version=19, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsResult) async def APIAddresses(self): ''' @@ -3845,6 +4709,27 @@ async def APIAddresses(self): + @ReturnMapping(APIHostPortsResult) + def sync_APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIHostPorts', + version=19, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(APIHostPortsResult) async def APIHostPorts(self): ''' @@ -3866,6 +4751,29 @@ async def APIHostPorts(self): + @ReturnMapping(StringResults) + def sync_ActionStatus(self, entities=None): + ''' + ActionStatus returns the status of Actions by Tags passed in. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ActionStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def ActionStatus(self, entities=None): ''' @@ -3889,6 +4797,30 @@ async def ActionStatus(self, entities=None): + @ReturnMapping(ActionResults) + def sync_Actions(self, entities=None): + ''' + Actions returns the Actions by Tags passed and ensures that the Unit asking + for them is the same Unit that has the Actions. + + entities : typing.Sequence[~Entity] + Returns -> ActionResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Actions', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ActionResults) async def Actions(self, entities=None): ''' @@ -3913,6 +4845,29 @@ async def Actions(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_AddMetricBatches(self, batches=None): + ''' + AddMetricBatches adds the metrics for the specified unit. + + batches : typing.Sequence[~MetricBatchParam] + Returns -> ErrorResults + ''' + if batches is not None and not isinstance(batches, (bytes, str, list)): + raise Exception("Expected batches to be a Sequence, received: {}".format(type(batches))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='AddMetricBatches', + version=19, + params=_params) + _params['batches'] = batches + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def AddMetricBatches(self, batches=None): ''' @@ -3937,7 +4892,7 @@ async def AddMetricBatches(self, batches=None): @ReturnMapping(ApplicationStatusResults) - async def ApplicationStatus(self, entities=None): + def sync_ApplicationStatus(self, entities=None): ''' ApplicationStatus returns the status of the Applications and its workloads if the given unit is the leader. @@ -3955,20 +4910,19 @@ async def ApplicationStatus(self, entities=None): version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringResults) - async def AssignedMachine(self, entities=None): + @ReturnMapping(ApplicationStatusResults) + async def ApplicationStatus(self, entities=None): ''' - AssignedMachine returns the machine tag for each given unit tag, or - an error satisfying params.IsCodeNotAssigned when a unit has no - assigned machine. + ApplicationStatus returns the status of the Applications and its workloads + if the given unit is the leader. entities : typing.Sequence[~Entity] - Returns -> StringResults + Returns -> ApplicationStatusResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -3976,7 +4930,7 @@ async def AssignedMachine(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='AssignedMachine', + request='ApplicationStatus', version=19, params=_params) _params['entities'] = entities @@ -3986,9 +4940,11 @@ async def AssignedMachine(self, entities=None): @ReturnMapping(StringResults) - async def AvailabilityZone(self, entities=None): + def sync_AssignedMachine(self, entities=None): ''' - AvailabilityZone returns the availability zone for each given unit, if applicable. + AssignedMachine returns the machine tag for each given unit tag, or + an error satisfying params.IsCodeNotAssigned when a unit has no + assigned machine. entities : typing.Sequence[~Entity] Returns -> StringResults @@ -3999,22 +4955,24 @@ async def AvailabilityZone(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='AvailabilityZone', + request='AssignedMachine', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def BeginActions(self, entities=None): + @ReturnMapping(StringResults) + async def AssignedMachine(self, entities=None): ''' - BeginActions marks the actions represented by the passed in Tags as running. + AssignedMachine returns the machine tag for each given unit tag, or + an error satisfying params.IsCodeNotAssigned when a unit has no + assigned machine. entities : typing.Sequence[~Entity] - Returns -> ErrorResults + Returns -> StringResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4022,7 +4980,7 @@ async def BeginActions(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='BeginActions', + request='AssignedMachine', version=19, params=_params) _params['entities'] = entities @@ -4031,13 +4989,13 @@ async def BeginActions(self, entities=None): - @ReturnMapping(BoolResults) - async def CanApplyLXDProfile(self, entities=None): + @ReturnMapping(StringResults) + def sync_AvailabilityZone(self, entities=None): ''' - CanApplyLXDProfile is a shim to call the LXDProfileAPIv2 version of this method. + AvailabilityZone returns the availability zone for each given unit, if applicable. entities : typing.Sequence[~Entity] - Returns -> BoolResults + Returns -> StringResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4045,47 +5003,45 @@ async def CanApplyLXDProfile(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CanApplyLXDProfile', + request='AvailabilityZone', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(StringResults) - async def CharmArchiveSha256(self, urls=None): + async def AvailabilityZone(self, entities=None): ''' - CharmArchiveSha256 returns the SHA256 digest of the charm archive - (bundle) data for each charm url in the given parameters. + AvailabilityZone returns the availability zone for each given unit, if applicable. - urls : typing.Sequence[~CharmURL] + entities : typing.Sequence[~Entity] Returns -> StringResults ''' - if urls is not None and not isinstance(urls, (bytes, str, list)): - raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CharmArchiveSha256', + request='AvailabilityZone', version=19, params=_params) - _params['urls'] = urls + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(IntResults) - async def CharmModifiedVersion(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_BeginActions(self, entities=None): ''' - CharmModifiedVersion returns the most CharmModifiedVersion for all given - units or applications. + BeginActions marks the actions represented by the passed in Tags as running. entities : typing.Sequence[~Entity] - Returns -> IntResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4093,22 +5049,22 @@ async def CharmModifiedVersion(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CharmModifiedVersion', + request='BeginActions', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringBoolResults) - async def CharmURL(self, entities=None): + @ReturnMapping(ErrorResults) + async def BeginActions(self, entities=None): ''' - CharmURL returns the charm URL for all given units or applications. + BeginActions marks the actions represented by the passed in Tags as running. entities : typing.Sequence[~Entity] - Returns -> StringBoolResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4116,7 +5072,7 @@ async def CharmURL(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CharmURL', + request='BeginActions', version=19, params=_params) _params['entities'] = entities @@ -4125,13 +5081,13 @@ async def CharmURL(self, entities=None): - @ReturnMapping(ErrorResults) - async def ClearResolved(self, entities=None): + @ReturnMapping(BoolResults) + def sync_CanApplyLXDProfile(self, entities=None): ''' - ClearResolved removes any resolved setting from each given unit. + CanApplyLXDProfile is a shim to call the LXDProfileAPIv2 version of this method. entities : typing.Sequence[~Entity] - Returns -> ErrorResults + Returns -> BoolResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4139,93 +5095,94 @@ async def ClearResolved(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ClearResolved', + request='CanApplyLXDProfile', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringResult) - async def CloudAPIVersion(self): + @ReturnMapping(BoolResults) + async def CanApplyLXDProfile(self, entities=None): ''' - CloudAPIVersion returns the cloud API version, if available. - + CanApplyLXDProfile is a shim to call the LXDProfileAPIv2 version of this method. - Returns -> StringResult + entities : typing.Sequence[~Entity] + Returns -> BoolResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CloudAPIVersion', + request='CanApplyLXDProfile', version=19, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(CloudSpecResult) - async def CloudSpec(self): + @ReturnMapping(StringResults) + def sync_CharmArchiveSha256(self, urls=None): ''' - CloudSpec returns the cloud spec used by the model in which the - authenticated unit or application resides. - A check is made beforehand to ensure that the request is made by an entity - that has been granted the appropriate trust. - + CharmArchiveSha256 returns the SHA256 digest of the charm archive + (bundle) data for each charm url in the given parameters. - Returns -> CloudSpecResult + urls : typing.Sequence[~CharmURL] + Returns -> StringResults ''' + if urls is not None and not isinstance(urls, (bytes, str, list)): + raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CloudSpec', + request='CharmArchiveSha256', version=19, params=_params) - - reply = await self.rpc(msg) + _params['urls'] = urls + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def CommitHookChanges(self, args=None): + @ReturnMapping(StringResults) + async def CharmArchiveSha256(self, urls=None): ''' - CommitHookChanges batches together all required API calls for applying - a set of changes after a hook successfully completes and executes them in a - single transaction. + CharmArchiveSha256 returns the SHA256 digest of the charm archive + (bundle) data for each charm url in the given parameters. - args : typing.Sequence[~CommitHookChangesArg] - Returns -> ErrorResults + urls : typing.Sequence[~CharmURL] + Returns -> StringResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if urls is not None and not isinstance(urls, (bytes, str, list)): + raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CommitHookChanges', + request='CharmArchiveSha256', version=19, params=_params) - _params['args'] = args + _params['urls'] = urls reply = await self.rpc(msg) return reply - @ReturnMapping(ConfigSettingsResults) - async def ConfigSettings(self, entities=None): + @ReturnMapping(IntResults) + def sync_CharmModifiedVersion(self, entities=None): ''' - ConfigSettings returns the complete set of application charm config - settings available to each given unit. + CharmModifiedVersion returns the most CharmModifiedVersion for all given + units or applications. entities : typing.Sequence[~Entity] - Returns -> ConfigSettingsResults + Returns -> IntResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4233,87 +5190,89 @@ async def ConfigSettings(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ConfigSettings', + request='CharmModifiedVersion', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringResults) - async def CreateSecretURIs(self, count=None): + @ReturnMapping(IntResults) + async def CharmModifiedVersion(self, entities=None): ''' - CreateSecretURIs creates new secret URIs. + CharmModifiedVersion returns the most CharmModifiedVersion for all given + units or applications. - count : int - Returns -> StringResults + entities : typing.Sequence[~Entity] + Returns -> IntResults ''' - if count is not None and not isinstance(count, int): - raise Exception("Expected count to be a int, received: {}".format(type(count))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CreateSecretURIs', + request='CharmModifiedVersion', version=19, params=_params) - _params['count'] = count + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(StringResults) - async def CreateSecrets(self, args=None): + @ReturnMapping(StringBoolResults) + def sync_CharmURL(self, entities=None): ''' - CreateSecrets creates new secrets. + CharmURL returns the charm URL for all given units or applications. - args : typing.Sequence[~CreateSecretArg] - Returns -> StringResults + entities : typing.Sequence[~Entity] + Returns -> StringBoolResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CreateSecrets', + request='CharmURL', version=19, params=_params) - _params['args'] = args - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ModelResult) - async def CurrentModel(self): + @ReturnMapping(StringBoolResults) + async def CharmURL(self, entities=None): ''' - CurrentModel returns the name and UUID for the current juju model. - + CharmURL returns the charm URL for all given units or applications. - Returns -> ModelResult + entities : typing.Sequence[~Entity] + Returns -> StringBoolResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='CurrentModel', + request='CharmURL', version=19, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def Destroy(self, entities=None): + def sync_ClearResolved(self, entities=None): ''' - Destroy advances all given Alive units' lifecycles as far as - possible. See state/Unit.Destroy(). + ClearResolved removes any resolved setting from each given unit. entities : typing.Sequence[~Entity] Returns -> ErrorResults @@ -4324,19 +5283,19 @@ async def Destroy(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Destroy', + request='ClearResolved', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def DestroyAllSubordinates(self, entities=None): + async def ClearResolved(self, entities=None): ''' - DestroyAllSubordinates destroys all subordinates of each given unit. + ClearResolved removes any resolved setting from each given unit. entities : typing.Sequence[~Entity] Returns -> ErrorResults @@ -4347,7 +5306,7 @@ async def DestroyAllSubordinates(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='DestroyAllSubordinates', + request='ClearResolved', version=19, params=_params) _params['entities'] = entities @@ -4356,160 +5315,154 @@ async def DestroyAllSubordinates(self, entities=None): - @ReturnMapping(ErrorResults) - async def DestroyUnitStorageAttachments(self, entities=None): + @ReturnMapping(StringResult) + def sync_CloudAPIVersion(self): ''' - DestroyUnitStorageAttachments marks each storage attachment of the - specified units as Dying. + CloudAPIVersion returns the cloud API version, if available. - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + + Returns -> StringResult ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='DestroyUnitStorageAttachments', + request='CloudAPIVersion', version=19, params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) + + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def EnsureDead(self, entities=None): + @ReturnMapping(StringResult) + async def CloudAPIVersion(self): ''' - EnsureDead calls EnsureDead on each given entity from state. It - will fail if the entity is not present. If it's Alive, nothing will - happen (see state/EnsureDead() for units or machines). + CloudAPIVersion returns the cloud API version, if available. - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + + Returns -> StringResult ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='EnsureDead', + request='CloudAPIVersion', version=19, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def EnterScope(self, relation_units=None): + @ReturnMapping(CloudSpecResult) + def sync_CloudSpec(self): ''' - EnterScope ensures each unit has entered its scope in the relation, - for all of the given relation/unit pairs. See also - state.RelationUnit.EnterScope(). + CloudSpec returns the cloud spec used by the model in which the + authenticated unit or application resides. + A check is made beforehand to ensure that the request is made by an entity + that has been granted the appropriate trust. - relation_units : typing.Sequence[~RelationUnit] - Returns -> ErrorResults + + Returns -> CloudSpecResult ''' - if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='EnterScope', + request='CloudSpec', version=19, params=_params) - _params['relation-units'] = relation_units - reply = await self.rpc(msg) + + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def FinishActions(self, results=None): + @ReturnMapping(CloudSpecResult) + async def CloudSpec(self): ''' - FinishActions saves the result of a completed Action + CloudSpec returns the cloud spec used by the model in which the + authenticated unit or application resides. + A check is made beforehand to ensure that the request is made by an entity + that has been granted the appropriate trust. - results : typing.Sequence[~ActionExecutionResult] - Returns -> ErrorResults + + Returns -> CloudSpecResult ''' - if results is not None and not isinstance(results, (bytes, str, list)): - raise Exception("Expected results to be a Sequence, received: {}".format(type(results))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='FinishActions', + request='CloudSpec', version=19, params=_params) - _params['results'] = results + reply = await self.rpc(msg) return reply - @ReturnMapping(SecretConsumerInfoResults) - async def GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): + @ReturnMapping(ErrorResults) + def sync_CommitHookChanges(self, args=None): ''' - GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets. - This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook. + CommitHookChanges batches together all required API calls for applying + a set of changes after a hook successfully completes and executes them in a + single transaction. - consumer_tag : str - uris : typing.Sequence[str] - Returns -> SecretConsumerInfoResults + args : typing.Sequence[~CommitHookChangesArg] + Returns -> ErrorResults ''' - if consumer_tag is not None and not isinstance(consumer_tag, (bytes, str)): - raise Exception("Expected consumer_tag to be a str, received: {}".format(type(consumer_tag))) - - if uris is not None and not isinstance(uris, (bytes, str, list)): - raise Exception("Expected uris to be a Sequence, received: {}".format(type(uris))) + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetConsumerSecretsRevisionInfo', + request='CommitHookChanges', version=19, params=_params) - _params['consumer-tag'] = consumer_tag - _params['uris'] = uris - reply = await self.rpc(msg) + _params['args'] = args + reply = self.sync_rpc(msg) return reply - @ReturnMapping(MeterStatusResults) - async def GetMeterStatus(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> MeterStatusResults + @ReturnMapping(ErrorResults) + async def CommitHookChanges(self, args=None): ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + CommitHookChanges batches together all required API calls for applying + a set of changes after a hook successfully completes and executes them in a + single transaction. - # map input types to rpc msg - _params = dict() + args : typing.Sequence[~CommitHookChangesArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() msg = dict(type='Uniter', - request='GetMeterStatus', + request='CommitHookChanges', version=19, params=_params) - _params['entities'] = entities + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(StringResults) - async def GetPodSpec(self, entities=None): + @ReturnMapping(ConfigSettingsResults) + def sync_ConfigSettings(self, entities=None): ''' - GetPodSpec gets the pod specs for a set of applications. + ConfigSettings returns the complete set of application charm config + settings available to each given unit. entities : typing.Sequence[~Entity] - Returns -> StringResults + Returns -> ConfigSettingsResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4517,23 +5470,23 @@ async def GetPodSpec(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetPodSpec', + request='ConfigSettings', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringBoolResults) - async def GetPrincipal(self, entities=None): + @ReturnMapping(ConfigSettingsResults) + async def ConfigSettings(self, entities=None): ''' - GetPrincipal returns the result of calling PrincipalName() and - converting it to a tag, on each given unit. + ConfigSettings returns the complete set of application charm config + settings available to each given unit. entities : typing.Sequence[~Entity] - Returns -> StringBoolResults + Returns -> ConfigSettingsResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4541,7 +5494,7 @@ async def GetPrincipal(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetPrincipal', + request='ConfigSettings', version=19, params=_params) _params['entities'] = entities @@ -4551,63 +5504,58 @@ async def GetPrincipal(self, entities=None): @ReturnMapping(StringResults) - async def GetRawK8sSpec(self, entities=None): + def sync_CreateSecretURIs(self, count=None): ''' - GetRawK8sSpec gets the raw k8s specs for a set of applications. + CreateSecretURIs creates new secret URIs. - entities : typing.Sequence[~Entity] + count : int Returns -> StringResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if count is not None and not isinstance(count, int): + raise Exception("Expected count to be a int, received: {}".format(type(count))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetRawK8sSpec', + request='CreateSecretURIs', version=19, params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) + _params['count'] = count + reply = self.sync_rpc(msg) return reply - @ReturnMapping(SecretBackendConfigResults) - async def GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): + @ReturnMapping(StringResults) + async def CreateSecretURIs(self, count=None): ''' - GetSecretBackendConfigs gets the config needed to create a client to secret backends. + CreateSecretURIs creates new secret URIs. - backend_ids : typing.Sequence[str] - for_drain : bool - Returns -> SecretBackendConfigResults + count : int + Returns -> StringResults ''' - if backend_ids is not None and not isinstance(backend_ids, (bytes, str, list)): - raise Exception("Expected backend_ids to be a Sequence, received: {}".format(type(backend_ids))) - - if for_drain is not None and not isinstance(for_drain, bool): - raise Exception("Expected for_drain to be a bool, received: {}".format(type(for_drain))) + if count is not None and not isinstance(count, int): + raise Exception("Expected count to be a int, received: {}".format(type(count))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetSecretBackendConfigs', + request='CreateSecretURIs', version=19, params=_params) - _params['backend-ids'] = backend_ids - _params['for-drain'] = for_drain + _params['count'] = count reply = await self.rpc(msg) return reply - @ReturnMapping(SecretContentResults) - async def GetSecretContentInfo(self, args=None): + @ReturnMapping(StringResults) + def sync_CreateSecrets(self, args=None): ''' - GetSecretContentInfo returns the secret values for the specified secrets. + CreateSecrets creates new secrets. - args : typing.Sequence[~GetSecretContentArg] - Returns -> SecretContentResults + args : typing.Sequence[~CreateSecretArg] + Returns -> StringResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) @@ -4615,76 +5563,88 @@ async def GetSecretContentInfo(self, args=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetSecretContentInfo', + request='CreateSecrets', version=19, params=_params) _params['args'] = args - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ListSecretResults) - async def GetSecretMetadata(self): + @ReturnMapping(StringResults) + async def CreateSecrets(self, args=None): ''' - GetSecretMetadata returns metadata for the caller's secrets. - + CreateSecrets creates new secrets. - Returns -> ListSecretResults + args : typing.Sequence[~CreateSecretArg] + Returns -> StringResults ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetSecretMetadata', + request='CreateSecrets', version=19, params=_params) - + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(SecretContentResults) - async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): + @ReturnMapping(ModelResult) + def sync_CurrentModel(self): ''' - GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. + CurrentModel returns the name and UUID for the current juju model. - pending_delete : bool - revisions : typing.Sequence[int] - uri : str - Returns -> SecretContentResults + + Returns -> ModelResult ''' - if pending_delete is not None and not isinstance(pending_delete, bool): - raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) - if revisions is not None and not isinstance(revisions, (bytes, str, list)): - raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CurrentModel', + version=19, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ModelResult) + async def CurrentModel(self): + ''' + CurrentModel returns the name and UUID for the current juju model. - if uri is not None and not isinstance(uri, (bytes, str)): - raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + Returns -> ModelResult + ''' # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GetSecretRevisionContentInfo', + request='CurrentModel', version=19, params=_params) - _params['pending-delete'] = pending_delete - _params['revisions'] = revisions - _params['uri'] = uri + reply = await self.rpc(msg) return reply - @ReturnMapping(GoalStateResults) - async def GoalStates(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_Destroy(self, entities=None): ''' - GoalStates returns information of charm units and relations. + Destroy advances all given Alive units' lifecycles as far as + possible. See state/Unit.Destroy(). entities : typing.Sequence[~Entity] - Returns -> GoalStateResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4692,22 +5652,23 @@ async def GoalStates(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='GoalStates', + request='Destroy', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(BoolResults) - async def HasSubordinates(self, entities=None): + @ReturnMapping(ErrorResults) + async def Destroy(self, entities=None): ''' - HasSubordinates returns the whether each given unit has any subordinates. + Destroy advances all given Alive units' lifecycles as far as + possible. See state/Unit.Destroy(). entities : typing.Sequence[~Entity] - Returns -> BoolResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4715,7 +5676,7 @@ async def HasSubordinates(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='HasSubordinates', + request='Destroy', version=19, params=_params) _params['entities'] = entities @@ -4724,13 +5685,13 @@ async def HasSubordinates(self, entities=None): - @ReturnMapping(StringResults) - async def LXDProfileName(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_DestroyAllSubordinates(self, entities=None): ''' - LXDProfileName is a shim to call the LXDProfileAPIv2 version of this method. + DestroyAllSubordinates destroys all subordinates of each given unit. entities : typing.Sequence[~Entity] - Returns -> StringResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4738,70 +5699,70 @@ async def LXDProfileName(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='LXDProfileName', + request='DestroyAllSubordinates', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(BoolResults) - async def LXDProfileRequired(self, urls=None): + @ReturnMapping(ErrorResults) + async def DestroyAllSubordinates(self, entities=None): ''' - LXDProfileRequired is a shim to call the LXDProfileAPIv2 version of this method. + DestroyAllSubordinates destroys all subordinates of each given unit. - urls : typing.Sequence[~CharmURL] - Returns -> BoolResults + entities : typing.Sequence[~Entity] + Returns -> ErrorResults ''' - if urls is not None and not isinstance(urls, (bytes, str, list)): - raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='LXDProfileRequired', + request='DestroyAllSubordinates', version=19, params=_params) - _params['urls'] = urls + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def LeaveScope(self, relation_units=None): + def sync_DestroyUnitStorageAttachments(self, entities=None): ''' - LeaveScope signals each unit has left its scope in the relation, - for all of the given relation/unit pairs. See also - state.RelationUnit.LeaveScope(). + DestroyUnitStorageAttachments marks each storage attachment of the + specified units as Dying. - relation_units : typing.Sequence[~RelationUnit] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' - if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='LeaveScope', + request='DestroyUnitStorageAttachments', version=19, params=_params) - _params['relation-units'] = relation_units - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(LifeResults) - async def Life(self, entities=None): + @ReturnMapping(ErrorResults) + async def DestroyUnitStorageAttachments(self, entities=None): ''' - Life returns the life status of every supplied entity, where available. + DestroyUnitStorageAttachments marks each storage attachment of the + specified units as Dying. entities : typing.Sequence[~Entity] - Returns -> LifeResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -4809,7 +5770,7 @@ async def Life(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Life', + request='DestroyUnitStorageAttachments', version=19, params=_params) _params['entities'] = entities @@ -4819,207 +5780,214 @@ async def Life(self, entities=None): @ReturnMapping(ErrorResults) - async def LogActionsMessages(self, messages=None): + def sync_EnsureDead(self, entities=None): ''' - LogActionsMessages records the log messages against the specified actions. + EnsureDead calls EnsureDead on each given entity from state. It + will fail if the entity is not present. If it's Alive, nothing will + happen (see state/EnsureDead() for units or machines). - messages : typing.Sequence[~EntityString] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' - if messages is not None and not isinstance(messages, (bytes, str, list)): - raise Exception("Expected messages to be a Sequence, received: {}".format(type(messages))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='LogActionsMessages', + request='EnsureDead', version=19, params=_params) - _params['messages'] = messages - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def Merge(self, params=None): + async def EnsureDead(self, entities=None): ''' - Merge merges in the provided leadership settings. Only leaders for - the given service may perform this operation. + EnsureDead calls EnsureDead on each given entity from state. It + will fail if the entity is not present. If it's Alive, nothing will + happen (see state/EnsureDead() for units or machines). - params : typing.Sequence[~MergeLeadershipSettingsParam] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' - if params is not None and not isinstance(params, (bytes, str, list)): - raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Merge', + request='EnsureDead', version=19, params=_params) - _params['params'] = params + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ModelConfigResult) - async def ModelConfig(self): + @ReturnMapping(ErrorResults) + def sync_EnterScope(self, relation_units=None): ''' - ModelConfig returns the current model's configuration. - + EnterScope ensures each unit has entered its scope in the relation, + for all of the given relation/unit pairs. See also + state.RelationUnit.EnterScope(). - Returns -> ModelConfigResult + relation_units : typing.Sequence[~RelationUnit] + Returns -> ErrorResults ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ModelConfig', + request='EnterScope', version=19, params=_params) - - reply = await self.rpc(msg) + _params['relation-units'] = relation_units + reply = self.sync_rpc(msg) return reply - @ReturnMapping(NetworkInfoResults) - async def NetworkInfo(self, bindings=None, relation_id=None, unit=None): + @ReturnMapping(ErrorResults) + async def EnterScope(self, relation_units=None): ''' - NetworkInfo returns network interfaces/addresses for specified bindings. + EnterScope ensures each unit has entered its scope in the relation, + for all of the given relation/unit pairs. See also + state.RelationUnit.EnterScope(). - bindings : typing.Sequence[str] - relation_id : int - unit : str - Returns -> NetworkInfoResults + relation_units : typing.Sequence[~RelationUnit] + Returns -> ErrorResults ''' - if bindings is not None and not isinstance(bindings, (bytes, str, list)): - raise Exception("Expected bindings to be a Sequence, received: {}".format(type(bindings))) - - if relation_id is not None and not isinstance(relation_id, int): - raise Exception("Expected relation_id to be a int, received: {}".format(type(relation_id))) - - if unit is not None and not isinstance(unit, (bytes, str)): - raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='NetworkInfo', + request='EnterScope', version=19, params=_params) - _params['bindings'] = bindings - _params['relation-id'] = relation_id - _params['unit'] = unit + _params['relation-units'] = relation_units reply = await self.rpc(msg) return reply - @ReturnMapping(OpenPortRangesByEndpointResults) - async def OpenedMachinePortRangesByEndpoint(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_FinishActions(self, results=None): ''' - OpenedMachinePortRangesByEndpoint returns the port ranges opened by each - unit on the provided machines grouped by application endpoint. + FinishActions saves the result of a completed Action - entities : typing.Sequence[~Entity] - Returns -> OpenPortRangesByEndpointResults + results : typing.Sequence[~ActionExecutionResult] + Returns -> ErrorResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if results is not None and not isinstance(results, (bytes, str, list)): + raise Exception("Expected results to be a Sequence, received: {}".format(type(results))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='OpenedMachinePortRangesByEndpoint', + request='FinishActions', version=19, params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) + _params['results'] = results + reply = self.sync_rpc(msg) return reply - @ReturnMapping(OpenPortRangesByEndpointResults) - async def OpenedPortRangesByEndpoint(self): + @ReturnMapping(ErrorResults) + async def FinishActions(self, results=None): ''' - OpenedPortRangesByEndpoint returns the port ranges opened by the unit. - + FinishActions saves the result of a completed Action - Returns -> OpenPortRangesByEndpointResults + results : typing.Sequence[~ActionExecutionResult] + Returns -> ErrorResults ''' + if results is not None and not isinstance(results, (bytes, str, list)): + raise Exception("Expected results to be a Sequence, received: {}".format(type(results))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='OpenedPortRangesByEndpoint', + request='FinishActions', version=19, params=_params) - + _params['results'] = results reply = await self.rpc(msg) return reply - @ReturnMapping(StringResults) - async def PrivateAddress(self, entities=None): + @ReturnMapping(SecretConsumerInfoResults) + def sync_GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): ''' - PrivateAddress returns the private address for each given unit, if set. + GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets. + This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook. - entities : typing.Sequence[~Entity] - Returns -> StringResults + consumer_tag : str + uris : typing.Sequence[str] + Returns -> SecretConsumerInfoResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if consumer_tag is not None and not isinstance(consumer_tag, (bytes, str)): + raise Exception("Expected consumer_tag to be a str, received: {}".format(type(consumer_tag))) + + if uris is not None and not isinstance(uris, (bytes, str, list)): + raise Exception("Expected uris to be a Sequence, received: {}".format(type(uris))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='PrivateAddress', + request='GetConsumerSecretsRevisionInfo', version=19, params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) + _params['consumer-tag'] = consumer_tag + _params['uris'] = uris + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringResult) - async def ProviderType(self): + @ReturnMapping(SecretConsumerInfoResults) + async def GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): ''' - ProviderType returns the provider type used by the current juju - model. - - TODO(dimitern): Refactor the uniter to call this instead of calling - ModelConfig() just to get the provider type. Once we have machine - addresses, this might be completely unnecessary though. - + GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets. + This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook. - Returns -> StringResult + consumer_tag : str + uris : typing.Sequence[str] + Returns -> SecretConsumerInfoResults ''' + if consumer_tag is not None and not isinstance(consumer_tag, (bytes, str)): + raise Exception("Expected consumer_tag to be a str, received: {}".format(type(consumer_tag))) + + if uris is not None and not isinstance(uris, (bytes, str, list)): + raise Exception("Expected uris to be a Sequence, received: {}".format(type(uris))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ProviderType', + request='GetConsumerSecretsRevisionInfo', version=19, params=_params) - + _params['consumer-tag'] = consumer_tag + _params['uris'] = uris reply = await self.rpc(msg) return reply - @ReturnMapping(StringResults) - async def PublicAddress(self, entities=None): + @ReturnMapping(MeterStatusResults) + def sync_GetMeterStatus(self, entities=None): ''' - PublicAddress returns the public address for each given unit, if set. - entities : typing.Sequence[~Entity] - Returns -> StringResults + Returns -> MeterStatusResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5027,23 +5995,20 @@ async def PublicAddress(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='PublicAddress', + request='GetMeterStatus', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(GetLeadershipSettingsBulkResults) - async def Read(self, entities=None): + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): ''' - Read reads leadership settings for the provided service ID. Any - unit of the service may perform this operation. - entities : typing.Sequence[~Entity] - Returns -> GetLeadershipSettingsBulkResults + Returns -> MeterStatusResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5051,7 +6016,7 @@ async def Read(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Read', + request='GetMeterStatus', version=19, params=_params) _params['entities'] = entities @@ -5060,94 +6025,84 @@ async def Read(self, entities=None): - @ReturnMapping(SettingsResult) - async def ReadLocalApplicationSettings(self, relation=None, unit=None): + @ReturnMapping(StringResults) + def sync_GetPodSpec(self, entities=None): ''' - ReadLocalApplicationSettings returns the local application settings for a - particular relation when invoked by the leader unit. + GetPodSpec gets the pod specs for a set of applications. - relation : str - unit : str - Returns -> SettingsResult + entities : typing.Sequence[~Entity] + Returns -> StringResults ''' - if relation is not None and not isinstance(relation, (bytes, str)): - raise Exception("Expected relation to be a str, received: {}".format(type(relation))) - - if unit is not None and not isinstance(unit, (bytes, str)): - raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ReadLocalApplicationSettings', + request='GetPodSpec', version=19, params=_params) - _params['relation'] = relation - _params['unit'] = unit - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(SettingsResults) - async def ReadRemoteSettings(self, relation_unit_pairs=None): + @ReturnMapping(StringResults) + async def GetPodSpec(self, entities=None): ''' - ReadRemoteSettings returns the remote settings of each given set of - relation/local unit/remote unit. + GetPodSpec gets the pod specs for a set of applications. - relation_unit_pairs : typing.Sequence[~RelationUnitPair] - Returns -> SettingsResults + entities : typing.Sequence[~Entity] + Returns -> StringResults ''' - if relation_unit_pairs is not None and not isinstance(relation_unit_pairs, (bytes, str, list)): - raise Exception("Expected relation_unit_pairs to be a Sequence, received: {}".format(type(relation_unit_pairs))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ReadRemoteSettings', + request='GetPodSpec', version=19, params=_params) - _params['relation-unit-pairs'] = relation_unit_pairs + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(SettingsResults) - async def ReadSettings(self, relation_units=None): + @ReturnMapping(StringBoolResults) + def sync_GetPrincipal(self, entities=None): ''' - ReadSettings returns the local settings of each given set of - relation/unit. - - NOTE(achilleasa): Using this call to read application data is deprecated - and will not work for k8s charms (see LP1876097). Instead, clients should - use ReadLocalApplicationSettings. + GetPrincipal returns the result of calling PrincipalName() and + converting it to a tag, on each given unit. - relation_units : typing.Sequence[~RelationUnit] - Returns -> SettingsResults + entities : typing.Sequence[~Entity] + Returns -> StringBoolResults ''' - if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='ReadSettings', + request='GetPrincipal', version=19, params=_params) - _params['relation-units'] = relation_units - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(UnitRefreshResults) - async def Refresh(self, entities=None): + @ReturnMapping(StringBoolResults) + async def GetPrincipal(self, entities=None): ''' - Refresh retrieves the latest values for attributes on this unit. + GetPrincipal returns the result of calling PrincipalName() and + converting it to a tag, on each given unit. entities : typing.Sequence[~Entity] - Returns -> UnitRefreshResults + Returns -> StringBoolResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5155,7 +6110,7 @@ async def Refresh(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Refresh', + request='GetPrincipal', version=19, params=_params) _params['entities'] = entities @@ -5164,62 +6119,2162 @@ async def Refresh(self, entities=None): - @ReturnMapping(RelationResults) - async def Relation(self, relation_units=None): + @ReturnMapping(StringResults) + def sync_GetRawK8sSpec(self, entities=None): ''' - Relation returns information about all given relation/unit pairs, - including their id, key and the local endpoint. + GetRawK8sSpec gets the raw k8s specs for a set of applications. - relation_units : typing.Sequence[~RelationUnit] - Returns -> RelationResults + entities : typing.Sequence[~Entity] + Returns -> StringResults ''' - if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Relation', + request='GetRawK8sSpec', version=19, params=_params) - _params['relation-units'] = relation_units - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(RelationResults) - async def RelationById(self, relation_ids=None): + @ReturnMapping(StringResults) + async def GetRawK8sSpec(self, entities=None): ''' - RelationById returns information about all given relations, - specified by their ids, including their key and the local - endpoint. + GetRawK8sSpec gets the raw k8s specs for a set of applications. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetRawK8sSpec', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretBackendConfigResults) + def sync_GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): + ''' + GetSecretBackendConfigs gets the config needed to create a client to secret backends. + + backend_ids : typing.Sequence[str] + for_drain : bool + Returns -> SecretBackendConfigResults + ''' + if backend_ids is not None and not isinstance(backend_ids, (bytes, str, list)): + raise Exception("Expected backend_ids to be a Sequence, received: {}".format(type(backend_ids))) + + if for_drain is not None and not isinstance(for_drain, bool): + raise Exception("Expected for_drain to be a bool, received: {}".format(type(for_drain))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretBackendConfigs', + version=19, + params=_params) + _params['backend-ids'] = backend_ids + _params['for-drain'] = for_drain + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SecretBackendConfigResults) + async def GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): + ''' + GetSecretBackendConfigs gets the config needed to create a client to secret backends. + + backend_ids : typing.Sequence[str] + for_drain : bool + Returns -> SecretBackendConfigResults + ''' + if backend_ids is not None and not isinstance(backend_ids, (bytes, str, list)): + raise Exception("Expected backend_ids to be a Sequence, received: {}".format(type(backend_ids))) + + if for_drain is not None and not isinstance(for_drain, bool): + raise Exception("Expected for_drain to be a bool, received: {}".format(type(for_drain))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretBackendConfigs', + version=19, + params=_params) + _params['backend-ids'] = backend_ids + _params['for-drain'] = for_drain + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + def sync_GetSecretContentInfo(self, args=None): + ''' + GetSecretContentInfo returns the secret values for the specified secrets. + + args : typing.Sequence[~GetSecretContentArg] + Returns -> SecretContentResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretContentInfo', + version=19, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + async def GetSecretContentInfo(self, args=None): + ''' + GetSecretContentInfo returns the secret values for the specified secrets. + + args : typing.Sequence[~GetSecretContentArg] + Returns -> SecretContentResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretContentInfo', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListSecretResults) + def sync_GetSecretMetadata(self): + ''' + GetSecretMetadata returns metadata for the caller's secrets. + + + Returns -> ListSecretResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretMetadata', + version=19, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ListSecretResults) + async def GetSecretMetadata(self): + ''' + GetSecretMetadata returns metadata for the caller's secrets. + + + Returns -> ListSecretResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretMetadata', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + def sync_GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): + ''' + GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. + + pending_delete : bool + revisions : typing.Sequence[int] + uri : str + Returns -> SecretContentResults + ''' + if pending_delete is not None and not isinstance(pending_delete, bool): + raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) + + if revisions is not None and not isinstance(revisions, (bytes, str, list)): + raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretRevisionContentInfo', + version=19, + params=_params) + _params['pending-delete'] = pending_delete + _params['revisions'] = revisions + _params['uri'] = uri + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SecretContentResults) + async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): + ''' + GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. + + pending_delete : bool + revisions : typing.Sequence[int] + uri : str + Returns -> SecretContentResults + ''' + if pending_delete is not None and not isinstance(pending_delete, bool): + raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) + + if revisions is not None and not isinstance(revisions, (bytes, str, list)): + raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GetSecretRevisionContentInfo', + version=19, + params=_params) + _params['pending-delete'] = pending_delete + _params['revisions'] = revisions + _params['uri'] = uri + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GoalStateResults) + def sync_GoalStates(self, entities=None): + ''' + GoalStates returns information of charm units and relations. + + entities : typing.Sequence[~Entity] + Returns -> GoalStateResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GoalStates', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(GoalStateResults) + async def GoalStates(self, entities=None): + ''' + GoalStates returns information of charm units and relations. + + entities : typing.Sequence[~Entity] + Returns -> GoalStateResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='GoalStates', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + def sync_HasSubordinates(self, entities=None): + ''' + HasSubordinates returns the whether each given unit has any subordinates. + + entities : typing.Sequence[~Entity] + Returns -> BoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='HasSubordinates', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def HasSubordinates(self, entities=None): + ''' + HasSubordinates returns the whether each given unit has any subordinates. + + entities : typing.Sequence[~Entity] + Returns -> BoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='HasSubordinates', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + def sync_LXDProfileName(self, entities=None): + ''' + LXDProfileName is a shim to call the LXDProfileAPIv2 version of this method. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LXDProfileName', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def LXDProfileName(self, entities=None): + ''' + LXDProfileName is a shim to call the LXDProfileAPIv2 version of this method. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LXDProfileName', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + def sync_LXDProfileRequired(self, urls=None): + ''' + LXDProfileRequired is a shim to call the LXDProfileAPIv2 version of this method. + + urls : typing.Sequence[~CharmURL] + Returns -> BoolResults + ''' + if urls is not None and not isinstance(urls, (bytes, str, list)): + raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LXDProfileRequired', + version=19, + params=_params) + _params['urls'] = urls + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def LXDProfileRequired(self, urls=None): + ''' + LXDProfileRequired is a shim to call the LXDProfileAPIv2 version of this method. + + urls : typing.Sequence[~CharmURL] + Returns -> BoolResults + ''' + if urls is not None and not isinstance(urls, (bytes, str, list)): + raise Exception("Expected urls to be a Sequence, received: {}".format(type(urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LXDProfileRequired', + version=19, + params=_params) + _params['urls'] = urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_LeaveScope(self, relation_units=None): + ''' + LeaveScope signals each unit has left its scope in the relation, + for all of the given relation/unit pairs. See also + state.RelationUnit.LeaveScope(). + + relation_units : typing.Sequence[~RelationUnit] + Returns -> ErrorResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LeaveScope', + version=19, + params=_params) + _params['relation-units'] = relation_units + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LeaveScope(self, relation_units=None): + ''' + LeaveScope signals each unit has left its scope in the relation, + for all of the given relation/unit pairs. See also + state.RelationUnit.LeaveScope(). + + relation_units : typing.Sequence[~RelationUnit] + Returns -> ErrorResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LeaveScope', + version=19, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Life', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Life', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_LogActionsMessages(self, messages=None): + ''' + LogActionsMessages records the log messages against the specified actions. + + messages : typing.Sequence[~EntityString] + Returns -> ErrorResults + ''' + if messages is not None and not isinstance(messages, (bytes, str, list)): + raise Exception("Expected messages to be a Sequence, received: {}".format(type(messages))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LogActionsMessages', + version=19, + params=_params) + _params['messages'] = messages + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LogActionsMessages(self, messages=None): + ''' + LogActionsMessages records the log messages against the specified actions. + + messages : typing.Sequence[~EntityString] + Returns -> ErrorResults + ''' + if messages is not None and not isinstance(messages, (bytes, str, list)): + raise Exception("Expected messages to be a Sequence, received: {}".format(type(messages))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='LogActionsMessages', + version=19, + params=_params) + _params['messages'] = messages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_Merge(self, params=None): + ''' + Merge merges in the provided leadership settings. Only leaders for + the given service may perform this operation. + + params : typing.Sequence[~MergeLeadershipSettingsParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Merge', + version=19, + params=_params) + _params['params'] = params + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Merge(self, params=None): + ''' + Merge merges in the provided leadership settings. Only leaders for + the given service may perform this operation. + + params : typing.Sequence[~MergeLeadershipSettingsParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Merge', + version=19, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + def sync_ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelConfig', + version=19, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelConfig', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NetworkInfoResults) + def sync_NetworkInfo(self, bindings=None, relation_id=None, unit=None): + ''' + NetworkInfo returns network interfaces/addresses for specified bindings. + + bindings : typing.Sequence[str] + relation_id : int + unit : str + Returns -> NetworkInfoResults + ''' + if bindings is not None and not isinstance(bindings, (bytes, str, list)): + raise Exception("Expected bindings to be a Sequence, received: {}".format(type(bindings))) + + if relation_id is not None and not isinstance(relation_id, int): + raise Exception("Expected relation_id to be a int, received: {}".format(type(relation_id))) + + if unit is not None and not isinstance(unit, (bytes, str)): + raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='NetworkInfo', + version=19, + params=_params) + _params['bindings'] = bindings + _params['relation-id'] = relation_id + _params['unit'] = unit + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NetworkInfoResults) + async def NetworkInfo(self, bindings=None, relation_id=None, unit=None): + ''' + NetworkInfo returns network interfaces/addresses for specified bindings. + + bindings : typing.Sequence[str] + relation_id : int + unit : str + Returns -> NetworkInfoResults + ''' + if bindings is not None and not isinstance(bindings, (bytes, str, list)): + raise Exception("Expected bindings to be a Sequence, received: {}".format(type(bindings))) + + if relation_id is not None and not isinstance(relation_id, int): + raise Exception("Expected relation_id to be a int, received: {}".format(type(relation_id))) + + if unit is not None and not isinstance(unit, (bytes, str)): + raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='NetworkInfo', + version=19, + params=_params) + _params['bindings'] = bindings + _params['relation-id'] = relation_id + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OpenPortRangesByEndpointResults) + def sync_OpenedMachinePortRangesByEndpoint(self, entities=None): + ''' + OpenedMachinePortRangesByEndpoint returns the port ranges opened by each + unit on the provided machines grouped by application endpoint. + + entities : typing.Sequence[~Entity] + Returns -> OpenPortRangesByEndpointResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='OpenedMachinePortRangesByEndpoint', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(OpenPortRangesByEndpointResults) + async def OpenedMachinePortRangesByEndpoint(self, entities=None): + ''' + OpenedMachinePortRangesByEndpoint returns the port ranges opened by each + unit on the provided machines grouped by application endpoint. + + entities : typing.Sequence[~Entity] + Returns -> OpenPortRangesByEndpointResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='OpenedMachinePortRangesByEndpoint', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OpenPortRangesByEndpointResults) + def sync_OpenedPortRangesByEndpoint(self): + ''' + OpenedPortRangesByEndpoint returns the port ranges opened by the unit. + + + Returns -> OpenPortRangesByEndpointResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='OpenedPortRangesByEndpoint', + version=19, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(OpenPortRangesByEndpointResults) + async def OpenedPortRangesByEndpoint(self): + ''' + OpenedPortRangesByEndpoint returns the port ranges opened by the unit. + + + Returns -> OpenPortRangesByEndpointResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='OpenedPortRangesByEndpoint', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + def sync_PrivateAddress(self, entities=None): + ''' + PrivateAddress returns the private address for each given unit, if set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='PrivateAddress', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PrivateAddress(self, entities=None): + ''' + PrivateAddress returns the private address for each given unit, if set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='PrivateAddress', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + def sync_ProviderType(self): + ''' + ProviderType returns the provider type used by the current juju + model. + + TODO(dimitern): Refactor the uniter to call this instead of calling + ModelConfig() just to get the provider type. Once we have machine + addresses, this might be completely unnecessary though. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ProviderType', + version=19, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ProviderType(self): + ''' + ProviderType returns the provider type used by the current juju + model. + + TODO(dimitern): Refactor the uniter to call this instead of calling + ModelConfig() just to get the provider type. Once we have machine + addresses, this might be completely unnecessary though. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ProviderType', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + def sync_PublicAddress(self, entities=None): + ''' + PublicAddress returns the public address for each given unit, if set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='PublicAddress', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PublicAddress(self, entities=None): + ''' + PublicAddress returns the public address for each given unit, if set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='PublicAddress', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetLeadershipSettingsBulkResults) + def sync_Read(self, entities=None): + ''' + Read reads leadership settings for the provided service ID. Any + unit of the service may perform this operation. + + entities : typing.Sequence[~Entity] + Returns -> GetLeadershipSettingsBulkResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Read', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(GetLeadershipSettingsBulkResults) + async def Read(self, entities=None): + ''' + Read reads leadership settings for the provided service ID. Any + unit of the service may perform this operation. + + entities : typing.Sequence[~Entity] + Returns -> GetLeadershipSettingsBulkResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Read', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResult) + def sync_ReadLocalApplicationSettings(self, relation=None, unit=None): + ''' + ReadLocalApplicationSettings returns the local application settings for a + particular relation when invoked by the leader unit. + + relation : str + unit : str + Returns -> SettingsResult + ''' + if relation is not None and not isinstance(relation, (bytes, str)): + raise Exception("Expected relation to be a str, received: {}".format(type(relation))) + + if unit is not None and not isinstance(unit, (bytes, str)): + raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadLocalApplicationSettings', + version=19, + params=_params) + _params['relation'] = relation + _params['unit'] = unit + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SettingsResult) + async def ReadLocalApplicationSettings(self, relation=None, unit=None): + ''' + ReadLocalApplicationSettings returns the local application settings for a + particular relation when invoked by the leader unit. + + relation : str + unit : str + Returns -> SettingsResult + ''' + if relation is not None and not isinstance(relation, (bytes, str)): + raise Exception("Expected relation to be a str, received: {}".format(type(relation))) + + if unit is not None and not isinstance(unit, (bytes, str)): + raise Exception("Expected unit to be a str, received: {}".format(type(unit))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadLocalApplicationSettings', + version=19, + params=_params) + _params['relation'] = relation + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + def sync_ReadRemoteSettings(self, relation_unit_pairs=None): + ''' + ReadRemoteSettings returns the remote settings of each given set of + relation/local unit/remote unit. + + relation_unit_pairs : typing.Sequence[~RelationUnitPair] + Returns -> SettingsResults + ''' + if relation_unit_pairs is not None and not isinstance(relation_unit_pairs, (bytes, str, list)): + raise Exception("Expected relation_unit_pairs to be a Sequence, received: {}".format(type(relation_unit_pairs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadRemoteSettings', + version=19, + params=_params) + _params['relation-unit-pairs'] = relation_unit_pairs + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadRemoteSettings(self, relation_unit_pairs=None): + ''' + ReadRemoteSettings returns the remote settings of each given set of + relation/local unit/remote unit. + + relation_unit_pairs : typing.Sequence[~RelationUnitPair] + Returns -> SettingsResults + ''' + if relation_unit_pairs is not None and not isinstance(relation_unit_pairs, (bytes, str, list)): + raise Exception("Expected relation_unit_pairs to be a Sequence, received: {}".format(type(relation_unit_pairs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadRemoteSettings', + version=19, + params=_params) + _params['relation-unit-pairs'] = relation_unit_pairs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + def sync_ReadSettings(self, relation_units=None): + ''' + ReadSettings returns the local settings of each given set of + relation/unit. + + NOTE(achilleasa): Using this call to read application data is deprecated + and will not work for k8s charms (see LP1876097). Instead, clients should + use ReadLocalApplicationSettings. + + relation_units : typing.Sequence[~RelationUnit] + Returns -> SettingsResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadSettings', + version=19, + params=_params) + _params['relation-units'] = relation_units + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadSettings(self, relation_units=None): + ''' + ReadSettings returns the local settings of each given set of + relation/unit. + + NOTE(achilleasa): Using this call to read application data is deprecated + and will not work for k8s charms (see LP1876097). Instead, clients should + use ReadLocalApplicationSettings. + + relation_units : typing.Sequence[~RelationUnit] + Returns -> SettingsResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ReadSettings', + version=19, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitRefreshResults) + def sync_Refresh(self, entities=None): + ''' + Refresh retrieves the latest values for attributes on this unit. + + entities : typing.Sequence[~Entity] + Returns -> UnitRefreshResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Refresh', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(UnitRefreshResults) + async def Refresh(self, entities=None): + ''' + Refresh retrieves the latest values for attributes on this unit. + + entities : typing.Sequence[~Entity] + Returns -> UnitRefreshResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Refresh', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + def sync_Relation(self, relation_units=None): + ''' + Relation returns information about all given relation/unit pairs, + including their id, key and the local endpoint. + + relation_units : typing.Sequence[~RelationUnit] + Returns -> RelationResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Relation', + version=19, + params=_params) + _params['relation-units'] = relation_units + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def Relation(self, relation_units=None): + ''' + Relation returns information about all given relation/unit pairs, + including their id, key and the local endpoint. + + relation_units : typing.Sequence[~RelationUnit] + Returns -> RelationResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Relation', + version=19, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + def sync_RelationById(self, relation_ids=None): + ''' + RelationById returns information about all given relations, + specified by their ids, including their key and the local + endpoint. + + relation_ids : typing.Sequence[int] + Returns -> RelationResults + ''' + if relation_ids is not None and not isinstance(relation_ids, (bytes, str, list)): + raise Exception("Expected relation_ids to be a Sequence, received: {}".format(type(relation_ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RelationById', + version=19, + params=_params) + _params['relation-ids'] = relation_ids + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def RelationById(self, relation_ids=None): + ''' + RelationById returns information about all given relations, + specified by their ids, including their key and the local + endpoint. relation_ids : typing.Sequence[int] Returns -> RelationResults ''' - if relation_ids is not None and not isinstance(relation_ids, (bytes, str, list)): - raise Exception("Expected relation_ids to be a Sequence, received: {}".format(type(relation_ids))) + if relation_ids is not None and not isinstance(relation_ids, (bytes, str, list)): + raise Exception("Expected relation_ids to be a Sequence, received: {}".format(type(relation_ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RelationById', + version=19, + params=_params) + _params['relation-ids'] = relation_ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitStatusResults) + def sync_RelationsStatus(self, entities=None): + ''' + RelationsStatus returns for each unit the corresponding relation and status information. + + entities : typing.Sequence[~Entity] + Returns -> RelationUnitStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RelationsStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitStatusResults) + async def RelationsStatus(self, entities=None): + ''' + RelationsStatus returns for each unit the corresponding relation and status information. + + entities : typing.Sequence[~Entity] + Returns -> RelationUnitStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RelationsStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_RemoveSecrets(self, args=None): + ''' + RemoveSecrets removes the specified secrets. + + args : typing.Sequence[~DeleteSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RemoveSecrets', + version=19, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveSecrets(self, args=None): + ''' + RemoveSecrets removes the specified secrets. + + args : typing.Sequence[~DeleteSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RemoveSecrets', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_RemoveStorageAttachments(self, ids=None): + ''' + RemoveStorageAttachments removes the specified storage + attachments from state. + + ids : typing.Sequence[~StorageAttachmentId] + Returns -> ErrorResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RemoveStorageAttachments', + version=19, + params=_params) + _params['ids'] = ids + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveStorageAttachments(self, ids=None): + ''' + RemoveStorageAttachments removes the specified storage + attachments from state. + + ids : typing.Sequence[~StorageAttachmentId] + Returns -> ErrorResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RemoveStorageAttachments', + version=19, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_RequestReboot(self, entities=None): + ''' + RequestReboot sets the reboot flag on the provided machines + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RequestReboot', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RequestReboot(self, entities=None): + ''' + RequestReboot sets the reboot flag on the provided machines + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='RequestReboot', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolvedModeResults) + def sync_Resolved(self, entities=None): + ''' + Resolved returns the current resolved setting for each given unit. + + entities : typing.Sequence[~Entity] + Returns -> ResolvedModeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Resolved', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ResolvedModeResults) + async def Resolved(self, entities=None): + ''' + Resolved returns the current resolved setting for each given unit. + + entities : typing.Sequence[~Entity] + Returns -> ResolvedModeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='Resolved', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + def sync_SLALevel(self): + ''' + SLALevel returns the model's SLA level. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SLALevel', + version=19, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + SLALevel returns the model's SLA level. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SLALevel', + version=19, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SecretsGrant(self, args=None): + ''' + SecretsGrant grants access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsGrant', + version=19, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SecretsGrant(self, args=None): + ''' + SecretsGrant grants access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsGrant', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SecretsRevoke(self, args=None): + ''' + SecretsRevoke revokes access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsRevoke', + version=19, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SecretsRevoke(self, args=None): + ''' + SecretsRevoke revokes access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsRevoke', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SecretsRotated(self, args=None): + ''' + SecretsRotated records when secrets were last rotated. + + args : typing.Sequence[~SecretRotatedArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsRotated', + version=19, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SecretsRotated(self, args=None): + ''' + SecretsRotated records when secrets were last rotated. + + args : typing.Sequence[~SecretRotatedArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SecretsRotated', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetAgentStatus(self, entities=None): + ''' + SetAgentStatus will set status for agents of Units passed in args, if one + of the args is not an Unit it will fail. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetAgentStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetAgentStatus(self, entities=None): + ''' + SetAgentStatus will set status for agents of Units passed in args, if one + of the args is not an Unit it will fail. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetAgentStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetApplicationStatus(self, entities=None): + ''' + SetApplicationStatus sets the status for all the Applications in args if the given Unit is + the leader. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetApplicationStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationStatus(self, entities=None): + ''' + SetApplicationStatus sets the status for all the Applications in args if the given Unit is + the leader. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetApplicationStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetCharmURL(self, entities=None): + ''' + SetCharmURL sets the charm URL for each given unit. An error will + be returned if a unit is dead, or the charm URL is not known. + + entities : typing.Sequence[~EntityCharmURL] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetCharmURL', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmURL(self, entities=None): + ''' + SetCharmURL sets the charm URL for each given unit. An error will + be returned if a unit is dead, or the charm URL is not known. + + entities : typing.Sequence[~EntityCharmURL] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetCharmURL', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetRelationStatus(self, args=None): + ''' + SetRelationStatus updates the status of the specified relations. + + args : typing.Sequence[~RelationStatusArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetRelationStatus', + version=19, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationStatus(self, args=None): + ''' + SetRelationStatus updates the status of the specified relations. + + args : typing.Sequence[~RelationStatusArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetRelationStatus', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetState(self, args=None): + ''' + SetState sets the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. + + args : typing.Sequence[~SetUnitStateArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetState', + version=19, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetState(self, args=None): + ''' + SetState sets the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. + + args : typing.Sequence[~SetUnitStateArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetState', + version=19, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetStatus(self, entities=None): + ''' + SetStatus will set status for a entities passed in args. If the entity is + a Unit it will instead set status to its agent, to emulate backwards + compatibility. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + SetStatus will set status for a entities passed in args. If the entity is + a Unit it will instead set status to its agent, to emulate backwards + compatibility. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetUnitStatus(self, entities=None): + ''' + SetUnitStatus sets status for all elements passed in args, the difference + with SetStatus is that if an entity is a Unit it will set its status instead + of its agent. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetUnitStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUnitStatus(self, entities=None): + ''' + SetUnitStatus sets status for all elements passed in args, the difference + with SetStatus is that if an entity is a Unit it will set its status instead + of its agent. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetUnitStatus', + version=19, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetUpgradeSeriesUnitStatus(self, params=None): + ''' + SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit. + If no upgrade is in progress an error is returned instead. + + params : typing.Sequence[~UpgradeSeriesStatusParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetUpgradeSeriesUnitStatus', + version=19, + params=_params) + _params['params'] = params + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUpgradeSeriesUnitStatus(self, params=None): + ''' + SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit. + If no upgrade is in progress an error is returned instead. + + params : typing.Sequence[~UpgradeSeriesStatusParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SetUpgradeSeriesUnitStatus', + version=19, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetWorkloadVersion(self, entities=None): + ''' + SetWorkloadVersion sets the workload version for each given unit. An error will + be returned if a unit is dead. + + entities : typing.Sequence[~EntityWorkloadVersion] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='RelationById', + request='SetWorkloadVersion', version=19, params=_params) - _params['relation-ids'] = relation_ids - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(RelationUnitStatusResults) - async def RelationsStatus(self, entities=None): + @ReturnMapping(ErrorResults) + async def SetWorkloadVersion(self, entities=None): ''' - RelationsStatus returns for each unit the corresponding relation and status information. + SetWorkloadVersion sets the workload version for each given unit. An error will + be returned if a unit is dead. - entities : typing.Sequence[~Entity] - Returns -> RelationUnitStatusResults + entities : typing.Sequence[~EntityWorkloadVersion] + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5227,7 +8282,7 @@ async def RelationsStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='RelationsStatus', + request='SetWorkloadVersion', version=19, params=_params) _params['entities'] = entities @@ -5236,197 +8291,201 @@ async def RelationsStatus(self, entities=None): - @ReturnMapping(ErrorResults) - async def RemoveSecrets(self, args=None): + @ReturnMapping(UnitStateResults) + def sync_State(self, entities=None): ''' - RemoveSecrets removes the specified secrets. + State returns the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. - args : typing.Sequence[~DeleteSecretArg] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> UnitStateResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='RemoveSecrets', + request='State', version=19, params=_params) - _params['args'] = args - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def RemoveStorageAttachments(self, ids=None): + @ReturnMapping(UnitStateResults) + async def State(self, entities=None): ''' - RemoveStorageAttachments removes the specified storage - attachments from state. + State returns the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. - ids : typing.Sequence[~StorageAttachmentId] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> UnitStateResults ''' - if ids is not None and not isinstance(ids, (bytes, str, list)): - raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='RemoveStorageAttachments', + request='State', version=19, params=_params) - _params['ids'] = ids + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def RequestReboot(self, entities=None): + @ReturnMapping(LifeResults) + def sync_StorageAttachmentLife(self, ids=None): ''' - RequestReboot sets the reboot flag on the provided machines + StorageAttachmentLife returns the lifecycle state of the storage attachments + with the specified tags. - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + ids : typing.Sequence[~StorageAttachmentId] + Returns -> LifeResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='RequestReboot', + request='StorageAttachmentLife', version=19, params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) + _params['ids'] = ids + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ResolvedModeResults) - async def Resolved(self, entities=None): + @ReturnMapping(LifeResults) + async def StorageAttachmentLife(self, ids=None): ''' - Resolved returns the current resolved setting for each given unit. + StorageAttachmentLife returns the lifecycle state of the storage attachments + with the specified tags. - entities : typing.Sequence[~Entity] - Returns -> ResolvedModeResults + ids : typing.Sequence[~StorageAttachmentId] + Returns -> LifeResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Resolved', + request='StorageAttachmentLife', version=19, params=_params) - _params['entities'] = entities + _params['ids'] = ids reply = await self.rpc(msg) return reply - @ReturnMapping(StringResult) - async def SLALevel(self): + @ReturnMapping(StorageAttachmentResults) + def sync_StorageAttachments(self, ids=None): ''' - SLALevel returns the model's SLA level. - + StorageAttachments returns the storage attachments with the specified tags. - Returns -> StringResult + ids : typing.Sequence[~StorageAttachmentId] + Returns -> StorageAttachmentResults ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SLALevel', + request='StorageAttachments', version=19, params=_params) - - reply = await self.rpc(msg) + _params['ids'] = ids + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SecretsGrant(self, args=None): + @ReturnMapping(StorageAttachmentResults) + async def StorageAttachments(self, ids=None): ''' - SecretsGrant grants access to a secret for the specified subjects. + StorageAttachments returns the storage attachments with the specified tags. - args : typing.Sequence[~GrantRevokeSecretArg] - Returns -> ErrorResults + ids : typing.Sequence[~StorageAttachmentId] + Returns -> StorageAttachmentResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SecretsGrant', + request='StorageAttachments', version=19, params=_params) - _params['args'] = args + _params['ids'] = ids reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SecretsRevoke(self, args=None): + @ReturnMapping(StatusResults) + def sync_UnitStatus(self, entities=None): ''' - SecretsRevoke revokes access to a secret for the specified subjects. + UnitStatus returns the workload status information for the unit. - args : typing.Sequence[~GrantRevokeSecretArg] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> StatusResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SecretsRevoke', + request='UnitStatus', version=19, params=_params) - _params['args'] = args - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SecretsRotated(self, args=None): + @ReturnMapping(StatusResults) + async def UnitStatus(self, entities=None): ''' - SecretsRotated records when secrets were last rotated. + UnitStatus returns the workload status information for the unit. - args : typing.Sequence[~SecretRotatedArg] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> StatusResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SecretsRotated', + request='UnitStatus', version=19, params=_params) - _params['args'] = args + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetAgentStatus(self, entities=None): + @ReturnMapping(StorageAttachmentIdsResults) + def sync_UnitStorageAttachments(self, entities=None): ''' - SetAgentStatus will set status for agents of Units passed in args, if one - of the args is not an Unit it will fail. + UnitStorageAttachments returns the IDs of storage attachments for a collection of units. - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> StorageAttachmentIdsResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5434,23 +8493,22 @@ async def SetAgentStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetAgentStatus', + request='UnitStorageAttachments', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetApplicationStatus(self, entities=None): + @ReturnMapping(StorageAttachmentIdsResults) + async def UnitStorageAttachments(self, entities=None): ''' - SetApplicationStatus sets the status for all the Applications in args if the given Unit is - the leader. + UnitStorageAttachments returns the IDs of storage attachments for a collection of units. - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> StorageAttachmentIdsResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5458,7 +8516,7 @@ async def SetApplicationStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetApplicationStatus', + request='UnitStorageAttachments', version=19, params=_params) _params['entities'] = entities @@ -5468,12 +8526,12 @@ async def SetApplicationStatus(self, entities=None): @ReturnMapping(ErrorResults) - async def SetCharmURL(self, entities=None): + def sync_UpdateNetworkInfo(self, entities=None): ''' - SetCharmURL sets the charm URL for each given unit. An error will - be returned if a unit is dead, or the charm URL is not known. + UpdateNetworkInfo refreshes the network settings for a unit's bound + endpoints. - entities : typing.Sequence[~EntityCharmURL] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): @@ -5482,45 +8540,45 @@ async def SetCharmURL(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetCharmURL', + request='UpdateNetworkInfo', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetRelationStatus(self, args=None): + async def UpdateNetworkInfo(self, entities=None): ''' - SetRelationStatus updates the status of the specified relations. + UpdateNetworkInfo refreshes the network settings for a unit's bound + endpoints. - args : typing.Sequence[~RelationStatusArg] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetRelationStatus', + request='UpdateNetworkInfo', version=19, params=_params) - _params['args'] = args + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetState(self, args=None): + def sync_UpdateSecrets(self, args=None): ''' - SetState sets the state persisted by the charm running in this unit - and the state internal to the uniter for this unit. + UpdateSecrets updates the specified secrets. - args : typing.Sequence[~SetUnitStateArg] + args : typing.Sequence[~UpdateSecretArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): @@ -5529,49 +8587,47 @@ async def SetState(self, args=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetState', + request='UpdateSecrets', version=19, params=_params) _params['args'] = args - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetStatus(self, entities=None): + async def UpdateSecrets(self, args=None): ''' - SetStatus will set status for a entities passed in args. If the entity is - a Unit it will instead set status to its agent, to emulate backwards - compatibility. + UpdateSecrets updates the specified secrets. - entities : typing.Sequence[~EntityStatusArgs] + args : typing.Sequence[~UpdateSecretArg] Returns -> ErrorResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetStatus', + request='UpdateSecrets', version=19, params=_params) - _params['entities'] = entities + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetUnitStatus(self, entities=None): + @ReturnMapping(UpgradeSeriesStatusResults) + def sync_UpgradeSeriesUnitStatus(self, entities=None): ''' - SetUnitStatus sets status for all elements passed in args, the difference - with SetStatus is that if an entity is a Unit it will set its status instead - of its agent. + UpgradeSeriesUnitStatus returns the current preparation status of an + upgrading unit. + If no series upgrade is in progress an error is returned instead. - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> UpgradeSeriesStatusResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5579,47 +8635,47 @@ async def SetUnitStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetUnitStatus', + request='UpgradeSeriesUnitStatus', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetUpgradeSeriesUnitStatus(self, params=None): + @ReturnMapping(UpgradeSeriesStatusResults) + async def UpgradeSeriesUnitStatus(self, entities=None): ''' - SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit. - If no upgrade is in progress an error is returned instead. + UpgradeSeriesUnitStatus returns the current preparation status of an + upgrading unit. + If no series upgrade is in progress an error is returned instead. - params : typing.Sequence[~UpgradeSeriesStatusParam] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> UpgradeSeriesStatusResults ''' - if params is not None and not isinstance(params, (bytes, str, list)): - raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetUpgradeSeriesUnitStatus', + request='UpgradeSeriesUnitStatus', version=19, params=_params) - _params['params'] = params + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetWorkloadVersion(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_Watch(self, entities=None): ''' - SetWorkloadVersion sets the workload version for each given unit. An error will - be returned if a unit is dead. + Watch starts an NotifyWatcher for each given entity. - entities : typing.Sequence[~EntityWorkloadVersion] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5627,23 +8683,22 @@ async def SetWorkloadVersion(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='SetWorkloadVersion', + request='Watch', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(UnitStateResults) - async def State(self, entities=None): + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): ''' - State returns the state persisted by the charm running in this unit - and the state internal to the uniter for this unit. + Watch starts an NotifyWatcher for each given entity. entities : typing.Sequence[~Entity] - Returns -> UnitStateResults + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5651,7 +8706,7 @@ async def State(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='State', + request='Watch', version=19, params=_params) _params['entities'] = entities @@ -5660,60 +8715,58 @@ async def State(self, entities=None): - @ReturnMapping(LifeResults) - async def StorageAttachmentLife(self, ids=None): + @ReturnMapping(NotifyWatchResult) + def sync_WatchAPIHostPorts(self): ''' - StorageAttachmentLife returns the lifecycle state of the storage attachments - with the specified tags. + WatchAPIHostPorts watches the API server addresses. - ids : typing.Sequence[~StorageAttachmentId] - Returns -> LifeResults + + Returns -> NotifyWatchResult ''' - if ids is not None and not isinstance(ids, (bytes, str, list)): - raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='StorageAttachmentLife', + request='WatchAPIHostPorts', version=19, params=_params) - _params['ids'] = ids - reply = await self.rpc(msg) + + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StorageAttachmentResults) - async def StorageAttachments(self, ids=None): + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): ''' - StorageAttachments returns the storage attachments with the specified tags. + WatchAPIHostPorts watches the API server addresses. - ids : typing.Sequence[~StorageAttachmentId] - Returns -> StorageAttachmentResults + + Returns -> NotifyWatchResult ''' - if ids is not None and not isinstance(ids, (bytes, str, list)): - raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='StorageAttachments', + request='WatchAPIHostPorts', version=19, params=_params) - _params['ids'] = ids + reply = await self.rpc(msg) return reply - @ReturnMapping(StatusResults) - async def UnitStatus(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchActionNotifications(self, entities=None): ''' - UnitStatus returns the workload status information for the unit. + WatchActionNotifications returns a StringsWatcher for observing + incoming action calls to a unit. See also state/watcher.go + Unit.WatchActionNotifications(). This method is called from + api/uniter/uniter.go WatchActionNotifications(). entities : typing.Sequence[~Entity] - Returns -> StatusResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5721,22 +8774,25 @@ async def UnitStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='UnitStatus', + request='WatchActionNotifications', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StorageAttachmentIdsResults) - async def UnitStorageAttachments(self, entities=None): + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(self, entities=None): ''' - UnitStorageAttachments returns the IDs of storage attachments for a collection of units. + WatchActionNotifications returns a StringsWatcher for observing + incoming action calls to a unit. See also state/watcher.go + Unit.WatchActionNotifications(). This method is called from + api/uniter/uniter.go WatchActionNotifications(). entities : typing.Sequence[~Entity] - Returns -> StorageAttachmentIdsResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5744,7 +8800,7 @@ async def UnitStorageAttachments(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='UnitStorageAttachments', + request='WatchActionNotifications', version=19, params=_params) _params['entities'] = entities @@ -5753,14 +8809,17 @@ async def UnitStorageAttachments(self, entities=None): - @ReturnMapping(ErrorResults) - async def UpdateNetworkInfo(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchConfigSettingsHash(self, entities=None): ''' - UpdateNetworkInfo refreshes the network settings for a unit's bound - endpoints. + WatchConfigSettingsHash returns a StringsWatcher that yields a hash + of the config values every time the config changes. The uniter can + save this hash and use it to decide whether the config-changed hook + needs to be run (or whether this was just an agent restart with no + substantive config change). entities : typing.Sequence[~Entity] - Returns -> ErrorResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5768,47 +8827,49 @@ async def UpdateNetworkInfo(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='UpdateNetworkInfo', + request='WatchConfigSettingsHash', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def UpdateSecrets(self, args=None): + @ReturnMapping(StringsWatchResults) + async def WatchConfigSettingsHash(self, entities=None): ''' - UpdateSecrets updates the specified secrets. + WatchConfigSettingsHash returns a StringsWatcher that yields a hash + of the config values every time the config changes. The uniter can + save this hash and use it to decide whether the config-changed hook + needs to be run (or whether this was just an agent restart with no + substantive config change). - args : typing.Sequence[~UpdateSecretArg] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='UpdateSecrets', + request='WatchConfigSettingsHash', version=19, params=_params) - _params['args'] = args + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(UpgradeSeriesStatusResults) - async def UpgradeSeriesUnitStatus(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchConsumedSecretsChanges(self, entities=None): ''' - UpgradeSeriesUnitStatus returns the current preparation status of an - upgrading unit. - If no series upgrade is in progress an error is returned instead. + WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers. entities : typing.Sequence[~Entity] - Returns -> UpgradeSeriesStatusResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5816,22 +8877,22 @@ async def UpgradeSeriesUnitStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='UpgradeSeriesUnitStatus', + request='WatchConsumedSecretsChanges', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def Watch(self, entities=None): + @ReturnMapping(StringsWatchResults) + async def WatchConsumedSecretsChanges(self, entities=None): ''' - Watch starts an NotifyWatcher for each given entity. + WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers. entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5839,7 +8900,7 @@ async def Watch(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='Watch', + request='WatchConsumedSecretsChanges', version=19, params=_params) _params['entities'] = entities @@ -5849,9 +8910,13 @@ async def Watch(self, entities=None): @ReturnMapping(NotifyWatchResult) - async def WatchAPIHostPorts(self): + def sync_WatchForModelConfigChanges(self): ''' - WatchAPIHostPorts watches the API server addresses. + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. Returns -> NotifyWatchResult @@ -5860,7 +8925,32 @@ async def WatchAPIHostPorts(self): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchAPIHostPorts', + request='WatchForModelConfigChanges', + version=19, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchForModelConfigChanges', version=19, params=_params) @@ -5869,16 +8959,13 @@ async def WatchAPIHostPorts(self): - @ReturnMapping(StringsWatchResults) - async def WatchActionNotifications(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchInstanceData(self, entities=None): ''' - WatchActionNotifications returns a StringsWatcher for observing - incoming action calls to a unit. See also state/watcher.go - Unit.WatchActionNotifications(). This method is called from - api/uniter/uniter.go WatchActionNotifications(). + WatchInstanceData is a shim to call the LXDProfileAPIv2 version of this method. entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5886,26 +8973,22 @@ async def WatchActionNotifications(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchActionNotifications', + request='WatchInstanceData', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringsWatchResults) - async def WatchConfigSettingsHash(self, entities=None): + @ReturnMapping(NotifyWatchResults) + async def WatchInstanceData(self, entities=None): ''' - WatchConfigSettingsHash returns a StringsWatcher that yields a hash - of the config values every time the config changes. The uniter can - save this hash and use it to decide whether the config-changed hook - needs to be run (or whether this was just an agent restart with no - substantive config change). + WatchInstanceData is a shim to call the LXDProfileAPIv2 version of this method. entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5913,7 +8996,7 @@ async def WatchConfigSettingsHash(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchConfigSettingsHash', + request='WatchInstanceData', version=19, params=_params) _params['entities'] = entities @@ -5922,13 +9005,14 @@ async def WatchConfigSettingsHash(self, entities=None): - @ReturnMapping(StringsWatchResults) - async def WatchConsumedSecretsChanges(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchLeadershipSettings(self, entities=None): ''' - WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers. + WatchLeadershipSettings will block the caller until leadership settings + for the given service ID change. entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -5936,45 +9020,42 @@ async def WatchConsumedSecretsChanges(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchConsumedSecretsChanges', + request='WatchLeadershipSettings', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def WatchForModelConfigChanges(self): + @ReturnMapping(NotifyWatchResults) + async def WatchLeadershipSettings(self, entities=None): ''' - WatchForModelConfigChanges returns a NotifyWatcher that observes - changes to the model configuration. - Note that although the NotifyWatchResult contains an Error field, - it's not used because we are only returning a single watcher, - so we use the regular error return. - + WatchLeadershipSettings will block the caller until leadership settings + for the given service ID change. - Returns -> NotifyWatchResult + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchForModelConfigChanges', + request='WatchLeadershipSettings', version=19, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(NotifyWatchResults) - async def WatchInstanceData(self, entities=None): + def sync_WatchMeterStatus(self, entities=None): ''' - WatchInstanceData is a shim to call the LXDProfileAPIv2 version of this method. - entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' @@ -5984,21 +9065,18 @@ async def WatchInstanceData(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchInstanceData', + request='WatchMeterStatus', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(NotifyWatchResults) - async def WatchLeadershipSettings(self, entities=None): + async def WatchMeterStatus(self, entities=None): ''' - WatchLeadershipSettings will block the caller until leadership settings - for the given service ID change. - entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' @@ -6008,7 +9086,7 @@ async def WatchLeadershipSettings(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchLeadershipSettings', + request='WatchMeterStatus', version=19, params=_params) _params['entities'] = entities @@ -6017,11 +9095,19 @@ async def WatchLeadershipSettings(self, entities=None): - @ReturnMapping(NotifyWatchResults) - async def WatchMeterStatus(self, entities=None): + @ReturnMapping(StringsWatchResult) + def sync_WatchObsolete(self, entities=None): ''' + WatchObsolete returns a watcher for notifying when: + - a secret owned by the entity is deleted + - a secret revision owed by the entity no longer + has any consumers + + Obsolete revisions results are "uri/revno" and deleted + secret results are "uri". + entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + Returns -> StringsWatchResult ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -6029,11 +9115,11 @@ async def WatchMeterStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Uniter', - request='WatchMeterStatus', + request='WatchObsolete', version=19, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @@ -6067,6 +9153,31 @@ async def WatchObsolete(self, entities=None): + @ReturnMapping(RelationUnitsWatchResults) + def sync_WatchRelationUnits(self, relation_units=None): + ''' + WatchRelationUnits returns a RelationUnitsWatcher for observing + changes to every unit in the supplied relation that is visible to + the supplied unit. See also state/watcher.go:RelationUnit.Watch(). + + relation_units : typing.Sequence[~RelationUnit] + Returns -> RelationUnitsWatchResults + ''' + if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): + raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchRelationUnits', + version=19, + params=_params) + _params['relation-units'] = relation_units + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RelationUnitsWatchResults) async def WatchRelationUnits(self, relation_units=None): ''' @@ -6092,6 +9203,29 @@ async def WatchRelationUnits(self, relation_units=None): + @ReturnMapping(SecretTriggerWatchResult) + def sync_WatchSecretRevisionsExpiryChanges(self, entities=None): + ''' + WatchSecretRevisionsExpiryChanges sets up a watcher to notify of changes to secret revision expiry config. + + entities : typing.Sequence[~Entity] + Returns -> SecretTriggerWatchResult + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchSecretRevisionsExpiryChanges', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretTriggerWatchResult) async def WatchSecretRevisionsExpiryChanges(self, entities=None): ''' @@ -6115,6 +9249,29 @@ async def WatchSecretRevisionsExpiryChanges(self, entities=None): + @ReturnMapping(SecretTriggerWatchResult) + def sync_WatchSecretsRotationChanges(self, entities=None): + ''' + WatchSecretsRotationChanges sets up a watcher to notify of changes to secret rotation config. + + entities : typing.Sequence[~Entity] + Returns -> SecretTriggerWatchResult + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchSecretsRotationChanges', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretTriggerWatchResult) async def WatchSecretsRotationChanges(self, entities=None): ''' @@ -6138,6 +9295,31 @@ async def WatchSecretsRotationChanges(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchStorageAttachments(self, ids=None): + ''' + WatchStorageAttachments creates watchers for a collection of storage + attachments, each of which can be used to watch changes to storage + attachment info. + + ids : typing.Sequence[~StorageAttachmentId] + Returns -> NotifyWatchResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchStorageAttachments', + version=19, + params=_params) + _params['ids'] = ids + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchStorageAttachments(self, ids=None): ''' @@ -6163,6 +9345,32 @@ async def WatchStorageAttachments(self, ids=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchTrustConfigSettingsHash(self, entities=None): + ''' + WatchTrustConfigSettingsHash returns a StringsWatcher that yields a + hash of the application config values whenever they change. The + uniter can use the hash to determine whether the actual values have + changed since it last saw the config. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchTrustConfigSettingsHash', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchTrustConfigSettingsHash(self, entities=None): ''' @@ -6189,6 +9397,32 @@ async def WatchTrustConfigSettingsHash(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchUnitAddressesHash(self, entities=None): + ''' + WatchUnitAddressesHash returns a StringsWatcher that yields the + hashes of the addresses for the unit whenever the addresses + change. The uniter can use the hash to determine whether the actual + address values have changed since it last saw the config. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchUnitAddressesHash', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchUnitAddressesHash(self, entities=None): ''' @@ -6215,6 +9449,33 @@ async def WatchUnitAddressesHash(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchUnitRelations(self, entities=None): + ''' + WatchUnitRelations returns a StringsWatcher, for each given + unit, that notifies of changes to the lifecycles of relations + relevant to that unit. For principal units, this will be all of the + relations for the application. For subordinate units, only + relations with the principal unit's application will be monitored. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchUnitRelations', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchUnitRelations(self, entities=None): ''' @@ -6242,6 +9503,31 @@ async def WatchUnitRelations(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchUnitStorageAttachments(self, entities=None): + ''' + WatchUnitStorageAttachments creates watchers for a collection of units, + each of which can be used to watch for lifecycle changes to the corresponding + unit's storage attachments. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchUnitStorageAttachments', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchUnitStorageAttachments(self, entities=None): ''' @@ -6267,6 +9553,29 @@ async def WatchUnitStorageAttachments(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchUpgradeSeriesNotifications(self, entities=None): + ''' + WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchUpgradeSeriesNotifications', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchUpgradeSeriesNotifications(self, entities=None): ''' @@ -6290,6 +9599,29 @@ async def WatchUpgradeSeriesNotifications(self, entities=None): + @ReturnMapping(StringResults) + def sync_WorkloadVersion(self, entities=None): + ''' + WorkloadVersion returns the workload version for all given units or applications. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WorkloadVersion', + version=19, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def WorkloadVersion(self, entities=None): ''' diff --git a/juju/client/_client2.py b/juju/client/_client2.py index 5728356b..9272e93d 100644 --- a/juju/client/_client2.py +++ b/juju/client/_client2.py @@ -74,6 +74,31 @@ class AnnotationsFacade(Type): 'type': 'object'} + @ReturnMapping(AnnotationsGetResults) + def sync_Get(self, entities=None): + ''' + Get returns annotations for given entities. + If annotations cannot be retrieved for a given entity, an error is returned. + Each entity is treated independently and, hence, will fail or succeed independently. + + entities : typing.Sequence[~Entity] + Returns -> AnnotationsGetResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Annotations', + request='Get', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AnnotationsGetResults) async def Get(self, entities=None): ''' @@ -99,6 +124,29 @@ async def Get(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_Set(self, annotations=None): + ''' + Set stores annotations for given entities + + annotations : typing.Sequence[~EntityAnnotations] + Returns -> ErrorResults + ''' + if annotations is not None and not isinstance(annotations, (bytes, str, list)): + raise Exception("Expected annotations to be a Sequence, received: {}".format(type(annotations))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Annotations', + request='Set', + version=2, + params=_params) + _params['annotations'] = annotations + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Set(self, annotations=None): ''' @@ -173,6 +221,27 @@ class BlockFacade(Type): 'type': 'object'} + @ReturnMapping(BlockResults) + def sync_List(self): + ''' + List implements Block.List(). + + + Returns -> BlockResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Block', + request='List', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(BlockResults) async def List(self): ''' @@ -194,6 +263,34 @@ async def List(self): + @ReturnMapping(ErrorResult) + def sync_SwitchBlockOff(self, message=None, type_=None): + ''' + SwitchBlockOff implements Block.SwitchBlockOff(). + + message : str + type_ : str + Returns -> ErrorResult + ''' + if message is not None and not isinstance(message, (bytes, str)): + raise Exception("Expected message to be a str, received: {}".format(type(message))) + + if type_ is not None and not isinstance(type_, (bytes, str)): + raise Exception("Expected type_ to be a str, received: {}".format(type(type_))) + + # 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 = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResult) async def SwitchBlockOff(self, message=None, type_=None): ''' @@ -222,6 +319,34 @@ async def SwitchBlockOff(self, message=None, type_=None): + @ReturnMapping(ErrorResult) + def sync_SwitchBlockOn(self, message=None, type_=None): + ''' + SwitchBlockOn implements Block.SwitchBlockOn(). + + message : str + type_ : str + Returns -> ErrorResult + ''' + if message is not None and not isinstance(message, (bytes, str)): + raise Exception("Expected message to be a str, received: {}".format(type(message))) + + if type_ is not None and not isinstance(type_, (bytes, str)): + raise Exception("Expected type_ to be a str, received: {}".format(type(type_))) + + # 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 = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResult) async def SwitchBlockOn(self, message=None, type_=None): ''' @@ -398,6 +523,29 @@ class CAASAgentFacade(Type): 'type': 'object'} + @ReturnMapping(CloudSpecResults) + def sync_CloudSpec(self, entities=None): + ''' + CloudSpec returns the model's cloud spec. + + entities : typing.Sequence[~Entity] + Returns -> CloudSpecResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASAgent', + request='CloudSpec', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CloudSpecResults) async def CloudSpec(self, entities=None): ''' @@ -421,6 +569,29 @@ async def CloudSpec(self, entities=None): + @ReturnMapping(ControllerAPIInfoResults) + def sync_ControllerAPIInfoForModels(self, entities=None): + ''' + ControllerAPIInfoForModels returns the controller api connection details for the specified models. + + entities : typing.Sequence[~Entity] + Returns -> ControllerAPIInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASAgent', + request='ControllerAPIInfoForModels', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ControllerAPIInfoResults) async def ControllerAPIInfoForModels(self, entities=None): ''' @@ -444,6 +615,27 @@ async def ControllerAPIInfoForModels(self, entities=None): + @ReturnMapping(ControllerConfigResult) + def sync_ControllerConfig(self): + ''' + ControllerConfig returns the controller's configuration. + + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASAgent', + request='ControllerConfig', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ControllerConfigResult) async def ControllerConfig(self): ''' @@ -465,6 +657,27 @@ async def ControllerConfig(self): + @ReturnMapping(CloudSpecResult) + def sync_GetCloudSpec(self): + ''' + GetCloudSpec constructs the CloudSpec for a validated and authorized model. + + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASAgent', + request='GetCloudSpec', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CloudSpecResult) async def GetCloudSpec(self): ''' @@ -486,6 +699,27 @@ async def GetCloudSpec(self): + @ReturnMapping(ModelConfigResult) + def sync_ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASAgent', + request='ModelConfig', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelConfigResult) async def ModelConfig(self): ''' @@ -507,6 +741,29 @@ async def ModelConfig(self): + @ReturnMapping(NotifyWatchResults) + def sync_WatchCloudSpecsChanges(self, entities=None): + ''' + WatchCloudSpecsChanges returns a watcher for cloud spec changes. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASAgent', + request='WatchCloudSpecsChanges', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchCloudSpecsChanges(self, entities=None): ''' @@ -531,7 +788,7 @@ async def WatchCloudSpecsChanges(self, entities=None): @ReturnMapping(NotifyWatchResult) - async def WatchForModelConfigChanges(self): + def sync_WatchForModelConfigChanges(self): ''' WatchForModelConfigChanges returns a NotifyWatcher that observes changes to the model configuration. @@ -550,30 +807,55 @@ async def WatchForModelConfigChanges(self): version=2, params=_params) - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply -class CAASUnitProvisionerFacade(Type): - name = 'CAASUnitProvisioner' - version = 2 - schema = {'definitions': {'Address': {'additionalProperties': False, - 'properties': {'cidr': {'type': 'string'}, - 'config-type': {'type': 'string'}, - 'is-secondary': {'type': 'boolean'}, - 'scope': {'type': 'string'}, - 'space-id': {'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'}, + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASAgent', + request='WatchForModelConfigChanges', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CAASUnitProvisionerFacade(Type): + name = 'CAASUnitProvisioner' + version = 2 + schema = {'definitions': {'Address': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'is-secondary': {'type': 'boolean'}, + 'scope': {'type': 'string'}, + 'space-id': {'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'}, 'ApplicationUnitInfo': {'additionalProperties': False, 'properties': {'provider-id': {'type': 'string'}, 'unit-tag': {'type': 'string'}}, @@ -1251,6 +1533,29 @@ class CAASUnitProvisionerFacade(Type): 'type': 'object'} + @ReturnMapping(Charm) + def sync_ApplicationCharmInfo(self, tag=None): + ''' + ApplicationCharmInfo returns information about an application's charm. + + tag : str + Returns -> Charm + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='ApplicationCharmInfo', + version=2, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(Charm) async def ApplicationCharmInfo(self, tag=None): ''' @@ -1275,7 +1580,7 @@ async def ApplicationCharmInfo(self, tag=None): @ReturnMapping(ApplicationGetConfigResults) - async def ApplicationsConfig(self, entities=None): + def sync_ApplicationsConfig(self, entities=None): ''' ApplicationsConfig returns the config for the specified applications. @@ -1292,18 +1597,18 @@ async def ApplicationsConfig(self, entities=None): version=2, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(IntResults) - async def ApplicationsScale(self, entities=None): + @ReturnMapping(ApplicationGetConfigResults) + async def ApplicationsConfig(self, entities=None): ''' - ApplicationsScale returns the scaling info for specified applications in this model. + ApplicationsConfig returns the config for the specified applications. entities : typing.Sequence[~Entity] - Returns -> IntResults + Returns -> ApplicationGetConfigResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -1311,7 +1616,7 @@ async def ApplicationsScale(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='ApplicationsScale', + request='ApplicationsConfig', version=2, params=_params) _params['entities'] = entities @@ -1320,13 +1625,13 @@ async def ApplicationsScale(self, entities=None): - @ReturnMapping(BoolResults) - async def ApplicationsTrust(self, entities=None): + @ReturnMapping(IntResults) + def sync_ApplicationsScale(self, entities=None): ''' - ApplicationsTrust returns the trust status for specified applications in this model. + ApplicationsScale returns the scaling info for specified applications in this model. entities : typing.Sequence[~Entity] - Returns -> BoolResults + Returns -> IntResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -1334,46 +1639,45 @@ async def ApplicationsTrust(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='ApplicationsTrust', + request='ApplicationsScale', version=2, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(Charm) - async def CharmInfo(self, url=None): + @ReturnMapping(IntResults) + async def ApplicationsScale(self, entities=None): ''' - CharmInfo returns information about the requested charm. + ApplicationsScale returns the scaling info for specified applications in this model. - url : str - Returns -> Charm + entities : typing.Sequence[~Entity] + Returns -> IntResults ''' - if url is not None and not isinstance(url, (bytes, str)): - raise Exception("Expected url to be a str, received: {}".format(type(url))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='CharmInfo', + request='ApplicationsScale', version=2, params=_params) - _params['url'] = url + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def ClearApplicationsResources(self, entities=None): + @ReturnMapping(BoolResults) + def sync_ApplicationsTrust(self, entities=None): ''' - ClearApplicationsResources clears the flags which indicate - applications still have resources in the cluster. + ApplicationsTrust returns the trust status for specified applications in this model. entities : typing.Sequence[~Entity] - Returns -> ErrorResults + Returns -> BoolResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -1381,22 +1685,22 @@ async def ClearApplicationsResources(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='ClearApplicationsResources', + request='ApplicationsTrust', version=2, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringResults) - async def DeploymentMode(self, entities=None): + @ReturnMapping(BoolResults) + async def ApplicationsTrust(self, entities=None): ''' - DeploymentMode returns the deployment mode of the given applications' charms. + ApplicationsTrust returns the trust status for specified applications in this model. entities : typing.Sequence[~Entity] - Returns -> StringResults + Returns -> BoolResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -1404,7 +1708,7 @@ async def DeploymentMode(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='DeploymentMode', + request='ApplicationsTrust', version=2, params=_params) _params['entities'] = entities @@ -1413,58 +1717,59 @@ async def DeploymentMode(self, entities=None): - @ReturnMapping(LifeResults) - async def Life(self, entities=None): + @ReturnMapping(Charm) + def sync_CharmInfo(self, url=None): ''' - Life returns the life status of every supplied entity, where available. + CharmInfo returns information about the requested charm. - entities : typing.Sequence[~Entity] - Returns -> LifeResults + url : str + Returns -> Charm ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='Life', + request='CharmInfo', version=2, params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) + _params['url'] = url + reply = self.sync_rpc(msg) return reply - @ReturnMapping(KubernetesProvisioningInfoResults) - async def ProvisioningInfo(self, entities=None): + @ReturnMapping(Charm) + async def CharmInfo(self, url=None): ''' - ProvisioningInfo returns the provisioning info for specified applications in this model. + CharmInfo returns information about the requested charm. - entities : typing.Sequence[~Entity] - Returns -> KubernetesProvisioningInfoResults + url : str + Returns -> Charm ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='ProvisioningInfo', + request='CharmInfo', version=2, params=_params) - _params['entities'] = entities + _params['url'] = url reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetOperatorStatus(self, entities=None): + def sync_ClearApplicationsResources(self, entities=None): ''' - SetOperatorStatus updates the operator status for each given application. + ClearApplicationsResources clears the flags which indicate + applications still have resources in the cluster. - entities : typing.Sequence[~EntityStatusArgs] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): @@ -1473,70 +1778,69 @@ async def SetOperatorStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='SetOperatorStatus', + request='ClearApplicationsResources', version=2, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def UpdateApplicationsService(self, args=None): + async def ClearApplicationsResources(self, entities=None): ''' - UpdateApplicationsService updates the Juju data model to reflect the given - service details of the specified application. + ClearApplicationsResources clears the flags which indicate + applications still have resources in the cluster. - args : typing.Sequence[~UpdateApplicationServiceArg] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='UpdateApplicationsService', + request='ClearApplicationsResources', version=2, params=_params) - _params['args'] = args + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(UpdateApplicationUnitResults) - async def UpdateApplicationsUnits(self, args=None): + @ReturnMapping(StringResults) + def sync_DeploymentMode(self, entities=None): ''' - UpdateApplicationsUnits updates the Juju data model to reflect the given - units of the specified application. + DeploymentMode returns the deployment mode of the given applications' charms. - args : typing.Sequence[~UpdateApplicationUnits] - Returns -> UpdateApplicationUnitResults + entities : typing.Sequence[~Entity] + Returns -> StringResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='UpdateApplicationsUnits', + request='DeploymentMode', version=2, params=_params) - _params['args'] = args - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def Watch(self, entities=None): + @ReturnMapping(StringResults) + async def DeploymentMode(self, entities=None): ''' - Watch starts a NotifyWatcher for each entity given. + DeploymentMode returns the deployment mode of the given applications' charms. entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + Returns -> StringResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -1544,7 +1848,7 @@ async def Watch(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='Watch', + request='DeploymentMode', version=2, params=_params) _params['entities'] = entities @@ -1553,36 +1857,36 @@ async def Watch(self, entities=None): - @ReturnMapping(StringsWatchResult) - async def WatchApplications(self): + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): ''' - WatchApplications starts a StringsWatcher to watch applications - deployed to this model. - + Life returns the life status of every supplied entity, where available. - Returns -> StringsWatchResult + entities : typing.Sequence[~Entity] + Returns -> LifeResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='WatchApplications', + request='Life', version=2, params=_params) - - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchApplicationsScale(self, entities=None): + @ReturnMapping(LifeResults) + async def Life(self, entities=None): ''' - WatchApplicationsScale starts a NotifyWatcher to watch changes - to the applications' scale. + Life returns the life status of every supplied entity, where available. entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + Returns -> LifeResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -1590,7 +1894,7 @@ async def WatchApplicationsScale(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='WatchApplicationsScale', + request='Life', version=2, params=_params) _params['entities'] = entities @@ -1599,14 +1903,13 @@ async def WatchApplicationsScale(self, entities=None): - @ReturnMapping(StringsWatchResults) - async def WatchApplicationsTrustHash(self, entities=None): + @ReturnMapping(KubernetesProvisioningInfoResults) + def sync_ProvisioningInfo(self, entities=None): ''' - WatchApplicationsTrustHash starts a StringsWatcher to watch changes - to the applications' trust status. + ProvisioningInfo returns the provisioning info for specified applications in this model. entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + Returns -> KubernetesProvisioningInfoResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -1614,16 +1917,391 @@ async def WatchApplicationsTrustHash(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='CAASUnitProvisioner', - request='WatchApplicationsTrustHash', + request='ProvisioningInfo', version=2, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) + @ReturnMapping(KubernetesProvisioningInfoResults) + async def ProvisioningInfo(self, entities=None): + ''' + ProvisioningInfo returns the provisioning info for specified applications in this model. + + entities : typing.Sequence[~Entity] + Returns -> KubernetesProvisioningInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='ProvisioningInfo', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetOperatorStatus(self, entities=None): + ''' + SetOperatorStatus updates the operator status for each given application. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='SetOperatorStatus', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetOperatorStatus(self, entities=None): + ''' + SetOperatorStatus updates the operator status for each given application. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='SetOperatorStatus', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_UpdateApplicationsService(self, args=None): + ''' + UpdateApplicationsService updates the Juju data model to reflect the given + service details of the specified application. + + args : typing.Sequence[~UpdateApplicationServiceArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='UpdateApplicationsService', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateApplicationsService(self, args=None): + ''' + UpdateApplicationsService updates the Juju data model to reflect the given + service details of the specified application. + + args : typing.Sequence[~UpdateApplicationServiceArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='UpdateApplicationsService', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpdateApplicationUnitResults) + def sync_UpdateApplicationsUnits(self, args=None): + ''' + UpdateApplicationsUnits updates the Juju data model to reflect the given + units of the specified application. + + args : typing.Sequence[~UpdateApplicationUnits] + Returns -> UpdateApplicationUnitResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='UpdateApplicationsUnits', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(UpdateApplicationUnitResults) + async def UpdateApplicationsUnits(self, args=None): + ''' + UpdateApplicationsUnits updates the Juju data model to reflect the given + units of the specified application. + + args : typing.Sequence[~UpdateApplicationUnits] + Returns -> UpdateApplicationUnitResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='UpdateApplicationsUnits', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + def sync_Watch(self, entities=None): + ''' + Watch starts a NotifyWatcher for each entity given. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='Watch', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts a NotifyWatcher for each entity given. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='Watch', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + def sync_WatchApplications(self): + ''' + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='WatchApplications', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchApplications(self): + ''' + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='WatchApplications', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + def sync_WatchApplicationsScale(self, entities=None): + ''' + WatchApplicationsScale starts a NotifyWatcher to watch changes + to the applications' scale. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='WatchApplicationsScale', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchApplicationsScale(self, entities=None): + ''' + WatchApplicationsScale starts a NotifyWatcher to watch changes + to the applications' scale. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='WatchApplicationsScale', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + def sync_WatchApplicationsTrustHash(self, entities=None): + ''' + WatchApplicationsTrustHash starts a StringsWatcher to watch changes + to the applications' trust status. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='WatchApplicationsTrustHash', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchApplicationsTrustHash(self, entities=None): + ''' + WatchApplicationsTrustHash starts a StringsWatcher to watch changes + to the applications' trust status. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='WatchApplicationsTrustHash', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + def sync_WatchPodSpec(self, entities=None): + ''' + WatchPodSpec starts a NotifyWatcher to watch changes to the + pod spec for specified units in this model. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='WatchPodSpec', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) async def WatchPodSpec(self, entities=None): ''' WatchPodSpec starts a NotifyWatcher to watch changes to the @@ -1675,6 +2353,28 @@ class CharmRevisionUpdaterFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResult) + def sync_UpdateLatestRevisions(self): + ''' + UpdateLatestRevisions retrieves the latest revision information from the charm store for all deployed charms + and records this information in state. + + + Returns -> ErrorResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CharmRevisionUpdater', + request='UpdateLatestRevisions', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResult) async def UpdateLatestRevisions(self): ''' @@ -1723,6 +2423,27 @@ class CleanerFacade(Type): 'type': 'object'} + @ReturnMapping(None) + def sync_Cleanup(self): + ''' + Cleanup triggers a state cleanup + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cleaner', + request='Cleanup', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Cleanup(self): ''' @@ -1744,6 +2465,27 @@ async def Cleanup(self): + @ReturnMapping(NotifyWatchResult) + def sync_WatchCleanups(self): + ''' + WatchCleanups watches for cleanups to be performed in state. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cleaner', + request='WatchCleanups', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchCleanups(self): ''' @@ -1831,6 +2573,29 @@ class CredentialValidatorFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResult) + def sync_InvalidateModelCredential(self, reason=None): + ''' + InvalidateModelCredential marks the cloud credential for this model as invalid. + + reason : str + Returns -> ErrorResult + ''' + if reason is not None and not isinstance(reason, (bytes, str)): + raise Exception("Expected reason to be a str, received: {}".format(type(reason))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CredentialValidator', + request='InvalidateModelCredential', + version=2, + params=_params) + _params['reason'] = reason + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResult) async def InvalidateModelCredential(self, reason=None): ''' @@ -1854,6 +2619,27 @@ async def InvalidateModelCredential(self, reason=None): + @ReturnMapping(ModelCredential) + def sync_ModelCredential(self): + ''' + ModelCredential returns cloud credential information for a model. + + + Returns -> ModelCredential + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CredentialValidator', + request='ModelCredential', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelCredential) async def ModelCredential(self): ''' @@ -1875,6 +2661,30 @@ async def ModelCredential(self): + @ReturnMapping(NotifyWatchResult) + def sync_WatchCredential(self, tag=None): + ''' + WatchCredential returns a NotifyWatcher that observes + changes to a given cloud credential. + + tag : str + Returns -> NotifyWatchResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CredentialValidator', + request='WatchCredential', + version=2, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchCredential(self, tag=None): ''' @@ -1899,6 +2709,27 @@ async def WatchCredential(self, tag=None): + @ReturnMapping(NotifyWatchResult) + def sync_WatchModelCredential(self): + ''' + WatchModelCredential returns a NotifyWatcher that watches what cloud credential a model uses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CredentialValidator', + request='WatchModelCredential', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchModelCredential(self): ''' @@ -2315,6 +3146,30 @@ class CrossModelRelationsFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_PublishIngressNetworkChanges(self, changes=None): + ''' + PublishIngressNetworkChanges publishes changes to the required + ingress addresses to the model hosting the offer in the relation. + + changes : typing.Sequence[~IngressNetworksChangeEvent] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='PublishIngressNetworkChanges', + version=2, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def PublishIngressNetworkChanges(self, changes=None): ''' @@ -2339,26 +3194,74 @@ async def PublishIngressNetworkChanges(self, changes=None): - @ReturnMapping(ErrorResults) - async def PublishRelationChanges(self, changes=None): + @ReturnMapping(ErrorResults) + def sync_PublishRelationChanges(self, changes=None): + ''' + PublishRelationChanges publishes relation changes to the + model hosting the remote application involved in the relation. + + changes : typing.Sequence[~RemoteRelationChangeEvent] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='PublishRelationChanges', + version=2, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def PublishRelationChanges(self, changes=None): + ''' + PublishRelationChanges publishes relation changes to the + model hosting the remote application involved in the relation. + + changes : typing.Sequence[~RemoteRelationChangeEvent] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='PublishRelationChanges', + version=2, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RegisterRemoteRelationResults) + def sync_RegisterRemoteRelations(self, relations=None): ''' - PublishRelationChanges publishes relation changes to the - model hosting the remote application involved in the relation. + RegisterRemoteRelations sets up the model to participate + in the specified relations. This operation is idempotent. - changes : typing.Sequence[~RemoteRelationChangeEvent] - Returns -> ErrorResults + relations : typing.Sequence[~RegisterRemoteRelationArg] + Returns -> RegisterRemoteRelationResults ''' - if changes is not None and not isinstance(changes, (bytes, str, list)): - raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + if relations is not None and not isinstance(relations, (bytes, str, list)): + raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) # map input types to rpc msg _params = dict() msg = dict(type='CrossModelRelations', - request='PublishRelationChanges', + request='RegisterRemoteRelations', version=2, params=_params) - _params['changes'] = changes - reply = await self.rpc(msg) + _params['relations'] = relations + reply = self.sync_rpc(msg) return reply @@ -2387,6 +3290,30 @@ async def RegisterRemoteRelations(self, relations=None): + @ReturnMapping(SecretRevisionWatchResults) + def sync_WatchConsumedSecretsChanges(self, relations=None): + ''' + WatchConsumedSecretsChanges returns a watcher which notifies of changes to any secrets + for the specified remote consumers. + + relations : typing.Sequence[~WatchRemoteSecretChangesArg] + Returns -> SecretRevisionWatchResults + ''' + if relations is not None and not isinstance(relations, (bytes, str, list)): + raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchConsumedSecretsChanges', + version=2, + params=_params) + _params['relations'] = relations + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretRevisionWatchResults) async def WatchConsumedSecretsChanges(self, relations=None): ''' @@ -2411,6 +3338,31 @@ async def WatchConsumedSecretsChanges(self, relations=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchEgressAddressesForRelations(self, args=None): + ''' + WatchEgressAddressesForRelations creates a watcher that notifies when addresses, from which + connections will originate for the relation, change. + Each event contains the entire set of addresses which are required for ingress for the relation. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> StringsWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchEgressAddressesForRelations', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchEgressAddressesForRelations(self, args=None): ''' @@ -2436,6 +3388,30 @@ async def WatchEgressAddressesForRelations(self, args=None): + @ReturnMapping(OfferStatusWatchResults) + def sync_WatchOfferStatus(self, args=None): + ''' + WatchOfferStatus starts an OfferStatusWatcher for + watching the status of an offer. + + args : typing.Sequence[~OfferArg] + Returns -> OfferStatusWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchOfferStatus', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(OfferStatusWatchResults) async def WatchOfferStatus(self, args=None): ''' @@ -2460,6 +3436,31 @@ async def WatchOfferStatus(self, args=None): + @ReturnMapping(RemoteRelationWatchResults) + def sync_WatchRelationChanges(self, args=None): + ''' + WatchRelationChanges starts a RemoteRelationChangesWatcher for each + specified relation, returning the watcher IDs and initial values, + or an error if the remote relations couldn't be watched. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> RemoteRelationWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchRelationChanges', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RemoteRelationWatchResults) async def WatchRelationChanges(self, args=None): ''' @@ -2485,6 +3486,30 @@ async def WatchRelationChanges(self, args=None): + @ReturnMapping(RelationStatusWatchResults) + def sync_WatchRelationsSuspendedStatus(self, args=None): + ''' + WatchRelationsSuspendedStatus starts a RelationStatusWatcher for + watching the life and suspended status of a relation. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> RelationStatusWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchRelationsSuspendedStatus', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RelationStatusWatchResults) async def WatchRelationsSuspendedStatus(self, args=None): ''' @@ -2572,6 +3597,27 @@ class DiskManagerFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_SetMachineBlockDevices(self, machine_block_devices=None): + ''' + machine_block_devices : typing.Sequence[~MachineBlockDevices] + Returns -> ErrorResults + ''' + if machine_block_devices is not None and not isinstance(machine_block_devices, (bytes, str, list)): + raise Exception("Expected machine_block_devices to be a Sequence, received: {}".format(type(machine_block_devices))) + + # 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 = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetMachineBlockDevices(self, machine_block_devices=None): ''' @@ -2624,6 +3670,29 @@ class EntityWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(EntitiesWatchResult) + def sync_Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvEntitiesWatcher. + + + Returns -> EntitiesWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='EntityWatcher', + request='Next', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(EntitiesWatchResult) async def Next(self): ''' @@ -2647,6 +3716,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='EntityWatcher', + request='Stop', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -2680,6 +3770,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class FilesystemAttachmentsWatcherFacade(Type): @@ -2720,6 +3821,29 @@ class FilesystemAttachmentsWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(MachineStorageIdsWatchResult) + def sync_Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvMachineStorageIdsWatcher. + + + Returns -> MachineStorageIdsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='FilesystemAttachmentsWatcher', + request='Next', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MachineStorageIdsWatchResult) async def Next(self): ''' @@ -2743,6 +3867,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='FilesystemAttachmentsWatcher', + request='Stop', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -2776,6 +3921,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class HighAvailabilityFacade(Type): @@ -2851,6 +4007,30 @@ class HighAvailabilityFacade(Type): 'type': 'object'} + @ReturnMapping(ControllersChangeResults) + def sync_EnableHA(self, specs=None): + ''' + EnableHA adds controller machines as necessary to ensure the + controller has the number of machines specified. + + specs : typing.Sequence[~ControllersSpec] + Returns -> ControllersChangeResults + ''' + if specs is not None and not isinstance(specs, (bytes, str, list)): + raise Exception("Expected specs to be a Sequence, received: {}".format(type(specs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='HighAvailability', + request='EnableHA', + version=2, + params=_params) + _params['specs'] = specs + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ControllersChangeResults) async def EnableHA(self, specs=None): ''' @@ -2931,6 +4111,30 @@ class LeadershipServiceFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResult) + def sync_BlockUntilLeadershipReleased(self, name=None): + ''' + BlockUntilLeadershipReleased blocks the caller until leadership is + released for the given service. + + name : str + Returns -> ErrorResult + ''' + if name is not None and not isinstance(name, (bytes, str)): + raise Exception("Expected name to be a str, received: {}".format(type(name))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='LeadershipService', + request='BlockUntilLeadershipReleased', + version=2, + params=_params) + _params['Name'] = name + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResult) async def BlockUntilLeadershipReleased(self, name=None): ''' @@ -2955,6 +4159,29 @@ async def BlockUntilLeadershipReleased(self, name=None): + @ReturnMapping(ClaimLeadershipBulkResults) + def sync_ClaimLeadership(self, params=None): + ''' + ClaimLeadership makes a leadership claim with the given parameters. + + params : typing.Sequence[~ClaimLeadershipParams] + Returns -> ClaimLeadershipBulkResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='LeadershipService', + request='ClaimLeadership', + version=2, + params=_params) + _params['params'] = params + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ClaimLeadershipBulkResults) async def ClaimLeadership(self, params=None): ''' @@ -3092,6 +4319,29 @@ class MeterStatusFacade(Type): 'type': 'object'} + @ReturnMapping(MeterStatusResults) + def sync_GetMeterStatus(self, entities=None): + ''' + GetMeterStatus returns meter status information for each unit. + + entities : typing.Sequence[~Entity] + Returns -> MeterStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MeterStatus', + request='GetMeterStatus', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MeterStatusResults) async def GetMeterStatus(self, entities=None): ''' @@ -3115,6 +4365,30 @@ async def GetMeterStatus(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetState(self, args=None): + ''' + SetState sets the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. + + args : typing.Sequence[~SetUnitStateArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MeterStatus', + request='SetState', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetState(self, args=None): ''' @@ -3139,6 +4413,30 @@ async def SetState(self, args=None): + @ReturnMapping(UnitStateResults) + def sync_State(self, entities=None): + ''' + State returns the state persisted by the charm running in this unit + and the state internal to the uniter for this unit. + + entities : typing.Sequence[~Entity] + Returns -> UnitStateResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MeterStatus', + request='State', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UnitStateResults) async def State(self, entities=None): ''' @@ -3163,6 +4461,30 @@ async def State(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchMeterStatus(self, entities=None): + ''' + WatchMeterStatus returns a NotifyWatcher for observing changes + to each unit's meter status. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MeterStatus', + request='WatchMeterStatus', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchMeterStatus(self, entities=None): ''' @@ -3246,6 +4568,29 @@ class MetricsAdderFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_AddMetricBatches(self, batches=None): + ''' + AddMetricBatches implements the MetricsAdder interface. + + batches : typing.Sequence[~MetricBatchParam] + Returns -> ErrorResults + ''' + if batches is not None and not isinstance(batches, (bytes, str, list)): + raise Exception("Expected batches to be a Sequence, received: {}".format(type(batches))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MetricsAdder', + request='AddMetricBatches', + version=2, + params=_params) + _params['batches'] = batches + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def AddMetricBatches(self, batches=None): ''' @@ -3345,6 +4690,29 @@ class MetricsDebugFacade(Type): 'type': 'object'} + @ReturnMapping(MetricResults) + def sync_GetMetrics(self, entities=None): + ''' + GetMetrics returns all metrics stored by the state server. + + entities : typing.Sequence[~Entity] + Returns -> MetricResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MetricsDebug', + request='GetMetrics', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MetricResults) async def GetMetrics(self, entities=None): ''' @@ -3368,6 +4736,29 @@ async def GetMetrics(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetMeterStatus(self, statues=None): + ''' + SetMeterStatus sets meter statuses for entities. + + statues : typing.Sequence[~MeterStatusParam] + Returns -> ErrorResults + ''' + if statues is not None and not isinstance(statues, (bytes, str, list)): + raise Exception("Expected statues to be a Sequence, received: {}".format(type(statues))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MetricsDebug', + request='SetMeterStatus', + version=2, + params=_params) + _params['statues'] = statues + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetMeterStatus(self, statues=None): ''' @@ -3617,6 +5008,30 @@ class MigrationTargetFacade(Type): 'type': 'object'} + @ReturnMapping(None) + def sync_Abort(self, model_tag=None): + ''' + Abort removes the specified model from the database. It is an error to + attempt to Abort a model that has a migration mode other than importing. + + model_tag : str + Returns -> None + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Abort', + version=2, + params=_params) + _params['model-tag'] = model_tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Abort(self, model_tag=None): ''' @@ -3632,11 +5047,63 @@ async def Abort(self, model_tag=None): # map input types to rpc msg _params = dict() msg = dict(type='MigrationTarget', - request='Abort', + request='Abort', + version=2, + params=_params) + _params['model-tag'] = model_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + def sync_Activate(self, controller_alias=None, controller_tag=None, cross_model_uuids=None, model_tag=None, source_api_addrs=None, source_ca_cert=None): + ''' + Activate sets the migration mode of the model to "none", meaning it + is ready for use. It is an error to attempt to Abort a model that + has a migration mode other than importing. It also adds any required + external controller records for those controllers hosting offers used + by the model. + + controller_alias : str + controller_tag : str + cross_model_uuids : typing.Sequence[str] + model_tag : str + source_api_addrs : typing.Sequence[str] + source_ca_cert : str + Returns -> None + ''' + if controller_alias is not None and not isinstance(controller_alias, (bytes, str)): + raise Exception("Expected controller_alias to be a str, received: {}".format(type(controller_alias))) + + if controller_tag is not None and not isinstance(controller_tag, (bytes, str)): + raise Exception("Expected controller_tag to be a str, received: {}".format(type(controller_tag))) + + if cross_model_uuids is not None and not isinstance(cross_model_uuids, (bytes, str, list)): + raise Exception("Expected cross_model_uuids to be a Sequence, received: {}".format(type(cross_model_uuids))) + + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + if source_api_addrs is not None and not isinstance(source_api_addrs, (bytes, str, list)): + raise Exception("Expected source_api_addrs to be a Sequence, received: {}".format(type(source_api_addrs))) + + if source_ca_cert is not None and not isinstance(source_ca_cert, (bytes, str)): + raise Exception("Expected source_ca_cert to be a str, received: {}".format(type(source_ca_cert))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Activate', version=2, params=_params) + _params['controller-alias'] = controller_alias + _params['controller-tag'] = controller_tag + _params['cross-model-uuids'] = cross_model_uuids _params['model-tag'] = model_tag - reply = await self.rpc(msg) + _params['source-api-addrs'] = source_api_addrs + _params['source-ca-cert'] = source_ca_cert + reply = self.sync_rpc(msg) return reply @@ -3693,6 +5160,37 @@ async def Activate(self, controller_alias=None, controller_tag=None, cross_model + @ReturnMapping(None) + def sync_AdoptResources(self, model_tag=None, source_controller_version=None): + ''' + AdoptResources asks the cloud provider to update the controller + tags for a model's resources. This prevents the resources from + being destroyed if the source controller is destroyed after the + model is migrated away. + + model_tag : str + source_controller_version : Number + Returns -> None + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + if source_controller_version is not None and not isinstance(source_controller_version, (dict, Number)): + raise Exception("Expected source_controller_version to be a Number, received: {}".format(type(source_controller_version))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='AdoptResources', + version=2, + params=_params) + _params['model-tag'] = model_tag + _params['source-controller-version'] = source_controller_version + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def AdoptResources(self, model_tag=None, source_controller_version=None): ''' @@ -3724,6 +5222,27 @@ async def AdoptResources(self, model_tag=None, source_controller_version=None): + @ReturnMapping(BytesResult) + def sync_CACert(self): + ''' + CACert returns the certificate used to validate the state connection. + + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='CACert', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(BytesResult) async def CACert(self): ''' @@ -3745,6 +5264,30 @@ async def CACert(self): + @ReturnMapping(ErrorResults) + def sync_CheckMachines(self, model_tag=None): + ''' + CheckMachines compares the machines in state with the ones reported + by the provider and reports any discrepancies. + + model_tag : str + Returns -> ErrorResults + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='CheckMachines', + version=2, + params=_params) + _params['model-tag'] = model_tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def CheckMachines(self, model_tag=None): ''' @@ -3769,6 +5312,45 @@ async def CheckMachines(self, model_tag=None): + @ReturnMapping(None) + def sync_Import(self, bytes_=None, charms=None, resources=None, tools=None): + ''' + Import takes a serialized Juju model, deserializes it, and + recreates it in the receiving controller. + + bytes_ : typing.Sequence[int] + charms : typing.Sequence[str] + resources : typing.Sequence[~SerializedModelResource] + tools : typing.Sequence[~SerializedModelTools] + Returns -> None + ''' + if bytes_ is not None and not isinstance(bytes_, (bytes, str, list)): + raise Exception("Expected bytes_ to be a Sequence, received: {}".format(type(bytes_))) + + if charms is not None and not isinstance(charms, (bytes, str, list)): + raise Exception("Expected charms to be a Sequence, received: {}".format(type(charms))) + + if resources is not None and not isinstance(resources, (bytes, str, list)): + raise Exception("Expected resources to be a Sequence, received: {}".format(type(resources))) + + if tools is not None and not isinstance(tools, (bytes, str, list)): + raise Exception("Expected tools to be a Sequence, received: {}".format(type(tools))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Import', + version=2, + params=_params) + _params['bytes'] = bytes_ + _params['charms'] = charms + _params['resources'] = resources + _params['tools'] = tools + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Import(self, bytes_=None, charms=None, resources=None, tools=None): ''' @@ -3808,6 +5390,44 @@ async def Import(self, bytes_=None, charms=None, resources=None, tools=None): + @ReturnMapping(str) + def sync_LatestLogTime(self, model_tag=None): + ''' + LatestLogTime returns the time of the most recent log record + received by the logtransfer endpoint. This can be used as the start + point for streaming logs from the source if the transfer was + interrupted. + + For performance reasons, not every time is tracked, so if the + target controller died during the transfer the latest log time + might be up to 2 minutes earlier. If the transfer was interrupted + in some other way (like the source controller going away or a + network partition) the time will be up-to-date. + + Log messages are assumed to be sent in time order (which is how + debug-log emits them). If that isn't the case then this mechanism + can't be used to avoid duplicates when logtransfer is restarted. + + Returns the zero time if no logs have been transferred. + + model_tag : str + Returns -> str + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='LatestLogTime', + version=2, + params=_params) + _params['model-tag'] = model_tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(str) async def LatestLogTime(self, model_tag=None): ''' @@ -3846,6 +5466,50 @@ async def LatestLogTime(self, model_tag=None): + @ReturnMapping(None) + def sync_Prechecks(self, agent_version=None, controller_agent_version=None, name=None, owner_tag=None, uuid=None): + ''' + Prechecks ensure that the target controller is ready to accept a + model migration. + + agent_version : Number + controller_agent_version : Number + name : str + owner_tag : str + uuid : str + Returns -> None + ''' + if agent_version is not None and not isinstance(agent_version, (dict, Number)): + raise Exception("Expected agent_version to be a Number, received: {}".format(type(agent_version))) + + if controller_agent_version is not None and not isinstance(controller_agent_version, (dict, Number)): + raise Exception("Expected controller_agent_version to be a Number, received: {}".format(type(controller_agent_version))) + + if name is not None and not isinstance(name, (bytes, str)): + raise Exception("Expected name to be a str, received: {}".format(type(name))) + + if owner_tag is not None and not isinstance(owner_tag, (bytes, str)): + raise Exception("Expected owner_tag to be a str, received: {}".format(type(owner_tag))) + + if uuid is not None and not isinstance(uuid, (bytes, str)): + raise Exception("Expected uuid to be a str, received: {}".format(type(uuid))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Prechecks', + version=2, + params=_params) + _params['agent-version'] = agent_version + _params['controller-agent-version'] = controller_agent_version + _params['name'] = name + _params['owner-tag'] = owner_tag + _params['uuid'] = uuid + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Prechecks(self, agent_version=None, controller_agent_version=None, name=None, owner_tag=None, uuid=None): ''' @@ -3972,6 +5636,29 @@ class ProxyUpdaterFacade(Type): 'type': 'object'} + @ReturnMapping(ProxyConfigResults) + def sync_ProxyConfig(self, entities=None): + ''' + ProxyConfig returns the proxy settings for the current model. + + entities : typing.Sequence[~Entity] + Returns -> ProxyConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ProxyUpdater', + request='ProxyConfig', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ProxyConfigResults) async def ProxyConfig(self, entities=None): ''' @@ -3995,6 +5682,29 @@ async def ProxyConfig(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchForProxyConfigAndAPIHostPortChanges(self, entities=None): + ''' + WatchForProxyConfigAndAPIHostPortChanges watches for changes to the proxy and api host port settings. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ProxyUpdater', + request='WatchForProxyConfigAndAPIHostPortChanges', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchForProxyConfigAndAPIHostPortChanges(self, entities=None): ''' @@ -4063,6 +5773,27 @@ class RaftLeaseFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_ApplyLease(self, commands=None): + ''' + commands : typing.Sequence[~LeaseOperationCommand] + Returns -> ErrorResults + ''' + if commands is not None and not isinstance(commands, (bytes, str, list)): + raise Exception("Expected commands to be a Sequence, received: {}".format(type(commands))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RaftLease', + request='ApplyLease', + version=2, + params=_params) + _params['commands'] = commands + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ApplyLease(self, commands=None): ''' @@ -4171,6 +5902,29 @@ class RebootFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_ClearReboot(self, entities=None): + ''' + ClearReboot will clear the reboot flag on provided machines, if it exists. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Reboot', + request='ClearReboot', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ClearReboot(self, entities=None): ''' @@ -4194,6 +5948,34 @@ async def ClearReboot(self, entities=None): + @ReturnMapping(RebootActionResults) + def sync_GetRebootAction(self, entities=None): + ''' + GetRebootAction returns the action a machine agent should take. + If a reboot flag is set on the machine, then that machine is + expected to reboot (params.ShouldReboot). + a reboot flag set on the machine parent or grandparent, will + cause the machine to shutdown (params.ShouldShutdown). + If no reboot flag is set, the machine should do nothing (params.ShouldDoNothing). + + entities : typing.Sequence[~Entity] + Returns -> RebootActionResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Reboot', + request='GetRebootAction', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RebootActionResults) async def GetRebootAction(self, entities=None): ''' @@ -4222,6 +6004,29 @@ async def GetRebootAction(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_RequestReboot(self, entities=None): + ''' + RequestReboot sets the reboot flag on the provided machines + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Reboot', + request='RequestReboot', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def RequestReboot(self, entities=None): ''' @@ -4245,6 +6050,28 @@ async def RequestReboot(self, entities=None): + @ReturnMapping(NotifyWatchResult) + def sync_WatchForRebootEvent(self): + ''' + WatchForRebootEvent starts a watcher to track if there is a new + reboot request on the machines ID or any of its parents (in case we are a container). + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Reboot', + request='WatchForRebootEvent', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchForRebootEvent(self): ''' @@ -4729,6 +6556,30 @@ class RemoteRelationsFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_ConsumeRemoteRelationChanges(self, changes=None): + ''' + ConsumeRemoteRelationChanges consumes changes to settings originating + from the remote/offering side of relations. + + changes : typing.Sequence[~RemoteRelationChangeEvent] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ConsumeRemoteRelationChanges', + version=2, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ConsumeRemoteRelationChanges(self, changes=None): ''' @@ -4753,6 +6604,30 @@ async def ConsumeRemoteRelationChanges(self, changes=None): + @ReturnMapping(ErrorResults) + def sync_ConsumeRemoteSecretChanges(self, changes=None): + ''' + ConsumeRemoteSecretChanges updates the local model with secret revision changes + originating from the remote/offering model. + + changes : typing.Sequence[~SecretRevisionChange] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ConsumeRemoteSecretChanges', + version=2, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ConsumeRemoteSecretChanges(self, changes=None): ''' @@ -4777,6 +6652,29 @@ async def ConsumeRemoteSecretChanges(self, changes=None): + @ReturnMapping(ControllerAPIInfoResults) + def sync_ControllerAPIInfoForModels(self, entities=None): + ''' + ControllerAPIInfoForModels returns the controller api connection details for the specified models. + + entities : typing.Sequence[~Entity] + Returns -> ControllerAPIInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ControllerAPIInfoForModels', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ControllerAPIInfoResults) async def ControllerAPIInfoForModels(self, entities=None): ''' @@ -4791,7 +6689,95 @@ async def ControllerAPIInfoForModels(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='RemoteRelations', - request='ControllerAPIInfoForModels', + request='ControllerAPIInfoForModels', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + def sync_ControllerConfig(self): + ''' + ControllerConfig returns the controller's configuration. + + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ControllerConfig', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + ControllerConfig returns the controller's configuration. + + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ControllerConfig', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(TokenResults) + def sync_ExportEntities(self, entities=None): + ''' + ExportEntities allocates unique, remote entity IDs for the given entities in the local model. + + entities : typing.Sequence[~Entity] + Returns -> TokenResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ExportEntities', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(TokenResults) + async def ExportEntities(self, entities=None): + ''' + ExportEntities allocates unique, remote entity IDs for the given entities in the local model. + + entities : typing.Sequence[~Entity] + Returns -> TokenResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ExportEntities', version=2, params=_params) _params['entities'] = entities @@ -4800,57 +6786,59 @@ async def ControllerAPIInfoForModels(self, entities=None): - @ReturnMapping(ControllerConfigResult) - async def ControllerConfig(self): + @ReturnMapping(StringResults) + def sync_GetTokens(self, args=None): ''' - ControllerConfig returns the controller's configuration. - + GetTokens returns the token associated with the entities with the given tags for the given models. - Returns -> ControllerConfigResult + args : typing.Sequence[~GetTokenArg] + Returns -> StringResults ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='RemoteRelations', - request='ControllerConfig', + request='GetTokens', version=2, params=_params) - - reply = await self.rpc(msg) + _params['Args'] = args + reply = self.sync_rpc(msg) return reply - @ReturnMapping(TokenResults) - async def ExportEntities(self, entities=None): + @ReturnMapping(StringResults) + async def GetTokens(self, args=None): ''' - ExportEntities allocates unique, remote entity IDs for the given entities in the local model. + GetTokens returns the token associated with the entities with the given tags for the given models. - entities : typing.Sequence[~Entity] - Returns -> TokenResults + args : typing.Sequence[~GetTokenArg] + Returns -> StringResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='RemoteRelations', - request='ExportEntities', + request='GetTokens', version=2, params=_params) - _params['entities'] = entities + _params['Args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(StringResults) - async def GetTokens(self, args=None): + @ReturnMapping(ErrorResults) + def sync_ImportRemoteEntities(self, args=None): ''' - GetTokens returns the token associated with the entities with the given tags for the given models. + ImportRemoteEntities adds entities to the remote entities collection with the specified opaque tokens. - args : typing.Sequence[~GetTokenArg] - Returns -> StringResults + args : typing.Sequence[~RemoteEntityTokenArg] + Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) @@ -4858,11 +6846,11 @@ async def GetTokens(self, args=None): # map input types to rpc msg _params = dict() msg = dict(type='RemoteRelations', - request='GetTokens', + request='ImportRemoteEntities', version=2, params=_params) _params['Args'] = args - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @@ -4890,6 +6878,30 @@ async def ImportRemoteEntities(self, args=None): + @ReturnMapping(RemoteRelationResults) + def sync_Relations(self, entities=None): + ''' + Relations returns information about the cross-model relations with the specified keys + in the local model. + + entities : typing.Sequence[~Entity] + Returns -> RemoteRelationResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='Relations', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RemoteRelationResults) async def Relations(self, entities=None): ''' @@ -4914,6 +6926,30 @@ async def Relations(self, entities=None): + @ReturnMapping(RemoteApplicationResults) + def sync_RemoteApplications(self, entities=None): + ''' + RemoteApplications returns the current state of the remote applications with + the specified names in the local model. + + entities : typing.Sequence[~Entity] + Returns -> RemoteApplicationResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='RemoteApplications', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RemoteApplicationResults) async def RemoteApplications(self, entities=None): ''' @@ -4938,6 +6974,29 @@ async def RemoteApplications(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SaveMacaroons(self, args=None): + ''' + SaveMacaroons saves the macaroons for the given entities. + + args : typing.Sequence[~EntityMacaroonArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='SaveMacaroons', + version=2, + params=_params) + _params['Args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SaveMacaroons(self, args=None): ''' @@ -4961,6 +7020,29 @@ async def SaveMacaroons(self, args=None): + @ReturnMapping(ErrorResults) + def sync_SetRemoteApplicationsStatus(self, entities=None): + ''' + SetRemoteApplicationsStatus sets the status for the specified remote applications. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='SetRemoteApplicationsStatus', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetRemoteApplicationsStatus(self, entities=None): ''' @@ -4984,6 +7066,31 @@ async def SetRemoteApplicationsStatus(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_UpdateControllersForModels(self, changes=None): + ''' + UpdateControllersForModels changes the external controller records for the + associated model entities. This is used when the remote relations worker gets + redirected following migration of an offering model. + + changes : typing.Sequence[~UpdateControllerForModel] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='UpdateControllersForModels', + version=2, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UpdateControllersForModels(self, changes=None): ''' @@ -5009,6 +7116,31 @@ async def UpdateControllersForModels(self, changes=None): + @ReturnMapping(RemoteRelationWatchResults) + def sync_WatchLocalRelationChanges(self, entities=None): + ''' + WatchLocalRelationChanges starts a RemoteRelationWatcher for each + specified relation, returning the watcher IDs and initial values, + or an error if the remote relations couldn't be watched. + + entities : typing.Sequence[~Entity] + Returns -> RemoteRelationWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='WatchLocalRelationChanges', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RemoteRelationWatchResults) async def WatchLocalRelationChanges(self, entities=None): ''' @@ -5034,6 +7166,32 @@ async def WatchLocalRelationChanges(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchRemoteApplicationRelations(self, entities=None): + ''' + WatchRemoteApplicationRelations starts a StringsWatcher for watching the relations of + each specified application in the local model, and returns the watcher IDs + and initial values, or an error if the services' relations could not be + watched. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='WatchRemoteApplicationRelations', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchRemoteApplicationRelations(self, entities=None): ''' @@ -5060,6 +7218,30 @@ async def WatchRemoteApplicationRelations(self, entities=None): + @ReturnMapping(StringsWatchResult) + def sync_WatchRemoteApplications(self): + ''' + WatchRemoteApplications starts a strings watcher that notifies of the addition, + removal, and lifecycle changes of remote applications in the model; and + returns the watcher ID and initial IDs of remote applications, or an error if + watching failed. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='WatchRemoteApplications', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchRemoteApplications(self): ''' @@ -5084,6 +7266,30 @@ async def WatchRemoteApplications(self): + @ReturnMapping(StringsWatchResult) + def sync_WatchRemoteRelations(self): + ''' + WatchRemoteRelations starts a strings watcher that notifies of the addition, + removal, and lifecycle changes of remote relations in the model; and + returns the watcher ID and initial IDs of remote relations, or an error if + watching failed. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='WatchRemoteRelations', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchRemoteRelations(self): ''' @@ -5324,6 +7530,29 @@ class SecretsFacade(Type): 'type': 'object'} + @ReturnMapping(StringResults) + def sync_CreateSecrets(self, args=None): + ''' + CreateSecrets creates new secrets. + + args : typing.Sequence[~CreateSecretArg] + Returns -> StringResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Secrets', + request='CreateSecrets', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def CreateSecrets(self, args=None): ''' @@ -5347,6 +7576,39 @@ async def CreateSecrets(self, args=None): + @ReturnMapping(ErrorResults) + def sync_GrantSecret(self, applications=None, label=None, uri=None): + ''' + GrantSecret grants access to a user secret. + + applications : typing.Sequence[str] + label : str + uri : str + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + if label is not None and not isinstance(label, (bytes, str)): + raise Exception("Expected label to be a str, received: {}".format(type(label))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Secrets', + request='GrantSecret', + version=2, + params=_params) + _params['applications'] = applications + _params['label'] = label + _params['uri'] = uri + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def GrantSecret(self, applications=None, label=None, uri=None): ''' @@ -5380,6 +7642,34 @@ async def GrantSecret(self, applications=None, label=None, uri=None): + @ReturnMapping(ListSecretResults) + def sync_ListSecrets(self, filter_=None, show_secrets=None): + ''' + ListSecrets lists available secrets. + + filter_ : SecretsFilter + show_secrets : bool + Returns -> ListSecretResults + ''' + if filter_ is not None and not isinstance(filter_, (dict, SecretsFilter)): + raise Exception("Expected filter_ to be a SecretsFilter, received: {}".format(type(filter_))) + + if show_secrets is not None and not isinstance(show_secrets, bool): + raise Exception("Expected show_secrets to be a bool, received: {}".format(type(show_secrets))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Secrets', + request='ListSecrets', + version=2, + params=_params) + _params['filter'] = filter_ + _params['show-secrets'] = show_secrets + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ListSecretResults) async def ListSecrets(self, filter_=None, show_secrets=None): ''' @@ -5408,6 +7698,29 @@ async def ListSecrets(self, filter_=None, show_secrets=None): + @ReturnMapping(ErrorResults) + def sync_RemoveSecrets(self, args=None): + ''' + RemoveSecrets remove user secret. + + args : typing.Sequence[~DeleteSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Secrets', + request='RemoveSecrets', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def RemoveSecrets(self, args=None): ''' @@ -5431,6 +7744,39 @@ async def RemoveSecrets(self, args=None): + @ReturnMapping(ErrorResults) + def sync_RevokeSecret(self, applications=None, label=None, uri=None): + ''' + RevokeSecret revokes access to a user secret. + + applications : typing.Sequence[str] + label : str + uri : str + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + if label is not None and not isinstance(label, (bytes, str)): + raise Exception("Expected label to be a str, received: {}".format(type(label))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Secrets', + request='RevokeSecret', + version=2, + params=_params) + _params['applications'] = applications + _params['label'] = label + _params['uri'] = uri + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def RevokeSecret(self, applications=None, label=None, uri=None): ''' @@ -5464,6 +7810,29 @@ async def RevokeSecret(self, applications=None, label=None, uri=None): + @ReturnMapping(ErrorResults) + def sync_UpdateSecrets(self, args=None): + ''' + UpdateSecrets creates new secrets. + + args : typing.Sequence[~UpdateUserSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Secrets', + request='UpdateSecrets', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UpdateSecrets(self, args=None): ''' @@ -5945,6 +8314,29 @@ class SecretsManagerFacade(Type): 'type': 'object'} + @ReturnMapping(StringResults) + def sync_CreateSecretURIs(self, count=None): + ''' + CreateSecretURIs creates new secret URIs. + + count : int + Returns -> StringResults + ''' + if count is not None and not isinstance(count, int): + raise Exception("Expected count to be a int, received: {}".format(type(count))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='CreateSecretURIs', + version=2, + params=_params) + _params['count'] = count + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def CreateSecretURIs(self, count=None): ''' @@ -5968,6 +8360,29 @@ async def CreateSecretURIs(self, count=None): + @ReturnMapping(StringResults) + def sync_CreateSecrets(self, args=None): + ''' + CreateSecrets creates new secrets. + + args : typing.Sequence[~CreateSecretArg] + Returns -> StringResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='CreateSecrets', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def CreateSecrets(self, args=None): ''' @@ -5991,6 +8406,35 @@ async def CreateSecrets(self, args=None): + @ReturnMapping(SecretConsumerInfoResults) + def sync_GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): + ''' + GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets. + This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook. + + consumer_tag : str + uris : typing.Sequence[str] + Returns -> SecretConsumerInfoResults + ''' + if consumer_tag is not None and not isinstance(consumer_tag, (bytes, str)): + raise Exception("Expected consumer_tag to be a str, received: {}".format(type(consumer_tag))) + + if uris is not None and not isinstance(uris, (bytes, str, list)): + raise Exception("Expected uris to be a Sequence, received: {}".format(type(uris))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetConsumerSecretsRevisionInfo', + version=2, + params=_params) + _params['consumer-tag'] = consumer_tag + _params['uris'] = uris + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretConsumerInfoResults) async def GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): ''' @@ -6020,6 +8464,34 @@ async def GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): + @ReturnMapping(SecretBackendConfigResults) + def sync_GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): + ''' + GetSecretBackendConfigs gets the config needed to create a client to secret backends. + + backend_ids : typing.Sequence[str] + for_drain : bool + Returns -> SecretBackendConfigResults + ''' + if backend_ids is not None and not isinstance(backend_ids, (bytes, str, list)): + raise Exception("Expected backend_ids to be a Sequence, received: {}".format(type(backend_ids))) + + if for_drain is not None and not isinstance(for_drain, bool): + raise Exception("Expected for_drain to be a bool, received: {}".format(type(for_drain))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretBackendConfigs', + version=2, + params=_params) + _params['backend-ids'] = backend_ids + _params['for-drain'] = for_drain + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretBackendConfigResults) async def GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): ''' @@ -6048,6 +8520,29 @@ async def GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): + @ReturnMapping(SecretContentResults) + def sync_GetSecretContentInfo(self, args=None): + ''' + GetSecretContentInfo returns the secret values for the specified secrets. + + args : typing.Sequence[~GetSecretContentArg] + Returns -> SecretContentResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretContentInfo', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretContentResults) async def GetSecretContentInfo(self, args=None): ''' @@ -6071,6 +8566,27 @@ async def GetSecretContentInfo(self, args=None): + @ReturnMapping(ListSecretResults) + def sync_GetSecretMetadata(self): + ''' + GetSecretMetadata returns metadata for the caller's secrets. + + + Returns -> ListSecretResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretMetadata', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ListSecretResults) async def GetSecretMetadata(self): ''' @@ -6092,6 +8608,39 @@ async def GetSecretMetadata(self): + @ReturnMapping(SecretContentResults) + def sync_GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): + ''' + GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. + + pending_delete : bool + revisions : typing.Sequence[int] + uri : str + Returns -> SecretContentResults + ''' + if pending_delete is not None and not isinstance(pending_delete, bool): + raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) + + if revisions is not None and not isinstance(revisions, (bytes, str, list)): + raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) + + if uri is not None and not isinstance(uri, (bytes, str)): + raise Exception("Expected uri to be a str, received: {}".format(type(uri))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='GetSecretRevisionContentInfo', + version=2, + params=_params) + _params['pending-delete'] = pending_delete + _params['revisions'] = revisions + _params['uri'] = uri + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretContentResults) async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): ''' @@ -6125,6 +8674,29 @@ async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None + @ReturnMapping(ErrorResults) + def sync_RemoveSecrets(self, args=None): + ''' + RemoveSecrets removes the specified secrets. + + args : typing.Sequence[~DeleteSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='RemoveSecrets', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def RemoveSecrets(self, args=None): ''' @@ -6148,6 +8720,29 @@ async def RemoveSecrets(self, args=None): + @ReturnMapping(ErrorResults) + def sync_SecretsGrant(self, args=None): + ''' + SecretsGrant grants access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='SecretsGrant', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SecretsGrant(self, args=None): ''' @@ -6171,6 +8766,29 @@ async def SecretsGrant(self, args=None): + @ReturnMapping(ErrorResults) + def sync_SecretsRevoke(self, args=None): + ''' + SecretsRevoke revokes access to a secret for the specified subjects. + + args : typing.Sequence[~GrantRevokeSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='SecretsRevoke', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SecretsRevoke(self, args=None): ''' @@ -6194,6 +8812,29 @@ async def SecretsRevoke(self, args=None): + @ReturnMapping(ErrorResults) + def sync_SecretsRotated(self, args=None): + ''' + SecretsRotated records when secrets were last rotated. + + args : typing.Sequence[~SecretRotatedArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='SecretsRotated', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SecretsRotated(self, args=None): ''' @@ -6217,36 +8858,163 @@ async def SecretsRotated(self, args=None): + @ReturnMapping(ErrorResults) + def sync_UpdateSecrets(self, args=None): + ''' + UpdateSecrets updates the specified secrets. + + args : typing.Sequence[~UpdateSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='UpdateSecrets', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UpdateSecrets(self, args=None): ''' UpdateSecrets updates the specified secrets. - args : typing.Sequence[~UpdateSecretArg] - Returns -> ErrorResults + args : typing.Sequence[~UpdateSecretArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='UpdateSecrets', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + def sync_WatchConsumedSecretsChanges(self, entities=None): + ''' + WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='WatchConsumedSecretsChanges', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchConsumedSecretsChanges(self, entities=None): + ''' + WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='WatchConsumedSecretsChanges', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + def sync_WatchObsolete(self, entities=None): + ''' + WatchObsolete returns a watcher for notifying when: + - a secret owned by the entity is deleted + - a secret revision owed by the entity no longer + has any consumers + + Obsolete revisions results are "uri/revno" and deleted + secret results are "uri". + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResult + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsManager', + request='WatchObsolete', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchObsolete(self, entities=None): + ''' + WatchObsolete returns a watcher for notifying when: + - a secret owned by the entity is deleted + - a secret revision owed by the entity no longer + has any consumers + + Obsolete revisions results are "uri/revno" and deleted + secret results are "uri". + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResult ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='UpdateSecrets', + request='WatchObsolete', version=2, params=_params) - _params['args'] = args + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResults) - async def WatchConsumedSecretsChanges(self, entities=None): + @ReturnMapping(SecretTriggerWatchResult) + def sync_WatchSecretRevisionsExpiryChanges(self, entities=None): ''' - WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers. + WatchSecretRevisionsExpiryChanges sets up a watcher to notify of changes to secret revision expiry config. entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + Returns -> SecretTriggerWatchResult ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -6254,28 +9022,22 @@ async def WatchConsumedSecretsChanges(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='WatchConsumedSecretsChanges', + request='WatchSecretRevisionsExpiryChanges', version=2, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringsWatchResult) - async def WatchObsolete(self, entities=None): + @ReturnMapping(SecretTriggerWatchResult) + async def WatchSecretRevisionsExpiryChanges(self, entities=None): ''' - WatchObsolete returns a watcher for notifying when: - - a secret owned by the entity is deleted - - a secret revision owed by the entity no longer - has any consumers - - Obsolete revisions results are "uri/revno" and deleted - secret results are "uri". + WatchSecretRevisionsExpiryChanges sets up a watcher to notify of changes to secret revision expiry config. entities : typing.Sequence[~Entity] - Returns -> StringsWatchResult + Returns -> SecretTriggerWatchResult ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -6283,7 +9045,7 @@ async def WatchObsolete(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='WatchObsolete', + request='WatchSecretRevisionsExpiryChanges', version=2, params=_params) _params['entities'] = entities @@ -6293,9 +9055,9 @@ async def WatchObsolete(self, entities=None): @ReturnMapping(SecretTriggerWatchResult) - async def WatchSecretRevisionsExpiryChanges(self, entities=None): + def sync_WatchSecretsRotationChanges(self, entities=None): ''' - WatchSecretRevisionsExpiryChanges sets up a watcher to notify of changes to secret revision expiry config. + WatchSecretsRotationChanges sets up a watcher to notify of changes to secret rotation config. entities : typing.Sequence[~Entity] Returns -> SecretTriggerWatchResult @@ -6306,11 +9068,11 @@ async def WatchSecretRevisionsExpiryChanges(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', - request='WatchSecretRevisionsExpiryChanges', + request='WatchSecretsRotationChanges', version=2, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @@ -6404,6 +9166,31 @@ class SingularFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_Claim(self, claims=None): + ''' + Claim makes the supplied singular-controller lease requests. (In practice, + any requests not for the connection's model or controller, or not on behalf + of the connected ModelManager machine, will be rejected.) + + claims : typing.Sequence[~SingularClaim] + Returns -> ErrorResults + ''' + if claims is not None and not isinstance(claims, (bytes, str, list)): + raise Exception("Expected claims to be a Sequence, received: {}".format(type(claims))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Singular', + request='Claim', + version=2, + params=_params) + _params['claims'] = claims + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Claim(self, claims=None): ''' @@ -6429,6 +9216,31 @@ async def Claim(self, claims=None): + @ReturnMapping(ErrorResults) + def sync_Wait(self, entities=None): + ''' + Wait waits for the singular-controller lease to expire for all supplied + entities. (In practice, any requests that do not refer to the connection's + model or controller will be rejected.) + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Singular', + request='Wait', + version=2, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Wait(self, entities=None): ''' @@ -6519,6 +9331,27 @@ class StatusHistoryFacade(Type): 'type': 'object'} + @ReturnMapping(ModelConfigResult) + def sync_ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='StatusHistory', + request='ModelConfig', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelConfigResult) async def ModelConfig(self): ''' @@ -6540,6 +9373,36 @@ async def ModelConfig(self): + @ReturnMapping(None) + def sync_Prune(self, max_history_mb=None, max_history_time=None): + ''' + Prune endpoint removes status history entries until + only the ones newer than now - p.MaxHistoryTime remain and + the history is smaller than p.MaxHistoryMB. + + max_history_mb : int + max_history_time : int + Returns -> None + ''' + if max_history_mb is not None and not isinstance(max_history_mb, int): + raise Exception("Expected max_history_mb to be a int, received: {}".format(type(max_history_mb))) + + if max_history_time is not None and not isinstance(max_history_time, int): + raise Exception("Expected max_history_time to be a int, received: {}".format(type(max_history_time))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StatusHistory', + request='Prune', + version=2, + params=_params) + _params['max-history-mb'] = max_history_mb + _params['max-history-time'] = max_history_time + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Prune(self, max_history_mb=None, max_history_time=None): ''' @@ -6570,6 +9433,31 @@ async def Prune(self, max_history_mb=None, max_history_time=None): + @ReturnMapping(NotifyWatchResult) + def sync_WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='StatusHistory', + request='WatchForModelConfigChanges', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchForModelConfigChanges(self): ''' @@ -6672,6 +9560,31 @@ class UpgradeStepsFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResult) + def sync_ResetKVMMachineModificationStatusIdle(self, tag=None): + ''' + ResetKVMMachineModificationStatusIdle sets the modification status + of a kvm machine to idle if it is in an error state before upgrade. + Related to lp:1829393. + + tag : str + Returns -> ErrorResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSteps', + request='ResetKVMMachineModificationStatusIdle', + version=2, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResult) async def ResetKVMMachineModificationStatusIdle(self, tag=None): ''' @@ -6697,6 +9610,30 @@ async def ResetKVMMachineModificationStatusIdle(self, tag=None): + @ReturnMapping(ErrorResults) + def sync_WriteAgentState(self, args=None): + ''' + WriteAgentState writes the agent state for the set of units provided. This + call presently deals with the state for the unit agent. + + args : typing.Sequence[~SetUnitStateArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSteps', + request='WriteAgentState', + version=2, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def WriteAgentState(self, args=None): ''' @@ -6759,6 +9696,29 @@ class VolumeAttachmentsWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(MachineStorageIdsWatchResult) + def sync_Next(self): + ''' + Next returns when a change has occurred to an entity of the + collection being watched since the most recent call to Next + or the Watch call that created the srvMachineStorageIdsWatcher. + + + Returns -> MachineStorageIdsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='VolumeAttachmentsWatcher', + request='Next', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MachineStorageIdsWatchResult) async def Next(self): ''' @@ -6782,6 +9742,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='VolumeAttachmentsWatcher', + request='Stop', + version=2, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -6815,4 +9796,15 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + diff --git a/juju/client/_client20.py b/juju/client/_client20.py index 3118b373..66c83ada 100644 --- a/juju/client/_client20.py +++ b/juju/client/_client20.py @@ -929,6 +929,34 @@ class ApplicationFacade(Type): 'type': 'object'} + @ReturnMapping(AddRelationResults) + def sync_AddRelation(self, endpoints=None, via_cidrs=None): + ''' + AddRelation adds a relation between the specified endpoints and returns the relation info. + + endpoints : typing.Sequence[str] + via_cidrs : typing.Sequence[str] + Returns -> AddRelationResults + ''' + if endpoints is not None and not isinstance(endpoints, (bytes, str, list)): + raise Exception("Expected endpoints to be a Sequence, received: {}".format(type(endpoints))) + + if via_cidrs is not None and not isinstance(via_cidrs, (bytes, str, list)): + raise Exception("Expected via_cidrs to be a Sequence, received: {}".format(type(via_cidrs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddRelation', + version=20, + params=_params) + _params['endpoints'] = endpoints + _params['via-cidrs'] = via_cidrs + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AddRelationResults) async def AddRelation(self, endpoints=None, via_cidrs=None): ''' @@ -957,6 +985,49 @@ async def AddRelation(self, endpoints=None, via_cidrs=None): + @ReturnMapping(AddApplicationUnitsResults) + def sync_AddUnits(self, application=None, attach_storage=None, num_units=None, placement=None, policy=None): + ''' + AddUnits adds a given number of units to an application. + + application : str + attach_storage : typing.Sequence[str] + num_units : int + placement : typing.Sequence[~Placement] + policy : str + Returns -> AddApplicationUnitsResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if attach_storage is not None and not isinstance(attach_storage, (bytes, str, list)): + raise Exception("Expected attach_storage to be a Sequence, received: {}".format(type(attach_storage))) + + if num_units is not None and not isinstance(num_units, int): + raise Exception("Expected num_units to be a int, received: {}".format(type(num_units))) + + if placement is not None and not isinstance(placement, (bytes, str, list)): + raise Exception("Expected placement to be a Sequence, received: {}".format(type(placement))) + + if policy is not None and not isinstance(policy, (bytes, str)): + raise Exception("Expected policy to be a str, received: {}".format(type(policy))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddUnits', + version=20, + params=_params) + _params['application'] = application + _params['attach-storage'] = attach_storage + _params['num-units'] = num_units + _params['placement'] = placement + _params['policy'] = policy + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AddApplicationUnitsResults) async def AddUnits(self, application=None, attach_storage=None, num_units=None, placement=None, policy=None): ''' @@ -1000,6 +1071,29 @@ async def AddUnits(self, application=None, attach_storage=None, num_units=None, + @ReturnMapping(ApplicationInfoResults) + def sync_ApplicationsInfo(self, entities=None): + ''' + ApplicationsInfo returns applications information. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ApplicationsInfo', + version=20, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationInfoResults) async def ApplicationsInfo(self, entities=None): ''' @@ -1023,6 +1117,30 @@ async def ApplicationsInfo(self, entities=None): + @ReturnMapping(ApplicationGetConfigResults) + def sync_CharmConfig(self, args=None): + ''' + CharmConfig returns charm config for the input list of applications and + model generations. + + args : typing.Sequence[~ApplicationGet] + Returns -> ApplicationGetConfigResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='CharmConfig', + version=20, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetConfigResults) async def CharmConfig(self, args=None): ''' @@ -1047,6 +1165,29 @@ async def CharmConfig(self, args=None): + @ReturnMapping(ApplicationCharmRelationsResults) + def sync_CharmRelations(self, application=None): + ''' + CharmRelations implements the server side of Application.CharmRelations. + + application : str + Returns -> ApplicationCharmRelationsResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='CharmRelations', + version=20, + params=_params) + _params['application'] = application + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationCharmRelationsResults) async def CharmRelations(self, application=None): ''' @@ -1070,6 +1211,30 @@ async def CharmRelations(self, application=None): + @ReturnMapping(ErrorResults) + def sync_Consume(self, args=None): + ''' + Consume adds remote applications to the model without creating any + relations. + + args : typing.Sequence[~ConsumeApplicationArgV5] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Consume', + version=20, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Consume(self, args=None): ''' @@ -1094,6 +1259,30 @@ async def Consume(self, args=None): + @ReturnMapping(ErrorResults) + def sync_Deploy(self, applications=None): + ''' + Deploy fetches the charms from the charm store and deploys them + using the specified placement directives. + + applications : typing.Sequence[~ApplicationDeploy] + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Deploy', + version=20, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Deploy(self, applications=None): ''' @@ -1118,6 +1307,33 @@ async def Deploy(self, applications=None): + @ReturnMapping(DeployFromRepositoryResults) + def sync_DeployFromRepository(self, args=None): + ''' + DeployFromRepository is a one-stop deployment method for repository + charms. Only a charm name is required to deploy. If argument validation + fails, a list of all errors found in validation will be returned. If a + local resource is provided, details required for uploading the validated + resource will be returned. + + args : typing.Sequence[~DeployFromRepositoryArg] + Returns -> DeployFromRepositoryResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DeployFromRepository', + version=20, + params=_params) + _params['Args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(DeployFromRepositoryResults) async def DeployFromRepository(self, args=None): ''' @@ -1145,6 +1361,29 @@ async def DeployFromRepository(self, args=None): + @ReturnMapping(DestroyApplicationResults) + def sync_DestroyApplication(self, applications=None): + ''' + DestroyApplication removes a given set of applications. + + applications : typing.Sequence[~DestroyApplicationParams] + Returns -> DestroyApplicationResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyApplication', + version=20, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(DestroyApplicationResults) async def DestroyApplication(self, applications=None): ''' @@ -1168,6 +1407,29 @@ async def DestroyApplication(self, applications=None): + @ReturnMapping(ErrorResults) + def sync_DestroyConsumedApplications(self, applications=None): + ''' + DestroyConsumedApplications removes a given set of consumed (remote) applications. + + applications : typing.Sequence[~DestroyConsumedApplicationParams] + Returns -> ErrorResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyConsumedApplications', + version=20, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def DestroyConsumedApplications(self, applications=None): ''' @@ -1192,7 +1454,7 @@ async def DestroyConsumedApplications(self, applications=None): @ReturnMapping(None) - async def DestroyRelation(self, endpoints=None, force=None, max_wait=None, relation_id=None): + def sync_DestroyRelation(self, endpoints=None, force=None, max_wait=None, relation_id=None): ''' DestroyRelation removes the relation between the specified endpoints or an id. @@ -1225,21 +1487,83 @@ async def DestroyRelation(self, endpoints=None, force=None, max_wait=None, relat _params['force'] = force _params['max-wait'] = max_wait _params['relation-id'] = relation_id - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(DestroyUnitResults) - async def DestroyUnit(self, units=None): + @ReturnMapping(None) + async def DestroyRelation(self, endpoints=None, force=None, max_wait=None, relation_id=None): ''' - DestroyUnit removes a given set of application units. + DestroyRelation removes the relation between the + specified endpoints or an id. - units : typing.Sequence[~DestroyUnitParams] - Returns -> DestroyUnitResults - ''' - if units is not None and not isinstance(units, (bytes, str, list)): - raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + endpoints : typing.Sequence[str] + force : bool + max_wait : int + relation_id : int + Returns -> None + ''' + if endpoints is not None and not isinstance(endpoints, (bytes, str, list)): + raise Exception("Expected endpoints to be a Sequence, received: {}".format(type(endpoints))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if max_wait is not None and not isinstance(max_wait, int): + raise Exception("Expected max_wait to be a int, received: {}".format(type(max_wait))) + + if relation_id is not None and not isinstance(relation_id, int): + raise Exception("Expected relation_id to be a int, received: {}".format(type(relation_id))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyRelation', + version=20, + params=_params) + _params['endpoints'] = endpoints + _params['force'] = force + _params['max-wait'] = max_wait + _params['relation-id'] = relation_id + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyUnitResults) + def sync_DestroyUnit(self, units=None): + ''' + DestroyUnit removes a given set of application units. + + units : typing.Sequence[~DestroyUnitParams] + Returns -> DestroyUnitResults + ''' + if units is not None and not isinstance(units, (bytes, str, list)): + raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnit', + version=20, + params=_params) + _params['units'] = units + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(DestroyUnitResults) + async def DestroyUnit(self, units=None): + ''' + DestroyUnit removes a given set of application units. + + units : typing.Sequence[~DestroyUnitParams] + Returns -> DestroyUnitResults + ''' + if units is not None and not isinstance(units, (bytes, str, list)): + raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) # map input types to rpc msg _params = dict() @@ -1253,6 +1577,35 @@ async def DestroyUnit(self, units=None): + @ReturnMapping(None) + def sync_Expose(self, application=None, exposed_endpoints=None): + ''' + Expose changes the juju-managed firewall to expose any ports that + were also explicitly marked by units as open. + + application : str + exposed_endpoints : typing.Mapping[str, ~ExposedEndpoint] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if exposed_endpoints is not None and not isinstance(exposed_endpoints, dict): + raise Exception("Expected exposed_endpoints to be a Mapping, received: {}".format(type(exposed_endpoints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=20, + params=_params) + _params['application'] = application + _params['exposed-endpoints'] = exposed_endpoints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Expose(self, application=None, exposed_endpoints=None): ''' @@ -1282,6 +1635,34 @@ async def Expose(self, application=None, exposed_endpoints=None): + @ReturnMapping(ApplicationGetResults) + def sync_Get(self, application=None, branch=None): + ''' + Get returns the charm configuration for an application. + + application : str + branch : str + Returns -> ApplicationGetResults + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Get', + version=20, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetResults) async def Get(self, application=None, branch=None): ''' @@ -1310,6 +1691,35 @@ async def Get(self, application=None, branch=None): + @ReturnMapping(CharmURLOriginResult) + def sync_GetCharmURLOrigin(self, application=None, branch=None): + ''' + GetCharmURLOrigin returns the charm URL and charm origin the given + application is running at present. + + application : str + branch : str + Returns -> CharmURLOriginResult + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetCharmURLOrigin', + version=20, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CharmURLOriginResult) async def GetCharmURLOrigin(self, application=None, branch=None): ''' @@ -1339,6 +1749,29 @@ async def GetCharmURLOrigin(self, application=None, branch=None): + @ReturnMapping(ApplicationGetConfigResults) + def sync_GetConfig(self, entities=None): + ''' + GetConfig returns the charm config for each of the input applications. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConfigResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetConfig', + version=20, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetConfigResults) async def GetConfig(self, entities=None): ''' @@ -1362,6 +1795,29 @@ async def GetConfig(self, entities=None): + @ReturnMapping(ApplicationGetConstraintsResults) + def sync_GetConstraints(self, entities=None): + ''' + GetConstraints returns the constraints for a given application. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConstraintsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetConstraints', + version=20, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationGetConstraintsResults) async def GetConstraints(self, entities=None): ''' @@ -1385,6 +1841,29 @@ async def GetConstraints(self, entities=None): + @ReturnMapping(StringResult) + def sync_Leader(self, tag=None): + ''' + Leader returns the unit name of the leader for the given application. + + tag : str + Returns -> StringResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Leader', + version=20, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResult) async def Leader(self, tag=None): ''' @@ -1408,6 +1887,30 @@ async def Leader(self, tag=None): + @ReturnMapping(ErrorResults) + def sync_MergeBindings(self, args=None): + ''' + MergeBindings merges operator-defined bindings with the current bindings for + one or more applications. + + args : typing.Sequence[~ApplicationMergeBindings] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='MergeBindings', + version=20, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def MergeBindings(self, args=None): ''' @@ -1432,58 +1935,197 @@ async def MergeBindings(self, args=None): - @ReturnMapping(ErrorResults) - async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): - ''' - ResolveUnitErrors marks errors on the specified units as resolved. + @ReturnMapping(ErrorResults) + def sync_ResolveUnitErrors(self, all_=None, retry=None, tags=None): + ''' + ResolveUnitErrors marks errors on the specified units as resolved. + + all_ : bool + retry : bool + tags : Entities + Returns -> ErrorResults + ''' + if all_ is not None and not isinstance(all_, bool): + raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + + if retry is not None and not isinstance(retry, bool): + raise Exception("Expected retry to be a bool, received: {}".format(type(retry))) + + if tags is not None and not isinstance(tags, (dict, Entities)): + raise Exception("Expected tags to be a Entities, received: {}".format(type(tags))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ResolveUnitErrors', + version=20, + params=_params) + _params['all'] = all_ + _params['retry'] = retry + _params['tags'] = tags + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): + ''' + ResolveUnitErrors marks errors on the specified units as resolved. + + all_ : bool + retry : bool + tags : Entities + Returns -> ErrorResults + ''' + if all_ is not None and not isinstance(all_, bool): + raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + + if retry is not None and not isinstance(retry, bool): + raise Exception("Expected retry to be a bool, received: {}".format(type(retry))) + + if tags is not None and not isinstance(tags, (dict, Entities)): + raise Exception("Expected tags to be a Entities, received: {}".format(type(tags))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ResolveUnitErrors', + version=20, + params=_params) + _params['all'] = all_ + _params['retry'] = retry + _params['tags'] = tags + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ScaleApplicationResults) + def sync_ScaleApplications(self, applications=None): + ''' + ScaleApplications scales the specified application to the requested number of units. + + applications : typing.Sequence[~ScaleApplicationParams] + Returns -> ScaleApplicationResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ScaleApplications', + version=20, + params=_params) + _params['applications'] = applications + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ScaleApplicationResults) + async def ScaleApplications(self, applications=None): + ''' + ScaleApplications scales the specified application to the requested number of units. + + applications : typing.Sequence[~ScaleApplicationParams] + Returns -> ScaleApplicationResults + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='ScaleApplications', + version=20, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + def sync_SetCharm(self, application=None, channel=None, charm_origin=None, charm_url=None, config_settings=None, config_settings_yaml=None, endpoint_bindings=None, force=None, force_base=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None): + ''' + SetCharm sets the charm for a given for the application. + + application : str + channel : str + charm_origin : CharmOrigin + charm_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + endpoint_bindings : typing.Mapping[str, str] + force : bool + force_base : bool + force_units : bool + generation : str + resource_ids : typing.Mapping[str, str] + storage_constraints : typing.Mapping[str, ~StorageConstraints] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if channel is not None and not isinstance(channel, (bytes, str)): + raise Exception("Expected channel to be a str, received: {}".format(type(channel))) + + if charm_origin is not None and not isinstance(charm_origin, (dict, CharmOrigin)): + raise Exception("Expected charm_origin to be a CharmOrigin, received: {}".format(type(charm_origin))) + + if charm_url is not None and not isinstance(charm_url, (bytes, str)): + raise Exception("Expected charm_url to be a str, received: {}".format(type(charm_url))) + + if config_settings is not None and not isinstance(config_settings, dict): + raise Exception("Expected config_settings to be a Mapping, received: {}".format(type(config_settings))) - all_ : bool - retry : bool - tags : Entities - Returns -> ErrorResults - ''' - if all_ is not None and not isinstance(all_, bool): - raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + if config_settings_yaml is not None and not isinstance(config_settings_yaml, (bytes, str)): + raise Exception("Expected config_settings_yaml to be a str, received: {}".format(type(config_settings_yaml))) - if retry is not None and not isinstance(retry, bool): - raise Exception("Expected retry to be a bool, received: {}".format(type(retry))) + if endpoint_bindings is not None and not isinstance(endpoint_bindings, dict): + raise Exception("Expected endpoint_bindings to be a Mapping, received: {}".format(type(endpoint_bindings))) - if tags is not None and not isinstance(tags, (dict, Entities)): - raise Exception("Expected tags to be a Entities, received: {}".format(type(tags))) + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='ResolveUnitErrors', - version=20, - params=_params) - _params['all'] = all_ - _params['retry'] = retry - _params['tags'] = tags - reply = await self.rpc(msg) - return reply + if force_base is not None and not isinstance(force_base, bool): + raise Exception("Expected force_base to be a bool, received: {}".format(type(force_base))) + if force_units is not None and not isinstance(force_units, bool): + raise Exception("Expected force_units to be a bool, received: {}".format(type(force_units))) + if generation is not None and not isinstance(generation, (bytes, str)): + raise Exception("Expected generation to be a str, received: {}".format(type(generation))) - @ReturnMapping(ScaleApplicationResults) - async def ScaleApplications(self, applications=None): - ''' - ScaleApplications scales the specified application to the requested number of units. + if resource_ids is not None and not isinstance(resource_ids, dict): + raise Exception("Expected resource_ids to be a Mapping, received: {}".format(type(resource_ids))) - applications : typing.Sequence[~ScaleApplicationParams] - Returns -> ScaleApplicationResults - ''' - if applications is not None and not isinstance(applications, (bytes, str, list)): - raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + if storage_constraints is not None and not isinstance(storage_constraints, dict): + raise Exception("Expected storage_constraints to be a Mapping, received: {}".format(type(storage_constraints))) # map input types to rpc msg _params = dict() msg = dict(type='Application', - request='ScaleApplications', + request='SetCharm', version=20, params=_params) - _params['applications'] = applications - reply = await self.rpc(msg) + _params['application'] = application + _params['channel'] = channel + _params['charm-origin'] = charm_origin + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['endpoint-bindings'] = endpoint_bindings + _params['force'] = force + _params['force-base'] = force_base + _params['force-units'] = force_units + _params['generation'] = generation + _params['resource-ids'] = resource_ids + _params['storage-constraints'] = storage_constraints + reply = self.sync_rpc(msg) return reply @@ -1571,6 +2213,31 @@ async def SetCharm(self, application=None, channel=None, charm_origin=None, char + @ReturnMapping(ErrorResults) + def sync_SetConfigs(self, args=None): + ''' + SetConfigs implements the server side of Application.SetConfig. Both + application and charm config are set. It does not unset values in + Config map that are set to an empty string. Unset should be used for that. + + args : typing.Sequence[~ConfigSet] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetConfigs', + version=20, + params=_params) + _params['Args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetConfigs(self, args=None): ''' @@ -1596,6 +2263,34 @@ async def SetConfigs(self, args=None): + @ReturnMapping(None) + def sync_SetConstraints(self, application=None, constraints=None): + ''' + SetConstraints sets the constraints for a given application. + + application : str + constraints : Value + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetConstraints', + version=20, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetConstraints(self, application=None, constraints=None): ''' @@ -1624,6 +2319,31 @@ async def SetConstraints(self, application=None, constraints=None): + @ReturnMapping(ErrorResults) + def sync_SetMetricCredentials(self, creds=None): + ''' + SetMetricCredentials sets credentials on the application. + TODO (cderici) only used for metered charms in cmd MeteredDeployAPI, + kept for client compatibility, remove in juju 4.0 + + creds : typing.Sequence[~ApplicationMetricCredential] + Returns -> ErrorResults + ''' + if creds is not None and not isinstance(creds, (bytes, str, list)): + raise Exception("Expected creds to be a Sequence, received: {}".format(type(creds))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetMetricCredentials', + version=20, + params=_params) + _params['creds'] = creds + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetMetricCredentials(self, creds=None): ''' @@ -1649,6 +2369,29 @@ async def SetMetricCredentials(self, creds=None): + @ReturnMapping(ErrorResults) + def sync_SetRelationsSuspended(self, args=None): + ''' + SetRelationsSuspended sets the suspended status of the specified relations. + + args : typing.Sequence[~RelationSuspendedArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetRelationsSuspended', + version=20, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetRelationsSuspended(self, args=None): ''' @@ -1672,6 +2415,35 @@ async def SetRelationsSuspended(self, args=None): + @ReturnMapping(None) + def sync_Unexpose(self, application=None, exposed_endpoints=None): + ''' + Unexpose changes the juju-managed firewall to unexpose any ports that + were also explicitly marked by units as open. + + application : str + exposed_endpoints : typing.Sequence[str] + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if exposed_endpoints is not None and not isinstance(exposed_endpoints, (bytes, str, list)): + raise Exception("Expected exposed_endpoints to be a Sequence, received: {}".format(type(exposed_endpoints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=20, + params=_params) + _params['application'] = application + _params['exposed-endpoints'] = exposed_endpoints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Unexpose(self, application=None, exposed_endpoints=None): ''' @@ -1701,6 +2473,30 @@ async def Unexpose(self, application=None, exposed_endpoints=None): + @ReturnMapping(UnitInfoResults) + def sync_UnitsInfo(self, entities=None): + ''' + UnitsInfo returns unit information for the given entities (units or + applications). + + entities : typing.Sequence[~Entity] + Returns -> UnitInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UnitsInfo', + version=20, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UnitInfoResults) async def UnitsInfo(self, entities=None): ''' @@ -1725,6 +2521,29 @@ async def UnitsInfo(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_UnsetApplicationsConfig(self, args=None): + ''' + UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig. + + args : typing.Sequence[~ApplicationUnset] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UnsetApplicationsConfig', + version=20, + params=_params) + _params['Args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UnsetApplicationsConfig(self, args=None): ''' @@ -1748,6 +2567,30 @@ async def UnsetApplicationsConfig(self, args=None): + @ReturnMapping(ErrorResults) + def sync_UpdateApplicationBase(self, args=None): + ''' + UpdateApplicationBase updates the application base. + Base for subordinates is updated too. + + args : typing.Sequence[~UpdateChannelArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='UpdateApplicationBase', + version=20, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UpdateApplicationBase(self, args=None): ''' diff --git a/juju/client/_client3.py b/juju/client/_client3.py index f7879810..8e136b22 100644 --- a/juju/client/_client3.py +++ b/juju/client/_client3.py @@ -117,6 +117,70 @@ class AdminFacade(Type): 'type': 'object'} + @ReturnMapping(LoginResult) + def sync_Login(self, auth_tag=None, bakery_version=None, cli_args=None, client_version=None, credentials=None, macaroons=None, nonce=None, token=None, user_data=None): + ''' + Login logs in with the provided credentials. All subsequent requests on the + connection will act as the authenticated user. + + auth_tag : str + bakery_version : int + cli_args : str + client_version : str + credentials : str + macaroons : typing.Sequence[~Macaroon] + nonce : str + token : str + user_data : str + Returns -> LoginResult + ''' + if auth_tag is not None and not isinstance(auth_tag, (bytes, str)): + raise Exception("Expected auth_tag to be a str, received: {}".format(type(auth_tag))) + + if bakery_version is not None and not isinstance(bakery_version, int): + raise Exception("Expected bakery_version to be a int, received: {}".format(type(bakery_version))) + + if cli_args is not None and not isinstance(cli_args, (bytes, str)): + raise Exception("Expected cli_args to be a str, received: {}".format(type(cli_args))) + + if client_version is not None and not isinstance(client_version, (bytes, str)): + raise Exception("Expected client_version to be a str, received: {}".format(type(client_version))) + + if credentials is not None and not isinstance(credentials, (bytes, str)): + raise Exception("Expected credentials to be a str, received: {}".format(type(credentials))) + + if macaroons is not None and not isinstance(macaroons, (bytes, str, list)): + raise Exception("Expected macaroons to be a Sequence, received: {}".format(type(macaroons))) + + if nonce is not None and not isinstance(nonce, (bytes, str)): + raise Exception("Expected nonce to be a str, received: {}".format(type(nonce))) + + if token is not None and not isinstance(token, (bytes, str)): + raise Exception("Expected token to be a str, received: {}".format(type(token))) + + if user_data is not None and not isinstance(user_data, (bytes, str)): + raise Exception("Expected user_data to be a str, received: {}".format(type(user_data))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Admin', + request='Login', + version=3, + params=_params) + _params['auth-tag'] = auth_tag + _params['bakery-version'] = bakery_version + _params['cli-args'] = cli_args + _params['client-version'] = client_version + _params['credentials'] = credentials + _params['macaroons'] = macaroons + _params['nonce'] = nonce + _params['token'] = token + _params['user-data'] = user_data + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LoginResult) async def Login(self, auth_tag=None, bakery_version=None, cli_args=None, client_version=None, credentials=None, macaroons=None, nonce=None, token=None, user_data=None): ''' @@ -181,6 +245,29 @@ async def Login(self, auth_tag=None, bakery_version=None, cli_args=None, client_ + @ReturnMapping(RedirectInfoResult) + def sync_RedirectInfo(self): + ''' + RedirectInfo returns redirected host information for the model. + In Juju it always returns an error because the Juju controller + does not multiplex controllers. + + + Returns -> RedirectInfoResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Admin', + request='RedirectInfo', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RedirectInfoResult) async def RedirectInfo(self): ''' @@ -432,7 +519,7 @@ class AgentFacade(Type): @ReturnMapping(ErrorResults) - async def ClearReboot(self, entities=None): + def sync_ClearReboot(self, entities=None): ''' ClearReboot will clear the reboot flag on provided machines, if it exists. @@ -449,18 +536,18 @@ async def ClearReboot(self, entities=None): version=3, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(CloudSpecResults) - async def CloudSpec(self, entities=None): + @ReturnMapping(ErrorResults) + async def ClearReboot(self, entities=None): ''' - CloudSpec returns the model's cloud spec. + ClearReboot will clear the reboot flag on provided machines, if it exists. entities : typing.Sequence[~Entity] - Returns -> CloudSpecResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -468,7 +555,7 @@ async def CloudSpec(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Agent', - request='CloudSpec', + request='ClearReboot', version=3, params=_params) _params['entities'] = entities @@ -477,13 +564,13 @@ async def CloudSpec(self, entities=None): - @ReturnMapping(ControllerAPIInfoResults) - async def ControllerAPIInfoForModels(self, entities=None): + @ReturnMapping(CloudSpecResults) + def sync_CloudSpec(self, entities=None): ''' - ControllerAPIInfoForModels returns the controller api connection details for the specified models. + CloudSpec returns the model's cloud spec. entities : typing.Sequence[~Entity] - Returns -> ControllerAPIInfoResults + Returns -> CloudSpecResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -491,62 +578,68 @@ async def ControllerAPIInfoForModels(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Agent', - request='ControllerAPIInfoForModels', + request='CloudSpec', version=3, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ControllerConfigResult) - async def ControllerConfig(self): + @ReturnMapping(CloudSpecResults) + async def CloudSpec(self, entities=None): ''' - ControllerConfig returns the controller's configuration. - + CloudSpec returns the model's cloud spec. - Returns -> ControllerConfigResult + entities : typing.Sequence[~Entity] + Returns -> CloudSpecResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Agent', - request='ControllerConfig', + request='CloudSpec', version=3, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(CloudSpecResult) - async def GetCloudSpec(self): + @ReturnMapping(ControllerAPIInfoResults) + def sync_ControllerAPIInfoForModels(self, entities=None): ''' - GetCloudSpec constructs the CloudSpec for a validated and authorized model. - + ControllerAPIInfoForModels returns the controller api connection details for the specified models. - Returns -> CloudSpecResult + entities : typing.Sequence[~Entity] + Returns -> ControllerAPIInfoResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Agent', - request='GetCloudSpec', + request='ControllerAPIInfoForModels', version=3, params=_params) - - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(AgentGetEntitiesResults) - async def GetEntities(self, entities=None): + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): ''' + ControllerAPIInfoForModels returns the controller api connection details for the specified models. + entities : typing.Sequence[~Entity] - Returns -> AgentGetEntitiesResults + Returns -> ControllerAPIInfoResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -554,7 +647,7 @@ async def GetEntities(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Agent', - request='GetEntities', + request='ControllerAPIInfoForModels', version=3, params=_params) _params['entities'] = entities @@ -563,38 +656,40 @@ async def GetEntities(self, entities=None): - @ReturnMapping(IsMasterResult) - async def IsMaster(self): + @ReturnMapping(ControllerConfigResult) + def sync_ControllerConfig(self): ''' + ControllerConfig returns the controller's configuration. - Returns -> IsMasterResult + + Returns -> ControllerConfigResult ''' # map input types to rpc msg _params = dict() msg = dict(type='Agent', - request='IsMaster', + request='ControllerConfig', version=3, params=_params) - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ModelConfigResult) - async def ModelConfig(self): + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): ''' - ModelConfig returns the current model's configuration. + ControllerConfig returns the controller's configuration. - Returns -> ModelConfigResult + Returns -> ControllerConfigResult ''' # map input types to rpc msg _params = dict() msg = dict(type='Agent', - request='ModelConfig', + request='ControllerConfig', version=3, params=_params) @@ -603,40 +698,40 @@ async def ModelConfig(self): - @ReturnMapping(ErrorResults) - async def SetPasswords(self, changes=None): + @ReturnMapping(CloudSpecResult) + def sync_GetCloudSpec(self): ''' - SetPasswords sets the given password for each supplied entity, if possible. + GetCloudSpec constructs the CloudSpec for a validated and authorized model. - changes : typing.Sequence[~EntityPassword] - Returns -> ErrorResults + + Returns -> CloudSpecResult ''' - if changes is not None and not isinstance(changes, (bytes, str, list)): - raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) # map input types to rpc msg _params = dict() msg = dict(type='Agent', - request='SetPasswords', + request='GetCloudSpec', version=3, params=_params) - _params['changes'] = changes - reply = await self.rpc(msg) + + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StateServingInfo) - async def StateServingInfo(self): + @ReturnMapping(CloudSpecResult) + async def GetCloudSpec(self): ''' + GetCloudSpec constructs the CloudSpec for a validated and authorized model. - Returns -> StateServingInfo + + Returns -> CloudSpecResult ''' # map input types to rpc msg _params = dict() msg = dict(type='Agent', - request='StateServingInfo', + request='GetCloudSpec', version=3, params=_params) @@ -645,13 +740,11 @@ async def StateServingInfo(self): - @ReturnMapping(NotifyWatchResults) - async def WatchCloudSpecsChanges(self, entities=None): + @ReturnMapping(AgentGetEntitiesResults) + def sync_GetEntities(self, entities=None): ''' - WatchCloudSpecsChanges returns a watcher for cloud spec changes. - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + Returns -> AgentGetEntitiesResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -659,22 +752,20 @@ async def WatchCloudSpecsChanges(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Agent', - request='WatchCloudSpecsChanges', + request='GetEntities', version=3, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchCredentials(self, entities=None): + @ReturnMapping(AgentGetEntitiesResults) + async def GetEntities(self, entities=None): ''' - WatchCredentials watches for changes to the specified credentials. - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + Returns -> AgentGetEntitiesResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -682,7 +773,7 @@ async def WatchCredentials(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Agent', - request='WatchCredentials', + request='GetEntities', version=3, params=_params) _params['entities'] = entities @@ -691,57 +782,360 @@ async def WatchCredentials(self, entities=None): - @ReturnMapping(NotifyWatchResult) - async def WatchForModelConfigChanges(self): + @ReturnMapping(IsMasterResult) + def sync_IsMaster(self): ''' - WatchForModelConfigChanges returns a NotifyWatcher that observes - changes to the model configuration. - Note that although the NotifyWatchResult contains an Error field, - it's not used because we are only returning a single watcher, - so we use the regular error return. - - Returns -> NotifyWatchResult + Returns -> IsMasterResult ''' # map input types to rpc msg _params = dict() msg = dict(type='Agent', - request='WatchForModelConfigChanges', + request='IsMaster', version=3, params=_params) - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply -class AllWatcherFacade(Type): - name = 'AllWatcher' - version = 3 - 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': {'description': 'Next will return the current state of ' - 'everything on the first call\n' - 'and subsequent calls will', - 'properties': {'Result': {'$ref': '#/definitions/AllWatcherNextResults'}}, - 'type': 'object'}, - 'Stop': {'description': 'Stop stops the watcher.', - 'type': 'object'}}, - 'type': 'object'} - + @ReturnMapping(IsMasterResult) + async def IsMaster(self): + ''' - @ReturnMapping(AllWatcherNextResults) - async def Next(self): + Returns -> IsMasterResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='IsMaster', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + def sync_ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='ModelConfig', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='ModelConfig', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetPasswords(self, changes=None): + ''' + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='SetPasswords', + version=3, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): + ''' + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='SetPasswords', + version=3, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StateServingInfo) + def sync_StateServingInfo(self): + ''' + + Returns -> StateServingInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='StateServingInfo', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StateServingInfo) + async def StateServingInfo(self): + ''' + + Returns -> StateServingInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='StateServingInfo', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + def sync_WatchCloudSpecsChanges(self, entities=None): + ''' + WatchCloudSpecsChanges returns a watcher for cloud spec changes. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='WatchCloudSpecsChanges', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchCloudSpecsChanges(self, entities=None): + ''' + WatchCloudSpecsChanges returns a watcher for cloud spec changes. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='WatchCloudSpecsChanges', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + def sync_WatchCredentials(self, entities=None): + ''' + WatchCredentials watches for changes to the specified credentials. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='WatchCredentials', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchCredentials(self, entities=None): + ''' + WatchCredentials watches for changes to the specified credentials. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='WatchCredentials', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + def sync_WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='WatchForModelConfigChanges', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='WatchForModelConfigChanges', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class AllWatcherFacade(Type): + name = 'AllWatcher' + version = 3 + 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': {'description': 'Next will return the current state of ' + 'everything on the first call\n' + 'and subsequent calls will', + 'properties': {'Result': {'$ref': '#/definitions/AllWatcherNextResults'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AllWatcherNextResults) + def sync_Next(self): + ''' + Next will return the current state of everything on the first call + and subsequent calls will + + + Returns -> AllWatcherNextResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='AllWatcher', + request='Next', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(AllWatcherNextResults) + async def Next(self): ''' Next will return the current state of everything on the first call and subsequent calls will @@ -762,6 +1156,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='AllWatcher', + request='Stop', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -795,6 +1210,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class BackupsFacade(Type): @@ -870,6 +1296,35 @@ class BackupsFacade(Type): 'type': 'object'} + @ReturnMapping(BackupsMetadataResult) + def sync_Create(self, no_download=None, notes=None): + ''' + Create is the API method that requests juju to create a new backup + of its state. + + no_download : bool + notes : str + Returns -> BackupsMetadataResult + ''' + if no_download is not None and not isinstance(no_download, bool): + raise Exception("Expected no_download to be a bool, received: {}".format(type(no_download))) + + if notes is not None and not isinstance(notes, (bytes, str)): + raise Exception("Expected notes to be a str, received: {}".format(type(notes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Backups', + request='Create', + version=3, + params=_params) + _params['no-download'] = no_download + _params['notes'] = notes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(BackupsMetadataResult) async def Create(self, no_download=None, notes=None): ''' @@ -1260,6 +1715,30 @@ class CrossModelRelationsFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_PublishIngressNetworkChanges(self, changes=None): + ''' + PublishIngressNetworkChanges publishes changes to the required + ingress addresses to the model hosting the offer in the relation. + + changes : typing.Sequence[~IngressNetworksChangeEvent] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='PublishIngressNetworkChanges', + version=3, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def PublishIngressNetworkChanges(self, changes=None): ''' @@ -1284,6 +1763,30 @@ async def PublishIngressNetworkChanges(self, changes=None): + @ReturnMapping(ErrorResults) + def sync_PublishRelationChanges(self, changes=None): + ''' + PublishRelationChanges publishes relation changes to the + model hosting the remote application involved in the relation. + + changes : typing.Sequence[~RemoteRelationChangeEvent] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='PublishRelationChanges', + version=3, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def PublishRelationChanges(self, changes=None): ''' @@ -1308,6 +1811,30 @@ async def PublishRelationChanges(self, changes=None): + @ReturnMapping(RegisterRemoteRelationResults) + def sync_RegisterRemoteRelations(self, relations=None): + ''' + RegisterRemoteRelations sets up the model to participate + in the specified relations. This operation is idempotent. + + relations : typing.Sequence[~RegisterRemoteRelationArg] + Returns -> RegisterRemoteRelationResults + ''' + if relations is not None and not isinstance(relations, (bytes, str, list)): + raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='RegisterRemoteRelations', + version=3, + params=_params) + _params['relations'] = relations + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RegisterRemoteRelationResults) async def RegisterRemoteRelations(self, relations=None): ''' @@ -1332,6 +1859,30 @@ async def RegisterRemoteRelations(self, relations=None): + @ReturnMapping(SecretRevisionWatchResults) + def sync_WatchConsumedSecretsChanges(self, relations=None): + ''' + WatchConsumedSecretsChanges returns a watcher which notifies of changes to any secrets + for the specified remote consumers. + + relations : typing.Sequence[~WatchRemoteSecretChangesArg] + Returns -> SecretRevisionWatchResults + ''' + if relations is not None and not isinstance(relations, (bytes, str, list)): + raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchConsumedSecretsChanges', + version=3, + params=_params) + _params['relations'] = relations + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SecretRevisionWatchResults) async def WatchConsumedSecretsChanges(self, relations=None): ''' @@ -1356,6 +1907,31 @@ async def WatchConsumedSecretsChanges(self, relations=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchEgressAddressesForRelations(self, args=None): + ''' + WatchEgressAddressesForRelations creates a watcher that notifies when addresses, from which + connections will originate for the relation, change. + Each event contains the entire set of addresses which are required for ingress for the relation. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> StringsWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchEgressAddressesForRelations', + version=3, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchEgressAddressesForRelations(self, args=None): ''' @@ -1381,6 +1957,30 @@ async def WatchEgressAddressesForRelations(self, args=None): + @ReturnMapping(OfferStatusWatchResults) + def sync_WatchOfferStatus(self, args=None): + ''' + WatchOfferStatus starts an OfferStatusWatcher for + watching the status of an offer. + + args : typing.Sequence[~OfferArg] + Returns -> OfferStatusWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchOfferStatus', + version=3, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(OfferStatusWatchResults) async def WatchOfferStatus(self, args=None): ''' @@ -1405,6 +2005,31 @@ async def WatchOfferStatus(self, args=None): + @ReturnMapping(RemoteRelationWatchResults) + def sync_WatchRelationChanges(self, args=None): + ''' + WatchRelationChanges starts a RemoteRelationChangesWatcher for each + specified relation, returning the watcher IDs and initial values, + or an error if the remote relations couldn't be watched. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> RemoteRelationWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchRelationChanges', + version=3, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RemoteRelationWatchResults) async def WatchRelationChanges(self, args=None): ''' @@ -1430,6 +2055,30 @@ async def WatchRelationChanges(self, args=None): + @ReturnMapping(RelationStatusWatchResults) + def sync_WatchRelationsSuspendedStatus(self, args=None): + ''' + WatchRelationsSuspendedStatus starts a RelationStatusWatcher for + watching the life and suspended status of a relation. + + args : typing.Sequence[~RemoteEntityArg] + Returns -> RelationStatusWatchResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CrossModelRelations', + request='WatchRelationsSuspendedStatus', + version=3, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RelationStatusWatchResults) async def WatchRelationsSuspendedStatus(self, args=None): ''' @@ -1466,6 +2115,28 @@ class ImageMetadataFacade(Type): 'type': 'object'} + @ReturnMapping(None) + def sync_UpdateFromPublishedImages(self): + ''' + UpdateFromPublishedImages is now a no-op. + It is retained for compatibility. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ImageMetadata', + request='UpdateFromPublishedImages', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def UpdateFromPublishedImages(self): ''' @@ -1710,6 +2381,31 @@ class InstanceMutaterFacade(Type): 'type': 'object'} + @ReturnMapping(CharmProfilingInfoResult) + def sync_CharmProfilingInfo(self, tag=None): + ''' + CharmProfilingInfo returns info to update lxd profiles on the machine. If + the machine is not provisioned, no profile change info will be returned, + nor will an error. + + tag : str + Returns -> CharmProfilingInfoResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='CharmProfilingInfo', + version=3, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CharmProfilingInfoResult) async def CharmProfilingInfo(self, tag=None): ''' @@ -1735,6 +2431,29 @@ async def CharmProfilingInfo(self, tag=None): + @ReturnMapping(ContainerTypeResult) + def sync_ContainerType(self, tag=None): + ''' + ContainerType returns the container type of a machine. + + tag : str + Returns -> ContainerTypeResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='ContainerType', + version=3, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ContainerTypeResult) async def ContainerType(self, tag=None): ''' @@ -1758,6 +2477,29 @@ async def ContainerType(self, tag=None): + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='Life', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' @@ -1781,6 +2523,29 @@ async def Life(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetCharmProfiles(self, args=None): + ''' + SetCharmProfiles records the given slice of charm profile names. + + args : typing.Sequence[~SetProfileArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='SetCharmProfiles', + version=3, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetCharmProfiles(self, args=None): ''' @@ -1804,6 +2569,35 @@ async def SetCharmProfiles(self, args=None): + @ReturnMapping(ErrorResults) + def sync_SetModificationStatus(self, entities=None): + ''' + SetModificationStatus updates the instance whilst changes are occurring. This + is different from SetStatus and SetInstanceStatus, by the fact this holds + information about the ongoing changes that are happening to instances. + Consider LXD Profile updates that can modify a instance, but may not cause + the instance to be placed into a error state. This modification status + serves the purpose of highlighting that to the operator. + Only machine tags are accepted. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='SetModificationStatus', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetModificationStatus(self, entities=None): ''' @@ -1833,6 +2627,30 @@ async def SetModificationStatus(self, entities=None): + @ReturnMapping(StringsWatchResult) + def sync_WatchContainers(self, tag=None): + ''' + WatchContainers starts a watcher to track Containers on a given + machine. + + tag : str + Returns -> StringsWatchResult + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='WatchContainers', + version=3, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchContainers(self, tag=None): ''' @@ -1857,6 +2675,30 @@ async def WatchContainers(self, tag=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchLXDProfileVerificationNeeded(self, entities=None): + ''' + WatchLXDProfileVerificationNeeded starts a watcher to track Applications with + LXD Profiles. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='WatchLXDProfileVerificationNeeded', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchLXDProfileVerificationNeeded(self, entities=None): ''' @@ -1881,6 +2723,29 @@ async def WatchLXDProfileVerificationNeeded(self, entities=None): + @ReturnMapping(StringsWatchResult) + def sync_WatchMachines(self): + ''' + WatchMachines starts a watcher to track machines. + WatchMachines does not consume the initial event of the watch response, as + that returns the initial set of machines that are currently available. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='WatchMachines', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchMachines(self): ''' @@ -1904,6 +2769,29 @@ async def WatchMachines(self): + @ReturnMapping(StringsWatchResult) + def sync_WatchModelMachines(self): + ''' + WatchModelMachines starts a watcher to track machines, but not containers. + WatchModelMachines does not consume the initial event of the watch response, as + that returns the initial set of machines that are currently available. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstanceMutater', + request='WatchModelMachines', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchModelMachines(self): ''' @@ -2202,23 +3090,66 @@ class MigrationMasterFacade(Type): 'type': 'object'} + @ReturnMapping(SerializedModel) + def sync_Export(self): + ''' + Export serializes the model associated with the API connection. + + + Returns -> SerializedModel + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Export', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SerializedModel) async def Export(self): ''' - Export serializes the model associated with the API connection. + Export serializes the model associated with the API connection. + + + Returns -> SerializedModel + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Export', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MasterMigrationStatus) + def sync_MigrationStatus(self): + ''' + MigrationStatus returns the details and progress of the latest + model migration. - Returns -> SerializedModel + Returns -> MasterMigrationStatus ''' # map input types to rpc msg _params = dict() msg = dict(type='MigrationMaster', - request='Export', + request='MigrationStatus', version=3, params=_params) - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @@ -2245,6 +3176,29 @@ async def MigrationStatus(self): + @ReturnMapping(StringResult) + def sync_MinionReportTimeout(self): + ''' + MinionReportTimeout returns the configuration value for this controller that + indicates how long the migration master worker should wait for minions to + reported on phases of a migration. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='MinionReportTimeout', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResult) async def MinionReportTimeout(self): ''' @@ -2268,6 +3222,28 @@ async def MinionReportTimeout(self): + @ReturnMapping(MinionReports) + def sync_MinionReports(self): + ''' + MinionReports returns details of the reports made by migration + minions to the controller for the current migration phase. + + + Returns -> MinionReports + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='MinionReports', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MinionReports) async def MinionReports(self): ''' @@ -2290,6 +3266,28 @@ async def MinionReports(self): + @ReturnMapping(MigrationModelInfo) + def sync_ModelInfo(self): + ''' + ModelInfo returns essential information about the model to be + migrated. + + + Returns -> MigrationModelInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='ModelInfo', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MigrationModelInfo) async def ModelInfo(self): ''' @@ -2312,6 +3310,30 @@ async def ModelInfo(self): + @ReturnMapping(None) + def sync_Prechecks(self, target_controller_version=None): + ''' + Prechecks performs pre-migration checks on the model and + (source) controller. + + target_controller_version : Number + Returns -> None + ''' + if target_controller_version is not None and not isinstance(target_controller_version, (dict, Number)): + raise Exception("Expected target_controller_version to be a Number, received: {}".format(type(target_controller_version))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Prechecks', + version=3, + params=_params) + _params['target-controller-version'] = target_controller_version + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Prechecks(self, target_controller_version=None): ''' @@ -2336,6 +3358,30 @@ async def Prechecks(self, target_controller_version=None): + @ReturnMapping(None) + def sync_ProcessRelations(self, controller_alias=None): + ''' + ProcessRelations processes any relations that need updating after an export. + This should help fix any remoteApplications that have been migrated. + + controller_alias : str + Returns -> None + ''' + if controller_alias is not None and not isinstance(controller_alias, (bytes, str)): + raise Exception("Expected controller_alias to be a str, received: {}".format(type(controller_alias))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='ProcessRelations', + version=3, + params=_params) + _params['controller-alias'] = controller_alias + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def ProcessRelations(self, controller_alias=None): ''' @@ -2360,6 +3406,28 @@ async def ProcessRelations(self, controller_alias=None): + @ReturnMapping(None) + def sync_Reap(self): + ''' + Reap removes all documents for the model associated with the API + connection. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Reap', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Reap(self): ''' @@ -2382,6 +3450,31 @@ async def Reap(self): + @ReturnMapping(None) + def sync_SetPhase(self, phase=None): + ''' + SetPhase sets the phase of the active model migration. The provided + phase must be a valid phase value, for example QUIESCE" or + "ABORT". See the core/migration package for the complete list. + + phase : str + Returns -> None + ''' + if phase is not None and not isinstance(phase, (bytes, str)): + raise Exception("Expected phase to be a str, received: {}".format(type(phase))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='SetPhase', + version=3, + params=_params) + _params['phase'] = phase + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetPhase(self, phase=None): ''' @@ -2407,6 +3500,31 @@ async def SetPhase(self, phase=None): + @ReturnMapping(None) + def sync_SetStatusMessage(self, message=None): + ''' + SetStatusMessage sets a human readable status message containing + information about the migration's progress. This will be shown in + status output shown to the end user. + + message : str + Returns -> None + ''' + if message is not None and not isinstance(message, (bytes, str)): + raise Exception("Expected message to be a str, received: {}".format(type(message))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='SetStatusMessage', + version=3, + params=_params) + _params['message'] = message + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetStatusMessage(self, message=None): ''' @@ -2432,6 +3550,28 @@ async def SetStatusMessage(self, message=None): + @ReturnMapping(MigrationSourceInfo) + def sync_SourceControllerInfo(self): + ''' + SourceControllerInfo returns the details required to connect to + the source controller for model migration. + + + Returns -> MigrationSourceInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='SourceControllerInfo', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MigrationSourceInfo) async def SourceControllerInfo(self): ''' @@ -2454,6 +3594,29 @@ async def SourceControllerInfo(self): + @ReturnMapping(NotifyWatchResult) + def sync_Watch(self): + ''' + Watch starts watching for an active migration for the model + associated with the API connection. The returned id should be used + with the NotifyWatcher facade to receive events. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Watch', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def Watch(self): ''' @@ -2477,6 +3640,28 @@ async def Watch(self): + @ReturnMapping(NotifyWatchResult) + def sync_WatchMinionReports(self): + ''' + WatchMinionReports sets up a watcher which reports when a report + for a migration minion has arrived. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='WatchMinionReports', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchMinionReports(self): ''' @@ -2728,6 +3913,30 @@ class MigrationTargetFacade(Type): 'type': 'object'} + @ReturnMapping(None) + def sync_Abort(self, model_tag=None): + ''' + Abort removes the specified model from the database. It is an error to + attempt to Abort a model that has a migration mode other than importing. + + model_tag : str + Returns -> None + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Abort', + version=3, + params=_params) + _params['model-tag'] = model_tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Abort(self, model_tag=None): ''' @@ -2752,6 +3961,58 @@ async def Abort(self, model_tag=None): + @ReturnMapping(None) + def sync_Activate(self, controller_alias=None, controller_tag=None, cross_model_uuids=None, model_tag=None, source_api_addrs=None, source_ca_cert=None): + ''' + Activate sets the migration mode of the model to "none", meaning it + is ready for use. It is an error to attempt to Abort a model that + has a migration mode other than importing. It also adds any required + external controller records for those controllers hosting offers used + by the model. + + controller_alias : str + controller_tag : str + cross_model_uuids : typing.Sequence[str] + model_tag : str + source_api_addrs : typing.Sequence[str] + source_ca_cert : str + Returns -> None + ''' + if controller_alias is not None and not isinstance(controller_alias, (bytes, str)): + raise Exception("Expected controller_alias to be a str, received: {}".format(type(controller_alias))) + + if controller_tag is not None and not isinstance(controller_tag, (bytes, str)): + raise Exception("Expected controller_tag to be a str, received: {}".format(type(controller_tag))) + + if cross_model_uuids is not None and not isinstance(cross_model_uuids, (bytes, str, list)): + raise Exception("Expected cross_model_uuids to be a Sequence, received: {}".format(type(cross_model_uuids))) + + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + if source_api_addrs is not None and not isinstance(source_api_addrs, (bytes, str, list)): + raise Exception("Expected source_api_addrs to be a Sequence, received: {}".format(type(source_api_addrs))) + + if source_ca_cert is not None and not isinstance(source_ca_cert, (bytes, str)): + raise Exception("Expected source_ca_cert to be a str, received: {}".format(type(source_ca_cert))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Activate', + version=3, + params=_params) + _params['controller-alias'] = controller_alias + _params['controller-tag'] = controller_tag + _params['cross-model-uuids'] = cross_model_uuids + _params['model-tag'] = model_tag + _params['source-api-addrs'] = source_api_addrs + _params['source-ca-cert'] = source_ca_cert + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Activate(self, controller_alias=None, controller_tag=None, cross_model_uuids=None, model_tag=None, source_api_addrs=None, source_ca_cert=None): ''' @@ -2804,6 +4065,37 @@ async def Activate(self, controller_alias=None, controller_tag=None, cross_model + @ReturnMapping(None) + def sync_AdoptResources(self, model_tag=None, source_controller_version=None): + ''' + AdoptResources asks the cloud provider to update the controller + tags for a model's resources. This prevents the resources from + being destroyed if the source controller is destroyed after the + model is migrated away. + + model_tag : str + source_controller_version : Number + Returns -> None + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + if source_controller_version is not None and not isinstance(source_controller_version, (dict, Number)): + raise Exception("Expected source_controller_version to be a Number, received: {}".format(type(source_controller_version))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='AdoptResources', + version=3, + params=_params) + _params['model-tag'] = model_tag + _params['source-controller-version'] = source_controller_version + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def AdoptResources(self, model_tag=None, source_controller_version=None): ''' @@ -2835,6 +4127,27 @@ async def AdoptResources(self, model_tag=None, source_controller_version=None): + @ReturnMapping(BytesResult) + def sync_CACert(self): + ''' + CACert returns the certificate used to validate the state connection. + + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='CACert', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(BytesResult) async def CACert(self): ''' @@ -2856,6 +4169,30 @@ async def CACert(self): + @ReturnMapping(ErrorResults) + def sync_CheckMachines(self, model_tag=None): + ''' + CheckMachines compares the machines in state with the ones reported + by the provider and reports any discrepancies. + + model_tag : str + Returns -> ErrorResults + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='CheckMachines', + version=3, + params=_params) + _params['model-tag'] = model_tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def CheckMachines(self, model_tag=None): ''' @@ -2880,6 +4217,45 @@ async def CheckMachines(self, model_tag=None): + @ReturnMapping(None) + def sync_Import(self, bytes_=None, charms=None, resources=None, tools=None): + ''' + Import takes a serialized Juju model, deserializes it, and + recreates it in the receiving controller. + + bytes_ : typing.Sequence[int] + charms : typing.Sequence[str] + resources : typing.Sequence[~SerializedModelResource] + tools : typing.Sequence[~SerializedModelTools] + Returns -> None + ''' + if bytes_ is not None and not isinstance(bytes_, (bytes, str, list)): + raise Exception("Expected bytes_ to be a Sequence, received: {}".format(type(bytes_))) + + if charms is not None and not isinstance(charms, (bytes, str, list)): + raise Exception("Expected charms to be a Sequence, received: {}".format(type(charms))) + + if resources is not None and not isinstance(resources, (bytes, str, list)): + raise Exception("Expected resources to be a Sequence, received: {}".format(type(resources))) + + if tools is not None and not isinstance(tools, (bytes, str, list)): + raise Exception("Expected tools to be a Sequence, received: {}".format(type(tools))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Import', + version=3, + params=_params) + _params['bytes'] = bytes_ + _params['charms'] = charms + _params['resources'] = resources + _params['tools'] = tools + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Import(self, bytes_=None, charms=None, resources=None, tools=None): ''' @@ -2919,6 +4295,44 @@ async def Import(self, bytes_=None, charms=None, resources=None, tools=None): + @ReturnMapping(str) + def sync_LatestLogTime(self, model_tag=None): + ''' + LatestLogTime returns the time of the most recent log record + received by the logtransfer endpoint. This can be used as the start + point for streaming logs from the source if the transfer was + interrupted. + + For performance reasons, not every time is tracked, so if the + target controller died during the transfer the latest log time + might be up to 2 minutes earlier. If the transfer was interrupted + in some other way (like the source controller going away or a + network partition) the time will be up-to-date. + + Log messages are assumed to be sent in time order (which is how + debug-log emits them). If that isn't the case then this mechanism + can't be used to avoid duplicates when logtransfer is restarted. + + Returns the zero time if no logs have been transferred. + + model_tag : str + Returns -> str + ''' + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='LatestLogTime', + version=3, + params=_params) + _params['model-tag'] = model_tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(str) async def LatestLogTime(self, model_tag=None): ''' @@ -2957,6 +4371,55 @@ async def LatestLogTime(self, model_tag=None): + @ReturnMapping(None) + def sync_Prechecks(self, agent_version=None, controller_agent_version=None, facade_versions=None, name=None, owner_tag=None, uuid=None): + ''' + Prechecks ensure that the target controller is ready to accept a + model migration. + + agent_version : Number + controller_agent_version : Number + facade_versions : typing.Mapping[str, typing.Sequence[int]] + name : str + owner_tag : str + uuid : str + Returns -> None + ''' + if agent_version is not None and not isinstance(agent_version, (dict, Number)): + raise Exception("Expected agent_version to be a Number, received: {}".format(type(agent_version))) + + if controller_agent_version is not None and not isinstance(controller_agent_version, (dict, Number)): + raise Exception("Expected controller_agent_version to be a Number, received: {}".format(type(controller_agent_version))) + + if facade_versions is not None and not isinstance(facade_versions, dict): + raise Exception("Expected facade_versions to be a Mapping, received: {}".format(type(facade_versions))) + + if name is not None and not isinstance(name, (bytes, str)): + raise Exception("Expected name to be a str, received: {}".format(type(name))) + + if owner_tag is not None and not isinstance(owner_tag, (bytes, str)): + raise Exception("Expected owner_tag to be a str, received: {}".format(type(owner_tag))) + + if uuid is not None and not isinstance(uuid, (bytes, str)): + raise Exception("Expected uuid to be a str, received: {}".format(type(uuid))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationTarget', + request='Prechecks', + version=3, + params=_params) + _params['agent-version'] = agent_version + _params['controller-agent-version'] = controller_agent_version + _params['facade-versions'] = facade_versions + _params['name'] = name + _params['owner-tag'] = owner_tag + _params['uuid'] = uuid + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Prechecks(self, agent_version=None, controller_agent_version=None, facade_versions=None, name=None, owner_tag=None, uuid=None): ''' @@ -3135,6 +4598,27 @@ class ModelConfigFacade(Type): 'type': 'object'} + @ReturnMapping(GetConstraintsResults) + def sync_GetModelConstraints(self): + ''' + GetModelConstraints returns the constraints for the model. + + + Returns -> GetConstraintsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='GetModelConstraints', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(GetConstraintsResults) async def GetModelConstraints(self): ''' @@ -3156,6 +4640,28 @@ async def GetModelConstraints(self): + @ReturnMapping(ModelConfigResults) + def sync_ModelGet(self): + ''' + ModelGet implements the server-side part of the + model-config CLI command. + + + Returns -> ModelConfigResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='ModelGet', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelConfigResults) async def ModelGet(self): ''' @@ -3178,6 +4684,30 @@ async def ModelGet(self): + @ReturnMapping(None) + def sync_ModelSet(self, config=None): + ''' + ModelSet implements the server-side part of the + set-model-config CLI command. + + config : typing.Mapping[str, typing.Any] + Returns -> None + ''' + if config is not None and not isinstance(config, dict): + raise Exception("Expected config to be a Mapping, received: {}".format(type(config))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='ModelSet', + version=3, + params=_params) + _params['config'] = config + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def ModelSet(self, config=None): ''' @@ -3202,6 +4732,30 @@ async def ModelSet(self, config=None): + @ReturnMapping(None) + def sync_ModelUnset(self, keys=None): + ''' + ModelUnset implements the server-side part of the + set-model-config CLI command. + + keys : typing.Sequence[str] + Returns -> None + ''' + if keys is not None and not isinstance(keys, (bytes, str, list)): + raise Exception("Expected keys to be a Sequence, received: {}".format(type(keys))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='ModelUnset', + version=3, + params=_params) + _params['keys'] = keys + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def ModelUnset(self, keys=None): ''' @@ -3226,6 +4780,27 @@ async def ModelUnset(self, keys=None): + @ReturnMapping(StringResult) + def sync_SLALevel(self): + ''' + SLALevel returns the current sla level for the model. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='SLALevel', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResult) async def SLALevel(self): ''' @@ -3247,6 +4822,27 @@ async def SLALevel(self): + @ReturnMapping(ModelSequencesResult) + def sync_Sequences(self): + ''' + Sequences returns the model's sequence names and next values. + + + Returns -> ModelSequencesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='Sequences', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelSequencesResult) async def Sequences(self): ''' @@ -3268,6 +4864,34 @@ async def Sequences(self): + @ReturnMapping(None) + def sync_SetModelConstraints(self, application=None, constraints=None): + ''' + SetModelConstraints sets the constraints for the model. + + application : str + constraints : Value + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + if constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='SetModelConstraints', + version=3, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetModelConstraints(self, application=None, constraints=None): ''' @@ -3296,6 +4920,44 @@ async def SetModelConstraints(self, application=None, constraints=None): + @ReturnMapping(None) + def sync_SetSLALevel(self, modelslainfo=None, creds=None, level=None, owner=None): + ''' + SetSLALevel sets the sla level on the model. + + modelslainfo : ModelSLAInfo + creds : typing.Sequence[int] + level : str + owner : str + Returns -> None + ''' + if modelslainfo is not None and not isinstance(modelslainfo, (dict, ModelSLAInfo)): + raise Exception("Expected modelslainfo to be a ModelSLAInfo, received: {}".format(type(modelslainfo))) + + if creds is not None and not isinstance(creds, (bytes, str, list)): + raise Exception("Expected creds to be a Sequence, received: {}".format(type(creds))) + + if level is not None and not isinstance(level, (bytes, str)): + raise Exception("Expected level to be a str, received: {}".format(type(level))) + + if owner is not None and not isinstance(owner, (bytes, str)): + raise Exception("Expected owner to be a str, received: {}".format(type(owner))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='SetSLALevel', + version=3, + params=_params) + _params['ModelSLAInfo'] = modelslainfo + _params['creds'] = creds + _params['level'] = level + _params['owner'] = owner + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetSLALevel(self, modelslainfo=None, creds=None, level=None, owner=None): ''' @@ -3503,6 +5165,56 @@ class ResourcesFacade(Type): 'type': 'object'} + @ReturnMapping(AddPendingResourcesResult) + def sync_AddPendingResources(self, entity=None, charm_origin=None, macaroon=None, resources=None, tag=None, url=None): + ''' + AddPendingResources adds the provided resources (info) to the Juju + model in a pending state, meaning they are not available until + resolved. Handles CharmHub and Local charms. + + entity : Entity + charm_origin : CharmOrigin + macaroon : Macaroon + resources : typing.Sequence[~CharmResource] + tag : str + url : str + Returns -> AddPendingResourcesResult + ''' + if entity is not None and not isinstance(entity, (dict, Entity)): + raise Exception("Expected entity to be a Entity, received: {}".format(type(entity))) + + if charm_origin is not None and not isinstance(charm_origin, (dict, CharmOrigin)): + raise Exception("Expected charm_origin to be a CharmOrigin, received: {}".format(type(charm_origin))) + + if macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): + raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) + + if resources is not None and not isinstance(resources, (bytes, str, list)): + raise Exception("Expected resources to be a Sequence, received: {}".format(type(resources))) + + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Resources', + request='AddPendingResources', + version=3, + params=_params) + _params['Entity'] = entity + _params['charm-origin'] = charm_origin + _params['macaroon'] = macaroon + _params['resources'] = resources + _params['tag'] = tag + _params['url'] = url + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AddPendingResourcesResult) async def AddPendingResources(self, entity=None, charm_origin=None, macaroon=None, resources=None, tag=None, url=None): ''' @@ -3553,6 +5265,29 @@ async def AddPendingResources(self, entity=None, charm_origin=None, macaroon=Non + @ReturnMapping(ResourcesResults) + def sync_ListResources(self, entities=None): + ''' + ListResources returns the list of resources for the given application. + + entities : typing.Sequence[~Entity] + Returns -> ResourcesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Resources', + request='ListResources', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ResourcesResults) async def ListResources(self, entities=None): ''' @@ -3864,6 +5599,32 @@ class UpgradeSeriesFacade(Type): 'type': 'object'} + @ReturnMapping(StringResults) + def sync_CurrentSeries(self, entities=None): + ''' + CurrentSeries returns what Juju thinks the current series of the machine is. + Note that a machine could have been upgraded out-of-band by running + do-release-upgrade outside of the upgrade-machine workflow, + making this value incorrect. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='CurrentSeries', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def CurrentSeries(self, entities=None): ''' @@ -3890,6 +5651,32 @@ async def CurrentSeries(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_FinishUpgradeSeries(self, args=None): + ''' + FinishUpgradeSeries is the last action in the upgrade workflow and is + called after all machine and unit statuses are "completed". + It updates the machine series to reflect the completed upgrade, then + removes the upgrade-machine lock. + + args : typing.Sequence[~UpdateChannelArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='FinishUpgradeSeries', + version=3, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def FinishUpgradeSeries(self, args=None): ''' @@ -3916,6 +5703,29 @@ async def FinishUpgradeSeries(self, args=None): + @ReturnMapping(UpgradeSeriesStatusResults) + def sync_MachineStatus(self, entities=None): + ''' + MachineStatus gets the current upgrade-machine status of a machine. + + entities : typing.Sequence[~Entity] + Returns -> UpgradeSeriesStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='MachineStatus', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UpgradeSeriesStatusResults) async def MachineStatus(self, entities=None): ''' @@ -3939,6 +5749,28 @@ async def MachineStatus(self, entities=None): + @ReturnMapping(PinApplicationsResults) + def sync_PinMachineApplications(self): + ''' + PinMachineApplications pins leadership for applications represented by units + running on the auth'd machine. + + + Returns -> PinApplicationsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='PinMachineApplications', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(PinApplicationsResults) async def PinMachineApplications(self): ''' @@ -3961,6 +5793,28 @@ async def PinMachineApplications(self): + @ReturnMapping(PinnedLeadershipResult) + def sync_PinnedLeadership(self): + ''' + PinnedLeadership returns all pinned applications and the entities that + require their pinned behaviour, for leadership in the current model. + + + Returns -> PinnedLeadershipResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='PinnedLeadership', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(PinnedLeadershipResult) async def PinnedLeadership(self): ''' @@ -3983,6 +5837,29 @@ async def PinnedLeadership(self): + @ReturnMapping(ErrorResults) + def sync_SetInstanceStatus(self, entities=None): + ''' + SetInstanceStatus sets the status of the machine. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='SetInstanceStatus', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetInstanceStatus(self, entities=None): ''' @@ -4006,6 +5883,29 @@ async def SetInstanceStatus(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetMachineStatus(self, params=None): + ''' + SetMachineStatus sets the current upgrade-machine status of a machine. + + params : typing.Sequence[~UpgradeSeriesStatusParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='SetMachineStatus', + version=3, + params=_params) + _params['params'] = params + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetMachineStatus(self, params=None): ''' @@ -4029,6 +5929,30 @@ async def SetMachineStatus(self, params=None): + @ReturnMapping(ErrorResults) + def sync_SetUpgradeSeriesUnitStatus(self, params=None): + ''' + SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit. + If no upgrade is in progress an error is returned instead. + + params : typing.Sequence[~UpgradeSeriesStatusParam] + Returns -> ErrorResults + ''' + if params is not None and not isinstance(params, (bytes, str, list)): + raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='SetUpgradeSeriesUnitStatus', + version=3, + params=_params) + _params['params'] = params + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetUpgradeSeriesUnitStatus(self, params=None): ''' @@ -4053,6 +5977,35 @@ async def SetUpgradeSeriesUnitStatus(self, params=None): + @ReturnMapping(ErrorResults) + def sync_StartUnitCompletion(self, entities=None, message=None): + ''' + StartUnitCompletion starts the upgrade series completion phase for all subordinate + units of a given machine. + + entities : typing.Sequence[~Entity] + message : str + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + if message is not None and not isinstance(message, (bytes, str)): + raise Exception("Expected message to be a str, received: {}".format(type(message))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='StartUnitCompletion', + version=3, + params=_params) + _params['entities'] = entities + _params['message'] = message + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def StartUnitCompletion(self, entities=None, message=None): ''' @@ -4082,6 +6035,30 @@ async def StartUnitCompletion(self, entities=None, message=None): + @ReturnMapping(StringResults) + def sync_TargetSeries(self, entities=None): + ''' + TargetSeries returns the series that a machine has been locked + for upgrading to. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='TargetSeries', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def TargetSeries(self, entities=None): ''' @@ -4107,10 +6084,59 @@ async def TargetSeries(self, entities=None): @ReturnMapping(EntitiesResults) - async def UnitsCompleted(self, entities=None): + def sync_UnitsCompleted(self, entities=None): + ''' + UnitsCompleted returns the units running on this machine that have completed + the upgrade-machine workflow and are in their normal running state. + + entities : typing.Sequence[~Entity] + Returns -> EntitiesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='UnitsCompleted', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(EntitiesResults) + async def UnitsCompleted(self, entities=None): + ''' + UnitsCompleted returns the units running on this machine that have completed + the upgrade-machine workflow and are in their normal running state. + + entities : typing.Sequence[~Entity] + Returns -> EntitiesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='UnitsCompleted', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(EntitiesResults) + def sync_UnitsPrepared(self, entities=None): ''' - UnitsCompleted returns the units running on this machine that have completed - the upgrade-machine workflow and are in their normal running state. + UnitsPrepared returns the units running on this machine that have completed + their upgrade-machine preparation, and are ready to be stopped and have their + unit agent services converted for the target series. entities : typing.Sequence[~Entity] Returns -> EntitiesResults @@ -4121,11 +6147,11 @@ async def UnitsCompleted(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='UpgradeSeries', - request='UnitsCompleted', + request='UnitsPrepared', version=3, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @@ -4155,6 +6181,28 @@ async def UnitsPrepared(self, entities=None): + @ReturnMapping(PinApplicationsResults) + def sync_UnpinMachineApplications(self): + ''' + UnpinMachineApplications unpins leadership for applications represented by + units running on the auth'd machine. + + + Returns -> PinApplicationsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='UnpinMachineApplications', + version=3, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(PinApplicationsResults) async def UnpinMachineApplications(self): ''' @@ -4177,6 +6225,31 @@ async def UnpinMachineApplications(self): + @ReturnMapping(UpgradeSeriesStatusResults) + def sync_UpgradeSeriesUnitStatus(self, entities=None): + ''' + UpgradeSeriesUnitStatus returns the current preparation status of an + upgrading unit. + If no series upgrade is in progress an error is returned instead. + + entities : typing.Sequence[~Entity] + Returns -> UpgradeSeriesStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='UpgradeSeriesUnitStatus', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UpgradeSeriesStatusResults) async def UpgradeSeriesUnitStatus(self, entities=None): ''' @@ -4202,6 +6275,29 @@ async def UpgradeSeriesUnitStatus(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchUpgradeSeriesNotifications(self, entities=None): + ''' + WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='WatchUpgradeSeriesNotifications', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchUpgradeSeriesNotifications(self, entities=None): ''' @@ -4412,6 +6508,30 @@ class UserManagerFacade(Type): 'type': 'object'} + @ReturnMapping(AddUserResults) + def sync_AddUser(self, users=None): + ''' + AddUser adds a user with a username, and either a password or + a randomly generated secret key which will be returned. + + users : typing.Sequence[~AddUser] + Returns -> AddUserResults + ''' + if users is not None and not isinstance(users, (bytes, str, list)): + raise Exception("Expected users to be a Sequence, received: {}".format(type(users))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserManager', + request='AddUser', + version=3, + params=_params) + _params['users'] = users + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AddUserResults) async def AddUser(self, users=None): ''' @@ -4436,6 +6556,30 @@ async def AddUser(self, users=None): + @ReturnMapping(ErrorResults) + def sync_DisableUser(self, entities=None): + ''' + DisableUser disables one or more users. If the user is already disabled, + the action is considered a success. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserManager', + request='DisableUser', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def DisableUser(self, entities=None): ''' @@ -4460,6 +6604,30 @@ async def DisableUser(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_EnableUser(self, entities=None): + ''' + EnableUser enables one or more users. If the user is already enabled, + the action is considered a success. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserManager', + request='EnableUser', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def EnableUser(self, entities=None): ''' @@ -4484,6 +6652,29 @@ async def EnableUser(self, entities=None): + @ReturnMapping(ModelUserInfoResults) + def sync_ModelUserInfo(self, entities=None): + ''' + ModelUserInfo returns information on all users in the model. + + entities : typing.Sequence[~Entity] + Returns -> ModelUserInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserManager', + request='ModelUserInfo', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelUserInfoResults) async def ModelUserInfo(self, entities=None): ''' @@ -4507,6 +6698,33 @@ async def ModelUserInfo(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_RemoveUser(self, entities=None): + ''' + RemoveUser permanently removes a user from the current controller for each + entity provided. While the user is permanently removed we keep it's + information around for auditing purposes. + TODO(redir): Add information about getting deleted user information when we + add that capability. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserManager', + request='RemoveUser', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def RemoveUser(self, entities=None): ''' @@ -4534,6 +6752,32 @@ async def RemoveUser(self, entities=None): + @ReturnMapping(AddUserResults) + def sync_ResetPassword(self, entities=None): + ''' + ResetPassword resets password for supplied users by + invalidating current passwords (if any) and generating + new random secret keys which will be returned. + Users cannot reset their own password. + + entities : typing.Sequence[~Entity] + Returns -> AddUserResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserManager', + request='ResetPassword', + version=3, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AddUserResults) async def ResetPassword(self, entities=None): ''' @@ -4560,6 +6804,29 @@ async def ResetPassword(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetPassword(self, changes=None): + ''' + SetPassword changes the stored password for the specified users. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserManager', + request='SetPassword', + version=3, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetPassword(self, changes=None): ''' @@ -4583,6 +6850,34 @@ async def SetPassword(self, changes=None): + @ReturnMapping(UserInfoResults) + def sync_UserInfo(self, entities=None, include_disabled=None): + ''' + UserInfo returns information on a user. + + entities : typing.Sequence[~Entity] + include_disabled : bool + Returns -> UserInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + if include_disabled is not None and not isinstance(include_disabled, bool): + raise Exception("Expected include_disabled to be a bool, received: {}".format(type(include_disabled))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='UserManager', + request='UserInfo', + version=3, + params=_params) + _params['entities'] = entities + _params['include-disabled'] = include_disabled + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UserInfoResults) async def UserInfo(self, entities=None, include_disabled=None): ''' diff --git a/juju/client/_client4.py b/juju/client/_client4.py index b313103c..7c232dd5 100644 --- a/juju/client/_client4.py +++ b/juju/client/_client4.py @@ -29,6 +29,28 @@ class AllModelWatcherFacade(Type): 'type': 'object'} + @ReturnMapping(AllWatcherNextResults) + def sync_Next(self): + ''' + Next will return the current state of everything on the first call + and subsequent calls will + + + Returns -> AllWatcherNextResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='AllModelWatcher', + request='Next', + version=4, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AllWatcherNextResults) async def Next(self): ''' @@ -51,6 +73,27 @@ async def Next(self): + @ReturnMapping(None) + def sync_Stop(self): + ''' + Stop stops the watcher. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='AllModelWatcher', + request='Stop', + version=4, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def Stop(self): ''' @@ -84,6 +127,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply + async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + class ApplicationOffersFacade(Type): @@ -456,6 +510,34 @@ class ApplicationOffersFacade(Type): 'type': 'object'} + @ReturnMapping(ApplicationOffersResults) + def sync_ApplicationOffers(self, bakery_version=None, offer_urls=None): + ''' + ApplicationOffers gets details about remote applications that match given URLs. + + bakery_version : int + offer_urls : typing.Sequence[str] + Returns -> ApplicationOffersResults + ''' + if bakery_version is not None and not isinstance(bakery_version, int): + raise Exception("Expected bakery_version to be a int, received: {}".format(type(bakery_version))) + + if offer_urls is not None and not isinstance(offer_urls, (bytes, str, list)): + raise Exception("Expected offer_urls to be a Sequence, received: {}".format(type(offer_urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='ApplicationOffers', + version=4, + params=_params) + _params['bakery-version'] = bakery_version + _params['offer-urls'] = offer_urls + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationOffersResults) async def ApplicationOffers(self, bakery_version=None, offer_urls=None): ''' @@ -484,6 +566,34 @@ async def ApplicationOffers(self, bakery_version=None, offer_urls=None): + @ReturnMapping(ErrorResults) + def sync_DestroyOffers(self, force=None, offer_urls=None): + ''' + DestroyOffers removes the offers specified by the given URLs, forcing if necessary. + + force : bool + offer_urls : typing.Sequence[str] + Returns -> ErrorResults + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if offer_urls is not None and not isinstance(offer_urls, (bytes, str, list)): + raise Exception("Expected offer_urls to be a Sequence, received: {}".format(type(offer_urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='DestroyOffers', + version=4, + params=_params) + _params['force'] = force + _params['offer-urls'] = offer_urls + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def DestroyOffers(self, force=None, offer_urls=None): ''' @@ -512,6 +622,29 @@ async def DestroyOffers(self, force=None, offer_urls=None): + @ReturnMapping(QueryApplicationOffersResults) + def sync_FindApplicationOffers(self, filters=None): + ''' + FindApplicationOffers gets details about remote applications that match given filter. + + filters : typing.Sequence[~OfferFilter] + Returns -> QueryApplicationOffersResults + ''' + if filters is not None and not isinstance(filters, (bytes, str, list)): + raise Exception("Expected filters to be a Sequence, received: {}".format(type(filters))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='FindApplicationOffers', + version=4, + params=_params) + _params['Filters'] = filters + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(QueryApplicationOffersResults) async def FindApplicationOffers(self, filters=None): ''' @@ -535,6 +668,35 @@ async def FindApplicationOffers(self, filters=None): + @ReturnMapping(ConsumeOfferDetailsResults) + def sync_GetConsumeDetails(self, offer_urls=None, user_tag=None): + ''' + GetConsumeDetails returns the details necessary to pass to another model + to allow the specified args user to consume the offers represented by the args URLs. + + offer_urls : OfferURLs + user_tag : str + Returns -> ConsumeOfferDetailsResults + ''' + if offer_urls is not None and not isinstance(offer_urls, (dict, OfferURLs)): + raise Exception("Expected offer_urls to be a OfferURLs, received: {}".format(type(offer_urls))) + + if user_tag is not None and not isinstance(user_tag, (bytes, str)): + raise Exception("Expected user_tag to be a str, received: {}".format(type(user_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='GetConsumeDetails', + version=4, + params=_params) + _params['offer-urls'] = offer_urls + _params['user-tag'] = user_tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ConsumeOfferDetailsResults) async def GetConsumeDetails(self, offer_urls=None, user_tag=None): ''' @@ -564,6 +726,30 @@ async def GetConsumeDetails(self, offer_urls=None, user_tag=None): + @ReturnMapping(QueryApplicationOffersResults) + def sync_ListApplicationOffers(self, filters=None): + ''' + ListApplicationOffers gets deployed details about application offers that match given filter. + The results contain details about the deployed applications such as connection count. + + filters : typing.Sequence[~OfferFilter] + Returns -> QueryApplicationOffersResults + ''' + if filters is not None and not isinstance(filters, (bytes, str, list)): + raise Exception("Expected filters to be a Sequence, received: {}".format(type(filters))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='ListApplicationOffers', + version=4, + params=_params) + _params['Filters'] = filters + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(QueryApplicationOffersResults) async def ListApplicationOffers(self, filters=None): ''' @@ -588,6 +774,29 @@ async def ListApplicationOffers(self, filters=None): + @ReturnMapping(ErrorResults) + def sync_ModifyOfferAccess(self, changes=None): + ''' + ModifyOfferAccess changes the application offer access granted to users. + + changes : typing.Sequence[~ModifyOfferAccess] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='ModifyOfferAccess', + version=4, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ModifyOfferAccess(self, changes=None): ''' @@ -611,6 +820,29 @@ async def ModifyOfferAccess(self, changes=None): + @ReturnMapping(ErrorResults) + def sync_Offer(self, offers=None): + ''' + Offer makes application endpoints available for consumption at a specified URL. + + offers : typing.Sequence[~AddApplicationOffer] + Returns -> ErrorResults + ''' + if offers is not None and not isinstance(offers, (bytes, str, list)): + raise Exception("Expected offers to be a Sequence, received: {}".format(type(offers))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='Offer', + version=4, + params=_params) + _params['Offers'] = offers + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Offer(self, offers=None): ''' @@ -634,6 +866,35 @@ async def Offer(self, offers=None): + @ReturnMapping(RemoteApplicationInfoResults) + def sync_RemoteApplicationInfo(self, bakery_version=None, offer_urls=None): + ''' + RemoteApplicationInfo returns information about the requested remote application. + This call currently has no client side API, only there for the Dashboard at this stage. + + bakery_version : int + offer_urls : typing.Sequence[str] + Returns -> RemoteApplicationInfoResults + ''' + if bakery_version is not None and not isinstance(bakery_version, int): + raise Exception("Expected bakery_version to be a int, received: {}".format(type(bakery_version))) + + if offer_urls is not None and not isinstance(offer_urls, (bytes, str, list)): + raise Exception("Expected offer_urls to be a Sequence, received: {}".format(type(offer_urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='RemoteApplicationInfo', + version=4, + params=_params) + _params['bakery-version'] = bakery_version + _params['offer-urls'] = offer_urls + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RemoteApplicationInfoResults) async def RemoteApplicationInfo(self, bakery_version=None, offer_urls=None): ''' @@ -1041,7 +1302,7 @@ class InstancePollerFacade(Type): @ReturnMapping(BoolResults) - async def AreManuallyProvisioned(self, entities=None): + def sync_AreManuallyProvisioned(self, entities=None): ''' AreManuallyProvisioned returns whether each given entity is manually provisioned or not. Only machine tags are accepted. @@ -1059,19 +1320,19 @@ async def AreManuallyProvisioned(self, entities=None): version=4, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringResults) - async def InstanceId(self, entities=None): + @ReturnMapping(BoolResults) + async def AreManuallyProvisioned(self, entities=None): ''' - InstanceId returns the provider specific instance id for each given - machine or an CodeNotProvisioned error, if not set. + AreManuallyProvisioned returns whether each given entity is + manually provisioned or not. Only machine tags are accepted. entities : typing.Sequence[~Entity] - Returns -> StringResults + Returns -> BoolResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -1079,7 +1340,7 @@ async def InstanceId(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='InstancePoller', - request='InstanceId', + request='AreManuallyProvisioned', version=4, params=_params) _params['entities'] = entities @@ -1088,8 +1349,80 @@ async def InstanceId(self, entities=None): - @ReturnMapping(StatusResults) - async def InstanceStatus(self, entities=None): + @ReturnMapping(StringResults) + def sync_InstanceId(self, entities=None): + ''' + InstanceId returns the provider specific instance id for each given + machine or an CodeNotProvisioned error, if not set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='InstanceId', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): + ''' + InstanceId returns the provider specific instance id for each given + machine or an CodeNotProvisioned error, if not set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='InstanceId', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + def sync_InstanceStatus(self, entities=None): + ''' + InstanceStatus returns the instance status for each given entity. + Only machine tags are accepted. + + entities : typing.Sequence[~Entity] + Returns -> StatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='InstanceStatus', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def InstanceStatus(self, entities=None): ''' InstanceStatus returns the instance status for each given entity. Only machine tags are accepted. @@ -1112,6 +1445,29 @@ async def InstanceStatus(self, entities=None): + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='Life', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' @@ -1135,6 +1491,27 @@ async def Life(self, entities=None): + @ReturnMapping(ModelConfigResult) + def sync_ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='ModelConfig', + version=4, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelConfigResult) async def ModelConfig(self): ''' @@ -1156,6 +1533,30 @@ async def ModelConfig(self): + @ReturnMapping(MachineAddressesResults) + def sync_ProviderAddresses(self, entities=None): + ''' + ProviderAddresses returns the list of all known provider addresses + for each given entity. Only machine tags are accepted. + + entities : typing.Sequence[~Entity] + Returns -> MachineAddressesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='ProviderAddresses', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MachineAddressesResults) async def ProviderAddresses(self, entities=None): ''' @@ -1180,6 +1581,30 @@ async def ProviderAddresses(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetInstanceStatus(self, entities=None): + ''' + SetInstanceStatus updates the instance status for each given entity. + Only machine tags are accepted. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='SetInstanceStatus', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetInstanceStatus(self, entities=None): ''' @@ -1204,6 +1629,30 @@ async def SetInstanceStatus(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetProviderAddresses(self, machine_addresses=None): + ''' + SetProviderAddresses updates the list of known provider addresses + for each given entity. Only machine tags are accepted. + + machine_addresses : typing.Sequence[~MachineAddresses] + Returns -> ErrorResults + ''' + if machine_addresses is not None and not isinstance(machine_addresses, (bytes, str, list)): + raise Exception("Expected machine_addresses to be a Sequence, received: {}".format(type(machine_addresses))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='SetProviderAddresses', + version=4, + params=_params) + _params['machine-addresses'] = machine_addresses + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetProviderAddresses(self, machine_addresses=None): ''' @@ -1228,6 +1677,35 @@ async def SetProviderAddresses(self, machine_addresses=None): + @ReturnMapping(SetProviderNetworkConfigResults) + def sync_SetProviderNetworkConfig(self, args=None): + ''' + SetProviderNetworkConfig updates the provider addresses for one or more + machines. + + What's more, if the client request includes provider-specific IDs (e.g. + network, subnet or address IDs), this method will also iterate any present + link layer devices (and their addresses) and merge in any missing + provider-specific information. + + args : typing.Sequence[~ProviderNetworkConfig] + Returns -> SetProviderNetworkConfigResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='SetProviderNetworkConfig', + version=4, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SetProviderNetworkConfigResults) async def SetProviderNetworkConfig(self, args=None): ''' @@ -1257,6 +1735,29 @@ async def SetProviderNetworkConfig(self, args=None): + @ReturnMapping(StatusResults) + def sync_Status(self, entities=None): + ''' + Status returns the status of each given entity. + + entities : typing.Sequence[~Entity] + Returns -> StatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='Status', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StatusResults) async def Status(self, entities=None): ''' @@ -1281,7 +1782,7 @@ async def Status(self, entities=None): @ReturnMapping(NotifyWatchResult) - async def WatchForModelConfigChanges(self): + def sync_WatchForModelConfigChanges(self): ''' WatchForModelConfigChanges returns a NotifyWatcher that observes changes to the model configuration. @@ -1300,25 +1801,28 @@ async def WatchForModelConfigChanges(self): version=4, params=_params) - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringsWatchResult) - async def WatchModelMachineStartTimes(self): + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): ''' - WatchModelMachineStartTimes watches the non-container machines in the model - for changes to the Life or AgentStartTime fields and reports them as a batch. + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. - Returns -> StringsWatchResult + Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='InstancePoller', - request='WatchModelMachineStartTimes', + request='WatchForModelConfigChanges', version=4, params=_params) @@ -1328,11 +1832,10 @@ async def WatchModelMachineStartTimes(self): @ReturnMapping(StringsWatchResult) - async def WatchModelMachines(self): + def sync_WatchModelMachineStartTimes(self): ''' - WatchModelMachines returns a StringsWatcher that notifies of - changes to the life cycles of the top level machines in the current - model. + WatchModelMachineStartTimes watches the non-container machines in the model + for changes to the Life or AgentStartTime fields and reports them as a batch. Returns -> StringsWatchResult @@ -1341,22 +1844,90 @@ async def WatchModelMachines(self): # map input types to rpc msg _params = dict() msg = dict(type='InstancePoller', - request='WatchModelMachines', + request='WatchModelMachineStartTimes', version=4, params=_params) - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply -class ModelGenerationFacade(Type): - name = 'ModelGeneration' - version = 4 - schema = {'definitions': {'BoolResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'boolean'}}, - 'required': ['result'], + @ReturnMapping(StringsWatchResult) + async def WatchModelMachineStartTimes(self): + ''' + WatchModelMachineStartTimes watches the non-container machines in the model + for changes to the Life or AgentStartTime fields and reports them as a batch. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='WatchModelMachineStartTimes', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + def sync_WatchModelMachines(self): + ''' + WatchModelMachines returns a StringsWatcher that notifies of + changes to the life cycles of the top level machines in the current + model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='WatchModelMachines', + version=4, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachines(self): + ''' + WatchModelMachines returns a StringsWatcher that notifies of + changes to the life cycles of the top level machines in the current + model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='WatchModelMachines', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class ModelGenerationFacade(Type): + name = 'ModelGeneration' + version = 4 + schema = {'definitions': {'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], 'type': 'object'}, 'BranchArg': {'additionalProperties': False, 'properties': {'branch': {'type': 'string'}}, @@ -1517,6 +2088,31 @@ class ModelGenerationFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResult) + def sync_AbortBranch(self, branch=None): + ''' + AbortBranch aborts the input branch, marking it complete. However no + changes are made applicable to the whole model. No units may be assigned + to the branch when aborting. + + branch : str + Returns -> ErrorResult + ''' + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='AbortBranch', + version=4, + params=_params) + _params['branch'] = branch + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResult) async def AbortBranch(self, branch=None): ''' @@ -1542,6 +2138,29 @@ async def AbortBranch(self, branch=None): + @ReturnMapping(ErrorResult) + def sync_AddBranch(self, branch=None): + ''' + AddBranch adds a new branch with the input name to the model. + + branch : str + Returns -> ErrorResult + ''' + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='AddBranch', + version=4, + params=_params) + _params['branch'] = branch + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResult) async def AddBranch(self, branch=None): ''' @@ -1565,6 +2184,37 @@ async def AddBranch(self, branch=None): + @ReturnMapping(BranchResults) + def sync_BranchInfo(self, branches=None, detailed=None): + ''' + BranchInfo will return details of branch identified by the input argument, + including units on the branch and the configuration disjoint with the + master generation. + An error is returned if no in-flight branch matching in input is found. + + branches : typing.Sequence[str] + detailed : bool + Returns -> BranchResults + ''' + if branches is not None and not isinstance(branches, (bytes, str, list)): + raise Exception("Expected branches to be a Sequence, received: {}".format(type(branches))) + + if detailed is not None and not isinstance(detailed, bool): + raise Exception("Expected detailed to be a bool, received: {}".format(type(detailed))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='BranchInfo', + version=4, + params=_params) + _params['branches'] = branches + _params['detailed'] = detailed + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(BranchResults) async def BranchInfo(self, branches=None, detailed=None): ''' @@ -1596,6 +2246,30 @@ async def BranchInfo(self, branches=None, detailed=None): + @ReturnMapping(IntResult) + def sync_CommitBranch(self, branch=None): + ''' + CommitBranch commits the input branch, making its changes applicable to + the whole model and marking it complete. + + branch : str + Returns -> IntResult + ''' + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='CommitBranch', + version=4, + params=_params) + _params['branch'] = branch + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(IntResult) async def CommitBranch(self, branch=None): ''' @@ -1620,6 +2294,30 @@ async def CommitBranch(self, branch=None): + @ReturnMapping(BoolResult) + def sync_HasActiveBranch(self, branch=None): + ''' + HasActiveBranch returns a true result if the input model has an "in-flight" + branch matching the input name. + + branch : str + Returns -> BoolResult + ''' + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='HasActiveBranch', + version=4, + params=_params) + _params['branch'] = branch + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(BoolResult) async def HasActiveBranch(self, branch=None): ''' @@ -1644,6 +2342,27 @@ async def HasActiveBranch(self, branch=None): + @ReturnMapping(BranchResults) + def sync_ListCommits(self): + ''' + ListCommits will return the commits, hence only branches with generation_id higher than 0 + + + Returns -> BranchResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='ListCommits', + version=4, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(BranchResults) async def ListCommits(self): ''' @@ -1665,6 +2384,31 @@ async def ListCommits(self): + @ReturnMapping(GenerationResult) + def sync_ShowCommit(self, generation_id=None): + ''' + ShowCommit will return details a commit given by its generationId + An error is returned if either no branch can be found corresponding to the generation id. + Or the generation id given is below 1. + + generation_id : int + Returns -> GenerationResult + ''' + if generation_id is not None and not isinstance(generation_id, int): + raise Exception("Expected generation_id to be a int, received: {}".format(type(generation_id))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='ShowCommit', + version=4, + params=_params) + _params['generation-id'] = generation_id + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(GenerationResult) async def ShowCommit(self, generation_id=None): ''' @@ -1691,7 +2435,7 @@ async def ShowCommit(self, generation_id=None): @ReturnMapping(ErrorResults) - async def TrackBranch(self, branch=None, entities=None, num_units=None): + def sync_TrackBranch(self, branch=None, entities=None, num_units=None): ''' TrackBranch marks the input units and/or applications as tracking the input branch, causing them to realise changes made under that branch. @@ -1719,33 +2463,67 @@ async def TrackBranch(self, branch=None, entities=None, num_units=None): _params['branch'] = branch _params['entities'] = entities _params['num-units'] = num_units - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply -class SSHClientFacade(Type): - name = 'SSHClient' - version = 4 - 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'}, - 'is-controller-cloud': {'type': 'boolean'}, - 'name': {'type': 'string'}, - 'region': {'type': 'string'}, - 'skip-tls-verify': {'type': 'boolean'}, - 'storage-endpoint': {'type': 'string'}, + @ReturnMapping(ErrorResults) + async def TrackBranch(self, branch=None, entities=None, num_units=None): + ''' + TrackBranch marks the input units and/or applications as tracking the input + branch, causing them to realise changes made under that branch. + + branch : str + entities : typing.Sequence[~Entity] + num_units : int + Returns -> ErrorResults + ''' + if branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + if num_units is not None and not isinstance(num_units, int): + raise Exception("Expected num_units to be a int, received: {}".format(type(num_units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='TrackBranch', + version=4, + params=_params) + _params['branch'] = branch + _params['entities'] = entities + _params['num-units'] = num_units + reply = await self.rpc(msg) + return reply + + + +class SSHClientFacade(Type): + name = 'SSHClient' + version = 4 + 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'}, + 'is-controller-cloud': {'type': 'boolean'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'skip-tls-verify': {'type': 'boolean'}, + 'storage-endpoint': {'type': 'string'}, 'type': {'type': 'string'}}, 'required': ['type', 'name'], 'type': 'object'}, @@ -1856,6 +2634,31 @@ class SSHClientFacade(Type): 'type': 'object'} + @ReturnMapping(SSHAddressesResults) + def sync_AllAddresses(self, entities=None): + ''' + AllAddresses reports all addresses that might have SSH listening for each + entity in args. The result is sorted with public addresses first. + Machines and units are supported as entity types. + + entities : typing.Sequence[~Entity] + Returns -> SSHAddressesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SSHClient', + request='AllAddresses', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SSHAddressesResults) async def AllAddresses(self, entities=None): ''' @@ -1881,6 +2684,28 @@ async def AllAddresses(self, entities=None): + @ReturnMapping(CloudSpecResult) + def sync_ModelCredentialForSSH(self): + ''' + ModelCredentialForSSH returns a cloud spec for ssh purpose. + This facade call is only used for k8s model. + + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SSHClient', + request='ModelCredentialForSSH', + version=4, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CloudSpecResult) async def ModelCredentialForSSH(self): ''' @@ -1903,6 +2728,30 @@ async def ModelCredentialForSSH(self): + @ReturnMapping(SSHAddressResults) + def sync_PrivateAddress(self, entities=None): + ''' + PrivateAddress reports the preferred private network address for one or + more entities. Machines and units are supported. + + entities : typing.Sequence[~Entity] + Returns -> SSHAddressResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SSHClient', + request='PrivateAddress', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SSHAddressResults) async def PrivateAddress(self, entities=None): ''' @@ -1927,6 +2776,28 @@ async def PrivateAddress(self, entities=None): + @ReturnMapping(SSHProxyResult) + def sync_Proxy(self): + ''' + Proxy returns whether SSH connections should be proxied through the + controller hosts for the model associated with the API connection. + + + Returns -> SSHProxyResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SSHClient', + request='Proxy', + version=4, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SSHProxyResult) async def Proxy(self): ''' @@ -1949,6 +2820,30 @@ async def Proxy(self): + @ReturnMapping(SSHAddressResults) + def sync_PublicAddress(self, entities=None): + ''' + PublicAddress reports the preferred public network address for one + or more entities. Machines and units are supported. + + entities : typing.Sequence[~Entity] + Returns -> SSHAddressResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SSHClient', + request='PublicAddress', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SSHAddressResults) async def PublicAddress(self, entities=None): ''' @@ -1973,6 +2868,30 @@ async def PublicAddress(self, entities=None): + @ReturnMapping(SSHPublicKeysResults) + def sync_PublicKeys(self, entities=None): + ''' + PublicKeys returns the public SSH hosts for one or more + entities. Machines and units are supported. + + entities : typing.Sequence[~Entity] + Returns -> SSHPublicKeysResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='SSHClient', + request='PublicKeys', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SSHPublicKeysResults) async def PublicKeys(self, entities=None): ''' @@ -2672,6 +3591,30 @@ class StorageProvisionerFacade(Type): 'type': 'object'} + @ReturnMapping(LifeResults) + def sync_AttachmentLife(self, ids=None): + ''' + AttachmentLife returns the lifecycle state of each specified machine + storage attachment. + + ids : typing.Sequence[~MachineStorageId] + Returns -> LifeResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='AttachmentLife', + version=4, + params=_params) + _params['ids'] = ids + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LifeResults) async def AttachmentLife(self, ids=None): ''' @@ -2696,6 +3639,27 @@ async def AttachmentLife(self, ids=None): + @ReturnMapping(ErrorResults) + def sync_CreateVolumeAttachmentPlans(self, volume_plans=None): + ''' + volume_plans : typing.Sequence[~VolumeAttachmentPlan] + Returns -> ErrorResults + ''' + if volume_plans is not None and not isinstance(volume_plans, (bytes, str, list)): + raise Exception("Expected volume_plans to be a Sequence, received: {}".format(type(volume_plans))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='CreateVolumeAttachmentPlans', + version=4, + params=_params) + _params['volume-plans'] = volume_plans + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def CreateVolumeAttachmentPlans(self, volume_plans=None): ''' @@ -2717,6 +3681,31 @@ async def CreateVolumeAttachmentPlans(self, volume_plans=None): + @ReturnMapping(ErrorResults) + def sync_EnsureDead(self, entities=None): + ''' + EnsureDead calls EnsureDead on each given entity from state. It + will fail if the entity is not present. If it's Alive, nothing will + happen (see state/EnsureDead() for units or machines). + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='EnsureDead', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def EnsureDead(self, entities=None): ''' @@ -2743,7 +3732,7 @@ async def EnsureDead(self, entities=None): @ReturnMapping(FilesystemAttachmentParamsResults) - async def FilesystemAttachmentParams(self, ids=None): + def sync_FilesystemAttachmentParams(self, ids=None): ''' FilesystemAttachmentParams returns the parameters for creating the filesystem attachments with the specified IDs. @@ -2761,15 +3750,62 @@ async def FilesystemAttachmentParams(self, ids=None): version=4, params=_params) _params['ids'] = ids - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(FilesystemAttachmentResults) - async def FilesystemAttachments(self, ids=None): + @ReturnMapping(FilesystemAttachmentParamsResults) + async def FilesystemAttachmentParams(self, ids=None): ''' - FilesystemAttachments returns details of filesystem attachments with the specified IDs. + FilesystemAttachmentParams returns the parameters for creating the filesystem + attachments with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + Returns -> FilesystemAttachmentParamsResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='FilesystemAttachmentParams', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemAttachmentResults) + def sync_FilesystemAttachments(self, ids=None): + ''' + FilesystemAttachments returns details of filesystem attachments with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + Returns -> FilesystemAttachmentResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='FilesystemAttachments', + version=4, + params=_params) + _params['ids'] = ids + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(FilesystemAttachmentResults) + async def FilesystemAttachments(self, ids=None): + ''' + FilesystemAttachments returns details of filesystem attachments with the specified IDs. ids : typing.Sequence[~MachineStorageId] Returns -> FilesystemAttachmentResults @@ -2789,6 +3825,30 @@ async def FilesystemAttachments(self, ids=None): + @ReturnMapping(FilesystemParamsResults) + def sync_FilesystemParams(self, entities=None): + ''' + FilesystemParams returns the parameters for creating the filesystems + with the specified tags. + + entities : typing.Sequence[~Entity] + Returns -> FilesystemParamsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='FilesystemParams', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(FilesystemParamsResults) async def FilesystemParams(self, entities=None): ''' @@ -2813,6 +3873,29 @@ async def FilesystemParams(self, entities=None): + @ReturnMapping(FilesystemResults) + def sync_Filesystems(self, entities=None): + ''' + Filesystems returns details of filesystems with the specified tags. + + entities : typing.Sequence[~Entity] + Returns -> FilesystemResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='Filesystems', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(FilesystemResults) async def Filesystems(self, entities=None): ''' @@ -2836,6 +3919,30 @@ async def Filesystems(self, entities=None): + @ReturnMapping(StringResults) + def sync_InstanceId(self, entities=None): + ''' + InstanceId returns the provider specific instance id for each given + machine or an CodeNotProvisioned error, if not set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='InstanceId', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def InstanceId(self, entities=None): ''' @@ -2860,6 +3967,29 @@ async def InstanceId(self, entities=None): + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='Life', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' @@ -2883,6 +4013,29 @@ async def Life(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_Remove(self, entities=None): + ''' + Remove removes volumes and filesystems from state. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='Remove', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Remove(self, entities=None): ''' @@ -2906,6 +4059,30 @@ async def Remove(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_RemoveAttachment(self, ids=None): + ''' + RemoveAttachment removes the specified machine storage attachments + from state. + + ids : typing.Sequence[~MachineStorageId] + Returns -> ErrorResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='RemoveAttachment', + version=4, + params=_params) + _params['ids'] = ids + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def RemoveAttachment(self, ids=None): ''' @@ -2930,6 +4107,30 @@ async def RemoveAttachment(self, ids=None): + @ReturnMapping(RemoveFilesystemParamsResults) + def sync_RemoveFilesystemParams(self, entities=None): + ''' + RemoveFilesystemParams returns the parameters for destroying or + releasing the filesystems with the specified tags. + + entities : typing.Sequence[~Entity] + Returns -> RemoveFilesystemParamsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='RemoveFilesystemParams', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RemoveFilesystemParamsResults) async def RemoveFilesystemParams(self, entities=None): ''' @@ -2954,6 +4155,27 @@ async def RemoveFilesystemParams(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_RemoveVolumeAttachmentPlan(self, ids=None): + ''' + ids : typing.Sequence[~MachineStorageId] + Returns -> ErrorResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='RemoveVolumeAttachmentPlan', + version=4, + params=_params) + _params['ids'] = ids + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def RemoveVolumeAttachmentPlan(self, ids=None): ''' @@ -2975,6 +4197,30 @@ async def RemoveVolumeAttachmentPlan(self, ids=None): + @ReturnMapping(RemoveVolumeParamsResults) + def sync_RemoveVolumeParams(self, entities=None): + ''' + RemoveVolumeParams returns the parameters for destroying + or releasing the volumes with the specified tags. + + entities : typing.Sequence[~Entity] + Returns -> RemoveVolumeParamsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='RemoveVolumeParams', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RemoveVolumeParamsResults) async def RemoveVolumeParams(self, entities=None): ''' @@ -2999,6 +4245,30 @@ async def RemoveVolumeParams(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetFilesystemAttachmentInfo(self, filesystem_attachments=None): + ''' + SetFilesystemAttachmentInfo records the details of newly provisioned filesystem + attachments. + + filesystem_attachments : typing.Sequence[~FilesystemAttachment] + Returns -> ErrorResults + ''' + if filesystem_attachments is not None and not isinstance(filesystem_attachments, (bytes, str, list)): + raise Exception("Expected filesystem_attachments to be a Sequence, received: {}".format(type(filesystem_attachments))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetFilesystemAttachmentInfo', + version=4, + params=_params) + _params['filesystem-attachments'] = filesystem_attachments + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetFilesystemAttachmentInfo(self, filesystem_attachments=None): ''' @@ -3023,6 +4293,29 @@ async def SetFilesystemAttachmentInfo(self, filesystem_attachments=None): + @ReturnMapping(ErrorResults) + def sync_SetFilesystemInfo(self, filesystems=None): + ''' + SetFilesystemInfo records the details of newly provisioned filesystems. + + filesystems : typing.Sequence[~Filesystem] + Returns -> ErrorResults + ''' + if filesystems is not None and not isinstance(filesystems, (bytes, str, list)): + raise Exception("Expected filesystems to be a Sequence, received: {}".format(type(filesystems))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetFilesystemInfo', + version=4, + params=_params) + _params['filesystems'] = filesystems + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetFilesystemInfo(self, filesystems=None): ''' @@ -3046,6 +4339,29 @@ async def SetFilesystemInfo(self, filesystems=None): + @ReturnMapping(ErrorResults) + def sync_SetStatus(self, entities=None): + ''' + SetStatus sets the status of each given entity. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetStatus', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetStatus(self, entities=None): ''' @@ -3069,6 +4385,30 @@ async def SetStatus(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetVolumeAttachmentInfo(self, volume_attachments=None): + ''' + SetVolumeAttachmentInfo records the details of newly provisioned volume + attachments. + + volume_attachments : typing.Sequence[~VolumeAttachment] + Returns -> ErrorResults + ''' + if volume_attachments is not None and not isinstance(volume_attachments, (bytes, str, list)): + raise Exception("Expected volume_attachments to be a Sequence, received: {}".format(type(volume_attachments))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetVolumeAttachmentInfo', + version=4, + params=_params) + _params['volume-attachments'] = volume_attachments + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetVolumeAttachmentInfo(self, volume_attachments=None): ''' @@ -3093,6 +4433,27 @@ async def SetVolumeAttachmentInfo(self, volume_attachments=None): + @ReturnMapping(ErrorResults) + def sync_SetVolumeAttachmentPlanBlockInfo(self, volume_plans=None): + ''' + volume_plans : typing.Sequence[~VolumeAttachmentPlan] + Returns -> ErrorResults + ''' + if volume_plans is not None and not isinstance(volume_plans, (bytes, str, list)): + raise Exception("Expected volume_plans to be a Sequence, received: {}".format(type(volume_plans))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetVolumeAttachmentPlanBlockInfo', + version=4, + params=_params) + _params['volume-plans'] = volume_plans + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetVolumeAttachmentPlanBlockInfo(self, volume_plans=None): ''' @@ -3114,6 +4475,29 @@ async def SetVolumeAttachmentPlanBlockInfo(self, volume_plans=None): + @ReturnMapping(ErrorResults) + def sync_SetVolumeInfo(self, volumes=None): + ''' + SetVolumeInfo records the details of newly provisioned volumes. + + volumes : typing.Sequence[~Volume] + Returns -> ErrorResults + ''' + if volumes is not None and not isinstance(volumes, (bytes, str, list)): + raise Exception("Expected volumes to be a Sequence, received: {}".format(type(volumes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetVolumeInfo', + version=4, + params=_params) + _params['volumes'] = volumes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetVolumeInfo(self, volumes=None): ''' @@ -3122,29 +4506,122 @@ async def SetVolumeInfo(self, volumes=None): volumes : typing.Sequence[~Volume] Returns -> ErrorResults ''' - if volumes is not None and not isinstance(volumes, (bytes, str, list)): - raise Exception("Expected volumes to be a Sequence, received: {}".format(type(volumes))) + if volumes is not None and not isinstance(volumes, (bytes, str, list)): + raise Exception("Expected volumes to be a Sequence, received: {}".format(type(volumes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetVolumeInfo', + version=4, + params=_params) + _params['volumes'] = volumes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeAttachmentParamsResults) + def sync_VolumeAttachmentParams(self, ids=None): + ''' + VolumeAttachmentParams returns the parameters for creating the volume + attachments with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + Returns -> VolumeAttachmentParamsResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='VolumeAttachmentParams', + version=4, + params=_params) + _params['ids'] = ids + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(VolumeAttachmentParamsResults) + async def VolumeAttachmentParams(self, ids=None): + ''' + VolumeAttachmentParams returns the parameters for creating the volume + attachments with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + Returns -> VolumeAttachmentParamsResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='VolumeAttachmentParams', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeAttachmentPlanResults) + def sync_VolumeAttachmentPlans(self, ids=None): + ''' + VolumeAttachmentPlans returns details of volume attachment plans with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + Returns -> VolumeAttachmentPlanResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='VolumeAttachmentPlans', + version=4, + params=_params) + _params['ids'] = ids + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(VolumeAttachmentPlanResults) + async def VolumeAttachmentPlans(self, ids=None): + ''' + VolumeAttachmentPlans returns details of volume attachment plans with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + Returns -> VolumeAttachmentPlanResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='StorageProvisioner', - request='SetVolumeInfo', + request='VolumeAttachmentPlans', version=4, params=_params) - _params['volumes'] = volumes + _params['ids'] = ids reply = await self.rpc(msg) return reply - @ReturnMapping(VolumeAttachmentParamsResults) - async def VolumeAttachmentParams(self, ids=None): + @ReturnMapping(VolumeAttachmentResults) + def sync_VolumeAttachments(self, ids=None): ''' - VolumeAttachmentParams returns the parameters for creating the volume - attachments with the specified IDs. + VolumeAttachments returns details of volume attachments with the specified IDs. ids : typing.Sequence[~MachineStorageId] - Returns -> VolumeAttachmentParamsResults + Returns -> VolumeAttachmentResults ''' if ids is not None and not isinstance(ids, (bytes, str, list)): raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) @@ -3152,22 +4629,22 @@ async def VolumeAttachmentParams(self, ids=None): # map input types to rpc msg _params = dict() msg = dict(type='StorageProvisioner', - request='VolumeAttachmentParams', + request='VolumeAttachments', version=4, params=_params) _params['ids'] = ids - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(VolumeAttachmentPlanResults) - async def VolumeAttachmentPlans(self, ids=None): + @ReturnMapping(VolumeAttachmentResults) + async def VolumeAttachments(self, ids=None): ''' - VolumeAttachmentPlans returns details of volume attachment plans with the specified IDs. + VolumeAttachments returns details of volume attachments with the specified IDs. ids : typing.Sequence[~MachineStorageId] - Returns -> VolumeAttachmentPlanResults + Returns -> VolumeAttachmentResults ''' if ids is not None and not isinstance(ids, (bytes, str, list)): raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) @@ -3175,7 +4652,7 @@ async def VolumeAttachmentPlans(self, ids=None): # map input types to rpc msg _params = dict() msg = dict(type='StorageProvisioner', - request='VolumeAttachmentPlans', + request='VolumeAttachments', version=4, params=_params) _params['ids'] = ids @@ -3184,13 +4661,14 @@ async def VolumeAttachmentPlans(self, ids=None): - @ReturnMapping(VolumeAttachmentResults) - async def VolumeAttachments(self, ids=None): + @ReturnMapping(BlockDeviceResults) + def sync_VolumeBlockDevices(self, ids=None): ''' - VolumeAttachments returns details of volume attachments with the specified IDs. + VolumeBlockDevices returns details of the block devices corresponding to the + volume attachments with the specified IDs. ids : typing.Sequence[~MachineStorageId] - Returns -> VolumeAttachmentResults + Returns -> BlockDeviceResults ''' if ids is not None and not isinstance(ids, (bytes, str, list)): raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) @@ -3198,11 +4676,11 @@ async def VolumeAttachments(self, ids=None): # map input types to rpc msg _params = dict() msg = dict(type='StorageProvisioner', - request='VolumeAttachments', + request='VolumeBlockDevices', version=4, params=_params) _params['ids'] = ids - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @@ -3231,6 +4709,30 @@ async def VolumeBlockDevices(self, ids=None): + @ReturnMapping(VolumeParamsResults) + def sync_VolumeParams(self, entities=None): + ''' + VolumeParams returns the parameters for creating or destroying + the volumes with the specified tags. + + entities : typing.Sequence[~Entity] + Returns -> VolumeParamsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='VolumeParams', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(VolumeParamsResults) async def VolumeParams(self, entities=None): ''' @@ -3255,6 +4757,29 @@ async def VolumeParams(self, entities=None): + @ReturnMapping(VolumeResults) + def sync_Volumes(self, entities=None): + ''' + Volumes returns details of volumes with the specified tags. + + entities : typing.Sequence[~Entity] + Returns -> VolumeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='Volumes', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(VolumeResults) async def Volumes(self, entities=None): ''' @@ -3278,6 +4803,28 @@ async def Volumes(self, entities=None): + @ReturnMapping(StringsWatchResult) + def sync_WatchApplications(self): + ''' + WatchApplications starts a StringsWatcher to watch CAAS applications + deployed to this model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='WatchApplications', + version=4, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchApplications(self): ''' @@ -3300,6 +4847,29 @@ async def WatchApplications(self): + @ReturnMapping(NotifyWatchResults) + def sync_WatchBlockDevices(self, entities=None): + ''' + WatchBlockDevices watches for changes to the specified machines' block devices. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='WatchBlockDevices', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchBlockDevices(self, entities=None): ''' @@ -3323,6 +4893,30 @@ async def WatchBlockDevices(self, entities=None): + @ReturnMapping(MachineStorageIdsWatchResults) + def sync_WatchFilesystemAttachments(self, entities=None): + ''' + WatchFilesystemAttachments watches for changes to filesystem attachments + scoped to the entity with the tag passed to NewState. + + entities : typing.Sequence[~Entity] + Returns -> MachineStorageIdsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='WatchFilesystemAttachments', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MachineStorageIdsWatchResults) async def WatchFilesystemAttachments(self, entities=None): ''' @@ -3347,6 +4941,30 @@ async def WatchFilesystemAttachments(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchFilesystems(self, entities=None): + ''' + WatchFilesystems watches for changes to filesystems scoped + to the entity with the tag passed to NewState. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='WatchFilesystems', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchFilesystems(self, entities=None): ''' @@ -3371,6 +4989,29 @@ async def WatchFilesystems(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchMachines(self, entities=None): + ''' + WatchMachines watches for changes to the specified machines. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='WatchMachines', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def WatchMachines(self, entities=None): ''' @@ -3394,6 +5035,30 @@ async def WatchMachines(self, entities=None): + @ReturnMapping(MachineStorageIdsWatchResults) + def sync_WatchVolumeAttachmentPlans(self, entities=None): + ''' + WatchVolumeAttachmentPlans watches for changes to volume attachments for a machine for the purpose of allowing + that machine to run any initialization needed, for that volume to actually appear as a block device (ie: iSCSI) + + entities : typing.Sequence[~Entity] + Returns -> MachineStorageIdsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='WatchVolumeAttachmentPlans', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MachineStorageIdsWatchResults) async def WatchVolumeAttachmentPlans(self, entities=None): ''' @@ -3418,6 +5083,30 @@ async def WatchVolumeAttachmentPlans(self, entities=None): + @ReturnMapping(MachineStorageIdsWatchResults) + def sync_WatchVolumeAttachments(self, entities=None): + ''' + WatchVolumeAttachments watches for changes to volume attachments scoped to + the entity with the tag passed to NewState. + + entities : typing.Sequence[~Entity] + Returns -> MachineStorageIdsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='WatchVolumeAttachments', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MachineStorageIdsWatchResults) async def WatchVolumeAttachments(self, entities=None): ''' @@ -3442,6 +5131,30 @@ async def WatchVolumeAttachments(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchVolumes(self, entities=None): + ''' + WatchVolumes watches for changes to volumes scoped to the + entity with the tag passed to NewState. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='WatchVolumes', + version=4, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchVolumes(self, entities=None): ''' diff --git a/juju/client/_client5.py b/juju/client/_client5.py index 8e3ca348..b2d0cd9d 100644 --- a/juju/client/_client5.py +++ b/juju/client/_client5.py @@ -335,6 +335,34 @@ class ApplicationOffersFacade(Type): 'type': 'object'} + @ReturnMapping(ApplicationOffersResults) + def sync_ApplicationOffers(self, bakery_version=None, offer_urls=None): + ''' + ApplicationOffers gets details about remote applications that match given URLs. + + bakery_version : int + offer_urls : typing.Sequence[str] + Returns -> ApplicationOffersResults + ''' + if bakery_version is not None and not isinstance(bakery_version, int): + raise Exception("Expected bakery_version to be a int, received: {}".format(type(bakery_version))) + + if offer_urls is not None and not isinstance(offer_urls, (bytes, str, list)): + raise Exception("Expected offer_urls to be a Sequence, received: {}".format(type(offer_urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='ApplicationOffers', + version=5, + params=_params) + _params['bakery-version'] = bakery_version + _params['offer-urls'] = offer_urls + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationOffersResults) async def ApplicationOffers(self, bakery_version=None, offer_urls=None): ''' @@ -363,6 +391,34 @@ async def ApplicationOffers(self, bakery_version=None, offer_urls=None): + @ReturnMapping(ErrorResults) + def sync_DestroyOffers(self, force=None, offer_urls=None): + ''' + DestroyOffers removes the offers specified by the given URLs, forcing if necessary. + + force : bool + offer_urls : typing.Sequence[str] + Returns -> ErrorResults + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if offer_urls is not None and not isinstance(offer_urls, (bytes, str, list)): + raise Exception("Expected offer_urls to be a Sequence, received: {}".format(type(offer_urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='DestroyOffers', + version=5, + params=_params) + _params['force'] = force + _params['offer-urls'] = offer_urls + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def DestroyOffers(self, force=None, offer_urls=None): ''' @@ -391,6 +447,29 @@ async def DestroyOffers(self, force=None, offer_urls=None): + @ReturnMapping(QueryApplicationOffersResultsV5) + def sync_FindApplicationOffers(self, filters=None): + ''' + FindApplicationOffers gets details about remote applications that match given filter. + + filters : typing.Sequence[~OfferFilter] + Returns -> QueryApplicationOffersResultsV5 + ''' + if filters is not None and not isinstance(filters, (bytes, str, list)): + raise Exception("Expected filters to be a Sequence, received: {}".format(type(filters))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='FindApplicationOffers', + version=5, + params=_params) + _params['Filters'] = filters + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(QueryApplicationOffersResultsV5) async def FindApplicationOffers(self, filters=None): ''' @@ -414,6 +493,35 @@ async def FindApplicationOffers(self, filters=None): + @ReturnMapping(ConsumeOfferDetailsResults) + def sync_GetConsumeDetails(self, offer_urls=None, user_tag=None): + ''' + GetConsumeDetails returns the details necessary to pass to another model + to allow the specified args user to consume the offers represented by the args URLs. + + offer_urls : OfferURLs + user_tag : str + Returns -> ConsumeOfferDetailsResults + ''' + if offer_urls is not None and not isinstance(offer_urls, (dict, OfferURLs)): + raise Exception("Expected offer_urls to be a OfferURLs, received: {}".format(type(offer_urls))) + + if user_tag is not None and not isinstance(user_tag, (bytes, str)): + raise Exception("Expected user_tag to be a str, received: {}".format(type(user_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='GetConsumeDetails', + version=5, + params=_params) + _params['offer-urls'] = offer_urls + _params['user-tag'] = user_tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ConsumeOfferDetailsResults) async def GetConsumeDetails(self, offer_urls=None, user_tag=None): ''' @@ -443,6 +551,30 @@ async def GetConsumeDetails(self, offer_urls=None, user_tag=None): + @ReturnMapping(QueryApplicationOffersResultsV5) + def sync_ListApplicationOffers(self, filters=None): + ''' + ListApplicationOffers gets deployed details about application offers that match given filter. + The results contain details about the deployed applications such as connection count. + + filters : typing.Sequence[~OfferFilter] + Returns -> QueryApplicationOffersResultsV5 + ''' + if filters is not None and not isinstance(filters, (bytes, str, list)): + raise Exception("Expected filters to be a Sequence, received: {}".format(type(filters))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='ListApplicationOffers', + version=5, + params=_params) + _params['Filters'] = filters + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(QueryApplicationOffersResultsV5) async def ListApplicationOffers(self, filters=None): ''' @@ -467,6 +599,29 @@ async def ListApplicationOffers(self, filters=None): + @ReturnMapping(ErrorResults) + def sync_ModifyOfferAccess(self, changes=None): + ''' + ModifyOfferAccess changes the application offer access granted to users. + + changes : typing.Sequence[~ModifyOfferAccess] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='ModifyOfferAccess', + version=5, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ModifyOfferAccess(self, changes=None): ''' @@ -490,6 +645,29 @@ async def ModifyOfferAccess(self, changes=None): + @ReturnMapping(ErrorResults) + def sync_Offer(self, offers=None): + ''' + Offer makes application endpoints available for consumption at a specified URL. + + offers : typing.Sequence[~AddApplicationOffer] + Returns -> ErrorResults + ''' + if offers is not None and not isinstance(offers, (bytes, str, list)): + raise Exception("Expected offers to be a Sequence, received: {}".format(type(offers))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='Offer', + version=5, + params=_params) + _params['Offers'] = offers + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Offer(self, offers=None): ''' @@ -513,6 +691,35 @@ async def Offer(self, offers=None): + @ReturnMapping(RemoteApplicationInfoResults) + def sync_RemoteApplicationInfo(self, bakery_version=None, offer_urls=None): + ''' + RemoteApplicationInfo returns information about the requested remote application. + This call currently has no client side API, only there for the Dashboard at this stage. + + bakery_version : int + offer_urls : typing.Sequence[str] + Returns -> RemoteApplicationInfoResults + ''' + if bakery_version is not None and not isinstance(bakery_version, int): + raise Exception("Expected bakery_version to be a int, received: {}".format(type(bakery_version))) + + if offer_urls is not None and not isinstance(offer_urls, (bytes, str, list)): + raise Exception("Expected offer_urls to be a Sequence, received: {}".format(type(offer_urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationOffers', + request='RemoteApplicationInfo', + version=5, + params=_params) + _params['bakery-version'] = bakery_version + _params['offer-urls'] = offer_urls + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RemoteApplicationInfoResults) async def RemoteApplicationInfo(self, bakery_version=None, offer_urls=None): ''' @@ -827,6 +1034,27 @@ class MachinerFacade(Type): 'type': 'object'} + @ReturnMapping(StringsResult) + def sync_APIAddresses(self): + ''' + APIAddresses returns the list of addresses used to connect to the API. + + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='APIAddresses', + version=5, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsResult) async def APIAddresses(self): ''' @@ -848,6 +1076,27 @@ async def APIAddresses(self): + @ReturnMapping(APIHostPortsResult) + def sync_APIHostPorts(self): + ''' + APIHostPorts returns the API server addresses. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='APIHostPorts', + version=5, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(APIHostPortsResult) async def APIHostPorts(self): ''' @@ -870,7 +1119,7 @@ async def APIHostPorts(self): @ReturnMapping(ErrorResults) - async def EnsureDead(self, entities=None): + def sync_EnsureDead(self, entities=None): ''' EnsureDead calls EnsureDead on each given entity from state. It will fail if the entity is not present. If it's Alive, nothing will @@ -889,18 +1138,20 @@ async def EnsureDead(self, entities=None): version=5, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(JobsResults) - async def Jobs(self, entities=None): + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): ''' - Jobs returns the jobs assigned to the given entities. + EnsureDead calls EnsureDead on each given entity from state. It + will fail if the entity is not present. If it's Alive, nothing will + happen (see state/EnsureDead() for units or machines). entities : typing.Sequence[~Entity] - Returns -> JobsResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -908,7 +1159,7 @@ async def Jobs(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Machiner', - request='Jobs', + request='EnsureDead', version=5, params=_params) _params['entities'] = entities @@ -917,13 +1168,13 @@ async def Jobs(self, entities=None): - @ReturnMapping(LifeResults) - async def Life(self, entities=None): + @ReturnMapping(JobsResults) + def sync_Jobs(self, entities=None): ''' - Life returns the life status of every supplied entity, where available. + Jobs returns the jobs assigned to the given entities. entities : typing.Sequence[~Entity] - Returns -> LifeResults + Returns -> JobsResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -931,18 +1182,111 @@ async def Life(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Machiner', - request='Life', + request='Jobs', version=5, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def RecordAgentStartInformation(self, args=None): - ''' + @ReturnMapping(JobsResults) + async def Jobs(self, entities=None): + ''' + Jobs returns the jobs assigned to the given entities. + + entities : typing.Sequence[~Entity] + Returns -> JobsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='Jobs', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='Life', + version=5, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='Life', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_RecordAgentStartInformation(self, args=None): + ''' + RecordAgentStartInformation syncs the machine model with information + reported by a machine agent when it starts. + + args : typing.Sequence[~RecordAgentStartInformationArg] + Returns -> ErrorResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='RecordAgentStartInformation', + version=5, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RecordAgentStartInformation(self, args=None): + ''' RecordAgentStartInformation syncs the machine model with information reported by a machine agent when it starts. @@ -964,6 +1308,29 @@ async def RecordAgentStartInformation(self, args=None): + @ReturnMapping(ErrorResults) + def sync_RecordAgentStartTime(self, entities=None): + ''' + RecordAgentStartTime updates the agent start time field in the machine doc. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='RecordAgentStartTime', + version=5, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def RecordAgentStartTime(self, entities=None): ''' @@ -987,6 +1354,27 @@ async def RecordAgentStartTime(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_SetMachineAddresses(self, machine_addresses=None): + ''' + machine_addresses : typing.Sequence[~MachineAddresses] + Returns -> ErrorResults + ''' + if machine_addresses is not None and not isinstance(machine_addresses, (bytes, str, list)): + raise Exception("Expected machine_addresses to be a Sequence, received: {}".format(type(machine_addresses))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='SetMachineAddresses', + version=5, + params=_params) + _params['machine-addresses'] = machine_addresses + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetMachineAddresses(self, machine_addresses=None): ''' @@ -1008,6 +1396,37 @@ async def SetMachineAddresses(self, machine_addresses=None): + @ReturnMapping(None) + def sync_SetObservedNetworkConfig(self, config=None, tag=None): + ''' + SetObservedNetworkConfig reads the network config for the machine + identified by the input args. + This config is merged with the new network config supplied in the + same args and updated if it has changed. + + config : typing.Sequence[~NetworkConfig] + tag : str + Returns -> None + ''' + if config is not None and not isinstance(config, (bytes, str, list)): + raise Exception("Expected config to be a Sequence, received: {}".format(type(config))) + + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='SetObservedNetworkConfig', + version=5, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def SetObservedNetworkConfig(self, config=None, tag=None): ''' @@ -1039,6 +1458,29 @@ async def SetObservedNetworkConfig(self, config=None, tag=None): + @ReturnMapping(ErrorResults) + def sync_SetStatus(self, entities=None): + ''' + SetStatus sets the status of each given entity. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='SetStatus', + version=5, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetStatus(self, entities=None): ''' @@ -1062,6 +1504,29 @@ async def SetStatus(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='Watch', + version=5, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResults) async def Watch(self, entities=None): ''' @@ -1085,6 +1550,27 @@ async def Watch(self, entities=None): + @ReturnMapping(NotifyWatchResult) + def sync_WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='WatchAPIHostPorts', + version=5, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchAPIHostPorts(self): ''' @@ -1213,6 +1699,29 @@ class SubnetsFacade(Type): 'type': 'object'} + @ReturnMapping(ZoneResults) + def sync_AllZones(self): + ''' + AllZones returns all availability zones known to Juju. If a + zone is unusable, unavailable, or deprecated the Available + field will be false. + + + Returns -> ZoneResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Subnets', + request='AllZones', + version=5, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ZoneResults) async def AllZones(self): ''' @@ -1236,6 +1745,35 @@ async def AllZones(self): + @ReturnMapping(ListSubnetsResults) + def sync_ListSubnets(self, space_tag=None, zone=None): + ''' + ListSubnets returns the matching subnets after applying + optional filters. + + space_tag : str + zone : str + Returns -> ListSubnetsResults + ''' + if space_tag is not None and not isinstance(space_tag, (bytes, str)): + raise Exception("Expected space_tag to be a str, received: {}".format(type(space_tag))) + + if zone is not None and not isinstance(zone, (bytes, str)): + raise Exception("Expected zone to be a str, received: {}".format(type(zone))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Subnets', + request='ListSubnets', + version=5, + params=_params) + _params['space-tag'] = space_tag + _params['zone'] = zone + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ListSubnetsResults) async def ListSubnets(self, space_tag=None, zone=None): ''' @@ -1265,6 +1803,29 @@ async def ListSubnets(self, space_tag=None, zone=None): + @ReturnMapping(SubnetsResults) + def sync_SubnetsByCIDR(self, cidrs=None): + ''' + SubnetsByCIDR returns the collection of subnets matching each CIDR in the input. + + cidrs : typing.Sequence[str] + Returns -> SubnetsResults + ''' + if cidrs is not None and not isinstance(cidrs, (bytes, str, list)): + raise Exception("Expected cidrs to be a Sequence, received: {}".format(type(cidrs))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Subnets', + request='SubnetsByCIDR', + version=5, + params=_params) + _params['cidrs'] = cidrs + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(SubnetsResults) async def SubnetsByCIDR(self, cidrs=None): ''' diff --git a/juju/client/_client6.py b/juju/client/_client6.py index 95b3ca84..cac79dbf 100644 --- a/juju/client/_client6.py +++ b/juju/client/_client6.py @@ -109,6 +109,34 @@ class BundleFacade(Type): 'type': 'object'} + @ReturnMapping(StringResult) + def sync_ExportBundle(self, include_charm_defaults=None, include_series=None): + ''' + ExportBundle exports the current model configuration as bundle. + + include_charm_defaults : bool + include_series : bool + Returns -> StringResult + ''' + if include_charm_defaults is not None and not isinstance(include_charm_defaults, bool): + raise Exception("Expected include_charm_defaults to be a bool, received: {}".format(type(include_charm_defaults))) + + if include_series is not None and not isinstance(include_series, bool): + raise Exception("Expected include_series to be a bool, received: {}".format(type(include_series))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Bundle', + request='ExportBundle', + version=6, + params=_params) + _params['include-charm-defaults'] = include_charm_defaults + _params['include-series'] = include_series + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResult) async def ExportBundle(self, include_charm_defaults=None, include_series=None): ''' @@ -137,6 +165,39 @@ async def ExportBundle(self, include_charm_defaults=None, include_series=None): + @ReturnMapping(BundleChangesResults) + def sync_GetChanges(self, bundleurl=None, yaml=None): + ''' + GetChanges returns the list of changes required to deploy the given bundle + data. The changes are sorted by requirements, so that they can be applied in + order. + GetChanges has been superseded in favour of GetChangesMapArgs. It's + preferable to use that new method to add new functionality and move clients + away from this one. + + bundleurl : str + yaml : str + Returns -> BundleChangesResults + ''' + if bundleurl is not None and not isinstance(bundleurl, (bytes, str)): + raise Exception("Expected bundleurl to be a str, received: {}".format(type(bundleurl))) + + if yaml is not None and not isinstance(yaml, (bytes, str)): + raise Exception("Expected yaml to be a str, received: {}".format(type(yaml))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Bundle', + request='GetChanges', + version=6, + params=_params) + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(BundleChangesResults) async def GetChanges(self, bundleurl=None, yaml=None): ''' @@ -170,6 +231,37 @@ async def GetChanges(self, bundleurl=None, yaml=None): + @ReturnMapping(BundleChangesMapArgsResults) + def sync_GetChangesMapArgs(self, bundleurl=None, yaml=None): + ''' + GetChangesMapArgs returns the list of changes required to deploy the given + bundle data. The changes are sorted by requirements, so that they can be + applied in order. + V4 GetChangesMapArgs is not supported on anything less than v4 + + bundleurl : str + yaml : str + Returns -> BundleChangesMapArgsResults + ''' + if bundleurl is not None and not isinstance(bundleurl, (bytes, str)): + raise Exception("Expected bundleurl to be a str, received: {}".format(type(bundleurl))) + + if yaml is not None and not isinstance(yaml, (bytes, str)): + raise Exception("Expected yaml to be a str, received: {}".format(type(yaml))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Bundle', + request='GetChangesMapArgs', + version=6, + params=_params) + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(BundleChangesMapArgsResults) async def GetChangesMapArgs(self, bundleurl=None, yaml=None): ''' @@ -634,6 +726,41 @@ class CharmsFacade(Type): 'type': 'object'} + @ReturnMapping(CharmOriginResult) + def sync_AddCharm(self, charm_origin=None, force=None, url=None): + ''' + AddCharm adds the given charm URL (which must include revision) to the + environment, if it does not exist yet. Local charms are not supported, + only charm store and charm hub URLs. See also AddLocalCharm(). + + charm_origin : CharmOrigin + force : bool + url : str + Returns -> CharmOriginResult + ''' + if charm_origin is not None and not isinstance(charm_origin, (dict, CharmOrigin)): + raise Exception("Expected charm_origin to be a CharmOrigin, received: {}".format(type(charm_origin))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='AddCharm', + version=6, + params=_params) + _params['charm-origin'] = charm_origin + _params['force'] = force + _params['url'] = url + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CharmOriginResult) async def AddCharm(self, charm_origin=None, force=None, url=None): ''' @@ -669,6 +796,29 @@ async def AddCharm(self, charm_origin=None, force=None, url=None): + @ReturnMapping(Charm) + def sync_CharmInfo(self, url=None): + ''' + CharmInfo returns information about the requested charm. + + url : str + Returns -> Charm + ''' + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='CharmInfo', + version=6, + params=_params) + _params['url'] = url + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(Charm) async def CharmInfo(self, url=None): ''' @@ -692,6 +842,30 @@ async def CharmInfo(self, url=None): + @ReturnMapping(ErrorResults) + def sync_CheckCharmPlacement(self, placements=None): + ''' + CheckCharmPlacement checks if a charm is allowed to be placed with in a + given application. + + placements : typing.Sequence[~ApplicationCharmPlacement] + Returns -> ErrorResults + ''' + if placements is not None and not isinstance(placements, (bytes, str, list)): + raise Exception("Expected placements to be a Sequence, received: {}".format(type(placements))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='CheckCharmPlacement', + version=6, + params=_params) + _params['placements'] = placements + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def CheckCharmPlacement(self, placements=None): ''' @@ -716,6 +890,30 @@ async def CheckCharmPlacement(self, placements=None): + @ReturnMapping(DownloadInfoResults) + def sync_GetDownloadInfos(self, entities=None): + ''' + GetDownloadInfos attempts to get the bundle corresponding to the charm url + and origin. + + entities : typing.Sequence[~CharmURLAndOrigin] + Returns -> DownloadInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='GetDownloadInfos', + version=6, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(DownloadInfoResults) async def GetDownloadInfos(self, entities=None): ''' @@ -740,6 +938,29 @@ async def GetDownloadInfos(self, entities=None): + @ReturnMapping(IsMeteredResult) + def sync_IsMetered(self, url=None): + ''' + IsMetered returns whether or not the charm is metered. + + url : str + Returns -> IsMeteredResult + ''' + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='IsMetered', + version=6, + params=_params) + _params['url'] = url + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(IsMeteredResult) async def IsMetered(self, url=None): ''' @@ -763,6 +984,31 @@ async def IsMetered(self, url=None): + @ReturnMapping(CharmsListResult) + def sync_List(self, names=None): + ''' + List returns a list of charm URLs currently in the state. + If supplied parameter contains any names, the result will + be filtered to return only the charms with supplied names. + + names : typing.Sequence[str] + Returns -> CharmsListResult + ''' + if names is not None and not isinstance(names, (bytes, str, list)): + raise Exception("Expected names to be a Sequence, received: {}".format(type(names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='List', + version=6, + params=_params) + _params['names'] = names + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CharmsListResult) async def List(self, names=None): ''' @@ -788,6 +1034,29 @@ async def List(self, names=None): + @ReturnMapping(CharmResourcesResults) + def sync_ListCharmResources(self, entities=None): + ''' + ListCharmResources returns a series of resources for a given charm. + + entities : typing.Sequence[~CharmURLAndOrigin] + Returns -> CharmResourcesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='ListCharmResources', + version=6, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CharmResourcesResults) async def ListCharmResources(self, entities=None): ''' @@ -812,7 +1081,7 @@ async def ListCharmResources(self, entities=None): @ReturnMapping(ResolveCharmWithChannelResults) - async def ResolveCharms(self, macaroon=None, resolve=None): + def sync_ResolveCharms(self, macaroon=None, resolve=None): ''' ResolveCharms resolves the given charm URLs with an optionally specified preferred channel. Channel provided via CharmOrigin. @@ -835,16 +1104,45 @@ async def ResolveCharms(self, macaroon=None, resolve=None): params=_params) _params['macaroon'] = macaroon _params['resolve'] = resolve - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply -class ClientFacade(Type): - name = 'Client' - version = 6 - schema = {'definitions': {'AllWatcherId': {'additionalProperties': False, - 'properties': {'watcher-id': {'type': 'string'}}, + @ReturnMapping(ResolveCharmWithChannelResults) + async def ResolveCharms(self, macaroon=None, resolve=None): + ''' + ResolveCharms resolves the given charm URLs with an optionally specified + preferred channel. Channel provided via CharmOrigin. + + macaroon : Macaroon + resolve : typing.Sequence[~ResolveCharmWithChannel] + Returns -> ResolveCharmWithChannelResults + ''' + if macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): + raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) + + if resolve is not None and not isinstance(resolve, (bytes, str, list)): + raise Exception("Expected resolve to be a Sequence, received: {}".format(type(resolve))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='ResolveCharms', + version=6, + params=_params) + _params['macaroon'] = macaroon + _params['resolve'] = resolve + reply = await self.rpc(msg) + return reply + + + +class ClientFacade(Type): + name = 'Client' + version = 6 + schema = {'definitions': {'AllWatcherId': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, 'required': ['watcher-id'], 'type': 'object'}, 'ApplicationOfferStatus': {'additionalProperties': False, @@ -1275,6 +1573,50 @@ class ClientFacade(Type): 'type': 'object'} + @ReturnMapping(FindToolsResult) + def sync_FindTools(self, agentstream=None, arch=None, major=None, number=None, os_type=None): + ''' + FindTools returns a List containing all tools matching the given parameters. + TODO(juju 3.1) - remove, used by 2.9 client only + + agentstream : str + arch : str + major : int + number : Number + os_type : str + Returns -> FindToolsResult + ''' + if agentstream is not None and not isinstance(agentstream, (bytes, str)): + raise Exception("Expected agentstream to be a str, received: {}".format(type(agentstream))) + + if arch is not None and not isinstance(arch, (bytes, str)): + raise Exception("Expected arch to be a str, received: {}".format(type(arch))) + + if major is not None and not isinstance(major, int): + raise Exception("Expected major to be a int, received: {}".format(type(major))) + + if number is not None and not isinstance(number, (dict, Number)): + raise Exception("Expected number to be a Number, received: {}".format(type(number))) + + if os_type is not None and not isinstance(os_type, (bytes, str)): + raise Exception("Expected os_type to be a str, received: {}".format(type(os_type))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='FindTools', + version=6, + params=_params) + _params['agentstream'] = agentstream + _params['arch'] = arch + _params['major'] = major + _params['number'] = number + _params['os-type'] = os_type + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(FindToolsResult) async def FindTools(self, agentstream=None, arch=None, major=None, number=None, os_type=None): ''' @@ -1319,6 +1661,29 @@ async def FindTools(self, agentstream=None, arch=None, major=None, number=None, + @ReturnMapping(FullStatus) + def sync_FullStatus(self, patterns=None): + ''' + FullStatus gives the information needed for juju status over the api + + patterns : typing.Sequence[str] + Returns -> FullStatus + ''' + if patterns is not None and not isinstance(patterns, (bytes, str, list)): + raise Exception("Expected patterns to be a Sequence, received: {}".format(type(patterns))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='FullStatus', + version=6, + params=_params) + _params['patterns'] = patterns + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(FullStatus) async def FullStatus(self, patterns=None): ''' @@ -1342,6 +1707,29 @@ async def FullStatus(self, patterns=None): + @ReturnMapping(StatusHistoryResults) + def sync_StatusHistory(self, requests=None): + ''' + StatusHistory returns a slice of past statuses for several entities. + + requests : typing.Sequence[~StatusHistoryRequest] + Returns -> StatusHistoryResults + ''' + if requests is not None and not isinstance(requests, (bytes, str, list)): + raise Exception("Expected requests to be a Sequence, received: {}".format(type(requests))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='StatusHistory', + version=6, + params=_params) + _params['requests'] = requests + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StatusHistoryResults) async def StatusHistory(self, requests=None): ''' @@ -1365,6 +1753,27 @@ async def StatusHistory(self, requests=None): + @ReturnMapping(AllWatcherId) + def sync_WatchAll(self): + ''' + WatchAll initiates a watcher for entities in the connected model. + + + Returns -> AllWatcherId + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='WatchAll', + version=6, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AllWatcherId) async def WatchAll(self): ''' @@ -1584,6 +1993,30 @@ class SpacesFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_CreateSpaces(self, spaces=None): + ''' + CreateSpaces creates a new Juju network space, associating the + specified subnets with it (optional; can be empty). + + spaces : typing.Sequence[~CreateSpaceParams] + Returns -> ErrorResults + ''' + if spaces is not None and not isinstance(spaces, (bytes, str, list)): + raise Exception("Expected spaces to be a Sequence, received: {}".format(type(spaces))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Spaces', + request='CreateSpaces', + version=6, + params=_params) + _params['spaces'] = spaces + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def CreateSpaces(self, spaces=None): ''' @@ -1608,6 +2041,27 @@ async def CreateSpaces(self, spaces=None): + @ReturnMapping(ListSpacesResults) + def sync_ListSpaces(self): + ''' + ListSpaces lists all the available spaces and their associated subnets. + + + Returns -> ListSpacesResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Spaces', + request='ListSpaces', + version=6, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ListSpacesResults) async def ListSpaces(self): ''' @@ -1629,6 +2083,29 @@ async def ListSpaces(self): + @ReturnMapping(MoveSubnetsResults) + def sync_MoveSubnets(self, args=None): + ''' + MoveSubnets ensures that the input subnets are in the input space. + + args : typing.Sequence[~MoveSubnetsParam] + Returns -> MoveSubnetsResults + ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Spaces', + request='MoveSubnets', + version=6, + params=_params) + _params['args'] = args + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MoveSubnetsResults) async def MoveSubnets(self, args=None): ''' @@ -1652,6 +2129,27 @@ async def MoveSubnets(self, args=None): + @ReturnMapping(None) + def sync_ReloadSpaces(self): + ''' + ReloadSpaces refreshes spaces from substrate + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Spaces', + request='ReloadSpaces', + version=6, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def ReloadSpaces(self): ''' @@ -1673,6 +2171,30 @@ async def ReloadSpaces(self): + @ReturnMapping(RemoveSpaceResults) + def sync_RemoveSpace(self, space_param=None): + ''' + RemoveSpace removes a space. + Returns SpaceResults if entities/settings are found which makes the deletion not possible. + + space_param : typing.Sequence[~RemoveSpaceParam] + Returns -> RemoveSpaceResults + ''' + if space_param is not None and not isinstance(space_param, (bytes, str, list)): + raise Exception("Expected space_param to be a Sequence, received: {}".format(type(space_param))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Spaces', + request='RemoveSpace', + version=6, + params=_params) + _params['space-param'] = space_param + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(RemoveSpaceResults) async def RemoveSpace(self, space_param=None): ''' @@ -1698,7 +2220,7 @@ async def RemoveSpace(self, space_param=None): @ReturnMapping(ErrorResults) - async def RenameSpace(self, changes=None): + def sync_RenameSpace(self, changes=None): ''' RenameSpace renames a space. @@ -1715,21 +2237,67 @@ async def RenameSpace(self, changes=None): version=6, params=_params) _params['changes'] = changes - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ShowSpaceResults) - async def ShowSpace(self, entities=None): + @ReturnMapping(ErrorResults) + async def RenameSpace(self, changes=None): ''' - ShowSpace shows the spaces for a set of given entities. + RenameSpace renames a space. - entities : typing.Sequence[~Entity] - Returns -> ShowSpaceResults + changes : typing.Sequence[~RenameSpaceParams] + Returns -> ErrorResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Spaces', + request='RenameSpace', + version=6, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ShowSpaceResults) + def sync_ShowSpace(self, entities=None): + ''' + ShowSpace shows the spaces for a set of given entities. + + entities : typing.Sequence[~Entity] + Returns -> ShowSpaceResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Spaces', + request='ShowSpace', + version=6, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ShowSpaceResults) + async def ShowSpace(self, entities=None): + ''' + ShowSpace shows the spaces for a set of given entities. + + entities : typing.Sequence[~Entity] + Returns -> ShowSpaceResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() @@ -2196,6 +2764,30 @@ class StorageFacade(Type): 'type': 'object'} + @ReturnMapping(AddStorageResults) + def sync_AddToUnit(self, storages=None): + ''' + AddToUnit validates and creates additional storage instances for units. + A "CHANGE" block can block this operation. + + storages : typing.Sequence[~StorageAddParams] + Returns -> AddStorageResults + ''' + if storages is not None and not isinstance(storages, (bytes, str, list)): + raise Exception("Expected storages to be a Sequence, received: {}".format(type(storages))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='AddToUnit', + version=6, + params=_params) + _params['storages'] = storages + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AddStorageResults) async def AddToUnit(self, storages=None): ''' @@ -2220,6 +2812,30 @@ async def AddToUnit(self, storages=None): + @ReturnMapping(ErrorResults) + def sync_Attach(self, ids=None): + ''' + Attach attaches existing storage instances to units. + A "CHANGE" block can block this operation. + + ids : typing.Sequence[~StorageAttachmentId] + Returns -> ErrorResults + ''' + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='Attach', + version=6, + params=_params) + _params['ids'] = ids + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Attach(self, ids=None): ''' @@ -2244,6 +2860,29 @@ async def Attach(self, ids=None): + @ReturnMapping(ErrorResults) + def sync_CreatePool(self, pools=None): + ''' + CreatePool creates a new pool with specified parameters. + + pools : typing.Sequence[~StoragePool] + Returns -> ErrorResults + ''' + if pools is not None and not isinstance(pools, (bytes, str, list)): + raise Exception("Expected pools to be a Sequence, received: {}".format(type(pools))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='CreatePool', + version=6, + params=_params) + _params['pools'] = pools + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def CreatePool(self, pools=None): ''' @@ -2267,6 +2906,41 @@ async def CreatePool(self, pools=None): + @ReturnMapping(ErrorResults) + def sync_DetachStorage(self, force=None, ids=None, max_wait=None): + ''' + DetachStorage sets the specified storage attachments to Dying, unless they are + already Dying or Dead. Any associated, persistent storage will remain + alive. This call can be forced. + + force : bool + ids : StorageAttachmentIds + max_wait : int + Returns -> ErrorResults + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if ids is not None and not isinstance(ids, (dict, StorageAttachmentIds)): + raise Exception("Expected ids to be a StorageAttachmentIds, received: {}".format(type(ids))) + + if max_wait is not None and not isinstance(max_wait, int): + raise Exception("Expected max_wait to be a int, received: {}".format(type(max_wait))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='DetachStorage', + version=6, + params=_params) + _params['force'] = force + _params['ids'] = ids + _params['max-wait'] = max_wait + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def DetachStorage(self, force=None, ids=None, max_wait=None): ''' @@ -2302,6 +2976,30 @@ async def DetachStorage(self, force=None, ids=None, max_wait=None): + @ReturnMapping(ImportStorageResults) + def sync_Import(self, storage=None): + ''' + Import imports existing storage into the model. + A "CHANGE" block can block this operation. + + storage : typing.Sequence[~ImportStorageParams] + Returns -> ImportStorageResults + ''' + if storage is not None and not isinstance(storage, (bytes, str, list)): + raise Exception("Expected storage to be a Sequence, received: {}".format(type(storage))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='Import', + version=6, + params=_params) + _params['storage'] = storage + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ImportStorageResults) async def Import(self, storage=None): ''' @@ -2326,6 +3024,31 @@ async def Import(self, storage=None): + @ReturnMapping(FilesystemDetailsListResults) + def sync_ListFilesystems(self, filters=None): + ''' + ListFilesystems returns a list of filesystems in the environment matching + the provided filter. Each result describes a filesystem in detail, including + the filesystem's attachments. + + filters : typing.Sequence[~FilesystemFilter] + Returns -> FilesystemDetailsListResults + ''' + if filters is not None and not isinstance(filters, (bytes, str, list)): + raise Exception("Expected filters to be a Sequence, received: {}".format(type(filters))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='ListFilesystems', + version=6, + params=_params) + _params['filters'] = filters + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(FilesystemDetailsListResults) async def ListFilesystems(self, filters=None): ''' @@ -2351,6 +3074,36 @@ async def ListFilesystems(self, filters=None): + @ReturnMapping(StoragePoolsResults) + def sync_ListPools(self, filters=None): + ''' + ListPools returns a list of pools. + If filter is provided, returned list only contains pools that match + the filter. + Pools can be filtered on names and provider types. + If both names and types are provided as filter, + pools that match either are returned. + This method lists union of pools and environment provider types. + If no filter is provided, all pools are returned. + + filters : typing.Sequence[~StoragePoolFilter] + Returns -> StoragePoolsResults + ''' + if filters is not None and not isinstance(filters, (bytes, str, list)): + raise Exception("Expected filters to be a Sequence, received: {}".format(type(filters))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='ListPools', + version=6, + params=_params) + _params['filters'] = filters + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StoragePoolsResults) async def ListPools(self, filters=None): ''' @@ -2381,6 +3134,29 @@ async def ListPools(self, filters=None): + @ReturnMapping(StorageDetailsListResults) + def sync_ListStorageDetails(self, filters=None): + ''' + ListStorageDetails returns storage matching a filter. + + filters : typing.Sequence[~StorageFilter] + Returns -> StorageDetailsListResults + ''' + if filters is not None and not isinstance(filters, (bytes, str, list)): + raise Exception("Expected filters to be a Sequence, received: {}".format(type(filters))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='ListStorageDetails', + version=6, + params=_params) + _params['filters'] = filters + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StorageDetailsListResults) async def ListStorageDetails(self, filters=None): ''' @@ -2404,6 +3180,31 @@ async def ListStorageDetails(self, filters=None): + @ReturnMapping(VolumeDetailsListResults) + def sync_ListVolumes(self, filters=None): + ''' + ListVolumes lists volumes with the given filters. Each filter produces + an independent list of volumes, or an error if the filter is invalid + or the volumes could not be listed. + + filters : typing.Sequence[~VolumeFilter] + Returns -> VolumeDetailsListResults + ''' + if filters is not None and not isinstance(filters, (bytes, str, list)): + raise Exception("Expected filters to be a Sequence, received: {}".format(type(filters))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='ListVolumes', + version=6, + params=_params) + _params['filters'] = filters + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(VolumeDetailsListResults) async def ListVolumes(self, filters=None): ''' @@ -2429,6 +3230,33 @@ async def ListVolumes(self, filters=None): + @ReturnMapping(ErrorResults) + def sync_Remove(self, storage=None): + ''' + Remove sets the specified storage entities to Dying, unless they are + already Dying or Dead, such that the storage will eventually be removed + from the model. If the arguments specify that the storage should be + destroyed, then the associated cloud storage will be destroyed first; + otherwise it will only be released from Juju's control. + + storage : typing.Sequence[~RemoveStorageInstance] + Returns -> ErrorResults + ''' + if storage is not None and not isinstance(storage, (bytes, str, list)): + raise Exception("Expected storage to be a Sequence, received: {}".format(type(storage))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='Remove', + version=6, + params=_params) + _params['storage'] = storage + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def Remove(self, storage=None): ''' @@ -2456,6 +3284,29 @@ async def Remove(self, storage=None): + @ReturnMapping(ErrorResults) + def sync_RemovePool(self, pools=None): + ''' + RemovePool deletes the named pool + + pools : typing.Sequence[~StoragePoolDeleteArg] + Returns -> ErrorResults + ''' + if pools is not None and not isinstance(pools, (bytes, str, list)): + raise Exception("Expected pools to be a Sequence, received: {}".format(type(pools))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='RemovePool', + version=6, + params=_params) + _params['pools'] = pools + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def RemovePool(self, pools=None): ''' @@ -2479,6 +3330,31 @@ async def RemovePool(self, pools=None): + @ReturnMapping(StorageDetailsResults) + def sync_StorageDetails(self, entities=None): + ''' + StorageDetails retrieves and returns detailed information about desired + storage identified by supplied tags. If specified storage cannot be + retrieved, individual error is returned instead of storage information. + + entities : typing.Sequence[~Entity] + Returns -> StorageDetailsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='StorageDetails', + version=6, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StorageDetailsResults) async def StorageDetails(self, entities=None): ''' @@ -2504,6 +3380,29 @@ async def StorageDetails(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_UpdatePool(self, pools=None): + ''' + UpdatePool deletes the named pool + + pools : typing.Sequence[~StoragePool] + Returns -> ErrorResults + ''' + if pools is not None and not isinstance(pools, (bytes, str, list)): + raise Exception("Expected pools to be a Sequence, received: {}".format(type(pools))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='UpdatePool', + version=6, + params=_params) + _params['pools'] = pools + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UpdatePool(self, pools=None): ''' diff --git a/juju/client/_client7.py b/juju/client/_client7.py index 66fe3815..44237e5f 100644 --- a/juju/client/_client7.py +++ b/juju/client/_client7.py @@ -219,6 +219,30 @@ class ActionFacade(Type): 'type': 'object'} + @ReturnMapping(ActionResults) + def sync_Actions(self, entities=None): + ''' + Actions takes a list of ActionTags, and returns the full Action for + each ID. + + entities : typing.Sequence[~Entity] + Returns -> ActionResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='Actions', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ActionResults) async def Actions(self, entities=None): ''' @@ -243,6 +267,30 @@ async def Actions(self, entities=None): + @ReturnMapping(ApplicationsCharmActionsResults) + def sync_ApplicationsCharmsActions(self, entities=None): + ''' + ApplicationsCharmsActions returns a slice of charm Actions for a slice of + services. + + entities : typing.Sequence[~Entity] + Returns -> ApplicationsCharmActionsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='ApplicationsCharmsActions', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ApplicationsCharmActionsResults) async def ApplicationsCharmsActions(self, entities=None): ''' @@ -267,6 +315,29 @@ async def ApplicationsCharmsActions(self, entities=None): + @ReturnMapping(ActionResults) + def sync_Cancel(self, entities=None): + ''' + Cancel attempts to cancel enqueued Actions from running. + + entities : typing.Sequence[~Entity] + Returns -> ActionResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='Cancel', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ActionResults) async def Cancel(self, entities=None): ''' @@ -290,6 +361,31 @@ async def Cancel(self, entities=None): + @ReturnMapping(EnqueuedActions) + def sync_EnqueueOperation(self, actions=None): + ''' + EnqueueOperation takes a list of Actions and queues them up to be executed as + an operation, each action running as a task on the designated ActionReceiver. + We return the ID of the overall operation and each individual task. + + actions : typing.Sequence[~Action] + Returns -> EnqueuedActions + ''' + if actions is not None and not isinstance(actions, (bytes, str, list)): + raise Exception("Expected actions to be a Sequence, received: {}".format(type(actions))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='EnqueueOperation', + version=7, + params=_params) + _params['actions'] = actions + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(EnqueuedActions) async def EnqueueOperation(self, actions=None): ''' @@ -315,6 +411,59 @@ async def EnqueueOperation(self, actions=None): + @ReturnMapping(OperationResults) + def sync_ListOperations(self, actions=None, applications=None, limit=None, machines=None, offset=None, status=None, units=None): + ''' + ListOperations fetches the called actions for specified apps/units. + + actions : typing.Sequence[str] + applications : typing.Sequence[str] + limit : int + machines : typing.Sequence[str] + offset : int + status : typing.Sequence[str] + units : typing.Sequence[str] + Returns -> OperationResults + ''' + if actions is not None and not isinstance(actions, (bytes, str, list)): + raise Exception("Expected actions to be a Sequence, received: {}".format(type(actions))) + + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + if limit is not None and not isinstance(limit, int): + raise Exception("Expected limit to be a int, received: {}".format(type(limit))) + + if machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + if offset is not None and not isinstance(offset, int): + raise Exception("Expected offset to be a int, received: {}".format(type(offset))) + + if status is not None and not isinstance(status, (bytes, str, list)): + raise Exception("Expected status to be a Sequence, received: {}".format(type(status))) + + if units is not None and not isinstance(units, (bytes, str, list)): + raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='ListOperations', + version=7, + params=_params) + _params['actions'] = actions + _params['applications'] = applications + _params['limit'] = limit + _params['machines'] = machines + _params['offset'] = offset + _params['status'] = status + _params['units'] = units + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(OperationResults) async def ListOperations(self, actions=None, applications=None, limit=None, machines=None, offset=None, status=None, units=None): ''' @@ -368,6 +517,29 @@ async def ListOperations(self, actions=None, applications=None, limit=None, mach + @ReturnMapping(OperationResults) + def sync_Operations(self, entities=None): + ''' + Operations fetches the specified operation ids. + + entities : typing.Sequence[~Entity] + Returns -> OperationResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='Operations', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(OperationResults) async def Operations(self, entities=None): ''' @@ -392,7 +564,7 @@ async def Operations(self, entities=None): @ReturnMapping(EnqueuedActions) - async def Run(self, applications=None, commands=None, execution_group=None, machines=None, parallel=None, timeout=None, units=None, workload_context=None): + def sync_Run(self, applications=None, commands=None, execution_group=None, machines=None, parallel=None, timeout=None, units=None, workload_context=None): ''' Run the commands specified on the machines identified through the list of machines, units and services. @@ -445,15 +617,16 @@ async def Run(self, applications=None, commands=None, execution_group=None, mach _params['timeout'] = timeout _params['units'] = units _params['workload-context'] = workload_context - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(EnqueuedActions) - async def RunOnAllMachines(self, applications=None, commands=None, execution_group=None, machines=None, parallel=None, timeout=None, units=None, workload_context=None): + async def Run(self, applications=None, commands=None, execution_group=None, machines=None, parallel=None, timeout=None, units=None, workload_context=None): ''' - RunOnAllMachines attempts to run the specified command on all the machines. + Run the commands specified on the machines identified through the + list of machines, units and services. applications : typing.Sequence[str] commands : str @@ -492,7 +665,7 @@ async def RunOnAllMachines(self, applications=None, commands=None, execution_gro # map input types to rpc msg _params = dict() msg = dict(type='Action', - request='RunOnAllMachines', + request='Run', version=7, params=_params) _params['applications'] = applications @@ -508,63 +681,202 @@ async def RunOnAllMachines(self, applications=None, commands=None, execution_gro - @ReturnMapping(StringsWatchResults) - async def WatchActionsProgress(self, entities=None): + @ReturnMapping(EnqueuedActions) + def sync_RunOnAllMachines(self, applications=None, commands=None, execution_group=None, machines=None, parallel=None, timeout=None, units=None, workload_context=None): ''' - WatchActionsProgress creates a watcher that reports on action log messages. + RunOnAllMachines attempts to run the specified command on all the machines. - entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + applications : typing.Sequence[str] + commands : str + execution_group : str + machines : typing.Sequence[str] + parallel : bool + timeout : int + units : typing.Sequence[str] + workload_context : bool + Returns -> EnqueuedActions ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + if commands is not None and not isinstance(commands, (bytes, str)): + raise Exception("Expected commands to be a str, received: {}".format(type(commands))) + + if execution_group is not None and not isinstance(execution_group, (bytes, str)): + raise Exception("Expected execution_group to be a str, received: {}".format(type(execution_group))) + + if machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + if parallel is not None and not isinstance(parallel, bool): + raise Exception("Expected parallel to be a bool, received: {}".format(type(parallel))) + + if timeout is not None and not isinstance(timeout, int): + raise Exception("Expected timeout to be a int, received: {}".format(type(timeout))) + + if units is not None and not isinstance(units, (bytes, str, list)): + raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + + if workload_context is not None and not isinstance(workload_context, bool): + raise Exception("Expected workload_context to be a bool, received: {}".format(type(workload_context))) # map input types to rpc msg _params = dict() msg = dict(type='Action', - request='WatchActionsProgress', + request='RunOnAllMachines', version=7, params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) + _params['applications'] = applications + _params['commands'] = commands + _params['execution-group'] = execution_group + _params['machines'] = machines + _params['parallel'] = parallel + _params['timeout'] = timeout + _params['units'] = units + _params['workload-context'] = workload_context + reply = self.sync_rpc(msg) return reply -class CharmsFacade(Type): - name = 'Charms' - version = 7 - schema = {'definitions': {'AddCharmWithOrigin': {'additionalProperties': False, - 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, - 'force': {'type': 'boolean'}, - 'url': {'type': 'string'}}, - 'required': ['url', - 'charm-origin', - 'force'], - 'type': 'object'}, - 'ApplicationCharmPlacement': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'charm-url': {'type': 'string'}}, - 'required': ['application', - 'charm-url'], - 'type': 'object'}, - 'ApplicationCharmPlacements': {'additionalProperties': False, - 'properties': {'placements': {'items': {'$ref': '#/definitions/ApplicationCharmPlacement'}, - 'type': 'array'}}, - 'required': ['placements'], - 'type': 'object'}, - 'Base': {'additionalProperties': False, - 'properties': {'channel': {'type': 'string'}, - 'name': {'type': 'string'}}, - 'required': ['name', 'channel'], - 'type': 'object'}, - 'Charm': {'additionalProperties': False, - 'properties': {'actions': {'$ref': '#/definitions/CharmActions'}, - 'config': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmOption'}}, - 'type': 'object'}, - 'lxd-profile': {'$ref': '#/definitions/CharmLXDProfile'}, - 'manifest': {'$ref': '#/definitions/CharmManifest'}, - 'meta': {'$ref': '#/definitions/CharmMeta'}, + @ReturnMapping(EnqueuedActions) + async def RunOnAllMachines(self, applications=None, commands=None, execution_group=None, machines=None, parallel=None, timeout=None, units=None, workload_context=None): + ''' + RunOnAllMachines attempts to run the specified command on all the machines. + + applications : typing.Sequence[str] + commands : str + execution_group : str + machines : typing.Sequence[str] + parallel : bool + timeout : int + units : typing.Sequence[str] + workload_context : bool + Returns -> EnqueuedActions + ''' + if applications is not None and not isinstance(applications, (bytes, str, list)): + raise Exception("Expected applications to be a Sequence, received: {}".format(type(applications))) + + if commands is not None and not isinstance(commands, (bytes, str)): + raise Exception("Expected commands to be a str, received: {}".format(type(commands))) + + if execution_group is not None and not isinstance(execution_group, (bytes, str)): + raise Exception("Expected execution_group to be a str, received: {}".format(type(execution_group))) + + if machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + if parallel is not None and not isinstance(parallel, bool): + raise Exception("Expected parallel to be a bool, received: {}".format(type(parallel))) + + if timeout is not None and not isinstance(timeout, int): + raise Exception("Expected timeout to be a int, received: {}".format(type(timeout))) + + if units is not None and not isinstance(units, (bytes, str, list)): + raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + + if workload_context is not None and not isinstance(workload_context, bool): + raise Exception("Expected workload_context to be a bool, received: {}".format(type(workload_context))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='RunOnAllMachines', + version=7, + params=_params) + _params['applications'] = applications + _params['commands'] = commands + _params['execution-group'] = execution_group + _params['machines'] = machines + _params['parallel'] = parallel + _params['timeout'] = timeout + _params['units'] = units + _params['workload-context'] = workload_context + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + def sync_WatchActionsProgress(self, entities=None): + ''' + WatchActionsProgress creates a watcher that reports on action log messages. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='WatchActionsProgress', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchActionsProgress(self, entities=None): + ''' + WatchActionsProgress creates a watcher that reports on action log messages. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='WatchActionsProgress', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class CharmsFacade(Type): + name = 'Charms' + version = 7 + schema = {'definitions': {'AddCharmWithOrigin': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'force': {'type': 'boolean'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'charm-origin', + 'force'], + 'type': 'object'}, + 'ApplicationCharmPlacement': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm-url': {'type': 'string'}}, + 'required': ['application', + 'charm-url'], + 'type': 'object'}, + 'ApplicationCharmPlacements': {'additionalProperties': False, + 'properties': {'placements': {'items': {'$ref': '#/definitions/ApplicationCharmPlacement'}, + 'type': 'array'}}, + 'required': ['placements'], + 'type': 'object'}, + 'Base': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'required': ['name', 'channel'], + 'type': 'object'}, + 'Charm': {'additionalProperties': False, + 'properties': {'actions': {'$ref': '#/definitions/CharmActions'}, + 'config': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmOption'}}, + 'type': 'object'}, + 'lxd-profile': {'$ref': '#/definitions/CharmLXDProfile'}, + 'manifest': {'$ref': '#/definitions/CharmManifest'}, + 'meta': {'$ref': '#/definitions/CharmMeta'}, 'metrics': {'$ref': '#/definitions/CharmMetrics'}, 'revision': {'type': 'integer'}, 'url': {'type': 'string'}}, @@ -972,6 +1284,41 @@ class CharmsFacade(Type): 'type': 'object'} + @ReturnMapping(CharmOriginResult) + def sync_AddCharm(self, charm_origin=None, force=None, url=None): + ''' + AddCharm adds the given charm URL (which must include revision) to the + environment, if it does not exist yet. Local charms are not supported, + only charm store and charm hub URLs. See also AddLocalCharm(). + + charm_origin : CharmOrigin + force : bool + url : str + Returns -> CharmOriginResult + ''' + if charm_origin is not None and not isinstance(charm_origin, (dict, CharmOrigin)): + raise Exception("Expected charm_origin to be a CharmOrigin, received: {}".format(type(charm_origin))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='AddCharm', + version=7, + params=_params) + _params['charm-origin'] = charm_origin + _params['force'] = force + _params['url'] = url + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CharmOriginResult) async def AddCharm(self, charm_origin=None, force=None, url=None): ''' @@ -1007,6 +1354,29 @@ async def AddCharm(self, charm_origin=None, force=None, url=None): + @ReturnMapping(Charm) + def sync_CharmInfo(self, url=None): + ''' + CharmInfo returns information about the requested charm. + + url : str + Returns -> Charm + ''' + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='CharmInfo', + version=7, + params=_params) + _params['url'] = url + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(Charm) async def CharmInfo(self, url=None): ''' @@ -1030,6 +1400,30 @@ async def CharmInfo(self, url=None): + @ReturnMapping(ErrorResults) + def sync_CheckCharmPlacement(self, placements=None): + ''' + CheckCharmPlacement checks if a charm is allowed to be placed with in a + given application. + + placements : typing.Sequence[~ApplicationCharmPlacement] + Returns -> ErrorResults + ''' + if placements is not None and not isinstance(placements, (bytes, str, list)): + raise Exception("Expected placements to be a Sequence, received: {}".format(type(placements))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='CheckCharmPlacement', + version=7, + params=_params) + _params['placements'] = placements + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def CheckCharmPlacement(self, placements=None): ''' @@ -1054,6 +1448,30 @@ async def CheckCharmPlacement(self, placements=None): + @ReturnMapping(DownloadInfoResults) + def sync_GetDownloadInfos(self, entities=None): + ''' + GetDownloadInfos attempts to get the bundle corresponding to the charm url + and origin. + + entities : typing.Sequence[~CharmURLAndOrigin] + Returns -> DownloadInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='GetDownloadInfos', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(DownloadInfoResults) async def GetDownloadInfos(self, entities=None): ''' @@ -1079,7 +1497,7 @@ async def GetDownloadInfos(self, entities=None): @ReturnMapping(IsMeteredResult) - async def IsMetered(self, url=None): + def sync_IsMetered(self, url=None): ''' IsMetered returns whether or not the charm is metered. TODO (cderici) only used for metered charms in cmd MeteredDeployAPI, @@ -1098,28 +1516,78 @@ async def IsMetered(self, url=None): version=7, params=_params) _params['url'] = url - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(CharmsListResult) - async def List(self, names=None): + @ReturnMapping(IsMeteredResult) + async def IsMetered(self, url=None): ''' - List returns a list of charm URLs currently in the state. - If supplied parameter contains any names, the result will - be filtered to return only the charms with supplied names. + IsMetered returns whether or not the charm is metered. + TODO (cderici) only used for metered charms in cmd MeteredDeployAPI, + kept for client compatibility, remove in juju 4.0 - names : typing.Sequence[str] - Returns -> CharmsListResult + url : str + Returns -> IsMeteredResult ''' - if names is not None and not isinstance(names, (bytes, str, list)): - raise Exception("Expected names to be a Sequence, received: {}".format(type(names))) + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) # map input types to rpc msg _params = dict() msg = dict(type='Charms', - request='List', + request='IsMetered', + version=7, + params=_params) + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CharmsListResult) + def sync_List(self, names=None): + ''' + List returns a list of charm URLs currently in the state. + If supplied parameter contains any names, the result will + be filtered to return only the charms with supplied names. + + names : typing.Sequence[str] + Returns -> CharmsListResult + ''' + if names is not None and not isinstance(names, (bytes, str, list)): + raise Exception("Expected names to be a Sequence, received: {}".format(type(names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='List', + version=7, + params=_params) + _params['names'] = names + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(CharmsListResult) + async def List(self, names=None): + ''' + List returns a list of charm URLs currently in the state. + If supplied parameter contains any names, the result will + be filtered to return only the charms with supplied names. + + names : typing.Sequence[str] + Returns -> CharmsListResult + ''' + if names is not None and not isinstance(names, (bytes, str, list)): + raise Exception("Expected names to be a Sequence, received: {}".format(type(names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='List', version=7, params=_params) _params['names'] = names @@ -1128,6 +1596,29 @@ async def List(self, names=None): + @ReturnMapping(CharmResourcesResults) + def sync_ListCharmResources(self, entities=None): + ''' + ListCharmResources returns a series of resources for a given charm. + + entities : typing.Sequence[~CharmURLAndOrigin] + Returns -> CharmResourcesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='ListCharmResources', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CharmResourcesResults) async def ListCharmResources(self, entities=None): ''' @@ -1151,6 +1642,35 @@ async def ListCharmResources(self, entities=None): + @ReturnMapping(ResolveCharmWithChannelResults) + def sync_ResolveCharms(self, macaroon=None, resolve=None): + ''' + ResolveCharms resolves the given charm URLs with an optionally specified + preferred channel. Channel provided via CharmOrigin. + + macaroon : Macaroon + resolve : typing.Sequence[~ResolveCharmWithChannel] + Returns -> ResolveCharmWithChannelResults + ''' + if macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): + raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) + + if resolve is not None and not isinstance(resolve, (bytes, str, list)): + raise Exception("Expected resolve to be a Sequence, received: {}".format(type(resolve))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Charms', + request='ResolveCharms', + version=7, + params=_params) + _params['macaroon'] = macaroon + _params['resolve'] = resolve + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ResolveCharmWithChannelResults) async def ResolveCharms(self, macaroon=None, resolve=None): ''' @@ -1734,6 +2254,50 @@ class ClientFacade(Type): 'type': 'object'} + @ReturnMapping(FindToolsResult) + def sync_FindTools(self, agentstream=None, arch=None, major=None, number=None, os_type=None): + ''' + FindTools returns a List containing all tools matching the given parameters. + TODO(juju 3.1) - remove, used by 2.9 client only + + agentstream : str + arch : str + major : int + number : Number + os_type : str + Returns -> FindToolsResult + ''' + if agentstream is not None and not isinstance(agentstream, (bytes, str)): + raise Exception("Expected agentstream to be a str, received: {}".format(type(agentstream))) + + if arch is not None and not isinstance(arch, (bytes, str)): + raise Exception("Expected arch to be a str, received: {}".format(type(arch))) + + if major is not None and not isinstance(major, int): + raise Exception("Expected major to be a int, received: {}".format(type(major))) + + if number is not None and not isinstance(number, (dict, Number)): + raise Exception("Expected number to be a Number, received: {}".format(type(number))) + + if os_type is not None and not isinstance(os_type, (bytes, str)): + raise Exception("Expected os_type to be a str, received: {}".format(type(os_type))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='FindTools', + version=7, + params=_params) + _params['agentstream'] = agentstream + _params['arch'] = arch + _params['major'] = major + _params['number'] = number + _params['os-type'] = os_type + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(FindToolsResult) async def FindTools(self, agentstream=None, arch=None, major=None, number=None, os_type=None): ''' @@ -1778,6 +2342,34 @@ async def FindTools(self, agentstream=None, arch=None, major=None, number=None, + @ReturnMapping(FullStatus) + def sync_FullStatus(self, include_storage=None, patterns=None): + ''' + FullStatus gives the information needed for juju status over the api + + include_storage : bool + patterns : typing.Sequence[str] + Returns -> FullStatus + ''' + if include_storage is not None and not isinstance(include_storage, bool): + raise Exception("Expected include_storage to be a bool, received: {}".format(type(include_storage))) + + if patterns is not None and not isinstance(patterns, (bytes, str, list)): + raise Exception("Expected patterns to be a Sequence, received: {}".format(type(patterns))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='FullStatus', + version=7, + params=_params) + _params['include-storage'] = include_storage + _params['patterns'] = patterns + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(FullStatus) async def FullStatus(self, include_storage=None, patterns=None): ''' @@ -1806,6 +2398,29 @@ async def FullStatus(self, include_storage=None, patterns=None): + @ReturnMapping(StatusHistoryResults) + def sync_StatusHistory(self, requests=None): + ''' + StatusHistory returns a slice of past statuses for several entities. + + requests : typing.Sequence[~StatusHistoryRequest] + Returns -> StatusHistoryResults + ''' + if requests is not None and not isinstance(requests, (bytes, str, list)): + raise Exception("Expected requests to be a Sequence, received: {}".format(type(requests))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='StatusHistory', + version=7, + params=_params) + _params['requests'] = requests + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StatusHistoryResults) async def StatusHistory(self, requests=None): ''' @@ -1829,6 +2444,27 @@ async def StatusHistory(self, requests=None): + @ReturnMapping(AllWatcherId) + def sync_WatchAll(self): + ''' + WatchAll initiates a watcher for entities in the connected model. + + + Returns -> AllWatcherId + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='WatchAll', + version=7, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(AllWatcherId) async def WatchAll(self): ''' @@ -2376,6 +3012,39 @@ class CloudFacade(Type): 'type': 'object'} + @ReturnMapping(None) + def sync_AddCloud(self, cloud=None, force=None, name=None): + ''' + AddCloud adds a new cloud, different from the one managed by the controller. + + cloud : Cloud + force : bool + name : str + Returns -> None + ''' + if cloud is not None and not isinstance(cloud, (dict, Cloud)): + raise Exception("Expected cloud to be a Cloud, received: {}".format(type(cloud))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if name is not None and not isinstance(name, (bytes, str)): + raise Exception("Expected name to be a str, received: {}".format(type(name))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='AddCloud', + version=7, + params=_params) + _params['cloud'] = cloud + _params['force'] = force + _params['name'] = name + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(None) async def AddCloud(self, cloud=None, force=None, name=None): ''' @@ -2410,7 +3079,7 @@ async def AddCloud(self, cloud=None, force=None, name=None): @ReturnMapping(ErrorResults) - async def AddCredentials(self, credentials=None): + def sync_AddCredentials(self, credentials=None): ''' AddCredentials adds new credentials. In contrast to UpdateCredentials() below, the new credentials can be @@ -2430,23 +3099,21 @@ async def AddCredentials(self, credentials=None): version=7, params=_params) _params['credentials'] = credentials - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(UpdateCredentialResults) - async def CheckCredentialsModels(self, credentials=None): + @ReturnMapping(ErrorResults) + async def AddCredentials(self, credentials=None): ''' - CheckCredentialsModels validates supplied cloud credentials' content against - models that currently use these credentials. - If there are any models that are using a credential and these models or their - cloud instances are not going to be accessible with corresponding credential, - there will be detailed validation errors per model. - There's no Juju API client which uses this, but JAAS does, + AddCredentials adds new credentials. + In contrast to UpdateCredentials() below, the new credentials can be + for a cloud that the controller does not manage (this is required + for CAAS models) credentials : typing.Sequence[~TaggedCredential] - Returns -> UpdateCredentialResults + Returns -> ErrorResults ''' if credentials is not None and not isinstance(credentials, (bytes, str, list)): raise Exception("Expected credentials to be a Sequence, received: {}".format(type(credentials))) @@ -2454,7 +3121,7 @@ async def CheckCredentialsModels(self, credentials=None): # map input types to rpc msg _params = dict() msg = dict(type='Cloud', - request='CheckCredentialsModels', + request='AddCredentials', version=7, params=_params) _params['credentials'] = credentials @@ -2463,7 +3130,86 @@ async def CheckCredentialsModels(self, credentials=None): - @ReturnMapping(CloudResults) + @ReturnMapping(UpdateCredentialResults) + def sync_CheckCredentialsModels(self, credentials=None): + ''' + CheckCredentialsModels validates supplied cloud credentials' content against + models that currently use these credentials. + If there are any models that are using a credential and these models or their + cloud instances are not going to be accessible with corresponding credential, + there will be detailed validation errors per model. + There's no Juju API client which uses this, but JAAS does, + + credentials : typing.Sequence[~TaggedCredential] + Returns -> UpdateCredentialResults + ''' + if credentials is not None and not isinstance(credentials, (bytes, str, list)): + raise Exception("Expected credentials to be a Sequence, received: {}".format(type(credentials))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='CheckCredentialsModels', + version=7, + params=_params) + _params['credentials'] = credentials + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(UpdateCredentialResults) + async def CheckCredentialsModels(self, credentials=None): + ''' + CheckCredentialsModels validates supplied cloud credentials' content against + models that currently use these credentials. + If there are any models that are using a credential and these models or their + cloud instances are not going to be accessible with corresponding credential, + there will be detailed validation errors per model. + There's no Juju API client which uses this, but JAAS does, + + credentials : typing.Sequence[~TaggedCredential] + Returns -> UpdateCredentialResults + ''' + if credentials is not None and not isinstance(credentials, (bytes, str, list)): + raise Exception("Expected credentials to be a Sequence, received: {}".format(type(credentials))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='CheckCredentialsModels', + version=7, + params=_params) + _params['credentials'] = credentials + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudResults) + def sync_Cloud(self, entities=None): + ''' + Cloud returns the cloud definitions for the specified clouds. + + entities : typing.Sequence[~Entity] + Returns -> CloudResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='Cloud', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(CloudResults) async def Cloud(self, entities=None): ''' Cloud returns the cloud definitions for the specified clouds. @@ -2486,6 +3232,29 @@ async def Cloud(self, entities=None): + @ReturnMapping(CloudInfoResults) + def sync_CloudInfo(self, entities=None): + ''' + CloudInfo returns information about the specified clouds. + + entities : typing.Sequence[~Entity] + Returns -> CloudInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='CloudInfo', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CloudInfoResults) async def CloudInfo(self, entities=None): ''' @@ -2509,6 +3278,28 @@ async def CloudInfo(self, entities=None): + @ReturnMapping(CloudsResult) + def sync_Clouds(self): + ''' + Clouds returns the definitions of all clouds supported by the controller + that the logged in user can see. + + + Returns -> CloudsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='Clouds', + version=7, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CloudsResult) async def Clouds(self): ''' @@ -2531,6 +3322,29 @@ async def Clouds(self): + @ReturnMapping(CloudCredentialResults) + def sync_Credential(self, entities=None): + ''' + Credential returns the specified cloud credential for each tag, minus secrets. + + entities : typing.Sequence[~Entity] + Returns -> CloudCredentialResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='Credential', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CloudCredentialResults) async def Credential(self, entities=None): ''' @@ -2554,6 +3368,39 @@ async def Credential(self, entities=None): + @ReturnMapping(CredentialContentResults) + def sync_CredentialContents(self, credentials=None, include_secrets=None): + ''' + CredentialContents returns the specified cloud credentials, + including the secrets if requested. + If no specific credential name/cloud was passed in, all credentials for this user + are returned. + Only credential owner can see its contents as well as what models use it. + Controller admin has no special superpowers here and is treated the same as all other users. + + credentials : typing.Sequence[~CloudCredentialArg] + include_secrets : bool + Returns -> CredentialContentResults + ''' + if credentials is not None and not isinstance(credentials, (bytes, str, list)): + raise Exception("Expected credentials to be a Sequence, received: {}".format(type(credentials))) + + if include_secrets is not None and not isinstance(include_secrets, bool): + raise Exception("Expected include_secrets to be a bool, received: {}".format(type(include_secrets))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='CredentialContents', + version=7, + params=_params) + _params['credentials'] = credentials + _params['include-secrets'] = include_secrets + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(CredentialContentResults) async def CredentialContents(self, credentials=None, include_secrets=None): ''' @@ -2587,6 +3434,30 @@ async def CredentialContents(self, credentials=None, include_secrets=None): + @ReturnMapping(InstanceTypesResults) + def sync_InstanceTypes(self, constraints=None): + ''' + InstanceTypes returns instance type information for the cloud and region + in which the current model is deployed. + + constraints : typing.Sequence[~CloudInstanceTypesConstraint] + Returns -> InstanceTypesResults + ''' + if constraints is not None and not isinstance(constraints, (bytes, str, list)): + raise Exception("Expected constraints to be a Sequence, received: {}".format(type(constraints))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='InstanceTypes', + version=7, + params=_params) + _params['constraints'] = constraints + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(InstanceTypesResults) async def InstanceTypes(self, constraints=None): ''' @@ -2611,6 +3482,36 @@ async def InstanceTypes(self, constraints=None): + @ReturnMapping(ListCloudInfoResults) + def sync_ListCloudInfo(self, all_=None, user_tag=None): + ''' + ListCloudInfo returns clouds that the specified user has access to. + Controller admins (superuser) can list clouds for any user. + Other users can only ask about their own clouds. + + all_ : bool + user_tag : str + Returns -> ListCloudInfoResults + ''' + if all_ is not None and not isinstance(all_, bool): + raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + + if user_tag is not None and not isinstance(user_tag, (bytes, str)): + raise Exception("Expected user_tag to be a str, received: {}".format(type(user_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='ListCloudInfo', + version=7, + params=_params) + _params['all'] = all_ + _params['user-tag'] = user_tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ListCloudInfoResults) async def ListCloudInfo(self, all_=None, user_tag=None): ''' @@ -2642,7 +3543,7 @@ async def ListCloudInfo(self, all_=None, user_tag=None): @ReturnMapping(ErrorResults) - async def ModifyCloudAccess(self, changes=None): + def sync_ModifyCloudAccess(self, changes=None): ''' ModifyCloudAccess changes the model access granted to users. @@ -2659,64 +3560,159 @@ async def ModifyCloudAccess(self, changes=None): version=7, params=_params) _params['changes'] = changes - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def RemoveClouds(self, entities=None): + async def ModifyCloudAccess(self, changes=None): ''' - RemoveClouds removes the specified clouds from the controller. - If a cloud is in use (has models deployed to it), the removal will fail. + ModifyCloudAccess changes the model access granted to users. - entities : typing.Sequence[~Entity] + changes : typing.Sequence[~ModifyCloudAccess] Returns -> ErrorResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) # map input types to rpc msg _params = dict() msg = dict(type='Cloud', - request='RemoveClouds', + request='ModifyCloudAccess', version=7, params=_params) - _params['entities'] = entities + _params['changes'] = changes reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def RevokeCredentialsCheckModels(self, credentials=None): + def sync_RemoveClouds(self, entities=None): ''' - RevokeCredentialsCheckModels revokes a set of cloud credentials. - If the credentials are used by any of the models, the credential deletion will be aborted. - If credential-in-use needs to be revoked nonetheless, this method allows the use of force. + RemoveClouds removes the specified clouds from the controller. + If a cloud is in use (has models deployed to it), the removal will fail. - credentials : typing.Sequence[~RevokeCredentialArg] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' - if credentials is not None and not isinstance(credentials, (bytes, str, list)): - raise Exception("Expected credentials to be a Sequence, received: {}".format(type(credentials))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Cloud', - request='RevokeCredentialsCheckModels', + request='RemoveClouds', version=7, params=_params) - _params['credentials'] = credentials - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply @ReturnMapping(ErrorResults) - async def UpdateCloud(self, clouds=None): + async def RemoveClouds(self, entities=None): ''' - UpdateCloud updates an existing cloud that the controller knows about. + RemoveClouds removes the specified clouds from the controller. + If a cloud is in use (has models deployed to it), the removal will fail. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='RemoveClouds', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_RevokeCredentialsCheckModels(self, credentials=None): + ''' + RevokeCredentialsCheckModels revokes a set of cloud credentials. + If the credentials are used by any of the models, the credential deletion will be aborted. + If credential-in-use needs to be revoked nonetheless, this method allows the use of force. + + credentials : typing.Sequence[~RevokeCredentialArg] + Returns -> ErrorResults + ''' + if credentials is not None and not isinstance(credentials, (bytes, str, list)): + raise Exception("Expected credentials to be a Sequence, received: {}".format(type(credentials))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='RevokeCredentialsCheckModels', + version=7, + params=_params) + _params['credentials'] = credentials + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RevokeCredentialsCheckModels(self, credentials=None): + ''' + RevokeCredentialsCheckModels revokes a set of cloud credentials. + If the credentials are used by any of the models, the credential deletion will be aborted. + If credential-in-use needs to be revoked nonetheless, this method allows the use of force. + + credentials : typing.Sequence[~RevokeCredentialArg] + Returns -> ErrorResults + ''' + if credentials is not None and not isinstance(credentials, (bytes, str, list)): + raise Exception("Expected credentials to be a Sequence, received: {}".format(type(credentials))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='RevokeCredentialsCheckModels', + version=7, + params=_params) + _params['credentials'] = credentials + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_UpdateCloud(self, clouds=None): + ''' + UpdateCloud updates an existing cloud that the controller knows about. + + clouds : typing.Sequence[~AddCloudArgs] + Returns -> ErrorResults + ''' + if clouds is not None and not isinstance(clouds, (bytes, str, list)): + raise Exception("Expected clouds to be a Sequence, received: {}".format(type(clouds))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='UpdateCloud', + version=7, + params=_params) + _params['clouds'] = clouds + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateCloud(self, clouds=None): + ''' + UpdateCloud updates an existing cloud that the controller knows about. clouds : typing.Sequence[~AddCloudArgs] Returns -> ErrorResults @@ -2736,6 +3732,40 @@ async def UpdateCloud(self, clouds=None): + @ReturnMapping(UpdateCredentialResults) + def sync_UpdateCredentialsCheckModels(self, credentials=None, force=None): + ''' + UpdateCredentialsCheckModels updates a set of cloud credentials' content. + If there are any models that are using a credential and these models + are not going to be visible with updated credential content, + there will be detailed validation errors per model. Such model errors are returned + separately and do not contribute to the overall method error status. + Controller admins can 'force' an update of the credential + regardless of whether it is deemed valid or not. + + credentials : typing.Sequence[~TaggedCredential] + force : bool + Returns -> UpdateCredentialResults + ''' + if credentials is not None and not isinstance(credentials, (bytes, str, list)): + raise Exception("Expected credentials to be a Sequence, received: {}".format(type(credentials))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='UpdateCredentialsCheckModels', + version=7, + params=_params) + _params['credentials'] = credentials + _params['force'] = force + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UpdateCredentialResults) async def UpdateCredentialsCheckModels(self, credentials=None, force=None): ''' @@ -2770,6 +3800,29 @@ async def UpdateCredentialsCheckModels(self, credentials=None, force=None): + @ReturnMapping(StringsResults) + def sync_UserCredentials(self, user_clouds=None): + ''' + UserCredentials returns the cloud credentials for a set of users. + + user_clouds : typing.Sequence[~UserCloud] + Returns -> StringsResults + ''' + if user_clouds is not None and not isinstance(user_clouds, (bytes, str, list)): + raise Exception("Expected user_clouds to be a Sequence, received: {}".format(type(user_clouds))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='UserCredentials', + version=7, + params=_params) + _params['user-clouds'] = user_clouds + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsResults) async def UserCredentials(self, user_clouds=None): ''' @@ -3363,6 +4416,30 @@ class FirewallerFacade(Type): 'type': 'object'} + @ReturnMapping(BoolResults) + def sync_AreManuallyProvisioned(self, entities=None): + ''' + AreManuallyProvisioned returns whether each given entity is + manually provisioned or not. Only machine tags are accepted. + + entities : typing.Sequence[~Entity] + Returns -> BoolResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='AreManuallyProvisioned', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(BoolResults) async def AreManuallyProvisioned(self, entities=None): ''' @@ -3388,7 +4465,7 @@ async def AreManuallyProvisioned(self, entities=None): @ReturnMapping(CloudSpecResults) - async def CloudSpec(self, entities=None): + def sync_CloudSpec(self, entities=None): ''' CloudSpec returns the model's cloud spec. @@ -3405,18 +4482,18 @@ async def CloudSpec(self, entities=None): version=7, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ControllerAPIInfoResults) - async def ControllerAPIInfoForModels(self, entities=None): + @ReturnMapping(CloudSpecResults) + async def CloudSpec(self, entities=None): ''' - ControllerAPIInfoForModels returns the controller api connection details for the specified models. + CloudSpec returns the model's cloud spec. entities : typing.Sequence[~Entity] - Returns -> ControllerAPIInfoResults + Returns -> CloudSpecResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -3424,7 +4501,7 @@ async def ControllerAPIInfoForModels(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Firewaller', - request='ControllerAPIInfoForModels', + request='CloudSpec', version=7, params=_params) _params['entities'] = entities @@ -3433,35 +4510,36 @@ async def ControllerAPIInfoForModels(self, entities=None): - @ReturnMapping(ControllerConfigResult) - async def ControllerConfig(self): + @ReturnMapping(ControllerAPIInfoResults) + def sync_ControllerAPIInfoForModels(self, entities=None): ''' - ControllerConfig returns the controller's configuration. - + ControllerAPIInfoForModels returns the controller api connection details for the specified models. - Returns -> ControllerConfigResult + entities : typing.Sequence[~Entity] + Returns -> ControllerAPIInfoResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Firewaller', - request='ControllerConfig', + request='ControllerAPIInfoForModels', version=7, params=_params) - - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply - @ReturnMapping(StringResults) - async def GetAssignedMachine(self, entities=None): + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): ''' - GetAssignedMachine returns the assigned machine tag (if any) for - each given unit. + ControllerAPIInfoForModels returns the controller api connection details for the specified models. entities : typing.Sequence[~Entity] - Returns -> StringResults + Returns -> ControllerAPIInfoResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -3469,7 +4547,7 @@ async def GetAssignedMachine(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Firewaller', - request='GetAssignedMachine', + request='ControllerAPIInfoForModels', version=7, params=_params) _params['entities'] = entities @@ -3478,56 +4556,53 @@ async def GetAssignedMachine(self, entities=None): - @ReturnMapping(CloudSpecResult) - async def GetCloudSpec(self): + @ReturnMapping(ControllerConfigResult) + def sync_ControllerConfig(self): ''' - GetCloudSpec constructs the CloudSpec for a validated and authorized model. + ControllerConfig returns the controller's configuration. - Returns -> CloudSpecResult + Returns -> ControllerConfigResult ''' # map input types to rpc msg _params = dict() msg = dict(type='Firewaller', - request='GetCloudSpec', + request='ControllerConfig', version=7, params=_params) - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ExposeInfoResults) - async def GetExposeInfo(self, entities=None): + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): ''' - GetExposeInfo returns the expose flag and per-endpoint expose settings - for the specified applications. + ControllerConfig returns the controller's configuration. - entities : typing.Sequence[~Entity] - Returns -> ExposeInfoResults + + Returns -> ControllerConfigResult ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Firewaller', - request='GetExposeInfo', + request='ControllerConfig', version=7, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply @ReturnMapping(StringResults) - async def InstanceId(self, entities=None): + def sync_GetAssignedMachine(self, entities=None): ''' - InstanceId returns the provider specific instance id for each given - machine or an CodeNotProvisioned error, if not set. + GetAssignedMachine returns the assigned machine tag (if any) for + each given unit. entities : typing.Sequence[~Entity] Returns -> StringResults @@ -3538,22 +4613,23 @@ async def InstanceId(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Firewaller', - request='InstanceId', + request='GetAssignedMachine', version=7, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(LifeResults) - async def Life(self, entities=None): + @ReturnMapping(StringResults) + async def GetAssignedMachine(self, entities=None): ''' - Life returns the life status of every supplied entity, where available. + GetAssignedMachine returns the assigned machine tag (if any) for + each given unit. entities : typing.Sequence[~Entity] - Returns -> LifeResults + Returns -> StringResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -3561,7 +4637,7 @@ async def Life(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Firewaller', - request='Life', + request='GetAssignedMachine', version=7, params=_params) _params['entities'] = entities @@ -3570,8 +4646,215 @@ async def Life(self, entities=None): - @ReturnMapping(MacaroonResults) - async def MacaroonForRelations(self, entities=None): + @ReturnMapping(CloudSpecResult) + def sync_GetCloudSpec(self): + ''' + GetCloudSpec constructs the CloudSpec for a validated and authorized model. + + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='GetCloudSpec', + version=7, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def GetCloudSpec(self): + ''' + GetCloudSpec constructs the CloudSpec for a validated and authorized model. + + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='GetCloudSpec', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ExposeInfoResults) + def sync_GetExposeInfo(self, entities=None): + ''' + GetExposeInfo returns the expose flag and per-endpoint expose settings + for the specified applications. + + entities : typing.Sequence[~Entity] + Returns -> ExposeInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='GetExposeInfo', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ExposeInfoResults) + async def GetExposeInfo(self, entities=None): + ''' + GetExposeInfo returns the expose flag and per-endpoint expose settings + for the specified applications. + + entities : typing.Sequence[~Entity] + Returns -> ExposeInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='GetExposeInfo', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + def sync_InstanceId(self, entities=None): + ''' + InstanceId returns the provider specific instance id for each given + machine or an CodeNotProvisioned error, if not set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='InstanceId', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): + ''' + InstanceId returns the provider specific instance id for each given + machine or an CodeNotProvisioned error, if not set. + + entities : typing.Sequence[~Entity] + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='InstanceId', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + def sync_Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='Life', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='Life', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MacaroonResults) + def sync_MacaroonForRelations(self, entities=None): + ''' + MacaroonForRelations returns the macaroon for the specified relations. + + entities : typing.Sequence[~Entity] + Returns -> MacaroonResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='MacaroonForRelations', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(MacaroonResults) + async def MacaroonForRelations(self, entities=None): ''' MacaroonForRelations returns the macaroon for the specified relations. @@ -3593,6 +4876,27 @@ async def MacaroonForRelations(self, entities=None): + @ReturnMapping(ModelConfigResult) + def sync_ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='ModelConfig', + version=7, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelConfigResult) async def ModelConfig(self): ''' @@ -3608,44 +4912,209 @@ async def ModelConfig(self): request='ModelConfig', version=7, params=_params) - - reply = await self.rpc(msg) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IngressRulesResult) + def sync_ModelFirewallRules(self): + ''' + ModelFirewallRules returns the firewall rules that this model is + configured to open + + + Returns -> IngressRulesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='ModelFirewallRules', + version=7, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(IngressRulesResult) + async def ModelFirewallRules(self): + ''' + ModelFirewallRules returns the firewall rules that this model is + configured to open + + + Returns -> IngressRulesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='ModelFirewallRules', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OpenMachinePortRangesResults) + def sync_OpenedMachinePortRanges(self, entities=None): + ''' + OpenedMachinePortRanges returns a list of the opened port ranges for the + specified machines where each result is broken down by unit. The list of + opened ports for each unit is further grouped by endpoint name and includes + the subnet CIDRs that belong to the space that each endpoint is bound to. + + entities : typing.Sequence[~Entity] + Returns -> OpenMachinePortRangesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='OpenedMachinePortRanges', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(OpenMachinePortRangesResults) + async def OpenedMachinePortRanges(self, entities=None): + ''' + OpenedMachinePortRanges returns a list of the opened port ranges for the + specified machines where each result is broken down by unit. The list of + opened ports for each unit is further grouped by endpoint name and includes + the subnet CIDRs that belong to the space that each endpoint is bound to. + + entities : typing.Sequence[~Entity] + Returns -> OpenMachinePortRangesResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='OpenedMachinePortRanges', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + def sync_SetRelationsStatus(self, entities=None): + ''' + SetRelationsStatus sets the status for the specified relations. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='SetRelationsStatus', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationsStatus(self, entities=None): + ''' + SetRelationsStatus sets the status for the specified relations. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='SetRelationsStatus', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SpaceInfos) + def sync_SpaceInfos(self, space_ids=None): + ''' + SpaceInfos returns a comprehensive representation of either all spaces or + a filtered subset of the known spaces and their associated subnet details. + + space_ids : typing.Sequence[str] + Returns -> SpaceInfos + ''' + if space_ids is not None and not isinstance(space_ids, (bytes, str, list)): + raise Exception("Expected space_ids to be a Sequence, received: {}".format(type(space_ids))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='SpaceInfos', + version=7, + params=_params) + _params['space-ids'] = space_ids + reply = self.sync_rpc(msg) return reply - @ReturnMapping(IngressRulesResult) - async def ModelFirewallRules(self): + @ReturnMapping(SpaceInfos) + async def SpaceInfos(self, space_ids=None): ''' - ModelFirewallRules returns the firewall rules that this model is - configured to open - + SpaceInfos returns a comprehensive representation of either all spaces or + a filtered subset of the known spaces and their associated subnet details. - Returns -> IngressRulesResult + space_ids : typing.Sequence[str] + Returns -> SpaceInfos ''' + if space_ids is not None and not isinstance(space_ids, (bytes, str, list)): + raise Exception("Expected space_ids to be a Sequence, received: {}".format(type(space_ids))) # map input types to rpc msg _params = dict() msg = dict(type='Firewaller', - request='ModelFirewallRules', + request='SpaceInfos', version=7, params=_params) - + _params['space-ids'] = space_ids reply = await self.rpc(msg) return reply - @ReturnMapping(OpenMachinePortRangesResults) - async def OpenedMachinePortRanges(self, entities=None): + @ReturnMapping(NotifyWatchResults) + def sync_Watch(self, entities=None): ''' - OpenedMachinePortRanges returns a list of the opened port ranges for the - specified machines where each result is broken down by unit. The list of - opened ports for each unit is further grouped by endpoint name and includes - the subnet CIDRs that belong to the space that each endpoint is bound to. + Watch starts an NotifyWatcher for each given entity. entities : typing.Sequence[~Entity] - Returns -> OpenMachinePortRangesResults + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -3653,22 +5122,22 @@ async def OpenedMachinePortRanges(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Firewaller', - request='OpenedMachinePortRanges', + request='Watch', version=7, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetRelationsStatus(self, entities=None): + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): ''' - SetRelationsStatus sets the status for the specified relations. + Watch starts an NotifyWatcher for each given entity. - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -3676,7 +5145,7 @@ async def SetRelationsStatus(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Firewaller', - request='SetRelationsStatus', + request='Watch', version=7, params=_params) _params['entities'] = entities @@ -3685,34 +5154,33 @@ async def SetRelationsStatus(self, entities=None): - @ReturnMapping(SpaceInfos) - async def SpaceInfos(self, space_ids=None): + @ReturnMapping(NotifyWatchResults) + def sync_WatchCloudSpecsChanges(self, entities=None): ''' - SpaceInfos returns a comprehensive representation of either all spaces or - a filtered subset of the known spaces and their associated subnet details. + WatchCloudSpecsChanges returns a watcher for cloud spec changes. - space_ids : typing.Sequence[str] - Returns -> SpaceInfos + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' - if space_ids is not None and not isinstance(space_ids, (bytes, str, list)): - raise Exception("Expected space_ids to be a Sequence, received: {}".format(type(space_ids))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Firewaller', - request='SpaceInfos', + request='WatchCloudSpecsChanges', version=7, params=_params) - _params['space-ids'] = space_ids - reply = await self.rpc(msg) + _params['entities'] = entities + reply = self.sync_rpc(msg) return reply @ReturnMapping(NotifyWatchResults) - async def Watch(self, entities=None): + async def WatchCloudSpecsChanges(self, entities=None): ''' - Watch starts an NotifyWatcher for each given entity. + WatchCloudSpecsChanges returns a watcher for cloud spec changes. entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults @@ -3723,7 +5191,7 @@ async def Watch(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Firewaller', - request='Watch', + request='WatchCloudSpecsChanges', version=7, params=_params) _params['entities'] = entities @@ -3732,13 +5200,15 @@ async def Watch(self, entities=None): - @ReturnMapping(NotifyWatchResults) - async def WatchCloudSpecsChanges(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchEgressAddressesForRelations(self, entities=None): ''' - WatchCloudSpecsChanges returns a watcher for cloud spec changes. + WatchEgressAddressesForRelations creates a watcher that notifies when addresses, from which + connections will originate for the relation, change. + Each event contains the entire set of addresses which are required for ingress for the relation. entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) @@ -3746,11 +5216,11 @@ async def WatchCloudSpecsChanges(self, entities=None): # map input types to rpc msg _params = dict() msg = dict(type='Firewaller', - request='WatchCloudSpecsChanges', + request='WatchEgressAddressesForRelations', version=7, params=_params) _params['entities'] = entities - reply = await self.rpc(msg) + reply = self.sync_rpc(msg) return reply @@ -3780,6 +5250,31 @@ async def WatchEgressAddressesForRelations(self, entities=None): + @ReturnMapping(NotifyWatchResult) + def sync_WatchForModelConfigChanges(self): + ''' + WatchForModelConfigChanges returns a NotifyWatcher that observes + changes to the model configuration. + Note that although the NotifyWatchResult contains an Error field, + it's not used because we are only returning a single watcher, + so we use the regular error return. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchForModelConfigChanges', + version=7, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchForModelConfigChanges(self): ''' @@ -3805,6 +5300,30 @@ async def WatchForModelConfigChanges(self): + @ReturnMapping(StringsWatchResults) + def sync_WatchIngressAddressesForRelations(self, entities=None): + ''' + WatchIngressAddressesForRelations creates a watcher that returns the ingress networks + that have been recorded against the specified relations. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchIngressAddressesForRelations', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchIngressAddressesForRelations(self, entities=None): ''' @@ -3829,6 +5348,28 @@ async def WatchIngressAddressesForRelations(self, entities=None): + @ReturnMapping(NotifyWatchResult) + def sync_WatchModelFirewallRules(self): + ''' + WatchModelFirewallRules returns a NotifyWatcher that notifies of + potential changes to a model's configured firewall rules + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchModelFirewallRules', + version=7, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(NotifyWatchResult) async def WatchModelFirewallRules(self): ''' @@ -3851,6 +5392,28 @@ async def WatchModelFirewallRules(self): + @ReturnMapping(StringsWatchResult) + def sync_WatchModelMachineStartTimes(self): + ''' + WatchModelMachineStartTimes watches the non-container machines in the model + for changes to the Life or AgentStartTime fields and reports them as a batch. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchModelMachineStartTimes', + version=7, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchModelMachineStartTimes(self): ''' @@ -3873,6 +5436,29 @@ async def WatchModelMachineStartTimes(self): + @ReturnMapping(StringsWatchResult) + def sync_WatchModelMachines(self): + ''' + WatchModelMachines returns a StringsWatcher that notifies of + changes to the life cycles of the top level machines in the current + model. + + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchModelMachines', + version=7, + params=_params) + + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchModelMachines(self): ''' @@ -3896,6 +5482,30 @@ async def WatchModelMachines(self): + @ReturnMapping(StringsWatchResults) + def sync_WatchOpenedPorts(self, entities=None): + ''' + WatchOpenedPorts returns a new StringsWatcher for each given + model tag. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchOpenedPorts', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchOpenedPorts(self, entities=None): ''' @@ -3920,6 +5530,30 @@ async def WatchOpenedPorts(self, entities=None): + @ReturnMapping(StringsWatchResult) + def sync_WatchSubnets(self, entities=None): + ''' + WatchSubnets returns a new StringsWatcher that watches the specified + subnet tags or all tags if no entities are specified. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResult + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchSubnets', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResult) async def WatchSubnets(self, entities=None): ''' @@ -3944,6 +5578,30 @@ async def WatchSubnets(self, entities=None): + @ReturnMapping(StringsWatchResults) + def sync_WatchUnits(self, entities=None): + ''' + WatchUnits starts a StringsWatcher to watch all units belonging to + to any entity (machine or service) passed in args. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchUnits', + version=7, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringsWatchResults) async def WatchUnits(self, entities=None): ''' diff --git a/juju/client/_client9.py b/juju/client/_client9.py index 7aa58aa6..14d8772a 100644 --- a/juju/client/_client9.py +++ b/juju/client/_client9.py @@ -553,6 +553,30 @@ class ModelManagerFacade(Type): 'type': 'object'} + @ReturnMapping(ErrorResults) + def sync_ChangeModelCredential(self, model_credentials=None): + ''' + ChangeModelCredential changes cloud credential reference for models. + These new cloud credentials must already exist on the controller. + + model_credentials : typing.Sequence[~ChangeModelCredentialParams] + Returns -> ErrorResults + ''' + if model_credentials is not None and not isinstance(model_credentials, (bytes, str, list)): + raise Exception("Expected model_credentials to be a Sequence, received: {}".format(type(model_credentials))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ChangeModelCredential', + version=9, + params=_params) + _params['model-credentials'] = model_credentials + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ChangeModelCredential(self, model_credentials=None): ''' @@ -577,6 +601,55 @@ async def ChangeModelCredential(self, model_credentials=None): + @ReturnMapping(ModelInfo) + def sync_CreateModel(self, cloud_tag=None, config=None, credential=None, name=None, owner_tag=None, region=None): + ''' + CreateModel creates a new model using the account and + model config specified in the args. + + cloud_tag : str + config : typing.Mapping[str, typing.Any] + credential : str + name : str + owner_tag : str + region : str + Returns -> ModelInfo + ''' + if cloud_tag is not None and not isinstance(cloud_tag, (bytes, str)): + raise Exception("Expected cloud_tag to be a str, received: {}".format(type(cloud_tag))) + + if config is not None and not isinstance(config, dict): + raise Exception("Expected config to be a Mapping, received: {}".format(type(config))) + + if credential is not None and not isinstance(credential, (bytes, str)): + raise Exception("Expected credential to be a str, received: {}".format(type(credential))) + + if name is not None and not isinstance(name, (bytes, str)): + raise Exception("Expected name to be a str, received: {}".format(type(name))) + + if owner_tag is not None and not isinstance(owner_tag, (bytes, str)): + raise Exception("Expected owner_tag to be a str, received: {}".format(type(owner_tag))) + + if region is not None and not isinstance(region, (bytes, str)): + raise Exception("Expected region to be a str, received: {}".format(type(region))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='CreateModel', + version=9, + params=_params) + _params['cloud-tag'] = cloud_tag + _params['config'] = config + _params['credential'] = credential + _params['name'] = name + _params['owner-tag'] = owner_tag + _params['region'] = region + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelInfo) async def CreateModel(self, cloud_tag=None, config=None, credential=None, name=None, owner_tag=None, region=None): ''' @@ -626,6 +699,31 @@ async def CreateModel(self, cloud_tag=None, config=None, credential=None, name=N + @ReturnMapping(ErrorResults) + def sync_DestroyModels(self, models=None): + ''' + DestroyModels will try to destroy the specified models. + If there is a block on destruction, this method will return an error. + From ModelManager v7 onwards, DestroyModels gains 'force' and 'max-wait' parameters. + + models : typing.Sequence[~DestroyModelParams] + Returns -> ErrorResults + ''' + if models is not None and not isinstance(models, (bytes, str, list)): + raise Exception("Expected models to be a Sequence, received: {}".format(type(models))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='DestroyModels', + version=9, + params=_params) + _params['models'] = models + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def DestroyModels(self, models=None): ''' @@ -651,6 +749,36 @@ async def DestroyModels(self, models=None): + @ReturnMapping(StringResults) + def sync_DumpModels(self, entities=None, simplified=None): + ''' + DumpModels will export the models into the database agnostic + representation. The user needs to either be a controller admin, or have + admin privileges on the model itself. + + entities : typing.Sequence[~Entity] + simplified : bool + Returns -> StringResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + if simplified is not None and not isinstance(simplified, bool): + raise Exception("Expected simplified to be a bool, received: {}".format(type(simplified))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='DumpModels', + version=9, + params=_params) + _params['entities'] = entities + _params['simplified'] = simplified + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(StringResults) async def DumpModels(self, entities=None, simplified=None): ''' @@ -681,6 +809,31 @@ async def DumpModels(self, entities=None, simplified=None): + @ReturnMapping(MapResults) + def sync_DumpModelsDB(self, entities=None): + ''' + DumpModelsDB will gather all documents from all model collections + for the specified model. The map result contains a map of collection + names to lists of documents represented as maps. + + entities : typing.Sequence[~Entity] + Returns -> MapResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='DumpModelsDB', + version=9, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(MapResults) async def DumpModelsDB(self, entities=None): ''' @@ -706,6 +859,37 @@ async def DumpModelsDB(self, entities=None): + @ReturnMapping(ModelSummaryResults) + def sync_ListModelSummaries(self, all_=None, user_tag=None): + ''' + ListModelSummaries returns models that the specified user + has access to in the current server. Controller admins (superuser) + can list models for any user. Other users + can only ask about their own models. + + all_ : bool + user_tag : str + Returns -> ModelSummaryResults + ''' + if all_ is not None and not isinstance(all_, bool): + raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + + if user_tag is not None and not isinstance(user_tag, (bytes, str)): + raise Exception("Expected user_tag to be a str, received: {}".format(type(user_tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ListModelSummaries', + version=9, + params=_params) + _params['all'] = all_ + _params['user-tag'] = user_tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelSummaryResults) async def ListModelSummaries(self, all_=None, user_tag=None): ''' @@ -737,6 +921,32 @@ async def ListModelSummaries(self, all_=None, user_tag=None): + @ReturnMapping(UserModelList) + def sync_ListModels(self, tag=None): + ''' + ListModels returns the models that the specified user + has access to in the current server. Controller admins (superuser) + can list models for any user. Other users + can only ask about their own models. + + tag : str + Returns -> UserModelList + ''' + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ListModels', + version=9, + params=_params) + _params['tag'] = tag + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(UserModelList) async def ListModels(self, tag=None): ''' @@ -763,6 +973,30 @@ async def ListModels(self, tag=None): + @ReturnMapping(ModelDefaultsResults) + def sync_ModelDefaultsForClouds(self, entities=None): + ''' + ModelDefaultsForClouds returns the default config values for the specified + clouds. + + entities : typing.Sequence[~Entity] + Returns -> ModelDefaultsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModelDefaultsForClouds', + version=9, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelDefaultsResults) async def ModelDefaultsForClouds(self, entities=None): ''' @@ -787,6 +1021,29 @@ async def ModelDefaultsForClouds(self, entities=None): + @ReturnMapping(ModelInfoResults) + def sync_ModelInfo(self, entities=None): + ''' + ModelInfo returns information about the specified models. + + entities : typing.Sequence[~Entity] + Returns -> ModelInfoResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModelInfo', + version=9, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelInfoResults) async def ModelInfo(self, entities=None): ''' @@ -810,6 +1067,29 @@ async def ModelInfo(self, entities=None): + @ReturnMapping(ModelStatusResults) + def sync_ModelStatus(self, entities=None): + ''' + ModelStatus returns a summary of the model. + + entities : typing.Sequence[~Entity] + Returns -> ModelStatusResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModelStatus', + version=9, + params=_params) + _params['entities'] = entities + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ModelStatusResults) async def ModelStatus(self, entities=None): ''' @@ -833,6 +1113,29 @@ async def ModelStatus(self, entities=None): + @ReturnMapping(ErrorResults) + def sync_ModifyModelAccess(self, changes=None): + ''' + ModifyModelAccess changes the model access granted to users. + + changes : typing.Sequence[~ModifyModelAccess] + Returns -> ErrorResults + ''' + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModifyModelAccess', + version=9, + params=_params) + _params['changes'] = changes + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def ModifyModelAccess(self, changes=None): ''' @@ -856,6 +1159,29 @@ async def ModifyModelAccess(self, changes=None): + @ReturnMapping(ErrorResults) + def sync_SetModelDefaults(self, config=None): + ''' + SetModelDefaults writes new values for the specified default model settings. + + config : typing.Sequence[~ModelDefaultValues] + Returns -> ErrorResults + ''' + if config is not None and not isinstance(config, (bytes, str, list)): + raise Exception("Expected config to be a Sequence, received: {}".format(type(config))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='SetModelDefaults', + version=9, + params=_params) + _params['config'] = config + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetModelDefaults(self, config=None): ''' @@ -879,6 +1205,29 @@ async def SetModelDefaults(self, config=None): + @ReturnMapping(ErrorResults) + def sync_UnsetModelDefaults(self, keys=None): + ''' + UnsetModelDefaults removes the specified default model settings. + + keys : typing.Sequence[~ModelUnsetKeys] + Returns -> ErrorResults + ''' + if keys is not None and not isinstance(keys, (bytes, str, list)): + raise Exception("Expected keys to be a Sequence, received: {}".format(type(keys))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='UnsetModelDefaults', + version=9, + params=_params) + _params['keys'] = keys + reply = self.sync_rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def UnsetModelDefaults(self, keys=None): ''' diff --git a/juju/client/codegen.py b/juju/client/codegen.py index 137d4ecf..9a2c20c3 100644 --- a/juju/client/codegen.py +++ b/juju/client/codegen.py @@ -22,10 +22,10 @@ def write(self, msg, depth=0): prefix = self.INDENT * depth msg = indent(msg, prefix) - return super(CodeWriter, self).write(msg) + return super().write(msg) def __str__(self): - return super(CodeWriter, self).getvalue() + return super().getvalue() class Capture(defaultdict): @@ -36,20 +36,4 @@ class Capture(defaultdict): """ def __init__(self, default_factory=CodeWriter, *args, **kwargs): - super(Capture, self).__init__(default_factory, *args, **kwargs) - - def clear(self, name): - """ - Reset one of the keys in this class, if it exists. - - This is necessary, because we don't worry about de-duplicating - the schemas for each version of juju up front, and this gives - us a way to sort of de-duplicate on the fly, by resetting a - specific CodeWriter instance before we start to write a class - into it. - - """ - try: - del self[name] - except KeyError: - pass + super().__init__(default_factory, *args, **kwargs) diff --git a/juju/client/connection.py b/juju/client/connection.py index 30df0c05..761c409c 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -575,7 +575,7 @@ async def _receiver(self): result = json.loads(result) with open("/tmp/ws-log.jsonl", "a") as f: # Top-level key "response": means incoming message - f.write(json.dumps({**result, "_connection": self.name}) + "\n") + f.write(json.dumps({**result, "_connection": self.name, "_addr": self.addr}) + "\n") await self.messages.put(result['request-id'], result) except jasyncio.CancelledError: log.debug('Receiver: Cancelled') @@ -655,7 +655,7 @@ async def rpc(self, msg, encoder=None): await self._ws.send(outgoing) with open("/tmp/ws-log.jsonl", "a") as f: # Top-level key "request": means outgoing message - f.write(json.dumps({**msg, "_connection": self.name}, cls=encoder) + "\n") + f.write(json.dumps({**msg, "_connection": self.name, "_addr": self.addr}, cls=encoder) + "\n") break except websockets.ConnectionClosed: if attempt == 2: diff --git a/juju/client/facade.py b/juju/client/facade.py index 40b82d4c..31bd282b 100644 --- a/juju/client/facade.py +++ b/juju/client/facade.py @@ -1,5 +1,11 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +# /// script +# requires-python = ">=3.12" +# dependencies = [ +# "typing_inspect>=0.6.0", +# ] +# /// import argparse import builtins @@ -15,11 +21,10 @@ from pathlib import Path from typing import Any, Mapping, Sequence, TypeVar -import typing_inspect +import typing_inspect # type: ignore # FIXME no stubs? from . import codegen -_marker = object() JUJU_VERSION = re.compile(r'[0-9]+\.[0-9-]+[\.\-][0-9a-z]+(\.[0-9]+)?') # Workaround for https://bugs.launchpad.net/juju/+bug/1683906 @@ -146,10 +151,12 @@ class TypeRegistry(dict): def __init__(self, schema): self.schema = schema - def get(self, name): + def get(self, name, default=None): + assert not default # Two way mapping refname = self.schema.referenceName(name) if refname not in self: + # FIXME that's not what TypeVar's are for result = TypeVar(refname) self[refname] = result self[result] = refname @@ -451,7 +458,7 @@ def __init__(self{}{}, **unknown_fields): source.append("{}self.unknown_fields = unknown_fields".format(INDENT * 2)) source = "\n".join(source) - capture.clear(name) + capture.pop(name, None) capture[name].write(source) capture[name].write("\n\n") if name is None: @@ -509,7 +516,7 @@ async def wrapper(*args, **kwargs): return decorator -def makeFunc(cls, name, description, params, result, _async=True): +def makeFunc(cls, name, description, params, result): INDENT = " " args = Args(cls.schema, params) assignments = [] @@ -523,7 +530,7 @@ def makeFunc(cls, name, description, params, result, _async=True): source = """ @ReturnMapping({rettype}) -{_async}def {name}(self{argsep}{args}): +{_async}def {sync}{name}(self{argsep}{args}): ''' {docstring} Returns -> {res} @@ -536,7 +543,7 @@ def makeFunc(cls, name, description, params, result, _async=True): version={cls.version}, params=_params) {assignments} - reply = {_await}self.rpc(msg) + reply = {_await}self.{sync}rpc(msg) return reply """ @@ -544,18 +551,40 @@ def makeFunc(cls, name, description, params, result, _async=True): if description != "": description = "{}\n\n".format(description) doc_string = "{}{}".format(description, args.get_doc()) - fsource = source.format(_async="async " if _async else "", - name=name, - argsep=", " if args else "", - args=args.as_kwargs(), - res=res, - validation=args.as_validation(), - rettype=result.__name__ if result else None, - docstring=textwrap.indent(doc_string, INDENT), - cls=cls, - assignments=assignments, - _await="await " if _async else "") + + src1 = source.format( + _async="", + sync="sync_", + name=name, + argsep=", " if args else "", + args=args.as_kwargs(), + res=res, + validation=args.as_validation(), + rettype=result.__name__ if result else None, + docstring=textwrap.indent(doc_string, INDENT), + cls=cls, + assignments=assignments, + _await="", + ) + + src2 = source.format( + _async="async ", + sync="", + name=name, + argsep=", " if args else "", + args=args.as_kwargs(), + res=res, + validation=args.as_validation(), + rettype=result.__name__ if result else None, + docstring=textwrap.indent(doc_string, INDENT), + cls=cls, + assignments=assignments, + _await="await ", + ) + + fsource = "".join([src1, src2]) ns = _getns(cls.schema) + # Validate that this is valid Python code exec(fsource, ns) func = ns[name] return func, fsource @@ -576,6 +605,17 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply +async def sync_rpc(self, msg): + ''' + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + """ ns = _getns(cls.schema) exec(source, ns) @@ -591,7 +631,7 @@ def buildMethods(cls, capture): capture["{}Facade".format(cls.__name__)].write(source, depth=1) -def _buildMethod(cls, name): +def _buildMethod(cls, name: str): params = None result = None method = cls.schema['properties'][name] @@ -643,6 +683,9 @@ def default(self, o): class Type: + _toPy: dict[str, str] + _toSchema: dict[str, str] + def connect(self, connection): self.connection = connection @@ -929,7 +972,7 @@ def generate_facades(schemas): cls, source = buildFacade(schema) cls_name = "{}Facade".format(schema.name) - captures[schema.version].clear(cls_name) + captures[schema.version].pop(cls_name, None) # Make the factory class for _client.py make_factory(cls_name) # Make the actual class From e0d09f7e7f3d34dca2840d61438d9bd5711710d9 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Tue, 3 Sep 2024 17:54:04 +0900 Subject: [PATCH 07/29] wip --- juju/client/_client.py | 18 ++++++++++++++++ juju/client/connector.py | 5 +++++ juju/client/facade.py | 45 ++++++++++++++++++++++++++++++++++++---- juju/model.py | 3 +++ 4 files changed, 67 insertions(+), 4 deletions(-) diff --git a/juju/client/_client.py b/juju/client/_client.py index 3cd83b9d..e7aa89f2 100644 --- a/juju/client/_client.py +++ b/juju/client/_client.py @@ -43,6 +43,24 @@ def lookup_facade(name, version): class TypeFactory: + @classmethod + def from_sync_connection(cls, connection): + 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.sync_connect(connection) + + return c + + @classmethod def from_connection(cls, connection): """ diff --git a/juju/client/connector.py b/juju/client/connector.py index 3a901c7d..600a28a7 100644 --- a/juju/client/connector.py +++ b/juju/client/connector.py @@ -51,6 +51,10 @@ def is_connected(self): """Report whether there is a currently connected controller or not""" return self._connection is not None + def sync_connection(self): + # FIXME cache it maybe? + return Connection.sync_connect() + def connection(self): """Return the current connection; raises an exception if there is no current connection.""" @@ -97,6 +101,7 @@ async def connect(self, **kwargs): if not ({'username', 'password'}.issubset(kwargs)): required = {'username', 'password'}.difference(kwargs) raise ValueError(f'Some authentication parameters are required : {",".join(required)}') + # FIXME split this up... self._connection = await Connection.connect(**kwargs) # Check if we support the target controller diff --git a/juju/client/facade.py b/juju/client/facade.py index 31bd282b..48d229bc 100644 --- a/juju/client/facade.py +++ b/juju/client/facade.py @@ -10,6 +10,7 @@ import argparse import builtins import functools +import inspect import json import keyword import pprint @@ -72,6 +73,24 @@ def lookup_facade(name, version): TYPE_FACTORY = ''' class TypeFactory: + @classmethod + def from_sync_connection(cls, connection): + 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.sync_connect(connection) + + return c + + @classmethod def from_connection(cls, connection): """ @@ -489,8 +508,18 @@ def ReturnMapping(cls): def decorator(f): @functools.wraps(f) async def wrapper(*args, **kwargs): - nonlocal cls reply = await f(*args, **kwargs) + return tail(reply) + + @functools.wraps(f) + def sync_wrapper(*args, **kwargs): + reply = f(*args, **kwargs) + return tail(reply) + + def tail(reply): + # FIXME rework this + nonlocal cls + if cls is None: return reply if 'error' in reply: @@ -512,7 +541,7 @@ async def wrapper(*args, **kwargs): result = cls.from_json(reply['response']) return result - return wrapper + return wrapper if inspect.iscoroutinefunction(f) else sync_wrapper return decorator @@ -686,7 +715,13 @@ class Type: _toPy: dict[str, str] _toSchema: dict[str, str] + # FIXME a bit ugly, let's think about this later + def sync_connect(self, connection): + self.sync_connection = connection + self.connection = None + def connect(self, connection): + self.sync_connection = None self.connection = connection def __repr__(self): @@ -698,9 +733,11 @@ def __eq__(self, other): return self.__dict__ == other.__dict__ + def sync_rpc(self, msg): + return self.sync_connection.rpc(msg, encoder=TypeEncoder) + async def rpc(self, msg): - result = await self.connection.rpc(msg, encoder=TypeEncoder) - return result + return await self.connection.rpc(msg, encoder=TypeEncoder) @classmethod def from_json(cls, data): diff --git a/juju/model.py b/juju/model.py index a51944de..1927277e 100644 --- a/juju/model.py +++ b/juju/model.py @@ -597,6 +597,9 @@ def connection(self): if the Model is disconnected""" return self._connector.connection() + def sync_connection(self): + return self._connector.sync_connection() + async def get_controller(self): """Return a Controller instance for the currently connected model. :return Controller: From 3d301a26ca30d47dd3e0c571934224136daf0b2b Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Wed, 4 Sep 2024 17:47:55 +0900 Subject: [PATCH 08/29] more sync and more types --- juju/client/connection.py | 215 +++++++++++++++++++++++++++++++++++++- 1 file changed, 214 insertions(+), 1 deletion(-) diff --git a/juju/client/connection.py b/juju/client/connection.py index 761c409c..508e8ffb 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -5,6 +5,7 @@ import itertools import json import logging +import typing import ssl import urllib.request import weakref @@ -242,6 +243,140 @@ class Connection: MAX_FRAME_SIZE = 2**22 "Maximum size for a single frame. Defaults to 4MB." _count = itertools.count() + uuid: str|None + bakery_client: typing.Any + usertag: str|None + password: str|None + name: str + __request_id__: int + endpoints: list[tuple[str, str]]|None # FIXME seems to always be None + is_debug_log_connection: bool + monitor: Monitor + proxy: typing.Any # is a library thing? + + @classmethod + def sync_connect( + cls, + endpoint: list[str]|str|None = None, + uuid=None, + username=None, + password=None, + cacert=None, + bakery_client=None, + max_frame_size=None, + retries=3, + retry_backoff=10, + specified_facades=None, + proxy=None, + debug_log_conn=None, + debug_log_params={} + ): + """Connect to the websocket, synchronously. + + If uuid is None, the connection will be to the controller. Otherwise it + will be to the model. + + :param str endpoint: The hostname:port of the controller to connect to (or list of strings). + :param str uuid: The model UUID to connect to (None for a + controller-only connection). + :param str username: The username for controller-local users (or None + to use macaroon-based login.) + :param str password: The password for controller-local users. + :param str cacert: The CA certificate of the controller + (PEM formatted). + :param httpbakery.Client bakery_client: The macaroon bakery client to + to use when performing macaroon-based login. Macaroon tokens + acquired when logging will be saved to bakery_client.cookies. + If this is None, a default bakery_client will be used. + :param int max_frame_size: The maximum websocket frame size to allow. + :param int retries: When connecting or reconnecting, and all endpoints + fail, how many times to retry the connection before giving up. + :param int retry_backoff: Number of seconds to increase the wait + between connection retry attempts (a backoff of 10 with 3 retries + would wait 10s, 20s, and 30s). + :param specified_facades: Define a series of facade versions you wish to override + to prevent using the conservative client pinning with in the client. + :param TextIOWrapper debug_log_conn: target if this is a debug log connection + :param dict debug_log_params: filtering parameters for the debug-log output + """ + # FIXME refactor logic shared with async connect() + self = cls() + if endpoint is None: + raise ValueError('no endpoint provided') + if not isinstance(endpoint, str) and not isinstance(endpoint, list): + raise TypeError("Endpoint should be either str or list") + self.uuid = uuid + if bakery_client is None: + bakery_client = httpbakery.Client() + self.bakery_client = bakery_client + if username and '@' in username and not username.endswith('@local'): + # We're trying to log in as an external user - we need to use + # macaroon authentication with no username or password. + if password is not None: + raise errors.JujuAuthError('cannot log in as external ' + 'user with a password') + username = None + self.usertag = tag.user(username) + self.password = password + + self.name = f"{cls.__name__}-{next(cls._count)}" + self.__request_id__ = 0 + + # The following instance variables are initialized by the + # _connect_with_redirect method, but create them here + # as a reminder that they will exist. + self.addr = None + self._ws = None + self.endpoint = None + self.endpoints = None + self.cacert = None + self.info = None + + assert debug_log_conn is None, "FIXME not implemented" + self.debug_log_target = debug_log_conn + self.is_debug_log_connection = debug_log_conn is not None + self.debug_log_params = debug_log_params + self.debug_log_shown_lines = 0 # number of lines + + # Create that _Task objects but don't start the tasks yet. + self._pinger_task = None + self._receiver_task = None + self._debug_log_task = None + + self._retries = retries + self._retry_backoff = retry_backoff + + self.facades = {} + self.specified_facades = specified_facades or {} + + self.messages = IdQueue() + self.monitor = Monitor(connection=self) + if max_frame_size is None: + max_frame_size = self.MAX_FRAME_SIZE + self.max_frame_size = max_frame_size + + self.proxy = proxy + if self.proxy is not None: + self.proxy.connect() + + assert endpoint is not None + _endpoints: list[tuple[str, str|None]] = [(endpoint, cacert)] if isinstance(endpoint, str) else [(e, cacert) for e in endpoint] + lastError: Exception|None = None + for _ep in _endpoints: + try: + self._sync_connect(*_ep, with_redirect=not self.is_debug_log_connection) + return self + except ssl.SSLError as e: + lastError = e + continue + except OSError as e: + logging.debug( + "Cannot access endpoint {}: {}".format(_ep, e.strerror)) + lastError = e + continue + if lastError is not None: + raise lastError + raise Exception("Unable to connect to websocket") @classmethod async def connect( @@ -375,7 +510,7 @@ def ws(self): return self._ws @property - def username(self): + def username(self) -> str|None: if not self.usertag: return None return self.usertag[len('user-'):] @@ -628,6 +763,51 @@ async def _do_ping(): log.debug('ping failed because of closed connection') pass + def sync_rpc(self, msg: dict, encoder=None) -> dict: # FIXME encoder is always the same thing + # FIXME need separate rpc flavours: + # - to establish the connection, aka login + # - for regular API calls + self.__request_id__ += 1 + msg = {**msg, "request-id": self.__request_id__} + if 'params' not in msg: + msg['params'] = {} + if "version" not in msg: + msg['version'] = self.facades[msg['type']] + outgoing = json.dumps(msg, indent=2, cls=encoder) + self._sync_ws.send(outgoing) + with open("/tmp/ws-log.jsonl", "a") as f: + # Top-level key "request": means outgoing message + f.write(json.dumps({**msg, "sync": True, "_connection": self.name, "_addr": self.addr}, cls=encoder) + "\n") + + blob = self._sync_ws.recv() + result = json.loads(blob) + assert isinstance(result, dict) + + if 'error' in result: + # API Error Response + raise errors.JujuAPIError(result) + + assert "response" in result + + if 'results' in result['response']: + # Check for errors in a result list. + # TODO This loses the results that might have succeeded. + # Perhaps JujuError should return all the results including + # errors, or perhaps a keyword parameter to the rpc method + # could be added to trigger this behaviour. + err_results = [] + for res in result['response']['results'] or []: + if res.get('error', {}).get('message'): + err_results.append(res['error']['message']) + if err_results: + raise errors.JujuError(err_results) + + elif result['response'].get('error', {}).get('message'): + raise errors.JujuError(result['response']['error']['message']) + + return result + + async def rpc(self, msg, encoder=None): '''Make an RPC to the API. The message is encoded as JSON using the given encoder if any. @@ -805,6 +985,39 @@ async def reconnect(self): log.debug('reconnect: scheduling a pinger task') self._pinger_task = jasyncio.create_task(self._pinger(), name="Task_Pinger") + def _sync_connect(self, endpoint: str, cacert: str|None, *, with_redirect: bool): + # make raw connection + if self.uuid: + url = "wss://{}/model/{}/api".format(endpoint, self.uuid) + else: + url = "wss://{}/api".format(endpoint) + # login flow + params = { + 'client-version': CLIENT_VERSION, + 'auth-tag': self.usertag, + } + if self.password: + params['credentials'] = self.password + else: + raise NotImplementedError("FIXME support macaroons") + + try: + result = self.sync_rpc({ + "type": "Admin", + "request": "Login", + "version": 3, + "params": params, + }) + except errors.JujuAPIError as e: + if e.error_code != 'redirection required': + raise NotImplementedError("FIXME macaroons") + raise + + assert not result.get["dischange-required"], "Macaroons are not implemented in the sync path yet" + self.info = result + # FIXME add the Login/redirect machinery + self._build_facades(result.get('facades', {})) + async def _connect(self, endpoints): if len(endpoints) == 0: raise errors.JujuConnectionError('no endpoints to connect to') From 1b7aeed05d81a34d3bbcf46480413830bb8229cd Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Thu, 5 Sep 2024 09:42:14 +0900 Subject: [PATCH 09/29] more type fixes --- juju/client/connection.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/juju/client/connection.py b/juju/client/connection.py index 508e8ffb..e0940419 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -253,6 +253,9 @@ class Connection: is_debug_log_connection: bool monitor: Monitor proxy: typing.Any # is a library thing? + max_frame_size: int + _retries: int + _retry_backoff: float @classmethod def sync_connect( @@ -1057,8 +1060,12 @@ async def _try_endpoint(endpoint, cacert, delay): # only executed if inner loop's else did not continue # (i.e., inner loop did break due to successful connection) break + else: + assert False # impossible, work around https://github.com/microsoft/pyright/issues/8791 + for task in tasks: task.cancel() + self._ws = result[0] self.addr = result[1] self.endpoint = result[2] From 2303d83c87fad498daa7b7d7cb9e4f4206a4d0bb Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Thu, 5 Sep 2024 09:59:20 +0900 Subject: [PATCH 10/29] =?UTF-8?q?refactor=E2=9A=99=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/formatted_status.py | 5 +++-- examples/status.py | 5 +++-- juju/charmhub.py | 3 ++- juju/client/connection.py | 9 +++++---- juju/jasyncio.py | 2 +- juju/machine.py | 5 +++-- juju/model.py | 5 +++-- juju/utils.py | 4 ++-- tests/integration/test_application.py | 4 ++-- tests/integration/test_charmhub.py | 8 +++++--- tests/integration/test_connection.py | 7 ++++--- tests/integration/test_crossmodel.py | 5 +++-- tests/integration/test_model.py | 15 ++++++++------- 13 files changed, 44 insertions(+), 33 deletions(-) diff --git a/examples/formatted_status.py b/examples/formatted_status.py index 74932fce..94ad232f 100644 --- a/examples/formatted_status.py +++ b/examples/formatted_status.py @@ -6,6 +6,7 @@ description. For a similar solution using the FullStatus object check examples/fullstatus.py """ +import asyncio from juju import jasyncio import logging import sys @@ -30,7 +31,7 @@ async def main(): channel='stable', ) - await jasyncio.sleep(10) + await asyncio.sleep(10) tmp = tempfile.NamedTemporaryFile(delete=False) LOG.info('status dumped to %s', tmp.name) with open(tmp.name, 'w') as f: @@ -40,7 +41,7 @@ async def main(): # await formatted_status(model, target=sys.stdout) await formatted_status(model, target=f) f.write('-----------\n') - await jasyncio.sleep(1) + await asyncio.sleep(1) await application.remove() await model.disconnect() diff --git a/examples/status.py b/examples/status.py index 0f1e0134..d2a2034e 100644 --- a/examples/status.py +++ b/examples/status.py @@ -5,6 +5,7 @@ This example demonstrate how status works """ +import asyncio from juju import jasyncio import logging import sys @@ -26,7 +27,7 @@ async def main(): series='jammy', channel='stable', ) - await jasyncio.sleep(10) + await asyncio.sleep(10) # Print the status to observe the evolution # during a minute for i in range(12): @@ -39,7 +40,7 @@ async def main(): print(status) except Exception as e: print(e) - await jasyncio.sleep(5) + await asyncio.sleep(5) print('Removing ubuntu') await application.remove() diff --git a/juju/charmhub.py b/juju/charmhub.py index b3765426..2ab3e326 100644 --- a/juju/charmhub.py +++ b/juju/charmhub.py @@ -1,6 +1,7 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +import asyncio from .client import client from .errors import JujuError from juju import jasyncio @@ -22,7 +23,7 @@ async def request_charmhub_with_retry(self, url, retries): _response = requests.get(url) if _response.status_code == 200: return _response - await jasyncio.sleep(5) + await asyncio.sleep(5) raise JujuError("Got {} from {}".format(_response.status_code, url)) async def get_charm_id(self, charm_name): diff --git a/juju/client/connection.py b/juju/client/connection.py index e0940419..e878ee96 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -1,6 +1,7 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +import asyncio import base64 import itertools import json @@ -756,7 +757,7 @@ async def _do_ping(): log=log) if self.monitor.close_called.is_set(): break - await jasyncio.sleep(10) + await asyncio.sleep(10) except jasyncio.CancelledError: log.debug('Pinger: Cancelled') pass @@ -1022,12 +1023,12 @@ def _sync_connect(self, endpoint: str, cacert: str|None, *, with_redirect: bool) self._build_facades(result.get('facades', {})) async def _connect(self, endpoints): - if len(endpoints) == 0: + if not endpoints: raise errors.JujuConnectionError('no endpoints to connect to') async def _try_endpoint(endpoint, cacert, delay): if delay: - await jasyncio.sleep(delay) + await asyncio.sleep(delay) return await self._open(endpoint, cacert) # Try all endpoints in parallel, with slight increasing delay (+100ms @@ -1051,7 +1052,7 @@ async def _try_endpoint(endpoint, cacert, delay): 'attempt {} of {}'.format(_endpoints_str, attempt + 1, self._retries + 1)) - await jasyncio.sleep((attempt + 1) * self._retry_backoff) + await asyncio.sleep((attempt + 1) * self._retry_backoff) continue else: raise errors.JujuConnectionError( diff --git a/juju/jasyncio.py b/juju/jasyncio.py index 40eda4f1..c9092e6b 100644 --- a/juju/jasyncio.py +++ b/juju/jasyncio.py @@ -18,7 +18,7 @@ ROOT_LOGGER = logging.getLogger() from asyncio import Event, TimeoutError, ensure_future, \ - gather, sleep, wait_for, create_subprocess_exec, subprocess, \ + gather, wait_for, create_subprocess_exec, subprocess, \ wait, FIRST_COMPLETED, Lock, as_completed, new_event_loop, \ get_event_loop_policy, CancelledError, get_running_loop, \ create_task, ALL_COMPLETED, all_tasks, current_task, shield # noqa diff --git a/juju/machine.py b/juju/machine.py index b0d77ef6..c103c8bd 100644 --- a/juju/machine.py +++ b/juju/machine.py @@ -1,6 +1,7 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +import asyncio import ipaddress import logging import typing @@ -148,7 +149,7 @@ async def _scp(self, source, destination, scp_opts): await process.wait() if process.returncode == 0: break - await jasyncio.sleep(retry_backoff) + await asyncio.sleep(retry_backoff) if process.returncode != 0: raise JujuError(f"command failed after {retries} attempts: {cmd}") @@ -193,7 +194,7 @@ async def ssh( stdout, stderr = await process.communicate() if process.returncode == 0: break - await jasyncio.sleep(retry_backoff) + await asyncio.sleep(retry_backoff) if process.returncode != 0: raise JujuError(f"command failed: {cmd} after {retries} attempts, with {stderr.decode()}") # stdout is a bytes-like object, returning a string might be more useful diff --git a/juju/model.py b/juju/model.py index 1927277e..641bd7bd 100644 --- a/juju/model.py +++ b/juju/model.py @@ -1,6 +1,7 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +import asyncio import base64 import collections import hashlib @@ -2424,7 +2425,7 @@ async def _wait_for_action_status(): if action_output.results[0].status in ('completed', 'failed'): return else: - await jasyncio.sleep(1) + await asyncio.sleep(1) await jasyncio.wait_for( _wait_for_action_status(), timeout=wait) @@ -2974,7 +2975,7 @@ def _raise_for_status(entities, status): if last_log_time is None or datetime.now() - last_log_time > log_interval: log.info("Waiting for model:\n " + busy) last_log_time = datetime.now() - await jasyncio.sleep(check_freq) + await asyncio.sleep(check_freq) def _create_consume_args(offer, macaroon, controller_info): diff --git a/juju/utils.py b/juju/utils.py index f71d5291..233347ed 100644 --- a/juju/utils.py +++ b/juju/utils.py @@ -136,7 +136,7 @@ async def block_until(*conditions, timeout=None, wait_period=0.5): """ async def _block(): while not all(c() for c in conditions): - await jasyncio.sleep(wait_period) + await asyncio.sleep(wait_period) await jasyncio.shield(jasyncio.wait_for(_block(), timeout)) @@ -147,7 +147,7 @@ async def block_until_with_coroutine(condition_coroutine, timeout=None, wait_per """ async def _block(): while not await condition_coroutine(): - await jasyncio.sleep(wait_period) + await asyncio.sleep(wait_period) await jasyncio.shield(jasyncio.wait_for(_block(), timeout=timeout)) diff --git a/tests/integration/test_application.py b/tests/integration/test_application.py index ecac8b7d..0b9a5832 100644 --- a/tests/integration/test_application.py +++ b/tests/integration/test_application.py @@ -1,9 +1,9 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +import asyncio import logging from pathlib import Path -import asyncio import pytest @@ -25,7 +25,7 @@ async def test_action(): async with base.CleanModel() as model: app = await model.deploy('juju-qa-test') - await jasyncio.sleep(10) + await asyncio.sleep(10) actions = await app.get_actions(schema=True) assert 'fortune' in actions.keys(), 'mis"fortune" in charm actions' diff --git a/tests/integration/test_charmhub.py b/tests/integration/test_charmhub.py index bada3557..0960de85 100644 --- a/tests/integration/test_charmhub.py +++ b/tests/integration/test_charmhub.py @@ -1,6 +1,8 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +import asyncio + import pytest from .. import base @@ -101,11 +103,11 @@ async def test_subordinate_charm_zero_units(): # rsyslog-forwarder-ha is a subordinate charm app = await model.deploy('rsyslog-forwarder-ha') - await jasyncio.sleep(5) + await asyncio.sleep(5) assert len(app.units) == 0 await app.destroy() - await jasyncio.sleep(5) + await asyncio.sleep(5) # note that it'll error if the user tries to use num_units with pytest.raises(JujuError): @@ -114,7 +116,7 @@ async def test_subordinate_charm_zero_units(): # (full disclosure: it'll quitely switch to 0 if user enters # num_units=1, instead of erroring) app2 = await model.deploy('rsyslog-forwarder-ha', num_units=1) - await jasyncio.sleep(5) + await asyncio.sleep(5) assert len(app2.units) == 0 diff --git a/tests/integration/test_connection.py b/tests/integration/test_connection.py index 940a500b..dd6fe426 100644 --- a/tests/integration/test_connection.py +++ b/tests/integration/test_connection.py @@ -1,6 +1,7 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +import asyncio import http import logging import socket @@ -48,7 +49,7 @@ async def test_monitor_catches_error(): await conn._ws.close() # this could be racy with reconnect # if auto-reconnect is not disabled by lock, force this # test to fail by deferring to the reconnect task via sleep - await jasyncio.sleep(0.1) + await asyncio.sleep(0.1) assert conn.monitor.status == 'error' finally: await conn.close() @@ -76,7 +77,7 @@ async def test_reconnect(): kwargs = model.connection().connect_params() conn = await Connection.connect(**kwargs) try: - await jasyncio.sleep(0.1) + await asyncio.sleep(0.1) assert conn.is_open await conn._ws.close() assert not conn.is_open @@ -202,7 +203,7 @@ async def redirect(path, request_headers): logger.debug('server: started') while not self._stop.is_set(): await run_with_interrupt( - jasyncio.sleep(1), + asyncio.sleep(1), self._stop) logger.debug('server: tick') logger.debug('server: stopping') diff --git a/tests/integration/test_crossmodel.py b/tests/integration/test_crossmodel.py index c7e02c9d..c34b4aa0 100644 --- a/tests/integration/test_crossmodel.py +++ b/tests/integration/test_crossmodel.py @@ -1,6 +1,7 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +import asyncio import tempfile from pathlib import Path @@ -85,7 +86,7 @@ async def test_remove_saas(): await model_2.consume("admin/{}.ubuntu".format(model_1.name)) await model_2.remove_saas('ubuntu') - await jasyncio.sleep(5) + await asyncio.sleep(5) status = await model_2.get_status() if 'ubuntu' in status.remote_applications: @@ -130,7 +131,7 @@ async def test_relate_with_offer(): raise Exception("Expected postgresql in saas") await model_2.remove_saas('postgresql') - await jasyncio.sleep(5) + await asyncio.sleep(5) status = await model_2.get_status() if 'postgresql' in status.remote_applications: diff --git a/tests/integration/test_model.py b/tests/integration/test_model.py index 8d213553..6f0ae85b 100644 --- a/tests/integration/test_model.py +++ b/tests/integration/test_model.py @@ -1,6 +1,7 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +import asyncio import json import os import random @@ -1229,7 +1230,7 @@ async def test_model_attach_storage_at_deploy(): storage_id = ret[0] await unit.detach_storage(storage_id, force=True) - await jasyncio.sleep(10) + await asyncio.sleep(10) storages1 = await model.list_storage() assert any([storage_id in s['storage-tag'] for s in storages1]) @@ -1237,7 +1238,7 @@ async def test_model_attach_storage_at_deploy(): # juju remove-application # actually removes the storage even though the destroy_storage=false await app.destroy(destroy_storage=False) - await jasyncio.sleep(10) + await asyncio.sleep(10) storages2 = await model.list_storage() assert any([storage_id in s['storage-tag'] for s in storages2]) @@ -1258,14 +1259,14 @@ async def test_detach_storage(): unit = app.units[0] storage_ids = await unit.add_storage("pgdata") storage_id = storage_ids[0] - await jasyncio.sleep(5) + await asyncio.sleep(5) _storage_details_1 = await model.show_storage_details(storage_id) storage_details_1 = _storage_details_1[0] assert 'unit-postgresql-0' in storage_details_1['attachments'] await unit.detach_storage(storage_id, force=True) - await jasyncio.sleep(20) + await asyncio.sleep(20) _storage_details_2 = await model.show_storage_details(storage_id) storage_details_2 = _storage_details_2[0] @@ -1274,7 +1275,7 @@ async def test_detach_storage(): # remove_storage await model.remove_storage(storage_id, force=True) - await jasyncio.sleep(10) + await asyncio.sleep(10) storages = await model.list_storage() assert all([storage_id not in s['storage-tag'] for s in storages]) @@ -1289,7 +1290,7 @@ async def test_add_and_list_storage(): # All we need is to make sure a unit is up, doesn't even need to # be in 'active' or 'idle', i.e. # await model.wait_for_idle(status="waiting", wait_for_exact_units=1) - await jasyncio.sleep(5) + await asyncio.sleep(5) unit = app.units[0] await unit.add_storage("pgdata", size=512) storages = await model.list_storage() @@ -1311,6 +1312,6 @@ async def test_storage_pools_on_lxd(): assert "test-pool" in [p['name'] for p in pools] await model.remove_storage_pool("test-pool") - await jasyncio.sleep(5) + await asyncio.sleep(5) pools = await model.list_storage_pools() assert "test-pool" not in [p['name'] for p in pools] From 3815c564aa17c65d5645865e89acec06ceb27981 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Fri, 6 Sep 2024 17:52:49 +0900 Subject: [PATCH 11/29] more work --- juju/client/connection.py | 15 +++++++++++++++ juju/client/connector.py | 28 ++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/juju/client/connection.py b/juju/client/connection.py index e878ee96..c8bb6db9 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -16,6 +16,7 @@ import macaroonbakery.bakery as bakery import macaroonbakery.httpbakery as httpbakery import websockets +import websockets.sync.client from juju import errors, tag, utils, jasyncio from juju.client import client from juju.utils import IdQueue @@ -995,6 +996,20 @@ def _sync_connect(self, endpoint: str, cacert: str|None, *, with_redirect: bool) url = "wss://{}/model/{}/api".format(endpoint, self.uuid) else: url = "wss://{}/api".format(endpoint) + + server_hostname = None + sock = None + if self.proxy is not None: + sock = self.proxy.socket() + server_hostname = "juju-app" + + self._sync_ws = websockets.sync.client.connect( + url, + ssl=self._get_ssl(cacert), + max_size=self.max_frame_size, + server_hostname=server_hostname, + sock=sock, + ) # login flow params = { 'client-version': CLIENT_VERSION, diff --git a/juju/client/connector.py b/juju/client/connector.py index 600a28a7..6d5f8507 100644 --- a/juju/client/connector.py +++ b/juju/client/connector.py @@ -51,9 +51,32 @@ def is_connected(self): """Report whether there is a currently connected controller or not""" return self._connection is not None - def sync_connection(self): + def sync_connection(self, *, model_uuid: str|None = None, **kwargs): + # kwargs.setdefault("max_frame_size", self.max_frame_size) + # kwargs.setdefault("bakery_client", self.bakery_client) + # if "macaroons" in kwargs: + # raise NotImplementedError("FIXME macaroons flow") + # if "debug_log_conn" in kwargs: + # raise NotImplementedError("FIXME debug log connection flow") + # if not model_uuid: + # raise NotImplementedError("FIXME implement model-less sync connection") + + # account = kwargs.pop('account', {}) + + # # Prioritize the username and password that user provided + # # If not enough, try to patch it with info from accounts.yaml + # if 'username' not in kwargs and account.get('user'): + # kwargs.update(username=account.get('user')) + # if 'password' not in kwargs and account.get('password'): + # kwargs.update(password=account.get('password')) + + # if not ({'username', 'password'}.issubset(kwargs)): + # required = {'username', 'password'}.difference(kwargs) + # raise ValueError(f'Some authentication parameters are required : {",".join(required)}') # FIXME cache it maybe? - return Connection.sync_connect() + # FIXME borrowing computed connection bits from the async method + return Connection.sync_connect(**self._fixme_connect_kwargs) + # FIXME juju major version check, maybe def connection(self): """Return the current connection; raises an exception if there @@ -102,6 +125,7 @@ async def connect(self, **kwargs): required = {'username', 'password'}.difference(kwargs) raise ValueError(f'Some authentication parameters are required : {",".join(required)}') # FIXME split this up... + self._fixme_connect_kwargs = {**kwargs} self._connection = await Connection.connect(**kwargs) # Check if we support the target controller From 0e1de583f281f186a14fd3bfd39ca3de5f2e119f Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Sun, 8 Sep 2024 13:30:57 +0900 Subject: [PATCH 12/29] fix websockets sync lib use over domain socket proxy --- juju/client/connection.py | 3 +++ setup.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/juju/client/connection.py b/juju/client/connection.py index c8bb6db9..5661eca9 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -999,8 +999,10 @@ def _sync_connect(self, endpoint: str, cacert: str|None, *, with_redirect: bool) server_hostname = None sock = None + unix = False if self.proxy is not None: sock = self.proxy.socket() + unix = True server_hostname = "juju-app" self._sync_ws = websockets.sync.client.connect( @@ -1009,6 +1011,7 @@ def _sync_connect(self, endpoint: str, cacert: str|None, *, with_redirect: bool) max_size=self.max_frame_size, server_hostname=server_hostname, sock=sock, + unix=unix, ) # login flow params = { diff --git a/setup.py b/setup.py index a2e8ee94..6d127b40 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ 'macaroonbakery>=1.1,<2.0', 'pyRFC3339>=1.0,<2.0', 'pyyaml>=5.1.2', - 'websockets>=8.1', + 'websockets~=13.0', 'paramiko>=2.4.0', 'pyasn1>=0.4.4', 'toposort>=1.5,<2', From 9d02c6f4c2f06a02dee7aaed6a2d12b22338edf6 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Sun, 8 Sep 2024 13:38:36 +0900 Subject: [PATCH 13/29] typo --- juju/client/connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/juju/client/connection.py b/juju/client/connection.py index 5661eca9..96049bdf 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -1035,7 +1035,7 @@ def _sync_connect(self, endpoint: str, cacert: str|None, *, with_redirect: bool) raise NotImplementedError("FIXME macaroons") raise - assert not result.get["dischange-required"], "Macaroons are not implemented in the sync path yet" + assert not result.get("dischange-required"), "Macaroons are not implemented in the sync path yet" self.info = result # FIXME add the Login/redirect machinery self._build_facades(result.get('facades', {})) From f421416dcab528bac49bc1a1e70a5bd7d1b056a9 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Sun, 8 Sep 2024 13:45:37 +0900 Subject: [PATCH 14/29] plug missing facades --- juju/model.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/juju/model.py b/juju/model.py index 641bd7bd..a5cc4b44 100644 --- a/juju/model.py +++ b/juju/model.py @@ -599,7 +599,10 @@ def connection(self): return self._connector.connection() def sync_connection(self): - return self._connector.sync_connection() + tmp = self._connector.sync_connection() + # FIXME + tmp.facades = self._connector.connection().facades + return tmp async def get_controller(self): """Return a Controller instance for the currently connected model. From 1ab091623c49699f2e22b9e111ae21b71f8318a8 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Sun, 8 Sep 2024 13:48:21 +0900 Subject: [PATCH 15/29] sync typo --- juju/client/_client1.py | 24 ++++++++++++------------ juju/client/_client2.py | 6 +++--- juju/client/_client3.py | 2 +- juju/client/_client4.py | 2 +- juju/client/facade.py | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/juju/client/_client1.py b/juju/client/_client1.py index 6ef3da19..d50efe77 100644 --- a/juju/client/_client1.py +++ b/juju/client/_client1.py @@ -11335,7 +11335,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -12196,7 +12196,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -12514,7 +12514,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -12674,7 +12674,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -13350,7 +13350,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -13507,7 +13507,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -13668,7 +13668,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -14612,7 +14612,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -16417,7 +16417,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -16570,7 +16570,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -16714,7 +16714,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -18721,7 +18721,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' diff --git a/juju/client/_client2.py b/juju/client/_client2.py index 9272e93d..691d0392 100644 --- a/juju/client/_client2.py +++ b/juju/client/_client2.py @@ -3770,7 +3770,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -3921,7 +3921,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' @@ -9796,7 +9796,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' diff --git a/juju/client/_client3.py b/juju/client/_client3.py index 8e136b22..2402bba4 100644 --- a/juju/client/_client3.py +++ b/juju/client/_client3.py @@ -1210,7 +1210,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' diff --git a/juju/client/_client4.py b/juju/client/_client4.py index 7c232dd5..407cd6f3 100644 --- a/juju/client/_client4.py +++ b/juju/client/_client4.py @@ -127,7 +127,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - async def sync_rpc(self, msg): + def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' diff --git a/juju/client/facade.py b/juju/client/facade.py index 48d229bc..79b4e02f 100644 --- a/juju/client/facade.py +++ b/juju/client/facade.py @@ -634,7 +634,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply -async def sync_rpc(self, msg): +def sync_rpc(self, msg): ''' Patch rpc method to add Id. ''' From b9801ed52c7e87f8c9e878bdce89c3e4236222b7 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Sun, 8 Sep 2024 14:03:21 +0900 Subject: [PATCH 16/29] more sync typos fixed --- juju/client/_client1.py | 72 +++++++++++++++++++-------------------- juju/client/_client2.py | 18 +++++----- juju/client/_client3.py | 6 ++-- juju/client/_client4.py | 6 ++-- juju/client/connection.py | 5 +-- juju/client/connector.py | 5 +-- juju/client/facade.py | 6 ++-- juju/model.py | 5 +-- 8 files changed, 63 insertions(+), 60 deletions(-) diff --git a/juju/client/_client1.py b/juju/client/_client1.py index d50efe77..da77f50f 100644 --- a/juju/client/_client1.py +++ b/juju/client/_client1.py @@ -11323,7 +11323,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -11335,7 +11335,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -11344,7 +11344,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) @@ -12184,7 +12184,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -12196,7 +12196,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -12205,7 +12205,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) @@ -12502,7 +12502,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -12514,7 +12514,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -12523,7 +12523,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) @@ -12662,7 +12662,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -12674,7 +12674,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -12683,7 +12683,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) @@ -13338,7 +13338,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -13350,7 +13350,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -13359,7 +13359,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) @@ -13495,7 +13495,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -13507,7 +13507,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -13516,7 +13516,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) @@ -13656,7 +13656,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -13668,7 +13668,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -13677,7 +13677,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) @@ -14600,7 +14600,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -14612,7 +14612,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -14621,7 +14621,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) @@ -16405,7 +16405,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -16417,7 +16417,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -16426,7 +16426,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) @@ -16558,7 +16558,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -16570,7 +16570,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -16579,7 +16579,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) @@ -16702,7 +16702,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -16714,7 +16714,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -16723,7 +16723,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) @@ -18709,7 +18709,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -18721,7 +18721,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -18730,6 +18730,6 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) diff --git a/juju/client/_client2.py b/juju/client/_client2.py index 691d0392..24892472 100644 --- a/juju/client/_client2.py +++ b/juju/client/_client2.py @@ -3758,7 +3758,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -3770,7 +3770,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -3779,7 +3779,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) @@ -3909,7 +3909,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -3921,7 +3921,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -3930,7 +3930,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) @@ -9784,7 +9784,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -9796,7 +9796,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -9805,6 +9805,6 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) diff --git a/juju/client/_client3.py b/juju/client/_client3.py index 2402bba4..a9dbb681 100644 --- a/juju/client/_client3.py +++ b/juju/client/_client3.py @@ -1198,7 +1198,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -1210,7 +1210,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -1219,7 +1219,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) diff --git a/juju/client/_client4.py b/juju/client/_client4.py index 407cd6f3..f9d9c87f 100644 --- a/juju/client/_client4.py +++ b/juju/client/_client4.py @@ -115,7 +115,7 @@ async def Stop(self): - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -127,7 +127,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - def sync_rpc(self, msg): + def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -136,7 +136,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) diff --git a/juju/client/connection.py b/juju/client/connection.py index 96049bdf..40fc0d1f 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -258,6 +258,7 @@ class Connection: max_frame_size: int _retries: int _retry_backoff: float + facades: dict[str, int] # best available version for each type? request? @classmethod def sync_connect( @@ -275,7 +276,7 @@ def sync_connect( proxy=None, debug_log_conn=None, debug_log_params={} - ): + ) -> typing.Self: """Connect to the websocket, synchronously. If uuid is None, the connection will be to the controller. Otherwise it @@ -399,7 +400,7 @@ async def connect( proxy=None, debug_log_conn=None, debug_log_params={} - ): + ) -> typing.Self: """Connect to the websocket. If uuid is None, the connection will be to the controller. Otherwise it diff --git a/juju/client/connector.py b/juju/client/connector.py index 6d5f8507..27735c81 100644 --- a/juju/client/connector.py +++ b/juju/client/connector.py @@ -51,7 +51,7 @@ def is_connected(self): """Report whether there is a currently connected controller or not""" return self._connection is not None - def sync_connection(self, *, model_uuid: str|None = None, **kwargs): + def sync_connection(self, *, model_uuid: str|None = None, **kwargs) -> Connection: # kwargs.setdefault("max_frame_size", self.max_frame_size) # kwargs.setdefault("bakery_client", self.bakery_client) # if "macaroons" in kwargs: @@ -78,11 +78,12 @@ def sync_connection(self, *, model_uuid: str|None = None, **kwargs): return Connection.sync_connect(**self._fixme_connect_kwargs) # FIXME juju major version check, maybe - def connection(self): + def connection(self) -> Connection: """Return the current connection; raises an exception if there is no current connection.""" if not self.is_connected(): raise NoConnectionException("not connected") + assert self._connection # for type checker return self._connection async def connect(self, **kwargs): diff --git a/juju/client/facade.py b/juju/client/facade.py index 79b4e02f..25df961e 100644 --- a/juju/client/facade.py +++ b/juju/client/facade.py @@ -622,7 +622,7 @@ def makeFunc(cls, name, description, params, result): def makeRPCFunc(cls): source = """ -async def rpc(self, msg): +async def rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -634,7 +634,7 @@ async def rpc(self, msg): reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply -def sync_rpc(self, msg): +def sync_rpc(self, msg: dict) -> dict: ''' Patch rpc method to add Id. ''' @@ -643,7 +643,7 @@ def sync_rpc(self, msg): msg['Id'] = id from .facade import TypeEncoder - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) """ ns = _getns(cls.schema) diff --git a/juju/model.py b/juju/model.py index a5cc4b44..f7c0053e 100644 --- a/juju/model.py +++ b/juju/model.py @@ -28,6 +28,7 @@ from .bundle import BundleHandler, get_charm_series, is_local_charm from .charmhub import CharmHub from .client import client, connector +from .client.connection import Connection from .client.overrides import Caveat, Macaroon from .constraints import parse as parse_constraints from .constraints import parse_storage_constraint @@ -593,12 +594,12 @@ def is_connected(self): """Reports whether the Model is currently connected.""" return self._connector.is_connected() - def connection(self): + def connection(self) -> Connection: """Return the current Connection object. It raises an exception if the Model is disconnected""" return self._connector.connection() - def sync_connection(self): + def sync_connection(self) -> Connection: tmp = self._connector.sync_connection() # FIXME tmp.facades = self._connector.connection().facades From 1302623f815167b99cc5b0d7eb1f75a838053430 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Sun, 8 Sep 2024 14:08:47 +0900 Subject: [PATCH 17/29] kinda works? --- juju/client/facade.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/juju/client/facade.py b/juju/client/facade.py index 25df961e..0fa15d7c 100644 --- a/juju/client/facade.py +++ b/juju/client/facade.py @@ -714,6 +714,9 @@ def default(self, o): class Type: _toPy: dict[str, str] _toSchema: dict[str, str] + connection: "juju.client.Connection" + sync_connection: "juju.client.Connection" + # FIXME a bit ugly, let's think about this later def sync_connect(self, connection): @@ -733,10 +736,10 @@ def __eq__(self, other): return self.__dict__ == other.__dict__ - def sync_rpc(self, msg): - return self.sync_connection.rpc(msg, encoder=TypeEncoder) + def sync_rpc(self, msg: dict) -> dict: + return self.sync_connection.sync_rpc(msg, encoder=TypeEncoder) - async def rpc(self, msg): + async def rpc(self, msg: dict) -> dict: return await self.connection.rpc(msg, encoder=TypeEncoder) @classmethod From 0b06a62338600aff5dcde77764f9b107d2a8f412 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Sun, 8 Sep 2024 14:09:27 +0900 Subject: [PATCH 18/29] add the wip local test code --- sample.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 sample.py diff --git a/sample.py b/sample.py new file mode 100644 index 00000000..7be38517 --- /dev/null +++ b/sample.py @@ -0,0 +1,19 @@ +from juju import jasyncio +from juju.client import client +from juju.model import Model + + +async def main(): + m = Model() + await m.connect(model_name="testm") + app_facade = client.ApplicationFacade.from_connection(m.connection()) + sync_facade = client.ApplicationFacade.from_sync_connection(m.sync_connection()) + for app_name in m.applications: + app = await app_facade.Get(app_name) + print(app.application, app.charm) + app = sync_facade.sync_Get(app_name) + print(app.application, app.charm) + + +if __name__ == "__main__": + jasyncio.run(main()) From ceb8c141097fc7406117b13653ea7aaf7456a9a5 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Sun, 8 Sep 2024 14:13:00 +0900 Subject: [PATCH 19/29] py 3.11 for now --- docs/readme.rst | 2 +- setup.py | 5 ++--- tox.ini | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/readme.rst b/docs/readme.rst index 2cc967cd..5682eb59 100644 --- a/docs/readme.rst +++ b/docs/readme.rst @@ -11,7 +11,7 @@ Documentation: https://pythonlibjuju.readthedocs.io/en/latest/ Requirements ------------ -* Python 3.9/3.10 +* Python 3.11 Design Notes diff --git a/setup.py b/setup.py index 6d127b40..81689c65 100644 --- a/setup.py +++ b/setup.py @@ -48,9 +48,8 @@ "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ], entry_points={ 'console_scripts': [ diff --git a/tox.ini b/tox.ini index ddbe6b71..8e8bad74 100644 --- a/tox.ini +++ b/tox.ini @@ -69,7 +69,7 @@ commands = python -m pytest --tb native -ra -v -n auto -k 'integration' -m 'not serial' {posargs} [testenv:unit] -base_python = 3.10 +base_python = 3.11 envdir = {toxworkdir}/py3 commands = python --version From 98ff033b9f39b9a2fc9cf2fefc2fc49120620083 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Thu, 12 Sep 2024 16:23:28 +0900 Subject: [PATCH 20/29] wip --- juju/application.py | 20 +++++++++++++++ juju/client/connector.py | 8 +++++- juju/client/facade.py | 1 + juju/model.py | 54 ++++++++++++++++++++++++++++++++++++++++ juju/version.py | 2 +- sample.py | 12 +++++++-- 6 files changed, 93 insertions(+), 4 deletions(-) diff --git a/juju/application.py b/juju/application.py index 3a80f23f..6d2d918e 100644 --- a/juju/application.py +++ b/juju/application.py @@ -7,6 +7,7 @@ import typing from pathlib import Path +import juju.client.facade from . import jasyncio, model, tag, utils from .annotationhelper import _get_annotations, _set_annotations from .bundle import get_charm_series, is_local_charm @@ -24,6 +25,22 @@ class Application(model.ModelEntity): + # What safe data usually contains + _expected_attributes = [ + "model_uuid", + "name", + "exposed", + "charm_url", + "owner_tag", + "life", + "min_units", + "constraints", + "subordinate", + "status", + "workload_version", + ] + _pk: str|int + @property def _unit_match_pattern(self): return r'^{}.*$'.format(self.entity_id) @@ -34,6 +51,9 @@ def _facade(self): def _facade_version(self): return client.ApplicationFacade.best_facade_version(self.connection) + def _sync_facade(self) -> juju.client.facade.Type: + return client.ApplicationFacade.from_sync_connection(self.model.sync_connection()) + 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. diff --git a/juju/client/connector.py b/juju/client/connector.py index 27735c81..1a4e854a 100644 --- a/juju/client/connector.py +++ b/juju/client/connector.py @@ -30,6 +30,8 @@ class Connector: """This class abstracts out a reconnectable client that can connect to controllers and models found in the Juju data files. """ + _connection: Connection|None + _sync_connection: Connection|None def __init__( self, @@ -42,6 +44,7 @@ def __init__( self.max_frame_size = max_frame_size self.bakery_client = bakery_client self._connection = None + self._sync_connection = None self._log_connection = None self.controller_uuid = None self.model_name = None @@ -75,7 +78,10 @@ def sync_connection(self, *, model_uuid: str|None = None, **kwargs) -> Connectio # raise ValueError(f'Some authentication parameters are required : {",".join(required)}') # FIXME cache it maybe? # FIXME borrowing computed connection bits from the async method - return Connection.sync_connect(**self._fixme_connect_kwargs) + if not self._sync_connection: + print("#"*66) + self._sync_connection = Connection.sync_connect(**self._fixme_connect_kwargs) + return self._sync_connection # FIXME juju major version check, maybe def connection(self) -> Connection: diff --git a/juju/client/facade.py b/juju/client/facade.py index 0fa15d7c..7d5c5218 100644 --- a/juju/client/facade.py +++ b/juju/client/facade.py @@ -386,6 +386,7 @@ def buildTypes(schema, capture): class {}(Type): _toSchema = {} _toPy = {} + def __init__(self{}{}, **unknown_fields): ''' {} diff --git a/juju/model.py b/juju/model.py index f7c0053e..e712996f 100644 --- a/juju/model.py +++ b/juju/model.py @@ -16,6 +16,7 @@ import weakref import zipfile from concurrent.futures import CancelledError +from dataclasses import dataclass from datetime import datetime, timedelta from functools import partial from pathlib import Path @@ -50,6 +51,30 @@ log = logging.getLogger(__name__) +@dataclass +class _SyncCache: + value: dict + exception: Exception|None = None + stale: bool = True + + @classmethod + def new(cls): + return cls({}) + + def update(self, value: dict|None = None, exception: Exception|None = None) -> None: + if value is None and exception is None: + raise ValueError("At least one must be set") + self.value = value or {} + self.exception = exception + self.stale = False + asyncio.create_task(asyncio.sleep(0)).add_done_callback(self.invalidate) + + def invalidate(self, task: asyncio.Task) -> None: + print("!! invalidated") + self.stale = True + task.result() + + class _Observer: """Wrapper around an observer callable. @@ -256,6 +281,7 @@ def get_entity( class ModelEntity: """An object in the Model tree""" + _sync_cache: _SyncCache def __init__(self, entity_id, model, history_index=-1, connected=True): """Initialize a new entity @@ -269,12 +295,14 @@ def __init__(self, entity_id, model, history_index=-1, connected=True): from the model. """ + print("~~~~ init", self.__class__.__name__) self.entity_id = entity_id self.model = model self._history_index = history_index self.connected = connected self.connection = model.connection() self._status = 'unknown' + self._sync_cache = _SyncCache.new() def __repr__(self): return '<{} entity_id="{}">'.format(type(self).__name__, @@ -285,6 +313,31 @@ def __getattr__(self, name): model. """ + print(self.__class__.__name__, name) + # Dima's hacks + if "_sync_facade" in self.__class__.__dict__: + facade = self._sync_facade() + if name not in self._expected_attributes: + raise AttributeError(f"{self.__class__.__name__!r} object has no attribute {name!r}") + # print(self.safe_data.keys()) + + if self._sync_cache.stale: + try: + self._sync_cache.update(value=facade.sync_Get(self.entity_id)) + print("++ cache update value") + #print("", self._sync_cache.value.__dict__.keys()) + #print("", self._expected_attributes) + except Exception as e: + self._sync_cache.update(exception=e) + print("++ cache update exc") + raise + + print(">> cache lookup", name) + if self._sync_cache.exception: + raise self._sync_cache.exception + return getattr(self._sync_cache.value, name) + + # End of hack try: return self.safe_data[name] except KeyError: @@ -330,6 +383,7 @@ def first_lower(s): return s[0].lower() + s[1:] return first_lower(self.__class__.__name__) + # FIXME not used externally, phew! @property def current(self): """Return True if this object represents the current state of the diff --git a/juju/version.py b/juju/version.py index 3b14eca5..8cd45f13 100644 --- a/juju/version.py +++ b/juju/version.py @@ -5,4 +5,4 @@ DEFAULT_ARCHITECTURE = 'amd64' -CLIENT_VERSION = "3.5.2.0" +CLIENT_VERSION = "3.5.4.0" diff --git a/sample.py b/sample.py index 7be38517..826ad035 100644 --- a/sample.py +++ b/sample.py @@ -9,10 +9,18 @@ async def main(): app_facade = client.ApplicationFacade.from_connection(m.connection()) sync_facade = client.ApplicationFacade.from_sync_connection(m.sync_connection()) for app_name in m.applications: + print() + print() + m.applications[app_name].constraints.arch + m.applications[app_name].constraints.arch + m.applications[app_name].constraints.arch + m.applications[app_name].constraints.arch + print() + print() app = await app_facade.Get(app_name) - print(app.application, app.charm) + print(app.application, app.charm, app.constraints.arch) app = sync_facade.sync_Get(app_name) - print(app.application, app.charm) + print(app.application, app.charm, app.constraints.arch) if __name__ == "__main__": From b1706c4e3643717cd0a7146d234707c60822d66f Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Fri, 13 Sep 2024 09:21:17 +0900 Subject: [PATCH 21/29] fix *Delta types --- juju/delta.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/juju/delta.py b/juju/delta.py index 6f65e442..8802a123 100644 --- a/juju/delta.py +++ b/juju/delta.py @@ -2,6 +2,7 @@ # Licensed under the Apache V2, see LICENCE file for details. from .client import client +from .model import ModelEntity def get_entity_delta(d): @@ -13,17 +14,19 @@ def get_entity_class(entity_type): class EntityDelta(client.Delta): - def get_id(self): + data: dict[str, str] + + def get_id(self) -> str: return self.data['id'] @classmethod - def get_entity_class(self): - return None + def get_entity_class(cls) -> type[ModelEntity]: + raise NotImplementedError() class ActionDelta(EntityDelta): @classmethod - def get_entity_class(self): + def get_entity_class(cls): from .action import Action return Action @@ -33,7 +36,7 @@ def get_id(self): return self.data['name'] @classmethod - def get_entity_class(self): + def get_entity_class(cls): from .application import Application return Application @@ -43,7 +46,7 @@ def get_id(self): return self.data['tag'] @classmethod - def get_entity_class(self): + def get_entity_class(cls): from .annotation import Annotation return Annotation @@ -53,14 +56,14 @@ def get_id(self): return self.data['model-uuid'] @classmethod - def get_entity_class(self): + def get_entity_class(cls): from .model import ModelInfo return ModelInfo class MachineDelta(EntityDelta): @classmethod - def get_entity_class(self): + def get_entity_class(cls): from .machine import Machine return Machine @@ -70,14 +73,14 @@ def get_id(self): return self.data['name'] @classmethod - def get_entity_class(self): + def get_entity_class(cls): from .unit import Unit return Unit class RelationDelta(EntityDelta): @classmethod - def get_entity_class(self): + def get_entity_class(cls): from .relation import Relation return Relation @@ -87,7 +90,7 @@ def get_id(self): return self.data['name'] @classmethod - def get_entity_class(self): + def get_entity_class(cls): from .remoteapplication import RemoteApplication return RemoteApplication @@ -97,7 +100,7 @@ def get_id(self): return self.data['charm-url'] @classmethod - def get_entity_class(self): + def get_entity_class(cls): from .charm import Charm return Charm @@ -107,7 +110,7 @@ def get_id(self): return self.data['application-name'] @classmethod - def get_entity_class(self): + def get_entity_class(cls): from .remoteapplication import ApplicationOffer return ApplicationOffer From 486325d75490ec749bba322bf596f23a3b844906 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Fri, 13 Sep 2024 09:21:37 +0900 Subject: [PATCH 22/29] wip --- juju/model.py | 33 ++++++++------------------------- juju/utils.py | 28 +++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/juju/model.py b/juju/model.py index e712996f..d901f3d9 100644 --- a/juju/model.py +++ b/juju/model.py @@ -16,7 +16,6 @@ import weakref import zipfile from concurrent.futures import CancelledError -from dataclasses import dataclass from datetime import datetime, timedelta from functools import partial from pathlib import Path @@ -46,35 +45,12 @@ from .secrets import create_secret_data, read_secret_data from .tag import application as application_tag from .url import URL, Schema +from .utils import _SyncCache from .version import DEFAULT_ARCHITECTURE log = logging.getLogger(__name__) -@dataclass -class _SyncCache: - value: dict - exception: Exception|None = None - stale: bool = True - - @classmethod - def new(cls): - return cls({}) - - def update(self, value: dict|None = None, exception: Exception|None = None) -> None: - if value is None and exception is None: - raise ValueError("At least one must be set") - self.value = value or {} - self.exception = exception - self.stale = False - asyncio.create_task(asyncio.sleep(0)).add_done_callback(self.invalidate) - - def invalidate(self, task: asyncio.Task) -> None: - print("!! invalidated") - self.stale = True - task.result() - - class _Observer: """Wrapper around an observer callable. @@ -279,6 +255,9 @@ def get_entity( connected=connected) +import itertools +ctr = itertools.count() + class ModelEntity: """An object in the Model tree""" _sync_cache: _SyncCache @@ -296,6 +275,10 @@ def __init__(self, entity_id, model, history_index=-1, connected=True): """ print("~~~~ init", self.__class__.__name__) + if self.__class__.__name__ == "Application": + if (n := next(ctr)) == 10: + import pdb + pdb.set_trace() self.entity_id = entity_id self.model = model self._history_index = history_index diff --git a/juju/utils.py b/juju/utils.py index 233347ed..a7bcf0a6 100644 --- a/juju/utils.py +++ b/juju/utils.py @@ -5,8 +5,9 @@ import os import textwrap from collections import defaultdict -from functools import partial +from dataclasses import dataclass from pathlib import Path +from typing import Any import base64 from pyasn1.type import univ, char from pyasn1.codec.der.encoder import encode @@ -18,6 +19,31 @@ from .errors import JujuError +@dataclass +class _SyncCache: + value: Any + exception: Exception|None = None + stale: bool = True + + @classmethod + def new(cls): + return cls({}) + + # FIXME check if None is ever a valid cached thing, maybe replace with _SENTINEL + def update(self, value: Any = None, exception: Exception|None = None) -> None: + if value is None and exception is None: + raise ValueError("At least one must be set") + self.value = value + self.exception = exception + self.stale = False + asyncio.create_task(asyncio.sleep(0)).add_done_callback(self.invalidate) + + def invalidate(self, task: asyncio.Task) -> None: + print("!! invalidated") + self.stale = True + task.result() + + async def execute_process(*cmd, log=None): ''' Wrapper around asyncio.create_subprocess_exec. From ea1de86270bc38c0a434b1cf3afa2463cc841425 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Fri, 13 Sep 2024 09:58:48 +0900 Subject: [PATCH 23/29] fix more types --- juju/utils.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/juju/utils.py b/juju/utils.py index a7bcf0a6..83286a15 100644 --- a/juju/utils.py +++ b/juju/utils.py @@ -32,7 +32,7 @@ def new(cls): # FIXME check if None is ever a valid cached thing, maybe replace with _SENTINEL def update(self, value: Any = None, exception: Exception|None = None) -> None: if value is None and exception is None: - raise ValueError("At least one must be set") + raise ValueError("At least one of {value, exception} must be set") self.value = value self.exception = exception self.stale = False @@ -177,7 +177,7 @@ async def _block(): await jasyncio.shield(jasyncio.wait_for(_block(), timeout=timeout)) -async def wait_for_bundle(model, bundle, **kwargs): +async def wait_for_bundle(model, bundle: str, **kwargs): """Helper to wait for just the apps in a specific bundle. Equivalent to loading the bundle, pulling out the app names, and calling:: @@ -189,11 +189,12 @@ async def wait_for_bundle(model, bundle, **kwargs): if bundle_path.is_file(): bundle = bundle_path.read_text() elif (bundle_path / "bundle.yaml").is_file(): - bundle = (bundle_path / "bundle.yaml") + bundle = (bundle_path / "bundle.yaml").read_text() except OSError: + # FIXME this is weird... bundle arg can also be a yaml string too? pass - bundle = yaml.safe_load(textwrap.dedent(bundle).strip()) - apps = list(bundle.get("applications", bundle.get("services")).keys()) + content: dict = yaml.safe_load(textwrap.dedent(bundle).strip()) + apps = list(content.get("applications", content.get("services")).keys()) await model.wait_for_idle(apps, **kwargs) From 042c5b019ae4d1883873023ec2a6068d20883c80 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Fri, 13 Sep 2024 10:18:20 +0900 Subject: [PATCH 24/29] cached live entity map --- juju/delta.py | 5 +++-- juju/model.py | 29 +++++++++++------------------ juju/utils.py | 12 ++++++++---- sample.py | 14 ++++++++------ 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/juju/delta.py b/juju/delta.py index 8802a123..a7b61b46 100644 --- a/juju/delta.py +++ b/juju/delta.py @@ -1,8 +1,9 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +from __future__ import annotations from .client import client -from .model import ModelEntity +from . import model def get_entity_delta(d): @@ -20,7 +21,7 @@ def get_id(self) -> str: return self.data['id'] @classmethod - def get_entity_class(cls) -> type[ModelEntity]: + def get_entity_class(cls) -> type[model.ModelEntity]: raise NotImplementedError() diff --git a/juju/model.py b/juju/model.py index d901f3d9..90afeb94 100644 --- a/juju/model.py +++ b/juju/model.py @@ -1,5 +1,6 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +from __future__ import annotations import asyncio import base64 @@ -126,17 +127,20 @@ class ModelState: def __init__(self, model): self.model = model self.state = dict() + self._live_entity_cache = _SyncCache.new(debug_name="live entity map") - def _live_entity_map(self, entity_type): + def _live_entity_map(self, entity_type: str) -> dict[str, ModelEntity]: """Return an id:Entity map of all the living entities of type ``entity_type``. """ - return { - entity_id: self.get_entity(entity_type, entity_id) - for entity_id, history in self.state.get(entity_type, {}).items() - if history[-1] is not None - } + if self._live_entity_cache.stale: + self._live_entity_cache.update(value = { + entity_id: self.get_entity(entity_type, entity_id) + for entity_id, history in self.state.get(entity_type, {}).items() + if history[-1] is not None + }) + return self._live_entity_cache.value @property def applications(self): @@ -255,9 +259,6 @@ def get_entity( connected=connected) -import itertools -ctr = itertools.count() - class ModelEntity: """An object in the Model tree""" _sync_cache: _SyncCache @@ -274,18 +275,13 @@ def __init__(self, entity_id, model, history_index=-1, connected=True): from the model. """ - print("~~~~ init", self.__class__.__name__) - if self.__class__.__name__ == "Application": - if (n := next(ctr)) == 10: - import pdb - pdb.set_trace() self.entity_id = entity_id self.model = model self._history_index = history_index self.connected = connected self.connection = model.connection() self._status = 'unknown' - self._sync_cache = _SyncCache.new() + self._sync_cache = _SyncCache.new(debug_name=self.__class__.__name__) def __repr__(self): return '<{} entity_id="{}">'.format(type(self).__name__, @@ -307,15 +303,12 @@ def __getattr__(self, name): if self._sync_cache.stale: try: self._sync_cache.update(value=facade.sync_Get(self.entity_id)) - print("++ cache update value") #print("", self._sync_cache.value.__dict__.keys()) #print("", self._expected_attributes) except Exception as e: self._sync_cache.update(exception=e) - print("++ cache update exc") raise - print(">> cache lookup", name) if self._sync_cache.exception: raise self._sync_cache.exception return getattr(self._sync_cache.value, name) diff --git a/juju/utils.py b/juju/utils.py index 83286a15..ffbccffe 100644 --- a/juju/utils.py +++ b/juju/utils.py @@ -2,6 +2,7 @@ # Licensed under the Apache V2, see LICENCE file for details. import asyncio +import logging import os import textwrap from collections import defaultdict @@ -21,13 +22,15 @@ @dataclass class _SyncCache: - value: Any + value: Any = None exception: Exception|None = None stale: bool = True + debug_name: str = "" @classmethod - def new(cls): - return cls({}) + def new(cls, debug_name=""): + logging.info("created %s", debug_name) + return cls(debug_name=debug_name) # FIXME check if None is ever a valid cached thing, maybe replace with _SENTINEL def update(self, value: Any = None, exception: Exception|None = None) -> None: @@ -37,11 +40,12 @@ def update(self, value: Any = None, exception: Exception|None = None) -> None: self.exception = exception self.stale = False asyncio.create_task(asyncio.sleep(0)).add_done_callback(self.invalidate) + logging.info("updated %s", self.debug_name) def invalidate(self, task: asyncio.Task) -> None: - print("!! invalidated") self.stale = True task.result() + logging.info("invalidated %s", self.debug_name) async def execute_process(*cmd, log=None): diff --git a/sample.py b/sample.py index 826ad035..0b92d427 100644 --- a/sample.py +++ b/sample.py @@ -1,3 +1,5 @@ +import logging + from juju import jasyncio from juju.client import client from juju.model import Model @@ -10,12 +12,11 @@ async def main(): sync_facade = client.ApplicationFacade.from_sync_connection(m.sync_connection()) for app_name in m.applications: print() - print() - m.applications[app_name].constraints.arch - m.applications[app_name].constraints.arch - m.applications[app_name].constraints.arch - m.applications[app_name].constraints.arch - print() + print(m.applications[app_name].constraints.arch) + print(m.applications[app_name].constraints.arch) + print(m.applications[app_name].constraints.arch) + print(m.applications[app_name].constraints.arch) + print() app = await app_facade.Get(app_name) print(app.application, app.charm, app.constraints.arch) @@ -24,4 +25,5 @@ async def main(): if __name__ == "__main__": + logging.basicConfig(level="INFO", format="ℹī¸ %(message)s") jasyncio.run(main()) From 3a87d70d329ce7289dbd109d5e0f1ea7a5a9c671 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Fri, 13 Sep 2024 10:29:26 +0900 Subject: [PATCH 25/29] better codegen formatting --- juju/client/_definitions.py | 952 ++++++++++++++++++++++++++++++++++++ 1 file changed, 952 insertions(+) diff --git a/juju/client/_definitions.py b/juju/client/_definitions.py index 3877c8be..82c3d908 100644 --- a/juju/client/_definitions.py +++ b/juju/client/_definitions.py @@ -7,6 +7,7 @@ class APIHostPortsResult(Type): _toSchema = {'servers': 'servers'} _toPy = {'servers': 'servers'} + def __init__(self, servers=None, **unknown_fields): ''' servers : typing.Sequence[~HostPort] @@ -25,6 +26,7 @@ def __init__(self, servers=None, **unknown_fields): class AccessInfo(Type): _toSchema = {'role': 'role', 'scope_tag': 'scope-tag', 'target_tag': 'target-tag'} _toPy = {'role': 'role', 'scope-tag': 'scope_tag', 'target-tag': 'target_tag'} + def __init__(self, role=None, scope_tag=None, target_tag=None, **unknown_fields): ''' role : str @@ -55,6 +57,7 @@ def __init__(self, role=None, scope_tag=None, target_tag=None, **unknown_fields) class Action(Type): _toSchema = {'execution_group': 'execution-group', 'name': 'name', 'parallel': 'parallel', 'parameters': 'parameters', 'receiver': 'receiver', 'tag': 'tag'} _toPy = {'execution-group': 'execution_group', 'name': 'name', 'parallel': 'parallel', 'parameters': 'parameters', 'receiver': 'receiver', 'tag': 'tag'} + def __init__(self, execution_group=None, name=None, parallel=None, parameters=None, receiver=None, tag=None, **unknown_fields): ''' execution_group : str @@ -103,6 +106,7 @@ def __init__(self, execution_group=None, name=None, parallel=None, parameters=No class ActionExecutionResult(Type): _toSchema = {'action_tag': 'action-tag', 'message': 'message', 'results': 'results', 'status': 'status'} _toPy = {'action-tag': 'action_tag', 'message': 'message', 'results': 'results', 'status': 'status'} + def __init__(self, action_tag=None, message=None, results=None, status=None, **unknown_fields): ''' action_tag : str @@ -139,6 +143,7 @@ def __init__(self, action_tag=None, message=None, results=None, status=None, **u class ActionExecutionResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ActionExecutionResult] @@ -157,6 +162,7 @@ def __init__(self, results=None, **unknown_fields): class ActionMessage(Type): _toSchema = {'message': 'message', 'timestamp': 'timestamp'} _toPy = {'message': 'message', 'timestamp': 'timestamp'} + def __init__(self, message=None, timestamp=None, **unknown_fields): ''' message : str @@ -181,6 +187,7 @@ def __init__(self, message=None, timestamp=None, **unknown_fields): class ActionMessageParams(Type): _toSchema = {'messages': 'messages'} _toPy = {'messages': 'messages'} + def __init__(self, messages=None, **unknown_fields): ''' messages : typing.Sequence[~EntityString] @@ -199,6 +206,7 @@ def __init__(self, messages=None, **unknown_fields): class ActionPruneArgs(Type): _toSchema = {'max_history_mb': 'max-history-mb', 'max_history_time': 'max-history-time'} _toPy = {'max-history-mb': 'max_history_mb', 'max-history-time': 'max_history_time'} + def __init__(self, max_history_mb=None, max_history_time=None, **unknown_fields): ''' max_history_mb : int @@ -223,6 +231,7 @@ def __init__(self, max_history_mb=None, max_history_time=None, **unknown_fields) class ActionResult(Type): _toSchema = {'action': 'action', 'completed': 'completed', 'enqueued': 'enqueued', 'error': 'error', 'log': 'log', 'message': 'message', 'output': 'output', 'started': 'started', 'status': 'status'} _toPy = {'action': 'action', 'completed': 'completed', 'enqueued': 'enqueued', 'error': 'error', 'log': 'log', 'message': 'message', 'output': 'output', 'started': 'started', 'status': 'status'} + def __init__(self, action=None, completed=None, enqueued=None, error=None, log=None, message=None, output=None, started=None, status=None, **unknown_fields): ''' action : Action @@ -289,6 +298,7 @@ def __init__(self, action=None, completed=None, enqueued=None, error=None, log=N class ActionResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ActionResult] @@ -307,6 +317,7 @@ def __init__(self, results=None, **unknown_fields): class ActionSpec(Type): _toSchema = {'description': 'description', 'params': 'params'} _toPy = {'description': 'description', 'params': 'params'} + def __init__(self, description=None, params=None, **unknown_fields): ''' description : str @@ -331,6 +342,7 @@ def __init__(self, description=None, params=None, **unknown_fields): class Actions(Type): _toSchema = {'actions': 'actions'} _toPy = {'actions': 'actions'} + def __init__(self, actions=None, **unknown_fields): ''' actions : typing.Sequence[~Action] @@ -349,6 +361,7 @@ def __init__(self, actions=None, **unknown_fields): class ActionsByReceiver(Type): _toSchema = {'actions': 'actions', 'error': 'error', 'receiver': 'receiver'} _toPy = {'actions': 'actions', 'error': 'error', 'receiver': 'receiver'} + def __init__(self, actions=None, error=None, receiver=None, **unknown_fields): ''' actions : typing.Sequence[~ActionResult] @@ -379,6 +392,7 @@ def __init__(self, actions=None, error=None, receiver=None, **unknown_fields): class ActionsByReceivers(Type): _toSchema = {'actions': 'actions'} _toPy = {'actions': 'actions'} + def __init__(self, actions=None, **unknown_fields): ''' actions : typing.Sequence[~ActionsByReceiver] @@ -397,6 +411,7 @@ def __init__(self, actions=None, **unknown_fields): class ActivateModelArgs(Type): _toSchema = {'controller_alias': 'controller-alias', 'controller_tag': 'controller-tag', 'cross_model_uuids': 'cross-model-uuids', 'model_tag': 'model-tag', 'source_api_addrs': 'source-api-addrs', 'source_ca_cert': 'source-ca-cert'} _toPy = {'controller-alias': 'controller_alias', 'controller-tag': 'controller_tag', 'cross-model-uuids': 'cross_model_uuids', 'model-tag': 'model_tag', 'source-api-addrs': 'source_api_addrs', 'source-ca-cert': 'source_ca_cert'} + def __init__(self, controller_alias=None, controller_tag=None, cross_model_uuids=None, model_tag=None, source_api_addrs=None, source_ca_cert=None, **unknown_fields): ''' controller_alias : str @@ -445,6 +460,7 @@ def __init__(self, controller_alias=None, controller_tag=None, cross_model_uuids class AddApplicationOffer(Type): _toSchema = {'application_description': 'application-description', 'application_name': 'application-name', 'endpoints': 'endpoints', 'model_tag': 'model-tag', 'offer_name': 'offer-name', 'owner_tag': 'owner-tag'} _toPy = {'application-description': 'application_description', 'application-name': 'application_name', 'endpoints': 'endpoints', 'model-tag': 'model_tag', 'offer-name': 'offer_name', 'owner-tag': 'owner_tag'} + def __init__(self, application_description=None, application_name=None, endpoints=None, model_tag=None, offer_name=None, owner_tag=None, **unknown_fields): ''' application_description : str @@ -493,6 +509,7 @@ def __init__(self, application_description=None, application_name=None, endpoint class AddApplicationOffers(Type): _toSchema = {'offers': 'Offers'} _toPy = {'Offers': 'offers'} + def __init__(self, offers=None, **unknown_fields): ''' offers : typing.Sequence[~AddApplicationOffer] @@ -511,6 +528,7 @@ def __init__(self, offers=None, **unknown_fields): class AddApplicationUnits(Type): _toSchema = {'application': 'application', 'attach_storage': 'attach-storage', 'num_units': 'num-units', 'placement': 'placement', 'policy': 'policy'} _toPy = {'application': 'application', 'attach-storage': 'attach_storage', 'num-units': 'num_units', 'placement': 'placement', 'policy': 'policy'} + def __init__(self, application=None, attach_storage=None, num_units=None, placement=None, policy=None, **unknown_fields): ''' application : str @@ -553,6 +571,7 @@ def __init__(self, application=None, attach_storage=None, num_units=None, placem class AddApplicationUnitsResults(Type): _toSchema = {'units': 'units'} _toPy = {'units': 'units'} + def __init__(self, units=None, **unknown_fields): ''' units : typing.Sequence[str] @@ -571,6 +590,7 @@ def __init__(self, units=None, **unknown_fields): class AddCharmWithOrigin(Type): _toSchema = {'charm_origin': 'charm-origin', 'force': 'force', 'url': 'url'} _toPy = {'charm-origin': 'charm_origin', 'force': 'force', 'url': 'url'} + def __init__(self, charm_origin=None, force=None, url=None, **unknown_fields): ''' charm_origin : CharmOrigin @@ -601,6 +621,7 @@ def __init__(self, charm_origin=None, force=None, url=None, **unknown_fields): class AddCloudArgs(Type): _toSchema = {'cloud': 'cloud', 'force': 'force', 'name': 'name'} _toPy = {'cloud': 'cloud', 'force': 'force', 'name': 'name'} + def __init__(self, cloud=None, force=None, name=None, **unknown_fields): ''' cloud : Cloud @@ -631,6 +652,7 @@ def __init__(self, cloud=None, force=None, name=None, **unknown_fields): class AddMachineParams(Type): _toSchema = {'addresses': 'addresses', 'base': 'base', 'constraints': 'constraints', 'container_type': 'container-type', 'disks': 'disks', 'hardware_characteristics': 'hardware-characteristics', 'instance_id': 'instance-id', 'jobs': 'jobs', 'nonce': 'nonce', 'parent_id': 'parent-id', 'placement': 'placement'} _toPy = {'addresses': 'addresses', 'base': 'base', 'constraints': 'constraints', 'container-type': 'container_type', 'disks': 'disks', 'hardware-characteristics': 'hardware_characteristics', 'instance-id': 'instance_id', 'jobs': 'jobs', 'nonce': 'nonce', 'parent-id': 'parent_id', 'placement': 'placement'} + def __init__(self, addresses=None, base=None, constraints=None, container_type=None, disks=None, hardware_characteristics=None, instance_id=None, jobs=None, nonce=None, parent_id=None, placement=None, **unknown_fields): ''' addresses : typing.Sequence[~Address] @@ -709,6 +731,7 @@ def __init__(self, addresses=None, base=None, constraints=None, container_type=N class AddMachines(Type): _toSchema = {'params': 'params'} _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): ''' params : typing.Sequence[~AddMachineParams] @@ -727,6 +750,7 @@ def __init__(self, params=None, **unknown_fields): class AddMachinesResult(Type): _toSchema = {'error': 'error', 'machine': 'machine'} _toPy = {'error': 'error', 'machine': 'machine'} + def __init__(self, error=None, machine=None, **unknown_fields): ''' error : Error @@ -751,6 +775,7 @@ def __init__(self, error=None, machine=None, **unknown_fields): class AddMachinesResults(Type): _toSchema = {'machines': 'machines'} _toPy = {'machines': 'machines'} + def __init__(self, machines=None, **unknown_fields): ''' machines : typing.Sequence[~AddMachinesResult] @@ -769,6 +794,7 @@ def __init__(self, machines=None, **unknown_fields): class AddPendingResourcesArgsV2(Type): _toSchema = {'charm_origin': 'charm-origin', 'entity': 'Entity', 'macaroon': 'macaroon', 'resources': 'resources', 'tag': 'tag', 'url': 'url'} _toPy = {'Entity': 'entity', 'charm-origin': 'charm_origin', 'macaroon': 'macaroon', 'resources': 'resources', 'tag': 'tag', 'url': 'url'} + def __init__(self, entity=None, charm_origin=None, macaroon=None, resources=None, tag=None, url=None, **unknown_fields): ''' entity : Entity @@ -817,6 +843,7 @@ def __init__(self, entity=None, charm_origin=None, macaroon=None, resources=None class AddPendingResourcesResult(Type): _toSchema = {'error': 'error', 'errorresult': 'ErrorResult', 'pending_ids': 'pending-ids'} _toPy = {'ErrorResult': 'errorresult', 'error': 'error', 'pending-ids': 'pending_ids'} + def __init__(self, errorresult=None, error=None, pending_ids=None, **unknown_fields): ''' errorresult : ErrorResult @@ -847,6 +874,7 @@ def __init__(self, errorresult=None, error=None, pending_ids=None, **unknown_fie class AddRelation(Type): _toSchema = {'endpoints': 'endpoints', 'via_cidrs': 'via-cidrs'} _toPy = {'endpoints': 'endpoints', 'via-cidrs': 'via_cidrs'} + def __init__(self, endpoints=None, via_cidrs=None, **unknown_fields): ''' endpoints : typing.Sequence[str] @@ -871,6 +899,7 @@ def __init__(self, endpoints=None, via_cidrs=None, **unknown_fields): class AddRelationResults(Type): _toSchema = {'endpoints': 'endpoints'} _toPy = {'endpoints': 'endpoints'} + def __init__(self, endpoints=None, **unknown_fields): ''' endpoints : typing.Mapping[str, ~CharmRelation] @@ -889,6 +918,7 @@ def __init__(self, endpoints=None, **unknown_fields): class AddSecretBackendArg(Type): _toSchema = {'backend_type': 'backend-type', 'config': 'config', 'id_': 'id', 'name': 'name', 'secretbackend': 'SecretBackend', 'token_rotate_interval': 'token-rotate-interval'} _toPy = {'SecretBackend': 'secretbackend', 'backend-type': 'backend_type', 'config': 'config', 'id': 'id_', 'name': 'name', 'token-rotate-interval': 'token_rotate_interval'} + def __init__(self, secretbackend=None, backend_type=None, config=None, id_=None, name=None, token_rotate_interval=None, **unknown_fields): ''' secretbackend : SecretBackend @@ -937,6 +967,7 @@ def __init__(self, secretbackend=None, backend_type=None, config=None, id_=None, class AddSecretBackendArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~AddSecretBackendArg] @@ -955,6 +986,7 @@ def __init__(self, args=None, **unknown_fields): class AddStorageDetails(Type): _toSchema = {'storage_tags': 'storage-tags'} _toPy = {'storage-tags': 'storage_tags'} + def __init__(self, storage_tags=None, **unknown_fields): ''' storage_tags : typing.Sequence[str] @@ -973,6 +1005,7 @@ def __init__(self, storage_tags=None, **unknown_fields): class AddStorageResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -997,6 +1030,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class AddStorageResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~AddStorageResult] @@ -1015,6 +1049,7 @@ def __init__(self, results=None, **unknown_fields): class AddUser(Type): _toSchema = {'display_name': 'display-name', 'password': 'password', 'username': 'username'} _toPy = {'display-name': 'display_name', 'password': 'password', 'username': 'username'} + def __init__(self, display_name=None, password=None, username=None, **unknown_fields): ''' display_name : str @@ -1045,6 +1080,7 @@ def __init__(self, display_name=None, password=None, username=None, **unknown_fi class AddUserResult(Type): _toSchema = {'error': 'error', 'secret_key': 'secret-key', 'tag': 'tag'} _toPy = {'error': 'error', 'secret-key': 'secret_key', 'tag': 'tag'} + def __init__(self, error=None, secret_key=None, tag=None, **unknown_fields): ''' error : Error @@ -1075,6 +1111,7 @@ def __init__(self, error=None, secret_key=None, tag=None, **unknown_fields): class AddUserResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~AddUserResult] @@ -1093,6 +1130,7 @@ def __init__(self, results=None, **unknown_fields): class AddUsers(Type): _toSchema = {'users': 'users'} _toPy = {'users': 'users'} + def __init__(self, users=None, **unknown_fields): ''' users : typing.Sequence[~AddUser] @@ -1111,6 +1149,7 @@ def __init__(self, users=None, **unknown_fields): class Address(Type): _toSchema = {'cidr': 'cidr', 'config_type': 'config-type', 'is_secondary': 'is-secondary', 'scope': 'scope', 'space_id': 'space-id', 'space_name': 'space-name', 'type_': 'type', 'value': 'value'} _toPy = {'cidr': 'cidr', 'config-type': 'config_type', 'is-secondary': 'is_secondary', 'scope': 'scope', 'space-id': 'space_id', 'space-name': 'space_name', 'type': 'type_', 'value': 'value'} + def __init__(self, cidr=None, config_type=None, is_secondary=None, scope=None, space_id=None, space_name=None, type_=None, value=None, **unknown_fields): ''' cidr : str @@ -1171,6 +1210,7 @@ def __init__(self, cidr=None, config_type=None, is_secondary=None, scope=None, s class AdoptResourcesArgs(Type): _toSchema = {'model_tag': 'model-tag', 'source_controller_version': 'source-controller-version'} _toPy = {'model-tag': 'model_tag', 'source-controller-version': 'source_controller_version'} + def __init__(self, model_tag=None, source_controller_version=None, **unknown_fields): ''' model_tag : str @@ -1195,6 +1235,7 @@ def __init__(self, model_tag=None, source_controller_version=None, **unknown_fie class AgentGetEntitiesResult(Type): _toSchema = {'container_type': 'container-type', 'error': 'error', 'jobs': 'jobs', 'life': 'life'} _toPy = {'container-type': 'container_type', 'error': 'error', 'jobs': 'jobs', 'life': 'life'} + def __init__(self, container_type=None, error=None, jobs=None, life=None, **unknown_fields): ''' container_type : str @@ -1231,6 +1272,7 @@ def __init__(self, container_type=None, error=None, jobs=None, life=None, **unkn class AgentGetEntitiesResults(Type): _toSchema = {'entities': 'entities'} _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): ''' entities : typing.Sequence[~AgentGetEntitiesResult] @@ -1249,6 +1291,7 @@ def __init__(self, entities=None, **unknown_fields): class AllWatcherId(Type): _toSchema = {'watcher_id': 'watcher-id'} _toPy = {'watcher-id': 'watcher_id'} + def __init__(self, watcher_id=None, **unknown_fields): ''' watcher_id : str @@ -1267,6 +1310,7 @@ def __init__(self, watcher_id=None, **unknown_fields): class AllWatcherNextResults(Type): _toSchema = {'deltas': 'deltas'} _toPy = {'deltas': 'deltas'} + def __init__(self, deltas=None, **unknown_fields): ''' deltas : typing.Sequence[~Delta] @@ -1285,6 +1329,7 @@ def __init__(self, deltas=None, **unknown_fields): class AnnotationsGetResult(Type): _toSchema = {'annotations': 'annotations', 'entity': 'entity', 'error': 'error'} _toPy = {'annotations': 'annotations', 'entity': 'entity', 'error': 'error'} + def __init__(self, annotations=None, entity=None, error=None, **unknown_fields): ''' annotations : typing.Mapping[str, str] @@ -1315,6 +1360,7 @@ def __init__(self, annotations=None, entity=None, error=None, **unknown_fields): class AnnotationsGetResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~AnnotationsGetResult] @@ -1333,6 +1379,7 @@ def __init__(self, results=None, **unknown_fields): class AnnotationsSet(Type): _toSchema = {'annotations': 'annotations'} _toPy = {'annotations': 'annotations'} + def __init__(self, annotations=None, **unknown_fields): ''' annotations : typing.Sequence[~EntityAnnotations] @@ -1351,6 +1398,7 @@ def __init__(self, annotations=None, **unknown_fields): class ApplicationCharm(Type): _toSchema = {'charm_modified_version': 'charm-modified-version', 'deployment_mode': 'deployment-mode', 'force_upgrade': 'force-upgrade', 'sha256': 'sha256', 'url': 'url'} _toPy = {'charm-modified-version': 'charm_modified_version', 'deployment-mode': 'deployment_mode', 'force-upgrade': 'force_upgrade', 'sha256': 'sha256', 'url': 'url'} + def __init__(self, charm_modified_version=None, deployment_mode=None, force_upgrade=None, sha256=None, url=None, **unknown_fields): ''' charm_modified_version : int @@ -1393,6 +1441,7 @@ def __init__(self, charm_modified_version=None, deployment_mode=None, force_upgr class ApplicationCharmActionsResult(Type): _toSchema = {'actions': 'actions', 'application_tag': 'application-tag', 'error': 'error'} _toPy = {'actions': 'actions', 'application-tag': 'application_tag', 'error': 'error'} + def __init__(self, actions=None, application_tag=None, error=None, **unknown_fields): ''' actions : typing.Mapping[str, ~ActionSpec] @@ -1423,6 +1472,7 @@ def __init__(self, actions=None, application_tag=None, error=None, **unknown_fie class ApplicationCharmPlacement(Type): _toSchema = {'application': 'application', 'charm_url': 'charm-url'} _toPy = {'application': 'application', 'charm-url': 'charm_url'} + def __init__(self, application=None, charm_url=None, **unknown_fields): ''' application : str @@ -1447,6 +1497,7 @@ def __init__(self, application=None, charm_url=None, **unknown_fields): class ApplicationCharmPlacements(Type): _toSchema = {'placements': 'placements'} _toPy = {'placements': 'placements'} + def __init__(self, placements=None, **unknown_fields): ''' placements : typing.Sequence[~ApplicationCharmPlacement] @@ -1465,6 +1516,7 @@ def __init__(self, placements=None, **unknown_fields): class ApplicationCharmRelations(Type): _toSchema = {'application': 'application'} _toPy = {'application': 'application'} + def __init__(self, application=None, **unknown_fields): ''' application : str @@ -1483,6 +1535,7 @@ def __init__(self, application=None, **unknown_fields): class ApplicationCharmRelationsResults(Type): _toSchema = {'charm_relations': 'charm-relations'} _toPy = {'charm-relations': 'charm_relations'} + def __init__(self, charm_relations=None, **unknown_fields): ''' charm_relations : typing.Sequence[str] @@ -1501,6 +1554,7 @@ def __init__(self, charm_relations=None, **unknown_fields): class ApplicationCharmResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -1525,6 +1579,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class ApplicationCharmResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ApplicationCharmResult] @@ -1543,6 +1598,7 @@ def __init__(self, results=None, **unknown_fields): class ApplicationConfigUnsetArgs(Type): _toSchema = {'args': 'Args'} _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~ApplicationUnset] @@ -1561,6 +1617,7 @@ def __init__(self, args=None, **unknown_fields): class ApplicationConstraint(Type): _toSchema = {'constraints': 'constraints', 'error': 'error'} _toPy = {'constraints': 'constraints', 'error': 'error'} + def __init__(self, constraints=None, error=None, **unknown_fields): ''' constraints : Value @@ -1585,6 +1642,7 @@ def __init__(self, constraints=None, error=None, **unknown_fields): class ApplicationDeploy(Type): _toSchema = {'application': 'application', 'attach_storage': 'attach-storage', 'channel': 'channel', 'charm_origin': 'charm-origin', 'charm_url': 'charm-url', 'config': 'config', 'config_yaml': 'config-yaml', 'constraints': 'constraints', 'devices': 'devices', 'endpoint_bindings': 'endpoint-bindings', 'force': 'Force', 'num_units': 'num-units', 'placement': 'placement', 'policy': 'policy', 'resources': 'resources', 'storage': 'storage'} _toPy = {'Force': 'force', 'application': 'application', 'attach-storage': 'attach_storage', 'channel': 'channel', 'charm-origin': 'charm_origin', 'charm-url': 'charm_url', 'config': 'config', 'config-yaml': 'config_yaml', 'constraints': 'constraints', 'devices': 'devices', 'endpoint-bindings': 'endpoint_bindings', 'num-units': 'num_units', 'placement': 'placement', 'policy': 'policy', 'resources': 'resources', 'storage': 'storage'} + def __init__(self, force=None, application=None, attach_storage=None, channel=None, charm_origin=None, charm_url=None, config=None, config_yaml=None, constraints=None, devices=None, endpoint_bindings=None, num_units=None, placement=None, policy=None, resources=None, storage=None, **unknown_fields): ''' force : bool @@ -1693,6 +1751,7 @@ def __init__(self, force=None, application=None, attach_storage=None, channel=No class ApplicationExpose(Type): _toSchema = {'application': 'application', 'exposed_endpoints': 'exposed-endpoints'} _toPy = {'application': 'application', 'exposed-endpoints': 'exposed_endpoints'} + def __init__(self, application=None, exposed_endpoints=None, **unknown_fields): ''' application : str @@ -1717,6 +1776,7 @@ def __init__(self, application=None, exposed_endpoints=None, **unknown_fields): class ApplicationGet(Type): _toSchema = {'application': 'application', 'branch': 'branch'} _toPy = {'application': 'application', 'branch': 'branch'} + def __init__(self, application=None, branch=None, **unknown_fields): ''' application : str @@ -1741,6 +1801,7 @@ def __init__(self, application=None, branch=None, **unknown_fields): class ApplicationGetArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~ApplicationGet] @@ -1759,6 +1820,7 @@ def __init__(self, args=None, **unknown_fields): class ApplicationGetConfigResults(Type): _toSchema = {'results': 'Results'} _toPy = {'Results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ConfigResult] @@ -1777,6 +1839,7 @@ def __init__(self, results=None, **unknown_fields): class ApplicationGetConstraintsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ApplicationConstraint] @@ -1795,6 +1858,7 @@ def __init__(self, results=None, **unknown_fields): class ApplicationGetResults(Type): _toSchema = {'application': 'application', 'application_config': 'application-config', 'base': 'base', 'channel': 'channel', 'charm': 'charm', 'config': 'config', 'constraints': 'constraints', 'endpoint_bindings': 'endpoint-bindings'} _toPy = {'application': 'application', 'application-config': 'application_config', 'base': 'base', 'channel': 'channel', 'charm': 'charm', 'config': 'config', 'constraints': 'constraints', 'endpoint-bindings': 'endpoint_bindings'} + def __init__(self, application=None, application_config=None, base=None, channel=None, charm=None, config=None, constraints=None, endpoint_bindings=None, **unknown_fields): ''' application : str @@ -1855,6 +1919,7 @@ def __init__(self, application=None, application_config=None, base=None, channel class ApplicationInfoResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -1879,6 +1944,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class ApplicationInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ApplicationInfoResult] @@ -1897,6 +1963,7 @@ def __init__(self, results=None, **unknown_fields): class ApplicationMergeBindings(Type): _toSchema = {'application_tag': 'application-tag', 'bindings': 'bindings', 'force': 'force'} _toPy = {'application-tag': 'application_tag', 'bindings': 'bindings', 'force': 'force'} + def __init__(self, application_tag=None, bindings=None, force=None, **unknown_fields): ''' application_tag : str @@ -1927,6 +1994,7 @@ def __init__(self, application_tag=None, bindings=None, force=None, **unknown_fi class ApplicationMergeBindingsArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~ApplicationMergeBindings] @@ -1945,6 +2013,7 @@ def __init__(self, args=None, **unknown_fields): class ApplicationMetricCredential(Type): _toSchema = {'application': 'application', 'metrics_credentials': 'metrics-credentials'} _toPy = {'application': 'application', 'metrics-credentials': 'metrics_credentials'} + def __init__(self, application=None, metrics_credentials=None, **unknown_fields): ''' application : str @@ -1969,6 +2038,7 @@ def __init__(self, application=None, metrics_credentials=None, **unknown_fields) class ApplicationMetricCredentials(Type): _toSchema = {'creds': 'creds'} _toPy = {'creds': 'creds'} + def __init__(self, creds=None, **unknown_fields): ''' creds : typing.Sequence[~ApplicationMetricCredential] @@ -1987,6 +2057,7 @@ def __init__(self, creds=None, **unknown_fields): class ApplicationOfferAdminDetails(Type): _toSchema = {'application_description': 'application-description', 'application_name': 'application-name', 'applicationofferdetails': 'ApplicationOfferDetails', 'bindings': 'bindings', 'charm_url': 'charm-url', 'connections': 'connections', 'endpoints': 'endpoints', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'offer_uuid': 'offer-uuid', 'source_model_tag': 'source-model-tag', 'spaces': 'spaces', 'users': 'users'} _toPy = {'ApplicationOfferDetails': 'applicationofferdetails', 'application-description': 'application_description', 'application-name': 'application_name', 'bindings': 'bindings', 'charm-url': 'charm_url', 'connections': 'connections', 'endpoints': 'endpoints', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'offer-uuid': 'offer_uuid', 'source-model-tag': 'source_model_tag', 'spaces': 'spaces', 'users': 'users'} + def __init__(self, applicationofferdetails=None, application_description=None, application_name=None, bindings=None, charm_url=None, connections=None, endpoints=None, offer_name=None, offer_url=None, offer_uuid=None, source_model_tag=None, spaces=None, users=None, **unknown_fields): ''' applicationofferdetails : ApplicationOfferDetails @@ -2077,6 +2148,7 @@ def __init__(self, applicationofferdetails=None, application_description=None, a class ApplicationOfferAdminDetailsV5(Type): _toSchema = {'application_description': 'application-description', 'application_name': 'application-name', 'applicationofferdetailsv5': 'ApplicationOfferDetailsV5', 'charm_url': 'charm-url', 'connections': 'connections', 'endpoints': 'endpoints', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'offer_uuid': 'offer-uuid', 'source_model_tag': 'source-model-tag', 'users': 'users'} _toPy = {'ApplicationOfferDetailsV5': 'applicationofferdetailsv5', 'application-description': 'application_description', 'application-name': 'application_name', 'charm-url': 'charm_url', 'connections': 'connections', 'endpoints': 'endpoints', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'offer-uuid': 'offer_uuid', 'source-model-tag': 'source_model_tag', 'users': 'users'} + def __init__(self, applicationofferdetailsv5=None, application_description=None, application_name=None, charm_url=None, connections=None, endpoints=None, offer_name=None, offer_url=None, offer_uuid=None, source_model_tag=None, users=None, **unknown_fields): ''' applicationofferdetailsv5 : ApplicationOfferDetailsV5 @@ -2155,6 +2227,7 @@ def __init__(self, applicationofferdetailsv5=None, application_description=None, class ApplicationOfferDetails(Type): _toSchema = {'application_description': 'application-description', 'bindings': 'bindings', 'endpoints': 'endpoints', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'offer_uuid': 'offer-uuid', 'source_model_tag': 'source-model-tag', 'spaces': 'spaces', 'users': 'users'} _toPy = {'application-description': 'application_description', 'bindings': 'bindings', 'endpoints': 'endpoints', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'offer-uuid': 'offer_uuid', 'source-model-tag': 'source_model_tag', 'spaces': 'spaces', 'users': 'users'} + def __init__(self, application_description=None, bindings=None, endpoints=None, offer_name=None, offer_url=None, offer_uuid=None, source_model_tag=None, spaces=None, users=None, **unknown_fields): ''' application_description : str @@ -2221,6 +2294,7 @@ def __init__(self, application_description=None, bindings=None, endpoints=None, class ApplicationOfferDetailsV5(Type): _toSchema = {'application_description': 'application-description', 'endpoints': 'endpoints', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'offer_uuid': 'offer-uuid', 'source_model_tag': 'source-model-tag', 'users': 'users'} _toPy = {'application-description': 'application_description', 'endpoints': 'endpoints', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'offer-uuid': 'offer_uuid', 'source-model-tag': 'source_model_tag', 'users': 'users'} + def __init__(self, application_description=None, endpoints=None, offer_name=None, offer_url=None, offer_uuid=None, source_model_tag=None, users=None, **unknown_fields): ''' application_description : str @@ -2275,6 +2349,7 @@ def __init__(self, application_description=None, endpoints=None, offer_name=None class ApplicationOfferResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -2299,6 +2374,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class ApplicationOfferStatus(Type): _toSchema = {'active_connected_count': 'active-connected-count', 'application_name': 'application-name', 'charm': 'charm', 'endpoints': 'endpoints', 'err': 'err', 'offer_name': 'offer-name', 'total_connected_count': 'total-connected-count'} _toPy = {'active-connected-count': 'active_connected_count', 'application-name': 'application_name', 'charm': 'charm', 'endpoints': 'endpoints', 'err': 'err', 'offer-name': 'offer_name', 'total-connected-count': 'total_connected_count'} + def __init__(self, active_connected_count=None, application_name=None, charm=None, endpoints=None, err=None, offer_name=None, total_connected_count=None, **unknown_fields): ''' active_connected_count : int @@ -2353,6 +2429,7 @@ def __init__(self, active_connected_count=None, application_name=None, charm=Non class ApplicationOffersResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ApplicationOfferResult] @@ -2371,6 +2448,7 @@ def __init__(self, results=None, **unknown_fields): class ApplicationOpenedPorts(Type): _toSchema = {'endpoint': 'endpoint', 'port_ranges': 'port-ranges'} _toPy = {'endpoint': 'endpoint', 'port-ranges': 'port_ranges'} + def __init__(self, endpoint=None, port_ranges=None, **unknown_fields): ''' endpoint : str @@ -2395,6 +2473,7 @@ def __init__(self, endpoint=None, port_ranges=None, **unknown_fields): class ApplicationOpenedPortsResult(Type): _toSchema = {'application_port_ranges': 'application-port-ranges', 'error': 'error'} _toPy = {'application-port-ranges': 'application_port_ranges', 'error': 'error'} + def __init__(self, application_port_ranges=None, error=None, **unknown_fields): ''' application_port_ranges : typing.Sequence[~ApplicationOpenedPorts] @@ -2419,6 +2498,7 @@ def __init__(self, application_port_ranges=None, error=None, **unknown_fields): class ApplicationOpenedPortsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ApplicationOpenedPortsResult] @@ -2437,6 +2517,7 @@ def __init__(self, results=None, **unknown_fields): class ApplicationResult(Type): _toSchema = {'base': 'base', 'channel': 'channel', 'charm': 'charm', 'constraints': 'constraints', 'endpoint_bindings': 'endpoint-bindings', 'exposed': 'exposed', 'exposed_endpoints': 'exposed-endpoints', 'life': 'life', 'principal': 'principal', 'remote': 'remote', 'tag': 'tag'} _toPy = {'base': 'base', 'channel': 'channel', 'charm': 'charm', 'constraints': 'constraints', 'endpoint-bindings': 'endpoint_bindings', 'exposed': 'exposed', 'exposed-endpoints': 'exposed_endpoints', 'life': 'life', 'principal': 'principal', 'remote': 'remote', 'tag': 'tag'} + def __init__(self, base=None, channel=None, charm=None, constraints=None, endpoint_bindings=None, exposed=None, exposed_endpoints=None, life=None, principal=None, remote=None, tag=None, **unknown_fields): ''' base : Base @@ -2515,6 +2596,7 @@ def __init__(self, base=None, channel=None, charm=None, constraints=None, endpoi class ApplicationSetCharm(Type): _toSchema = {'application': 'application', 'channel': 'channel', 'charm_origin': 'charm-origin', 'charm_url': 'charm-url', 'config_settings': 'config-settings', 'config_settings_yaml': 'config-settings-yaml', 'endpoint_bindings': 'endpoint-bindings', 'force': 'force', 'force_base': 'force-base', 'force_units': 'force-units', 'generation': 'generation', 'resource_ids': 'resource-ids', 'storage_constraints': 'storage-constraints'} _toPy = {'application': 'application', 'channel': 'channel', 'charm-origin': 'charm_origin', 'charm-url': 'charm_url', 'config-settings': 'config_settings', 'config-settings-yaml': 'config_settings_yaml', 'endpoint-bindings': 'endpoint_bindings', 'force': 'force', 'force-base': 'force_base', 'force-units': 'force_units', 'generation': 'generation', 'resource-ids': 'resource_ids', 'storage-constraints': 'storage_constraints'} + def __init__(self, application=None, channel=None, charm_origin=None, charm_url=None, config_settings=None, config_settings_yaml=None, endpoint_bindings=None, force=None, force_base=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None, **unknown_fields): ''' application : str @@ -2605,6 +2687,7 @@ def __init__(self, application=None, channel=None, charm_origin=None, charm_url= class ApplicationStatus(Type): _toSchema = {'base': 'base', 'can_upgrade_to': 'can-upgrade-to', 'charm': 'charm', 'charm_channel': 'charm-channel', 'charm_profile': 'charm-profile', 'charm_version': 'charm-version', 'endpoint_bindings': 'endpoint-bindings', 'err': 'err', 'exposed': 'exposed', 'exposed_endpoints': 'exposed-endpoints', 'int_': 'int', 'life': 'life', 'meter_statuses': 'meter-statuses', 'provider_id': 'provider-id', 'public_address': 'public-address', 'relations': 'relations', 'status': 'status', 'subordinate_to': 'subordinate-to', 'units': 'units', 'workload_version': 'workload-version'} _toPy = {'base': 'base', 'can-upgrade-to': 'can_upgrade_to', 'charm': 'charm', 'charm-channel': 'charm_channel', 'charm-profile': 'charm_profile', 'charm-version': 'charm_version', 'endpoint-bindings': 'endpoint_bindings', 'err': 'err', 'exposed': 'exposed', 'exposed-endpoints': 'exposed_endpoints', 'int': 'int_', 'life': 'life', 'meter-statuses': 'meter_statuses', 'provider-id': 'provider_id', 'public-address': 'public_address', 'relations': 'relations', 'status': 'status', 'subordinate-to': 'subordinate_to', 'units': 'units', 'workload-version': 'workload_version'} + def __init__(self, base=None, can_upgrade_to=None, charm=None, charm_channel=None, charm_profile=None, charm_version=None, endpoint_bindings=None, err=None, exposed=None, exposed_endpoints=None, int_=None, life=None, meter_statuses=None, provider_id=None, public_address=None, relations=None, status=None, subordinate_to=None, units=None, workload_version=None, **unknown_fields): ''' base : Base @@ -2737,6 +2820,7 @@ def __init__(self, base=None, can_upgrade_to=None, charm=None, charm_channel=Non class ApplicationStatusResult(Type): _toSchema = {'application': 'application', 'error': 'error', 'units': 'units'} _toPy = {'application': 'application', 'error': 'error', 'units': 'units'} + def __init__(self, application=None, error=None, units=None, **unknown_fields): ''' application : StatusResult @@ -2767,6 +2851,7 @@ def __init__(self, application=None, error=None, units=None, **unknown_fields): class ApplicationStatusResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ApplicationStatusResult] @@ -2785,6 +2870,7 @@ def __init__(self, results=None, **unknown_fields): class ApplicationTag(Type): _toSchema = {'name': 'Name'} _toPy = {'Name': 'name'} + def __init__(self, name=None, **unknown_fields): ''' name : str @@ -2803,6 +2889,7 @@ def __init__(self, name=None, **unknown_fields): class ApplicationUnexpose(Type): _toSchema = {'application': 'application', 'exposed_endpoints': 'exposed-endpoints'} _toPy = {'application': 'application', 'exposed-endpoints': 'exposed_endpoints'} + def __init__(self, application=None, exposed_endpoints=None, **unknown_fields): ''' application : str @@ -2827,6 +2914,7 @@ def __init__(self, application=None, exposed_endpoints=None, **unknown_fields): class ApplicationUnitInfo(Type): _toSchema = {'provider_id': 'provider-id', 'unit_tag': 'unit-tag'} _toPy = {'provider-id': 'provider_id', 'unit-tag': 'unit_tag'} + def __init__(self, provider_id=None, unit_tag=None, **unknown_fields): ''' provider_id : str @@ -2851,6 +2939,7 @@ def __init__(self, provider_id=None, unit_tag=None, **unknown_fields): class ApplicationUnitParams(Type): _toSchema = {'address': 'address', 'data': 'data', 'filesystem_info': 'filesystem-info', 'info': 'info', 'ports': 'ports', 'provider_id': 'provider-id', 'stateful': 'stateful', 'status': 'status', 'unit_tag': 'unit-tag'} _toPy = {'address': 'address', 'data': 'data', 'filesystem-info': 'filesystem_info', 'info': 'info', 'ports': 'ports', 'provider-id': 'provider_id', 'stateful': 'stateful', 'status': 'status', 'unit-tag': 'unit_tag'} + def __init__(self, address=None, data=None, filesystem_info=None, info=None, ports=None, provider_id=None, stateful=None, status=None, unit_tag=None, **unknown_fields): ''' address : str @@ -2917,6 +3006,7 @@ def __init__(self, address=None, data=None, filesystem_info=None, info=None, por class ApplicationUnset(Type): _toSchema = {'application': 'application', 'branch': 'branch', 'options': 'options'} _toPy = {'application': 'application', 'branch': 'branch', 'options': 'options'} + def __init__(self, application=None, branch=None, options=None, **unknown_fields): ''' application : str @@ -2947,6 +3037,7 @@ def __init__(self, application=None, branch=None, options=None, **unknown_fields class ApplicationsCharmActionsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ApplicationCharmActionsResult] @@ -2965,6 +3056,7 @@ def __init__(self, results=None, **unknown_fields): class ApplicationsDeploy(Type): _toSchema = {'applications': 'applications'} _toPy = {'applications': 'applications'} + def __init__(self, applications=None, **unknown_fields): ''' applications : typing.Sequence[~ApplicationDeploy] @@ -2983,6 +3075,7 @@ def __init__(self, applications=None, **unknown_fields): class AuthUserInfo(Type): _toSchema = {'controller_access': 'controller-access', 'credentials': 'credentials', 'display_name': 'display-name', 'identity': 'identity', 'last_connection': 'last-connection', 'model_access': 'model-access'} _toPy = {'controller-access': 'controller_access', 'credentials': 'credentials', 'display-name': 'display_name', 'identity': 'identity', 'last-connection': 'last_connection', 'model-access': 'model_access'} + def __init__(self, controller_access=None, credentials=None, display_name=None, identity=None, last_connection=None, model_access=None, **unknown_fields): ''' controller_access : str @@ -3031,6 +3124,7 @@ def __init__(self, controller_access=None, credentials=None, display_name=None, class BackupsCreateArgs(Type): _toSchema = {'no_download': 'no-download', 'notes': 'notes'} _toPy = {'no-download': 'no_download', 'notes': 'notes'} + def __init__(self, no_download=None, notes=None, **unknown_fields): ''' no_download : bool @@ -3055,6 +3149,7 @@ def __init__(self, no_download=None, notes=None, **unknown_fields): class BackupsMetadataResult(Type): _toSchema = {'base': 'base', 'checksum': 'checksum', 'checksum_format': 'checksum-format', 'controller_machine_id': 'controller-machine-id', 'controller_machine_inst_id': 'controller-machine-inst-id', 'controller_uuid': 'controller-uuid', 'filename': 'filename', 'finished': 'finished', 'format_version': 'format-version', 'ha_nodes': 'ha-nodes', 'hostname': 'hostname', 'id_': 'id', 'machine': 'machine', 'model': 'model', 'notes': 'notes', 'size': 'size', 'started': 'started', 'stored': 'stored', 'version': 'version'} _toPy = {'base': 'base', 'checksum': 'checksum', 'checksum-format': 'checksum_format', 'controller-machine-id': 'controller_machine_id', 'controller-machine-inst-id': 'controller_machine_inst_id', 'controller-uuid': 'controller_uuid', 'filename': 'filename', 'finished': 'finished', 'format-version': 'format_version', 'ha-nodes': 'ha_nodes', 'hostname': 'hostname', 'id': 'id_', 'machine': 'machine', 'model': 'model', 'notes': 'notes', 'size': 'size', 'started': 'started', 'stored': 'stored', 'version': 'version'} + def __init__(self, base=None, checksum=None, checksum_format=None, controller_machine_id=None, controller_machine_inst_id=None, controller_uuid=None, filename=None, finished=None, format_version=None, ha_nodes=None, hostname=None, id_=None, machine=None, model=None, notes=None, size=None, started=None, stored=None, version=None, **unknown_fields): ''' base : str @@ -3181,6 +3276,7 @@ def __init__(self, base=None, checksum=None, checksum_format=None, controller_ma class Base(Type): _toSchema = {'channel': 'channel', 'name': 'name'} _toPy = {'channel': 'channel', 'name': 'name'} + def __init__(self, channel=None, name=None, **unknown_fields): ''' channel : str @@ -3205,6 +3301,7 @@ def __init__(self, channel=None, name=None, **unknown_fields): class Binary(Type): _toSchema = {'arch': 'Arch', 'build': 'Build', 'major': 'Major', 'minor': 'Minor', 'number': 'Number', 'patch': 'Patch', 'release': 'Release', 'tag': 'Tag'} _toPy = {'Arch': 'arch', 'Build': 'build', 'Major': 'major', 'Minor': 'minor', 'Number': 'number', 'Patch': 'patch', 'Release': 'release', 'Tag': 'tag'} + def __init__(self, arch=None, build=None, major=None, minor=None, number=None, patch=None, release=None, tag=None, **unknown_fields): ''' arch : str @@ -3265,6 +3362,7 @@ def __init__(self, arch=None, build=None, major=None, minor=None, number=None, p class Block(Type): _toSchema = {'id_': 'id', 'message': 'message', 'tag': 'tag', 'type_': 'type'} _toPy = {'id': 'id_', 'message': 'message', 'tag': 'tag', 'type': 'type_'} + def __init__(self, id_=None, message=None, tag=None, type_=None, **unknown_fields): ''' id_ : str @@ -3301,6 +3399,7 @@ def __init__(self, id_=None, message=None, tag=None, type_=None, **unknown_field class BlockDevice(Type): _toSchema = {'busaddress': 'BusAddress', 'devicelinks': 'DeviceLinks', 'devicename': 'DeviceName', 'filesystemtype': 'FilesystemType', 'hardwareid': 'HardwareId', 'inuse': 'InUse', 'label': 'Label', 'mountpoint': 'MountPoint', 'serialid': 'SerialId', 'size': 'Size', 'uuid': 'UUID', 'wwn': 'WWN'} _toPy = {'BusAddress': 'busaddress', 'DeviceLinks': 'devicelinks', 'DeviceName': 'devicename', 'FilesystemType': 'filesystemtype', 'HardwareId': 'hardwareid', 'InUse': 'inuse', 'Label': 'label', 'MountPoint': 'mountpoint', 'SerialId': 'serialid', 'Size': 'size', 'UUID': 'uuid', 'WWN': 'wwn'} + def __init__(self, busaddress=None, devicelinks=None, devicename=None, filesystemtype=None, hardwareid=None, inuse=None, label=None, mountpoint=None, serialid=None, size=None, uuid=None, wwn=None, **unknown_fields): ''' busaddress : str @@ -3385,6 +3484,7 @@ def __init__(self, busaddress=None, devicelinks=None, devicename=None, filesyste class BlockDeviceResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -3409,6 +3509,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class BlockDeviceResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~BlockDeviceResult] @@ -3427,6 +3528,7 @@ def __init__(self, results=None, **unknown_fields): class BlockResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -3451,6 +3553,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class BlockResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~BlockResult] @@ -3469,6 +3572,7 @@ def __init__(self, results=None, **unknown_fields): class BlockSwitchParams(Type): _toSchema = {'message': 'message', 'type_': 'type'} _toPy = {'message': 'message', 'type': 'type_'} + def __init__(self, message=None, type_=None, **unknown_fields): ''' message : str @@ -3493,6 +3597,7 @@ def __init__(self, message=None, type_=None, **unknown_fields): class BoolResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -3517,6 +3622,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class BoolResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~BoolResult] @@ -3535,6 +3641,7 @@ def __init__(self, results=None, **unknown_fields): class BranchArg(Type): _toSchema = {'branch': 'branch'} _toPy = {'branch': 'branch'} + def __init__(self, branch=None, **unknown_fields): ''' branch : str @@ -3553,6 +3660,7 @@ def __init__(self, branch=None, **unknown_fields): class BranchInfoArgs(Type): _toSchema = {'branches': 'branches', 'detailed': 'detailed'} _toPy = {'branches': 'branches', 'detailed': 'detailed'} + def __init__(self, branches=None, detailed=None, **unknown_fields): ''' branches : typing.Sequence[str] @@ -3577,6 +3685,7 @@ def __init__(self, branches=None, detailed=None, **unknown_fields): class BranchResults(Type): _toSchema = {'error': 'error', 'generations': 'generations'} _toPy = {'error': 'error', 'generations': 'generations'} + def __init__(self, error=None, generations=None, **unknown_fields): ''' error : Error @@ -3601,6 +3710,7 @@ def __init__(self, error=None, generations=None, **unknown_fields): class BranchStatus(Type): _toSchema = {'assigned_units': 'assigned-units', 'created': 'created', 'created_by': 'created-by'} _toPy = {'assigned-units': 'assigned_units', 'created': 'created', 'created-by': 'created_by'} + def __init__(self, assigned_units=None, created=None, created_by=None, **unknown_fields): ''' assigned_units : typing.Mapping[str, typing.Sequence[str]] @@ -3631,6 +3741,7 @@ def __init__(self, assigned_units=None, created=None, created_by=None, **unknown class BranchTrackArg(Type): _toSchema = {'branch': 'branch', 'entities': 'entities', 'num_units': 'num-units'} _toPy = {'branch': 'branch', 'entities': 'entities', 'num-units': 'num_units'} + def __init__(self, branch=None, entities=None, num_units=None, **unknown_fields): ''' branch : str @@ -3661,6 +3772,7 @@ def __init__(self, branch=None, entities=None, num_units=None, **unknown_fields) class BulkImportStorageParams(Type): _toSchema = {'storage': 'storage'} _toPy = {'storage': 'storage'} + def __init__(self, storage=None, **unknown_fields): ''' storage : typing.Sequence[~ImportStorageParams] @@ -3679,6 +3791,7 @@ def __init__(self, storage=None, **unknown_fields): class BundleChange(Type): _toSchema = {'args': 'args', 'id_': 'id', 'method': 'method', 'requires': 'requires'} _toPy = {'args': 'args', 'id': 'id_', 'method': 'method', 'requires': 'requires'} + def __init__(self, args=None, id_=None, method=None, requires=None, **unknown_fields): ''' args : typing.Sequence[typing.Any] @@ -3715,6 +3828,7 @@ def __init__(self, args=None, id_=None, method=None, requires=None, **unknown_fi class BundleChangesMapArgs(Type): _toSchema = {'args': 'args', 'id_': 'id', 'method': 'method', 'requires': 'requires'} _toPy = {'args': 'args', 'id': 'id_', 'method': 'method', 'requires': 'requires'} + def __init__(self, args=None, id_=None, method=None, requires=None, **unknown_fields): ''' args : typing.Mapping[str, typing.Any] @@ -3751,6 +3865,7 @@ def __init__(self, args=None, id_=None, method=None, requires=None, **unknown_fi class BundleChangesMapArgsResults(Type): _toSchema = {'changes': 'changes', 'errors': 'errors'} _toPy = {'changes': 'changes', 'errors': 'errors'} + def __init__(self, changes=None, errors=None, **unknown_fields): ''' changes : typing.Sequence[~BundleChangesMapArgs] @@ -3775,6 +3890,7 @@ def __init__(self, changes=None, errors=None, **unknown_fields): class BundleChangesParams(Type): _toSchema = {'bundleurl': 'bundleURL', 'yaml': 'yaml'} _toPy = {'bundleURL': 'bundleurl', 'yaml': 'yaml'} + def __init__(self, bundleurl=None, yaml=None, **unknown_fields): ''' bundleurl : str @@ -3799,6 +3915,7 @@ def __init__(self, bundleurl=None, yaml=None, **unknown_fields): class BundleChangesResults(Type): _toSchema = {'changes': 'changes', 'errors': 'errors'} _toPy = {'changes': 'changes', 'errors': 'errors'} + def __init__(self, changes=None, errors=None, **unknown_fields): ''' changes : typing.Sequence[~BundleChange] @@ -3823,6 +3940,7 @@ def __init__(self, changes=None, errors=None, **unknown_fields): class BytesResult(Type): _toSchema = {'result': 'result'} _toPy = {'result': 'result'} + def __init__(self, result=None, **unknown_fields): ''' result : typing.Sequence[int] @@ -3841,6 +3959,7 @@ def __init__(self, result=None, **unknown_fields): class CAASApplicationGarbageCollectArg(Type): _toSchema = {'active_pod_names': 'active-pod-names', 'application': 'application', 'desired_replicas': 'desired-replicas', 'force': 'force', 'observed_units': 'observed-units'} _toPy = {'active-pod-names': 'active_pod_names', 'application': 'application', 'desired-replicas': 'desired_replicas', 'force': 'force', 'observed-units': 'observed_units'} + def __init__(self, active_pod_names=None, application=None, desired_replicas=None, force=None, observed_units=None, **unknown_fields): ''' active_pod_names : typing.Sequence[str] @@ -3883,6 +4002,7 @@ def __init__(self, active_pod_names=None, application=None, desired_replicas=Non class CAASApplicationGarbageCollectArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~CAASApplicationGarbageCollectArg] @@ -3901,6 +4021,7 @@ def __init__(self, args=None, **unknown_fields): class CAASApplicationOCIResourceResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -3925,6 +4046,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class CAASApplicationOCIResourceResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~CAASApplicationOCIResourceResult] @@ -3943,6 +4065,7 @@ def __init__(self, results=None, **unknown_fields): class CAASApplicationOCIResources(Type): _toSchema = {'images': 'images'} _toPy = {'images': 'images'} + def __init__(self, images=None, **unknown_fields): ''' images : typing.Mapping[str, ~DockerImageInfo] @@ -3961,6 +4084,7 @@ def __init__(self, images=None, **unknown_fields): class CAASApplicationProvisionerConfig(Type): _toSchema = {'unmanaged_applications': 'unmanaged-applications'} _toPy = {'unmanaged-applications': 'unmanaged_applications'} + def __init__(self, unmanaged_applications=None, **unknown_fields): ''' unmanaged_applications : Entities @@ -3979,6 +4103,7 @@ def __init__(self, unmanaged_applications=None, **unknown_fields): class CAASApplicationProvisionerConfigResult(Type): _toSchema = {'error': 'error', 'provisioner_config': 'provisioner-config'} _toPy = {'error': 'error', 'provisioner-config': 'provisioner_config'} + def __init__(self, error=None, provisioner_config=None, **unknown_fields): ''' error : Error @@ -4003,6 +4128,7 @@ def __init__(self, error=None, provisioner_config=None, **unknown_fields): class CAASApplicationProvisioningInfo(Type): _toSchema = {'api_addresses': 'api-addresses', 'base': 'base', 'ca_cert': 'ca-cert', 'charm_modified_version': 'charm-modified-version', 'charm_url': 'charm-url', 'constraints': 'constraints', 'devices': 'devices', 'error': 'error', 'filesystems': 'filesystems', 'image_repo': 'image-repo', 'scale': 'scale', 'tags': 'tags', 'trust': 'trust', 'version': 'version', 'volumes': 'volumes'} _toPy = {'api-addresses': 'api_addresses', 'base': 'base', 'ca-cert': 'ca_cert', 'charm-modified-version': 'charm_modified_version', 'charm-url': 'charm_url', 'constraints': 'constraints', 'devices': 'devices', 'error': 'error', 'filesystems': 'filesystems', 'image-repo': 'image_repo', 'scale': 'scale', 'tags': 'tags', 'trust': 'trust', 'version': 'version', 'volumes': 'volumes'} + def __init__(self, api_addresses=None, base=None, ca_cert=None, charm_modified_version=None, charm_url=None, constraints=None, devices=None, error=None, filesystems=None, image_repo=None, scale=None, tags=None, trust=None, version=None, volumes=None, **unknown_fields): ''' api_addresses : typing.Sequence[str] @@ -4105,6 +4231,7 @@ def __init__(self, api_addresses=None, base=None, ca_cert=None, charm_modified_v class CAASApplicationProvisioningInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~CAASApplicationProvisioningInfo] @@ -4123,6 +4250,7 @@ def __init__(self, results=None, **unknown_fields): class CAASApplicationProvisioningState(Type): _toSchema = {'scale_target': 'scale-target', 'scaling': 'scaling'} _toPy = {'scale-target': 'scale_target', 'scaling': 'scaling'} + def __init__(self, scale_target=None, scaling=None, **unknown_fields): ''' scale_target : int @@ -4147,6 +4275,7 @@ def __init__(self, scale_target=None, scaling=None, **unknown_fields): class CAASApplicationProvisioningStateArg(Type): _toSchema = {'application': 'application', 'provisioning_state': 'provisioning-state'} _toPy = {'application': 'application', 'provisioning-state': 'provisioning_state'} + def __init__(self, application=None, provisioning_state=None, **unknown_fields): ''' application : Entity @@ -4171,6 +4300,7 @@ def __init__(self, application=None, provisioning_state=None, **unknown_fields): class CAASApplicationProvisioningStateResult(Type): _toSchema = {'error': 'error', 'provisioning_state': 'provisioning-state'} _toPy = {'error': 'error', 'provisioning-state': 'provisioning_state'} + def __init__(self, error=None, provisioning_state=None, **unknown_fields): ''' error : Error @@ -4195,6 +4325,7 @@ def __init__(self, error=None, provisioning_state=None, **unknown_fields): class CAASUnitInfo(Type): _toSchema = {'tag': 'tag', 'unit_status': 'unit-status'} _toPy = {'tag': 'tag', 'unit-status': 'unit_status'} + def __init__(self, tag=None, unit_status=None, **unknown_fields): ''' tag : str @@ -4219,6 +4350,7 @@ def __init__(self, tag=None, unit_status=None, **unknown_fields): class CAASUnitIntroduction(Type): _toSchema = {'agent_conf': 'agent-conf', 'unit_name': 'unit-name'} _toPy = {'agent-conf': 'agent_conf', 'unit-name': 'unit_name'} + def __init__(self, agent_conf=None, unit_name=None, **unknown_fields): ''' agent_conf : typing.Sequence[int] @@ -4243,6 +4375,7 @@ def __init__(self, agent_conf=None, unit_name=None, **unknown_fields): class CAASUnitIntroductionArgs(Type): _toSchema = {'pod_name': 'pod-name', 'pod_uuid': 'pod-uuid'} _toPy = {'pod-name': 'pod_name', 'pod-uuid': 'pod_uuid'} + def __init__(self, pod_name=None, pod_uuid=None, **unknown_fields): ''' pod_name : str @@ -4267,6 +4400,7 @@ def __init__(self, pod_name=None, pod_uuid=None, **unknown_fields): class CAASUnitIntroductionResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -4291,6 +4425,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class CAASUnitTerminationResult(Type): _toSchema = {'error': 'Error', 'willrestart': 'WillRestart'} _toPy = {'Error': 'error', 'WillRestart': 'willrestart'} + def __init__(self, error=None, willrestart=None, **unknown_fields): ''' error : Error @@ -4315,6 +4450,7 @@ def __init__(self, error=None, willrestart=None, **unknown_fields): class CAASUnitsResult(Type): _toSchema = {'error': 'error', 'units': 'units'} _toPy = {'error': 'error', 'units': 'units'} + def __init__(self, error=None, units=None, **unknown_fields): ''' error : Error @@ -4339,6 +4475,7 @@ def __init__(self, error=None, units=None, **unknown_fields): class CAASUnitsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~CAASUnitsResult] @@ -4357,6 +4494,7 @@ def __init__(self, results=None, **unknown_fields): class CIDRParams(Type): _toSchema = {'cidrs': 'cidrs'} _toPy = {'cidrs': 'cidrs'} + def __init__(self, cidrs=None, **unknown_fields): ''' cidrs : typing.Sequence[str] @@ -4375,6 +4513,7 @@ def __init__(self, cidrs=None, **unknown_fields): class ChangeModelCredentialParams(Type): _toSchema = {'credential_tag': 'credential-tag', 'model_tag': 'model-tag'} _toPy = {'credential-tag': 'credential_tag', 'model-tag': 'model_tag'} + def __init__(self, credential_tag=None, model_tag=None, **unknown_fields): ''' credential_tag : str @@ -4399,6 +4538,7 @@ def __init__(self, credential_tag=None, model_tag=None, **unknown_fields): class ChangeModelCredentialsParams(Type): _toSchema = {'model_credentials': 'model-credentials'} _toPy = {'model-credentials': 'model_credentials'} + def __init__(self, model_credentials=None, **unknown_fields): ''' model_credentials : typing.Sequence[~ChangeModelCredentialParams] @@ -4417,6 +4557,7 @@ def __init__(self, model_credentials=None, **unknown_fields): class ChangeSecretBackendArg(Type): _toSchema = {'content': 'content', 'revision': 'revision', 'uri': 'uri'} _toPy = {'content': 'content', 'revision': 'revision', 'uri': 'uri'} + def __init__(self, content=None, revision=None, uri=None, **unknown_fields): ''' content : SecretContentParams @@ -4447,6 +4588,7 @@ def __init__(self, content=None, revision=None, uri=None, **unknown_fields): class ChangeSecretBackendArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~ChangeSecretBackendArg] @@ -4465,6 +4607,7 @@ def __init__(self, args=None, **unknown_fields): class Channel(Type): _toSchema = {'branch': 'branch', 'risk': 'risk', 'track': 'track'} _toPy = {'branch': 'branch', 'risk': 'risk', 'track': 'track'} + def __init__(self, branch=None, risk=None, track=None, **unknown_fields): ''' branch : str @@ -4495,6 +4638,7 @@ def __init__(self, branch=None, risk=None, track=None, **unknown_fields): class Charm(Type): _toSchema = {'actions': 'actions', 'config': 'config', 'lxd_profile': 'lxd-profile', 'manifest': 'manifest', 'meta': 'meta', 'metrics': 'metrics', 'revision': 'revision', 'url': 'url'} _toPy = {'actions': 'actions', 'config': 'config', 'lxd-profile': 'lxd_profile', 'manifest': 'manifest', 'meta': 'meta', 'metrics': 'metrics', 'revision': 'revision', 'url': 'url'} + def __init__(self, actions=None, config=None, lxd_profile=None, manifest=None, meta=None, metrics=None, revision=None, url=None, **unknown_fields): ''' actions : CharmActions @@ -4555,6 +4699,7 @@ def __init__(self, actions=None, config=None, lxd_profile=None, manifest=None, m class CharmActionSpec(Type): _toSchema = {'description': 'description', 'params': 'params'} _toPy = {'description': 'description', 'params': 'params'} + def __init__(self, description=None, params=None, **unknown_fields): ''' description : str @@ -4579,6 +4724,7 @@ def __init__(self, description=None, params=None, **unknown_fields): class CharmActions(Type): _toSchema = {'specs': 'specs'} _toPy = {'specs': 'specs'} + def __init__(self, specs=None, **unknown_fields): ''' specs : typing.Mapping[str, ~CharmActionSpec] @@ -4597,6 +4743,7 @@ def __init__(self, specs=None, **unknown_fields): class CharmBase(Type): _toSchema = {'architectures': 'architectures', 'channel': 'channel', 'name': 'name'} _toPy = {'architectures': 'architectures', 'channel': 'channel', 'name': 'name'} + def __init__(self, architectures=None, channel=None, name=None, **unknown_fields): ''' architectures : typing.Sequence[str] @@ -4627,6 +4774,7 @@ def __init__(self, architectures=None, channel=None, name=None, **unknown_fields class CharmContainer(Type): _toSchema = {'gid': 'gid', 'mounts': 'mounts', 'resource': 'resource', 'uid': 'uid'} _toPy = {'gid': 'gid', 'mounts': 'mounts', 'resource': 'resource', 'uid': 'uid'} + def __init__(self, gid=None, mounts=None, resource=None, uid=None, **unknown_fields): ''' gid : int @@ -4663,6 +4811,7 @@ def __init__(self, gid=None, mounts=None, resource=None, uid=None, **unknown_fie class CharmDeployment(Type): _toSchema = {'min_version': 'min-version', 'mode': 'mode', 'service': 'service', 'type_': 'type'} _toPy = {'min-version': 'min_version', 'mode': 'mode', 'service': 'service', 'type': 'type_'} + def __init__(self, min_version=None, mode=None, service=None, type_=None, **unknown_fields): ''' min_version : str @@ -4699,6 +4848,7 @@ def __init__(self, min_version=None, mode=None, service=None, type_=None, **unkn class CharmDevice(Type): _toSchema = {'countmax': 'CountMax', 'countmin': 'CountMin', 'description': 'Description', 'name': 'Name', 'type_': 'Type'} _toPy = {'CountMax': 'countmax', 'CountMin': 'countmin', 'Description': 'description', 'Name': 'name', 'Type': 'type_'} + def __init__(self, countmax=None, countmin=None, description=None, name=None, type_=None, **unknown_fields): ''' countmax : int @@ -4741,6 +4891,7 @@ def __init__(self, countmax=None, countmin=None, description=None, name=None, ty class CharmLXDProfile(Type): _toSchema = {'config': 'config', 'description': 'description', 'devices': 'devices'} _toPy = {'config': 'config', 'description': 'description', 'devices': 'devices'} + def __init__(self, config=None, description=None, devices=None, **unknown_fields): ''' config : typing.Mapping[str, str] @@ -4771,6 +4922,7 @@ def __init__(self, config=None, description=None, devices=None, **unknown_fields class CharmManifest(Type): _toSchema = {'bases': 'bases'} _toPy = {'bases': 'bases'} + def __init__(self, bases=None, **unknown_fields): ''' bases : typing.Sequence[~CharmBase] @@ -4789,6 +4941,7 @@ def __init__(self, bases=None, **unknown_fields): class CharmMeta(Type): _toSchema = {'assumes_expr': 'assumes-expr', 'categories': 'categories', 'charm_user': 'charm-user', 'containers': 'containers', 'deployment': 'deployment', 'description': 'description', 'devices': 'devices', 'extra_bindings': 'extra-bindings', 'min_juju_version': 'min-juju-version', 'name': 'name', 'payload_classes': 'payload-classes', 'peers': 'peers', 'provides': 'provides', 'requires': 'requires', 'resources': 'resources', 'series': 'series', 'storage': 'storage', 'subordinate': 'subordinate', 'summary': 'summary', 'tags': 'tags', 'terms': 'terms'} _toPy = {'assumes-expr': 'assumes_expr', 'categories': 'categories', 'charm-user': 'charm_user', 'containers': 'containers', 'deployment': 'deployment', 'description': 'description', 'devices': 'devices', 'extra-bindings': 'extra_bindings', 'min-juju-version': 'min_juju_version', 'name': 'name', 'payload-classes': 'payload_classes', 'peers': 'peers', 'provides': 'provides', 'requires': 'requires', 'resources': 'resources', 'series': 'series', 'storage': 'storage', 'subordinate': 'subordinate', 'summary': 'summary', 'tags': 'tags', 'terms': 'terms'} + def __init__(self, assumes_expr=None, categories=None, charm_user=None, containers=None, deployment=None, description=None, devices=None, extra_bindings=None, min_juju_version=None, name=None, payload_classes=None, peers=None, provides=None, requires=None, resources=None, series=None, storage=None, subordinate=None, summary=None, tags=None, terms=None, **unknown_fields): ''' assumes_expr : ExpressionTree @@ -4927,6 +5080,7 @@ def __init__(self, assumes_expr=None, categories=None, charm_user=None, containe class CharmMetric(Type): _toSchema = {'description': 'description', 'type_': 'type'} _toPy = {'description': 'description', 'type': 'type_'} + def __init__(self, description=None, type_=None, **unknown_fields): ''' description : str @@ -4951,6 +5105,7 @@ def __init__(self, description=None, type_=None, **unknown_fields): class CharmMetrics(Type): _toSchema = {'metrics': 'metrics', 'plan': 'plan'} _toPy = {'metrics': 'metrics', 'plan': 'plan'} + def __init__(self, metrics=None, plan=None, **unknown_fields): ''' metrics : typing.Mapping[str, ~CharmMetric] @@ -4975,6 +5130,7 @@ def __init__(self, metrics=None, plan=None, **unknown_fields): class CharmMount(Type): _toSchema = {'location': 'location', 'storage': 'storage'} _toPy = {'location': 'location', 'storage': 'storage'} + def __init__(self, location=None, storage=None, **unknown_fields): ''' location : str @@ -4999,6 +5155,7 @@ def __init__(self, location=None, storage=None, **unknown_fields): class CharmOption(Type): _toSchema = {'default': 'default', 'description': 'description', 'type_': 'type'} _toPy = {'default': 'default', 'description': 'description', 'type': 'type_'} + def __init__(self, default=None, description=None, type_=None, **unknown_fields): ''' default : Any @@ -5026,6 +5183,7 @@ def __init__(self, default=None, description=None, type_=None, **unknown_fields) class CharmOrigin(Type): _toSchema = {'architecture': 'architecture', 'base': 'base', 'branch': 'branch', 'hash_': 'hash', 'id_': 'id', 'instance_key': 'instance-key', 'revision': 'revision', 'risk': 'risk', 'source': 'source', 'track': 'track', 'type_': 'type'} _toPy = {'architecture': 'architecture', 'base': 'base', 'branch': 'branch', 'hash': 'hash_', 'id': 'id_', 'instance-key': 'instance_key', 'revision': 'revision', 'risk': 'risk', 'source': 'source', 'track': 'track', 'type': 'type_'} + def __init__(self, architecture=None, base=None, branch=None, hash_=None, id_=None, instance_key=None, revision=None, risk=None, source=None, track=None, type_=None, **unknown_fields): ''' architecture : str @@ -5104,6 +5262,7 @@ def __init__(self, architecture=None, base=None, branch=None, hash_=None, id_=No class CharmOriginResult(Type): _toSchema = {'charm_origin': 'charm-origin', 'error': 'error'} _toPy = {'charm-origin': 'charm_origin', 'error': 'error'} + def __init__(self, charm_origin=None, error=None, **unknown_fields): ''' charm_origin : CharmOrigin @@ -5128,6 +5287,7 @@ def __init__(self, charm_origin=None, error=None, **unknown_fields): class CharmPayloadClass(Type): _toSchema = {'name': 'name', 'type_': 'type'} _toPy = {'name': 'name', 'type': 'type_'} + def __init__(self, name=None, type_=None, **unknown_fields): ''' name : str @@ -5152,6 +5312,7 @@ def __init__(self, name=None, type_=None, **unknown_fields): class CharmPlan(Type): _toSchema = {'required': 'required'} _toPy = {'required': 'required'} + def __init__(self, required=None, **unknown_fields): ''' required : bool @@ -5170,6 +5331,7 @@ def __init__(self, required=None, **unknown_fields): class CharmProfilingInfoResult(Type): _toSchema = {'current_profiles': 'current-profiles', 'error': 'error', 'instance_id': 'instance-id', 'model_name': 'model-name', 'profile_changes': 'profile-changes'} _toPy = {'current-profiles': 'current_profiles', 'error': 'error', 'instance-id': 'instance_id', 'model-name': 'model_name', 'profile-changes': 'profile_changes'} + def __init__(self, current_profiles=None, error=None, instance_id=None, model_name=None, profile_changes=None, **unknown_fields): ''' current_profiles : typing.Sequence[str] @@ -5212,6 +5374,7 @@ def __init__(self, current_profiles=None, error=None, instance_id=None, model_na class CharmRelation(Type): _toSchema = {'interface': 'interface', 'limit': 'limit', 'name': 'name', 'optional': 'optional', 'role': 'role', 'scope': 'scope'} _toPy = {'interface': 'interface', 'limit': 'limit', 'name': 'name', 'optional': 'optional', 'role': 'role', 'scope': 'scope'} + def __init__(self, interface=None, limit=None, name=None, optional=None, role=None, scope=None, **unknown_fields): ''' interface : str @@ -5260,6 +5423,7 @@ def __init__(self, interface=None, limit=None, name=None, optional=None, role=No class CharmResource(Type): _toSchema = {'description': 'description', 'fingerprint': 'fingerprint', 'name': 'name', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'type_': 'type'} _toPy = {'description': 'description', 'fingerprint': 'fingerprint', 'name': 'name', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'type': 'type_'} + def __init__(self, description=None, fingerprint=None, name=None, origin=None, path=None, revision=None, size=None, type_=None, **unknown_fields): ''' description : str @@ -5320,6 +5484,7 @@ def __init__(self, description=None, fingerprint=None, name=None, origin=None, p class CharmResourceMeta(Type): _toSchema = {'description': 'description', 'name': 'name', 'path': 'path', 'type_': 'type'} _toPy = {'description': 'description', 'name': 'name', 'path': 'path', 'type': 'type_'} + def __init__(self, description=None, name=None, path=None, type_=None, **unknown_fields): ''' description : str @@ -5356,6 +5521,7 @@ def __init__(self, description=None, name=None, path=None, type_=None, **unknown class CharmResourceResult(Type): _toSchema = {'charmresource': 'CharmResource', 'description': 'description', 'error': 'error', 'errorresult': 'ErrorResult', 'fingerprint': 'fingerprint', 'name': 'name', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'type_': 'type'} _toPy = {'CharmResource': 'charmresource', 'ErrorResult': 'errorresult', 'description': 'description', 'error': 'error', 'fingerprint': 'fingerprint', 'name': 'name', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'type': 'type_'} + def __init__(self, charmresource=None, errorresult=None, description=None, error=None, fingerprint=None, name=None, origin=None, path=None, revision=None, size=None, type_=None, **unknown_fields): ''' charmresource : CharmResource @@ -5434,6 +5600,7 @@ def __init__(self, charmresource=None, errorresult=None, description=None, error class CharmResourcesResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~CharmResourceResult] @@ -5452,6 +5619,7 @@ def __init__(self, results=None, **unknown_fields): class CharmStorage(Type): _toSchema = {'count_max': 'count-max', 'count_min': 'count-min', 'description': 'description', 'location': 'location', 'minimum_size': 'minimum-size', 'name': 'name', 'properties': 'properties', 'read_only': 'read-only', 'shared': 'shared', 'type_': 'type'} _toPy = {'count-max': 'count_max', 'count-min': 'count_min', 'description': 'description', 'location': 'location', 'minimum-size': 'minimum_size', 'name': 'name', 'properties': 'properties', 'read-only': 'read_only', 'shared': 'shared', 'type': 'type_'} + def __init__(self, count_max=None, count_min=None, description=None, location=None, minimum_size=None, name=None, properties=None, read_only=None, shared=None, type_=None, **unknown_fields): ''' count_max : int @@ -5524,6 +5692,7 @@ def __init__(self, count_max=None, count_min=None, description=None, location=No class CharmURL(Type): _toSchema = {'url': 'url'} _toPy = {'url': 'url'} + def __init__(self, url=None, **unknown_fields): ''' url : str @@ -5542,6 +5711,7 @@ def __init__(self, url=None, **unknown_fields): class CharmURLAndOrigin(Type): _toSchema = {'charm_origin': 'charm-origin', 'charm_url': 'charm-url', 'macaroon': 'macaroon'} _toPy = {'charm-origin': 'charm_origin', 'charm-url': 'charm_url', 'macaroon': 'macaroon'} + def __init__(self, charm_origin=None, charm_url=None, macaroon=None, **unknown_fields): ''' charm_origin : CharmOrigin @@ -5572,6 +5742,7 @@ def __init__(self, charm_origin=None, charm_url=None, macaroon=None, **unknown_f class CharmURLAndOrigins(Type): _toSchema = {'entities': 'entities'} _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): ''' entities : typing.Sequence[~CharmURLAndOrigin] @@ -5590,6 +5761,7 @@ def __init__(self, entities=None, **unknown_fields): class CharmURLOriginResult(Type): _toSchema = {'charm_origin': 'charm-origin', 'error': 'error', 'url': 'url'} _toPy = {'charm-origin': 'charm_origin', 'error': 'error', 'url': 'url'} + def __init__(self, charm_origin=None, error=None, url=None, **unknown_fields): ''' charm_origin : CharmOrigin @@ -5620,6 +5792,7 @@ def __init__(self, charm_origin=None, error=None, url=None, **unknown_fields): class CharmURLs(Type): _toSchema = {'urls': 'urls'} _toPy = {'urls': 'urls'} + def __init__(self, urls=None, **unknown_fields): ''' urls : typing.Sequence[~CharmURL] @@ -5638,6 +5811,7 @@ def __init__(self, urls=None, **unknown_fields): class CharmsList(Type): _toSchema = {'names': 'names'} _toPy = {'names': 'names'} + def __init__(self, names=None, **unknown_fields): ''' names : typing.Sequence[str] @@ -5656,6 +5830,7 @@ def __init__(self, names=None, **unknown_fields): class CharmsListResult(Type): _toSchema = {'charm_urls': 'charm-urls'} _toPy = {'charm-urls': 'charm_urls'} + def __init__(self, charm_urls=None, **unknown_fields): ''' charm_urls : typing.Sequence[str] @@ -5674,6 +5849,7 @@ def __init__(self, charm_urls=None, **unknown_fields): class ClaimLeadershipBulkParams(Type): _toSchema = {'params': 'params'} _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): ''' params : typing.Sequence[~ClaimLeadershipParams] @@ -5692,6 +5868,7 @@ def __init__(self, params=None, **unknown_fields): class ClaimLeadershipBulkResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ErrorResult] @@ -5710,6 +5887,7 @@ def __init__(self, results=None, **unknown_fields): class ClaimLeadershipParams(Type): _toSchema = {'application_tag': 'application-tag', 'duration': 'duration', 'unit_tag': 'unit-tag'} _toPy = {'application-tag': 'application_tag', 'duration': 'duration', 'unit-tag': 'unit_tag'} + def __init__(self, application_tag=None, duration=None, unit_tag=None, **unknown_fields): ''' application_tag : str @@ -5740,6 +5918,7 @@ def __init__(self, application_tag=None, duration=None, unit_tag=None, **unknown class Cloud(Type): _toSchema = {'auth_types': 'auth-types', 'ca_certificates': 'ca-certificates', 'config': 'config', 'endpoint': 'endpoint', 'host_cloud_region': 'host-cloud-region', 'identity_endpoint': 'identity-endpoint', 'is_controller_cloud': 'is-controller-cloud', 'region_config': 'region-config', 'regions': 'regions', 'skip_tls_verify': 'skip-tls-verify', 'storage_endpoint': 'storage-endpoint', 'type_': 'type'} _toPy = {'auth-types': 'auth_types', 'ca-certificates': 'ca_certificates', 'config': 'config', 'endpoint': 'endpoint', 'host-cloud-region': 'host_cloud_region', 'identity-endpoint': 'identity_endpoint', 'is-controller-cloud': 'is_controller_cloud', 'region-config': 'region_config', 'regions': 'regions', 'skip-tls-verify': 'skip_tls_verify', 'storage-endpoint': 'storage_endpoint', 'type': 'type_'} + def __init__(self, auth_types=None, ca_certificates=None, config=None, endpoint=None, host_cloud_region=None, identity_endpoint=None, is_controller_cloud=None, region_config=None, regions=None, skip_tls_verify=None, storage_endpoint=None, type_=None, **unknown_fields): ''' auth_types : typing.Sequence[str] @@ -5824,6 +6003,7 @@ def __init__(self, auth_types=None, ca_certificates=None, config=None, endpoint= class CloudCredential(Type): _toSchema = {'attrs': 'attrs', 'auth_type': 'auth-type', 'redacted': 'redacted'} _toPy = {'attrs': 'attrs', 'auth-type': 'auth_type', 'redacted': 'redacted'} + def __init__(self, attrs=None, auth_type=None, redacted=None, **unknown_fields): ''' attrs : typing.Mapping[str, str] @@ -5854,6 +6034,7 @@ def __init__(self, attrs=None, auth_type=None, redacted=None, **unknown_fields): class CloudCredentialArg(Type): _toSchema = {'cloud_name': 'cloud-name', 'credential_name': 'credential-name'} _toPy = {'cloud-name': 'cloud_name', 'credential-name': 'credential_name'} + def __init__(self, cloud_name=None, credential_name=None, **unknown_fields): ''' cloud_name : str @@ -5878,6 +6059,7 @@ def __init__(self, cloud_name=None, credential_name=None, **unknown_fields): class CloudCredentialArgs(Type): _toSchema = {'credentials': 'credentials', 'include_secrets': 'include-secrets'} _toPy = {'credentials': 'credentials', 'include-secrets': 'include_secrets'} + def __init__(self, credentials=None, include_secrets=None, **unknown_fields): ''' credentials : typing.Sequence[~CloudCredentialArg] @@ -5902,6 +6084,7 @@ def __init__(self, credentials=None, include_secrets=None, **unknown_fields): class CloudCredentialResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -5926,6 +6109,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class CloudCredentialResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~CloudCredentialResult] @@ -5944,6 +6128,7 @@ def __init__(self, results=None, **unknown_fields): class CloudDetails(Type): _toSchema = {'auth_types': 'auth-types', 'endpoint': 'endpoint', 'identity_endpoint': 'identity-endpoint', 'regions': 'regions', 'storage_endpoint': 'storage-endpoint', 'type_': 'type'} _toPy = {'auth-types': 'auth_types', 'endpoint': 'endpoint', 'identity-endpoint': 'identity_endpoint', 'regions': 'regions', 'storage-endpoint': 'storage_endpoint', 'type': 'type_'} + def __init__(self, auth_types=None, endpoint=None, identity_endpoint=None, regions=None, storage_endpoint=None, type_=None, **unknown_fields): ''' auth_types : typing.Sequence[str] @@ -5992,6 +6177,7 @@ def __init__(self, auth_types=None, endpoint=None, identity_endpoint=None, regio class CloudImageMetadata(Type): _toSchema = {'arch': 'arch', 'image_id': 'image-id', 'priority': 'priority', 'region': 'region', 'root_storage_size': 'root-storage-size', 'root_storage_type': 'root-storage-type', 'source': 'source', 'stream': 'stream', 'version': 'version', 'virt_type': 'virt-type'} _toPy = {'arch': 'arch', 'image-id': 'image_id', 'priority': 'priority', 'region': 'region', 'root-storage-size': 'root_storage_size', 'root-storage-type': 'root_storage_type', 'source': 'source', 'stream': 'stream', 'version': 'version', 'virt-type': 'virt_type'} + def __init__(self, arch=None, image_id=None, priority=None, region=None, root_storage_size=None, root_storage_type=None, source=None, stream=None, version=None, virt_type=None, **unknown_fields): ''' arch : str @@ -6064,6 +6250,7 @@ def __init__(self, arch=None, image_id=None, priority=None, region=None, root_st class CloudImageMetadataList(Type): _toSchema = {'metadata': 'metadata'} _toPy = {'metadata': 'metadata'} + def __init__(self, metadata=None, **unknown_fields): ''' metadata : typing.Sequence[~CloudImageMetadata] @@ -6082,6 +6269,7 @@ def __init__(self, metadata=None, **unknown_fields): class CloudInfo(Type): _toSchema = {'clouddetails': 'CloudDetails', 'users': 'users'} _toPy = {'CloudDetails': 'clouddetails', 'users': 'users'} + def __init__(self, clouddetails=None, users=None, **unknown_fields): ''' clouddetails : CloudDetails @@ -6106,6 +6294,7 @@ def __init__(self, clouddetails=None, users=None, **unknown_fields): class CloudInfoResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -6130,6 +6319,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class CloudInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~CloudInfoResult] @@ -6148,6 +6338,7 @@ def __init__(self, results=None, **unknown_fields): class CloudInstanceTypesConstraint(Type): _toSchema = {'cloud_tag': 'cloud-tag', 'constraints': 'constraints', 'region': 'region'} _toPy = {'cloud-tag': 'cloud_tag', 'constraints': 'constraints', 'region': 'region'} + def __init__(self, cloud_tag=None, constraints=None, region=None, **unknown_fields): ''' cloud_tag : str @@ -6178,6 +6369,7 @@ def __init__(self, cloud_tag=None, constraints=None, region=None, **unknown_fiel class CloudInstanceTypesConstraints(Type): _toSchema = {'constraints': 'constraints'} _toPy = {'constraints': 'constraints'} + def __init__(self, constraints=None, **unknown_fields): ''' constraints : typing.Sequence[~CloudInstanceTypesConstraint] @@ -6196,6 +6388,7 @@ def __init__(self, constraints=None, **unknown_fields): class CloudRegion(Type): _toSchema = {'endpoint': 'endpoint', 'identity_endpoint': 'identity-endpoint', 'name': 'name', 'storage_endpoint': 'storage-endpoint'} _toPy = {'endpoint': 'endpoint', 'identity-endpoint': 'identity_endpoint', 'name': 'name', 'storage-endpoint': 'storage_endpoint'} + def __init__(self, endpoint=None, identity_endpoint=None, name=None, storage_endpoint=None, **unknown_fields): ''' endpoint : str @@ -6232,6 +6425,7 @@ def __init__(self, endpoint=None, identity_endpoint=None, name=None, storage_end class CloudResult(Type): _toSchema = {'cloud': 'cloud', 'error': 'error'} _toPy = {'cloud': 'cloud', 'error': 'error'} + def __init__(self, cloud=None, error=None, **unknown_fields): ''' cloud : Cloud @@ -6256,6 +6450,7 @@ def __init__(self, cloud=None, error=None, **unknown_fields): class CloudResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~CloudResult] @@ -6274,6 +6469,7 @@ def __init__(self, results=None, **unknown_fields): class CloudSpec(Type): _toSchema = {'cacertificates': 'cacertificates', 'credential': 'credential', 'endpoint': 'endpoint', 'identity_endpoint': 'identity-endpoint', 'is_controller_cloud': 'is-controller-cloud', 'name': 'name', 'region': 'region', 'skip_tls_verify': 'skip-tls-verify', 'storage_endpoint': 'storage-endpoint', 'type_': 'type'} _toPy = {'cacertificates': 'cacertificates', 'credential': 'credential', 'endpoint': 'endpoint', 'identity-endpoint': 'identity_endpoint', 'is-controller-cloud': 'is_controller_cloud', 'name': 'name', 'region': 'region', 'skip-tls-verify': 'skip_tls_verify', 'storage-endpoint': 'storage_endpoint', 'type': 'type_'} + def __init__(self, cacertificates=None, credential=None, endpoint=None, identity_endpoint=None, is_controller_cloud=None, name=None, region=None, skip_tls_verify=None, storage_endpoint=None, type_=None, **unknown_fields): ''' cacertificates : typing.Sequence[str] @@ -6346,6 +6542,7 @@ def __init__(self, cacertificates=None, credential=None, endpoint=None, identity class CloudSpecResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -6370,6 +6567,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class CloudSpecResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~CloudSpecResult] @@ -6388,6 +6586,7 @@ def __init__(self, results=None, **unknown_fields): class CloudUserInfo(Type): _toSchema = {'access': 'access', 'display_name': 'display-name', 'user': 'user'} _toPy = {'access': 'access', 'display-name': 'display_name', 'user': 'user'} + def __init__(self, access=None, display_name=None, user=None, **unknown_fields): ''' access : str @@ -6418,6 +6617,7 @@ def __init__(self, access=None, display_name=None, user=None, **unknown_fields): class CloudsResult(Type): _toSchema = {'clouds': 'clouds'} _toPy = {'clouds': 'clouds'} + def __init__(self, clouds=None, **unknown_fields): ''' clouds : typing.Mapping[str, ~Cloud] @@ -6436,6 +6636,7 @@ def __init__(self, clouds=None, **unknown_fields): class CommitHookChangesArg(Type): _toSchema = {'add_storage': 'add-storage', 'close_ports': 'close-ports', 'open_ports': 'open-ports', 'pod_spec': 'pod-spec', 'relation_unit_settings': 'relation-unit-settings', 'secret_creates': 'secret-creates', 'secret_deletes': 'secret-deletes', 'secret_grants': 'secret-grants', 'secret_revokes': 'secret-revokes', 'secret_track_latest': 'secret-track-latest', 'secret_updates': 'secret-updates', 'set_raw_k8s_spec': 'set-raw-k8s-spec', 'tag': 'tag', 'unit_state': 'unit-state', 'update_network_info': 'update-network-info'} _toPy = {'add-storage': 'add_storage', 'close-ports': 'close_ports', 'open-ports': 'open_ports', 'pod-spec': 'pod_spec', 'relation-unit-settings': 'relation_unit_settings', 'secret-creates': 'secret_creates', 'secret-deletes': 'secret_deletes', 'secret-grants': 'secret_grants', 'secret-revokes': 'secret_revokes', 'secret-track-latest': 'secret_track_latest', 'secret-updates': 'secret_updates', 'set-raw-k8s-spec': 'set_raw_k8s_spec', 'tag': 'tag', 'unit-state': 'unit_state', 'update-network-info': 'update_network_info'} + def __init__(self, add_storage=None, close_ports=None, open_ports=None, pod_spec=None, relation_unit_settings=None, secret_creates=None, secret_deletes=None, secret_grants=None, secret_revokes=None, secret_track_latest=None, secret_updates=None, set_raw_k8s_spec=None, tag=None, unit_state=None, update_network_info=None, **unknown_fields): ''' add_storage : typing.Sequence[~StorageAddParams] @@ -6538,6 +6739,7 @@ def __init__(self, add_storage=None, close_ports=None, open_ports=None, pod_spec class CommitHookChangesArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~CommitHookChangesArg] @@ -6556,6 +6758,7 @@ def __init__(self, args=None, **unknown_fields): class ConfigResult(Type): _toSchema = {'config': 'config', 'error': 'error'} _toPy = {'config': 'config', 'error': 'error'} + def __init__(self, config=None, error=None, **unknown_fields): ''' config : typing.Mapping[str, typing.Any] @@ -6580,6 +6783,7 @@ def __init__(self, config=None, error=None, **unknown_fields): class ConfigSet(Type): _toSchema = {'application': 'application', 'config': 'config', 'config_yaml': 'config-yaml', 'generation': 'generation'} _toPy = {'application': 'application', 'config': 'config', 'config-yaml': 'config_yaml', 'generation': 'generation'} + def __init__(self, application=None, config=None, config_yaml=None, generation=None, **unknown_fields): ''' application : str @@ -6616,6 +6820,7 @@ def __init__(self, application=None, config=None, config_yaml=None, generation=N class ConfigSetArgs(Type): _toSchema = {'args': 'Args'} _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~ConfigSet] @@ -6634,6 +6839,7 @@ def __init__(self, args=None, **unknown_fields): class ConfigSettingsResult(Type): _toSchema = {'error': 'error', 'settings': 'settings'} _toPy = {'error': 'error', 'settings': 'settings'} + def __init__(self, error=None, settings=None, **unknown_fields): ''' error : Error @@ -6658,6 +6864,7 @@ def __init__(self, error=None, settings=None, **unknown_fields): class ConfigSettingsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ConfigSettingsResult] @@ -6676,6 +6883,7 @@ def __init__(self, results=None, **unknown_fields): class ConfigValue(Type): _toSchema = {'source': 'source', 'value': 'value'} _toPy = {'source': 'source', 'value': 'value'} + def __init__(self, source=None, value=None, **unknown_fields): ''' source : str @@ -6697,6 +6905,7 @@ def __init__(self, source=None, value=None, **unknown_fields): class Constraints(Type): _toSchema = {'count': 'Count', 'pool': 'Pool', 'size': 'Size'} _toPy = {'Count': 'count', 'Pool': 'pool', 'Size': 'size'} + def __init__(self, count=None, pool=None, size=None, **unknown_fields): ''' count : int @@ -6727,6 +6936,7 @@ def __init__(self, count=None, pool=None, size=None, **unknown_fields): class ConstraintsResult(Type): _toSchema = {'constraints': 'constraints', 'error': 'error'} _toPy = {'constraints': 'constraints', 'error': 'error'} + def __init__(self, constraints=None, error=None, **unknown_fields): ''' constraints : Value @@ -6751,6 +6961,7 @@ def __init__(self, constraints=None, error=None, **unknown_fields): class ConstraintsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ConstraintsResult] @@ -6769,6 +6980,7 @@ def __init__(self, results=None, **unknown_fields): class ConsumeApplicationArg(Type): _toSchema = {'application_alias': 'application-alias', 'application_description': 'application-description', 'applicationofferdetails': 'ApplicationOfferDetails', 'bindings': 'bindings', 'endpoints': 'endpoints', 'external_controller': 'external-controller', 'macaroon': 'macaroon', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'offer_uuid': 'offer-uuid', 'source_model_tag': 'source-model-tag', 'spaces': 'spaces', 'users': 'users'} _toPy = {'ApplicationOfferDetails': 'applicationofferdetails', 'application-alias': 'application_alias', 'application-description': 'application_description', 'bindings': 'bindings', 'endpoints': 'endpoints', 'external-controller': 'external_controller', 'macaroon': 'macaroon', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'offer-uuid': 'offer_uuid', 'source-model-tag': 'source_model_tag', 'spaces': 'spaces', 'users': 'users'} + def __init__(self, applicationofferdetails=None, application_alias=None, application_description=None, bindings=None, endpoints=None, external_controller=None, macaroon=None, offer_name=None, offer_url=None, offer_uuid=None, source_model_tag=None, spaces=None, users=None, **unknown_fields): ''' applicationofferdetails : ApplicationOfferDetails @@ -6859,6 +7071,7 @@ def __init__(self, applicationofferdetails=None, application_alias=None, applica class ConsumeApplicationArgV5(Type): _toSchema = {'application_alias': 'application-alias', 'application_description': 'application-description', 'applicationofferdetailsv5': 'ApplicationOfferDetailsV5', 'endpoints': 'endpoints', 'external_controller': 'external-controller', 'macaroon': 'macaroon', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'offer_uuid': 'offer-uuid', 'source_model_tag': 'source-model-tag', 'users': 'users'} _toPy = {'ApplicationOfferDetailsV5': 'applicationofferdetailsv5', 'application-alias': 'application_alias', 'application-description': 'application_description', 'endpoints': 'endpoints', 'external-controller': 'external_controller', 'macaroon': 'macaroon', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'offer-uuid': 'offer_uuid', 'source-model-tag': 'source_model_tag', 'users': 'users'} + def __init__(self, applicationofferdetailsv5=None, application_alias=None, application_description=None, endpoints=None, external_controller=None, macaroon=None, offer_name=None, offer_url=None, offer_uuid=None, source_model_tag=None, users=None, **unknown_fields): ''' applicationofferdetailsv5 : ApplicationOfferDetailsV5 @@ -6937,6 +7150,7 @@ def __init__(self, applicationofferdetailsv5=None, application_alias=None, appli class ConsumeApplicationArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~ConsumeApplicationArg] @@ -6955,6 +7169,7 @@ def __init__(self, args=None, **unknown_fields): class ConsumeApplicationArgsV5(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~ConsumeApplicationArgV5] @@ -6973,6 +7188,7 @@ def __init__(self, args=None, **unknown_fields): class ConsumeOfferDetails(Type): _toSchema = {'external_controller': 'external-controller', 'macaroon': 'macaroon', 'offer': 'offer'} _toPy = {'external-controller': 'external_controller', 'macaroon': 'macaroon', 'offer': 'offer'} + def __init__(self, external_controller=None, macaroon=None, offer=None, **unknown_fields): ''' external_controller : ExternalControllerInfo @@ -7003,6 +7219,7 @@ def __init__(self, external_controller=None, macaroon=None, offer=None, **unknow class ConsumeOfferDetailsArg(Type): _toSchema = {'offer_urls': 'offer-urls', 'user_tag': 'user-tag'} _toPy = {'offer-urls': 'offer_urls', 'user-tag': 'user_tag'} + def __init__(self, offer_urls=None, user_tag=None, **unknown_fields): ''' offer_urls : OfferURLs @@ -7027,6 +7244,7 @@ def __init__(self, offer_urls=None, user_tag=None, **unknown_fields): class ConsumeOfferDetailsResult(Type): _toSchema = {'consumeofferdetails': 'ConsumeOfferDetails', 'error': 'error', 'external_controller': 'external-controller', 'macaroon': 'macaroon', 'offer': 'offer'} _toPy = {'ConsumeOfferDetails': 'consumeofferdetails', 'error': 'error', 'external-controller': 'external_controller', 'macaroon': 'macaroon', 'offer': 'offer'} + def __init__(self, consumeofferdetails=None, error=None, external_controller=None, macaroon=None, offer=None, **unknown_fields): ''' consumeofferdetails : ConsumeOfferDetails @@ -7069,6 +7287,7 @@ def __init__(self, consumeofferdetails=None, error=None, external_controller=Non class ConsumeOfferDetailsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ConsumeOfferDetailsResult] @@ -7087,6 +7306,7 @@ def __init__(self, results=None, **unknown_fields): class ContainerConfig(Type): _toSchema = {'apt_mirror': 'apt-mirror', 'apt_proxy': 'apt-proxy', 'authorized_keys': 'authorized-keys', 'cloudinit_userdata': 'cloudinit-userdata', 'container_inherit_properties': 'container-inherit-properties', 'juju_proxy': 'juju-proxy', 'legacy_proxy': 'legacy-proxy', 'provider_type': 'provider-type', 'snap_proxy': 'snap-proxy', 'snap_store_assertions': 'snap-store-assertions', 'snap_store_proxy_id': 'snap-store-proxy-id', 'snap_store_proxy_url': 'snap-store-proxy-url', 'ssl_hostname_verification': 'ssl-hostname-verification', 'updatebehavior': 'UpdateBehavior'} _toPy = {'UpdateBehavior': 'updatebehavior', 'apt-mirror': 'apt_mirror', 'apt-proxy': 'apt_proxy', 'authorized-keys': 'authorized_keys', 'cloudinit-userdata': 'cloudinit_userdata', 'container-inherit-properties': 'container_inherit_properties', 'juju-proxy': 'juju_proxy', 'legacy-proxy': 'legacy_proxy', 'provider-type': 'provider_type', 'snap-proxy': 'snap_proxy', 'snap-store-assertions': 'snap_store_assertions', 'snap-store-proxy-id': 'snap_store_proxy_id', 'snap-store-proxy-url': 'snap_store_proxy_url', 'ssl-hostname-verification': 'ssl_hostname_verification'} + def __init__(self, updatebehavior=None, apt_mirror=None, apt_proxy=None, authorized_keys=None, cloudinit_userdata=None, container_inherit_properties=None, juju_proxy=None, legacy_proxy=None, provider_type=None, snap_proxy=None, snap_store_assertions=None, snap_store_proxy_id=None, snap_store_proxy_url=None, ssl_hostname_verification=None, **unknown_fields): ''' updatebehavior : UpdateBehavior @@ -7183,6 +7403,7 @@ def __init__(self, updatebehavior=None, apt_mirror=None, apt_proxy=None, authori class ContainerLXDProfile(Type): _toSchema = {'name': 'name', 'profile': 'profile'} _toPy = {'name': 'name', 'profile': 'profile'} + def __init__(self, name=None, profile=None, **unknown_fields): ''' name : str @@ -7207,6 +7428,7 @@ def __init__(self, name=None, profile=None, **unknown_fields): class ContainerManagerConfig(Type): _toSchema = {'config': 'config'} _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): ''' config : typing.Mapping[str, str] @@ -7225,6 +7447,7 @@ def __init__(self, config=None, **unknown_fields): class ContainerManagerConfigParams(Type): _toSchema = {'type_': 'type'} _toPy = {'type': 'type_'} + def __init__(self, type_=None, **unknown_fields): ''' type_ : str @@ -7243,6 +7466,7 @@ def __init__(self, type_=None, **unknown_fields): class ContainerProfileResult(Type): _toSchema = {'error': 'error', 'lxd_profiles': 'lxd-profiles'} _toPy = {'error': 'error', 'lxd-profiles': 'lxd_profiles'} + def __init__(self, error=None, lxd_profiles=None, **unknown_fields): ''' error : Error @@ -7267,6 +7491,7 @@ def __init__(self, error=None, lxd_profiles=None, **unknown_fields): class ContainerProfileResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ContainerProfileResult] @@ -7285,6 +7510,7 @@ def __init__(self, results=None, **unknown_fields): class ContainerTypeResult(Type): _toSchema = {'container_type': 'container-type', 'error': 'error'} _toPy = {'container-type': 'container_type', 'error': 'error'} + def __init__(self, container_type=None, error=None, **unknown_fields): ''' container_type : str @@ -7309,6 +7535,7 @@ def __init__(self, container_type=None, error=None, **unknown_fields): class ControllerAPIInfoResult(Type): _toSchema = {'addresses': 'addresses', 'cacert': 'cacert', 'error': 'error'} _toPy = {'addresses': 'addresses', 'cacert': 'cacert', 'error': 'error'} + def __init__(self, addresses=None, cacert=None, error=None, **unknown_fields): ''' addresses : typing.Sequence[str] @@ -7339,6 +7566,7 @@ def __init__(self, addresses=None, cacert=None, error=None, **unknown_fields): class ControllerAPIInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ControllerAPIInfoResult] @@ -7357,6 +7585,7 @@ def __init__(self, results=None, **unknown_fields): class ControllerConfigResult(Type): _toSchema = {'config': 'config'} _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): ''' config : typing.Mapping[str, typing.Any] @@ -7375,6 +7604,7 @@ def __init__(self, config=None, **unknown_fields): class ControllerConfigSet(Type): _toSchema = {'config': 'config'} _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): ''' config : typing.Mapping[str, typing.Any] @@ -7393,6 +7623,7 @@ def __init__(self, config=None, **unknown_fields): class ControllerCredentialInfo(Type): _toSchema = {'content': 'content', 'models': 'models'} _toPy = {'content': 'content', 'models': 'models'} + def __init__(self, content=None, models=None, **unknown_fields): ''' content : CredentialContent @@ -7417,6 +7648,7 @@ def __init__(self, content=None, models=None, **unknown_fields): class ControllerVersionResults(Type): _toSchema = {'git_commit': 'git-commit', 'version': 'version'} _toPy = {'git-commit': 'git_commit', 'version': 'version'} + def __init__(self, git_commit=None, version=None, **unknown_fields): ''' git_commit : str @@ -7441,6 +7673,7 @@ def __init__(self, git_commit=None, version=None, **unknown_fields): class ControllersChangeResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -7465,6 +7698,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class ControllersChangeResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ControllersChangeResult] @@ -7483,6 +7717,7 @@ def __init__(self, results=None, **unknown_fields): class ControllersChanges(Type): _toSchema = {'added': 'added', 'converted': 'converted', 'maintained': 'maintained', 'removed': 'removed'} _toPy = {'added': 'added', 'converted': 'converted', 'maintained': 'maintained', 'removed': 'removed'} + def __init__(self, added=None, converted=None, maintained=None, removed=None, **unknown_fields): ''' added : typing.Sequence[str] @@ -7519,6 +7754,7 @@ def __init__(self, added=None, converted=None, maintained=None, removed=None, ** class ControllersSpec(Type): _toSchema = {'constraints': 'constraints', 'num_controllers': 'num-controllers', 'placement': 'placement'} _toPy = {'constraints': 'constraints', 'num-controllers': 'num_controllers', 'placement': 'placement'} + def __init__(self, constraints=None, num_controllers=None, placement=None, **unknown_fields): ''' constraints : Value @@ -7549,6 +7785,7 @@ def __init__(self, constraints=None, num_controllers=None, placement=None, **unk class ControllersSpecs(Type): _toSchema = {'specs': 'specs'} _toPy = {'specs': 'specs'} + def __init__(self, specs=None, **unknown_fields): ''' specs : typing.Sequence[~ControllersSpec] @@ -7567,6 +7804,7 @@ def __init__(self, specs=None, **unknown_fields): class CreateSecretArg(Type): _toSchema = {'content': 'content', 'description': 'description', 'expire_time': 'expire-time', 'label': 'label', 'owner_tag': 'owner-tag', 'params': 'params', 'rotate_policy': 'rotate-policy', 'upsertsecretarg': 'UpsertSecretArg', 'uri': 'uri'} _toPy = {'UpsertSecretArg': 'upsertsecretarg', 'content': 'content', 'description': 'description', 'expire-time': 'expire_time', 'label': 'label', 'owner-tag': 'owner_tag', 'params': 'params', 'rotate-policy': 'rotate_policy', 'uri': 'uri'} + def __init__(self, upsertsecretarg=None, content=None, description=None, expire_time=None, label=None, owner_tag=None, params=None, rotate_policy=None, uri=None, **unknown_fields): ''' upsertsecretarg : UpsertSecretArg @@ -7633,6 +7871,7 @@ def __init__(self, upsertsecretarg=None, content=None, description=None, expire_ class CreateSecretArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~CreateSecretArg] @@ -7651,6 +7890,7 @@ def __init__(self, args=None, **unknown_fields): class CreateSecretURIsArg(Type): _toSchema = {'count': 'count'} _toPy = {'count': 'count'} + def __init__(self, count=None, **unknown_fields): ''' count : int @@ -7669,6 +7909,7 @@ def __init__(self, count=None, **unknown_fields): class CreateSpaceParams(Type): _toSchema = {'cidrs': 'cidrs', 'provider_id': 'provider-id', 'public': 'public', 'space_tag': 'space-tag'} _toPy = {'cidrs': 'cidrs', 'provider-id': 'provider_id', 'public': 'public', 'space-tag': 'space_tag'} + def __init__(self, cidrs=None, provider_id=None, public=None, space_tag=None, **unknown_fields): ''' cidrs : typing.Sequence[str] @@ -7705,6 +7946,7 @@ def __init__(self, cidrs=None, provider_id=None, public=None, space_tag=None, ** class CreateSpacesParams(Type): _toSchema = {'spaces': 'spaces'} _toPy = {'spaces': 'spaces'} + def __init__(self, spaces=None, **unknown_fields): ''' spaces : typing.Sequence[~CreateSpaceParams] @@ -7723,6 +7965,7 @@ def __init__(self, spaces=None, **unknown_fields): class CredentialContent(Type): _toSchema = {'attrs': 'attrs', 'auth_type': 'auth-type', 'cloud': 'cloud', 'name': 'name', 'valid': 'valid'} _toPy = {'attrs': 'attrs', 'auth-type': 'auth_type', 'cloud': 'cloud', 'name': 'name', 'valid': 'valid'} + def __init__(self, attrs=None, auth_type=None, cloud=None, name=None, valid=None, **unknown_fields): ''' attrs : typing.Mapping[str, str] @@ -7765,6 +8008,7 @@ def __init__(self, attrs=None, auth_type=None, cloud=None, name=None, valid=None class CredentialContentResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -7789,6 +8033,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class CredentialContentResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~CredentialContentResult] @@ -7807,6 +8052,7 @@ def __init__(self, results=None, **unknown_fields): class DashboardConnectionInfo(Type): _toSchema = {'error': 'error', 'proxy_connection': 'proxy-connection', 'ssh_connection': 'ssh-connection'} _toPy = {'error': 'error', 'proxy-connection': 'proxy_connection', 'ssh-connection': 'ssh_connection'} + def __init__(self, error=None, proxy_connection=None, ssh_connection=None, **unknown_fields): ''' error : Error @@ -7837,6 +8083,7 @@ def __init__(self, error=None, proxy_connection=None, ssh_connection=None, **unk class DashboardConnectionSSHTunnel(Type): _toSchema = {'entity': 'entity', 'host': 'host', 'model': 'model', 'port': 'port'} _toPy = {'entity': 'entity', 'host': 'host', 'model': 'model', 'port': 'port'} + def __init__(self, entity=None, host=None, model=None, port=None, **unknown_fields): ''' entity : str @@ -7873,6 +8120,7 @@ def __init__(self, entity=None, host=None, model=None, port=None, **unknown_fiel class DeleteSecretArg(Type): _toSchema = {'label': 'label', 'revisions': 'revisions', 'uri': 'uri'} _toPy = {'label': 'label', 'revisions': 'revisions', 'uri': 'uri'} + def __init__(self, label=None, revisions=None, uri=None, **unknown_fields): ''' label : str @@ -7903,6 +8151,7 @@ def __init__(self, label=None, revisions=None, uri=None, **unknown_fields): class DeleteSecretArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~DeleteSecretArg] @@ -7921,6 +8170,7 @@ def __init__(self, args=None, **unknown_fields): class Delta(Type): _toSchema = {'entity': 'entity', 'removed': 'removed'} _toPy = {'entity': 'entity', 'removed': 'removed'} + def __init__(self, entity=None, removed=None, **unknown_fields): ''' entity : Any @@ -7942,6 +8192,7 @@ def __init__(self, entity=None, removed=None, **unknown_fields): class DeployFromRepositoryArg(Type): _toSchema = {'applicationname': 'ApplicationName', 'attachstorage': 'AttachStorage', 'base': 'base', 'channel': 'channel', 'charmname': 'CharmName', 'configyaml': 'ConfigYAML', 'cons': 'Cons', 'devices': 'Devices', 'dryrun': 'DryRun', 'endpoint_bindings': 'endpoint-bindings', 'force': 'force', 'num_units': 'num-units', 'placement': 'Placement', 'resources': 'resources', 'revision': 'revision', 'storage': 'Storage', 'trust': 'Trust'} _toPy = {'ApplicationName': 'applicationname', 'AttachStorage': 'attachstorage', 'CharmName': 'charmname', 'ConfigYAML': 'configyaml', 'Cons': 'cons', 'Devices': 'devices', 'DryRun': 'dryrun', 'Placement': 'placement', 'Storage': 'storage', 'Trust': 'trust', 'base': 'base', 'channel': 'channel', 'endpoint-bindings': 'endpoint_bindings', 'force': 'force', 'num-units': 'num_units', 'resources': 'resources', 'revision': 'revision'} + def __init__(self, applicationname=None, attachstorage=None, charmname=None, configyaml=None, cons=None, devices=None, dryrun=None, placement=None, storage=None, trust=None, base=None, channel=None, endpoint_bindings=None, force=None, num_units=None, resources=None, revision=None, **unknown_fields): ''' applicationname : str @@ -8056,6 +8307,7 @@ def __init__(self, applicationname=None, attachstorage=None, charmname=None, con class DeployFromRepositoryArgs(Type): _toSchema = {'args': 'Args'} _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~DeployFromRepositoryArg] @@ -8074,6 +8326,7 @@ def __init__(self, args=None, **unknown_fields): class DeployFromRepositoryInfo(Type): _toSchema = {'architecture': 'architecture', 'base': 'base', 'channel': 'channel', 'effective_channel': 'effective-channel', 'name': 'name', 'revision': 'revision'} _toPy = {'architecture': 'architecture', 'base': 'base', 'channel': 'channel', 'effective-channel': 'effective_channel', 'name': 'name', 'revision': 'revision'} + def __init__(self, architecture=None, base=None, channel=None, effective_channel=None, name=None, revision=None, **unknown_fields): ''' architecture : str @@ -8122,6 +8375,7 @@ def __init__(self, architecture=None, base=None, channel=None, effective_channel class DeployFromRepositoryResult(Type): _toSchema = {'errors': 'Errors', 'info': 'Info', 'pendingresourceuploads': 'PendingResourceUploads'} _toPy = {'Errors': 'errors', 'Info': 'info', 'PendingResourceUploads': 'pendingresourceuploads'} + def __init__(self, errors=None, info=None, pendingresourceuploads=None, **unknown_fields): ''' errors : typing.Sequence[~Error] @@ -8152,6 +8406,7 @@ def __init__(self, errors=None, info=None, pendingresourceuploads=None, **unknow class DeployFromRepositoryResults(Type): _toSchema = {'results': 'Results'} _toPy = {'Results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~DeployFromRepositoryResult] @@ -8170,6 +8425,7 @@ def __init__(self, results=None, **unknown_fields): class DeployerConnectionValues(Type): _toSchema = {'api_addresses': 'api-addresses'} _toPy = {'api-addresses': 'api_addresses'} + def __init__(self, api_addresses=None, **unknown_fields): ''' api_addresses : typing.Sequence[str] @@ -8188,6 +8444,7 @@ def __init__(self, api_addresses=None, **unknown_fields): class DestroyApplicationInfo(Type): _toSchema = {'destroyed_storage': 'destroyed-storage', 'destroyed_units': 'destroyed-units', 'detached_storage': 'detached-storage'} _toPy = {'destroyed-storage': 'destroyed_storage', 'destroyed-units': 'destroyed_units', 'detached-storage': 'detached_storage'} + def __init__(self, destroyed_storage=None, destroyed_units=None, detached_storage=None, **unknown_fields): ''' destroyed_storage : typing.Sequence[~Entity] @@ -8218,6 +8475,7 @@ def __init__(self, destroyed_storage=None, destroyed_units=None, detached_storag class DestroyApplicationOffers(Type): _toSchema = {'force': 'force', 'offer_urls': 'offer-urls'} _toPy = {'force': 'force', 'offer-urls': 'offer_urls'} + def __init__(self, force=None, offer_urls=None, **unknown_fields): ''' force : bool @@ -8242,6 +8500,7 @@ def __init__(self, force=None, offer_urls=None, **unknown_fields): class DestroyApplicationParams(Type): _toSchema = {'application_tag': 'application-tag', 'destroy_storage': 'destroy-storage', 'dry_run': 'dry-run', 'force': 'force', 'max_wait': 'max-wait'} _toPy = {'application-tag': 'application_tag', 'destroy-storage': 'destroy_storage', 'dry-run': 'dry_run', 'force': 'force', 'max-wait': 'max_wait'} + def __init__(self, application_tag=None, destroy_storage=None, dry_run=None, force=None, max_wait=None, **unknown_fields): ''' application_tag : str @@ -8284,6 +8543,7 @@ def __init__(self, application_tag=None, destroy_storage=None, dry_run=None, for class DestroyApplicationResult(Type): _toSchema = {'error': 'error', 'info': 'info'} _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): ''' error : Error @@ -8308,6 +8568,7 @@ def __init__(self, error=None, info=None, **unknown_fields): class DestroyApplicationResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~DestroyApplicationResult] @@ -8326,6 +8587,7 @@ def __init__(self, results=None, **unknown_fields): class DestroyApplicationsParams(Type): _toSchema = {'applications': 'applications'} _toPy = {'applications': 'applications'} + def __init__(self, applications=None, **unknown_fields): ''' applications : typing.Sequence[~DestroyApplicationParams] @@ -8344,6 +8606,7 @@ def __init__(self, applications=None, **unknown_fields): class DestroyConsumedApplicationParams(Type): _toSchema = {'application_tag': 'application-tag', 'force': 'force', 'max_wait': 'max-wait'} _toPy = {'application-tag': 'application_tag', 'force': 'force', 'max-wait': 'max_wait'} + def __init__(self, application_tag=None, force=None, max_wait=None, **unknown_fields): ''' application_tag : str @@ -8374,6 +8637,7 @@ def __init__(self, application_tag=None, force=None, max_wait=None, **unknown_fi class DestroyConsumedApplicationsParams(Type): _toSchema = {'applications': 'applications'} _toPy = {'applications': 'applications'} + def __init__(self, applications=None, **unknown_fields): ''' applications : typing.Sequence[~DestroyConsumedApplicationParams] @@ -8392,6 +8656,7 @@ def __init__(self, applications=None, **unknown_fields): class DestroyControllerArgs(Type): _toSchema = {'destroy_models': 'destroy-models', 'destroy_storage': 'destroy-storage', 'force': 'force', 'max_wait': 'max-wait', 'model_timeout': 'model-timeout'} _toPy = {'destroy-models': 'destroy_models', 'destroy-storage': 'destroy_storage', 'force': 'force', 'max-wait': 'max_wait', 'model-timeout': 'model_timeout'} + def __init__(self, destroy_models=None, destroy_storage=None, force=None, max_wait=None, model_timeout=None, **unknown_fields): ''' destroy_models : bool @@ -8434,6 +8699,7 @@ def __init__(self, destroy_models=None, destroy_storage=None, force=None, max_wa class DestroyMachineInfo(Type): _toSchema = {'destroyed_containers': 'destroyed-containers', 'destroyed_storage': 'destroyed-storage', 'destroyed_units': 'destroyed-units', 'detached_storage': 'detached-storage', 'machine_id': 'machine-id'} _toPy = {'destroyed-containers': 'destroyed_containers', 'destroyed-storage': 'destroyed_storage', 'destroyed-units': 'destroyed_units', 'detached-storage': 'detached_storage', 'machine-id': 'machine_id'} + def __init__(self, destroyed_containers=None, destroyed_storage=None, destroyed_units=None, detached_storage=None, machine_id=None, **unknown_fields): ''' destroyed_containers : typing.Sequence[~DestroyMachineResult] @@ -8476,6 +8742,7 @@ def __init__(self, destroyed_containers=None, destroyed_storage=None, destroyed_ class DestroyMachineResult(Type): _toSchema = {'error': 'error', 'info': 'info'} _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): ''' error : Error @@ -8500,6 +8767,7 @@ def __init__(self, error=None, info=None, **unknown_fields): class DestroyMachineResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~DestroyMachineResult] @@ -8518,6 +8786,7 @@ def __init__(self, results=None, **unknown_fields): class DestroyMachinesParams(Type): _toSchema = {'dry_run': 'dry-run', 'force': 'force', 'keep': 'keep', 'machine_tags': 'machine-tags', 'max_wait': 'max-wait'} _toPy = {'dry-run': 'dry_run', 'force': 'force', 'keep': 'keep', 'machine-tags': 'machine_tags', 'max-wait': 'max_wait'} + def __init__(self, dry_run=None, force=None, keep=None, machine_tags=None, max_wait=None, **unknown_fields): ''' dry_run : bool @@ -8560,6 +8829,7 @@ def __init__(self, dry_run=None, force=None, keep=None, machine_tags=None, max_w class DestroyModelParams(Type): _toSchema = {'destroy_storage': 'destroy-storage', 'force': 'force', 'max_wait': 'max-wait', 'model_tag': 'model-tag', 'timeout': 'timeout'} _toPy = {'destroy-storage': 'destroy_storage', 'force': 'force', 'max-wait': 'max_wait', 'model-tag': 'model_tag', 'timeout': 'timeout'} + def __init__(self, destroy_storage=None, force=None, max_wait=None, model_tag=None, timeout=None, **unknown_fields): ''' destroy_storage : bool @@ -8602,6 +8872,7 @@ def __init__(self, destroy_storage=None, force=None, max_wait=None, model_tag=No class DestroyModelsParams(Type): _toSchema = {'models': 'models'} _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): ''' models : typing.Sequence[~DestroyModelParams] @@ -8620,6 +8891,7 @@ def __init__(self, models=None, **unknown_fields): class DestroyRelation(Type): _toSchema = {'endpoints': 'endpoints', 'force': 'force', 'max_wait': 'max-wait', 'relation_id': 'relation-id'} _toPy = {'endpoints': 'endpoints', 'force': 'force', 'max-wait': 'max_wait', 'relation-id': 'relation_id'} + def __init__(self, endpoints=None, force=None, max_wait=None, relation_id=None, **unknown_fields): ''' endpoints : typing.Sequence[str] @@ -8656,6 +8928,7 @@ def __init__(self, endpoints=None, force=None, max_wait=None, relation_id=None, class DestroyUnitInfo(Type): _toSchema = {'destroyed_storage': 'destroyed-storage', 'detached_storage': 'detached-storage'} _toPy = {'destroyed-storage': 'destroyed_storage', 'detached-storage': 'detached_storage'} + def __init__(self, destroyed_storage=None, detached_storage=None, **unknown_fields): ''' destroyed_storage : typing.Sequence[~Entity] @@ -8680,6 +8953,7 @@ def __init__(self, destroyed_storage=None, detached_storage=None, **unknown_fiel class DestroyUnitParams(Type): _toSchema = {'destroy_storage': 'destroy-storage', 'dry_run': 'dry-run', 'force': 'force', 'max_wait': 'max-wait', 'unit_tag': 'unit-tag'} _toPy = {'destroy-storage': 'destroy_storage', 'dry-run': 'dry_run', 'force': 'force', 'max-wait': 'max_wait', 'unit-tag': 'unit_tag'} + def __init__(self, destroy_storage=None, dry_run=None, force=None, max_wait=None, unit_tag=None, **unknown_fields): ''' destroy_storage : bool @@ -8722,6 +8996,7 @@ def __init__(self, destroy_storage=None, dry_run=None, force=None, max_wait=None class DestroyUnitResult(Type): _toSchema = {'error': 'error', 'info': 'info'} _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): ''' error : Error @@ -8746,6 +9021,7 @@ def __init__(self, error=None, info=None, **unknown_fields): class DestroyUnitResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~DestroyUnitResult] @@ -8764,6 +9040,7 @@ def __init__(self, results=None, **unknown_fields): class DestroyUnitsParams(Type): _toSchema = {'units': 'units'} _toPy = {'units': 'units'} + def __init__(self, units=None, **unknown_fields): ''' units : typing.Sequence[~DestroyUnitParams] @@ -8782,6 +9059,7 @@ def __init__(self, units=None, **unknown_fields): class DetailedStatus(Type): _toSchema = {'data': 'data', 'err': 'err', 'info': 'info', 'kind': 'kind', 'life': 'life', 'since': 'since', 'status': 'status', 'version': 'version'} _toPy = {'data': 'data', 'err': 'err', 'info': 'info', 'kind': 'kind', 'life': 'life', 'since': 'since', 'status': 'status', 'version': 'version'} + def __init__(self, data=None, err=None, info=None, kind=None, life=None, since=None, status=None, version=None, **unknown_fields): ''' data : typing.Mapping[str, typing.Any] @@ -8842,6 +9120,7 @@ def __init__(self, data=None, err=None, info=None, kind=None, life=None, since=N class DeviceBridgeInfo(Type): _toSchema = {'bridge_name': 'bridge-name', 'host_device_name': 'host-device-name', 'mac_address': 'mac-address'} _toPy = {'bridge-name': 'bridge_name', 'host-device-name': 'host_device_name', 'mac-address': 'mac_address'} + def __init__(self, bridge_name=None, host_device_name=None, mac_address=None, **unknown_fields): ''' bridge_name : str @@ -8872,6 +9151,7 @@ def __init__(self, bridge_name=None, host_device_name=None, mac_address=None, ** class DistributionGroupResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -8896,6 +9176,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class DistributionGroupResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~DistributionGroupResult] @@ -8914,6 +9195,7 @@ def __init__(self, results=None, **unknown_fields): class DockerImageInfo(Type): _toSchema = {'auth': 'auth', 'email': 'email', 'identitytoken': 'identitytoken', 'image_name': 'image-name', 'password': 'password', 'registrytoken': 'registrytoken', 'repository': 'repository', 'serveraddress': 'serveraddress', 'username': 'username'} _toPy = {'auth': 'auth', 'email': 'email', 'identitytoken': 'identitytoken', 'image-name': 'image_name', 'password': 'password', 'registrytoken': 'registrytoken', 'repository': 'repository', 'serveraddress': 'serveraddress', 'username': 'username'} + def __init__(self, auth=None, email=None, identitytoken=None, image_name=None, password=None, registrytoken=None, repository=None, serveraddress=None, username=None, **unknown_fields): ''' auth : str @@ -8980,6 +9262,7 @@ def __init__(self, auth=None, email=None, identitytoken=None, image_name=None, p class DownloadInfoResult(Type): _toSchema = {'charm_origin': 'charm-origin', 'url': 'url'} _toPy = {'charm-origin': 'charm_origin', 'url': 'url'} + def __init__(self, charm_origin=None, url=None, **unknown_fields): ''' charm_origin : CharmOrigin @@ -9004,6 +9287,7 @@ def __init__(self, charm_origin=None, url=None, **unknown_fields): class DownloadInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~DownloadInfoResult] @@ -9022,6 +9306,7 @@ def __init__(self, results=None, **unknown_fields): class DumpModelRequest(Type): _toSchema = {'entities': 'entities', 'simplified': 'simplified'} _toPy = {'entities': 'entities', 'simplified': 'simplified'} + def __init__(self, entities=None, simplified=None, **unknown_fields): ''' entities : typing.Sequence[~Entity] @@ -9046,6 +9331,7 @@ def __init__(self, entities=None, simplified=None, **unknown_fields): class Endpoint(Type): _toSchema = {'application_name': 'application-name', 'relation': 'relation'} _toPy = {'application-name': 'application_name', 'relation': 'relation'} + def __init__(self, application_name=None, relation=None, **unknown_fields): ''' application_name : str @@ -9070,6 +9356,7 @@ def __init__(self, application_name=None, relation=None, **unknown_fields): class EndpointFilterAttributes(Type): _toSchema = {'interface': 'interface', 'name': 'name', 'role': 'role'} _toPy = {'interface': 'interface', 'name': 'name', 'role': 'role'} + def __init__(self, interface=None, name=None, role=None, **unknown_fields): ''' interface : str @@ -9100,6 +9387,7 @@ def __init__(self, interface=None, name=None, role=None, **unknown_fields): class EndpointRelationData(Type): _toSchema = {'applicationdata': 'ApplicationData', 'cross_model': 'cross-model', 'endpoint': 'endpoint', 'related_endpoint': 'related-endpoint', 'relation_id': 'relation-id', 'unit_relation_data': 'unit-relation-data'} _toPy = {'ApplicationData': 'applicationdata', 'cross-model': 'cross_model', 'endpoint': 'endpoint', 'related-endpoint': 'related_endpoint', 'relation-id': 'relation_id', 'unit-relation-data': 'unit_relation_data'} + def __init__(self, applicationdata=None, cross_model=None, endpoint=None, related_endpoint=None, relation_id=None, unit_relation_data=None, **unknown_fields): ''' applicationdata : typing.Mapping[str, typing.Any] @@ -9148,6 +9436,7 @@ def __init__(self, applicationdata=None, cross_model=None, endpoint=None, relate class EndpointStatus(Type): _toSchema = {'application': 'application', 'name': 'name', 'role': 'role', 'subordinate': 'subordinate'} _toPy = {'application': 'application', 'name': 'name', 'role': 'role', 'subordinate': 'subordinate'} + def __init__(self, application=None, name=None, role=None, subordinate=None, **unknown_fields): ''' application : str @@ -9184,6 +9473,7 @@ def __init__(self, application=None, name=None, role=None, subordinate=None, **u class EnqueuedActions(Type): _toSchema = {'actions': 'actions', 'operation': 'operation'} _toPy = {'actions': 'actions', 'operation': 'operation'} + def __init__(self, actions=None, operation=None, **unknown_fields): ''' actions : typing.Sequence[~ActionResult] @@ -9208,6 +9498,7 @@ def __init__(self, actions=None, operation=None, **unknown_fields): class Entities(Type): _toSchema = {'entities': 'entities'} _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): ''' entities : typing.Sequence[~Entity] @@ -9226,6 +9517,7 @@ def __init__(self, entities=None, **unknown_fields): class EntitiesCharmURL(Type): _toSchema = {'entities': 'entities'} _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): ''' entities : typing.Sequence[~EntityCharmURL] @@ -9244,6 +9536,7 @@ def __init__(self, entities=None, **unknown_fields): class EntitiesResult(Type): _toSchema = {'entities': 'entities', 'error': 'error'} _toPy = {'entities': 'entities', 'error': 'error'} + def __init__(self, entities=None, error=None, **unknown_fields): ''' entities : typing.Sequence[~Entity] @@ -9268,6 +9561,7 @@ def __init__(self, entities=None, error=None, **unknown_fields): class EntitiesResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~EntitiesResult] @@ -9286,6 +9580,7 @@ def __init__(self, results=None, **unknown_fields): class EntitiesVersion(Type): _toSchema = {'agent_tools': 'agent-tools'} _toPy = {'agent-tools': 'agent_tools'} + def __init__(self, agent_tools=None, **unknown_fields): ''' agent_tools : typing.Sequence[~EntityVersion] @@ -9304,6 +9599,7 @@ def __init__(self, agent_tools=None, **unknown_fields): class EntitiesWatchResult(Type): _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' changes : typing.Sequence[str] @@ -9334,6 +9630,7 @@ def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): class Entity(Type): _toSchema = {'tag': 'tag'} _toPy = {'tag': 'tag'} + def __init__(self, tag=None, **unknown_fields): ''' tag : str @@ -9352,6 +9649,7 @@ def __init__(self, tag=None, **unknown_fields): class EntityAnnotations(Type): _toSchema = {'annotations': 'annotations', 'entity': 'entity'} _toPy = {'annotations': 'annotations', 'entity': 'entity'} + def __init__(self, annotations=None, entity=None, **unknown_fields): ''' annotations : typing.Mapping[str, str] @@ -9376,6 +9674,7 @@ def __init__(self, annotations=None, entity=None, **unknown_fields): class EntityCharmURL(Type): _toSchema = {'charm_url': 'charm-url', 'tag': 'tag'} _toPy = {'charm-url': 'charm_url', 'tag': 'tag'} + def __init__(self, charm_url=None, tag=None, **unknown_fields): ''' charm_url : str @@ -9400,6 +9699,7 @@ def __init__(self, charm_url=None, tag=None, **unknown_fields): class EntityMacaroonArg(Type): _toSchema = {'macaroon': 'macaroon', 'tag': 'tag'} _toPy = {'macaroon': 'macaroon', 'tag': 'tag'} + def __init__(self, macaroon=None, tag=None, **unknown_fields): ''' macaroon : Macaroon @@ -9424,6 +9724,7 @@ def __init__(self, macaroon=None, tag=None, **unknown_fields): class EntityMacaroonArgs(Type): _toSchema = {'args': 'Args'} _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~EntityMacaroonArg] @@ -9442,6 +9743,7 @@ def __init__(self, args=None, **unknown_fields): class EntityMetrics(Type): _toSchema = {'error': 'error', 'metrics': 'metrics'} _toPy = {'error': 'error', 'metrics': 'metrics'} + def __init__(self, error=None, metrics=None, **unknown_fields): ''' error : Error @@ -9466,6 +9768,7 @@ def __init__(self, error=None, metrics=None, **unknown_fields): class EntityPassword(Type): _toSchema = {'password': 'password', 'tag': 'tag'} _toPy = {'password': 'password', 'tag': 'tag'} + def __init__(self, password=None, tag=None, **unknown_fields): ''' password : str @@ -9490,6 +9793,7 @@ def __init__(self, password=None, tag=None, **unknown_fields): class EntityPasswords(Type): _toSchema = {'changes': 'changes'} _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): ''' changes : typing.Sequence[~EntityPassword] @@ -9508,6 +9812,7 @@ def __init__(self, changes=None, **unknown_fields): class EntityPortRange(Type): _toSchema = {'endpoint': 'endpoint', 'from_port': 'from-port', 'protocol': 'protocol', 'tag': 'tag', 'to_port': 'to-port'} _toPy = {'endpoint': 'endpoint', 'from-port': 'from_port', 'protocol': 'protocol', 'tag': 'tag', 'to-port': 'to_port'} + def __init__(self, endpoint=None, from_port=None, protocol=None, tag=None, to_port=None, **unknown_fields): ''' endpoint : str @@ -9550,6 +9855,7 @@ def __init__(self, endpoint=None, from_port=None, protocol=None, tag=None, to_po class EntityStatus(Type): _toSchema = {'data': 'data', 'info': 'info', 'since': 'since', 'status': 'status'} _toPy = {'data': 'data', 'info': 'info', 'since': 'since', 'status': 'status'} + def __init__(self, data=None, info=None, since=None, status=None, **unknown_fields): ''' data : typing.Mapping[str, typing.Any] @@ -9586,6 +9892,7 @@ def __init__(self, data=None, info=None, since=None, status=None, **unknown_fiel class EntityStatusArgs(Type): _toSchema = {'data': 'data', 'info': 'info', 'status': 'status', 'tag': 'tag'} _toPy = {'data': 'data', 'info': 'info', 'status': 'status', 'tag': 'tag'} + def __init__(self, data=None, info=None, status=None, tag=None, **unknown_fields): ''' data : typing.Mapping[str, typing.Any] @@ -9622,6 +9929,7 @@ def __init__(self, data=None, info=None, status=None, tag=None, **unknown_fields class EntityString(Type): _toSchema = {'tag': 'tag', 'value': 'value'} _toPy = {'tag': 'tag', 'value': 'value'} + def __init__(self, tag=None, value=None, **unknown_fields): ''' tag : str @@ -9646,6 +9954,7 @@ def __init__(self, tag=None, value=None, **unknown_fields): class EntityVersion(Type): _toSchema = {'tag': 'tag', 'tools': 'tools'} _toPy = {'tag': 'tag', 'tools': 'tools'} + def __init__(self, tag=None, tools=None, **unknown_fields): ''' tag : str @@ -9670,6 +9979,7 @@ def __init__(self, tag=None, tools=None, **unknown_fields): class EntityWorkloadVersion(Type): _toSchema = {'tag': 'tag', 'workload_version': 'workload-version'} _toPy = {'tag': 'tag', 'workload-version': 'workload_version'} + def __init__(self, tag=None, workload_version=None, **unknown_fields): ''' tag : str @@ -9694,6 +10004,7 @@ def __init__(self, tag=None, workload_version=None, **unknown_fields): class EntityWorkloadVersions(Type): _toSchema = {'entities': 'entities'} _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): ''' entities : typing.Sequence[~EntityWorkloadVersion] @@ -9712,6 +10023,7 @@ def __init__(self, entities=None, **unknown_fields): class Error(Type): _toSchema = {'code': 'code', 'info': 'info', 'message': 'message'} _toPy = {'code': 'code', 'info': 'info', 'message': 'message'} + def __init__(self, code=None, info=None, message=None, **unknown_fields): ''' code : str @@ -9742,6 +10054,7 @@ def __init__(self, code=None, info=None, message=None, **unknown_fields): class ErrorResult(Type): _toSchema = {'error': 'error'} _toPy = {'error': 'error'} + def __init__(self, error=None, **unknown_fields): ''' error : Error @@ -9760,6 +10073,7 @@ def __init__(self, error=None, **unknown_fields): class ErrorResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ErrorResult] @@ -9778,6 +10092,7 @@ def __init__(self, results=None, **unknown_fields): class ExportBundleParams(Type): _toSchema = {'include_charm_defaults': 'include-charm-defaults', 'include_series': 'include-series'} _toPy = {'include-charm-defaults': 'include_charm_defaults', 'include-series': 'include_series'} + def __init__(self, include_charm_defaults=None, include_series=None, **unknown_fields): ''' include_charm_defaults : bool @@ -9802,6 +10117,7 @@ def __init__(self, include_charm_defaults=None, include_series=None, **unknown_f class ExposeInfoResult(Type): _toSchema = {'error': 'error', 'exposed': 'exposed', 'exposed_endpoints': 'exposed-endpoints'} _toPy = {'error': 'error', 'exposed': 'exposed', 'exposed-endpoints': 'exposed_endpoints'} + def __init__(self, error=None, exposed=None, exposed_endpoints=None, **unknown_fields): ''' error : Error @@ -9832,6 +10148,7 @@ def __init__(self, error=None, exposed=None, exposed_endpoints=None, **unknown_f class ExposeInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ExposeInfoResult] @@ -9850,6 +10167,7 @@ def __init__(self, results=None, **unknown_fields): class ExposedEndpoint(Type): _toSchema = {'expose_to_cidrs': 'expose-to-cidrs', 'expose_to_spaces': 'expose-to-spaces'} _toPy = {'expose-to-cidrs': 'expose_to_cidrs', 'expose-to-spaces': 'expose_to_spaces'} + def __init__(self, expose_to_cidrs=None, expose_to_spaces=None, **unknown_fields): ''' expose_to_cidrs : typing.Sequence[str] @@ -9874,6 +10192,7 @@ def __init__(self, expose_to_cidrs=None, expose_to_spaces=None, **unknown_fields class ExpressionTree(Type): _toSchema = {'expression': 'Expression'} _toPy = {'Expression': 'expression'} + def __init__(self, expression=None, **unknown_fields): ''' expression : Any @@ -9889,6 +10208,7 @@ def __init__(self, expression=None, **unknown_fields): class ExternalControllerInfo(Type): _toSchema = {'addrs': 'addrs', 'ca_cert': 'ca-cert', 'controller_alias': 'controller-alias', 'controller_tag': 'controller-tag'} _toPy = {'addrs': 'addrs', 'ca-cert': 'ca_cert', 'controller-alias': 'controller_alias', 'controller-tag': 'controller_tag'} + def __init__(self, addrs=None, ca_cert=None, controller_alias=None, controller_tag=None, **unknown_fields): ''' addrs : typing.Sequence[str] @@ -9925,6 +10245,7 @@ def __init__(self, addrs=None, ca_cert=None, controller_alias=None, controller_t class ExternalControllerInfoResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -9949,6 +10270,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class ExternalControllerInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ExternalControllerInfoResult] @@ -9967,6 +10289,7 @@ def __init__(self, results=None, **unknown_fields): class FanConfigEntry(Type): _toSchema = {'overlay': 'overlay', 'underlay': 'underlay'} _toPy = {'overlay': 'overlay', 'underlay': 'underlay'} + def __init__(self, overlay=None, underlay=None, **unknown_fields): ''' overlay : str @@ -9991,6 +10314,7 @@ def __init__(self, overlay=None, underlay=None, **unknown_fields): class FanConfigResult(Type): _toSchema = {'fans': 'fans'} _toPy = {'fans': 'fans'} + def __init__(self, fans=None, **unknown_fields): ''' fans : typing.Sequence[~FanConfigEntry] @@ -10009,6 +10333,7 @@ def __init__(self, fans=None, **unknown_fields): class Filesystem(Type): _toSchema = {'filesystem_tag': 'filesystem-tag', 'info': 'info', 'volume_tag': 'volume-tag'} _toPy = {'filesystem-tag': 'filesystem_tag', 'info': 'info', 'volume-tag': 'volume_tag'} + def __init__(self, filesystem_tag=None, info=None, volume_tag=None, **unknown_fields): ''' filesystem_tag : str @@ -10039,6 +10364,7 @@ def __init__(self, filesystem_tag=None, info=None, volume_tag=None, **unknown_fi class FilesystemAttachment(Type): _toSchema = {'filesystem_tag': 'filesystem-tag', 'info': 'info', 'machine_tag': 'machine-tag'} _toPy = {'filesystem-tag': 'filesystem_tag', 'info': 'info', 'machine-tag': 'machine_tag'} + def __init__(self, filesystem_tag=None, info=None, machine_tag=None, **unknown_fields): ''' filesystem_tag : str @@ -10069,6 +10395,7 @@ def __init__(self, filesystem_tag=None, info=None, machine_tag=None, **unknown_f class FilesystemAttachmentDetails(Type): _toSchema = {'filesystemattachmentinfo': 'FilesystemAttachmentInfo', 'life': 'life', 'mount_point': 'mount-point', 'read_only': 'read-only'} _toPy = {'FilesystemAttachmentInfo': 'filesystemattachmentinfo', 'life': 'life', 'mount-point': 'mount_point', 'read-only': 'read_only'} + def __init__(self, filesystemattachmentinfo=None, life=None, mount_point=None, read_only=None, **unknown_fields): ''' filesystemattachmentinfo : FilesystemAttachmentInfo @@ -10105,6 +10432,7 @@ def __init__(self, filesystemattachmentinfo=None, life=None, mount_point=None, r class FilesystemAttachmentInfo(Type): _toSchema = {'mount_point': 'mount-point', 'read_only': 'read-only'} _toPy = {'mount-point': 'mount_point', 'read-only': 'read_only'} + def __init__(self, mount_point=None, read_only=None, **unknown_fields): ''' mount_point : str @@ -10129,6 +10457,7 @@ def __init__(self, mount_point=None, read_only=None, **unknown_fields): class FilesystemAttachmentParams(Type): _toSchema = {'filesystem_id': 'filesystem-id', 'filesystem_tag': 'filesystem-tag', 'instance_id': 'instance-id', 'machine_tag': 'machine-tag', 'mount_point': 'mount-point', 'provider': 'provider', 'read_only': 'read-only'} _toPy = {'filesystem-id': 'filesystem_id', 'filesystem-tag': 'filesystem_tag', 'instance-id': 'instance_id', 'machine-tag': 'machine_tag', 'mount-point': 'mount_point', 'provider': 'provider', 'read-only': 'read_only'} + def __init__(self, filesystem_id=None, filesystem_tag=None, instance_id=None, machine_tag=None, mount_point=None, provider=None, read_only=None, **unknown_fields): ''' filesystem_id : str @@ -10183,6 +10512,7 @@ def __init__(self, filesystem_id=None, filesystem_tag=None, instance_id=None, ma class FilesystemAttachmentParamsResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -10207,6 +10537,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class FilesystemAttachmentParamsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~FilesystemAttachmentParamsResult] @@ -10225,6 +10556,7 @@ def __init__(self, results=None, **unknown_fields): class FilesystemAttachmentResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -10249,6 +10581,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class FilesystemAttachmentResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~FilesystemAttachmentResult] @@ -10267,6 +10600,7 @@ def __init__(self, results=None, **unknown_fields): class FilesystemAttachments(Type): _toSchema = {'filesystem_attachments': 'filesystem-attachments'} _toPy = {'filesystem-attachments': 'filesystem_attachments'} + def __init__(self, filesystem_attachments=None, **unknown_fields): ''' filesystem_attachments : typing.Sequence[~FilesystemAttachment] @@ -10285,6 +10619,7 @@ def __init__(self, filesystem_attachments=None, **unknown_fields): class FilesystemDetails(Type): _toSchema = {'filesystem_tag': 'filesystem-tag', 'info': 'info', 'life': 'life', 'machine_attachments': 'machine-attachments', 'status': 'status', 'storage': 'storage', 'unit_attachments': 'unit-attachments', 'volume_tag': 'volume-tag'} _toPy = {'filesystem-tag': 'filesystem_tag', 'info': 'info', 'life': 'life', 'machine-attachments': 'machine_attachments', 'status': 'status', 'storage': 'storage', 'unit-attachments': 'unit_attachments', 'volume-tag': 'volume_tag'} + def __init__(self, filesystem_tag=None, info=None, life=None, machine_attachments=None, status=None, storage=None, unit_attachments=None, volume_tag=None, **unknown_fields): ''' filesystem_tag : str @@ -10345,6 +10680,7 @@ def __init__(self, filesystem_tag=None, info=None, life=None, machine_attachment class FilesystemDetailsListResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -10369,6 +10705,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class FilesystemDetailsListResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~FilesystemDetailsListResult] @@ -10387,6 +10724,7 @@ def __init__(self, results=None, **unknown_fields): class FilesystemFilter(Type): _toSchema = {'machines': 'machines'} _toPy = {'machines': 'machines'} + def __init__(self, machines=None, **unknown_fields): ''' machines : typing.Sequence[str] @@ -10405,6 +10743,7 @@ def __init__(self, machines=None, **unknown_fields): class FilesystemFilters(Type): _toSchema = {'filters': 'filters'} _toPy = {'filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): ''' filters : typing.Sequence[~FilesystemFilter] @@ -10423,6 +10762,7 @@ def __init__(self, filters=None, **unknown_fields): class FilesystemInfo(Type): _toSchema = {'filesystem_id': 'filesystem-id', 'pool': 'pool', 'size': 'size'} _toPy = {'filesystem-id': 'filesystem_id', 'pool': 'pool', 'size': 'size'} + def __init__(self, filesystem_id=None, pool=None, size=None, **unknown_fields): ''' filesystem_id : str @@ -10453,6 +10793,7 @@ def __init__(self, filesystem_id=None, pool=None, size=None, **unknown_fields): class FilesystemParams(Type): _toSchema = {'attachment': 'attachment', 'attributes': 'attributes', 'filesystem_tag': 'filesystem-tag', 'provider': 'provider', 'size': 'size', 'tags': 'tags', 'volume_tag': 'volume-tag'} _toPy = {'attachment': 'attachment', 'attributes': 'attributes', 'filesystem-tag': 'filesystem_tag', 'provider': 'provider', 'size': 'size', 'tags': 'tags', 'volume-tag': 'volume_tag'} + def __init__(self, attachment=None, attributes=None, filesystem_tag=None, provider=None, size=None, tags=None, volume_tag=None, **unknown_fields): ''' attachment : FilesystemAttachmentParams @@ -10507,6 +10848,7 @@ def __init__(self, attachment=None, attributes=None, filesystem_tag=None, provid class FilesystemParamsResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -10531,6 +10873,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class FilesystemParamsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~FilesystemParamsResult] @@ -10549,6 +10892,7 @@ def __init__(self, results=None, **unknown_fields): class FilesystemResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -10573,6 +10917,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class FilesystemResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~FilesystemResult] @@ -10591,6 +10936,7 @@ def __init__(self, results=None, **unknown_fields): class Filesystems(Type): _toSchema = {'filesystems': 'filesystems'} _toPy = {'filesystems': 'filesystems'} + def __init__(self, filesystems=None, **unknown_fields): ''' filesystems : typing.Sequence[~Filesystem] @@ -10609,6 +10955,7 @@ def __init__(self, filesystems=None, **unknown_fields): class FindToolsParams(Type): _toSchema = {'agentstream': 'agentstream', 'arch': 'arch', 'major': 'major', 'number': 'number', 'os_type': 'os-type'} _toPy = {'agentstream': 'agentstream', 'arch': 'arch', 'major': 'major', 'number': 'number', 'os-type': 'os_type'} + def __init__(self, agentstream=None, arch=None, major=None, number=None, os_type=None, **unknown_fields): ''' agentstream : str @@ -10651,6 +10998,7 @@ def __init__(self, agentstream=None, arch=None, major=None, number=None, os_type class FindToolsResult(Type): _toSchema = {'error': 'error', 'list_': 'list'} _toPy = {'error': 'error', 'list': 'list_'} + def __init__(self, error=None, list_=None, **unknown_fields): ''' error : Error @@ -10675,6 +11023,7 @@ def __init__(self, error=None, list_=None, **unknown_fields): class FirewallRule(Type): _toSchema = {'known_service': 'known-service', 'whitelist_cidrs': 'whitelist-cidrs'} _toPy = {'known-service': 'known_service', 'whitelist-cidrs': 'whitelist_cidrs'} + def __init__(self, known_service=None, whitelist_cidrs=None, **unknown_fields): ''' known_service : str @@ -10699,6 +11048,7 @@ def __init__(self, known_service=None, whitelist_cidrs=None, **unknown_fields): class FirewallRuleArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~FirewallRule] @@ -10717,6 +11067,7 @@ def __init__(self, args=None, **unknown_fields): class FullStatus(Type): _toSchema = {'applications': 'applications', 'branches': 'branches', 'controller_timestamp': 'controller-timestamp', 'filesystems': 'filesystems', 'machines': 'machines', 'model': 'model', 'offers': 'offers', 'relations': 'relations', 'remote_applications': 'remote-applications', 'storage': 'storage', 'volumes': 'volumes'} _toPy = {'applications': 'applications', 'branches': 'branches', 'controller-timestamp': 'controller_timestamp', 'filesystems': 'filesystems', 'machines': 'machines', 'model': 'model', 'offers': 'offers', 'relations': 'relations', 'remote-applications': 'remote_applications', 'storage': 'storage', 'volumes': 'volumes'} + def __init__(self, applications=None, branches=None, controller_timestamp=None, filesystems=None, machines=None, model=None, offers=None, relations=None, remote_applications=None, storage=None, volumes=None, **unknown_fields): ''' applications : typing.Mapping[str, ~ApplicationStatus] @@ -10795,6 +11146,7 @@ def __init__(self, applications=None, branches=None, controller_timestamp=None, class Generation(Type): _toSchema = {'applications': 'applications', 'branch': 'branch', 'completed': 'completed', 'completed_by': 'completed-by', 'created': 'created', 'created_by': 'created-by', 'generation_id': 'generation-id'} _toPy = {'applications': 'applications', 'branch': 'branch', 'completed': 'completed', 'completed-by': 'completed_by', 'created': 'created', 'created-by': 'created_by', 'generation-id': 'generation_id'} + def __init__(self, applications=None, branch=None, completed=None, completed_by=None, created=None, created_by=None, generation_id=None, **unknown_fields): ''' applications : typing.Sequence[~GenerationApplication] @@ -10849,6 +11201,7 @@ def __init__(self, applications=None, branch=None, completed=None, completed_by= class GenerationApplication(Type): _toSchema = {'application': 'application', 'config': 'config', 'pending': 'pending', 'progress': 'progress', 'tracking': 'tracking'} _toPy = {'application': 'application', 'config': 'config', 'pending': 'pending', 'progress': 'progress', 'tracking': 'tracking'} + def __init__(self, application=None, config=None, pending=None, progress=None, tracking=None, **unknown_fields): ''' application : str @@ -10891,6 +11244,7 @@ def __init__(self, application=None, config=None, pending=None, progress=None, t class GenerationId(Type): _toSchema = {'generation_id': 'generation-id'} _toPy = {'generation-id': 'generation_id'} + def __init__(self, generation_id=None, **unknown_fields): ''' generation_id : int @@ -10909,6 +11263,7 @@ def __init__(self, generation_id=None, **unknown_fields): class GenerationResult(Type): _toSchema = {'error': 'error', 'generation': 'generation'} _toPy = {'error': 'error', 'generation': 'generation'} + def __init__(self, error=None, generation=None, **unknown_fields): ''' error : Error @@ -10933,6 +11288,7 @@ def __init__(self, error=None, generation=None, **unknown_fields): class GetConstraintsResults(Type): _toSchema = {'constraints': 'constraints'} _toPy = {'constraints': 'constraints'} + def __init__(self, constraints=None, **unknown_fields): ''' constraints : Value @@ -10951,6 +11307,7 @@ def __init__(self, constraints=None, **unknown_fields): class GetLeadershipSettingsBulkResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~GetLeadershipSettingsResult] @@ -10969,6 +11326,7 @@ def __init__(self, results=None, **unknown_fields): class GetLeadershipSettingsResult(Type): _toSchema = {'error': 'error', 'settings': 'settings'} _toPy = {'error': 'error', 'settings': 'settings'} + def __init__(self, error=None, settings=None, **unknown_fields): ''' error : Error @@ -10993,6 +11351,7 @@ def __init__(self, error=None, settings=None, **unknown_fields): class GetRemoteSecretAccessArg(Type): _toSchema = {'application_token': 'application-token', 'unit_id': 'unit-id', 'uri': 'uri'} _toPy = {'application-token': 'application_token', 'unit-id': 'unit_id', 'uri': 'uri'} + def __init__(self, application_token=None, unit_id=None, uri=None, **unknown_fields): ''' application_token : str @@ -11023,6 +11382,7 @@ def __init__(self, application_token=None, unit_id=None, uri=None, **unknown_fie class GetRemoteSecretAccessArgs(Type): _toSchema = {'relations': 'relations'} _toPy = {'relations': 'relations'} + def __init__(self, relations=None, **unknown_fields): ''' relations : typing.Sequence[~GetRemoteSecretAccessArg] @@ -11041,6 +11401,7 @@ def __init__(self, relations=None, **unknown_fields): class GetRemoteSecretContentArg(Type): _toSchema = {'application_token': 'application-token', 'bakery_version': 'bakery-version', 'macaroons': 'macaroons', 'peek': 'peek', 'refresh': 'refresh', 'revision': 'revision', 'source_controller_uuid': 'source-controller-uuid', 'unit_id': 'unit-id', 'uri': 'uri'} _toPy = {'application-token': 'application_token', 'bakery-version': 'bakery_version', 'macaroons': 'macaroons', 'peek': 'peek', 'refresh': 'refresh', 'revision': 'revision', 'source-controller-uuid': 'source_controller_uuid', 'unit-id': 'unit_id', 'uri': 'uri'} + def __init__(self, application_token=None, bakery_version=None, macaroons=None, peek=None, refresh=None, revision=None, source_controller_uuid=None, unit_id=None, uri=None, **unknown_fields): ''' application_token : str @@ -11107,6 +11468,7 @@ def __init__(self, application_token=None, bakery_version=None, macaroons=None, class GetRemoteSecretContentArgs(Type): _toSchema = {'relations': 'relations'} _toPy = {'relations': 'relations'} + def __init__(self, relations=None, **unknown_fields): ''' relations : typing.Sequence[~GetRemoteSecretContentArg] @@ -11125,6 +11487,7 @@ def __init__(self, relations=None, **unknown_fields): class GetSecretConsumerInfoArgs(Type): _toSchema = {'consumer_tag': 'consumer-tag', 'uris': 'uris'} _toPy = {'consumer-tag': 'consumer_tag', 'uris': 'uris'} + def __init__(self, consumer_tag=None, uris=None, **unknown_fields): ''' consumer_tag : str @@ -11149,6 +11512,7 @@ def __init__(self, consumer_tag=None, uris=None, **unknown_fields): class GetSecretContentArg(Type): _toSchema = {'label': 'label', 'peek': 'peek', 'refresh': 'refresh', 'uri': 'uri'} _toPy = {'label': 'label', 'peek': 'peek', 'refresh': 'refresh', 'uri': 'uri'} + def __init__(self, label=None, peek=None, refresh=None, uri=None, **unknown_fields): ''' label : str @@ -11185,6 +11549,7 @@ def __init__(self, label=None, peek=None, refresh=None, uri=None, **unknown_fiel class GetSecretContentArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~GetSecretContentArg] @@ -11203,6 +11568,7 @@ def __init__(self, args=None, **unknown_fields): class GetTokenArg(Type): _toSchema = {'tag': 'tag'} _toPy = {'tag': 'tag'} + def __init__(self, tag=None, **unknown_fields): ''' tag : str @@ -11221,6 +11587,7 @@ def __init__(self, tag=None, **unknown_fields): class GetTokenArgs(Type): _toSchema = {'args': 'Args'} _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~GetTokenArg] @@ -11239,6 +11606,7 @@ def __init__(self, args=None, **unknown_fields): class GoalState(Type): _toSchema = {'relations': 'relations', 'units': 'units'} _toPy = {'relations': 'relations', 'units': 'units'} + def __init__(self, relations=None, units=None, **unknown_fields): ''' relations : typing.Mapping[str, typing.Any] @@ -11263,6 +11631,7 @@ def __init__(self, relations=None, units=None, **unknown_fields): class GoalStateResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -11287,6 +11656,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class GoalStateResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~GoalStateResult] @@ -11305,6 +11675,7 @@ def __init__(self, results=None, **unknown_fields): class GoalStateStatus(Type): _toSchema = {'since': 'since', 'status': 'status'} _toPy = {'since': 'since', 'status': 'status'} + def __init__(self, since=None, status=None, **unknown_fields): ''' since : str @@ -11329,6 +11700,7 @@ def __init__(self, since=None, status=None, **unknown_fields): class GrantRevokeSecretArg(Type): _toSchema = {'role': 'role', 'scope_tag': 'scope-tag', 'subject_tags': 'subject-tags', 'uri': 'uri'} _toPy = {'role': 'role', 'scope-tag': 'scope_tag', 'subject-tags': 'subject_tags', 'uri': 'uri'} + def __init__(self, role=None, scope_tag=None, subject_tags=None, uri=None, **unknown_fields): ''' role : str @@ -11365,6 +11737,7 @@ def __init__(self, role=None, scope_tag=None, subject_tags=None, uri=None, **unk class GrantRevokeSecretArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~GrantRevokeSecretArg] @@ -11383,6 +11756,7 @@ def __init__(self, args=None, **unknown_fields): class GrantRevokeUserSecretArg(Type): _toSchema = {'applications': 'applications', 'label': 'label', 'uri': 'uri'} _toPy = {'applications': 'applications', 'label': 'label', 'uri': 'uri'} + def __init__(self, applications=None, label=None, uri=None, **unknown_fields): ''' applications : typing.Sequence[str] @@ -11413,6 +11787,7 @@ def __init__(self, applications=None, label=None, uri=None, **unknown_fields): class HardwareCharacteristics(Type): _toSchema = {'arch': 'arch', 'availability_zone': 'availability-zone', 'cpu_cores': 'cpu-cores', 'cpu_power': 'cpu-power', 'mem': 'mem', 'root_disk': 'root-disk', 'root_disk_source': 'root-disk-source', 'tags': 'tags', 'virt_type': 'virt-type'} _toPy = {'arch': 'arch', 'availability-zone': 'availability_zone', 'cpu-cores': 'cpu_cores', 'cpu-power': 'cpu_power', 'mem': 'mem', 'root-disk': 'root_disk', 'root-disk-source': 'root_disk_source', 'tags': 'tags', 'virt-type': 'virt_type'} + def __init__(self, arch=None, availability_zone=None, cpu_cores=None, cpu_power=None, mem=None, root_disk=None, root_disk_source=None, tags=None, virt_type=None, **unknown_fields): ''' arch : str @@ -11479,6 +11854,7 @@ def __init__(self, arch=None, availability_zone=None, cpu_cores=None, cpu_power= class History(Type): _toSchema = {'error': 'error', 'statuses': 'statuses'} _toPy = {'error': 'error', 'statuses': 'statuses'} + def __init__(self, error=None, statuses=None, **unknown_fields): ''' error : Error @@ -11503,6 +11879,7 @@ def __init__(self, error=None, statuses=None, **unknown_fields): class HostNetworkChange(Type): _toSchema = {'error': 'error', 'new_bridges': 'new-bridges', 'reconfigure_delay': 'reconfigure-delay'} _toPy = {'error': 'error', 'new-bridges': 'new_bridges', 'reconfigure-delay': 'reconfigure_delay'} + def __init__(self, error=None, new_bridges=None, reconfigure_delay=None, **unknown_fields): ''' error : Error @@ -11533,6 +11910,7 @@ def __init__(self, error=None, new_bridges=None, reconfigure_delay=None, **unkno class HostNetworkChangeResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~HostNetworkChange] @@ -11551,6 +11929,7 @@ def __init__(self, results=None, **unknown_fields): class HostPort(Type): _toSchema = {'address': 'Address', 'cidr': 'cidr', 'config_type': 'config-type', 'is_secondary': 'is-secondary', 'port': 'port', 'scope': 'scope', 'space_id': 'space-id', 'space_name': 'space-name', 'type_': 'type', 'value': 'value'} _toPy = {'Address': 'address', 'cidr': 'cidr', 'config-type': 'config_type', 'is-secondary': 'is_secondary', 'port': 'port', 'scope': 'scope', 'space-id': 'space_id', 'space-name': 'space_name', 'type': 'type_', 'value': 'value'} + def __init__(self, address=None, cidr=None, config_type=None, is_secondary=None, port=None, scope=None, space_id=None, space_name=None, type_=None, value=None, **unknown_fields): ''' address : Address @@ -11623,6 +12002,7 @@ def __init__(self, address=None, cidr=None, config_type=None, is_secondary=None, class HostedModelConfig(Type): _toSchema = {'cloud_spec': 'cloud-spec', 'config': 'config', 'error': 'error', 'name': 'name', 'owner': 'owner'} _toPy = {'cloud-spec': 'cloud_spec', 'config': 'config', 'error': 'error', 'name': 'name', 'owner': 'owner'} + def __init__(self, cloud_spec=None, config=None, error=None, name=None, owner=None, **unknown_fields): ''' cloud_spec : CloudSpec @@ -11665,6 +12045,7 @@ def __init__(self, cloud_spec=None, config=None, error=None, name=None, owner=No class HostedModelConfigsResults(Type): _toSchema = {'models': 'models'} _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): ''' models : typing.Sequence[~HostedModelConfig] @@ -11683,6 +12064,7 @@ def __init__(self, models=None, **unknown_fields): class ImageMetadataFilter(Type): _toSchema = {'arches': 'arches', 'region': 'region', 'root_storage_type': 'root-storage-type', 'stream': 'stream', 'versions': 'versions', 'virt_type': 'virt-type'} _toPy = {'arches': 'arches', 'region': 'region', 'root-storage-type': 'root_storage_type', 'stream': 'stream', 'versions': 'versions', 'virt-type': 'virt_type'} + def __init__(self, arches=None, region=None, root_storage_type=None, stream=None, versions=None, virt_type=None, **unknown_fields): ''' arches : typing.Sequence[str] @@ -11731,6 +12113,7 @@ def __init__(self, arches=None, region=None, root_storage_type=None, stream=None class ImportStorageDetails(Type): _toSchema = {'storage_tag': 'storage-tag'} _toPy = {'storage-tag': 'storage_tag'} + def __init__(self, storage_tag=None, **unknown_fields): ''' storage_tag : str @@ -11749,6 +12132,7 @@ def __init__(self, storage_tag=None, **unknown_fields): class ImportStorageParams(Type): _toSchema = {'kind': 'kind', 'pool': 'pool', 'provider_id': 'provider-id', 'storage_name': 'storage-name'} _toPy = {'kind': 'kind', 'pool': 'pool', 'provider-id': 'provider_id', 'storage-name': 'storage_name'} + def __init__(self, kind=None, pool=None, provider_id=None, storage_name=None, **unknown_fields): ''' kind : int @@ -11785,6 +12169,7 @@ def __init__(self, kind=None, pool=None, provider_id=None, storage_name=None, ** class ImportStorageResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -11809,6 +12194,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class ImportStorageResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ImportStorageResult] @@ -11827,6 +12213,7 @@ def __init__(self, results=None, **unknown_fields): class IngressNetworksChangeEvent(Type): _toSchema = {'bakery_version': 'bakery-version', 'ingress_required': 'ingress-required', 'macaroons': 'macaroons', 'networks': 'networks', 'relation_token': 'relation-token'} _toPy = {'bakery-version': 'bakery_version', 'ingress-required': 'ingress_required', 'macaroons': 'macaroons', 'networks': 'networks', 'relation-token': 'relation_token'} + def __init__(self, bakery_version=None, ingress_required=None, macaroons=None, networks=None, relation_token=None, **unknown_fields): ''' bakery_version : int @@ -11869,6 +12256,7 @@ def __init__(self, bakery_version=None, ingress_required=None, macaroons=None, n class IngressNetworksChanges(Type): _toSchema = {'changes': 'changes'} _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): ''' changes : typing.Sequence[~IngressNetworksChangeEvent] @@ -11887,6 +12275,7 @@ def __init__(self, changes=None, **unknown_fields): class IngressRule(Type): _toSchema = {'port_range': 'port-range', 'source_cidrs': 'source-cidrs'} _toPy = {'port-range': 'port_range', 'source-cidrs': 'source_cidrs'} + def __init__(self, port_range=None, source_cidrs=None, **unknown_fields): ''' port_range : PortRange @@ -11911,6 +12300,7 @@ def __init__(self, port_range=None, source_cidrs=None, **unknown_fields): class IngressRulesResult(Type): _toSchema = {'error': 'error', 'rules': 'rules'} _toPy = {'error': 'error', 'rules': 'rules'} + def __init__(self, error=None, rules=None, **unknown_fields): ''' error : Error @@ -11935,6 +12325,7 @@ def __init__(self, error=None, rules=None, **unknown_fields): class InitiateMigrationArgs(Type): _toSchema = {'specs': 'specs'} _toPy = {'specs': 'specs'} + def __init__(self, specs=None, **unknown_fields): ''' specs : typing.Sequence[~MigrationSpec] @@ -11953,6 +12344,7 @@ def __init__(self, specs=None, **unknown_fields): class InitiateMigrationResult(Type): _toSchema = {'error': 'error', 'migration_id': 'migration-id', 'model_tag': 'model-tag'} _toPy = {'error': 'error', 'migration-id': 'migration_id', 'model-tag': 'model_tag'} + def __init__(self, error=None, migration_id=None, model_tag=None, **unknown_fields): ''' error : Error @@ -11983,6 +12375,7 @@ def __init__(self, error=None, migration_id=None, model_tag=None, **unknown_fiel class InitiateMigrationResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~InitiateMigrationResult] @@ -12001,6 +12394,7 @@ def __init__(self, results=None, **unknown_fields): class InstanceInfo(Type): _toSchema = {'characteristics': 'characteristics', 'charm_profiles': 'charm-profiles', 'display_name': 'display-name', 'instance_id': 'instance-id', 'network_config': 'network-config', 'nonce': 'nonce', 'tag': 'tag', 'volume_attachments': 'volume-attachments', 'volumes': 'volumes'} _toPy = {'characteristics': 'characteristics', 'charm-profiles': 'charm_profiles', 'display-name': 'display_name', 'instance-id': 'instance_id', 'network-config': 'network_config', 'nonce': 'nonce', 'tag': 'tag', 'volume-attachments': 'volume_attachments', 'volumes': 'volumes'} + def __init__(self, characteristics=None, charm_profiles=None, display_name=None, instance_id=None, network_config=None, nonce=None, tag=None, volume_attachments=None, volumes=None, **unknown_fields): ''' characteristics : HardwareCharacteristics @@ -12067,6 +12461,7 @@ def __init__(self, characteristics=None, charm_profiles=None, display_name=None, class InstanceType(Type): _toSchema = {'arches': 'arches', 'cost': 'cost', 'cpu_cores': 'cpu-cores', 'memory': 'memory', 'name': 'name', 'root_disk': 'root-disk', 'virt_type': 'virt-type'} _toPy = {'arches': 'arches', 'cost': 'cost', 'cpu-cores': 'cpu_cores', 'memory': 'memory', 'name': 'name', 'root-disk': 'root_disk', 'virt-type': 'virt_type'} + def __init__(self, arches=None, cost=None, cpu_cores=None, memory=None, name=None, root_disk=None, virt_type=None, **unknown_fields): ''' arches : typing.Sequence[str] @@ -12121,6 +12516,7 @@ def __init__(self, arches=None, cost=None, cpu_cores=None, memory=None, name=Non class InstanceTypesResult(Type): _toSchema = {'cost_currency': 'cost-currency', 'cost_divisor': 'cost-divisor', 'cost_unit': 'cost-unit', 'error': 'error', 'instance_types': 'instance-types'} _toPy = {'cost-currency': 'cost_currency', 'cost-divisor': 'cost_divisor', 'cost-unit': 'cost_unit', 'error': 'error', 'instance-types': 'instance_types'} + def __init__(self, cost_currency=None, cost_divisor=None, cost_unit=None, error=None, instance_types=None, **unknown_fields): ''' cost_currency : str @@ -12163,6 +12559,7 @@ def __init__(self, cost_currency=None, cost_divisor=None, cost_unit=None, error= class InstanceTypesResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~InstanceTypesResult] @@ -12181,6 +12578,7 @@ def __init__(self, results=None, **unknown_fields): class InstancesInfo(Type): _toSchema = {'machines': 'machines'} _toPy = {'machines': 'machines'} + def __init__(self, machines=None, **unknown_fields): ''' machines : typing.Sequence[~InstanceInfo] @@ -12199,6 +12597,7 @@ def __init__(self, machines=None, **unknown_fields): class IntResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -12223,6 +12622,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class IntResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~IntResult] @@ -12241,6 +12641,7 @@ def __init__(self, results=None, **unknown_fields): class InterfaceAddress(Type): _toSchema = {'cidr': 'cidr', 'hostname': 'hostname', 'value': 'value'} _toPy = {'cidr': 'cidr', 'hostname': 'hostname', 'value': 'value'} + def __init__(self, cidr=None, hostname=None, value=None, **unknown_fields): ''' cidr : str @@ -12271,6 +12672,7 @@ def __init__(self, cidr=None, hostname=None, value=None, **unknown_fields): class InvalidateCredentialArg(Type): _toSchema = {'reason': 'reason'} _toPy = {'reason': 'reason'} + def __init__(self, reason=None, **unknown_fields): ''' reason : str @@ -12289,6 +12691,7 @@ def __init__(self, reason=None, **unknown_fields): class IsMasterResult(Type): _toSchema = {'master': 'master'} _toPy = {'master': 'master'} + def __init__(self, master=None, **unknown_fields): ''' master : bool @@ -12307,6 +12710,7 @@ def __init__(self, master=None, **unknown_fields): class IsMeteredResult(Type): _toSchema = {'metered': 'metered'} _toPy = {'metered': 'metered'} + def __init__(self, metered=None, **unknown_fields): ''' metered : bool @@ -12325,6 +12729,7 @@ def __init__(self, metered=None, **unknown_fields): class IssueOperatorCertificateResult(Type): _toSchema = {'ca_cert': 'ca-cert', 'cert': 'cert', 'error': 'error', 'private_key': 'private-key'} _toPy = {'ca-cert': 'ca_cert', 'cert': 'cert', 'error': 'error', 'private-key': 'private_key'} + def __init__(self, ca_cert=None, cert=None, error=None, private_key=None, **unknown_fields): ''' ca_cert : str @@ -12361,6 +12766,7 @@ def __init__(self, ca_cert=None, cert=None, error=None, private_key=None, **unkn class IssueOperatorCertificateResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~IssueOperatorCertificateResult] @@ -12379,6 +12785,7 @@ def __init__(self, results=None, **unknown_fields): class JobsResult(Type): _toSchema = {'error': 'error', 'jobs': 'jobs'} _toPy = {'error': 'error', 'jobs': 'jobs'} + def __init__(self, error=None, jobs=None, **unknown_fields): ''' error : Error @@ -12403,6 +12810,7 @@ def __init__(self, error=None, jobs=None, **unknown_fields): class JobsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~JobsResult] @@ -12421,6 +12829,7 @@ def __init__(self, results=None, **unknown_fields): class KnownServiceArgs(Type): _toSchema = {'known_services': 'known-services'} _toPy = {'known-services': 'known_services'} + def __init__(self, known_services=None, **unknown_fields): ''' known_services : typing.Sequence[str] @@ -12439,6 +12848,7 @@ def __init__(self, known_services=None, **unknown_fields): class KubernetesDeploymentInfo(Type): _toSchema = {'deployment_type': 'deployment-type', 'service_type': 'service-type'} _toPy = {'deployment-type': 'deployment_type', 'service-type': 'service_type'} + def __init__(self, deployment_type=None, service_type=None, **unknown_fields): ''' deployment_type : str @@ -12463,6 +12873,7 @@ def __init__(self, deployment_type=None, service_type=None, **unknown_fields): class KubernetesDeviceParams(Type): _toSchema = {'attributes': 'Attributes', 'count': 'Count', 'type_': 'Type'} _toPy = {'Attributes': 'attributes', 'Count': 'count', 'Type': 'type_'} + def __init__(self, attributes=None, count=None, type_=None, **unknown_fields): ''' attributes : typing.Mapping[str, str] @@ -12493,6 +12904,7 @@ def __init__(self, attributes=None, count=None, type_=None, **unknown_fields): class KubernetesFilesystemAttachmentParams(Type): _toSchema = {'mount_point': 'mount-point', 'provider': 'provider', 'read_only': 'read-only'} _toPy = {'mount-point': 'mount_point', 'provider': 'provider', 'read-only': 'read_only'} + def __init__(self, mount_point=None, provider=None, read_only=None, **unknown_fields): ''' mount_point : str @@ -12523,6 +12935,7 @@ def __init__(self, mount_point=None, provider=None, read_only=None, **unknown_fi class KubernetesFilesystemInfo(Type): _toSchema = {'data': 'data', 'filesystem_id': 'filesystem-id', 'info': 'info', 'mount_point': 'mount-point', 'pool': 'pool', 'read_only': 'read-only', 'size': 'size', 'status': 'status', 'storagename': 'storagename', 'volume': 'volume'} _toPy = {'data': 'data', 'filesystem-id': 'filesystem_id', 'info': 'info', 'mount-point': 'mount_point', 'pool': 'pool', 'read-only': 'read_only', 'size': 'size', 'status': 'status', 'storagename': 'storagename', 'volume': 'volume'} + def __init__(self, data=None, filesystem_id=None, info=None, mount_point=None, pool=None, read_only=None, size=None, status=None, storagename=None, volume=None, **unknown_fields): ''' data : typing.Mapping[str, typing.Any] @@ -12595,6 +13008,7 @@ def __init__(self, data=None, filesystem_id=None, info=None, mount_point=None, p class KubernetesFilesystemParams(Type): _toSchema = {'attachment': 'attachment', 'attributes': 'attributes', 'provider': 'provider', 'size': 'size', 'storagename': 'storagename', 'tags': 'tags'} _toPy = {'attachment': 'attachment', 'attributes': 'attributes', 'provider': 'provider', 'size': 'size', 'storagename': 'storagename', 'tags': 'tags'} + def __init__(self, attachment=None, attributes=None, provider=None, size=None, storagename=None, tags=None, **unknown_fields): ''' attachment : KubernetesFilesystemAttachmentParams @@ -12643,6 +13057,7 @@ def __init__(self, attachment=None, attributes=None, provider=None, size=None, s class KubernetesProvisioningInfo(Type): _toSchema = {'charm_modified_version': 'charm-modified-version', 'constraints': 'constraints', 'deployment_info': 'deployment-info', 'devices': 'devices', 'filesystems': 'filesystems', 'image_repo': 'image-repo', 'pod_spec': 'pod-spec', 'raw_k8s_spec': 'raw-k8s-spec', 'tags': 'tags', 'volumes': 'volumes'} _toPy = {'charm-modified-version': 'charm_modified_version', 'constraints': 'constraints', 'deployment-info': 'deployment_info', 'devices': 'devices', 'filesystems': 'filesystems', 'image-repo': 'image_repo', 'pod-spec': 'pod_spec', 'raw-k8s-spec': 'raw_k8s_spec', 'tags': 'tags', 'volumes': 'volumes'} + def __init__(self, charm_modified_version=None, constraints=None, deployment_info=None, devices=None, filesystems=None, image_repo=None, pod_spec=None, raw_k8s_spec=None, tags=None, volumes=None, **unknown_fields): ''' charm_modified_version : int @@ -12715,6 +13130,7 @@ def __init__(self, charm_modified_version=None, constraints=None, deployment_inf class KubernetesProvisioningInfoResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -12739,6 +13155,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class KubernetesProvisioningInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~KubernetesProvisioningInfoResult] @@ -12757,6 +13174,7 @@ def __init__(self, results=None, **unknown_fields): class KubernetesUpgradeArg(Type): _toSchema = {'agent_tag': 'agent-tag', 'version': 'version'} _toPy = {'agent-tag': 'agent_tag', 'version': 'version'} + def __init__(self, agent_tag=None, version=None, **unknown_fields): ''' agent_tag : str @@ -12781,6 +13199,7 @@ def __init__(self, agent_tag=None, version=None, **unknown_fields): class KubernetesVolumeAttachmentParams(Type): _toSchema = {'provider': 'provider', 'read_only': 'read-only'} _toPy = {'provider': 'provider', 'read-only': 'read_only'} + def __init__(self, provider=None, read_only=None, **unknown_fields): ''' provider : str @@ -12805,6 +13224,7 @@ def __init__(self, provider=None, read_only=None, **unknown_fields): class KubernetesVolumeInfo(Type): _toSchema = {'data': 'data', 'info': 'info', 'persistent': 'persistent', 'pool': 'pool', 'size': 'size', 'status': 'status', 'volume_id': 'volume-id'} _toPy = {'data': 'data', 'info': 'info', 'persistent': 'persistent', 'pool': 'pool', 'size': 'size', 'status': 'status', 'volume-id': 'volume_id'} + def __init__(self, data=None, info=None, persistent=None, pool=None, size=None, status=None, volume_id=None, **unknown_fields): ''' data : typing.Mapping[str, typing.Any] @@ -12859,6 +13279,7 @@ def __init__(self, data=None, info=None, persistent=None, pool=None, size=None, class KubernetesVolumeParams(Type): _toSchema = {'attachment': 'attachment', 'attributes': 'attributes', 'provider': 'provider', 'size': 'size', 'storagename': 'storagename', 'tags': 'tags'} _toPy = {'attachment': 'attachment', 'attributes': 'attributes', 'provider': 'provider', 'size': 'size', 'storagename': 'storagename', 'tags': 'tags'} + def __init__(self, attachment=None, attributes=None, provider=None, size=None, storagename=None, tags=None, **unknown_fields): ''' attachment : KubernetesVolumeAttachmentParams @@ -12907,6 +13328,7 @@ def __init__(self, attachment=None, attributes=None, provider=None, size=None, s class LXDProfile(Type): _toSchema = {'config': 'config', 'description': 'description', 'devices': 'devices'} _toPy = {'config': 'config', 'description': 'description', 'devices': 'devices'} + def __init__(self, config=None, description=None, devices=None, **unknown_fields): ''' config : typing.Mapping[str, str] @@ -12937,6 +13359,7 @@ def __init__(self, config=None, description=None, devices=None, **unknown_fields class LatestSecretRevisionChanges(Type): _toSchema = {'changes': 'changes'} _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): ''' changes : typing.Sequence[~SecretRevisionChange] @@ -12955,6 +13378,7 @@ def __init__(self, changes=None, **unknown_fields): class LeaseOperationCommand(Type): _toSchema = {'duration': 'duration', 'holder': 'holder', 'lease': 'lease', 'model_uuid': 'model-uuid', 'namespace': 'namespace', 'new_time': 'new-time', 'old_time': 'old-time', 'operation': 'operation', 'pin_entity': 'pin-entity', 'version': 'version'} _toPy = {'duration': 'duration', 'holder': 'holder', 'lease': 'lease', 'model-uuid': 'model_uuid', 'namespace': 'namespace', 'new-time': 'new_time', 'old-time': 'old_time', 'operation': 'operation', 'pin-entity': 'pin_entity', 'version': 'version'} + def __init__(self, duration=None, holder=None, lease=None, model_uuid=None, namespace=None, new_time=None, old_time=None, operation=None, pin_entity=None, version=None, **unknown_fields): ''' duration : int @@ -13027,6 +13451,7 @@ def __init__(self, duration=None, holder=None, lease=None, model_uuid=None, name class LeaseOperationsV2(Type): _toSchema = {'commands': 'commands'} _toPy = {'commands': 'commands'} + def __init__(self, commands=None, **unknown_fields): ''' commands : typing.Sequence[~LeaseOperationCommand] @@ -13045,6 +13470,7 @@ def __init__(self, commands=None, **unknown_fields): class LifeResult(Type): _toSchema = {'error': 'error', 'life': 'life'} _toPy = {'error': 'error', 'life': 'life'} + def __init__(self, error=None, life=None, **unknown_fields): ''' error : Error @@ -13069,6 +13495,7 @@ def __init__(self, error=None, life=None, **unknown_fields): class LifeResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~LifeResult] @@ -13087,6 +13514,7 @@ def __init__(self, results=None, **unknown_fields): class ListCloudImageMetadataResult(Type): _toSchema = {'result': 'result'} _toPy = {'result': 'result'} + def __init__(self, result=None, **unknown_fields): ''' result : typing.Sequence[~CloudImageMetadata] @@ -13105,6 +13533,7 @@ def __init__(self, result=None, **unknown_fields): class ListCloudInfo(Type): _toSchema = {'clouddetails': 'CloudDetails', 'user_access': 'user-access'} _toPy = {'CloudDetails': 'clouddetails', 'user-access': 'user_access'} + def __init__(self, clouddetails=None, user_access=None, **unknown_fields): ''' clouddetails : CloudDetails @@ -13129,6 +13558,7 @@ def __init__(self, clouddetails=None, user_access=None, **unknown_fields): class ListCloudInfoResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -13153,6 +13583,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class ListCloudInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ListCloudInfoResult] @@ -13171,6 +13602,7 @@ def __init__(self, results=None, **unknown_fields): class ListCloudsRequest(Type): _toSchema = {'all_': 'all', 'user_tag': 'user-tag'} _toPy = {'all': 'all_', 'user-tag': 'user_tag'} + def __init__(self, all_=None, user_tag=None, **unknown_fields): ''' all_ : bool @@ -13195,6 +13627,7 @@ def __init__(self, all_=None, user_tag=None, **unknown_fields): class ListFirewallRulesResults(Type): _toSchema = {'rules': 'Rules'} _toPy = {'Rules': 'rules'} + def __init__(self, rules=None, **unknown_fields): ''' rules : typing.Sequence[~FirewallRule] @@ -13213,6 +13646,7 @@ def __init__(self, rules=None, **unknown_fields): class ListResourcesArgs(Type): _toSchema = {'entities': 'entities'} _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): ''' entities : typing.Sequence[~Entity] @@ -13231,6 +13665,7 @@ def __init__(self, entities=None, **unknown_fields): class ListSSHKeys(Type): _toSchema = {'entities': 'entities', 'mode': 'mode'} _toPy = {'entities': 'entities', 'mode': 'mode'} + def __init__(self, entities=None, mode=None, **unknown_fields): ''' entities : Entities @@ -13255,6 +13690,7 @@ def __init__(self, entities=None, mode=None, **unknown_fields): class ListSecretBackendsArgs(Type): _toSchema = {'names': 'names', 'reveal': 'reveal'} _toPy = {'names': 'names', 'reveal': 'reveal'} + def __init__(self, names=None, reveal=None, **unknown_fields): ''' names : typing.Sequence[str] @@ -13279,6 +13715,7 @@ def __init__(self, names=None, reveal=None, **unknown_fields): class ListSecretBackendsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~SecretBackendResult] @@ -13297,6 +13734,7 @@ def __init__(self, results=None, **unknown_fields): class ListSecretResult(Type): _toSchema = {'access': 'access', 'create_time': 'create-time', 'description': 'description', 'label': 'label', 'latest_expire_time': 'latest-expire-time', 'latest_revision': 'latest-revision', 'next_rotate_time': 'next-rotate-time', 'owner_tag': 'owner-tag', 'revisions': 'revisions', 'rotate_policy': 'rotate-policy', 'update_time': 'update-time', 'uri': 'uri', 'value': 'value', 'version': 'version'} _toPy = {'access': 'access', 'create-time': 'create_time', 'description': 'description', 'label': 'label', 'latest-expire-time': 'latest_expire_time', 'latest-revision': 'latest_revision', 'next-rotate-time': 'next_rotate_time', 'owner-tag': 'owner_tag', 'revisions': 'revisions', 'rotate-policy': 'rotate_policy', 'update-time': 'update_time', 'uri': 'uri', 'value': 'value', 'version': 'version'} + def __init__(self, access=None, create_time=None, description=None, label=None, latest_expire_time=None, latest_revision=None, next_rotate_time=None, owner_tag=None, revisions=None, rotate_policy=None, update_time=None, uri=None, value=None, version=None, **unknown_fields): ''' access : typing.Sequence[~AccessInfo] @@ -13393,6 +13831,7 @@ def __init__(self, access=None, create_time=None, description=None, label=None, class ListSecretResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ListSecretResult] @@ -13411,6 +13850,7 @@ def __init__(self, results=None, **unknown_fields): class ListSecretsArgs(Type): _toSchema = {'filter_': 'filter', 'show_secrets': 'show-secrets'} _toPy = {'filter': 'filter_', 'show-secrets': 'show_secrets'} + def __init__(self, filter_=None, show_secrets=None, **unknown_fields): ''' filter_ : SecretsFilter @@ -13435,6 +13875,7 @@ def __init__(self, filter_=None, show_secrets=None, **unknown_fields): class ListSpacesResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~Space] @@ -13453,6 +13894,7 @@ def __init__(self, results=None, **unknown_fields): class ListSubnetsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~Subnet] @@ -13471,6 +13913,7 @@ def __init__(self, results=None, **unknown_fields): class ListUnitResourcesArgs(Type): _toSchema = {'resource_names': 'resource-names'} _toPy = {'resource-names': 'resource_names'} + def __init__(self, resource_names=None, **unknown_fields): ''' resource_names : typing.Sequence[str] @@ -13489,6 +13932,7 @@ def __init__(self, resource_names=None, **unknown_fields): class LogForwardingGetLastSentParams(Type): _toSchema = {'ids': 'ids'} _toPy = {'ids': 'ids'} + def __init__(self, ids=None, **unknown_fields): ''' ids : typing.Sequence[~LogForwardingID] @@ -13507,6 +13951,7 @@ def __init__(self, ids=None, **unknown_fields): class LogForwardingGetLastSentResult(Type): _toSchema = {'err': 'err', 'record_id': 'record-id', 'record_timestamp': 'record-timestamp'} _toPy = {'err': 'err', 'record-id': 'record_id', 'record-timestamp': 'record_timestamp'} + def __init__(self, err=None, record_id=None, record_timestamp=None, **unknown_fields): ''' err : Error @@ -13537,6 +13982,7 @@ def __init__(self, err=None, record_id=None, record_timestamp=None, **unknown_fi class LogForwardingGetLastSentResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~LogForwardingGetLastSentResult] @@ -13555,6 +14001,7 @@ def __init__(self, results=None, **unknown_fields): class LogForwardingID(Type): _toSchema = {'model': 'model', 'sink': 'sink'} _toPy = {'model': 'model', 'sink': 'sink'} + def __init__(self, model=None, sink=None, **unknown_fields): ''' model : str @@ -13579,6 +14026,7 @@ def __init__(self, model=None, sink=None, **unknown_fields): class LogForwardingSetLastSentParam(Type): _toSchema = {'logforwardingid': 'LogForwardingID', 'model': 'model', 'record_id': 'record-id', 'record_timestamp': 'record-timestamp', 'sink': 'sink'} _toPy = {'LogForwardingID': 'logforwardingid', 'model': 'model', 'record-id': 'record_id', 'record-timestamp': 'record_timestamp', 'sink': 'sink'} + def __init__(self, logforwardingid=None, model=None, record_id=None, record_timestamp=None, sink=None, **unknown_fields): ''' logforwardingid : LogForwardingID @@ -13621,6 +14069,7 @@ def __init__(self, logforwardingid=None, model=None, record_id=None, record_time class LogForwardingSetLastSentParams(Type): _toSchema = {'params': 'params'} _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): ''' params : typing.Sequence[~LogForwardingSetLastSentParam] @@ -13639,6 +14088,7 @@ def __init__(self, params=None, **unknown_fields): class LoginRequest(Type): _toSchema = {'auth_tag': 'auth-tag', 'bakery_version': 'bakery-version', 'cli_args': 'cli-args', 'client_version': 'client-version', 'credentials': 'credentials', 'macaroons': 'macaroons', 'nonce': 'nonce', 'token': 'token', 'user_data': 'user-data'} _toPy = {'auth-tag': 'auth_tag', 'bakery-version': 'bakery_version', 'cli-args': 'cli_args', 'client-version': 'client_version', 'credentials': 'credentials', 'macaroons': 'macaroons', 'nonce': 'nonce', 'token': 'token', 'user-data': 'user_data'} + def __init__(self, auth_tag=None, bakery_version=None, cli_args=None, client_version=None, credentials=None, macaroons=None, nonce=None, token=None, user_data=None, **unknown_fields): ''' auth_tag : str @@ -13705,6 +14155,7 @@ def __init__(self, auth_tag=None, bakery_version=None, cli_args=None, client_ver class LoginResult(Type): _toSchema = {'bakery_discharge_required': 'bakery-discharge-required', 'controller_tag': 'controller-tag', 'discharge_required': 'discharge-required', 'discharge_required_error': 'discharge-required-error', 'facades': 'facades', 'model_tag': 'model-tag', 'public_dns_name': 'public-dns-name', 'server_version': 'server-version', 'servers': 'servers', 'user_info': 'user-info'} _toPy = {'bakery-discharge-required': 'bakery_discharge_required', 'controller-tag': 'controller_tag', 'discharge-required': 'discharge_required', 'discharge-required-error': 'discharge_required_error', 'facades': 'facades', 'model-tag': 'model_tag', 'public-dns-name': 'public_dns_name', 'server-version': 'server_version', 'servers': 'servers', 'user-info': 'user_info'} + def __init__(self, bakery_discharge_required=None, controller_tag=None, discharge_required=None, discharge_required_error=None, facades=None, model_tag=None, public_dns_name=None, server_version=None, servers=None, user_info=None, **unknown_fields): ''' bakery_discharge_required : Macaroon @@ -13777,6 +14228,7 @@ def __init__(self, bakery_discharge_required=None, controller_tag=None, discharg class LookUpPayloadArg(Type): _toSchema = {'id_': 'id', 'name': 'name'} _toPy = {'id': 'id_', 'name': 'name'} + def __init__(self, id_=None, name=None, **unknown_fields): ''' id_ : str @@ -13801,6 +14253,7 @@ def __init__(self, id_=None, name=None, **unknown_fields): class LookUpPayloadArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~LookUpPayloadArg] @@ -13819,6 +14272,7 @@ def __init__(self, args=None, **unknown_fields): class Macaroon(Type): _toSchema = {} _toPy = {} + def __init__(self, **unknown_fields): ''' @@ -13830,6 +14284,7 @@ def __init__(self, **unknown_fields): class MacaroonResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -13854,6 +14309,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class MacaroonResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~MacaroonResult] @@ -13872,6 +14328,7 @@ def __init__(self, results=None, **unknown_fields): class MachineAddresses(Type): _toSchema = {'addresses': 'addresses', 'tag': 'tag'} _toPy = {'addresses': 'addresses', 'tag': 'tag'} + def __init__(self, addresses=None, tag=None, **unknown_fields): ''' addresses : typing.Sequence[~Address] @@ -13896,6 +14353,7 @@ def __init__(self, addresses=None, tag=None, **unknown_fields): class MachineAddressesResult(Type): _toSchema = {'addresses': 'addresses', 'error': 'error'} _toPy = {'addresses': 'addresses', 'error': 'error'} + def __init__(self, addresses=None, error=None, **unknown_fields): ''' addresses : typing.Sequence[~Address] @@ -13920,6 +14378,7 @@ def __init__(self, addresses=None, error=None, **unknown_fields): class MachineAddressesResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~MachineAddressesResult] @@ -13938,6 +14397,7 @@ def __init__(self, results=None, **unknown_fields): class MachineBlockDevices(Type): _toSchema = {'block_devices': 'block-devices', 'machine': 'machine'} _toPy = {'block-devices': 'block_devices', 'machine': 'machine'} + def __init__(self, block_devices=None, machine=None, **unknown_fields): ''' block_devices : typing.Sequence[~BlockDevice] @@ -13962,6 +14422,7 @@ def __init__(self, block_devices=None, machine=None, **unknown_fields): class MachineContainerResult(Type): _toSchema = {'container_types': 'container-types', 'determined': 'determined', 'error': 'error'} _toPy = {'container-types': 'container_types', 'determined': 'determined', 'error': 'error'} + def __init__(self, container_types=None, determined=None, error=None, **unknown_fields): ''' container_types : typing.Sequence[str] @@ -13992,6 +14453,7 @@ def __init__(self, container_types=None, determined=None, error=None, **unknown_ class MachineContainerResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~MachineContainerResult] @@ -14010,6 +14472,7 @@ def __init__(self, results=None, **unknown_fields): class MachineContainers(Type): _toSchema = {'container_types': 'container-types', 'machine_tag': 'machine-tag'} _toPy = {'container-types': 'container_types', 'machine-tag': 'machine_tag'} + def __init__(self, container_types=None, machine_tag=None, **unknown_fields): ''' container_types : typing.Sequence[str] @@ -14034,6 +14497,7 @@ def __init__(self, container_types=None, machine_tag=None, **unknown_fields): class MachineContainersParams(Type): _toSchema = {'params': 'params'} _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): ''' params : typing.Sequence[~MachineContainers] @@ -14052,6 +14516,7 @@ def __init__(self, params=None, **unknown_fields): class MachineHardware(Type): _toSchema = {'arch': 'arch', 'availability_zone': 'availability-zone', 'cores': 'cores', 'cpu_power': 'cpu-power', 'mem': 'mem', 'root_disk': 'root-disk', 'tags': 'tags', 'virt_type': 'virt-type'} _toPy = {'arch': 'arch', 'availability-zone': 'availability_zone', 'cores': 'cores', 'cpu-power': 'cpu_power', 'mem': 'mem', 'root-disk': 'root_disk', 'tags': 'tags', 'virt-type': 'virt_type'} + def __init__(self, arch=None, availability_zone=None, cores=None, cpu_power=None, mem=None, root_disk=None, tags=None, virt_type=None, **unknown_fields): ''' arch : str @@ -14112,6 +14577,7 @@ def __init__(self, arch=None, availability_zone=None, cores=None, cpu_power=None class MachineNetworkConfigResult(Type): _toSchema = {'error': 'error', 'info': 'info'} _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): ''' error : Error @@ -14136,6 +14602,7 @@ def __init__(self, error=None, info=None, **unknown_fields): class MachineNetworkConfigResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~MachineNetworkConfigResult] @@ -14154,6 +14621,7 @@ def __init__(self, results=None, **unknown_fields): class MachineStatus(Type): _toSchema = {'agent_status': 'agent-status', 'base': 'base', 'constraints': 'constraints', 'containers': 'containers', 'display_name': 'display-name', 'dns_name': 'dns-name', 'hardware': 'hardware', 'has_vote': 'has-vote', 'hostname': 'hostname', 'id_': 'id', 'instance_id': 'instance-id', 'instance_status': 'instance-status', 'ip_addresses': 'ip-addresses', 'jobs': 'jobs', 'lxd_profiles': 'lxd-profiles', 'modification_status': 'modification-status', 'network_interfaces': 'network-interfaces', 'primary_controller_machine': 'primary-controller-machine', 'wants_vote': 'wants-vote'} _toPy = {'agent-status': 'agent_status', 'base': 'base', 'constraints': 'constraints', 'containers': 'containers', 'display-name': 'display_name', 'dns-name': 'dns_name', 'hardware': 'hardware', 'has-vote': 'has_vote', 'hostname': 'hostname', 'id': 'id_', 'instance-id': 'instance_id', 'instance-status': 'instance_status', 'ip-addresses': 'ip_addresses', 'jobs': 'jobs', 'lxd-profiles': 'lxd_profiles', 'modification-status': 'modification_status', 'network-interfaces': 'network_interfaces', 'primary-controller-machine': 'primary_controller_machine', 'wants-vote': 'wants_vote'} + def __init__(self, agent_status=None, base=None, constraints=None, containers=None, display_name=None, dns_name=None, hardware=None, has_vote=None, hostname=None, id_=None, instance_id=None, instance_status=None, ip_addresses=None, jobs=None, lxd_profiles=None, modification_status=None, network_interfaces=None, primary_controller_machine=None, wants_vote=None, **unknown_fields): ''' agent_status : DetailedStatus @@ -14280,6 +14748,7 @@ def __init__(self, agent_status=None, base=None, constraints=None, containers=No class MachineStorageId(Type): _toSchema = {'attachment_tag': 'attachment-tag', 'machine_tag': 'machine-tag'} _toPy = {'attachment-tag': 'attachment_tag', 'machine-tag': 'machine_tag'} + def __init__(self, attachment_tag=None, machine_tag=None, **unknown_fields): ''' attachment_tag : str @@ -14304,6 +14773,7 @@ def __init__(self, attachment_tag=None, machine_tag=None, **unknown_fields): class MachineStorageIds(Type): _toSchema = {'ids': 'ids'} _toPy = {'ids': 'ids'} + def __init__(self, ids=None, **unknown_fields): ''' ids : typing.Sequence[~MachineStorageId] @@ -14322,6 +14792,7 @@ def __init__(self, ids=None, **unknown_fields): class MachineStorageIdsWatchResult(Type): _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' changes : typing.Sequence[~MachineStorageId] @@ -14352,6 +14823,7 @@ def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): class MachineStorageIdsWatchResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~MachineStorageIdsWatchResult] @@ -14370,6 +14842,7 @@ def __init__(self, results=None, **unknown_fields): class MapResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -14394,6 +14867,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class MapResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~MapResult] @@ -14412,6 +14886,7 @@ def __init__(self, results=None, **unknown_fields): class MasterMigrationStatus(Type): _toSchema = {'migration_id': 'migration-id', 'phase': 'phase', 'phase_changed_time': 'phase-changed-time', 'spec': 'spec'} _toPy = {'migration-id': 'migration_id', 'phase': 'phase', 'phase-changed-time': 'phase_changed_time', 'spec': 'spec'} + def __init__(self, migration_id=None, phase=None, phase_changed_time=None, spec=None, **unknown_fields): ''' migration_id : str @@ -14448,6 +14923,7 @@ def __init__(self, migration_id=None, phase=None, phase_changed_time=None, spec= class MergeLeadershipSettingsBulkParams(Type): _toSchema = {'params': 'params'} _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): ''' params : typing.Sequence[~MergeLeadershipSettingsParam] @@ -14466,6 +14942,7 @@ def __init__(self, params=None, **unknown_fields): class MergeLeadershipSettingsParam(Type): _toSchema = {'application_tag': 'application-tag', 'settings': 'settings', 'unit_tag': 'unit-tag'} _toPy = {'application-tag': 'application_tag', 'settings': 'settings', 'unit-tag': 'unit_tag'} + def __init__(self, application_tag=None, settings=None, unit_tag=None, **unknown_fields): ''' application_tag : str @@ -14496,6 +14973,7 @@ def __init__(self, application_tag=None, settings=None, unit_tag=None, **unknown class MetadataImageIds(Type): _toSchema = {'image_ids': 'image-ids'} _toPy = {'image-ids': 'image_ids'} + def __init__(self, image_ids=None, **unknown_fields): ''' image_ids : typing.Sequence[str] @@ -14514,6 +14992,7 @@ def __init__(self, image_ids=None, **unknown_fields): class MetadataSaveParams(Type): _toSchema = {'metadata': 'metadata'} _toPy = {'metadata': 'metadata'} + def __init__(self, metadata=None, **unknown_fields): ''' metadata : typing.Sequence[~CloudImageMetadataList] @@ -14532,6 +15011,7 @@ def __init__(self, metadata=None, **unknown_fields): class MeterStatus(Type): _toSchema = {'color': 'color', 'message': 'message'} _toPy = {'color': 'color', 'message': 'message'} + def __init__(self, color=None, message=None, **unknown_fields): ''' color : str @@ -14556,6 +15036,7 @@ def __init__(self, color=None, message=None, **unknown_fields): class MeterStatusParam(Type): _toSchema = {'code': 'code', 'info': 'info', 'tag': 'tag'} _toPy = {'code': 'code', 'info': 'info', 'tag': 'tag'} + def __init__(self, code=None, info=None, tag=None, **unknown_fields): ''' code : str @@ -14586,6 +15067,7 @@ def __init__(self, code=None, info=None, tag=None, **unknown_fields): class MeterStatusParams(Type): _toSchema = {'statues': 'statues'} _toPy = {'statues': 'statues'} + def __init__(self, statues=None, **unknown_fields): ''' statues : typing.Sequence[~MeterStatusParam] @@ -14604,6 +15086,7 @@ def __init__(self, statues=None, **unknown_fields): class MeterStatusResult(Type): _toSchema = {'code': 'code', 'error': 'error', 'info': 'info'} _toPy = {'code': 'code', 'error': 'error', 'info': 'info'} + def __init__(self, code=None, error=None, info=None, **unknown_fields): ''' code : str @@ -14634,6 +15117,7 @@ def __init__(self, code=None, error=None, info=None, **unknown_fields): class MeterStatusResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~MeterStatusResult] @@ -14652,6 +15136,7 @@ def __init__(self, results=None, **unknown_fields): class Metric(Type): _toSchema = {'key': 'key', 'labels': 'labels', 'time': 'time', 'value': 'value'} _toPy = {'key': 'key', 'labels': 'labels', 'time': 'time', 'value': 'value'} + def __init__(self, key=None, labels=None, time=None, value=None, **unknown_fields): ''' key : str @@ -14688,6 +15173,7 @@ def __init__(self, key=None, labels=None, time=None, value=None, **unknown_field class MetricBatch(Type): _toSchema = {'charm_url': 'charm-url', 'created': 'created', 'metrics': 'metrics', 'uuid': 'uuid'} _toPy = {'charm-url': 'charm_url', 'created': 'created', 'metrics': 'metrics', 'uuid': 'uuid'} + def __init__(self, charm_url=None, created=None, metrics=None, uuid=None, **unknown_fields): ''' charm_url : str @@ -14724,6 +15210,7 @@ def __init__(self, charm_url=None, created=None, metrics=None, uuid=None, **unkn class MetricBatchParam(Type): _toSchema = {'batch': 'batch', 'tag': 'tag'} _toPy = {'batch': 'batch', 'tag': 'tag'} + def __init__(self, batch=None, tag=None, **unknown_fields): ''' batch : MetricBatch @@ -14748,6 +15235,7 @@ def __init__(self, batch=None, tag=None, **unknown_fields): class MetricBatchParams(Type): _toSchema = {'batches': 'batches'} _toPy = {'batches': 'batches'} + def __init__(self, batches=None, **unknown_fields): ''' batches : typing.Sequence[~MetricBatchParam] @@ -14766,6 +15254,7 @@ def __init__(self, batches=None, **unknown_fields): class MetricResult(Type): _toSchema = {'key': 'key', 'labels': 'labels', 'time': 'time', 'unit': 'unit', 'value': 'value'} _toPy = {'key': 'key', 'labels': 'labels', 'time': 'time', 'unit': 'unit', 'value': 'value'} + def __init__(self, key=None, labels=None, time=None, unit=None, value=None, **unknown_fields): ''' key : str @@ -14808,6 +15297,7 @@ def __init__(self, key=None, labels=None, time=None, unit=None, value=None, **un class MetricResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~EntityMetrics] @@ -14826,6 +15316,7 @@ def __init__(self, results=None, **unknown_fields): class MigrationModelInfo(Type): _toSchema = {'agent_version': 'agent-version', 'controller_agent_version': 'controller-agent-version', 'facade_versions': 'facade-versions', 'name': 'name', 'owner_tag': 'owner-tag', 'uuid': 'uuid'} _toPy = {'agent-version': 'agent_version', 'controller-agent-version': 'controller_agent_version', 'facade-versions': 'facade_versions', 'name': 'name', 'owner-tag': 'owner_tag', 'uuid': 'uuid'} + def __init__(self, agent_version=None, controller_agent_version=None, facade_versions=None, name=None, owner_tag=None, uuid=None, **unknown_fields): ''' agent_version : Number @@ -14874,6 +15365,7 @@ def __init__(self, agent_version=None, controller_agent_version=None, facade_ver class MigrationSourceInfo(Type): _toSchema = {'addrs': 'addrs', 'ca_cert': 'ca-cert', 'controller_alias': 'controller-alias', 'controller_tag': 'controller-tag', 'local_related_models': 'local-related-models'} _toPy = {'addrs': 'addrs', 'ca-cert': 'ca_cert', 'controller-alias': 'controller_alias', 'controller-tag': 'controller_tag', 'local-related-models': 'local_related_models'} + def __init__(self, addrs=None, ca_cert=None, controller_alias=None, controller_tag=None, local_related_models=None, **unknown_fields): ''' addrs : typing.Sequence[str] @@ -14916,6 +15408,7 @@ def __init__(self, addrs=None, ca_cert=None, controller_alias=None, controller_t class MigrationSpec(Type): _toSchema = {'model_tag': 'model-tag', 'target_info': 'target-info'} _toPy = {'model-tag': 'model_tag', 'target-info': 'target_info'} + def __init__(self, model_tag=None, target_info=None, **unknown_fields): ''' model_tag : str @@ -14940,6 +15433,7 @@ def __init__(self, model_tag=None, target_info=None, **unknown_fields): class MigrationStatus(Type): _toSchema = {'attempt': 'attempt', 'migration_id': 'migration-id', 'phase': 'phase', 'source_api_addrs': 'source-api-addrs', 'source_ca_cert': 'source-ca-cert', 'target_api_addrs': 'target-api-addrs', 'target_ca_cert': 'target-ca-cert'} _toPy = {'attempt': 'attempt', 'migration-id': 'migration_id', 'phase': 'phase', 'source-api-addrs': 'source_api_addrs', 'source-ca-cert': 'source_ca_cert', 'target-api-addrs': 'target_api_addrs', 'target-ca-cert': 'target_ca_cert'} + def __init__(self, attempt=None, migration_id=None, phase=None, source_api_addrs=None, source_ca_cert=None, target_api_addrs=None, target_ca_cert=None, **unknown_fields): ''' attempt : int @@ -14994,6 +15488,7 @@ def __init__(self, attempt=None, migration_id=None, phase=None, source_api_addrs class MigrationTargetInfo(Type): _toSchema = {'addrs': 'addrs', 'auth_tag': 'auth-tag', 'ca_cert': 'ca-cert', 'controller_alias': 'controller-alias', 'controller_tag': 'controller-tag', 'macaroons': 'macaroons', 'password': 'password'} _toPy = {'addrs': 'addrs', 'auth-tag': 'auth_tag', 'ca-cert': 'ca_cert', 'controller-alias': 'controller_alias', 'controller-tag': 'controller_tag', 'macaroons': 'macaroons', 'password': 'password'} + def __init__(self, addrs=None, auth_tag=None, ca_cert=None, controller_alias=None, controller_tag=None, macaroons=None, password=None, **unknown_fields): ''' addrs : typing.Sequence[str] @@ -15048,6 +15543,7 @@ def __init__(self, addrs=None, auth_tag=None, ca_cert=None, controller_alias=Non class MinionReport(Type): _toSchema = {'migration_id': 'migration-id', 'phase': 'phase', 'success': 'success'} _toPy = {'migration-id': 'migration_id', 'phase': 'phase', 'success': 'success'} + def __init__(self, migration_id=None, phase=None, success=None, **unknown_fields): ''' migration_id : str @@ -15078,6 +15574,7 @@ def __init__(self, migration_id=None, phase=None, success=None, **unknown_fields class MinionReports(Type): _toSchema = {'failed': 'failed', 'migration_id': 'migration-id', 'phase': 'phase', 'success_count': 'success-count', 'unknown_count': 'unknown-count', 'unknown_sample': 'unknown-sample'} _toPy = {'failed': 'failed', 'migration-id': 'migration_id', 'phase': 'phase', 'success-count': 'success_count', 'unknown-count': 'unknown_count', 'unknown-sample': 'unknown_sample'} + def __init__(self, failed=None, migration_id=None, phase=None, success_count=None, unknown_count=None, unknown_sample=None, **unknown_fields): ''' failed : typing.Sequence[str] @@ -15126,6 +15623,7 @@ def __init__(self, failed=None, migration_id=None, phase=None, success_count=Non class Model(Type): _toSchema = {'name': 'name', 'owner_tag': 'owner-tag', 'type_': 'type', 'uuid': 'uuid'} _toPy = {'name': 'name', 'owner-tag': 'owner_tag', 'type': 'type_', 'uuid': 'uuid'} + def __init__(self, name=None, owner_tag=None, type_=None, uuid=None, **unknown_fields): ''' name : str @@ -15162,6 +15660,7 @@ def __init__(self, name=None, owner_tag=None, type_=None, uuid=None, **unknown_f class ModelAbstract(Type): _toSchema = {'admins': 'admins', 'annotations': 'annotations', 'cloud': 'cloud', 'controller': 'controller', 'credential': 'credential', 'messages': 'messages', 'name': 'name', 'region': 'region', 'removed': 'removed', 'size': 'size', 'status': 'status', 'uuid': 'uuid'} _toPy = {'admins': 'admins', 'annotations': 'annotations', 'cloud': 'cloud', 'controller': 'controller', 'credential': 'credential', 'messages': 'messages', 'name': 'name', 'region': 'region', 'removed': 'removed', 'size': 'size', 'status': 'status', 'uuid': 'uuid'} + def __init__(self, admins=None, annotations=None, cloud=None, controller=None, credential=None, messages=None, name=None, region=None, removed=None, size=None, status=None, uuid=None, **unknown_fields): ''' admins : typing.Sequence[str] @@ -15246,6 +15745,7 @@ def __init__(self, admins=None, annotations=None, cloud=None, controller=None, c class ModelAccess(Type): _toSchema = {'access': 'access', 'model': 'model'} _toPy = {'access': 'access', 'model': 'model'} + def __init__(self, access=None, model=None, **unknown_fields): ''' access : str @@ -15270,6 +15770,7 @@ def __init__(self, access=None, model=None, **unknown_fields): class ModelApplicationInfo(Type): _toSchema = {'name': 'name'} _toPy = {'name': 'name'} + def __init__(self, name=None, **unknown_fields): ''' name : str @@ -15288,6 +15789,7 @@ def __init__(self, name=None, **unknown_fields): class ModelArgs(Type): _toSchema = {'model_tag': 'model-tag'} _toPy = {'model-tag': 'model_tag'} + def __init__(self, model_tag=None, **unknown_fields): ''' model_tag : str @@ -15306,6 +15808,7 @@ def __init__(self, model_tag=None, **unknown_fields): class ModelBlockInfo(Type): _toSchema = {'blocks': 'blocks', 'model_uuid': 'model-uuid', 'name': 'name', 'owner_tag': 'owner-tag'} _toPy = {'blocks': 'blocks', 'model-uuid': 'model_uuid', 'name': 'name', 'owner-tag': 'owner_tag'} + def __init__(self, blocks=None, model_uuid=None, name=None, owner_tag=None, **unknown_fields): ''' blocks : typing.Sequence[str] @@ -15342,6 +15845,7 @@ def __init__(self, blocks=None, model_uuid=None, name=None, owner_tag=None, **un class ModelBlockInfoList(Type): _toSchema = {'models': 'models'} _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): ''' models : typing.Sequence[~ModelBlockInfo] @@ -15360,6 +15864,7 @@ def __init__(self, models=None, **unknown_fields): class ModelConfigResult(Type): _toSchema = {'config': 'config'} _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): ''' config : typing.Mapping[str, typing.Any] @@ -15378,6 +15883,7 @@ def __init__(self, config=None, **unknown_fields): class ModelConfigResults(Type): _toSchema = {'config': 'config'} _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): ''' config : typing.Mapping[str, ~ConfigValue] @@ -15396,6 +15902,7 @@ def __init__(self, config=None, **unknown_fields): class ModelCreateArgs(Type): _toSchema = {'cloud_tag': 'cloud-tag', 'config': 'config', 'credential': 'credential', 'name': 'name', 'owner_tag': 'owner-tag', 'region': 'region'} _toPy = {'cloud-tag': 'cloud_tag', 'config': 'config', 'credential': 'credential', 'name': 'name', 'owner-tag': 'owner_tag', 'region': 'region'} + def __init__(self, cloud_tag=None, config=None, credential=None, name=None, owner_tag=None, region=None, **unknown_fields): ''' cloud_tag : str @@ -15444,6 +15951,7 @@ def __init__(self, cloud_tag=None, config=None, credential=None, name=None, owne class ModelCredential(Type): _toSchema = {'credential_tag': 'credential-tag', 'exists': 'exists', 'model_tag': 'model-tag', 'valid': 'valid'} _toPy = {'credential-tag': 'credential_tag', 'exists': 'exists', 'model-tag': 'model_tag', 'valid': 'valid'} + def __init__(self, credential_tag=None, exists=None, model_tag=None, valid=None, **unknown_fields): ''' credential_tag : str @@ -15480,6 +15988,7 @@ def __init__(self, credential_tag=None, exists=None, model_tag=None, valid=None, class ModelDefaultValues(Type): _toSchema = {'cloud_region': 'cloud-region', 'cloud_tag': 'cloud-tag', 'config': 'config'} _toPy = {'cloud-region': 'cloud_region', 'cloud-tag': 'cloud_tag', 'config': 'config'} + def __init__(self, cloud_region=None, cloud_tag=None, config=None, **unknown_fields): ''' cloud_region : str @@ -15510,6 +16019,7 @@ def __init__(self, cloud_region=None, cloud_tag=None, config=None, **unknown_fie class ModelDefaults(Type): _toSchema = {'controller': 'controller', 'default': 'default', 'regions': 'regions'} _toPy = {'controller': 'controller', 'default': 'default', 'regions': 'regions'} + def __init__(self, controller=None, default=None, regions=None, **unknown_fields): ''' controller : Any @@ -15534,6 +16044,7 @@ def __init__(self, controller=None, default=None, regions=None, **unknown_fields class ModelDefaultsResult(Type): _toSchema = {'config': 'config', 'error': 'error'} _toPy = {'config': 'config', 'error': 'error'} + def __init__(self, config=None, error=None, **unknown_fields): ''' config : typing.Mapping[str, ~ModelDefaults] @@ -15558,6 +16069,7 @@ def __init__(self, config=None, error=None, **unknown_fields): class ModelDefaultsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ModelDefaultsResult] @@ -15576,6 +16088,7 @@ def __init__(self, results=None, **unknown_fields): class ModelEntityCount(Type): _toSchema = {'count': 'count', 'entity': 'entity'} _toPy = {'count': 'count', 'entity': 'entity'} + def __init__(self, count=None, entity=None, **unknown_fields): ''' count : int @@ -15600,6 +16113,7 @@ def __init__(self, count=None, entity=None, **unknown_fields): class ModelFilesystemInfo(Type): _toSchema = {'detachable': 'detachable', 'id_': 'id', 'message': 'message', 'provider_id': 'provider-id', 'status': 'status'} _toPy = {'detachable': 'detachable', 'id': 'id_', 'message': 'message', 'provider-id': 'provider_id', 'status': 'status'} + def __init__(self, detachable=None, id_=None, message=None, provider_id=None, status=None, **unknown_fields): ''' detachable : bool @@ -15642,6 +16156,7 @@ def __init__(self, detachable=None, id_=None, message=None, provider_id=None, st class ModelInfo(Type): _toSchema = {'agent_version': 'agent-version', 'cloud_credential_tag': 'cloud-credential-tag', 'cloud_credential_validity': 'cloud-credential-validity', 'cloud_region': 'cloud-region', 'cloud_tag': 'cloud-tag', 'controller_uuid': 'controller-uuid', 'default_base': 'default-base', 'default_series': 'default-series', 'is_controller': 'is-controller', 'life': 'life', 'machines': 'machines', 'migration': 'migration', 'name': 'name', 'owner_tag': 'owner-tag', 'provider_type': 'provider-type', 'secret_backends': 'secret-backends', 'sla': 'sla', 'status': 'status', 'supported_features': 'supported-features', 'type_': 'type', 'users': 'users', 'uuid': 'uuid'} _toPy = {'agent-version': 'agent_version', 'cloud-credential-tag': 'cloud_credential_tag', 'cloud-credential-validity': 'cloud_credential_validity', 'cloud-region': 'cloud_region', 'cloud-tag': 'cloud_tag', 'controller-uuid': 'controller_uuid', 'default-base': 'default_base', 'default-series': 'default_series', 'is-controller': 'is_controller', 'life': 'life', 'machines': 'machines', 'migration': 'migration', 'name': 'name', 'owner-tag': 'owner_tag', 'provider-type': 'provider_type', 'secret-backends': 'secret_backends', 'sla': 'sla', 'status': 'status', 'supported-features': 'supported_features', 'type': 'type_', 'users': 'users', 'uuid': 'uuid'} + def __init__(self, agent_version=None, cloud_credential_tag=None, cloud_credential_validity=None, cloud_region=None, cloud_tag=None, controller_uuid=None, default_base=None, default_series=None, is_controller=None, life=None, machines=None, migration=None, name=None, owner_tag=None, provider_type=None, secret_backends=None, sla=None, status=None, supported_features=None, type_=None, users=None, uuid=None, **unknown_fields): ''' agent_version : Number @@ -15786,6 +16301,7 @@ def __init__(self, agent_version=None, cloud_credential_tag=None, cloud_credenti class ModelInfoResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -15810,6 +16326,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class ModelInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ModelInfoResult] @@ -15828,6 +16345,7 @@ def __init__(self, results=None, **unknown_fields): class ModelInstanceTypesConstraint(Type): _toSchema = {'value': 'value'} _toPy = {'value': 'value'} + def __init__(self, value=None, **unknown_fields): ''' value : Value @@ -15846,6 +16364,7 @@ def __init__(self, value=None, **unknown_fields): class ModelInstanceTypesConstraints(Type): _toSchema = {'constraints': 'constraints'} _toPy = {'constraints': 'constraints'} + def __init__(self, constraints=None, **unknown_fields): ''' constraints : typing.Sequence[~ModelInstanceTypesConstraint] @@ -15864,6 +16383,7 @@ def __init__(self, constraints=None, **unknown_fields): class ModelMachineInfo(Type): _toSchema = {'display_name': 'display-name', 'ha_primary': 'ha-primary', 'hardware': 'hardware', 'has_vote': 'has-vote', 'id_': 'id', 'instance_id': 'instance-id', 'message': 'message', 'status': 'status', 'wants_vote': 'wants-vote'} _toPy = {'display-name': 'display_name', 'ha-primary': 'ha_primary', 'hardware': 'hardware', 'has-vote': 'has_vote', 'id': 'id_', 'instance-id': 'instance_id', 'message': 'message', 'status': 'status', 'wants-vote': 'wants_vote'} + def __init__(self, display_name=None, ha_primary=None, hardware=None, has_vote=None, id_=None, instance_id=None, message=None, status=None, wants_vote=None, **unknown_fields): ''' display_name : str @@ -15930,6 +16450,7 @@ def __init__(self, display_name=None, ha_primary=None, hardware=None, has_vote=N class ModelMigrationStatus(Type): _toSchema = {'end': 'end', 'start': 'start', 'status': 'status'} _toPy = {'end': 'end', 'start': 'start', 'status': 'status'} + def __init__(self, end=None, start=None, status=None, **unknown_fields): ''' end : str @@ -15960,6 +16481,7 @@ def __init__(self, end=None, start=None, status=None, **unknown_fields): class ModelOperatorInfo(Type): _toSchema = {'api_addresses': 'api-addresses', 'image_details': 'image-details', 'version': 'version'} _toPy = {'api-addresses': 'api_addresses', 'image-details': 'image_details', 'version': 'version'} + def __init__(self, api_addresses=None, image_details=None, version=None, **unknown_fields): ''' api_addresses : typing.Sequence[str] @@ -15990,6 +16512,7 @@ def __init__(self, api_addresses=None, image_details=None, version=None, **unkno class ModelParam(Type): _toSchema = {'model_tag': 'model-tag'} _toPy = {'model-tag': 'model_tag'} + def __init__(self, model_tag=None, **unknown_fields): ''' model_tag : str @@ -16008,6 +16531,7 @@ def __init__(self, model_tag=None, **unknown_fields): class ModelResult(Type): _toSchema = {'error': 'error', 'name': 'name', 'type_': 'type', 'uuid': 'uuid'} _toPy = {'error': 'error', 'name': 'name', 'type': 'type_', 'uuid': 'uuid'} + def __init__(self, error=None, name=None, type_=None, uuid=None, **unknown_fields): ''' error : Error @@ -16044,6 +16568,7 @@ def __init__(self, error=None, name=None, type_=None, uuid=None, **unknown_field class ModelSLA(Type): _toSchema = {'creds': 'creds', 'level': 'level', 'modelslainfo': 'ModelSLAInfo', 'owner': 'owner'} _toPy = {'ModelSLAInfo': 'modelslainfo', 'creds': 'creds', 'level': 'level', 'owner': 'owner'} + def __init__(self, modelslainfo=None, creds=None, level=None, owner=None, **unknown_fields): ''' modelslainfo : ModelSLAInfo @@ -16080,6 +16605,7 @@ def __init__(self, modelslainfo=None, creds=None, level=None, owner=None, **unkn class ModelSLAInfo(Type): _toSchema = {'level': 'level', 'owner': 'owner'} _toPy = {'level': 'level', 'owner': 'owner'} + def __init__(self, level=None, owner=None, **unknown_fields): ''' level : str @@ -16104,6 +16630,7 @@ def __init__(self, level=None, owner=None, **unknown_fields): class ModelSequencesResult(Type): _toSchema = {'sequences': 'sequences'} _toPy = {'sequences': 'sequences'} + def __init__(self, sequences=None, **unknown_fields): ''' sequences : typing.Mapping[str, int] @@ -16122,6 +16649,7 @@ def __init__(self, sequences=None, **unknown_fields): class ModelSet(Type): _toSchema = {'config': 'config'} _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): ''' config : typing.Mapping[str, typing.Any] @@ -16140,6 +16668,7 @@ def __init__(self, config=None, **unknown_fields): class ModelStatus(Type): _toSchema = {'application_count': 'application-count', 'applications': 'applications', 'error': 'error', 'filesystems': 'filesystems', 'hosted_machine_count': 'hosted-machine-count', 'life': 'life', 'machines': 'machines', 'model_tag': 'model-tag', 'owner_tag': 'owner-tag', 'type_': 'type', 'unit_count': 'unit-count', 'volumes': 'volumes'} _toPy = {'application-count': 'application_count', 'applications': 'applications', 'error': 'error', 'filesystems': 'filesystems', 'hosted-machine-count': 'hosted_machine_count', 'life': 'life', 'machines': 'machines', 'model-tag': 'model_tag', 'owner-tag': 'owner_tag', 'type': 'type_', 'unit-count': 'unit_count', 'volumes': 'volumes'} + def __init__(self, application_count=None, applications=None, error=None, filesystems=None, hosted_machine_count=None, life=None, machines=None, model_tag=None, owner_tag=None, type_=None, unit_count=None, volumes=None, **unknown_fields): ''' application_count : int @@ -16224,6 +16753,7 @@ def __init__(self, application_count=None, applications=None, error=None, filesy class ModelStatusInfo(Type): _toSchema = {'available_version': 'available-version', 'cloud_tag': 'cloud-tag', 'meter_status': 'meter-status', 'model_status': 'model-status', 'name': 'name', 'region': 'region', 'sla': 'sla', 'type_': 'type', 'version': 'version'} _toPy = {'available-version': 'available_version', 'cloud-tag': 'cloud_tag', 'meter-status': 'meter_status', 'model-status': 'model_status', 'name': 'name', 'region': 'region', 'sla': 'sla', 'type': 'type_', 'version': 'version'} + def __init__(self, available_version=None, cloud_tag=None, meter_status=None, model_status=None, name=None, region=None, sla=None, type_=None, version=None, **unknown_fields): ''' available_version : str @@ -16290,6 +16820,7 @@ def __init__(self, available_version=None, cloud_tag=None, meter_status=None, mo class ModelStatusResults(Type): _toSchema = {'models': 'models'} _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): ''' models : typing.Sequence[~ModelStatus] @@ -16308,6 +16839,7 @@ def __init__(self, models=None, **unknown_fields): class ModelSummariesRequest(Type): _toSchema = {'all_': 'all', 'user_tag': 'user-tag'} _toPy = {'all': 'all_', 'user-tag': 'user_tag'} + def __init__(self, all_=None, user_tag=None, **unknown_fields): ''' all_ : bool @@ -16332,6 +16864,7 @@ def __init__(self, all_=None, user_tag=None, **unknown_fields): class ModelSummary(Type): _toSchema = {'agent_version': 'agent-version', 'cloud_credential_tag': 'cloud-credential-tag', 'cloud_region': 'cloud-region', 'cloud_tag': 'cloud-tag', 'controller_uuid': 'controller-uuid', 'counts': 'counts', 'default_series': 'default-series', 'is_controller': 'is-controller', 'last_connection': 'last-connection', 'life': 'life', 'migration': 'migration', 'name': 'name', 'owner_tag': 'owner-tag', 'provider_type': 'provider-type', 'sla': 'sla', 'status': 'status', 'type_': 'type', 'user_access': 'user-access', 'uuid': 'uuid'} _toPy = {'agent-version': 'agent_version', 'cloud-credential-tag': 'cloud_credential_tag', 'cloud-region': 'cloud_region', 'cloud-tag': 'cloud_tag', 'controller-uuid': 'controller_uuid', 'counts': 'counts', 'default-series': 'default_series', 'is-controller': 'is_controller', 'last-connection': 'last_connection', 'life': 'life', 'migration': 'migration', 'name': 'name', 'owner-tag': 'owner_tag', 'provider-type': 'provider_type', 'sla': 'sla', 'status': 'status', 'type': 'type_', 'user-access': 'user_access', 'uuid': 'uuid'} + def __init__(self, agent_version=None, cloud_credential_tag=None, cloud_region=None, cloud_tag=None, controller_uuid=None, counts=None, default_series=None, is_controller=None, last_connection=None, life=None, migration=None, name=None, owner_tag=None, provider_type=None, sla=None, status=None, type_=None, user_access=None, uuid=None, **unknown_fields): ''' agent_version : Number @@ -16458,6 +16991,7 @@ def __init__(self, agent_version=None, cloud_credential_tag=None, cloud_region=N class ModelSummaryMessage(Type): _toSchema = {'agent': 'agent', 'message': 'message'} _toPy = {'agent': 'agent', 'message': 'message'} + def __init__(self, agent=None, message=None, **unknown_fields): ''' agent : str @@ -16482,6 +17016,7 @@ def __init__(self, agent=None, message=None, **unknown_fields): class ModelSummaryResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -16506,6 +17041,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class ModelSummaryResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ModelSummaryResult] @@ -16524,6 +17060,7 @@ def __init__(self, results=None, **unknown_fields): class ModelSummarySize(Type): _toSchema = {'applications': 'applications', 'containers': 'containers', 'machines': 'machines', 'relations': 'relations', 'units': 'units'} _toPy = {'applications': 'applications', 'containers': 'containers', 'machines': 'machines', 'relations': 'relations', 'units': 'units'} + def __init__(self, applications=None, containers=None, machines=None, relations=None, units=None, **unknown_fields): ''' applications : int @@ -16566,6 +17103,7 @@ def __init__(self, applications=None, containers=None, machines=None, relations= class ModelTag(Type): _toSchema = {} _toPy = {} + def __init__(self, **unknown_fields): ''' @@ -16577,6 +17115,7 @@ def __init__(self, **unknown_fields): class ModelUnset(Type): _toSchema = {'keys': 'keys'} _toPy = {'keys': 'keys'} + def __init__(self, keys=None, **unknown_fields): ''' keys : typing.Sequence[str] @@ -16595,6 +17134,7 @@ def __init__(self, keys=None, **unknown_fields): class ModelUnsetKeys(Type): _toSchema = {'cloud_region': 'cloud-region', 'cloud_tag': 'cloud-tag', 'keys': 'keys'} _toPy = {'cloud-region': 'cloud_region', 'cloud-tag': 'cloud_tag', 'keys': 'keys'} + def __init__(self, cloud_region=None, cloud_tag=None, keys=None, **unknown_fields): ''' cloud_region : str @@ -16625,6 +17165,7 @@ def __init__(self, cloud_region=None, cloud_tag=None, keys=None, **unknown_field class ModelUserInfo(Type): _toSchema = {'access': 'access', 'display_name': 'display-name', 'last_connection': 'last-connection', 'model_tag': 'model-tag', 'user': 'user'} _toPy = {'access': 'access', 'display-name': 'display_name', 'last-connection': 'last_connection', 'model-tag': 'model_tag', 'user': 'user'} + def __init__(self, access=None, display_name=None, last_connection=None, model_tag=None, user=None, **unknown_fields): ''' access : str @@ -16667,6 +17208,7 @@ def __init__(self, access=None, display_name=None, last_connection=None, model_t class ModelUserInfoResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -16691,6 +17233,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class ModelUserInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ModelUserInfoResult] @@ -16709,6 +17252,7 @@ def __init__(self, results=None, **unknown_fields): class ModelVolumeInfo(Type): _toSchema = {'detachable': 'detachable', 'id_': 'id', 'message': 'message', 'provider_id': 'provider-id', 'status': 'status'} _toPy = {'detachable': 'detachable', 'id': 'id_', 'message': 'message', 'provider-id': 'provider_id', 'status': 'status'} + def __init__(self, detachable=None, id_=None, message=None, provider_id=None, status=None, **unknown_fields): ''' detachable : bool @@ -16751,6 +17295,7 @@ def __init__(self, detachable=None, id_=None, message=None, provider_id=None, st class ModifyCloudAccess(Type): _toSchema = {'access': 'access', 'action': 'action', 'cloud_tag': 'cloud-tag', 'user_tag': 'user-tag'} _toPy = {'access': 'access', 'action': 'action', 'cloud-tag': 'cloud_tag', 'user-tag': 'user_tag'} + def __init__(self, access=None, action=None, cloud_tag=None, user_tag=None, **unknown_fields): ''' access : str @@ -16787,6 +17332,7 @@ def __init__(self, access=None, action=None, cloud_tag=None, user_tag=None, **un class ModifyCloudAccessRequest(Type): _toSchema = {'changes': 'changes'} _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): ''' changes : typing.Sequence[~ModifyCloudAccess] @@ -16805,6 +17351,7 @@ def __init__(self, changes=None, **unknown_fields): class ModifyControllerAccess(Type): _toSchema = {'access': 'access', 'action': 'action', 'user_tag': 'user-tag'} _toPy = {'access': 'access', 'action': 'action', 'user-tag': 'user_tag'} + def __init__(self, access=None, action=None, user_tag=None, **unknown_fields): ''' access : str @@ -16835,6 +17382,7 @@ def __init__(self, access=None, action=None, user_tag=None, **unknown_fields): class ModifyControllerAccessRequest(Type): _toSchema = {'changes': 'changes'} _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): ''' changes : typing.Sequence[~ModifyControllerAccess] @@ -16853,6 +17401,7 @@ def __init__(self, changes=None, **unknown_fields): class ModifyModelAccess(Type): _toSchema = {'access': 'access', 'action': 'action', 'model_tag': 'model-tag', 'user_tag': 'user-tag'} _toPy = {'access': 'access', 'action': 'action', 'model-tag': 'model_tag', 'user-tag': 'user_tag'} + def __init__(self, access=None, action=None, model_tag=None, user_tag=None, **unknown_fields): ''' access : str @@ -16889,6 +17438,7 @@ def __init__(self, access=None, action=None, model_tag=None, user_tag=None, **un class ModifyModelAccessRequest(Type): _toSchema = {'changes': 'changes'} _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): ''' changes : typing.Sequence[~ModifyModelAccess] @@ -16907,6 +17457,7 @@ def __init__(self, changes=None, **unknown_fields): class ModifyOfferAccess(Type): _toSchema = {'access': 'access', 'action': 'action', 'offer_url': 'offer-url', 'user_tag': 'user-tag'} _toPy = {'access': 'access', 'action': 'action', 'offer-url': 'offer_url', 'user-tag': 'user_tag'} + def __init__(self, access=None, action=None, offer_url=None, user_tag=None, **unknown_fields): ''' access : str @@ -16943,6 +17494,7 @@ def __init__(self, access=None, action=None, offer_url=None, user_tag=None, **un class ModifyOfferAccessRequest(Type): _toSchema = {'changes': 'changes'} _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): ''' changes : typing.Sequence[~ModifyOfferAccess] @@ -16961,6 +17513,7 @@ def __init__(self, changes=None, **unknown_fields): class ModifyUserSSHKeys(Type): _toSchema = {'ssh_keys': 'ssh-keys', 'user': 'user'} _toPy = {'ssh-keys': 'ssh_keys', 'user': 'user'} + def __init__(self, ssh_keys=None, user=None, **unknown_fields): ''' ssh_keys : typing.Sequence[str] @@ -16985,6 +17538,7 @@ def __init__(self, ssh_keys=None, user=None, **unknown_fields): class MoveSubnetsParam(Type): _toSchema = {'force': 'force', 'space_tag': 'space-tag', 'subnets': 'subnets'} _toPy = {'force': 'force', 'space-tag': 'space_tag', 'subnets': 'subnets'} + def __init__(self, force=None, space_tag=None, subnets=None, **unknown_fields): ''' force : bool @@ -17015,6 +17569,7 @@ def __init__(self, force=None, space_tag=None, subnets=None, **unknown_fields): class MoveSubnetsParams(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~MoveSubnetsParam] @@ -17033,6 +17588,7 @@ def __init__(self, args=None, **unknown_fields): class MoveSubnetsResult(Type): _toSchema = {'error': 'error', 'moved_subnets': 'moved-subnets', 'new_space': 'new-space'} _toPy = {'error': 'error', 'moved-subnets': 'moved_subnets', 'new-space': 'new_space'} + def __init__(self, error=None, moved_subnets=None, new_space=None, **unknown_fields): ''' error : Error @@ -17063,6 +17619,7 @@ def __init__(self, error=None, moved_subnets=None, new_space=None, **unknown_fie class MoveSubnetsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~MoveSubnetsResult] @@ -17081,6 +17638,7 @@ def __init__(self, results=None, **unknown_fields): class MovedSubnet(Type): _toSchema = {'cidr': 'cidr', 'old_space': 'old-space', 'subnet': 'subnet'} _toPy = {'cidr': 'cidr', 'old-space': 'old_space', 'subnet': 'subnet'} + def __init__(self, cidr=None, old_space=None, subnet=None, **unknown_fields): ''' cidr : str @@ -17111,6 +17669,7 @@ def __init__(self, cidr=None, old_space=None, subnet=None, **unknown_fields): class NetworkConfig(Type): _toSchema = {'address': 'address', 'addresses': 'addresses', 'cidr': 'cidr', 'config_type': 'config-type', 'device_index': 'device-index', 'disabled': 'disabled', 'dns_search_domains': 'dns-search-domains', 'dns_servers': 'dns-servers', 'gateway_address': 'gateway-address', 'interface_name': 'interface-name', 'interface_type': 'interface-type', 'is_default_gateway': 'is-default-gateway', 'mac_address': 'mac-address', 'mtu': 'mtu', 'no_auto_start': 'no-auto-start', 'origin': 'origin', 'parent_interface_name': 'parent-interface-name', 'provider_address_id': 'provider-address-id', 'provider_id': 'provider-id', 'provider_network_id': 'provider-network-id', 'provider_space_id': 'provider-space-id', 'provider_subnet_id': 'provider-subnet-id', 'provider_vlan_id': 'provider-vlan-id', 'routes': 'routes', 'shadow_addresses': 'shadow-addresses', 'virtual_port_type': 'virtual-port-type', 'vlan_tag': 'vlan-tag'} _toPy = {'address': 'address', 'addresses': 'addresses', 'cidr': 'cidr', 'config-type': 'config_type', 'device-index': 'device_index', 'disabled': 'disabled', 'dns-search-domains': 'dns_search_domains', 'dns-servers': 'dns_servers', 'gateway-address': 'gateway_address', 'interface-name': 'interface_name', 'interface-type': 'interface_type', 'is-default-gateway': 'is_default_gateway', 'mac-address': 'mac_address', 'mtu': 'mtu', 'no-auto-start': 'no_auto_start', 'origin': 'origin', 'parent-interface-name': 'parent_interface_name', 'provider-address-id': 'provider_address_id', 'provider-id': 'provider_id', 'provider-network-id': 'provider_network_id', 'provider-space-id': 'provider_space_id', 'provider-subnet-id': 'provider_subnet_id', 'provider-vlan-id': 'provider_vlan_id', 'routes': 'routes', 'shadow-addresses': 'shadow_addresses', 'virtual-port-type': 'virtual_port_type', 'vlan-tag': 'vlan_tag'} + def __init__(self, address=None, addresses=None, cidr=None, config_type=None, device_index=None, disabled=None, dns_search_domains=None, dns_servers=None, gateway_address=None, interface_name=None, interface_type=None, is_default_gateway=None, mac_address=None, mtu=None, no_auto_start=None, origin=None, parent_interface_name=None, provider_address_id=None, provider_id=None, provider_network_id=None, provider_space_id=None, provider_subnet_id=None, provider_vlan_id=None, routes=None, shadow_addresses=None, virtual_port_type=None, vlan_tag=None, **unknown_fields): ''' address : str @@ -17285,6 +17844,7 @@ def __init__(self, address=None, addresses=None, cidr=None, config_type=None, de class NetworkInfo(Type): _toSchema = {'addresses': 'addresses', 'interface_name': 'interface-name', 'mac_address': 'mac-address'} _toPy = {'addresses': 'addresses', 'interface-name': 'interface_name', 'mac-address': 'mac_address'} + def __init__(self, addresses=None, interface_name=None, mac_address=None, **unknown_fields): ''' addresses : typing.Sequence[~InterfaceAddress] @@ -17315,6 +17875,7 @@ def __init__(self, addresses=None, interface_name=None, mac_address=None, **unkn class NetworkInfoParams(Type): _toSchema = {'bindings': 'bindings', 'relation_id': 'relation-id', 'unit': 'unit'} _toPy = {'bindings': 'bindings', 'relation-id': 'relation_id', 'unit': 'unit'} + def __init__(self, bindings=None, relation_id=None, unit=None, **unknown_fields): ''' bindings : typing.Sequence[str] @@ -17345,6 +17906,7 @@ def __init__(self, bindings=None, relation_id=None, unit=None, **unknown_fields) class NetworkInfoResult(Type): _toSchema = {'bind_addresses': 'bind-addresses', 'egress_subnets': 'egress-subnets', 'error': 'error', 'ingress_addresses': 'ingress-addresses'} _toPy = {'bind-addresses': 'bind_addresses', 'egress-subnets': 'egress_subnets', 'error': 'error', 'ingress-addresses': 'ingress_addresses'} + def __init__(self, bind_addresses=None, egress_subnets=None, error=None, ingress_addresses=None, **unknown_fields): ''' bind_addresses : typing.Sequence[~NetworkInfo] @@ -17381,6 +17943,7 @@ def __init__(self, bind_addresses=None, egress_subnets=None, error=None, ingress class NetworkInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Mapping[str, ~NetworkInfoResult] @@ -17399,6 +17962,7 @@ def __init__(self, results=None, **unknown_fields): class NetworkInterface(Type): _toSchema = {'dns_nameservers': 'dns-nameservers', 'gateway': 'gateway', 'ip_addresses': 'ip-addresses', 'is_up': 'is-up', 'mac_address': 'mac-address', 'space': 'space'} _toPy = {'dns-nameservers': 'dns_nameservers', 'gateway': 'gateway', 'ip-addresses': 'ip_addresses', 'is-up': 'is_up', 'mac-address': 'mac_address', 'space': 'space'} + def __init__(self, dns_nameservers=None, gateway=None, ip_addresses=None, is_up=None, mac_address=None, space=None, **unknown_fields): ''' dns_nameservers : typing.Sequence[str] @@ -17447,6 +18011,7 @@ def __init__(self, dns_nameservers=None, gateway=None, ip_addresses=None, is_up= class NetworkRoute(Type): _toSchema = {'destination_cidr': 'destination-cidr', 'gateway_ip': 'gateway-ip', 'metric': 'metric'} _toPy = {'destination-cidr': 'destination_cidr', 'gateway-ip': 'gateway_ip', 'metric': 'metric'} + def __init__(self, destination_cidr=None, gateway_ip=None, metric=None, **unknown_fields): ''' destination_cidr : str @@ -17477,6 +18042,7 @@ def __init__(self, destination_cidr=None, gateway_ip=None, metric=None, **unknow class NotifyWatchResult(Type): _toSchema = {'error': 'error', 'notifywatcherid': 'NotifyWatcherId'} _toPy = {'NotifyWatcherId': 'notifywatcherid', 'error': 'error'} + def __init__(self, notifywatcherid=None, error=None, **unknown_fields): ''' notifywatcherid : str @@ -17501,6 +18067,7 @@ def __init__(self, notifywatcherid=None, error=None, **unknown_fields): class NotifyWatchResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~NotifyWatchResult] @@ -17519,6 +18086,7 @@ def __init__(self, results=None, **unknown_fields): class Number(Type): _toSchema = {'build': 'Build', 'major': 'Major', 'minor': 'Minor', 'patch': 'Patch', 'tag': 'Tag'} _toPy = {'Build': 'build', 'Major': 'major', 'Minor': 'minor', 'Patch': 'patch', 'Tag': 'tag'} + def __init__(self, build=None, major=None, minor=None, patch=None, tag=None, **unknown_fields): ''' build : int @@ -17561,6 +18129,7 @@ def __init__(self, build=None, major=None, minor=None, patch=None, tag=None, **u class OfferArg(Type): _toSchema = {'bakery_version': 'bakery-version', 'macaroons': 'macaroons', 'offer_uuid': 'offer-uuid'} _toPy = {'bakery-version': 'bakery_version', 'macaroons': 'macaroons', 'offer-uuid': 'offer_uuid'} + def __init__(self, bakery_version=None, macaroons=None, offer_uuid=None, **unknown_fields): ''' bakery_version : int @@ -17591,6 +18160,7 @@ def __init__(self, bakery_version=None, macaroons=None, offer_uuid=None, **unkno class OfferArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~OfferArg] @@ -17609,6 +18179,7 @@ def __init__(self, args=None, **unknown_fields): class OfferConnection(Type): _toSchema = {'endpoint': 'endpoint', 'ingress_subnets': 'ingress-subnets', 'relation_id': 'relation-id', 'source_model_tag': 'source-model-tag', 'status': 'status', 'username': 'username'} _toPy = {'endpoint': 'endpoint', 'ingress-subnets': 'ingress_subnets', 'relation-id': 'relation_id', 'source-model-tag': 'source_model_tag', 'status': 'status', 'username': 'username'} + def __init__(self, endpoint=None, ingress_subnets=None, relation_id=None, source_model_tag=None, status=None, username=None, **unknown_fields): ''' endpoint : str @@ -17657,6 +18228,7 @@ def __init__(self, endpoint=None, ingress_subnets=None, relation_id=None, source class OfferFilter(Type): _toSchema = {'allowed_users': 'allowed-users', 'application_description': 'application-description', 'application_name': 'application-name', 'application_user': 'application-user', 'connected_users': 'connected-users', 'endpoints': 'endpoints', 'model_name': 'model-name', 'offer_name': 'offer-name', 'owner_name': 'owner-name'} _toPy = {'allowed-users': 'allowed_users', 'application-description': 'application_description', 'application-name': 'application_name', 'application-user': 'application_user', 'connected-users': 'connected_users', 'endpoints': 'endpoints', 'model-name': 'model_name', 'offer-name': 'offer_name', 'owner-name': 'owner_name'} + def __init__(self, allowed_users=None, application_description=None, application_name=None, application_user=None, connected_users=None, endpoints=None, model_name=None, offer_name=None, owner_name=None, **unknown_fields): ''' allowed_users : typing.Sequence[str] @@ -17723,6 +18295,7 @@ def __init__(self, allowed_users=None, application_description=None, application class OfferFilters(Type): _toSchema = {'filters': 'Filters'} _toPy = {'Filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): ''' filters : typing.Sequence[~OfferFilter] @@ -17741,6 +18314,7 @@ def __init__(self, filters=None, **unknown_fields): class OfferStatusChange(Type): _toSchema = {'offer_name': 'offer-name', 'status': 'status'} _toPy = {'offer-name': 'offer_name', 'status': 'status'} + def __init__(self, offer_name=None, status=None, **unknown_fields): ''' offer_name : str @@ -17765,6 +18339,7 @@ def __init__(self, offer_name=None, status=None, **unknown_fields): class OfferStatusWatchResult(Type): _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' changes : typing.Sequence[~OfferStatusChange] @@ -17795,6 +18370,7 @@ def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): class OfferStatusWatchResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~OfferStatusWatchResult] @@ -17813,6 +18389,7 @@ def __init__(self, results=None, **unknown_fields): class OfferURLs(Type): _toSchema = {'bakery_version': 'bakery-version', 'offer_urls': 'offer-urls'} _toPy = {'bakery-version': 'bakery_version', 'offer-urls': 'offer_urls'} + def __init__(self, bakery_version=None, offer_urls=None, **unknown_fields): ''' bakery_version : int @@ -17837,6 +18414,7 @@ def __init__(self, bakery_version=None, offer_urls=None, **unknown_fields): class OfferUserDetails(Type): _toSchema = {'access': 'access', 'display_name': 'display-name', 'user': 'user'} _toPy = {'access': 'access', 'display-name': 'display_name', 'user': 'user'} + def __init__(self, access=None, display_name=None, user=None, **unknown_fields): ''' access : str @@ -17867,6 +18445,7 @@ def __init__(self, access=None, display_name=None, user=None, **unknown_fields): class OpenMachinePortRangesByEndpointResult(Type): _toSchema = {'error': 'error', 'unit_port_ranges': 'unit-port-ranges'} _toPy = {'error': 'error', 'unit-port-ranges': 'unit_port_ranges'} + def __init__(self, error=None, unit_port_ranges=None, **unknown_fields): ''' error : Error @@ -17891,6 +18470,7 @@ def __init__(self, error=None, unit_port_ranges=None, **unknown_fields): class OpenMachinePortRangesByEndpointResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~OpenMachinePortRangesByEndpointResult] @@ -17909,6 +18489,7 @@ def __init__(self, results=None, **unknown_fields): class OpenMachinePortRangesResult(Type): _toSchema = {'error': 'error', 'unit_port_ranges': 'unit-port-ranges'} _toPy = {'error': 'error', 'unit-port-ranges': 'unit_port_ranges'} + def __init__(self, error=None, unit_port_ranges=None, **unknown_fields): ''' error : Error @@ -17933,6 +18514,7 @@ def __init__(self, error=None, unit_port_ranges=None, **unknown_fields): class OpenMachinePortRangesResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~OpenMachinePortRangesResult] @@ -17951,6 +18533,7 @@ def __init__(self, results=None, **unknown_fields): class OpenPortRangesByEndpointResult(Type): _toSchema = {'error': 'error', 'unit_port_ranges': 'unit-port-ranges'} _toPy = {'error': 'error', 'unit-port-ranges': 'unit_port_ranges'} + def __init__(self, error=None, unit_port_ranges=None, **unknown_fields): ''' error : Error @@ -17975,6 +18558,7 @@ def __init__(self, error=None, unit_port_ranges=None, **unknown_fields): class OpenPortRangesByEndpointResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~OpenPortRangesByEndpointResult] @@ -17993,6 +18577,7 @@ def __init__(self, results=None, **unknown_fields): class OpenUnitPortRanges(Type): _toSchema = {'endpoint': 'endpoint', 'port_ranges': 'port-ranges', 'subnet_cidrs': 'subnet-cidrs'} _toPy = {'endpoint': 'endpoint', 'port-ranges': 'port_ranges', 'subnet-cidrs': 'subnet_cidrs'} + def __init__(self, endpoint=None, port_ranges=None, subnet_cidrs=None, **unknown_fields): ''' endpoint : str @@ -18023,6 +18608,7 @@ def __init__(self, endpoint=None, port_ranges=None, subnet_cidrs=None, **unknown class OpenUnitPortRangesByEndpoint(Type): _toSchema = {'endpoint': 'endpoint', 'port_ranges': 'port-ranges'} _toPy = {'endpoint': 'endpoint', 'port-ranges': 'port_ranges'} + def __init__(self, endpoint=None, port_ranges=None, **unknown_fields): ''' endpoint : str @@ -18047,6 +18633,7 @@ def __init__(self, endpoint=None, port_ranges=None, **unknown_fields): class OperationQueryArgs(Type): _toSchema = {'actions': 'actions', 'applications': 'applications', 'limit': 'limit', 'machines': 'machines', 'offset': 'offset', 'status': 'status', 'units': 'units'} _toPy = {'actions': 'actions', 'applications': 'applications', 'limit': 'limit', 'machines': 'machines', 'offset': 'offset', 'status': 'status', 'units': 'units'} + def __init__(self, actions=None, applications=None, limit=None, machines=None, offset=None, status=None, units=None, **unknown_fields): ''' actions : typing.Sequence[str] @@ -18101,6 +18688,7 @@ def __init__(self, actions=None, applications=None, limit=None, machines=None, o class OperationResult(Type): _toSchema = {'actions': 'actions', 'completed': 'completed', 'enqueued': 'enqueued', 'error': 'error', 'fail': 'fail', 'operation': 'operation', 'started': 'started', 'status': 'status', 'summary': 'summary'} _toPy = {'actions': 'actions', 'completed': 'completed', 'enqueued': 'enqueued', 'error': 'error', 'fail': 'fail', 'operation': 'operation', 'started': 'started', 'status': 'status', 'summary': 'summary'} + def __init__(self, actions=None, completed=None, enqueued=None, error=None, fail=None, operation=None, started=None, status=None, summary=None, **unknown_fields): ''' actions : typing.Sequence[~ActionResult] @@ -18167,6 +18755,7 @@ def __init__(self, actions=None, completed=None, enqueued=None, error=None, fail class OperationResults(Type): _toSchema = {'results': 'results', 'truncated': 'truncated'} _toPy = {'results': 'results', 'truncated': 'truncated'} + def __init__(self, results=None, truncated=None, **unknown_fields): ''' results : typing.Sequence[~OperationResult] @@ -18191,6 +18780,7 @@ def __init__(self, results=None, truncated=None, **unknown_fields): class OperatorProvisioningInfo(Type): _toSchema = {'api_addresses': 'api-addresses', 'base_image_details': 'base-image-details', 'charm_storage': 'charm-storage', 'error': 'error', 'image_details': 'image-details', 'tags': 'tags', 'version': 'version'} _toPy = {'api-addresses': 'api_addresses', 'base-image-details': 'base_image_details', 'charm-storage': 'charm_storage', 'error': 'error', 'image-details': 'image_details', 'tags': 'tags', 'version': 'version'} + def __init__(self, api_addresses=None, base_image_details=None, charm_storage=None, error=None, image_details=None, tags=None, version=None, **unknown_fields): ''' api_addresses : typing.Sequence[str] @@ -18245,6 +18835,7 @@ def __init__(self, api_addresses=None, base_image_details=None, charm_storage=No class OperatorProvisioningInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~OperatorProvisioningInfo] @@ -18263,6 +18854,7 @@ def __init__(self, results=None, **unknown_fields): class Payload(Type): _toSchema = {'class_': 'class', 'id_': 'id', 'labels': 'labels', 'machine': 'machine', 'status': 'status', 'type_': 'type', 'unit': 'unit'} _toPy = {'class': 'class_', 'id': 'id_', 'labels': 'labels', 'machine': 'machine', 'status': 'status', 'type': 'type_', 'unit': 'unit'} + def __init__(self, class_=None, id_=None, labels=None, machine=None, status=None, type_=None, unit=None, **unknown_fields): ''' class_ : str @@ -18317,6 +18909,7 @@ def __init__(self, class_=None, id_=None, labels=None, machine=None, status=None class PayloadListArgs(Type): _toSchema = {'patterns': 'patterns'} _toPy = {'patterns': 'patterns'} + def __init__(self, patterns=None, **unknown_fields): ''' patterns : typing.Sequence[str] @@ -18335,6 +18928,7 @@ def __init__(self, patterns=None, **unknown_fields): class PayloadListResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~Payload] @@ -18353,6 +18947,7 @@ def __init__(self, results=None, **unknown_fields): class PayloadResult(Type): _toSchema = {'entity': 'Entity', 'error': 'error', 'not_found': 'not-found', 'payload': 'payload', 'tag': 'tag'} _toPy = {'Entity': 'entity', 'error': 'error', 'not-found': 'not_found', 'payload': 'payload', 'tag': 'tag'} + def __init__(self, entity=None, error=None, not_found=None, payload=None, tag=None, **unknown_fields): ''' entity : Entity @@ -18395,6 +18990,7 @@ def __init__(self, entity=None, error=None, not_found=None, payload=None, tag=No class PayloadResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~PayloadResult] @@ -18413,6 +19009,7 @@ def __init__(self, results=None, **unknown_fields): class PendingResourceUpload(Type): _toSchema = {'filename': 'Filename', 'name': 'Name', 'type_': 'Type'} _toPy = {'Filename': 'filename', 'Name': 'name', 'Type': 'type_'} + def __init__(self, filename=None, name=None, type_=None, **unknown_fields): ''' filename : str @@ -18443,6 +19040,7 @@ def __init__(self, filename=None, name=None, type_=None, **unknown_fields): class PhaseResult(Type): _toSchema = {'error': 'error', 'phase': 'phase'} _toPy = {'error': 'error', 'phase': 'phase'} + def __init__(self, error=None, phase=None, **unknown_fields): ''' error : Error @@ -18467,6 +19065,7 @@ def __init__(self, error=None, phase=None, **unknown_fields): class PhaseResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~PhaseResult] @@ -18485,6 +19084,7 @@ def __init__(self, results=None, **unknown_fields): class PinApplicationResult(Type): _toSchema = {'application_name': 'application-name', 'error': 'error'} _toPy = {'application-name': 'application_name', 'error': 'error'} + def __init__(self, application_name=None, error=None, **unknown_fields): ''' application_name : str @@ -18509,6 +19109,7 @@ def __init__(self, application_name=None, error=None, **unknown_fields): class PinApplicationsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~PinApplicationResult] @@ -18527,6 +19128,7 @@ def __init__(self, results=None, **unknown_fields): class PinnedLeadershipResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -18551,6 +19153,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class Placement(Type): _toSchema = {'directive': 'directive', 'scope': 'scope'} _toPy = {'directive': 'directive', 'scope': 'scope'} + def __init__(self, directive=None, scope=None, **unknown_fields): ''' directive : str @@ -18575,6 +19178,7 @@ def __init__(self, directive=None, scope=None, **unknown_fields): class PodSpec(Type): _toSchema = {'spec': 'spec', 'tag': 'tag'} _toPy = {'spec': 'spec', 'tag': 'tag'} + def __init__(self, spec=None, tag=None, **unknown_fields): ''' spec : str @@ -18599,6 +19203,7 @@ def __init__(self, spec=None, tag=None, **unknown_fields): class PortRange(Type): _toSchema = {'from_port': 'from-port', 'protocol': 'protocol', 'to_port': 'to-port'} _toPy = {'from-port': 'from_port', 'protocol': 'protocol', 'to-port': 'to_port'} + def __init__(self, from_port=None, protocol=None, to_port=None, **unknown_fields): ''' from_port : int @@ -18629,6 +19234,7 @@ def __init__(self, from_port=None, protocol=None, to_port=None, **unknown_fields class PrechecksArgs(Type): _toSchema = {'target_controller_version': 'target-controller-version'} _toPy = {'target-controller-version': 'target_controller_version'} + def __init__(self, target_controller_version=None, **unknown_fields): ''' target_controller_version : Number @@ -18647,6 +19253,7 @@ def __init__(self, target_controller_version=None, **unknown_fields): class ProcessRelations(Type): _toSchema = {'controller_alias': 'controller-alias'} _toPy = {'controller-alias': 'controller_alias'} + def __init__(self, controller_alias=None, **unknown_fields): ''' controller_alias : str @@ -18665,6 +19272,7 @@ def __init__(self, controller_alias=None, **unknown_fields): class ProfileInfoResult(Type): _toSchema = {'application_name': 'application-name', 'error': 'error', 'profile': 'profile', 'revision': 'revision'} _toPy = {'application-name': 'application_name', 'error': 'error', 'profile': 'profile', 'revision': 'revision'} + def __init__(self, application_name=None, error=None, profile=None, revision=None, **unknown_fields): ''' application_name : str @@ -18701,6 +19309,7 @@ def __init__(self, application_name=None, error=None, profile=None, revision=Non class ProviderInterfaceInfo(Type): _toSchema = {'interface_name': 'interface-name', 'mac_address': 'mac-address', 'provider_id': 'provider-id'} _toPy = {'interface-name': 'interface_name', 'mac-address': 'mac_address', 'provider-id': 'provider_id'} + def __init__(self, interface_name=None, mac_address=None, provider_id=None, **unknown_fields): ''' interface_name : str @@ -18731,6 +19340,7 @@ def __init__(self, interface_name=None, mac_address=None, provider_id=None, **un class ProviderInterfaceInfoResult(Type): _toSchema = {'error': 'error', 'interfaces': 'interfaces', 'machine_tag': 'machine-tag'} _toPy = {'error': 'error', 'interfaces': 'interfaces', 'machine-tag': 'machine_tag'} + def __init__(self, error=None, interfaces=None, machine_tag=None, **unknown_fields): ''' error : Error @@ -18761,6 +19371,7 @@ def __init__(self, error=None, interfaces=None, machine_tag=None, **unknown_fiel class ProviderInterfaceInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ProviderInterfaceInfoResult] @@ -18779,6 +19390,7 @@ def __init__(self, results=None, **unknown_fields): class ProviderNetworkConfig(Type): _toSchema = {'config': 'config', 'tag': 'tag'} _toPy = {'config': 'config', 'tag': 'tag'} + def __init__(self, config=None, tag=None, **unknown_fields): ''' config : typing.Sequence[~NetworkConfig] @@ -18803,6 +19415,7 @@ def __init__(self, config=None, tag=None, **unknown_fields): class ProvisioningInfo(Type): _toSchema = {'base': 'base', 'charm_lxd_profiles': 'charm-lxd-profiles', 'cloudinit_userdata': 'cloudinit-userdata', 'constraints': 'constraints', 'controller_config': 'controller-config', 'endpoint_bindings': 'endpoint-bindings', 'image_metadata': 'image-metadata', 'jobs': 'jobs', 'placement': 'placement', 'provisioningnetworktopology': 'ProvisioningNetworkTopology', 'root_disk': 'root-disk', 'space_subnets': 'space-subnets', 'subnet_zones': 'subnet-zones', 'tags': 'tags', 'volume_attachments': 'volume-attachments', 'volumes': 'volumes'} _toPy = {'ProvisioningNetworkTopology': 'provisioningnetworktopology', 'base': 'base', 'charm-lxd-profiles': 'charm_lxd_profiles', 'cloudinit-userdata': 'cloudinit_userdata', 'constraints': 'constraints', 'controller-config': 'controller_config', 'endpoint-bindings': 'endpoint_bindings', 'image-metadata': 'image_metadata', 'jobs': 'jobs', 'placement': 'placement', 'root-disk': 'root_disk', 'space-subnets': 'space_subnets', 'subnet-zones': 'subnet_zones', 'tags': 'tags', 'volume-attachments': 'volume_attachments', 'volumes': 'volumes'} + def __init__(self, provisioningnetworktopology=None, base=None, charm_lxd_profiles=None, cloudinit_userdata=None, constraints=None, controller_config=None, endpoint_bindings=None, image_metadata=None, jobs=None, placement=None, root_disk=None, space_subnets=None, subnet_zones=None, tags=None, volume_attachments=None, volumes=None, **unknown_fields): ''' provisioningnetworktopology : ProvisioningNetworkTopology @@ -18911,6 +19524,7 @@ def __init__(self, provisioningnetworktopology=None, base=None, charm_lxd_profil class ProvisioningInfoResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -18935,6 +19549,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class ProvisioningInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ProvisioningInfoResult] @@ -18953,6 +19568,7 @@ def __init__(self, results=None, **unknown_fields): class ProvisioningNetworkTopology(Type): _toSchema = {'space_subnets': 'space-subnets', 'subnet_zones': 'subnet-zones'} _toPy = {'space-subnets': 'space_subnets', 'subnet-zones': 'subnet_zones'} + def __init__(self, space_subnets=None, subnet_zones=None, **unknown_fields): ''' space_subnets : typing.Mapping[str, typing.Sequence[str]] @@ -18977,6 +19593,7 @@ def __init__(self, space_subnets=None, subnet_zones=None, **unknown_fields): class ProvisioningScriptParams(Type): _toSchema = {'data_dir': 'data-dir', 'disable_package_commands': 'disable-package-commands', 'machine_id': 'machine-id', 'nonce': 'nonce'} _toPy = {'data-dir': 'data_dir', 'disable-package-commands': 'disable_package_commands', 'machine-id': 'machine_id', 'nonce': 'nonce'} + def __init__(self, data_dir=None, disable_package_commands=None, machine_id=None, nonce=None, **unknown_fields): ''' data_dir : str @@ -19013,6 +19630,7 @@ def __init__(self, data_dir=None, disable_package_commands=None, machine_id=None class ProvisioningScriptResult(Type): _toSchema = {'script': 'script'} _toPy = {'script': 'script'} + def __init__(self, script=None, **unknown_fields): ''' script : str @@ -19031,6 +19649,7 @@ def __init__(self, script=None, **unknown_fields): class Proxy(Type): _toSchema = {'config': 'config', 'type_': 'type'} _toPy = {'config': 'config', 'type': 'type_'} + def __init__(self, config=None, type_=None, **unknown_fields): ''' config : typing.Mapping[str, typing.Any] @@ -19055,6 +19674,7 @@ def __init__(self, config=None, type_=None, **unknown_fields): class ProxyConfig(Type): _toSchema = {'ftp': 'ftp', 'http': 'http', 'https': 'https', 'no_proxy': 'no-proxy'} _toPy = {'ftp': 'ftp', 'http': 'http', 'https': 'https', 'no-proxy': 'no_proxy'} + def __init__(self, ftp=None, http=None, https=None, no_proxy=None, **unknown_fields): ''' ftp : str @@ -19091,6 +19711,7 @@ def __init__(self, ftp=None, http=None, https=None, no_proxy=None, **unknown_fie class ProxyConfigResult(Type): _toSchema = {'apt_mirror': 'apt-mirror', 'apt_proxy_settings': 'apt-proxy-settings', 'error': 'error', 'juju_proxy_settings': 'juju-proxy-settings', 'legacy_proxy_settings': 'legacy-proxy-settings', 'snap_proxy_settings': 'snap-proxy-settings', 'snap_store_assertions': 'snap-store-assertions', 'snap_store_id': 'snap-store-id', 'snap_store_proxy_url': 'snap-store-proxy-url'} _toPy = {'apt-mirror': 'apt_mirror', 'apt-proxy-settings': 'apt_proxy_settings', 'error': 'error', 'juju-proxy-settings': 'juju_proxy_settings', 'legacy-proxy-settings': 'legacy_proxy_settings', 'snap-proxy-settings': 'snap_proxy_settings', 'snap-store-assertions': 'snap_store_assertions', 'snap-store-id': 'snap_store_id', 'snap-store-proxy-url': 'snap_store_proxy_url'} + def __init__(self, apt_mirror=None, apt_proxy_settings=None, error=None, juju_proxy_settings=None, legacy_proxy_settings=None, snap_proxy_settings=None, snap_store_assertions=None, snap_store_id=None, snap_store_proxy_url=None, **unknown_fields): ''' apt_mirror : str @@ -19157,6 +19778,7 @@ def __init__(self, apt_mirror=None, apt_proxy_settings=None, error=None, juju_pr class ProxyConfigResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ProxyConfigResult] @@ -19175,6 +19797,7 @@ def __init__(self, results=None, **unknown_fields): class QueryApplicationOffersResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ApplicationOfferAdminDetails] @@ -19193,6 +19816,7 @@ def __init__(self, results=None, **unknown_fields): class QueryApplicationOffersResultsV5(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ApplicationOfferAdminDetailsV5] @@ -19211,6 +19835,7 @@ def __init__(self, results=None, **unknown_fields): class RebootActionResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -19235,6 +19860,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class RebootActionResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RebootActionResult] @@ -19253,6 +19879,7 @@ def __init__(self, results=None, **unknown_fields): class RecordAgentStartInformationArg(Type): _toSchema = {'hostname': 'hostname', 'tag': 'tag'} _toPy = {'hostname': 'hostname', 'tag': 'tag'} + def __init__(self, hostname=None, tag=None, **unknown_fields): ''' hostname : str @@ -19277,6 +19904,7 @@ def __init__(self, hostname=None, tag=None, **unknown_fields): class RecordAgentStartInformationArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~RecordAgentStartInformationArg] @@ -19295,6 +19923,7 @@ def __init__(self, args=None, **unknown_fields): class RedirectInfoResult(Type): _toSchema = {'ca_cert': 'ca-cert', 'servers': 'servers'} _toPy = {'ca-cert': 'ca_cert', 'servers': 'servers'} + def __init__(self, ca_cert=None, servers=None, **unknown_fields): ''' ca_cert : str @@ -19319,6 +19948,7 @@ def __init__(self, ca_cert=None, servers=None, **unknown_fields): class RegionDefaults(Type): _toSchema = {'region_name': 'region-name', 'value': 'value'} _toPy = {'region-name': 'region_name', 'value': 'value'} + def __init__(self, region_name=None, value=None, **unknown_fields): ''' region_name : str @@ -19340,6 +19970,7 @@ def __init__(self, region_name=None, value=None, **unknown_fields): class RegisterRemoteRelationArg(Type): _toSchema = {'application_token': 'application-token', 'bakery_version': 'bakery-version', 'consume_version': 'consume-version', 'local_endpoint_name': 'local-endpoint-name', 'macaroons': 'macaroons', 'offer_uuid': 'offer-uuid', 'relation_token': 'relation-token', 'remote_endpoint': 'remote-endpoint', 'source_model_tag': 'source-model-tag'} _toPy = {'application-token': 'application_token', 'bakery-version': 'bakery_version', 'consume-version': 'consume_version', 'local-endpoint-name': 'local_endpoint_name', 'macaroons': 'macaroons', 'offer-uuid': 'offer_uuid', 'relation-token': 'relation_token', 'remote-endpoint': 'remote_endpoint', 'source-model-tag': 'source_model_tag'} + def __init__(self, application_token=None, bakery_version=None, consume_version=None, local_endpoint_name=None, macaroons=None, offer_uuid=None, relation_token=None, remote_endpoint=None, source_model_tag=None, **unknown_fields): ''' application_token : str @@ -19406,6 +20037,7 @@ def __init__(self, application_token=None, bakery_version=None, consume_version= class RegisterRemoteRelationArgs(Type): _toSchema = {'relations': 'relations'} _toPy = {'relations': 'relations'} + def __init__(self, relations=None, **unknown_fields): ''' relations : typing.Sequence[~RegisterRemoteRelationArg] @@ -19424,6 +20056,7 @@ def __init__(self, relations=None, **unknown_fields): class RegisterRemoteRelationResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -19448,6 +20081,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class RegisterRemoteRelationResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RegisterRemoteRelationResult] @@ -19466,6 +20100,7 @@ def __init__(self, results=None, **unknown_fields): class RelationData(Type): _toSchema = {'inscope': 'InScope', 'unitdata': 'UnitData'} _toPy = {'InScope': 'inscope', 'UnitData': 'unitdata'} + def __init__(self, inscope=None, unitdata=None, **unknown_fields): ''' inscope : bool @@ -19490,6 +20125,7 @@ def __init__(self, inscope=None, unitdata=None, **unknown_fields): class RelationIds(Type): _toSchema = {'relation_ids': 'relation-ids'} _toPy = {'relation-ids': 'relation_ids'} + def __init__(self, relation_ids=None, **unknown_fields): ''' relation_ids : typing.Sequence[int] @@ -19508,6 +20144,7 @@ def __init__(self, relation_ids=None, **unknown_fields): class RelationLifeSuspendedStatusChange(Type): _toSchema = {'key': 'key', 'life': 'life', 'suspended': 'suspended', 'suspended_reason': 'suspended-reason'} _toPy = {'key': 'key', 'life': 'life', 'suspended': 'suspended', 'suspended-reason': 'suspended_reason'} + def __init__(self, key=None, life=None, suspended=None, suspended_reason=None, **unknown_fields): ''' key : str @@ -19544,6 +20181,7 @@ def __init__(self, key=None, life=None, suspended=None, suspended_reason=None, * class RelationLifeSuspendedStatusWatchResult(Type): _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' changes : typing.Sequence[~RelationLifeSuspendedStatusChange] @@ -19574,6 +20212,7 @@ def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): class RelationResult(Type): _toSchema = {'bool_': 'bool', 'endpoint': 'endpoint', 'error': 'error', 'id_': 'id', 'key': 'key', 'life': 'life', 'other_application': 'other-application'} _toPy = {'bool': 'bool_', 'endpoint': 'endpoint', 'error': 'error', 'id': 'id_', 'key': 'key', 'life': 'life', 'other-application': 'other_application'} + def __init__(self, bool_=None, endpoint=None, error=None, id_=None, key=None, life=None, other_application=None, **unknown_fields): ''' bool_ : bool @@ -19628,6 +20267,7 @@ def __init__(self, bool_=None, endpoint=None, error=None, id_=None, key=None, li class RelationResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RelationResult] @@ -19646,6 +20286,7 @@ def __init__(self, results=None, **unknown_fields): class RelationStatus(Type): _toSchema = {'endpoints': 'endpoints', 'id_': 'id', 'interface': 'interface', 'key': 'key', 'scope': 'scope', 'status': 'status'} _toPy = {'endpoints': 'endpoints', 'id': 'id_', 'interface': 'interface', 'key': 'key', 'scope': 'scope', 'status': 'status'} + def __init__(self, endpoints=None, id_=None, interface=None, key=None, scope=None, status=None, **unknown_fields): ''' endpoints : typing.Sequence[~EndpointStatus] @@ -19694,6 +20335,7 @@ def __init__(self, endpoints=None, id_=None, interface=None, key=None, scope=Non class RelationStatusArg(Type): _toSchema = {'message': 'message', 'relation_id': 'relation-id', 'status': 'status', 'unit_tag': 'unit-tag'} _toPy = {'message': 'message', 'relation-id': 'relation_id', 'status': 'status', 'unit-tag': 'unit_tag'} + def __init__(self, message=None, relation_id=None, status=None, unit_tag=None, **unknown_fields): ''' message : str @@ -19730,6 +20372,7 @@ def __init__(self, message=None, relation_id=None, status=None, unit_tag=None, * class RelationStatusArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~RelationStatusArg] @@ -19748,6 +20391,7 @@ def __init__(self, args=None, **unknown_fields): class RelationStatusWatchResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RelationLifeSuspendedStatusWatchResult] @@ -19766,6 +20410,7 @@ def __init__(self, results=None, **unknown_fields): class RelationSuspendedArg(Type): _toSchema = {'message': 'message', 'relation_id': 'relation-id', 'suspended': 'suspended'} _toPy = {'message': 'message', 'relation-id': 'relation_id', 'suspended': 'suspended'} + def __init__(self, message=None, relation_id=None, suspended=None, **unknown_fields): ''' message : str @@ -19796,6 +20441,7 @@ def __init__(self, message=None, relation_id=None, suspended=None, **unknown_fie class RelationSuspendedArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~RelationSuspendedArg] @@ -19814,6 +20460,7 @@ def __init__(self, args=None, **unknown_fields): class RelationUnit(Type): _toSchema = {'relation': 'relation', 'unit': 'unit'} _toPy = {'relation': 'relation', 'unit': 'unit'} + def __init__(self, relation=None, unit=None, **unknown_fields): ''' relation : str @@ -19838,6 +20485,7 @@ def __init__(self, relation=None, unit=None, **unknown_fields): class RelationUnitPair(Type): _toSchema = {'local_unit': 'local-unit', 'relation': 'relation', 'remote_unit': 'remote-unit'} _toPy = {'local-unit': 'local_unit', 'relation': 'relation', 'remote-unit': 'remote_unit'} + def __init__(self, local_unit=None, relation=None, remote_unit=None, **unknown_fields): ''' local_unit : str @@ -19868,6 +20516,7 @@ def __init__(self, local_unit=None, relation=None, remote_unit=None, **unknown_f class RelationUnitPairs(Type): _toSchema = {'relation_unit_pairs': 'relation-unit-pairs'} _toPy = {'relation-unit-pairs': 'relation_unit_pairs'} + def __init__(self, relation_unit_pairs=None, **unknown_fields): ''' relation_unit_pairs : typing.Sequence[~RelationUnitPair] @@ -19886,6 +20535,7 @@ def __init__(self, relation_unit_pairs=None, **unknown_fields): class RelationUnitSettings(Type): _toSchema = {'application_settings': 'application-settings', 'relation': 'relation', 'settings': 'settings', 'unit': 'unit'} _toPy = {'application-settings': 'application_settings', 'relation': 'relation', 'settings': 'settings', 'unit': 'unit'} + def __init__(self, application_settings=None, relation=None, settings=None, unit=None, **unknown_fields): ''' application_settings : typing.Mapping[str, str] @@ -19922,6 +20572,7 @@ def __init__(self, application_settings=None, relation=None, settings=None, unit class RelationUnitStatus(Type): _toSchema = {'in_scope': 'in-scope', 'relation_tag': 'relation-tag', 'suspended': 'suspended'} _toPy = {'in-scope': 'in_scope', 'relation-tag': 'relation_tag', 'suspended': 'suspended'} + def __init__(self, in_scope=None, relation_tag=None, suspended=None, **unknown_fields): ''' in_scope : bool @@ -19952,6 +20603,7 @@ def __init__(self, in_scope=None, relation_tag=None, suspended=None, **unknown_f class RelationUnitStatusResult(Type): _toSchema = {'error': 'error', 'results': 'results'} _toPy = {'error': 'error', 'results': 'results'} + def __init__(self, error=None, results=None, **unknown_fields): ''' error : Error @@ -19976,6 +20628,7 @@ def __init__(self, error=None, results=None, **unknown_fields): class RelationUnitStatusResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RelationUnitStatusResult] @@ -19994,6 +20647,7 @@ def __init__(self, results=None, **unknown_fields): class RelationUnits(Type): _toSchema = {'relation_units': 'relation-units'} _toPy = {'relation-units': 'relation_units'} + def __init__(self, relation_units=None, **unknown_fields): ''' relation_units : typing.Sequence[~RelationUnit] @@ -20012,6 +20666,7 @@ def __init__(self, relation_units=None, **unknown_fields): class RelationUnitsChange(Type): _toSchema = {'app_changed': 'app-changed', 'changed': 'changed', 'departed': 'departed'} _toPy = {'app-changed': 'app_changed', 'changed': 'changed', 'departed': 'departed'} + def __init__(self, app_changed=None, changed=None, departed=None, **unknown_fields): ''' app_changed : typing.Mapping[str, int] @@ -20042,6 +20697,7 @@ def __init__(self, app_changed=None, changed=None, departed=None, **unknown_fiel class RelationUnitsWatchResult(Type): _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' changes : RelationUnitsChange @@ -20072,6 +20728,7 @@ def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): class RelationUnitsWatchResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RelationUnitsWatchResult] @@ -20090,6 +20747,7 @@ def __init__(self, results=None, **unknown_fields): class RemoteApplication(Type): _toSchema = {'consume_version': 'consume-version', 'is_consumer_proxy': 'is-consumer-proxy', 'life': 'life', 'macaroon': 'macaroon', 'model_uuid': 'model-uuid', 'name': 'name', 'offer_uuid': 'offer-uuid', 'status': 'status'} _toPy = {'consume-version': 'consume_version', 'is-consumer-proxy': 'is_consumer_proxy', 'life': 'life', 'macaroon': 'macaroon', 'model-uuid': 'model_uuid', 'name': 'name', 'offer-uuid': 'offer_uuid', 'status': 'status'} + def __init__(self, consume_version=None, is_consumer_proxy=None, life=None, macaroon=None, model_uuid=None, name=None, offer_uuid=None, status=None, **unknown_fields): ''' consume_version : int @@ -20150,6 +20808,7 @@ def __init__(self, consume_version=None, is_consumer_proxy=None, life=None, maca class RemoteApplicationInfo(Type): _toSchema = {'description': 'description', 'endpoints': 'endpoints', 'icon_url_path': 'icon-url-path', 'model_tag': 'model-tag', 'name': 'name', 'offer_url': 'offer-url', 'source_model_label': 'source-model-label'} _toPy = {'description': 'description', 'endpoints': 'endpoints', 'icon-url-path': 'icon_url_path', 'model-tag': 'model_tag', 'name': 'name', 'offer-url': 'offer_url', 'source-model-label': 'source_model_label'} + def __init__(self, description=None, endpoints=None, icon_url_path=None, model_tag=None, name=None, offer_url=None, source_model_label=None, **unknown_fields): ''' description : str @@ -20204,6 +20863,7 @@ def __init__(self, description=None, endpoints=None, icon_url_path=None, model_t class RemoteApplicationInfoResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -20228,6 +20888,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class RemoteApplicationInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RemoteApplicationInfoResult] @@ -20246,6 +20907,7 @@ def __init__(self, results=None, **unknown_fields): class RemoteApplicationResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -20270,6 +20932,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class RemoteApplicationResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RemoteApplicationResult] @@ -20288,6 +20951,7 @@ def __init__(self, results=None, **unknown_fields): class RemoteApplicationStatus(Type): _toSchema = {'endpoints': 'endpoints', 'err': 'err', 'life': 'life', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'relations': 'relations', 'status': 'status'} _toPy = {'endpoints': 'endpoints', 'err': 'err', 'life': 'life', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'relations': 'relations', 'status': 'status'} + def __init__(self, endpoints=None, err=None, life=None, offer_name=None, offer_url=None, relations=None, status=None, **unknown_fields): ''' endpoints : typing.Sequence[~RemoteEndpoint] @@ -20342,6 +21006,7 @@ def __init__(self, endpoints=None, err=None, life=None, offer_name=None, offer_u class RemoteEndpoint(Type): _toSchema = {'interface': 'interface', 'limit': 'limit', 'name': 'name', 'role': 'role'} _toPy = {'interface': 'interface', 'limit': 'limit', 'name': 'name', 'role': 'role'} + def __init__(self, interface=None, limit=None, name=None, role=None, **unknown_fields): ''' interface : str @@ -20378,6 +21043,7 @@ def __init__(self, interface=None, limit=None, name=None, role=None, **unknown_f class RemoteEntityArg(Type): _toSchema = {'bakery_version': 'bakery-version', 'macaroons': 'macaroons', 'relation_token': 'relation-token'} _toPy = {'bakery-version': 'bakery_version', 'macaroons': 'macaroons', 'relation-token': 'relation_token'} + def __init__(self, bakery_version=None, macaroons=None, relation_token=None, **unknown_fields): ''' bakery_version : int @@ -20408,6 +21074,7 @@ def __init__(self, bakery_version=None, macaroons=None, relation_token=None, **u class RemoteEntityArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~RemoteEntityArg] @@ -20426,6 +21093,7 @@ def __init__(self, args=None, **unknown_fields): class RemoteEntityTokenArg(Type): _toSchema = {'tag': 'tag', 'token': 'token'} _toPy = {'tag': 'tag', 'token': 'token'} + def __init__(self, tag=None, token=None, **unknown_fields): ''' tag : str @@ -20450,6 +21118,7 @@ def __init__(self, tag=None, token=None, **unknown_fields): class RemoteEntityTokenArgs(Type): _toSchema = {'args': 'Args'} _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~RemoteEntityTokenArg] @@ -20468,6 +21137,7 @@ def __init__(self, args=None, **unknown_fields): class RemoteRelation(Type): _toSchema = {'application_name': 'application-name', 'endpoint': 'endpoint', 'id_': 'id', 'key': 'key', 'life': 'life', 'remote_application_name': 'remote-application-name', 'remote_endpoint_name': 'remote-endpoint-name', 'source_model_uuid': 'source-model-uuid', 'suspended': 'suspended', 'unit_count': 'unit-count'} _toPy = {'application-name': 'application_name', 'endpoint': 'endpoint', 'id': 'id_', 'key': 'key', 'life': 'life', 'remote-application-name': 'remote_application_name', 'remote-endpoint-name': 'remote_endpoint_name', 'source-model-uuid': 'source_model_uuid', 'suspended': 'suspended', 'unit-count': 'unit_count'} + def __init__(self, application_name=None, endpoint=None, id_=None, key=None, life=None, remote_application_name=None, remote_endpoint_name=None, source_model_uuid=None, suspended=None, unit_count=None, **unknown_fields): ''' application_name : str @@ -20540,6 +21210,7 @@ def __init__(self, application_name=None, endpoint=None, id_=None, key=None, lif class RemoteRelationChangeEvent(Type): _toSchema = {'application_settings': 'application-settings', 'application_token': 'application-token', 'bakery_version': 'bakery-version', 'changed_units': 'changed-units', 'departed_units': 'departed-units', 'force_cleanup': 'force-cleanup', 'life': 'life', 'macaroons': 'macaroons', 'relation_token': 'relation-token', 'suspended': 'suspended', 'suspended_reason': 'suspended-reason', 'unit_count': 'unit-count'} _toPy = {'application-settings': 'application_settings', 'application-token': 'application_token', 'bakery-version': 'bakery_version', 'changed-units': 'changed_units', 'departed-units': 'departed_units', 'force-cleanup': 'force_cleanup', 'life': 'life', 'macaroons': 'macaroons', 'relation-token': 'relation_token', 'suspended': 'suspended', 'suspended-reason': 'suspended_reason', 'unit-count': 'unit_count'} + def __init__(self, application_settings=None, application_token=None, bakery_version=None, changed_units=None, departed_units=None, force_cleanup=None, life=None, macaroons=None, relation_token=None, suspended=None, suspended_reason=None, unit_count=None, **unknown_fields): ''' application_settings : typing.Mapping[str, typing.Any] @@ -20624,6 +21295,7 @@ def __init__(self, application_settings=None, application_token=None, bakery_ver class RemoteRelationDetails(Type): _toSchema = {'bakery_version': 'bakery-version', 'macaroon': 'macaroon', 'relation_token': 'relation-token'} _toPy = {'bakery-version': 'bakery_version', 'macaroon': 'macaroon', 'relation-token': 'relation_token'} + def __init__(self, bakery_version=None, macaroon=None, relation_token=None, **unknown_fields): ''' bakery_version : int @@ -20654,6 +21326,7 @@ def __init__(self, bakery_version=None, macaroon=None, relation_token=None, **un class RemoteRelationResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -20678,6 +21351,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class RemoteRelationResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RemoteRelationResult] @@ -20696,6 +21370,7 @@ def __init__(self, results=None, **unknown_fields): class RemoteRelationUnitChange(Type): _toSchema = {'settings': 'settings', 'unit_id': 'unit-id'} _toPy = {'settings': 'settings', 'unit-id': 'unit_id'} + def __init__(self, settings=None, unit_id=None, **unknown_fields): ''' settings : typing.Mapping[str, typing.Any] @@ -20720,6 +21395,7 @@ def __init__(self, settings=None, unit_id=None, **unknown_fields): class RemoteRelationWatchResult(Type): _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' changes : RemoteRelationChangeEvent @@ -20750,6 +21426,7 @@ def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): class RemoteRelationWatchResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RemoteRelationWatchResult] @@ -20768,6 +21445,7 @@ def __init__(self, results=None, **unknown_fields): class RemoteRelationsChanges(Type): _toSchema = {'changes': 'changes'} _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): ''' changes : typing.Sequence[~RemoteRelationChangeEvent] @@ -20786,6 +21464,7 @@ def __init__(self, changes=None, **unknown_fields): class RemoteSpace(Type): _toSchema = {'cloud_type': 'cloud-type', 'name': 'name', 'provider_attributes': 'provider-attributes', 'provider_id': 'provider-id', 'subnets': 'subnets'} _toPy = {'cloud-type': 'cloud_type', 'name': 'name', 'provider-attributes': 'provider_attributes', 'provider-id': 'provider_id', 'subnets': 'subnets'} + def __init__(self, cloud_type=None, name=None, provider_attributes=None, provider_id=None, subnets=None, **unknown_fields): ''' cloud_type : str @@ -20828,6 +21507,7 @@ def __init__(self, cloud_type=None, name=None, provider_attributes=None, provide class RemoveBlocksArgs(Type): _toSchema = {'all_': 'all'} _toPy = {'all': 'all_'} + def __init__(self, all_=None, **unknown_fields): ''' all_ : bool @@ -20846,6 +21526,7 @@ def __init__(self, all_=None, **unknown_fields): class RemoveFilesystemParams(Type): _toSchema = {'destroy': 'destroy', 'filesystem_id': 'filesystem-id', 'provider': 'provider'} _toPy = {'destroy': 'destroy', 'filesystem-id': 'filesystem_id', 'provider': 'provider'} + def __init__(self, destroy=None, filesystem_id=None, provider=None, **unknown_fields): ''' destroy : bool @@ -20876,6 +21557,7 @@ def __init__(self, destroy=None, filesystem_id=None, provider=None, **unknown_fi class RemoveFilesystemParamsResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -20900,6 +21582,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class RemoveFilesystemParamsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RemoveFilesystemParamsResult] @@ -20918,6 +21601,7 @@ def __init__(self, results=None, **unknown_fields): class RemoveSecretBackendArg(Type): _toSchema = {'force': 'force', 'name': 'name'} _toPy = {'force': 'force', 'name': 'name'} + def __init__(self, force=None, name=None, **unknown_fields): ''' force : bool @@ -20942,6 +21626,7 @@ def __init__(self, force=None, name=None, **unknown_fields): class RemoveSecretBackendArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~RemoveSecretBackendArg] @@ -20960,6 +21645,7 @@ def __init__(self, args=None, **unknown_fields): class RemoveSpaceParam(Type): _toSchema = {'dry_run': 'dry-run', 'force': 'force', 'space': 'space'} _toPy = {'dry-run': 'dry_run', 'force': 'force', 'space': 'space'} + def __init__(self, dry_run=None, force=None, space=None, **unknown_fields): ''' dry_run : bool @@ -20990,6 +21676,7 @@ def __init__(self, dry_run=None, force=None, space=None, **unknown_fields): class RemoveSpaceParams(Type): _toSchema = {'space_param': 'space-param'} _toPy = {'space-param': 'space_param'} + def __init__(self, space_param=None, **unknown_fields): ''' space_param : typing.Sequence[~RemoveSpaceParam] @@ -21008,6 +21695,7 @@ def __init__(self, space_param=None, **unknown_fields): class RemoveSpaceResult(Type): _toSchema = {'bindings': 'bindings', 'constraints': 'constraints', 'controller_settings': 'controller-settings', 'error': 'error'} _toPy = {'bindings': 'bindings', 'constraints': 'constraints', 'controller-settings': 'controller_settings', 'error': 'error'} + def __init__(self, bindings=None, constraints=None, controller_settings=None, error=None, **unknown_fields): ''' bindings : typing.Sequence[~Entity] @@ -21044,6 +21732,7 @@ def __init__(self, bindings=None, constraints=None, controller_settings=None, er class RemoveSpaceResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RemoveSpaceResult] @@ -21062,6 +21751,7 @@ def __init__(self, results=None, **unknown_fields): class RemoveStorage(Type): _toSchema = {'storage': 'storage'} _toPy = {'storage': 'storage'} + def __init__(self, storage=None, **unknown_fields): ''' storage : typing.Sequence[~RemoveStorageInstance] @@ -21080,6 +21770,7 @@ def __init__(self, storage=None, **unknown_fields): class RemoveStorageInstance(Type): _toSchema = {'destroy_attachments': 'destroy-attachments', 'destroy_storage': 'destroy-storage', 'force': 'force', 'max_wait': 'max-wait', 'tag': 'tag'} _toPy = {'destroy-attachments': 'destroy_attachments', 'destroy-storage': 'destroy_storage', 'force': 'force', 'max-wait': 'max_wait', 'tag': 'tag'} + def __init__(self, destroy_attachments=None, destroy_storage=None, force=None, max_wait=None, tag=None, **unknown_fields): ''' destroy_attachments : bool @@ -21122,6 +21813,7 @@ def __init__(self, destroy_attachments=None, destroy_storage=None, force=None, m class RemoveVolumeParams(Type): _toSchema = {'destroy': 'destroy', 'provider': 'provider', 'volume_id': 'volume-id'} _toPy = {'destroy': 'destroy', 'provider': 'provider', 'volume-id': 'volume_id'} + def __init__(self, destroy=None, provider=None, volume_id=None, **unknown_fields): ''' destroy : bool @@ -21152,6 +21844,7 @@ def __init__(self, destroy=None, provider=None, volume_id=None, **unknown_fields class RemoveVolumeParamsResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -21176,6 +21869,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class RemoveVolumeParamsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RemoveVolumeParamsResult] @@ -21194,6 +21888,7 @@ def __init__(self, results=None, **unknown_fields): class RenameSpaceParams(Type): _toSchema = {'from_space_tag': 'from-space-tag', 'to_space_tag': 'to-space-tag'} _toPy = {'from-space-tag': 'from_space_tag', 'to-space-tag': 'to_space_tag'} + def __init__(self, from_space_tag=None, to_space_tag=None, **unknown_fields): ''' from_space_tag : str @@ -21218,6 +21913,7 @@ def __init__(self, from_space_tag=None, to_space_tag=None, **unknown_fields): class RenameSpacesParams(Type): _toSchema = {'changes': 'changes'} _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): ''' changes : typing.Sequence[~RenameSpaceParams] @@ -21236,6 +21932,7 @@ def __init__(self, changes=None, **unknown_fields): class ResolveCharmWithChannel(Type): _toSchema = {'charm_origin': 'charm-origin', 'reference': 'reference', 'switch_charm': 'switch-charm'} _toPy = {'charm-origin': 'charm_origin', 'reference': 'reference', 'switch-charm': 'switch_charm'} + def __init__(self, charm_origin=None, reference=None, switch_charm=None, **unknown_fields): ''' charm_origin : CharmOrigin @@ -21266,6 +21963,7 @@ def __init__(self, charm_origin=None, reference=None, switch_charm=None, **unkno class ResolveCharmWithChannelResult(Type): _toSchema = {'charm_origin': 'charm-origin', 'error': 'error', 'supported_bases': 'supported-bases', 'url': 'url'} _toPy = {'charm-origin': 'charm_origin', 'error': 'error', 'supported-bases': 'supported_bases', 'url': 'url'} + def __init__(self, charm_origin=None, error=None, supported_bases=None, url=None, **unknown_fields): ''' charm_origin : CharmOrigin @@ -21302,6 +22000,7 @@ def __init__(self, charm_origin=None, error=None, supported_bases=None, url=None class ResolveCharmWithChannelResults(Type): _toSchema = {'results': 'Results'} _toPy = {'Results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ResolveCharmWithChannelResult] @@ -21320,6 +22019,7 @@ def __init__(self, results=None, **unknown_fields): class ResolveCharmsWithChannel(Type): _toSchema = {'macaroon': 'macaroon', 'resolve': 'resolve'} _toPy = {'macaroon': 'macaroon', 'resolve': 'resolve'} + def __init__(self, macaroon=None, resolve=None, **unknown_fields): ''' macaroon : Macaroon @@ -21344,6 +22044,7 @@ def __init__(self, macaroon=None, resolve=None, **unknown_fields): class ResolvedModeResult(Type): _toSchema = {'error': 'error', 'mode': 'mode'} _toPy = {'error': 'error', 'mode': 'mode'} + def __init__(self, error=None, mode=None, **unknown_fields): ''' error : Error @@ -21368,6 +22069,7 @@ def __init__(self, error=None, mode=None, **unknown_fields): class ResolvedModeResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ResolvedModeResult] @@ -21386,6 +22088,7 @@ def __init__(self, results=None, **unknown_fields): class Resource(Type): _toSchema = {'application': 'application', 'charmresource': 'CharmResource', 'description': 'description', 'fingerprint': 'fingerprint', 'id_': 'id', 'name': 'name', 'origin': 'origin', 'path': 'path', 'pending_id': 'pending-id', 'revision': 'revision', 'size': 'size', 'timestamp': 'timestamp', 'type_': 'type', 'username': 'username'} _toPy = {'CharmResource': 'charmresource', 'application': 'application', 'description': 'description', 'fingerprint': 'fingerprint', 'id': 'id_', 'name': 'name', 'origin': 'origin', 'path': 'path', 'pending-id': 'pending_id', 'revision': 'revision', 'size': 'size', 'timestamp': 'timestamp', 'type': 'type_', 'username': 'username'} + def __init__(self, charmresource=None, application=None, description=None, fingerprint=None, id_=None, name=None, origin=None, path=None, pending_id=None, revision=None, size=None, timestamp=None, type_=None, username=None, **unknown_fields): ''' charmresource : CharmResource @@ -21482,6 +22185,7 @@ def __init__(self, charmresource=None, application=None, description=None, finge class ResourcesResult(Type): _toSchema = {'charm_store_resources': 'charm-store-resources', 'error': 'error', 'errorresult': 'ErrorResult', 'resources': 'resources', 'unit_resources': 'unit-resources'} _toPy = {'ErrorResult': 'errorresult', 'charm-store-resources': 'charm_store_resources', 'error': 'error', 'resources': 'resources', 'unit-resources': 'unit_resources'} + def __init__(self, errorresult=None, charm_store_resources=None, error=None, resources=None, unit_resources=None, **unknown_fields): ''' errorresult : ErrorResult @@ -21524,6 +22228,7 @@ def __init__(self, errorresult=None, charm_store_resources=None, error=None, res class ResourcesResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ResourcesResult] @@ -21542,6 +22247,7 @@ def __init__(self, results=None, **unknown_fields): class RetryProvisioningArgs(Type): _toSchema = {'all_': 'all', 'machines': 'machines'} _toPy = {'all': 'all_', 'machines': 'machines'} + def __init__(self, all_=None, machines=None, **unknown_fields): ''' all_ : bool @@ -21566,6 +22272,7 @@ def __init__(self, all_=None, machines=None, **unknown_fields): class RetryStrategy(Type): _toSchema = {'jitter_retry_time': 'jitter-retry-time', 'max_retry_time': 'max-retry-time', 'min_retry_time': 'min-retry-time', 'retry_time_factor': 'retry-time-factor', 'should_retry': 'should-retry'} _toPy = {'jitter-retry-time': 'jitter_retry_time', 'max-retry-time': 'max_retry_time', 'min-retry-time': 'min_retry_time', 'retry-time-factor': 'retry_time_factor', 'should-retry': 'should_retry'} + def __init__(self, jitter_retry_time=None, max_retry_time=None, min_retry_time=None, retry_time_factor=None, should_retry=None, **unknown_fields): ''' jitter_retry_time : bool @@ -21608,6 +22315,7 @@ def __init__(self, jitter_retry_time=None, max_retry_time=None, min_retry_time=N class RetryStrategyResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -21632,6 +22340,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class RetryStrategyResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~RetryStrategyResult] @@ -21650,6 +22359,7 @@ def __init__(self, results=None, **unknown_fields): class RevokeCredentialArg(Type): _toSchema = {'force': 'force', 'tag': 'tag'} _toPy = {'force': 'force', 'tag': 'tag'} + def __init__(self, force=None, tag=None, **unknown_fields): ''' force : bool @@ -21674,6 +22384,7 @@ def __init__(self, force=None, tag=None, **unknown_fields): class RevokeCredentialArgs(Type): _toSchema = {'credentials': 'credentials'} _toPy = {'credentials': 'credentials'} + def __init__(self, credentials=None, **unknown_fields): ''' credentials : typing.Sequence[~RevokeCredentialArg] @@ -21692,6 +22403,7 @@ def __init__(self, credentials=None, **unknown_fields): class RotateSecretBackendArgs(Type): _toSchema = {'backend_ids': 'backend-ids'} _toPy = {'backend-ids': 'backend_ids'} + def __init__(self, backend_ids=None, **unknown_fields): ''' backend_ids : typing.Sequence[str] @@ -21710,6 +22422,7 @@ def __init__(self, backend_ids=None, **unknown_fields): class RunParams(Type): _toSchema = {'applications': 'applications', 'commands': 'commands', 'execution_group': 'execution-group', 'machines': 'machines', 'parallel': 'parallel', 'timeout': 'timeout', 'units': 'units', 'workload_context': 'workload-context'} _toPy = {'applications': 'applications', 'commands': 'commands', 'execution-group': 'execution_group', 'machines': 'machines', 'parallel': 'parallel', 'timeout': 'timeout', 'units': 'units', 'workload-context': 'workload_context'} + def __init__(self, applications=None, commands=None, execution_group=None, machines=None, parallel=None, timeout=None, units=None, workload_context=None, **unknown_fields): ''' applications : typing.Sequence[str] @@ -21770,6 +22483,7 @@ def __init__(self, applications=None, commands=None, execution_group=None, machi class SSHAddressResult(Type): _toSchema = {'address': 'address', 'error': 'error'} _toPy = {'address': 'address', 'error': 'error'} + def __init__(self, address=None, error=None, **unknown_fields): ''' address : str @@ -21794,6 +22508,7 @@ def __init__(self, address=None, error=None, **unknown_fields): class SSHAddressResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~SSHAddressResult] @@ -21812,6 +22527,7 @@ def __init__(self, results=None, **unknown_fields): class SSHAddressesResult(Type): _toSchema = {'addresses': 'addresses', 'error': 'error'} _toPy = {'addresses': 'addresses', 'error': 'error'} + def __init__(self, addresses=None, error=None, **unknown_fields): ''' addresses : typing.Sequence[str] @@ -21836,6 +22552,7 @@ def __init__(self, addresses=None, error=None, **unknown_fields): class SSHAddressesResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~SSHAddressesResult] @@ -21854,6 +22571,7 @@ def __init__(self, results=None, **unknown_fields): class SSHHostKeySet(Type): _toSchema = {'entity_keys': 'entity-keys'} _toPy = {'entity-keys': 'entity_keys'} + def __init__(self, entity_keys=None, **unknown_fields): ''' entity_keys : typing.Sequence[~SSHHostKeys] @@ -21872,6 +22590,7 @@ def __init__(self, entity_keys=None, **unknown_fields): class SSHHostKeys(Type): _toSchema = {'public_keys': 'public-keys', 'tag': 'tag'} _toPy = {'public-keys': 'public_keys', 'tag': 'tag'} + def __init__(self, public_keys=None, tag=None, **unknown_fields): ''' public_keys : typing.Sequence[str] @@ -21896,6 +22615,7 @@ def __init__(self, public_keys=None, tag=None, **unknown_fields): class SSHProxyResult(Type): _toSchema = {'use_proxy': 'use-proxy'} _toPy = {'use-proxy': 'use_proxy'} + def __init__(self, use_proxy=None, **unknown_fields): ''' use_proxy : bool @@ -21914,6 +22634,7 @@ def __init__(self, use_proxy=None, **unknown_fields): class SSHPublicKeysResult(Type): _toSchema = {'error': 'error', 'public_keys': 'public-keys'} _toPy = {'error': 'error', 'public-keys': 'public_keys'} + def __init__(self, error=None, public_keys=None, **unknown_fields): ''' error : Error @@ -21938,6 +22659,7 @@ def __init__(self, error=None, public_keys=None, **unknown_fields): class SSHPublicKeysResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~SSHPublicKeysResult] @@ -21956,6 +22678,7 @@ def __init__(self, results=None, **unknown_fields): class ScaleApplicationInfo(Type): _toSchema = {'num_units': 'num-units'} _toPy = {'num-units': 'num_units'} + def __init__(self, num_units=None, **unknown_fields): ''' num_units : int @@ -21974,6 +22697,7 @@ def __init__(self, num_units=None, **unknown_fields): class ScaleApplicationParams(Type): _toSchema = {'application_tag': 'application-tag', 'force': 'force', 'scale': 'scale', 'scale_change': 'scale-change'} _toPy = {'application-tag': 'application_tag', 'force': 'force', 'scale': 'scale', 'scale-change': 'scale_change'} + def __init__(self, application_tag=None, force=None, scale=None, scale_change=None, **unknown_fields): ''' application_tag : str @@ -22010,6 +22734,7 @@ def __init__(self, application_tag=None, force=None, scale=None, scale_change=No class ScaleApplicationResult(Type): _toSchema = {'error': 'error', 'info': 'info'} _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): ''' error : Error @@ -22034,6 +22759,7 @@ def __init__(self, error=None, info=None, **unknown_fields): class ScaleApplicationResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ScaleApplicationResult] @@ -22052,6 +22778,7 @@ def __init__(self, results=None, **unknown_fields): class ScaleApplicationsParams(Type): _toSchema = {'applications': 'applications'} _toPy = {'applications': 'applications'} + def __init__(self, applications=None, **unknown_fields): ''' applications : typing.Sequence[~ScaleApplicationParams] @@ -22070,6 +22797,7 @@ def __init__(self, applications=None, **unknown_fields): class SecretBackend(Type): _toSchema = {'backend_type': 'backend-type', 'config': 'config', 'name': 'name', 'token_rotate_interval': 'token-rotate-interval'} _toPy = {'backend-type': 'backend_type', 'config': 'config', 'name': 'name', 'token-rotate-interval': 'token_rotate_interval'} + def __init__(self, backend_type=None, config=None, name=None, token_rotate_interval=None, **unknown_fields): ''' backend_type : str @@ -22106,6 +22834,7 @@ def __init__(self, backend_type=None, config=None, name=None, token_rotate_inter class SecretBackendArgs(Type): _toSchema = {'backend_ids': 'backend-ids', 'for_drain': 'for-drain'} _toPy = {'backend-ids': 'backend_ids', 'for-drain': 'for_drain'} + def __init__(self, backend_ids=None, for_drain=None, **unknown_fields): ''' backend_ids : typing.Sequence[str] @@ -22130,6 +22859,7 @@ def __init__(self, backend_ids=None, for_drain=None, **unknown_fields): class SecretBackendConfig(Type): _toSchema = {'params': 'params', 'type_': 'type'} _toPy = {'params': 'params', 'type': 'type_'} + def __init__(self, params=None, type_=None, **unknown_fields): ''' params : typing.Mapping[str, typing.Any] @@ -22154,6 +22884,7 @@ def __init__(self, params=None, type_=None, **unknown_fields): class SecretBackendConfigResult(Type): _toSchema = {'config': 'config', 'draining': 'draining', 'model_controller': 'model-controller', 'model_name': 'model-name', 'model_uuid': 'model-uuid'} _toPy = {'config': 'config', 'draining': 'draining', 'model-controller': 'model_controller', 'model-name': 'model_name', 'model-uuid': 'model_uuid'} + def __init__(self, config=None, draining=None, model_controller=None, model_name=None, model_uuid=None, **unknown_fields): ''' config : SecretBackendConfig @@ -22196,6 +22927,7 @@ def __init__(self, config=None, draining=None, model_controller=None, model_name class SecretBackendConfigResults(Type): _toSchema = {'active_id': 'active-id', 'results': 'results'} _toPy = {'active-id': 'active_id', 'results': 'results'} + def __init__(self, active_id=None, results=None, **unknown_fields): ''' active_id : str @@ -22220,6 +22952,7 @@ def __init__(self, active_id=None, results=None, **unknown_fields): class SecretBackendResult(Type): _toSchema = {'error': 'error', 'id_': 'id', 'message': 'message', 'num_secrets': 'num-secrets', 'result': 'result', 'status': 'status'} _toPy = {'error': 'error', 'id': 'id_', 'message': 'message', 'num-secrets': 'num_secrets', 'result': 'result', 'status': 'status'} + def __init__(self, error=None, id_=None, message=None, num_secrets=None, result=None, status=None, **unknown_fields): ''' error : Error @@ -22268,6 +23001,7 @@ def __init__(self, error=None, id_=None, message=None, num_secrets=None, result= class SecretBackendRotateChange(Type): _toSchema = {'backend_name': 'backend-name', 'id_': 'id', 'next_trigger_time': 'next-trigger-time'} _toPy = {'backend-name': 'backend_name', 'id': 'id_', 'next-trigger-time': 'next_trigger_time'} + def __init__(self, backend_name=None, id_=None, next_trigger_time=None, **unknown_fields): ''' backend_name : str @@ -22298,6 +23032,7 @@ def __init__(self, backend_name=None, id_=None, next_trigger_time=None, **unknow class SecretBackendRotateWatchResult(Type): _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' changes : typing.Sequence[~SecretBackendRotateChange] @@ -22328,6 +23063,7 @@ def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): class SecretConsumerInfoResult(Type): _toSchema = {'error': 'error', 'label': 'label', 'revision': 'revision'} _toPy = {'error': 'error', 'label': 'label', 'revision': 'revision'} + def __init__(self, error=None, label=None, revision=None, **unknown_fields): ''' error : Error @@ -22358,6 +23094,7 @@ def __init__(self, error=None, label=None, revision=None, **unknown_fields): class SecretConsumerInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~SecretConsumerInfoResult] @@ -22376,6 +23113,7 @@ def __init__(self, results=None, **unknown_fields): class SecretContentParams(Type): _toSchema = {'data': 'data', 'value_ref': 'value-ref'} _toPy = {'data': 'data', 'value-ref': 'value_ref'} + def __init__(self, data=None, value_ref=None, **unknown_fields): ''' data : typing.Mapping[str, str] @@ -22400,6 +23138,7 @@ def __init__(self, data=None, value_ref=None, **unknown_fields): class SecretContentResult(Type): _toSchema = {'backend_config': 'backend-config', 'content': 'content', 'error': 'error', 'latest_revision': 'latest-revision'} _toPy = {'backend-config': 'backend_config', 'content': 'content', 'error': 'error', 'latest-revision': 'latest_revision'} + def __init__(self, backend_config=None, content=None, error=None, latest_revision=None, **unknown_fields): ''' backend_config : SecretBackendConfigResult @@ -22436,6 +23175,7 @@ def __init__(self, backend_config=None, content=None, error=None, latest_revisio class SecretContentResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~SecretContentResult] @@ -22454,6 +23194,7 @@ def __init__(self, results=None, **unknown_fields): class SecretRevision(Type): _toSchema = {'backend_name': 'backend-name', 'create_time': 'create-time', 'expire_time': 'expire-time', 'revision': 'revision', 'update_time': 'update-time', 'value_ref': 'value-ref'} _toPy = {'backend-name': 'backend_name', 'create-time': 'create_time', 'expire-time': 'expire_time', 'revision': 'revision', 'update-time': 'update_time', 'value-ref': 'value_ref'} + def __init__(self, backend_name=None, create_time=None, expire_time=None, revision=None, update_time=None, value_ref=None, **unknown_fields): ''' backend_name : str @@ -22502,6 +23243,7 @@ def __init__(self, backend_name=None, create_time=None, expire_time=None, revisi class SecretRevisionArg(Type): _toSchema = {'pending_delete': 'pending-delete', 'revisions': 'revisions', 'uri': 'uri'} _toPy = {'pending-delete': 'pending_delete', 'revisions': 'revisions', 'uri': 'uri'} + def __init__(self, pending_delete=None, revisions=None, uri=None, **unknown_fields): ''' pending_delete : bool @@ -22532,6 +23274,7 @@ def __init__(self, pending_delete=None, revisions=None, uri=None, **unknown_fiel class SecretRevisionChange(Type): _toSchema = {'revision': 'revision', 'uri': 'uri'} _toPy = {'revision': 'revision', 'uri': 'uri'} + def __init__(self, revision=None, uri=None, **unknown_fields): ''' revision : int @@ -22556,6 +23299,7 @@ def __init__(self, revision=None, uri=None, **unknown_fields): class SecretRevisionWatchResult(Type): _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' changes : typing.Sequence[~SecretRevisionChange] @@ -22586,6 +23330,7 @@ def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): class SecretRevisionWatchResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~SecretRevisionWatchResult] @@ -22604,6 +23349,7 @@ def __init__(self, results=None, **unknown_fields): class SecretRotatedArg(Type): _toSchema = {'original_revision': 'original-revision', 'skip': 'skip', 'uri': 'uri'} _toPy = {'original-revision': 'original_revision', 'skip': 'skip', 'uri': 'uri'} + def __init__(self, original_revision=None, skip=None, uri=None, **unknown_fields): ''' original_revision : int @@ -22634,6 +23380,7 @@ def __init__(self, original_revision=None, skip=None, uri=None, **unknown_fields class SecretRotatedArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~SecretRotatedArg] @@ -22652,6 +23399,7 @@ def __init__(self, args=None, **unknown_fields): class SecretTriggerChange(Type): _toSchema = {'next_trigger_time': 'next-trigger-time', 'revision': 'revision', 'uri': 'uri'} _toPy = {'next-trigger-time': 'next_trigger_time', 'revision': 'revision', 'uri': 'uri'} + def __init__(self, next_trigger_time=None, revision=None, uri=None, **unknown_fields): ''' next_trigger_time : str @@ -22682,6 +23430,7 @@ def __init__(self, next_trigger_time=None, revision=None, uri=None, **unknown_fi class SecretTriggerWatchResult(Type): _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' changes : typing.Sequence[~SecretTriggerChange] @@ -22712,6 +23461,7 @@ def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): class SecretValueRef(Type): _toSchema = {'backend_id': 'backend-id', 'revision_id': 'revision-id'} _toPy = {'backend-id': 'backend_id', 'revision-id': 'revision_id'} + def __init__(self, backend_id=None, revision_id=None, **unknown_fields): ''' backend_id : str @@ -22736,6 +23486,7 @@ def __init__(self, backend_id=None, revision_id=None, **unknown_fields): class SecretValueResult(Type): _toSchema = {'data': 'data', 'error': 'error'} _toPy = {'data': 'data', 'error': 'error'} + def __init__(self, data=None, error=None, **unknown_fields): ''' data : typing.Mapping[str, str] @@ -22760,6 +23511,7 @@ def __init__(self, data=None, error=None, **unknown_fields): class SecretsFilter(Type): _toSchema = {'label': 'label', 'owner_tag': 'owner-tag', 'revision': 'revision', 'uri': 'uri'} _toPy = {'label': 'label', 'owner-tag': 'owner_tag', 'revision': 'revision', 'uri': 'uri'} + def __init__(self, label=None, owner_tag=None, revision=None, uri=None, **unknown_fields): ''' label : str @@ -22796,6 +23548,7 @@ def __init__(self, label=None, owner_tag=None, revision=None, uri=None, **unknow class SerializedModel(Type): _toSchema = {'bytes_': 'bytes', 'charms': 'charms', 'resources': 'resources', 'tools': 'tools'} _toPy = {'bytes': 'bytes_', 'charms': 'charms', 'resources': 'resources', 'tools': 'tools'} + def __init__(self, bytes_=None, charms=None, resources=None, tools=None, **unknown_fields): ''' bytes_ : typing.Sequence[int] @@ -22832,6 +23585,7 @@ def __init__(self, bytes_=None, charms=None, resources=None, tools=None, **unkno class SerializedModelResource(Type): _toSchema = {'application': 'application', 'application_revision': 'application-revision', 'charmstore_revision': 'charmstore-revision', 'name': 'name', 'unit_revisions': 'unit-revisions'} _toPy = {'application': 'application', 'application-revision': 'application_revision', 'charmstore-revision': 'charmstore_revision', 'name': 'name', 'unit-revisions': 'unit_revisions'} + def __init__(self, application=None, application_revision=None, charmstore_revision=None, name=None, unit_revisions=None, **unknown_fields): ''' application : str @@ -22874,6 +23628,7 @@ def __init__(self, application=None, application_revision=None, charmstore_revis class SerializedModelResourceRevision(Type): _toSchema = {'description': 'description', 'fingerprint': 'fingerprint', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'timestamp': 'timestamp', 'type_': 'type', 'username': 'username'} _toPy = {'description': 'description', 'fingerprint': 'fingerprint', 'origin': 'origin', 'path': 'path', 'revision': 'revision', 'size': 'size', 'timestamp': 'timestamp', 'type': 'type_', 'username': 'username'} + def __init__(self, description=None, fingerprint=None, origin=None, path=None, revision=None, size=None, timestamp=None, type_=None, username=None, **unknown_fields): ''' description : str @@ -22940,6 +23695,7 @@ def __init__(self, description=None, fingerprint=None, origin=None, path=None, r class SerializedModelTools(Type): _toSchema = {'uri': 'uri', 'version': 'version'} _toPy = {'uri': 'uri', 'version': 'version'} + def __init__(self, uri=None, version=None, **unknown_fields): ''' uri : str @@ -22964,6 +23720,7 @@ def __init__(self, uri=None, version=None, **unknown_fields): class SetConstraints(Type): _toSchema = {'application': 'application', 'constraints': 'constraints'} _toPy = {'application': 'application', 'constraints': 'constraints'} + def __init__(self, application=None, constraints=None, **unknown_fields): ''' application : str @@ -22988,6 +23745,7 @@ def __init__(self, application=None, constraints=None, **unknown_fields): class SetExternalControllerInfoParams(Type): _toSchema = {'info': 'info'} _toPy = {'info': 'info'} + def __init__(self, info=None, **unknown_fields): ''' info : ExternalControllerInfo @@ -23006,6 +23764,7 @@ def __init__(self, info=None, **unknown_fields): class SetExternalControllersInfoParams(Type): _toSchema = {'controllers': 'controllers'} _toPy = {'controllers': 'controllers'} + def __init__(self, controllers=None, **unknown_fields): ''' controllers : typing.Sequence[~SetExternalControllerInfoParams] @@ -23024,6 +23783,7 @@ def __init__(self, controllers=None, **unknown_fields): class SetMachineBlockDevices(Type): _toSchema = {'machine_block_devices': 'machine-block-devices'} _toPy = {'machine-block-devices': 'machine_block_devices'} + def __init__(self, machine_block_devices=None, **unknown_fields): ''' machine_block_devices : typing.Sequence[~MachineBlockDevices] @@ -23042,6 +23802,7 @@ def __init__(self, machine_block_devices=None, **unknown_fields): class SetMachineNetworkConfig(Type): _toSchema = {'config': 'config', 'tag': 'tag'} _toPy = {'config': 'config', 'tag': 'tag'} + def __init__(self, config=None, tag=None, **unknown_fields): ''' config : typing.Sequence[~NetworkConfig] @@ -23066,6 +23827,7 @@ def __init__(self, config=None, tag=None, **unknown_fields): class SetMachinesAddresses(Type): _toSchema = {'machine_addresses': 'machine-addresses'} _toPy = {'machine-addresses': 'machine_addresses'} + def __init__(self, machine_addresses=None, **unknown_fields): ''' machine_addresses : typing.Sequence[~MachineAddresses] @@ -23084,6 +23846,7 @@ def __init__(self, machine_addresses=None, **unknown_fields): class SetMigrationPhaseArgs(Type): _toSchema = {'phase': 'phase'} _toPy = {'phase': 'phase'} + def __init__(self, phase=None, **unknown_fields): ''' phase : str @@ -23102,6 +23865,7 @@ def __init__(self, phase=None, **unknown_fields): class SetMigrationStatusMessageArgs(Type): _toSchema = {'message': 'message'} _toPy = {'message': 'message'} + def __init__(self, message=None, **unknown_fields): ''' message : str @@ -23120,6 +23884,7 @@ def __init__(self, message=None, **unknown_fields): class SetModelDefaults(Type): _toSchema = {'config': 'config'} _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): ''' config : typing.Sequence[~ModelDefaultValues] @@ -23138,6 +23903,7 @@ def __init__(self, config=None, **unknown_fields): class SetModelEnvironVersion(Type): _toSchema = {'model_tag': 'model-tag', 'version': 'version'} _toPy = {'model-tag': 'model_tag', 'version': 'version'} + def __init__(self, model_tag=None, version=None, **unknown_fields): ''' model_tag : str @@ -23162,6 +23928,7 @@ def __init__(self, model_tag=None, version=None, **unknown_fields): class SetModelEnvironVersions(Type): _toSchema = {'models': 'models'} _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): ''' models : typing.Sequence[~SetModelEnvironVersion] @@ -23180,6 +23947,7 @@ def __init__(self, models=None, **unknown_fields): class SetPayloadStatusArg(Type): _toSchema = {'entity': 'Entity', 'status': 'status', 'tag': 'tag'} _toPy = {'Entity': 'entity', 'status': 'status', 'tag': 'tag'} + def __init__(self, entity=None, status=None, tag=None, **unknown_fields): ''' entity : Entity @@ -23210,6 +23978,7 @@ def __init__(self, entity=None, status=None, tag=None, **unknown_fields): class SetPayloadStatusArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~SetPayloadStatusArg] @@ -23228,6 +23997,7 @@ def __init__(self, args=None, **unknown_fields): class SetPodSpecParams(Type): _toSchema = {'specs': 'specs'} _toPy = {'specs': 'specs'} + def __init__(self, specs=None, **unknown_fields): ''' specs : typing.Sequence[~EntityString] @@ -23246,6 +24016,7 @@ def __init__(self, specs=None, **unknown_fields): class SetProfileArg(Type): _toSchema = {'entity': 'entity', 'profiles': 'profiles'} _toPy = {'entity': 'entity', 'profiles': 'profiles'} + def __init__(self, entity=None, profiles=None, **unknown_fields): ''' entity : Entity @@ -23270,6 +24041,7 @@ def __init__(self, entity=None, profiles=None, **unknown_fields): class SetProfileArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~SetProfileArg] @@ -23288,6 +24060,7 @@ def __init__(self, args=None, **unknown_fields): class SetProviderNetworkConfig(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~ProviderNetworkConfig] @@ -23306,6 +24079,7 @@ def __init__(self, args=None, **unknown_fields): class SetProviderNetworkConfigResult(Type): _toSchema = {'addresses': 'addresses', 'error': 'error', 'modified': 'modified'} _toPy = {'addresses': 'addresses', 'error': 'error', 'modified': 'modified'} + def __init__(self, addresses=None, error=None, modified=None, **unknown_fields): ''' addresses : typing.Sequence[~Address] @@ -23336,6 +24110,7 @@ def __init__(self, addresses=None, error=None, modified=None, **unknown_fields): class SetProviderNetworkConfigResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~SetProviderNetworkConfigResult] @@ -23354,6 +24129,7 @@ def __init__(self, results=None, **unknown_fields): class SetStatus(Type): _toSchema = {'entities': 'entities'} _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): ''' entities : typing.Sequence[~EntityStatusArgs] @@ -23372,6 +24148,7 @@ def __init__(self, entities=None, **unknown_fields): class SetUnitStateArg(Type): _toSchema = {'charm_state': 'charm-state', 'meter_status_state': 'meter-status-state', 'relation_state': 'relation-state', 'secret_state': 'secret-state', 'storage_state': 'storage-state', 'tag': 'tag', 'uniter_state': 'uniter-state'} _toPy = {'charm-state': 'charm_state', 'meter-status-state': 'meter_status_state', 'relation-state': 'relation_state', 'secret-state': 'secret_state', 'storage-state': 'storage_state', 'tag': 'tag', 'uniter-state': 'uniter_state'} + def __init__(self, charm_state=None, meter_status_state=None, relation_state=None, secret_state=None, storage_state=None, tag=None, uniter_state=None, **unknown_fields): ''' charm_state : typing.Mapping[str, str] @@ -23426,6 +24203,7 @@ def __init__(self, charm_state=None, meter_status_state=None, relation_state=Non class SetUnitStateArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~SetUnitStateArg] @@ -23444,6 +24222,7 @@ def __init__(self, args=None, **unknown_fields): class Settings(Type): _toSchema = {'autonoproxy': 'AutoNoProxy', 'ftp': 'Ftp', 'http': 'Http', 'https': 'Https', 'noproxy': 'NoProxy'} _toPy = {'AutoNoProxy': 'autonoproxy', 'Ftp': 'ftp', 'Http': 'http', 'Https': 'https', 'NoProxy': 'noproxy'} + def __init__(self, autonoproxy=None, ftp=None, http=None, https=None, noproxy=None, **unknown_fields): ''' autonoproxy : str @@ -23486,6 +24265,7 @@ def __init__(self, autonoproxy=None, ftp=None, http=None, https=None, noproxy=No class SettingsResult(Type): _toSchema = {'error': 'error', 'settings': 'settings'} _toPy = {'error': 'error', 'settings': 'settings'} + def __init__(self, error=None, settings=None, **unknown_fields): ''' error : Error @@ -23510,6 +24290,7 @@ def __init__(self, error=None, settings=None, **unknown_fields): class SettingsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~SettingsResult] @@ -23528,6 +24309,7 @@ def __init__(self, results=None, **unknown_fields): class ShowSpaceResult(Type): _toSchema = {'applications': 'applications', 'error': 'error', 'machine_count': 'machine-count', 'space': 'space'} _toPy = {'applications': 'applications', 'error': 'error', 'machine-count': 'machine_count', 'space': 'space'} + def __init__(self, applications=None, error=None, machine_count=None, space=None, **unknown_fields): ''' applications : typing.Sequence[str] @@ -23564,6 +24346,7 @@ def __init__(self, applications=None, error=None, machine_count=None, space=None class ShowSpaceResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ShowSpaceResult] @@ -23582,6 +24365,7 @@ def __init__(self, results=None, **unknown_fields): class SingularClaim(Type): _toSchema = {'claimant_tag': 'claimant-tag', 'duration': 'duration', 'entity_tag': 'entity-tag'} _toPy = {'claimant-tag': 'claimant_tag', 'duration': 'duration', 'entity-tag': 'entity_tag'} + def __init__(self, claimant_tag=None, duration=None, entity_tag=None, **unknown_fields): ''' claimant_tag : str @@ -23612,6 +24396,7 @@ def __init__(self, claimant_tag=None, duration=None, entity_tag=None, **unknown_ class SingularClaims(Type): _toSchema = {'claims': 'claims'} _toPy = {'claims': 'claims'} + def __init__(self, claims=None, **unknown_fields): ''' claims : typing.Sequence[~SingularClaim] @@ -23630,6 +24415,7 @@ def __init__(self, claims=None, **unknown_fields): class Space(Type): _toSchema = {'error': 'error', 'id_': 'id', 'name': 'name', 'subnets': 'subnets'} _toPy = {'error': 'error', 'id': 'id_', 'name': 'name', 'subnets': 'subnets'} + def __init__(self, error=None, id_=None, name=None, subnets=None, **unknown_fields): ''' error : Error @@ -23666,6 +24452,7 @@ def __init__(self, error=None, id_=None, name=None, subnets=None, **unknown_fiel class SpaceInfo(Type): _toSchema = {'id_': 'id', 'name': 'name', 'provider_id': 'provider-id', 'subnets': 'subnets'} _toPy = {'id': 'id_', 'name': 'name', 'provider-id': 'provider_id', 'subnets': 'subnets'} + def __init__(self, id_=None, name=None, provider_id=None, subnets=None, **unknown_fields): ''' id_ : str @@ -23702,6 +24489,7 @@ def __init__(self, id_=None, name=None, provider_id=None, subnets=None, **unknow class SpaceInfos(Type): _toSchema = {'space_infos': 'space-infos'} _toPy = {'space-infos': 'space_infos'} + def __init__(self, space_infos=None, **unknown_fields): ''' space_infos : typing.Sequence[~SpaceInfo] @@ -23720,6 +24508,7 @@ def __init__(self, space_infos=None, **unknown_fields): class SpaceInfosParams(Type): _toSchema = {'space_ids': 'space-ids'} _toPy = {'space-ids': 'space_ids'} + def __init__(self, space_ids=None, **unknown_fields): ''' space_ids : typing.Sequence[str] @@ -23738,6 +24527,7 @@ def __init__(self, space_ids=None, **unknown_fields): class StateServingInfo(Type): _toSchema = {'api_port': 'api-port', 'ca_private_key': 'ca-private-key', 'cert': 'cert', 'controller_api_port': 'controller-api-port', 'private_key': 'private-key', 'shared_secret': 'shared-secret', 'state_port': 'state-port', 'system_identity': 'system-identity'} _toPy = {'api-port': 'api_port', 'ca-private-key': 'ca_private_key', 'cert': 'cert', 'controller-api-port': 'controller_api_port', 'private-key': 'private_key', 'shared-secret': 'shared_secret', 'state-port': 'state_port', 'system-identity': 'system_identity'} + def __init__(self, api_port=None, ca_private_key=None, cert=None, controller_api_port=None, private_key=None, shared_secret=None, state_port=None, system_identity=None, **unknown_fields): ''' api_port : int @@ -23798,6 +24588,7 @@ def __init__(self, api_port=None, ca_private_key=None, cert=None, controller_api class StatusHistoryFilter(Type): _toSchema = {'date': 'date', 'delta': 'delta', 'exclude': 'exclude', 'size': 'size'} _toPy = {'date': 'date', 'delta': 'delta', 'exclude': 'exclude', 'size': 'size'} + def __init__(self, date=None, delta=None, exclude=None, size=None, **unknown_fields): ''' date : str @@ -23834,6 +24625,7 @@ def __init__(self, date=None, delta=None, exclude=None, size=None, **unknown_fie class StatusHistoryPruneArgs(Type): _toSchema = {'max_history_mb': 'max-history-mb', 'max_history_time': 'max-history-time'} _toPy = {'max-history-mb': 'max_history_mb', 'max-history-time': 'max_history_time'} + def __init__(self, max_history_mb=None, max_history_time=None, **unknown_fields): ''' max_history_mb : int @@ -23858,6 +24650,7 @@ def __init__(self, max_history_mb=None, max_history_time=None, **unknown_fields) class StatusHistoryRequest(Type): _toSchema = {'filter_': 'filter', 'historykind': 'historyKind', 'size': 'size', 'tag': 'tag'} _toPy = {'filter': 'filter_', 'historyKind': 'historykind', 'size': 'size', 'tag': 'tag'} + def __init__(self, filter_=None, historykind=None, size=None, tag=None, **unknown_fields): ''' filter_ : StatusHistoryFilter @@ -23894,6 +24687,7 @@ def __init__(self, filter_=None, historykind=None, size=None, tag=None, **unknow class StatusHistoryRequests(Type): _toSchema = {'requests': 'requests'} _toPy = {'requests': 'requests'} + def __init__(self, requests=None, **unknown_fields): ''' requests : typing.Sequence[~StatusHistoryRequest] @@ -23912,6 +24706,7 @@ def __init__(self, requests=None, **unknown_fields): class StatusHistoryResult(Type): _toSchema = {'error': 'error', 'history': 'history'} _toPy = {'error': 'error', 'history': 'history'} + def __init__(self, error=None, history=None, **unknown_fields): ''' error : Error @@ -23936,6 +24731,7 @@ def __init__(self, error=None, history=None, **unknown_fields): class StatusHistoryResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~StatusHistoryResult] @@ -23954,6 +24750,7 @@ def __init__(self, results=None, **unknown_fields): class StatusParams(Type): _toSchema = {'include_storage': 'include-storage', 'patterns': 'patterns'} _toPy = {'include-storage': 'include_storage', 'patterns': 'patterns'} + def __init__(self, include_storage=None, patterns=None, **unknown_fields): ''' include_storage : bool @@ -23978,6 +24775,7 @@ def __init__(self, include_storage=None, patterns=None, **unknown_fields): class StatusResult(Type): _toSchema = {'data': 'data', 'error': 'error', 'id_': 'id', 'info': 'info', 'life': 'life', 'since': 'since', 'status': 'status'} _toPy = {'data': 'data', 'error': 'error', 'id': 'id_', 'info': 'info', 'life': 'life', 'since': 'since', 'status': 'status'} + def __init__(self, data=None, error=None, id_=None, info=None, life=None, since=None, status=None, **unknown_fields): ''' data : typing.Mapping[str, typing.Any] @@ -24032,6 +24830,7 @@ def __init__(self, data=None, error=None, id_=None, info=None, life=None, since= class StatusResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~StatusResult] @@ -24050,6 +24849,7 @@ def __init__(self, results=None, **unknown_fields): class StorageAddParams(Type): _toSchema = {'name': 'name', 'storage': 'storage', 'unit': 'unit'} _toPy = {'name': 'name', 'storage': 'storage', 'unit': 'unit'} + def __init__(self, name=None, storage=None, unit=None, **unknown_fields): ''' name : str @@ -24080,6 +24880,7 @@ def __init__(self, name=None, storage=None, unit=None, **unknown_fields): class StorageAttachment(Type): _toSchema = {'kind': 'kind', 'life': 'life', 'location': 'location', 'owner_tag': 'owner-tag', 'storage_tag': 'storage-tag', 'unit_tag': 'unit-tag'} _toPy = {'kind': 'kind', 'life': 'life', 'location': 'location', 'owner-tag': 'owner_tag', 'storage-tag': 'storage_tag', 'unit-tag': 'unit_tag'} + def __init__(self, kind=None, life=None, location=None, owner_tag=None, storage_tag=None, unit_tag=None, **unknown_fields): ''' kind : int @@ -24128,6 +24929,7 @@ def __init__(self, kind=None, life=None, location=None, owner_tag=None, storage_ class StorageAttachmentDetails(Type): _toSchema = {'life': 'life', 'location': 'location', 'machine_tag': 'machine-tag', 'storage_tag': 'storage-tag', 'unit_tag': 'unit-tag'} _toPy = {'life': 'life', 'location': 'location', 'machine-tag': 'machine_tag', 'storage-tag': 'storage_tag', 'unit-tag': 'unit_tag'} + def __init__(self, life=None, location=None, machine_tag=None, storage_tag=None, unit_tag=None, **unknown_fields): ''' life : str @@ -24170,6 +24972,7 @@ def __init__(self, life=None, location=None, machine_tag=None, storage_tag=None, class StorageAttachmentId(Type): _toSchema = {'storage_tag': 'storage-tag', 'unit_tag': 'unit-tag'} _toPy = {'storage-tag': 'storage_tag', 'unit-tag': 'unit_tag'} + def __init__(self, storage_tag=None, unit_tag=None, **unknown_fields): ''' storage_tag : str @@ -24194,6 +24997,7 @@ def __init__(self, storage_tag=None, unit_tag=None, **unknown_fields): class StorageAttachmentIds(Type): _toSchema = {'ids': 'ids'} _toPy = {'ids': 'ids'} + def __init__(self, ids=None, **unknown_fields): ''' ids : typing.Sequence[~StorageAttachmentId] @@ -24212,6 +25016,7 @@ def __init__(self, ids=None, **unknown_fields): class StorageAttachmentIdsResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -24236,6 +25041,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class StorageAttachmentIdsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~StorageAttachmentIdsResult] @@ -24254,6 +25060,7 @@ def __init__(self, results=None, **unknown_fields): class StorageAttachmentResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -24278,6 +25085,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class StorageAttachmentResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~StorageAttachmentResult] @@ -24296,6 +25104,7 @@ def __init__(self, results=None, **unknown_fields): class StorageConstraints(Type): _toSchema = {'count': 'count', 'pool': 'pool', 'size': 'size'} _toPy = {'count': 'count', 'pool': 'pool', 'size': 'size'} + def __init__(self, count=None, pool=None, size=None, **unknown_fields): ''' count : int @@ -24326,6 +25135,7 @@ def __init__(self, count=None, pool=None, size=None, **unknown_fields): class StorageDetachmentParams(Type): _toSchema = {'force': 'force', 'ids': 'ids', 'max_wait': 'max-wait'} _toPy = {'force': 'force', 'ids': 'ids', 'max-wait': 'max_wait'} + def __init__(self, force=None, ids=None, max_wait=None, **unknown_fields): ''' force : bool @@ -24356,6 +25166,7 @@ def __init__(self, force=None, ids=None, max_wait=None, **unknown_fields): class StorageDetails(Type): _toSchema = {'attachments': 'attachments', 'kind': 'kind', 'life': 'life', 'owner_tag': 'owner-tag', 'persistent': 'persistent', 'status': 'status', 'storage_tag': 'storage-tag'} _toPy = {'attachments': 'attachments', 'kind': 'kind', 'life': 'life', 'owner-tag': 'owner_tag', 'persistent': 'persistent', 'status': 'status', 'storage-tag': 'storage_tag'} + def __init__(self, attachments=None, kind=None, life=None, owner_tag=None, persistent=None, status=None, storage_tag=None, **unknown_fields): ''' attachments : typing.Mapping[str, ~StorageAttachmentDetails] @@ -24410,6 +25221,7 @@ def __init__(self, attachments=None, kind=None, life=None, owner_tag=None, persi class StorageDetailsListResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -24434,6 +25246,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class StorageDetailsListResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~StorageDetailsListResult] @@ -24452,6 +25265,7 @@ def __init__(self, results=None, **unknown_fields): class StorageDetailsResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -24476,6 +25290,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class StorageDetailsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~StorageDetailsResult] @@ -24494,6 +25309,7 @@ def __init__(self, results=None, **unknown_fields): class StorageFilter(Type): _toSchema = {} _toPy = {} + def __init__(self, **unknown_fields): ''' @@ -24505,6 +25321,7 @@ def __init__(self, **unknown_fields): class StorageFilters(Type): _toSchema = {'filters': 'filters'} _toPy = {'filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): ''' filters : typing.Sequence[~StorageFilter] @@ -24523,6 +25340,7 @@ def __init__(self, filters=None, **unknown_fields): class StoragePool(Type): _toSchema = {'attrs': 'attrs', 'name': 'name', 'provider': 'provider'} _toPy = {'attrs': 'attrs', 'name': 'name', 'provider': 'provider'} + def __init__(self, attrs=None, name=None, provider=None, **unknown_fields): ''' attrs : typing.Mapping[str, typing.Any] @@ -24553,6 +25371,7 @@ def __init__(self, attrs=None, name=None, provider=None, **unknown_fields): class StoragePoolArgs(Type): _toSchema = {'pools': 'pools'} _toPy = {'pools': 'pools'} + def __init__(self, pools=None, **unknown_fields): ''' pools : typing.Sequence[~StoragePool] @@ -24571,6 +25390,7 @@ def __init__(self, pools=None, **unknown_fields): class StoragePoolDeleteArg(Type): _toSchema = {'name': 'name'} _toPy = {'name': 'name'} + def __init__(self, name=None, **unknown_fields): ''' name : str @@ -24589,6 +25409,7 @@ def __init__(self, name=None, **unknown_fields): class StoragePoolDeleteArgs(Type): _toSchema = {'pools': 'pools'} _toPy = {'pools': 'pools'} + def __init__(self, pools=None, **unknown_fields): ''' pools : typing.Sequence[~StoragePoolDeleteArg] @@ -24607,6 +25428,7 @@ def __init__(self, pools=None, **unknown_fields): class StoragePoolFilter(Type): _toSchema = {'names': 'names', 'providers': 'providers'} _toPy = {'names': 'names', 'providers': 'providers'} + def __init__(self, names=None, providers=None, **unknown_fields): ''' names : typing.Sequence[str] @@ -24631,6 +25453,7 @@ def __init__(self, names=None, providers=None, **unknown_fields): class StoragePoolFilters(Type): _toSchema = {'filters': 'filters'} _toPy = {'filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): ''' filters : typing.Sequence[~StoragePoolFilter] @@ -24649,6 +25472,7 @@ def __init__(self, filters=None, **unknown_fields): class StoragePoolsResult(Type): _toSchema = {'error': 'error', 'storage_pools': 'storage-pools'} _toPy = {'error': 'error', 'storage-pools': 'storage_pools'} + def __init__(self, error=None, storage_pools=None, **unknown_fields): ''' error : Error @@ -24673,6 +25497,7 @@ def __init__(self, error=None, storage_pools=None, **unknown_fields): class StoragePoolsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~StoragePoolsResult] @@ -24691,6 +25516,7 @@ def __init__(self, results=None, **unknown_fields): class StoragesAddParams(Type): _toSchema = {'storages': 'storages'} _toPy = {'storages': 'storages'} + def __init__(self, storages=None, **unknown_fields): ''' storages : typing.Sequence[~StorageAddParams] @@ -24709,6 +25535,7 @@ def __init__(self, storages=None, **unknown_fields): class StringBoolResult(Type): _toSchema = {'error': 'error', 'ok': 'ok', 'result': 'result'} _toPy = {'error': 'error', 'ok': 'ok', 'result': 'result'} + def __init__(self, error=None, ok=None, result=None, **unknown_fields): ''' error : Error @@ -24739,6 +25566,7 @@ def __init__(self, error=None, ok=None, result=None, **unknown_fields): class StringBoolResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~StringBoolResult] @@ -24757,6 +25585,7 @@ def __init__(self, results=None, **unknown_fields): class StringResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -24781,6 +25610,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class StringResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~StringResult] @@ -24799,6 +25629,7 @@ def __init__(self, results=None, **unknown_fields): class StringsResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -24823,6 +25654,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class StringsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~StringsResult] @@ -24841,6 +25673,7 @@ def __init__(self, results=None, **unknown_fields): class StringsWatchResult(Type): _toSchema = {'changes': 'changes', 'error': 'error', 'watcher_id': 'watcher-id'} _toPy = {'changes': 'changes', 'error': 'error', 'watcher-id': 'watcher_id'} + def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): ''' changes : typing.Sequence[str] @@ -24871,6 +25704,7 @@ def __init__(self, changes=None, error=None, watcher_id=None, **unknown_fields): class StringsWatchResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~StringsWatchResult] @@ -24889,6 +25723,7 @@ def __init__(self, results=None, **unknown_fields): class Subnet(Type): _toSchema = {'cidr': 'cidr', 'life': 'life', 'provider_id': 'provider-id', 'provider_network_id': 'provider-network-id', 'provider_space_id': 'provider-space-id', 'space_tag': 'space-tag', 'status': 'status', 'vlan_tag': 'vlan-tag', 'zones': 'zones'} _toPy = {'cidr': 'cidr', 'life': 'life', 'provider-id': 'provider_id', 'provider-network-id': 'provider_network_id', 'provider-space-id': 'provider_space_id', 'space-tag': 'space_tag', 'status': 'status', 'vlan-tag': 'vlan_tag', 'zones': 'zones'} + def __init__(self, cidr=None, life=None, provider_id=None, provider_network_id=None, provider_space_id=None, space_tag=None, status=None, vlan_tag=None, zones=None, **unknown_fields): ''' cidr : str @@ -24955,6 +25790,7 @@ def __init__(self, cidr=None, life=None, provider_id=None, provider_network_id=N class SubnetV2(Type): _toSchema = {'cidr': 'cidr', 'id_': 'id', 'life': 'life', 'provider_id': 'provider-id', 'provider_network_id': 'provider-network-id', 'provider_space_id': 'provider-space-id', 'space_tag': 'space-tag', 'status': 'status', 'subnet': 'Subnet', 'vlan_tag': 'vlan-tag', 'zones': 'zones'} _toPy = {'Subnet': 'subnet', 'cidr': 'cidr', 'id': 'id_', 'life': 'life', 'provider-id': 'provider_id', 'provider-network-id': 'provider_network_id', 'provider-space-id': 'provider_space_id', 'space-tag': 'space_tag', 'status': 'status', 'vlan-tag': 'vlan_tag', 'zones': 'zones'} + def __init__(self, subnet=None, cidr=None, id_=None, life=None, provider_id=None, provider_network_id=None, provider_space_id=None, space_tag=None, status=None, vlan_tag=None, zones=None, **unknown_fields): ''' subnet : Subnet @@ -25033,6 +25869,7 @@ def __init__(self, subnet=None, cidr=None, id_=None, life=None, provider_id=None class SubnetV3(Type): _toSchema = {'cidr': 'cidr', 'fan_info': 'fan-info', 'id_': 'id', 'is_public': 'is-public', 'life': 'life', 'provider_id': 'provider-id', 'provider_network_id': 'provider-network-id', 'provider_space_id': 'provider-space-id', 'space_id': 'space-id', 'space_tag': 'space-tag', 'status': 'status', 'subnet': 'Subnet', 'subnetv2': 'SubnetV2', 'vlan_tag': 'vlan-tag', 'zones': 'zones'} _toPy = {'Subnet': 'subnet', 'SubnetV2': 'subnetv2', 'cidr': 'cidr', 'fan-info': 'fan_info', 'id': 'id_', 'is-public': 'is_public', 'life': 'life', 'provider-id': 'provider_id', 'provider-network-id': 'provider_network_id', 'provider-space-id': 'provider_space_id', 'space-id': 'space_id', 'space-tag': 'space_tag', 'status': 'status', 'vlan-tag': 'vlan_tag', 'zones': 'zones'} + def __init__(self, subnet=None, subnetv2=None, cidr=None, fan_info=None, id_=None, is_public=None, life=None, provider_id=None, provider_network_id=None, provider_space_id=None, space_id=None, space_tag=None, status=None, vlan_tag=None, zones=None, **unknown_fields): ''' subnet : Subnet @@ -25135,6 +25972,7 @@ def __init__(self, subnet=None, subnetv2=None, cidr=None, fan_info=None, id_=Non class SubnetsFilters(Type): _toSchema = {'space_tag': 'space-tag', 'zone': 'zone'} _toPy = {'space-tag': 'space_tag', 'zone': 'zone'} + def __init__(self, space_tag=None, zone=None, **unknown_fields): ''' space_tag : str @@ -25159,6 +25997,7 @@ def __init__(self, space_tag=None, zone=None, **unknown_fields): class SubnetsResult(Type): _toSchema = {'error': 'error', 'subnets': 'subnets'} _toPy = {'error': 'error', 'subnets': 'subnets'} + def __init__(self, error=None, subnets=None, **unknown_fields): ''' error : Error @@ -25183,6 +26022,7 @@ def __init__(self, error=None, subnets=None, **unknown_fields): class SubnetsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~SubnetsResult] @@ -25201,6 +26041,7 @@ def __init__(self, results=None, **unknown_fields): class SummaryWatcherID(Type): _toSchema = {'watcher_id': 'watcher-id'} _toPy = {'watcher-id': 'watcher_id'} + def __init__(self, watcher_id=None, **unknown_fields): ''' watcher_id : str @@ -25219,6 +26060,7 @@ def __init__(self, watcher_id=None, **unknown_fields): class SummaryWatcherNextResults(Type): _toSchema = {'models': 'models'} _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): ''' models : typing.Sequence[~ModelAbstract] @@ -25237,6 +26079,7 @@ def __init__(self, models=None, **unknown_fields): class SupportedFeature(Type): _toSchema = {'description': 'description', 'name': 'name', 'version': 'version'} _toPy = {'description': 'description', 'name': 'name', 'version': 'version'} + def __init__(self, description=None, name=None, version=None, **unknown_fields): ''' description : str @@ -25267,6 +26110,7 @@ def __init__(self, description=None, name=None, version=None, **unknown_fields): class TaggedCredential(Type): _toSchema = {'credential': 'credential', 'tag': 'tag'} _toPy = {'credential': 'credential', 'tag': 'tag'} + def __init__(self, credential=None, tag=None, **unknown_fields): ''' credential : CloudCredential @@ -25291,6 +26135,7 @@ def __init__(self, credential=None, tag=None, **unknown_fields): class TaggedCredentials(Type): _toSchema = {'credentials': 'credentials'} _toPy = {'credentials': 'credentials'} + def __init__(self, credentials=None, **unknown_fields): ''' credentials : typing.Sequence[~TaggedCredential] @@ -25309,6 +26154,7 @@ def __init__(self, credentials=None, **unknown_fields): class TokenResult(Type): _toSchema = {'error': 'error', 'token': 'token'} _toPy = {'error': 'error', 'token': 'token'} + def __init__(self, error=None, token=None, **unknown_fields): ''' error : Error @@ -25333,6 +26179,7 @@ def __init__(self, error=None, token=None, **unknown_fields): class TokenResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~TokenResult] @@ -25351,6 +26198,7 @@ def __init__(self, results=None, **unknown_fields): class Tools(Type): _toSchema = {'sha256': 'sha256', 'size': 'size', 'url': 'url', 'version': 'version'} _toPy = {'sha256': 'sha256', 'size': 'size', 'url': 'url', 'version': 'version'} + def __init__(self, sha256=None, size=None, url=None, version=None, **unknown_fields): ''' sha256 : str @@ -25387,6 +26235,7 @@ def __init__(self, sha256=None, size=None, url=None, version=None, **unknown_fie class ToolsResult(Type): _toSchema = {'error': 'error', 'tools': 'tools'} _toPy = {'error': 'error', 'tools': 'tools'} + def __init__(self, error=None, tools=None, **unknown_fields): ''' error : Error @@ -25411,6 +26260,7 @@ def __init__(self, error=None, tools=None, **unknown_fields): class ToolsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ToolsResult] @@ -25429,6 +26279,7 @@ def __init__(self, results=None, **unknown_fields): class TrackPayloadArgs(Type): _toSchema = {'payloads': 'payloads'} _toPy = {'payloads': 'payloads'} + def __init__(self, payloads=None, **unknown_fields): ''' payloads : typing.Sequence[~Payload] @@ -25447,6 +26298,7 @@ def __init__(self, payloads=None, **unknown_fields): class UndertakerModelInfo(Type): _toSchema = {'destroy_timeout': 'destroy-timeout', 'force_destroyed': 'force-destroyed', 'global_name': 'global-name', 'is_system': 'is-system', 'life': 'life', 'name': 'name', 'uuid': 'uuid'} _toPy = {'destroy-timeout': 'destroy_timeout', 'force-destroyed': 'force_destroyed', 'global-name': 'global_name', 'is-system': 'is_system', 'life': 'life', 'name': 'name', 'uuid': 'uuid'} + def __init__(self, destroy_timeout=None, force_destroyed=None, global_name=None, is_system=None, life=None, name=None, uuid=None, **unknown_fields): ''' destroy_timeout : int @@ -25501,6 +26353,7 @@ def __init__(self, destroy_timeout=None, force_destroyed=None, global_name=None, class UndertakerModelInfoResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -25525,6 +26378,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class UnitInfoResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -25549,6 +26403,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class UnitInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~UnitInfoResult] @@ -25567,6 +26422,7 @@ def __init__(self, results=None, **unknown_fields): class UnitRefreshResult(Type): _toSchema = {'error': 'Error', 'life': 'Life', 'provider_id': 'provider-id', 'resolved': 'Resolved'} _toPy = {'Error': 'error', 'Life': 'life', 'Resolved': 'resolved', 'provider-id': 'provider_id'} + def __init__(self, error=None, life=None, resolved=None, provider_id=None, **unknown_fields): ''' error : Error @@ -25603,6 +26459,7 @@ def __init__(self, error=None, life=None, resolved=None, provider_id=None, **unk class UnitRefreshResults(Type): _toSchema = {'results': 'Results'} _toPy = {'Results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~UnitRefreshResult] @@ -25621,6 +26478,7 @@ def __init__(self, results=None, **unknown_fields): class UnitResourceResult(Type): _toSchema = {'error': 'error', 'errorresult': 'ErrorResult', 'resource': 'resource'} _toPy = {'ErrorResult': 'errorresult', 'error': 'error', 'resource': 'resource'} + def __init__(self, errorresult=None, error=None, resource=None, **unknown_fields): ''' errorresult : ErrorResult @@ -25651,6 +26509,7 @@ def __init__(self, errorresult=None, error=None, resource=None, **unknown_fields class UnitResources(Type): _toSchema = {'download_progress': 'download-progress', 'entity': 'Entity', 'resources': 'resources', 'tag': 'tag'} _toPy = {'Entity': 'entity', 'download-progress': 'download_progress', 'resources': 'resources', 'tag': 'tag'} + def __init__(self, entity=None, download_progress=None, resources=None, tag=None, **unknown_fields): ''' entity : Entity @@ -25687,6 +26546,7 @@ def __init__(self, entity=None, download_progress=None, resources=None, tag=None class UnitResourcesResult(Type): _toSchema = {'error': 'error', 'errorresult': 'ErrorResult', 'resources': 'resources'} _toPy = {'ErrorResult': 'errorresult', 'error': 'error', 'resources': 'resources'} + def __init__(self, errorresult=None, error=None, resources=None, **unknown_fields): ''' errorresult : ErrorResult @@ -25717,6 +26577,7 @@ def __init__(self, errorresult=None, error=None, resources=None, **unknown_field class UnitResult(Type): _toSchema = {'address': 'address', 'charm': 'charm', 'leader': 'leader', 'life': 'life', 'machine': 'machine', 'opened_ports': 'opened-ports', 'provider_id': 'provider-id', 'public_address': 'public-address', 'relation_data': 'relation-data', 'tag': 'tag', 'workload_version': 'workload-version'} _toPy = {'address': 'address', 'charm': 'charm', 'leader': 'leader', 'life': 'life', 'machine': 'machine', 'opened-ports': 'opened_ports', 'provider-id': 'provider_id', 'public-address': 'public_address', 'relation-data': 'relation_data', 'tag': 'tag', 'workload-version': 'workload_version'} + def __init__(self, address=None, charm=None, leader=None, life=None, machine=None, opened_ports=None, provider_id=None, public_address=None, relation_data=None, tag=None, workload_version=None, **unknown_fields): ''' address : str @@ -25795,6 +26656,7 @@ def __init__(self, address=None, charm=None, leader=None, life=None, machine=Non class UnitSettings(Type): _toSchema = {'version': 'version'} _toPy = {'version': 'version'} + def __init__(self, version=None, **unknown_fields): ''' version : int @@ -25813,6 +26675,7 @@ def __init__(self, version=None, **unknown_fields): class UnitStateResult(Type): _toSchema = {'charm_state': 'charm-state', 'error': 'error', 'meter_status_state': 'meter-status-state', 'relation_state': 'relation-state', 'secret_state': 'secret-state', 'storage_state': 'storage-state', 'uniter_state': 'uniter-state'} _toPy = {'charm-state': 'charm_state', 'error': 'error', 'meter-status-state': 'meter_status_state', 'relation-state': 'relation_state', 'secret-state': 'secret_state', 'storage-state': 'storage_state', 'uniter-state': 'uniter_state'} + def __init__(self, charm_state=None, error=None, meter_status_state=None, relation_state=None, secret_state=None, storage_state=None, uniter_state=None, **unknown_fields): ''' charm_state : typing.Mapping[str, str] @@ -25867,6 +26730,7 @@ def __init__(self, charm_state=None, error=None, meter_status_state=None, relati class UnitStateResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~UnitStateResult] @@ -25885,6 +26749,7 @@ def __init__(self, results=None, **unknown_fields): class UnitStatus(Type): _toSchema = {'address': 'address', 'agent_status': 'agent-status', 'charm': 'charm', 'leader': 'leader', 'machine': 'machine', 'opened_ports': 'opened-ports', 'provider_id': 'provider-id', 'public_address': 'public-address', 'subordinates': 'subordinates', 'workload_status': 'workload-status', 'workload_version': 'workload-version'} _toPy = {'address': 'address', 'agent-status': 'agent_status', 'charm': 'charm', 'leader': 'leader', 'machine': 'machine', 'opened-ports': 'opened_ports', 'provider-id': 'provider_id', 'public-address': 'public_address', 'subordinates': 'subordinates', 'workload-status': 'workload_status', 'workload-version': 'workload_version'} + def __init__(self, address=None, agent_status=None, charm=None, leader=None, machine=None, opened_ports=None, provider_id=None, public_address=None, subordinates=None, workload_status=None, workload_version=None, **unknown_fields): ''' address : str @@ -25963,6 +26828,7 @@ def __init__(self, address=None, agent_status=None, charm=None, leader=None, mac class UnitsResolved(Type): _toSchema = {'all_': 'all', 'retry': 'retry', 'tags': 'tags'} _toPy = {'all': 'all_', 'retry': 'retry', 'tags': 'tags'} + def __init__(self, all_=None, retry=None, tags=None, **unknown_fields): ''' all_ : bool @@ -25993,6 +26859,7 @@ def __init__(self, all_=None, retry=None, tags=None, **unknown_fields): class UnsetModelDefaults(Type): _toSchema = {'keys': 'keys'} _toPy = {'keys': 'keys'} + def __init__(self, keys=None, **unknown_fields): ''' keys : typing.Sequence[~ModelUnsetKeys] @@ -26011,6 +26878,7 @@ def __init__(self, keys=None, **unknown_fields): class UpdateApplicationServiceArg(Type): _toSchema = {'addresses': 'addresses', 'application_tag': 'application-tag', 'generation': 'generation', 'provider_id': 'provider-id', 'scale': 'scale'} _toPy = {'addresses': 'addresses', 'application-tag': 'application_tag', 'generation': 'generation', 'provider-id': 'provider_id', 'scale': 'scale'} + def __init__(self, addresses=None, application_tag=None, generation=None, provider_id=None, scale=None, **unknown_fields): ''' addresses : typing.Sequence[~Address] @@ -26053,6 +26921,7 @@ def __init__(self, addresses=None, application_tag=None, generation=None, provid class UpdateApplicationServiceArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~UpdateApplicationServiceArg] @@ -26071,6 +26940,7 @@ def __init__(self, args=None, **unknown_fields): class UpdateApplicationUnitArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~UpdateApplicationUnits] @@ -26089,6 +26959,7 @@ def __init__(self, args=None, **unknown_fields): class UpdateApplicationUnitResult(Type): _toSchema = {'error': 'error', 'info': 'info'} _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): ''' error : Error @@ -26113,6 +26984,7 @@ def __init__(self, error=None, info=None, **unknown_fields): class UpdateApplicationUnitResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~UpdateApplicationUnitResult] @@ -26131,6 +27003,7 @@ def __init__(self, results=None, **unknown_fields): class UpdateApplicationUnits(Type): _toSchema = {'application_tag': 'application-tag', 'generation': 'generation', 'scale': 'scale', 'status': 'status', 'units': 'units'} _toPy = {'application-tag': 'application_tag', 'generation': 'generation', 'scale': 'scale', 'status': 'status', 'units': 'units'} + def __init__(self, application_tag=None, generation=None, scale=None, status=None, units=None, **unknown_fields): ''' application_tag : str @@ -26173,6 +27046,7 @@ def __init__(self, application_tag=None, generation=None, scale=None, status=Non class UpdateApplicationUnitsInfo(Type): _toSchema = {'units': 'units'} _toPy = {'units': 'units'} + def __init__(self, units=None, **unknown_fields): ''' units : typing.Sequence[~ApplicationUnitInfo] @@ -26191,6 +27065,7 @@ def __init__(self, units=None, **unknown_fields): class UpdateBehavior(Type): _toSchema = {'enable_os_refresh_update': 'enable-os-refresh-update', 'enable_os_upgrade': 'enable-os-upgrade'} _toPy = {'enable-os-refresh-update': 'enable_os_refresh_update', 'enable-os-upgrade': 'enable_os_upgrade'} + def __init__(self, enable_os_refresh_update=None, enable_os_upgrade=None, **unknown_fields): ''' enable_os_refresh_update : bool @@ -26215,6 +27090,7 @@ def __init__(self, enable_os_refresh_update=None, enable_os_upgrade=None, **unkn class UpdateChannelArg(Type): _toSchema = {'channel': 'channel', 'force': 'force', 'tag': 'tag'} _toPy = {'channel': 'channel', 'force': 'force', 'tag': 'tag'} + def __init__(self, channel=None, force=None, tag=None, **unknown_fields): ''' channel : str @@ -26245,6 +27121,7 @@ def __init__(self, channel=None, force=None, tag=None, **unknown_fields): class UpdateChannelArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~UpdateChannelArg] @@ -26263,6 +27140,7 @@ def __init__(self, args=None, **unknown_fields): class UpdateCloudArgs(Type): _toSchema = {'clouds': 'clouds'} _toPy = {'clouds': 'clouds'} + def __init__(self, clouds=None, **unknown_fields): ''' clouds : typing.Sequence[~AddCloudArgs] @@ -26281,6 +27159,7 @@ def __init__(self, clouds=None, **unknown_fields): class UpdateControllerForModel(Type): _toSchema = {'info': 'info', 'model_tag': 'model-tag'} _toPy = {'info': 'info', 'model-tag': 'model_tag'} + def __init__(self, info=None, model_tag=None, **unknown_fields): ''' info : ExternalControllerInfo @@ -26305,6 +27184,7 @@ def __init__(self, info=None, model_tag=None, **unknown_fields): class UpdateControllersForModelsParams(Type): _toSchema = {'changes': 'changes'} _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): ''' changes : typing.Sequence[~UpdateControllerForModel] @@ -26323,6 +27203,7 @@ def __init__(self, changes=None, **unknown_fields): class UpdateCredentialArgs(Type): _toSchema = {'credentials': 'credentials', 'force': 'force'} _toPy = {'credentials': 'credentials', 'force': 'force'} + def __init__(self, credentials=None, force=None, **unknown_fields): ''' credentials : typing.Sequence[~TaggedCredential] @@ -26347,6 +27228,7 @@ def __init__(self, credentials=None, force=None, **unknown_fields): class UpdateCredentialModelResult(Type): _toSchema = {'errors': 'errors', 'name': 'name', 'uuid': 'uuid'} _toPy = {'errors': 'errors', 'name': 'name', 'uuid': 'uuid'} + def __init__(self, errors=None, name=None, uuid=None, **unknown_fields): ''' errors : typing.Sequence[~ErrorResult] @@ -26377,6 +27259,7 @@ def __init__(self, errors=None, name=None, uuid=None, **unknown_fields): class UpdateCredentialResult(Type): _toSchema = {'error': 'error', 'models': 'models', 'tag': 'tag'} _toPy = {'error': 'error', 'models': 'models', 'tag': 'tag'} + def __init__(self, error=None, models=None, tag=None, **unknown_fields): ''' error : Error @@ -26407,6 +27290,7 @@ def __init__(self, error=None, models=None, tag=None, **unknown_fields): class UpdateCredentialResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~UpdateCredentialResult] @@ -26425,6 +27309,7 @@ def __init__(self, results=None, **unknown_fields): class UpdateSecretArg(Type): _toSchema = {'content': 'content', 'description': 'description', 'expire_time': 'expire-time', 'label': 'label', 'params': 'params', 'rotate_policy': 'rotate-policy', 'upsertsecretarg': 'UpsertSecretArg', 'uri': 'uri'} _toPy = {'UpsertSecretArg': 'upsertsecretarg', 'content': 'content', 'description': 'description', 'expire-time': 'expire_time', 'label': 'label', 'params': 'params', 'rotate-policy': 'rotate_policy', 'uri': 'uri'} + def __init__(self, upsertsecretarg=None, content=None, description=None, expire_time=None, label=None, params=None, rotate_policy=None, uri=None, **unknown_fields): ''' upsertsecretarg : UpsertSecretArg @@ -26485,6 +27370,7 @@ def __init__(self, upsertsecretarg=None, content=None, description=None, expire_ class UpdateSecretArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~UpdateSecretArg] @@ -26503,6 +27389,7 @@ def __init__(self, args=None, **unknown_fields): class UpdateSecretBackendArg(Type): _toSchema = {'config': 'config', 'force': 'force', 'name': 'name', 'name_change': 'name-change', 'reset': 'reset', 'token_rotate_interval': 'token-rotate-interval'} _toPy = {'config': 'config', 'force': 'force', 'name': 'name', 'name-change': 'name_change', 'reset': 'reset', 'token-rotate-interval': 'token_rotate_interval'} + def __init__(self, config=None, force=None, name=None, name_change=None, reset=None, token_rotate_interval=None, **unknown_fields): ''' config : typing.Mapping[str, typing.Any] @@ -26551,6 +27438,7 @@ def __init__(self, config=None, force=None, name=None, name_change=None, reset=N class UpdateSecretBackendArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~UpdateSecretBackendArg] @@ -26569,6 +27457,7 @@ def __init__(self, args=None, **unknown_fields): class UpdateUserSecretArg(Type): _toSchema = {'auto_prune': 'auto-prune', 'content': 'content', 'description': 'description', 'existing_label': 'existing-label', 'expire_time': 'expire-time', 'label': 'label', 'params': 'params', 'rotate_policy': 'rotate-policy', 'upsertsecretarg': 'UpsertSecretArg', 'uri': 'uri'} _toPy = {'UpsertSecretArg': 'upsertsecretarg', 'auto-prune': 'auto_prune', 'content': 'content', 'description': 'description', 'existing-label': 'existing_label', 'expire-time': 'expire_time', 'label': 'label', 'params': 'params', 'rotate-policy': 'rotate_policy', 'uri': 'uri'} + def __init__(self, upsertsecretarg=None, auto_prune=None, content=None, description=None, existing_label=None, expire_time=None, label=None, params=None, rotate_policy=None, uri=None, **unknown_fields): ''' upsertsecretarg : UpsertSecretArg @@ -26641,6 +27530,7 @@ def __init__(self, upsertsecretarg=None, auto_prune=None, content=None, descript class UpdateUserSecretArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~UpdateUserSecretArg] @@ -26659,6 +27549,7 @@ def __init__(self, args=None, **unknown_fields): class UpgradeModelParams(Type): _toSchema = {'agent_stream': 'agent-stream', 'dry_run': 'dry-run', 'ignore_agent_versions': 'ignore-agent-versions', 'model_tag': 'model-tag', 'target_version': 'target-version'} _toPy = {'agent-stream': 'agent_stream', 'dry-run': 'dry_run', 'ignore-agent-versions': 'ignore_agent_versions', 'model-tag': 'model_tag', 'target-version': 'target_version'} + def __init__(self, agent_stream=None, dry_run=None, ignore_agent_versions=None, model_tag=None, target_version=None, **unknown_fields): ''' agent_stream : str @@ -26701,6 +27592,7 @@ def __init__(self, agent_stream=None, dry_run=None, ignore_agent_versions=None, class UpgradeModelResult(Type): _toSchema = {'chosen_version': 'chosen-version', 'error': 'error'} _toPy = {'chosen-version': 'chosen_version', 'error': 'error'} + def __init__(self, chosen_version=None, error=None, **unknown_fields): ''' chosen_version : Number @@ -26725,6 +27617,7 @@ def __init__(self, chosen_version=None, error=None, **unknown_fields): class UpgradeSeriesNotificationParam(Type): _toSchema = {'entity': 'entity', 'watcher_id': 'watcher-id'} _toPy = {'entity': 'entity', 'watcher-id': 'watcher_id'} + def __init__(self, entity=None, watcher_id=None, **unknown_fields): ''' entity : Entity @@ -26749,6 +27642,7 @@ def __init__(self, entity=None, watcher_id=None, **unknown_fields): class UpgradeSeriesNotificationParams(Type): _toSchema = {'params': 'params'} _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): ''' params : typing.Sequence[~UpgradeSeriesNotificationParam] @@ -26767,6 +27661,7 @@ def __init__(self, params=None, **unknown_fields): class UpgradeSeriesStartUnitCompletionParam(Type): _toSchema = {'entities': 'entities', 'message': 'message'} _toPy = {'entities': 'entities', 'message': 'message'} + def __init__(self, entities=None, message=None, **unknown_fields): ''' entities : typing.Sequence[~Entity] @@ -26791,6 +27686,7 @@ def __init__(self, entities=None, message=None, **unknown_fields): class UpgradeSeriesStatusParam(Type): _toSchema = {'entity': 'entity', 'message': 'message', 'status': 'status'} _toPy = {'entity': 'entity', 'message': 'message', 'status': 'status'} + def __init__(self, entity=None, message=None, status=None, **unknown_fields): ''' entity : Entity @@ -26821,6 +27717,7 @@ def __init__(self, entity=None, message=None, status=None, **unknown_fields): class UpgradeSeriesStatusParams(Type): _toSchema = {'params': 'params'} _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): ''' params : typing.Sequence[~UpgradeSeriesStatusParam] @@ -26839,6 +27736,7 @@ def __init__(self, params=None, **unknown_fields): class UpgradeSeriesStatusResult(Type): _toSchema = {'error': 'error', 'status': 'status', 'target': 'target'} _toPy = {'error': 'error', 'status': 'status', 'target': 'target'} + def __init__(self, error=None, status=None, target=None, **unknown_fields): ''' error : Error @@ -26869,6 +27767,7 @@ def __init__(self, error=None, status=None, target=None, **unknown_fields): class UpgradeSeriesStatusResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~UpgradeSeriesStatusResult] @@ -26887,6 +27786,7 @@ def __init__(self, results=None, **unknown_fields): class UpgradeSeriesUnitsResult(Type): _toSchema = {'error': 'error', 'unit_names': 'unit-names'} _toPy = {'error': 'error', 'unit-names': 'unit_names'} + def __init__(self, error=None, unit_names=None, **unknown_fields): ''' error : Error @@ -26911,6 +27811,7 @@ def __init__(self, error=None, unit_names=None, **unknown_fields): class UpgradeSeriesUnitsResults(Type): _toSchema = {'results': 'Results'} _toPy = {'Results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~UpgradeSeriesUnitsResult] @@ -26929,6 +27830,7 @@ def __init__(self, results=None, **unknown_fields): class UpsertSecretArg(Type): _toSchema = {'content': 'content', 'description': 'description', 'expire_time': 'expire-time', 'label': 'label', 'params': 'params', 'rotate_policy': 'rotate-policy'} _toPy = {'content': 'content', 'description': 'description', 'expire-time': 'expire_time', 'label': 'label', 'params': 'params', 'rotate-policy': 'rotate_policy'} + def __init__(self, content=None, description=None, expire_time=None, label=None, params=None, rotate_policy=None, **unknown_fields): ''' content : SecretContentParams @@ -26977,6 +27879,7 @@ def __init__(self, content=None, description=None, expire_time=None, label=None, class UserAccess(Type): _toSchema = {'access': 'access', 'user_tag': 'user-tag'} _toPy = {'access': 'access', 'user-tag': 'user_tag'} + def __init__(self, access=None, user_tag=None, **unknown_fields): ''' access : str @@ -27001,6 +27904,7 @@ def __init__(self, access=None, user_tag=None, **unknown_fields): class UserAccessResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -27025,6 +27929,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class UserAccessResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~UserAccessResult] @@ -27043,6 +27948,7 @@ def __init__(self, results=None, **unknown_fields): class UserCloud(Type): _toSchema = {'cloud_tag': 'cloud-tag', 'user_tag': 'user-tag'} _toPy = {'cloud-tag': 'cloud_tag', 'user-tag': 'user_tag'} + def __init__(self, cloud_tag=None, user_tag=None, **unknown_fields): ''' cloud_tag : str @@ -27067,6 +27973,7 @@ def __init__(self, cloud_tag=None, user_tag=None, **unknown_fields): class UserClouds(Type): _toSchema = {'user_clouds': 'user-clouds'} _toPy = {'user-clouds': 'user_clouds'} + def __init__(self, user_clouds=None, **unknown_fields): ''' user_clouds : typing.Sequence[~UserCloud] @@ -27085,6 +27992,7 @@ def __init__(self, user_clouds=None, **unknown_fields): class UserInfo(Type): _toSchema = {'access': 'access', 'created_by': 'created-by', 'date_created': 'date-created', 'disabled': 'disabled', 'display_name': 'display-name', 'last_connection': 'last-connection', 'username': 'username'} _toPy = {'access': 'access', 'created-by': 'created_by', 'date-created': 'date_created', 'disabled': 'disabled', 'display-name': 'display_name', 'last-connection': 'last_connection', 'username': 'username'} + def __init__(self, access=None, created_by=None, date_created=None, disabled=None, display_name=None, last_connection=None, username=None, **unknown_fields): ''' access : str @@ -27139,6 +28047,7 @@ def __init__(self, access=None, created_by=None, date_created=None, disabled=Non class UserInfoRequest(Type): _toSchema = {'entities': 'entities', 'include_disabled': 'include-disabled'} _toPy = {'entities': 'entities', 'include-disabled': 'include_disabled'} + def __init__(self, entities=None, include_disabled=None, **unknown_fields): ''' entities : typing.Sequence[~Entity] @@ -27163,6 +28072,7 @@ def __init__(self, entities=None, include_disabled=None, **unknown_fields): class UserInfoResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -27187,6 +28097,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class UserInfoResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~UserInfoResult] @@ -27205,6 +28116,7 @@ def __init__(self, results=None, **unknown_fields): class UserModel(Type): _toSchema = {'last_connection': 'last-connection', 'model': 'model'} _toPy = {'last-connection': 'last_connection', 'model': 'model'} + def __init__(self, last_connection=None, model=None, **unknown_fields): ''' last_connection : str @@ -27229,6 +28141,7 @@ def __init__(self, last_connection=None, model=None, **unknown_fields): class UserModelList(Type): _toSchema = {'user_models': 'user-models'} _toPy = {'user-models': 'user_models'} + def __init__(self, user_models=None, **unknown_fields): ''' user_models : typing.Sequence[~UserModel] @@ -27247,6 +28160,7 @@ def __init__(self, user_models=None, **unknown_fields): class Value(Type): _toSchema = {'allocate_public_ip': 'allocate-public-ip', 'arch': 'arch', 'container': 'container', 'cores': 'cores', 'cpu_power': 'cpu-power', 'image_id': 'image-id', 'instance_role': 'instance-role', 'instance_type': 'instance-type', 'mem': 'mem', 'root_disk': 'root-disk', 'root_disk_source': 'root-disk-source', 'spaces': 'spaces', 'tags': 'tags', 'virt_type': 'virt-type', 'zones': 'zones'} _toPy = {'allocate-public-ip': 'allocate_public_ip', 'arch': 'arch', 'container': 'container', 'cores': 'cores', 'cpu-power': 'cpu_power', 'image-id': 'image_id', 'instance-role': 'instance_role', 'instance-type': 'instance_type', 'mem': 'mem', 'root-disk': 'root_disk', 'root-disk-source': 'root_disk_source', 'spaces': 'spaces', 'tags': 'tags', 'virt-type': 'virt_type', 'zones': 'zones'} + def __init__(self, allocate_public_ip=None, arch=None, container=None, cores=None, cpu_power=None, image_id=None, instance_role=None, instance_type=None, mem=None, root_disk=None, root_disk_source=None, spaces=None, tags=None, virt_type=None, zones=None, **unknown_fields): ''' allocate_public_ip : bool @@ -27349,6 +28263,7 @@ def __init__(self, allocate_public_ip=None, arch=None, container=None, cores=Non class Version(Type): _toSchema = {'version': 'version'} _toPy = {'version': 'version'} + def __init__(self, version=None, **unknown_fields): ''' version : Binary @@ -27367,6 +28282,7 @@ def __init__(self, version=None, **unknown_fields): class VersionResult(Type): _toSchema = {'error': 'error', 'version': 'version'} _toPy = {'error': 'error', 'version': 'version'} + def __init__(self, error=None, version=None, **unknown_fields): ''' error : Error @@ -27391,6 +28307,7 @@ def __init__(self, error=None, version=None, **unknown_fields): class VersionResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~VersionResult] @@ -27409,6 +28326,7 @@ def __init__(self, results=None, **unknown_fields): class Volume(Type): _toSchema = {'info': 'info', 'volume_tag': 'volume-tag'} _toPy = {'info': 'info', 'volume-tag': 'volume_tag'} + def __init__(self, info=None, volume_tag=None, **unknown_fields): ''' info : VolumeInfo @@ -27433,6 +28351,7 @@ def __init__(self, info=None, volume_tag=None, **unknown_fields): class VolumeAttachment(Type): _toSchema = {'info': 'info', 'machine_tag': 'machine-tag', 'volume_tag': 'volume-tag'} _toPy = {'info': 'info', 'machine-tag': 'machine_tag', 'volume-tag': 'volume_tag'} + def __init__(self, info=None, machine_tag=None, volume_tag=None, **unknown_fields): ''' info : VolumeAttachmentInfo @@ -27463,6 +28382,7 @@ def __init__(self, info=None, machine_tag=None, volume_tag=None, **unknown_field class VolumeAttachmentDetails(Type): _toSchema = {'bus_address': 'bus-address', 'device_link': 'device-link', 'device_name': 'device-name', 'life': 'life', 'plan_info': 'plan-info', 'read_only': 'read-only', 'volumeattachmentinfo': 'VolumeAttachmentInfo'} _toPy = {'VolumeAttachmentInfo': 'volumeattachmentinfo', 'bus-address': 'bus_address', 'device-link': 'device_link', 'device-name': 'device_name', 'life': 'life', 'plan-info': 'plan_info', 'read-only': 'read_only'} + def __init__(self, volumeattachmentinfo=None, bus_address=None, device_link=None, device_name=None, life=None, plan_info=None, read_only=None, **unknown_fields): ''' volumeattachmentinfo : VolumeAttachmentInfo @@ -27517,6 +28437,7 @@ def __init__(self, volumeattachmentinfo=None, bus_address=None, device_link=None class VolumeAttachmentInfo(Type): _toSchema = {'bus_address': 'bus-address', 'device_link': 'device-link', 'device_name': 'device-name', 'plan_info': 'plan-info', 'read_only': 'read-only'} _toPy = {'bus-address': 'bus_address', 'device-link': 'device_link', 'device-name': 'device_name', 'plan-info': 'plan_info', 'read-only': 'read_only'} + def __init__(self, bus_address=None, device_link=None, device_name=None, plan_info=None, read_only=None, **unknown_fields): ''' bus_address : str @@ -27559,6 +28480,7 @@ def __init__(self, bus_address=None, device_link=None, device_name=None, plan_in class VolumeAttachmentParams(Type): _toSchema = {'instance_id': 'instance-id', 'machine_tag': 'machine-tag', 'provider': 'provider', 'read_only': 'read-only', 'volume_id': 'volume-id', 'volume_tag': 'volume-tag'} _toPy = {'instance-id': 'instance_id', 'machine-tag': 'machine_tag', 'provider': 'provider', 'read-only': 'read_only', 'volume-id': 'volume_id', 'volume-tag': 'volume_tag'} + def __init__(self, instance_id=None, machine_tag=None, provider=None, read_only=None, volume_id=None, volume_tag=None, **unknown_fields): ''' instance_id : str @@ -27607,6 +28529,7 @@ def __init__(self, instance_id=None, machine_tag=None, provider=None, read_only= class VolumeAttachmentParamsResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -27631,6 +28554,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class VolumeAttachmentParamsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~VolumeAttachmentParamsResult] @@ -27649,6 +28573,7 @@ def __init__(self, results=None, **unknown_fields): class VolumeAttachmentPlan(Type): _toSchema = {'block_device': 'block-device', 'life': 'life', 'machine_tag': 'machine-tag', 'plan_info': 'plan-info', 'volume_tag': 'volume-tag'} _toPy = {'block-device': 'block_device', 'life': 'life', 'machine-tag': 'machine_tag', 'plan-info': 'plan_info', 'volume-tag': 'volume_tag'} + def __init__(self, block_device=None, life=None, machine_tag=None, plan_info=None, volume_tag=None, **unknown_fields): ''' block_device : BlockDevice @@ -27691,6 +28616,7 @@ def __init__(self, block_device=None, life=None, machine_tag=None, plan_info=Non class VolumeAttachmentPlanInfo(Type): _toSchema = {'device_attributes': 'device-attributes', 'device_type': 'device-type'} _toPy = {'device-attributes': 'device_attributes', 'device-type': 'device_type'} + def __init__(self, device_attributes=None, device_type=None, **unknown_fields): ''' device_attributes : typing.Mapping[str, str] @@ -27715,6 +28641,7 @@ def __init__(self, device_attributes=None, device_type=None, **unknown_fields): class VolumeAttachmentPlanResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -27739,6 +28666,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class VolumeAttachmentPlanResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~VolumeAttachmentPlanResult] @@ -27757,6 +28685,7 @@ def __init__(self, results=None, **unknown_fields): class VolumeAttachmentPlans(Type): _toSchema = {'volume_plans': 'volume-plans'} _toPy = {'volume-plans': 'volume_plans'} + def __init__(self, volume_plans=None, **unknown_fields): ''' volume_plans : typing.Sequence[~VolumeAttachmentPlan] @@ -27775,6 +28704,7 @@ def __init__(self, volume_plans=None, **unknown_fields): class VolumeAttachmentResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -27799,6 +28729,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class VolumeAttachmentResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~VolumeAttachmentResult] @@ -27817,6 +28748,7 @@ def __init__(self, results=None, **unknown_fields): class VolumeAttachments(Type): _toSchema = {'volume_attachments': 'volume-attachments'} _toPy = {'volume-attachments': 'volume_attachments'} + def __init__(self, volume_attachments=None, **unknown_fields): ''' volume_attachments : typing.Sequence[~VolumeAttachment] @@ -27835,6 +28767,7 @@ def __init__(self, volume_attachments=None, **unknown_fields): class VolumeDetails(Type): _toSchema = {'info': 'info', 'life': 'life', 'machine_attachments': 'machine-attachments', 'status': 'status', 'storage': 'storage', 'unit_attachments': 'unit-attachments', 'volume_tag': 'volume-tag'} _toPy = {'info': 'info', 'life': 'life', 'machine-attachments': 'machine_attachments', 'status': 'status', 'storage': 'storage', 'unit-attachments': 'unit_attachments', 'volume-tag': 'volume_tag'} + def __init__(self, info=None, life=None, machine_attachments=None, status=None, storage=None, unit_attachments=None, volume_tag=None, **unknown_fields): ''' info : VolumeInfo @@ -27889,6 +28822,7 @@ def __init__(self, info=None, life=None, machine_attachments=None, status=None, class VolumeDetailsListResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -27913,6 +28847,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class VolumeDetailsListResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~VolumeDetailsListResult] @@ -27931,6 +28866,7 @@ def __init__(self, results=None, **unknown_fields): class VolumeFilter(Type): _toSchema = {'machines': 'machines'} _toPy = {'machines': 'machines'} + def __init__(self, machines=None, **unknown_fields): ''' machines : typing.Sequence[str] @@ -27949,6 +28885,7 @@ def __init__(self, machines=None, **unknown_fields): class VolumeFilters(Type): _toSchema = {'filters': 'filters'} _toPy = {'filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): ''' filters : typing.Sequence[~VolumeFilter] @@ -27967,6 +28904,7 @@ def __init__(self, filters=None, **unknown_fields): class VolumeInfo(Type): _toSchema = {'hardware_id': 'hardware-id', 'persistent': 'persistent', 'pool': 'pool', 'size': 'size', 'volume_id': 'volume-id', 'wwn': 'wwn'} _toPy = {'hardware-id': 'hardware_id', 'persistent': 'persistent', 'pool': 'pool', 'size': 'size', 'volume-id': 'volume_id', 'wwn': 'wwn'} + def __init__(self, hardware_id=None, persistent=None, pool=None, size=None, volume_id=None, wwn=None, **unknown_fields): ''' hardware_id : str @@ -28015,6 +28953,7 @@ def __init__(self, hardware_id=None, persistent=None, pool=None, size=None, volu class VolumeParams(Type): _toSchema = {'attachment': 'attachment', 'attributes': 'attributes', 'provider': 'provider', 'size': 'size', 'tags': 'tags', 'volume_tag': 'volume-tag'} _toPy = {'attachment': 'attachment', 'attributes': 'attributes', 'provider': 'provider', 'size': 'size', 'tags': 'tags', 'volume-tag': 'volume_tag'} + def __init__(self, attachment=None, attributes=None, provider=None, size=None, tags=None, volume_tag=None, **unknown_fields): ''' attachment : VolumeAttachmentParams @@ -28063,6 +29002,7 @@ def __init__(self, attachment=None, attributes=None, provider=None, size=None, t class VolumeParamsResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -28087,6 +29027,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class VolumeParamsResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~VolumeParamsResult] @@ -28105,6 +29046,7 @@ def __init__(self, results=None, **unknown_fields): class VolumeResult(Type): _toSchema = {'error': 'error', 'result': 'result'} _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): ''' error : Error @@ -28129,6 +29071,7 @@ def __init__(self, error=None, result=None, **unknown_fields): class VolumeResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~VolumeResult] @@ -28147,6 +29090,7 @@ def __init__(self, results=None, **unknown_fields): class Volumes(Type): _toSchema = {'volumes': 'volumes'} _toPy = {'volumes': 'volumes'} + def __init__(self, volumes=None, **unknown_fields): ''' volumes : typing.Sequence[~Volume] @@ -28165,6 +29109,7 @@ def __init__(self, volumes=None, **unknown_fields): class WatchContainer(Type): _toSchema = {'container_type': 'container-type', 'machine_tag': 'machine-tag'} _toPy = {'container-type': 'container_type', 'machine-tag': 'machine_tag'} + def __init__(self, container_type=None, machine_tag=None, **unknown_fields): ''' container_type : str @@ -28189,6 +29134,7 @@ def __init__(self, container_type=None, machine_tag=None, **unknown_fields): class WatchContainerStartArg(Type): _toSchema = {'container': 'container', 'entity': 'entity'} _toPy = {'container': 'container', 'entity': 'entity'} + def __init__(self, container=None, entity=None, **unknown_fields): ''' container : str @@ -28213,6 +29159,7 @@ def __init__(self, container=None, entity=None, **unknown_fields): class WatchContainerStartArgs(Type): _toSchema = {'args': 'args'} _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): ''' args : typing.Sequence[~WatchContainerStartArg] @@ -28231,6 +29178,7 @@ def __init__(self, args=None, **unknown_fields): class WatchContainers(Type): _toSchema = {'params': 'params'} _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): ''' params : typing.Sequence[~WatchContainer] @@ -28249,6 +29197,7 @@ def __init__(self, params=None, **unknown_fields): class WatchRemoteSecretChangesArg(Type): _toSchema = {'application_token': 'application-token', 'bakery_version': 'bakery-version', 'macaroons': 'macaroons', 'relation_token': 'relation-token'} _toPy = {'application-token': 'application_token', 'bakery-version': 'bakery_version', 'macaroons': 'macaroons', 'relation-token': 'relation_token'} + def __init__(self, application_token=None, bakery_version=None, macaroons=None, relation_token=None, **unknown_fields): ''' application_token : str @@ -28285,6 +29234,7 @@ def __init__(self, application_token=None, bakery_version=None, macaroons=None, class WatchRemoteSecretChangesArgs(Type): _toSchema = {'relations': 'relations'} _toPy = {'relations': 'relations'} + def __init__(self, relations=None, **unknown_fields): ''' relations : typing.Sequence[~WatchRemoteSecretChangesArg] @@ -28303,6 +29253,7 @@ def __init__(self, relations=None, **unknown_fields): class ZoneResult(Type): _toSchema = {'available': 'available', 'error': 'error', 'name': 'name'} _toPy = {'available': 'available', 'error': 'error', 'name': 'name'} + def __init__(self, available=None, error=None, name=None, **unknown_fields): ''' available : bool @@ -28333,6 +29284,7 @@ def __init__(self, available=None, error=None, name=None, **unknown_fields): class ZoneResults(Type): _toSchema = {'results': 'results'} _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): ''' results : typing.Sequence[~ZoneResult] From 342f811dd2338038b64317673684a31b20295d87 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Fri, 13 Sep 2024 17:53:31 +0900 Subject: [PATCH 26/29] wip --- juju/application.py | 81 ++++++++++++++++++++++++++++++++++++++++--- juju/client/facade.py | 2 +- juju/model.py | 19 +++++++--- sample.py | 32 ++++++++++++++--- 4 files changed, 119 insertions(+), 15 deletions(-) diff --git a/juju/application.py b/juju/application.py index 6d2d918e..28fb3ff2 100644 --- a/juju/application.py +++ b/juju/application.py @@ -1,17 +1,18 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. +import copy import hashlib import json import logging -import typing +from typing import Any, List from pathlib import Path import juju.client.facade from . import jasyncio, model, tag, utils from .annotationhelper import _get_annotations, _set_annotations from .bundle import get_charm_series, is_local_charm -from .client import client +from .client import client, _definitions from .errors import JujuApplicationConfigError, JujuError from .origin import Channel from .placement import parse as parse_placement @@ -23,11 +24,44 @@ log = logging.getLogger(__name__) +""" +# juju:rpc/params/multiwatcher.go + +// StatusInfo holds the unit and machine status information. It is +// used by ApplicationInfo and UnitInfo. +type StatusInfo struct { + Err error `json:"err,omitempty"` + Current status.Status `json:"current"` + Message string `json:"message"` + Since *time.Time `json:"since,omitempty"` + Version string `json:"version"` + Data map[string]interface{} `json:"data,omitempty"` +} + +// ApplicationInfo holds the information about an application that is tracked +// by multiwatcherStore. +type ApplicationInfo struct { + ModelUUID string `json:"model-uuid"` + Name string `json:"name"` + Exposed bool `json:"exposed"` + CharmURL string `json:"charm-url"` + OwnerTag string `json:"owner-tag"` + Life life.Value `json:"life"` + MinUnits int `json:"min-units"` + Constraints constraints.Value `json:"constraints"` + Config map[string]interface{} `json:"config,omitempty"` + Subordinate bool `json:"subordinate"` + Status StatusInfo `json:"status"` + WorkloadVersion string `json:"workload-version"` +} +""" + +_FIXME = object() class Application(model.ModelEntity): # What safe data usually contains _expected_attributes = [ - "model_uuid", + "model_uuid", # FIXME is it even useful? There's always a link to the model. "name", "exposed", "charm_url", @@ -39,8 +73,42 @@ class Application(model.ModelEntity): "status", "workload_version", ] + + model_uuid: str + name: str + exposed: bool # present on ApplicationResult, ApplicationStatus + charm_url: str + owner_tag: str # This is weird, present on Model, Secret, Storage, ApplicationOffer, MigrationModel; not app + life: Any # Life, present on ApplicationStatus + min_units: int + constraints: _definitions.Value + config: dict[str, Any] # json-able # FIXME may be omitted + subordinate: bool + # status: Any # Status # @property + workload_version: str # e.g. ApplicationStatus, maybe EntityXxx + _pk: str|int + def _facade_to_data(self, obj: juju.client.facade.Type) -> dict: + value = obj.serialize() + rv = { + "name": value.pop("application"), + "exposed": _FIXME, + "charm_url": value.pop("charm"), + "owner_tag": _FIXME, + "life": _FIXME, + "min_units": _FIXME, + "constraints": _definitions.Value.from_json(value.pop("constraints")), + "subordinate": _FIXME, + "status": _FIXME, # needs a separate API call + "workload_version": _FIXME, + } + __import__("pdb").set_trace() + if value: + logging.info("Unused Application.Get fields %s", list(value)) + logging.debug("Unused Application.Get data %s", value) + return rv + @property def _unit_match_pattern(self): return r'^{}.*$'.format(self.entity_id) @@ -83,7 +151,7 @@ def subordinate_units(self): return [u for u in self.units if u.is_subordinate] @property - def relations(self) -> typing.List[Relation]: + def relations(self) -> List[Relation]: return [rel for rel in self.model.relations if rel.matches(self.name)] def related_applications(self, endpoint_name=None): @@ -107,6 +175,9 @@ def status(self): If the application is unknown it will attempt to derive the unit workload status and highlight the most relevant (severity). """ + # FIXME how to undo this mess? + # users rely on status subscript + # users may rely on status inference from units status = self.safe_data['status']['current'] if status == "unset": known_statuses = [] @@ -598,7 +669,7 @@ def charm_name(self): return URL.parse(self.charm_url).name @property - def charm_url(self): + def __fixme_remove_charm_url(self): """Get the charm url for this application :return str: The charm url diff --git a/juju/client/facade.py b/juju/client/facade.py index 7d5c5218..b3933f82 100644 --- a/juju/client/facade.py +++ b/juju/client/facade.py @@ -788,7 +788,7 @@ def _parse_nested_list_entry(expr, result_dict): return cls(**d) return None - def serialize(self): + def serialize(self) -> dict: d = {} for attr, tgt in self._toSchema.items(): d[tgt] = getattr(self, attr) diff --git a/juju/model.py b/juju/model.py index 90afeb94..5089fcd7 100644 --- a/juju/model.py +++ b/juju/model.py @@ -20,6 +20,7 @@ from datetime import datetime, timedelta from functools import partial from pathlib import Path +from typing import Any import yaml import websockets @@ -28,7 +29,7 @@ from .annotationhelper import _get_annotations, _set_annotations from .bundle import BundleHandler, get_charm_series, is_local_charm from .charmhub import CharmHub -from .client import client, connector +from .client import client, connector, facade from .client.connection import Connection from .client.overrides import Caveat, Macaroon from .constraints import parse as parse_constraints @@ -261,6 +262,7 @@ def get_entity( class ModelEntity: """An object in the Model tree""" + entity_id: str _sync_cache: _SyncCache def __init__(self, entity_id, model, history_index=-1, connected=True): @@ -287,7 +289,10 @@ def __repr__(self): return '<{} entity_id="{}">'.format(type(self).__name__, self.entity_id) - def __getattr__(self, name): + def _facade_to_data(self, obj: facade.Type) -> dict: + raise NotImplementedError() + + def __getattr__(self, name: str) -> Any: """Fetch object attributes from the underlying data dict held in the model. @@ -302,7 +307,7 @@ def __getattr__(self, name): if self._sync_cache.stale: try: - self._sync_cache.update(value=facade.sync_Get(self.entity_id)) + self._sync_cache.update(value=self._facade_to_data(facade.sync_Get(self.entity_id))) #print("", self._sync_cache.value.__dict__.keys()) #print("", self._expected_attributes) except Exception as e: @@ -311,7 +316,13 @@ def __getattr__(self, name): if self._sync_cache.exception: raise self._sync_cache.exception - return getattr(self._sync_cache.value, name) + old = self.safe_data.get(name, self.safe_data.get(name.replace("_", "-"), "unknown")) + new = self._sync_cache.value[name] + if old != new: + logging.warning("%s.%s: value mismatch old %r new %r", self.__class__.__name__, name, old, new) + return old + else: + return new # End of hack try: diff --git a/sample.py b/sample.py index 0b92d427..013e13b6 100644 --- a/sample.py +++ b/sample.py @@ -12,10 +12,17 @@ async def main(): sync_facade = client.ApplicationFacade.from_sync_connection(m.sync_connection()) for app_name in m.applications: print() - print(m.applications[app_name].constraints.arch) - print(m.applications[app_name].constraints.arch) - print(m.applications[app_name].constraints.arch) - print(m.applications[app_name].constraints.arch) + # print(m.applications[app_name].constraints.arch) # temporarily broken, but why? + print(m.applications[app_name].name) + print(m.applications[app_name].exposed) + print(m.applications[app_name].charm_url) + print(m.applications[app_name].owner_tag) + # print(m.applications[app_name].life) + print(m.applications[app_name].min_units) + print(m.applications[app_name].constraints) + print(m.applications[app_name].subordinate) + # print(m.applications[app_name].status) + print(m.applications[app_name].workload_version) print() app = await app_facade.Get(app_name) @@ -24,6 +31,21 @@ async def main(): print(app.application, app.charm, app.constraints.arch) +class SymbolFilter(logging.Filter): + DEBUG = '🐛' + INFO = 'ℹī¸' + WARNING = '⚠ī¸' + ERROR = '❌' + CRITICAL = 'đŸ”Ĩ' + + def filter(self, record): + record.symbol = getattr(self, record.levelname, '#') + # FIXME can control log record origin here if needed + return True + + if __name__ == "__main__": - logging.basicConfig(level="INFO", format="ℹī¸ %(message)s") + # FIXME why is level=DEBUG broken? + logging.basicConfig(level="INFO", format="%(symbol)s %(message)s") + logging.root.addFilter(SymbolFilter()) jasyncio.run(main()) From 0771a65b7d6797d83f9aef1182dd75c0b324a62d Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Tue, 17 Sep 2024 13:35:54 +0900 Subject: [PATCH 27/29] plug #1100 local_refresh type --- juju/application.py | 49 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/juju/application.py b/juju/application.py index 28fb3ff2..b836d8e8 100644 --- a/juju/application.py +++ b/juju/application.py @@ -1,12 +1,12 @@ # Copyright 2023 Canonical Ltd. # Licensed under the Apache V2, see LICENCE file for details. -import copy import hashlib import json import logging +import pathlib +import warnings from typing import Any, List -from pathlib import Path import juju.client.facade from . import jasyncio, model, tag, utils @@ -78,9 +78,9 @@ class Application(model.ModelEntity): name: str exposed: bool # present on ApplicationResult, ApplicationStatus charm_url: str - owner_tag: str # This is weird, present on Model, Secret, Storage, ApplicationOffer, MigrationModel; not app + # owner_tag: str # This is weird, present on Model, Secret, Storage, ApplicationOffer, MigrationModel; not app life: Any # Life, present on ApplicationStatus - min_units: int + # min_units: int constraints: _definitions.Value config: dict[str, Any] # json-able # FIXME may be omitted subordinate: bool @@ -138,6 +138,24 @@ def on_unit_remove(self, callable_): self.model.add_observer( callable_, 'unit', 'remove', self._unit_match_pattern) + @property + def min_units(self) -> int: + warnings.warn( + "`Application.min_units` is deprecated and will soon be removed", + DeprecationWarning, + stacklevel=2, + ) + return self.__getattr__("min_units") + + @property + def owner_tag(self) -> str: + warnings.warn( + "`Application.owner_tag` is deprecated and will soon be removed", + DeprecationWarning, + stacklevel=2, + ) + return self.__getattr__("owner_tag") + @property def units(self): return [ @@ -750,7 +768,7 @@ async def set_constraints(self, constraints): async def refresh( self, channel=None, force=False, force_series=False, force_units=False, - path=None, resources=None, revision=None, switch=None): + path: str|None =None, resources=None, revision=None, switch: str|None =None): """Refresh the charm for this application. :param str channel: Channel to use when getting the charm from the @@ -786,8 +804,9 @@ async def refresh( current_origin = charm_url_origin_result.charm_origin if path is not None or (switch is not None and is_local_charm(switch)): - await self.local_refresh(current_origin, force, force_series, - force_units, path or switch, resources) + charm_path: str = path or switch # type: ignore # validated above + await self.local_refresh(charm_origin=current_origin, force=force, force_series=force_series, + force_units=force_units, path=charm_path, resources=resources) return origin = _refresh_origin(current_origin, channel, revision) @@ -913,9 +932,15 @@ async def refresh( upgrade_charm = refresh async def local_refresh( - self, charm_origin=None, force=False, force_series=False, + self, + *, + charm_origin: _definitions.CharmOrigin, + force=False, + force_series=False, force_units=False, - path=None, resources=None): + path: str, + resources=None, + ): """Refresh the charm for this application with a local charm. :param dict charm_origin: The charm origin of the destination charm @@ -933,8 +958,8 @@ async def local_refresh( if isinstance(path, str) and path.startswith("local:"): path = path[6:] - path = Path(path) - charm_dir = path.expanduser().resolve() + charm_path = pathlib.Path(path) + charm_dir = charm_path.expanduser().resolve() model_config = await self.get_config() series = ( @@ -950,7 +975,7 @@ async def local_refresh( if default_series: series = default_series.value charm_url = await self.model.add_local_charm_dir(charm_dir, series) - metadata = utils.get_local_charm_metadata(path) + metadata = utils.get_local_charm_metadata(charm_path) if resources is not None: resources = await self.model.add_local_resources(self.entity_id, charm_url, From 43770d88ffa2e40e3dab27c841bc38d6efe89043 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Tue, 17 Sep 2024 13:58:12 +0900 Subject: [PATCH 28/29] pyright clean --- juju/application.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/juju/application.py b/juju/application.py index b836d8e8..776b49f1 100644 --- a/juju/application.py +++ b/juju/application.py @@ -85,7 +85,7 @@ class Application(model.ModelEntity): config: dict[str, Any] # json-able # FIXME may be omitted subordinate: bool # status: Any # Status # @property - workload_version: str # e.g. ApplicationStatus, maybe EntityXxx + # workload_version: str # e.g. ApplicationStatus, maybe EntityXxx _pk: str|int @@ -156,6 +156,15 @@ def owner_tag(self) -> str: ) return self.__getattr__("owner_tag") + @property + def workload_version(self) -> str: + warnings.warn( + "`Application.workload_version` is deprecated, use Unit.workload_version instead", + DeprecationWarning, + stacklevel=2, + ) + return self.__getattr__("workload_version") + @property def units(self): return [ @@ -892,7 +901,7 @@ async def refresh( revision=_arg_res_revisions.get(res_name, -1), type_=resource.get('Type', resource.get('type')), origin='store', - )) + )) # type: ignore # FIXME later response = await resources_facade.AddPendingResources( application_tag=self.tag, From 1066d603cc50b7bfa5c9bd8981532322e459b5a5 Mon Sep 17 00:00:00 2001 From: Dima Tisnek Date: Fri, 20 Sep 2024 14:42:52 +0900 Subject: [PATCH 29/29] wip --- juju/application.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/juju/application.py b/juju/application.py index 776b49f1..8c02f4b1 100644 --- a/juju/application.py +++ b/juju/application.py @@ -6,7 +6,7 @@ import logging import pathlib import warnings -from typing import Any, List +from typing import Any, List, TYPE_CHECKING import juju.client.facade from . import jasyncio, model, tag, utils @@ -22,6 +22,9 @@ from .utils import block_until from .version import DEFAULT_ARCHITECTURE +if TYPE_CHECKING: + from .unit import Unit + log = logging.getLogger(__name__) """ @@ -166,7 +169,7 @@ def workload_version(self) -> str: return self.__getattr__("workload_version") @property - def units(self): + def units(self) -> list[Unit]: return [ unit for unit in self.model.units.values() if unit.application == self.name