diff --git a/juju/application.py b/juju/application.py index 070ec7bbe..bb2ab2ddf 100644 --- a/juju/application.py +++ b/juju/application.py @@ -431,10 +431,9 @@ async def get_actions(self, schema=False): :return dict: The charms actions, empty dict if none are defined. """ actions = {} - entity = [{"tag": self.tag}] + entity = {"tag": self.tag} action_facade = client.ActionFacade.from_connection(self.connection) - results = ( - await action_facade.ApplicationsCharmsActions(entities=entity)).results + results = (await action_facade.ApplicationsCharmsActions(entities=[entity])).results for result in results: if result.application_tag == self.tag and result.actions: actions = result.actions @@ -563,7 +562,10 @@ async def set_config(self, config): else: raise JujuApplicationConfigError(config, [k, v]) - await app_facade.Set(application=self.name, options=str_config) + return await app_facade.SetConfigs(args=[{ + "application": self.name, + "config": str_config, + }]) async def reset_config(self, to_default): """ @@ -577,7 +579,10 @@ async def reset_config(self, to_default): log.debug( 'Restoring default config for %s: %s', self.name, to_default) - return await app_facade.Unset(application=self.name, options=to_default) + return await app_facade.UnsetApplicationsConfig(args=[{ + "application": self.name, + "options": to_default, + }]) async def set_constraints(self, constraints): """Set machine constraints for this application. @@ -619,7 +624,7 @@ async def refresh( if switch is not None and revision is not None: raise ValueError("switch and revision are mutually exclusive") - client_facade = client.ClientFacade.from_connection(self.connection) + charms_facade = client.CharmsFacade.from_connection(self.connection) resources_facade = client.ResourcesFacade.from_connection( self.connection) app_facade = self._facade() @@ -644,11 +649,15 @@ async def refresh( if charm_url == self.data['charm-url']: raise JujuError('already running charm "%s"' % charm_url) + # TODO (caner) : this needs to be revisited and updated with the charmhub stuff + origin = client.CharmOrigin(source="charm-store", + risk=channel, + ) # Update charm - await client_facade.AddCharm( + await charms_facade.AddCharm( url=charm_url, force=force, - channel=channel + charm_origin=origin, ) # Update resources diff --git a/juju/bundle.py b/juju/bundle.py index 1fdbd453c..b0767e7b2 100644 --- a/juju/bundle.py +++ b/juju/bundle.py @@ -52,6 +52,8 @@ def __init__(self, model, trusted=False, forced=False): model.connection()) self.ann_facade = client.AnnotationsFacade.from_connection( model.connection()) + self.machine_manager_facade = client.MachineManagerFacade.from_connection( + model.connection()) # Feature detect if we have the new charms facade, otherwise fallback # to the client facade, when making calls. @@ -617,10 +619,8 @@ async def run(self, context): self.application, charm, overrides=self.resources) elif Schema.CHARM_HUB.matches(url.schema): c_hub = charmhub.CharmHub(context.model) - info = await c_hub.info(url.name, channel=self.channel) - if info.errors.error_list.code: - raise JujuError("unable to resolve the charm {} with channel {}".format(url.name, channel)) - origin.id_ = info.result.id_ + id_, _ = c_hub.get_charm_id(url.name) + origin.id_ = id_ resources = await context.model._add_charmhub_resources( self.application, charm, origin, overrides=self.resources) else: @@ -726,7 +726,7 @@ async def run(self, context): if Schema.CHARM_STORE.matches(url.schema): entity_id = await context.charmstore.entityId(self.charm, channel=self.channel) log.debug('Adding %s', entity_id) - await context.client_facade.AddCharm(channel=self.channel, url=entity_id, force=False) + await context.charms_facade.AddCharm(channel=self.channel, url=entity_id, force=False) identifier = entity_id origin = client.CharmOrigin(source="charm-store", risk="stable") @@ -837,7 +837,7 @@ async def run(self, context): # Submit the request. params = client.AddMachineParams(**params) - results = await context.client_facade.AddMachines(params=[params]) + results = await context.machine_manager_facade.AddMachines(params=[params]) error = results.machines[0].error if error: raise ValueError("Error adding machine: %s" % error.message) diff --git a/juju/charmhub.py b/juju/charmhub.py index 9d574be6d..0ac2bd687 100644 --- a/juju/charmhub.py +++ b/juju/charmhub.py @@ -1,11 +1,42 @@ from .client import client from .errors import JujuError +from juju import jasyncio + +import requests +import json class CharmHub: def __init__(self, model): self.model = model + def request_charmhub_with_retry(self, url, retries): + for attempt in range(retries): + _response = requests.get(url) + if _response.status_code == 200: + return _response + jasyncio.sleep(5) + raise JujuError("Got {} from {}".format(_response.status_code, url)) + + def get_charm_id(self, charm_name): + conn, headers, path_prefix = self.model.connection().https_connection() + + url = "http://api.snapcraft.io/v2/charms/info/{}".format(charm_name) + _response = self.request_charmhub_with_retry(url, 5) + response = json.loads(_response.text) + return response['id'], response['name'] + + def is_subordinate(self, charm_name): + conn, headers, path_prefix = self.model.connection().https_connection() + + url = "http://api.snapcraft.io/v2/charms/info/{}?fields=default-release.revision.subordinate".format(charm_name) + _response = self.request_charmhub_with_retry(url, 5) + response = json.loads(_response.text) + return 'subordinate' in response['default-release']['revision'] + + # TODO (caner) : we should be able to recreate the channel-map through the + # api call without needing the CharmHub facade + async def info(self, name, channel=None): """info displays detailed information about a CharmHub charm. The charm can be specified by the exact name. diff --git a/juju/client/_client.py b/juju/client/_client.py index 5918c2aba..11e5abd1d 100644 --- a/juju/client/_client.py +++ b/juju/client/_client.py @@ -3,7 +3,8 @@ from juju.client._definitions import * -from juju.client import _client2, _client1, _client3, _client4, _client5, _client8, _client7, _client9, _client10, _client6, _client12, _client11, _client13, _client15, _client16, _client17, _client18 + +from juju.client import _client2, _client1, _client3, _client4, _client5, _client8, _client7, _client9, _client10, _client6, _client12, _client11, _client13, _client15, _client16, _client17, _client18, _client14 CLIENTS = { @@ -23,11 +24,11 @@ "15": _client15, "16": _client16, "17": _client17, - "18": _client18 + "18": _client18, + "14": _client14 } - def lookup_facade(name, version): """ Given a facade name and version, attempt to pull that facade out @@ -45,7 +46,6 @@ def lookup_facade(name, version): "{}".format(name)) - class TypeFactory: @classmethod def from_connection(cls, connection): @@ -259,6 +259,10 @@ class EntityWatcherFacade(TypeFactory): pass +class EnvironUpgraderFacade(TypeFactory): + pass + + class ExternalControllerUpdaterFacade(TypeFactory): pass diff --git a/juju/client/_client1.py b/juju/client/_client1.py index 5360ff43d..04056ca75 100644 --- a/juju/client/_client1.py +++ b/juju/client/_client1.py @@ -37,7 +37,13 @@ class ActionPrunerFacade(Type): "current model's configuration.", 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, 'type': 'object'}, - 'Prune': {'properties': {'Params': {'$ref': '#/definitions/ActionPruneArgs'}}, + 'Prune': {'description': 'Prune endpoint removes action ' + 'entries until\n' + 'only the ones newer than now - ' + 'p.MaxHistoryTime remain and\n' + 'the history is smaller than ' + 'p.MaxHistoryMB.', + 'properties': {'Params': {'$ref': '#/definitions/ActionPruneArgs'}}, 'type': 'object'}, 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' 'returns a ' @@ -88,6 +94,10 @@ async def ModelConfig(self): @ReturnMapping(None) async def 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 @@ -1324,7 +1334,6 @@ class CAASApplicationProvisionerFacade(Type): 'error': {'$ref': '#/definitions/Error'}, 'filesystems': {'items': {'$ref': '#/definitions/KubernetesFilesystemParams'}, 'type': 'array'}, - 'image-path': {'type': 'string'}, 'image-repo': {'$ref': '#/definitions/DockerImageInfo'}, 'scale': {'type': 'integer'}, 'series': {'type': 'string'}, @@ -1334,8 +1343,7 @@ class CAASApplicationProvisionerFacade(Type): 'version': {'$ref': '#/definitions/Number'}, 'volumes': {'items': {'$ref': '#/definitions/KubernetesVolumeParams'}, 'type': 'array'}}, - 'required': ['image-path', - 'version', + 'required': ['version', 'api-addresses', 'ca-cert', 'constraints'], @@ -1773,6 +1781,11 @@ class CAASApplicationProvisionerFacade(Type): 'watcher-id': {'type': 'string'}}, 'required': ['watcher-id'], 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, 'UnitStatus': {'additionalProperties': False, 'properties': {'address': {'type': 'string'}, 'agent-status': {'$ref': '#/definitions/DetailedStatus'}, @@ -1888,6 +1901,17 @@ class CAASApplicationProvisionerFacade(Type): 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, 'Result': {'$ref': '#/definitions/Charm'}}, 'type': 'object'}, + 'ClearApplicationsResources': {'description': 'ClearApplicationsResources ' + 'clears the ' + 'flags which ' + 'indicate\n' + 'applications ' + 'still have ' + 'resources in ' + 'the cluster.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, 'Life': {'description': 'Life returns the life status of every ' 'supplied entity, where available.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, @@ -1900,6 +1924,13 @@ class CAASApplicationProvisionerFacade(Type): 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/CAASApplicationProvisioningInfoResults'}}, 'type': 'object'}, + 'Remove': {'description': 'Remove removes every given entity ' + 'from state, calling EnsureDead\n' + 'first, then Remove. It will fail if ' + 'the entity is not present.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, 'SetOperatorStatus': {'description': 'SetOperatorStatus sets ' 'the status of each given ' 'entity.', @@ -1937,7 +1968,16 @@ class CAASApplicationProvisionerFacade(Type): 'watch applications\n' 'deployed to this model.', 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, - 'type': 'object'}}, + 'type': 'object'}, + 'WatchUnits': {'description': 'WatchUnits starts a ' + 'StringsWatcher to watch changes ' + 'to the\n' + 'lifecycle states of units for ' + 'the specified applications in\n' + 'this model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, 'type': 'object'} @@ -2035,6 +2075,30 @@ async def CharmInfo(self, url=None): + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' @@ -2081,6 +2145,30 @@ async def ProvisioningInfo(self, entities=None): + @ReturnMapping(ErrorResults) + async def 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='CAASApplicationProvisioner', + request='Remove', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + @ReturnMapping(ErrorResults) async def SetOperatorStatus(self, entities=None): ''' @@ -2219,6 +2307,31 @@ async def WatchApplications(self): + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + class CAASFirewallerEmbeddedFacade(Type): name = 'CAASFirewallerEmbedded' version = 1 @@ -8812,8 +8925,8 @@ async def WatchUnits(self, entities=None): -class ExternalControllerUpdaterFacade(Type): - name = 'ExternalControllerUpdater' +class EnvironUpgraderFacade(Type): + name = 'EnvironUpgrader' version = 1 schema = {'definitions': {'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, @@ -8824,6 +8937,18 @@ class ExternalControllerUpdaterFacade(Type): 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, @@ -8840,87 +8965,337 @@ class ExternalControllerUpdaterFacade(Type): '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'], + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetModelEnvironVersion': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'version': {'type': 'integer'}}, + 'required': ['model-tag', + 'version'], 'type': 'object'}, - 'ExternalControllerInfoResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/ExternalControllerInfo'}}, - 'required': ['result', - 'error'], - 'type': 'object'}, - 'ExternalControllerInfoResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ExternalControllerInfoResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'SetExternalControllerInfoParams': {'additionalProperties': False, - 'properties': {'info': {'$ref': '#/definitions/ExternalControllerInfo'}}, - 'required': ['info'], - 'type': 'object'}, - 'SetExternalControllersInfoParams': {'additionalProperties': False, - 'properties': {'controllers': {'items': {'$ref': '#/definitions/SetExternalControllerInfoParams'}, - 'type': 'array'}}, - 'required': ['controllers'], - 'type': 'object'}, - 'StringsWatchResult': {'additionalProperties': False, - 'properties': {'changes': {'items': {'type': 'string'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}, - 'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id'], + 'SetModelEnvironVersions': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/SetModelEnvironVersion'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}}, + 'properties': {'ModelEnvironVersion': {'description': 'ModelEnvironVersion ' + 'returns the current ' + 'version of the environ ' + 'corresponding\n' + 'to each specified ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, 'type': 'object'}, - 'StringsWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}}, - 'properties': {'ExternalControllerInfo': {'description': 'ExternalControllerInfo ' - 'returns the info ' - 'for the specified ' - 'external ' - 'controllers.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ExternalControllerInfoResults'}}, - 'type': 'object'}, - 'SetExternalControllerInfo': {'description': 'SetExternalControllerInfo ' - 'saves the info ' - 'for the ' - 'specified ' - 'external ' - 'controllers.', - 'properties': {'Params': {'$ref': '#/definitions/SetExternalControllersInfoParams'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'ModelTargetEnvironVersion': {'description': 'ModelTargetEnvironVersion ' + 'returns the ' + 'target version ' + 'of the environ\n' + 'corresponding to ' + 'each specified ' + 'model. The ' + 'target version ' + 'is the\n' + 'environ ' + "provider's " + 'version.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, 'type': 'object'}, - 'WatchExternalControllers': {'description': 'WatchExternalControllers ' - 'watches for the ' - 'addition and ' - 'removal of ' - 'external\n' - 'controller ' - 'records to the ' - 'local ' - "controller's " - 'database.', - 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ExternalControllerInfoResults) - async def ExternalControllerInfo(self, entities=None): - ''' - ExternalControllerInfo returns the info for the specified external controllers. - - entities : typing.Sequence[~Entity] + 'SetModelEnvironVersion': {'description': 'SetModelEnvironVersion ' + 'sets the current ' + 'version of the ' + 'environ ' + 'corresponding\n' + 'to each specified ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/SetModelEnvironVersions'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModelStatus': {'description': 'SetModelStatus sets the ' + 'status of each given model.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchModelEnvironVersion': {'description': 'WatchModelEnvironVersion ' + 'watches for ' + 'changes to the ' + 'environ version ' + 'of the\n' + 'specified ' + 'models.\n' + '\n' + 'NOTE(axw) this is ' + 'currently ' + 'implemented in ' + 'terms of ' + 'state.Model.Watch, ' + 'so\n' + 'the client may be ' + 'notified of ' + 'changes unrelated ' + 'to the environ ' + 'version.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(IntResults) + async def ModelEnvironVersion(self, entities=None): + ''' + ModelEnvironVersion returns the current version of the environ corresponding + to each specified model. + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='EnvironUpgrader', + request='ModelEnvironVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def ModelTargetEnvironVersion(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. + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='EnvironUpgrader', + request='ModelTargetEnvironVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.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) + 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) + async def 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 = await self.rpc(msg) + return reply + + + +class ExternalControllerUpdaterFacade(Type): + name = 'ExternalControllerUpdater' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'ExternalControllerInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ExternalControllerInfo'}}, + 'required': ['result', + 'error'], + 'type': 'object'}, + 'ExternalControllerInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ExternalControllerInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetExternalControllerInfoParams': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/ExternalControllerInfo'}}, + 'required': ['info'], + 'type': 'object'}, + 'SetExternalControllersInfoParams': {'additionalProperties': False, + 'properties': {'controllers': {'items': {'$ref': '#/definitions/SetExternalControllerInfoParams'}, + 'type': 'array'}}, + 'required': ['controllers'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'ExternalControllerInfo': {'description': 'ExternalControllerInfo ' + 'returns the info ' + 'for the specified ' + 'external ' + 'controllers.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ExternalControllerInfoResults'}}, + 'type': 'object'}, + 'SetExternalControllerInfo': {'description': 'SetExternalControllerInfo ' + 'saves the info ' + 'for the ' + 'specified ' + 'external ' + 'controllers.', + 'properties': {'Params': {'$ref': '#/definitions/SetExternalControllersInfoParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchExternalControllers': {'description': 'WatchExternalControllers ' + 'watches for the ' + 'addition and ' + 'removal of ' + 'external\n' + 'controller ' + 'records to the ' + 'local ' + "controller's " + 'database.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ExternalControllerInfoResults) + async def 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)): @@ -10082,7 +10457,9 @@ class MachineActionsFacade(Type): name = 'MachineActions' version = 1 schema = {'definitions': {'Action': {'additionalProperties': False, - 'properties': {'name': {'type': 'string'}, + 'properties': {'execution-group': {'type': 'string'}, + 'name': {'type': 'string'}, + 'parallel': {'type': 'boolean'}, 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, @@ -12870,260 +13247,106 @@ async def rpc(self, msg): class ModelUpgraderFacade(Type): name = 'ModelUpgrader' version = 1 - schema = {'definitions': {'Entities': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}}, - 'required': ['entities'], - 'type': 'object'}, - 'Entity': {'additionalProperties': False, - 'properties': {'tag': {'type': 'string'}}, - 'required': ['tag'], + schema = {'definitions': {'ModelParam': {'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'}, - 'EntityStatusArgs': {'additionalProperties': False, - 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'info': {'type': 'string'}, - 'status': {'type': 'string'}, - 'tag': {'type': 'string'}}, - 'required': ['tag', - 'status', - 'info', - 'data'], + 'UpgradeModel': {'additionalProperties': False, + 'properties': {'agent-stream': {'type': 'string'}, + 'dry-run': {'type': 'boolean'}, + 'ignore-agent-versions': {'type': 'boolean'}, + 'model-tag': {'type': 'string'}, + 'to-version': {'$ref': '#/definitions/Number'}}, + 'required': ['model-tag', 'to-version'], + 'type': 'object'}}, + 'properties': {'AbortModelUpgrade': {'description': 'AbortModelUpgrade aborts ' + 'and archives the model ' + 'upgrade\n' + 'synchronisation record, ' + 'if any.', + 'properties': {'Params': {'$ref': '#/definitions/ModelParam'}}, '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'}, - 'IntResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'integer'}}, - 'required': ['result'], - 'type': 'object'}, - 'IntResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'NotifyWatchResult': {'additionalProperties': False, - 'properties': {'NotifyWatcherId': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['NotifyWatcherId'], - 'type': 'object'}, - 'NotifyWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'SetModelEnvironVersion': {'additionalProperties': False, - 'properties': {'model-tag': {'type': 'string'}, - 'version': {'type': 'integer'}}, - 'required': ['model-tag', - 'version'], - 'type': 'object'}, - 'SetModelEnvironVersions': {'additionalProperties': False, - 'properties': {'models': {'items': {'$ref': '#/definitions/SetModelEnvironVersion'}, - 'type': 'array'}}, - 'type': 'object'}, - 'SetStatus': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, - 'type': 'array'}}, - 'required': ['entities'], - 'type': 'object'}}, - 'properties': {'ModelEnvironVersion': {'description': 'ModelEnvironVersion ' - 'returns the current ' - 'version of the environ ' - 'corresponding\n' - 'to each specified ' - 'model.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/IntResults'}}, - 'type': 'object'}, - 'ModelTargetEnvironVersion': {'description': 'ModelTargetEnvironVersion ' - 'returns the ' - 'target version ' - 'of the environ\n' - 'corresponding to ' - 'each specified ' - 'model. The ' - 'target version ' - 'is the\n' - 'environ ' - "provider's " - 'version.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/IntResults'}}, - 'type': 'object'}, - 'SetModelEnvironVersion': {'description': 'SetModelEnvironVersion ' - 'sets the current ' - 'version of the ' - 'environ ' - 'corresponding\n' - 'to each specified ' - 'model.', - 'properties': {'Params': {'$ref': '#/definitions/SetModelEnvironVersions'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SetModelStatus': {'description': 'SetModelStatus sets the ' - 'status of each given model.', - 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'WatchModelEnvironVersion': {'description': 'WatchModelEnvironVersion ' - 'watches for ' - 'changes to the ' - 'environ version ' - 'of the\n' - 'specified ' - 'models.\n' - '\n' - 'NOTE(axw) this is ' - 'currently ' - 'implemented in ' - 'terms of ' - 'state.Model.Watch, ' - 'so\n' - 'the client may be ' - 'notified of ' - 'changes unrelated ' - 'to the environ ' - 'version.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}}, + 'UpgradeModel': {'description': 'UpgradeModel upgrades a ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeModel'}}, + 'type': 'object'}}, 'type': 'object'} - @ReturnMapping(IntResults) - async def ModelEnvironVersion(self, entities=None): - ''' - ModelEnvironVersion returns the current version of the environ corresponding - to each specified model. - - 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))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelUpgrader', - request='ModelEnvironVersion', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(IntResults) - async def ModelTargetEnvironVersion(self, entities=None): - ''' - 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[~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))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelUpgrader', - request='ModelTargetEnvironVersion', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def SetModelEnvironVersion(self, models=None): + @ReturnMapping(None) + async def AbortModelUpgrade(self, model_tag=None): ''' - SetModelEnvironVersion sets the current version of the environ corresponding - to each specified model. + AbortModelUpgrade aborts and archives the model upgrade + synchronisation record, if any. - models : typing.Sequence[~SetModelEnvironVersion] - Returns -> ErrorResults + model_tag : str + Returns -> None ''' - 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 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='SetModelEnvironVersion', + request='AbortModelUpgrade', version=1, params=_params) - _params['models'] = models + _params['model-tag'] = model_tag reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetModelStatus(self, entities=None): + @ReturnMapping(None) + async def UpgradeModel(self, agent_stream=None, dry_run=None, ignore_agent_versions=None, model_tag=None, to_version=None): ''' - SetModelStatus sets the status of each given model. + UpgradeModel upgrades a model. - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + agent_stream : str + dry_run : bool + ignore_agent_versions : bool + model_tag : str + to_version : Number + 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='ModelUpgrader', - request='SetModelStatus', - version=1, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - + 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))) - @ReturnMapping(NotifyWatchResults) - async def WatchModelEnvironVersion(self, entities=None): - ''' - WatchModelEnvironVersion watches for changes to the environ version of the - specified models. + 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))) - 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. + 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))) - 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))) + if to_version is not None and not isinstance(to_version, (dict, Number)): + raise Exception("Expected to_version to be a Number, received: {}".format(type(to_version))) # map input types to rpc msg _params = dict() msg = dict(type='ModelUpgrader', - request='WatchModelEnvironVersion', + request='UpgradeModel', version=1, params=_params) - _params['entities'] = entities + _params['agent-stream'] = agent_stream + _params['dry-run'] = dry_run + _params['ignore-agent-versions'] = ignore_agent_versions + _params['model-tag'] = model_tag + _params['to-version'] = to_version reply = await self.rpc(msg) return reply @@ -14184,7 +14407,8 @@ class RemoteRelationWatcherFacade(Type): 'unit-count': {'type': 'integer'}}, 'required': ['relation-token', 'application-token', - 'life'], + 'life', + 'unit-count'], 'type': 'object'}, 'RemoteRelationUnitChange': {'additionalProperties': False, 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, diff --git a/juju/client/_client11.py b/juju/client/_client11.py index 9a1443c14..fcd2166a4 100644 --- a/juju/client/_client11.py +++ b/juju/client/_client11.py @@ -1627,6 +1627,25 @@ class ControllerFacade(Type): 'required': ['version', 'git-commit'], 'type': 'object'}, + 'DashboardConnectionInfo': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'proxy-connection': {'$ref': '#/definitions/DashboardConnectionProxy'}, + 'ssh-connection': {'$ref': '#/definitions/DashboardConnectionSSHTunnel'}}, + 'required': ['proxy-connection', + 'ssh-connection'], + 'type': 'object'}, + 'DashboardConnectionProxy': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'type': {'type': 'string'}}, + 'required': ['config', 'type'], + 'type': 'object'}, + 'DashboardConnectionSSHTunnel': {'additionalProperties': False, + 'properties': {'host': {'type': 'string'}, + 'port': {'type': 'string'}}, + 'required': ['host', 'port'], + 'type': 'object'}, 'DestroyControllerArgs': {'additionalProperties': False, 'properties': {'destroy-models': {'type': 'boolean'}, 'destroy-storage': {'type': 'boolean'}, @@ -1916,6 +1935,18 @@ class ControllerFacade(Type): 'access.', 'properties': {'Result': {'$ref': '#/definitions/ControllerVersionResults'}}, 'type': 'object'}, + 'DashboardConnectionInfo': {'description': 'DashboardConnectionInfo ' + 'returns the ' + 'connection ' + 'information for a ' + 'client to\n' + 'connect to the ' + 'Juju Dashboard ' + 'including any ' + 'proxying ' + 'information.', + 'properties': {'Result': {'$ref': '#/definitions/DashboardConnectionInfo'}}, + 'type': 'object'}, 'DestroyController': {'description': 'DestroyController ' 'destroys the ' 'controller.\n' @@ -2215,6 +2246,28 @@ async def ControllerVersion(self): + @ReturnMapping(DashboardConnectionInfo) + async def 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 = await self.rpc(msg) + return reply + + + @ReturnMapping(None) async def DestroyController(self, destroy_models=None, destroy_storage=None, force=None, max_wait=None, model_timeout=None): ''' @@ -2847,13 +2900,11 @@ class ProvisionerFacade(Type): 'major': {'type': 'integer'}, 'minor': {'type': 'integer'}, 'number': {'$ref': '#/definitions/Number'}, - 'os-type': {'type': 'string'}, - 'series': {'type': 'string'}}, + 'os-type': {'type': 'string'}}, 'required': ['number', 'major', 'minor', 'arch', - 'series', 'os-type', 'agentstream'], 'type': 'object'}, @@ -3059,88 +3110,56 @@ class ProvisionerFacade(Type): 'Patch', 'Build'], 'type': 'object'}, - 'ProvisioningInfoBase': {'additionalProperties': False, - 'properties': {'charm-lxd-profiles': {'items': {'type': 'string'}, - 'type': 'array'}, - 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'constraints': {'$ref': '#/definitions/Value'}, - 'controller-config': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'image-metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'ProvisioningInfo': {'additionalProperties': False, + 'properties': {'ProvisioningNetworkTopology': {'$ref': '#/definitions/ProvisioningNetworkTopology'}, + 'charm-lxd-profiles': {'items': {'type': 'string'}, 'type': 'array'}, - 'jobs': {'items': {'type': 'string'}, - 'type': 'array'}, - 'placement': {'type': 'string'}, - 'root-disk': {'$ref': '#/definitions/VolumeParams'}, - 'series': {'type': 'string'}, - 'tags': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachmentParams'}, - 'type': 'array'}, - 'volumes': {'items': {'$ref': '#/definitions/VolumeParams'}, - 'type': 'array'}}, - 'required': ['constraints', - 'series', - 'placement', - 'jobs'], - 'type': 'object'}, - 'ProvisioningInfoResultV10': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/ProvisioningInfoV10'}}, - 'required': ['result'], - 'type': 'object'}, - 'ProvisioningInfoResultsV10': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ProvisioningInfoResultV10'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'ProvisioningInfoV10': {'additionalProperties': False, - 'properties': {'ProvisioningInfoBase': {'$ref': '#/definitions/ProvisioningInfoBase'}, - 'ProvisioningNetworkTopology': {'$ref': '#/definitions/ProvisioningNetworkTopology'}, - 'charm-lxd-profiles': {'items': {'type': 'string'}, - 'type': 'array'}, - 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'constraints': {'$ref': '#/definitions/Value'}, - 'controller-config': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'image-metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, - 'type': 'array'}, - 'jobs': {'items': {'type': 'string'}, - 'type': 'array'}, - 'placement': {'type': 'string'}, - 'root-disk': {'$ref': '#/definitions/VolumeParams'}, - 'series': {'type': 'string'}, - 'space-subnets': {'patternProperties': {'.*': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'subnet-zones': {'patternProperties': {'.*': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'tags': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}, - 'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachmentParams'}, - 'type': 'array'}, - 'volumes': {'items': {'$ref': '#/definitions/VolumeParams'}, - 'type': 'array'}}, - 'required': ['constraints', - 'series', - 'placement', - 'jobs', - 'ProvisioningInfoBase', - 'subnet-zones', - 'space-subnets', - 'ProvisioningNetworkTopology'], - 'type': 'object'}, + 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'controller-config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'image-metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'placement': {'type': 'string'}, + 'root-disk': {'$ref': '#/definitions/VolumeParams'}, + 'series': {'type': 'string'}, + 'space-subnets': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'subnet-zones': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'type': 'array'}, + 'volumes': {'items': {'$ref': '#/definitions/VolumeParams'}, + 'type': 'array'}}, + 'required': ['constraints', + 'series', + 'placement', + 'jobs', + 'subnet-zones', + 'space-subnets', + 'ProvisioningNetworkTopology'], + 'type': 'object'}, + 'ProvisioningInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ProvisioningInfo'}}, + 'required': ['result'], + 'type': 'object'}, + 'ProvisioningInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProvisioningInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, 'ProvisioningNetworkTopology': {'additionalProperties': False, 'properties': {'space-subnets': {'patternProperties': {'.*': {'items': {'type': 'string'}, 'type': 'array'}}, @@ -3590,7 +3609,7 @@ class ProvisionerFacade(Type): 'It supports all positive ' 'space constraints.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ProvisioningInfoResultsV10'}}, + 'Result': {'$ref': '#/definitions/ProvisioningInfoResults'}}, 'type': 'object'}, 'ReleaseContainerAddresses': {'description': 'ReleaseContainerAddresses ' 'finds addresses ' @@ -4088,7 +4107,7 @@ async def EnsureDead(self, entities=None): @ReturnMapping(FindToolsResult) - async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, number=None, os_type=None, series=None): + async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, number=None, os_type=None): ''' FindTools returns a List containing all tools matching the given parameters. @@ -4098,7 +4117,6 @@ async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, n minor : int number : Number os_type : str - series : str Returns -> FindToolsResult ''' if agentstream is not None and not isinstance(agentstream, (bytes, str)): @@ -4119,9 +4137,6 @@ async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, n 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))) - if series is not None and not isinstance(series, (bytes, str)): - raise Exception("Expected series to be a str, received: {}".format(type(series))) - # map input types to rpc msg _params = dict() msg = dict(type='Provisioner', @@ -4134,7 +4149,6 @@ async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, n _params['minor'] = minor _params['number'] = number _params['os-type'] = os_type - _params['series'] = series reply = await self.rpc(msg) return reply @@ -4422,14 +4436,14 @@ async def PrepareContainerInterfaceInfo(self, entities=None): - @ReturnMapping(ProvisioningInfoResultsV10) + @ReturnMapping(ProvisioningInfoResults) async def ProvisioningInfo(self, entities=None): ''' ProvisioningInfo returns the provisioning information for each given machine entity. It supports all positive space constraints. entities : typing.Sequence[~Entity] - Returns -> ProvisioningInfoResultsV10 + 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))) diff --git a/juju/client/_client13.py b/juju/client/_client13.py index 3136c58bd..1739caa5e 100644 --- a/juju/client/_client13.py +++ b/juju/client/_client13.py @@ -205,6 +205,7 @@ class ApplicationFacade(Type): 'exposed': {'type': 'boolean'}, 'exposed-endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/ExposedEndpoint'}}, 'type': 'object'}, + 'life': {'type': 'string'}, 'principal': {'type': 'boolean'}, 'remote': {'type': 'boolean'}, 'series': {'type': 'string'}, @@ -212,17 +213,9 @@ class ApplicationFacade(Type): 'required': ['tag', 'principal', 'exposed', - 'remote'], + 'remote', + 'life'], 'type': 'object'}, - 'ApplicationSet': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'branch': {'type': 'string'}, - 'options': {'patternProperties': {'.*': {'type': 'string'}}, - 'type': 'object'}}, - 'required': ['application', - 'branch', - 'options'], - 'type': 'object'}, 'ApplicationSetCharm': {'additionalProperties': False, 'properties': {'application': {'type': 'string'}, 'channel': {'type': 'string'}, @@ -449,9 +442,11 @@ class ApplicationFacade(Type): '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': ['endpoint', + 'required': ['relation-id', + 'endpoint', 'cross-model', 'related-endpoint', 'ApplicationData', @@ -594,11 +589,6 @@ class ApplicationFacade(Type): 'pool': {'type': 'string'}, 'size': {'type': 'integer'}}, 'type': 'object'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - 'type': 'object'}, 'Subnet': {'additionalProperties': False, 'properties': {'cidr': {'type': 'string'}, 'life': {'type': 'string'}, @@ -629,6 +619,7 @@ class ApplicationFacade(Type): 'properties': {'address': {'type': 'string'}, 'charm': {'type': 'string'}, 'leader': {'type': 'boolean'}, + 'life': {'type': 'string'}, 'machine': {'type': 'string'}, 'opened-ports': {'items': {'type': 'string'}, 'type': 'array'}, @@ -794,12 +785,6 @@ class ApplicationFacade(Type): 'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, 'Result': {'$ref': '#/definitions/ApplicationGetResults'}}, 'type': 'object'}, - 'GetCharmURL': {'description': 'GetCharmURL returns the charm ' - 'URL the given application is\n' - 'running at present.', - 'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, - 'Result': {'$ref': '#/definitions/StringResult'}}, - 'type': 'object'}, 'GetCharmURLOrigin': {'description': 'GetCharmURLOrigin ' 'returns the charm URL ' 'and charm origin the ' @@ -843,20 +828,13 @@ class ApplicationFacade(Type): 'properties': {'Params': {'$ref': '#/definitions/ScaleApplicationsParams'}, 'Result': {'$ref': '#/definitions/ScaleApplicationResults'}}, 'type': 'object'}, - 'Set': {'description': 'Set implements the server side of ' - 'Application.Set.\n' - 'It does not unset values that are set ' - 'to an empty string.\n' - 'Unset should be used for that.', - 'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, - 'type': 'object'}, 'SetCharm': {'description': 'SetCharm sets the charm for a ' 'given for the application.', 'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, 'type': 'object'}, - 'SetConfigs': {'description': 'SetConfig implements the server ' - 'side of Application.SetConfig. ' - 'Both\n' + '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' @@ -892,14 +870,12 @@ class ApplicationFacade(Type): 'properties': {'Params': {'$ref': '#/definitions/ApplicationUnexpose'}}, 'type': 'object'}, 'UnitsInfo': {'description': 'UnitsInfo returns unit ' - 'information.', + 'information for the given ' + 'entities (units or\n' + 'applications).', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/UnitInfoResults'}}, 'type': 'object'}, - 'Unset': {'description': 'Unset implements the server side of ' - 'Client.Unset.', - 'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, - 'type': 'object'}, 'UnsetApplicationsConfig': {'description': 'UnsetApplicationsConfig ' 'implements the ' 'server side of ' @@ -1338,35 +1314,6 @@ async def Get(self, application=None, branch=None): - @ReturnMapping(StringResult) - async def GetCharmURL(self, application=None, branch=None): - ''' - GetCharmURL returns the charm URL the given application is - running at present. - - application : str - branch : str - Returns -> StringResult - ''' - 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='GetCharmURL', - version=13, - 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): ''' @@ -1522,41 +1469,6 @@ async def ScaleApplications(self, applications=None): - @ReturnMapping(None) - async def Set(self, application=None, branch=None, options=None): - ''' - Set implements the server side of Application.Set. - It does not unset values that are set to an empty string. - Unset should be used for that. - - application : str - branch : str - options : typing.Mapping[str, 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 branch is not None and not isinstance(branch, (bytes, str)): - raise Exception("Expected branch to be a str, received: {}".format(type(branch))) - - if options is not None and not isinstance(options, dict): - raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='Set', - version=13, - params=_params) - _params['application'] = application - _params['branch'] = branch - _params['options'] = options - 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_series=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None): ''' @@ -1643,7 +1555,7 @@ async def SetCharm(self, application=None, channel=None, charm_origin=None, char @ReturnMapping(ErrorResults) async def SetConfigs(self, args=None): ''' - SetConfig implements the server side of Application.SetConfig. Both + 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. @@ -1771,7 +1683,8 @@ async def Unexpose(self, application=None, exposed_endpoints=None): @ReturnMapping(UnitInfoResults) async def UnitsInfo(self, entities=None): ''' - UnitsInfo returns unit information. + UnitsInfo returns unit information for the given entities (units or + applications). entities : typing.Sequence[~Entity] Returns -> UnitInfoResults @@ -1791,39 +1704,6 @@ async def UnitsInfo(self, entities=None): - @ReturnMapping(None) - async def Unset(self, application=None, branch=None, options=None): - ''' - Unset implements the server side of Client.Unset. - - application : str - branch : str - options : 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 branch is not None and not isinstance(branch, (bytes, str)): - raise Exception("Expected branch to be a str, received: {}".format(type(branch))) - - if options is not None and not isinstance(options, (bytes, str, list)): - raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='Application', - request='Unset', - version=13, - params=_params) - _params['application'] = application - _params['branch'] = branch - _params['options'] = options - reply = await self.rpc(msg) - return reply - - - @ReturnMapping(ErrorResults) async def UnsetApplicationsConfig(self, args=None): ''' diff --git a/juju/client/_client14.py b/juju/client/_client14.py new file mode 100644 index 000000000..04c0297ea --- /dev/null +++ b/juju/client/_client14.py @@ -0,0 +1,1908 @@ +# 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 = 14 + 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'}, + 'series': {'type': 'string'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'series', + 'charm-url', + 'channel', + 'num-units', + 'config-yaml', + 'constraints', + 'Force'], + 'type': 'object'}, + 'ApplicationDestroy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + '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'}, + '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'}, + 'series': {'type': 'string'}}, + 'required': ['application', + 'charm', + 'config', + 'constraints', + 'series', + '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'}, + 'ApplicationOfferDetails': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description'], + 'type': 'object'}, + 'ApplicationResult': {'additionalProperties': False, + 'properties': {'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'}, + 'series': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'principal', + 'exposed', + 'remote', + 'life'], + 'type': 'object'}, + 'ApplicationSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'options': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', + 'branch', + 'options'], + '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-series': {'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-series'], + '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'}, + 'CharmOrigin': {'additionalProperties': False, + 'properties': {'architecture': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'hash': {'type': 'string'}, + 'id': {'type': 'string'}, + 'instance-key': {'type': 'string'}, + 'os': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'risk': {'type': 'string'}, + 'series': {'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'}, + 'ConsumeApplicationArg': {'additionalProperties': False, + 'properties': {'ApplicationOfferDetails': {'$ref': '#/definitions/ApplicationOfferDetails'}, + 'application-alias': {'type': 'string'}, + 'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + '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'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description', + 'ApplicationOfferDetails'], + 'type': 'object'}, + 'ConsumeApplicationArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ConsumeApplicationArg'}, + 'type': 'array'}}, + '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'}, + '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'}, + 'DestroyApplicationUnits': {'additionalProperties': False, + 'properties': {'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + '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'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', 'force'], + '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'}, + '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'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + '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'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + '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'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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/ConsumeApplicationArgs'}, + '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'}, + 'Destroy': {'description': 'Destroy destroys a given ' + 'application, local or remote.\n' + '\n' + 'NOTE(axw) this exists only for ' + 'backwards compatibility,\n' + 'for API facade versions 1-3; ' + 'clients should prefer its\n' + 'successor, DestroyApplication, ' + 'below. Until all consumers\n' + 'have been updated, or we bump a ' + "major version, we can't\n" + 'drop this.\n' + '\n' + 'TODO(axw) 2017-03-16 #1673323\n' + 'Drop this in Juju 3.0.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}}, + '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'}, + 'DestroyUnits': {'description': 'DestroyUnits removes a given ' + 'set of application units.\n' + '\n' + 'NOTE(axw) this exists only ' + 'for backwards compatibility,\n' + 'for API facade versions 1-3; ' + 'clients should prefer its\n' + 'successor, DestroyUnit, ' + 'below. Until all consumers ' + 'have\n' + 'been updated, or we bump a ' + "major version, we can't drop\n" + 'this.\n' + '\n' + 'TODO(axw) 2017-03-16 ' + '#1673323\n' + 'Drop this in Juju 3.0.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, + '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'}, + 'GetCharmURL': {'description': 'GetCharmURL returns the charm ' + 'URL the given application is\n' + 'running at present.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + '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'}, + 'Set': {'description': 'Set implements the server side of ' + 'Application.Set.\n' + 'It does not unset values that are set ' + 'to an empty string.\n' + 'Unset should be used for that.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, + 'type': 'object'}, + 'SetCharm': {'description': 'SetCharm sets the charm for a ' + 'given for the application.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, + 'type': 'object'}, + 'SetConfigs': {'description': 'SetConfig 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.', + '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'}, + 'Unset': {'description': 'Unset implements the server side of ' + 'Client.Unset.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, + 'type': 'object'}, + 'UnsetApplicationsConfig': {'description': 'UnsetApplicationsConfig ' + 'implements the ' + 'server side of ' + 'Application.UnsetApplicationsConfig.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigUnsetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateApplicationSeries': {'description': 'UpdateApplicationSeries ' + 'updates the ' + 'application ' + 'series. Series ' + 'for\n' + 'subordinates ' + 'updated too.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + '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=14, + 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=14, + 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=14, + 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=14, + 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=14, + 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[~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=14, + 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=14, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Destroy(self, application=None): + ''' + Destroy destroys a given application, local or remote. + + NOTE(axw) this exists only for backwards compatibility, + for API facade versions 1-3; clients should prefer its + successor, DestroyApplication, below. Until all consumers + have been updated, or we bump a major version, we can't + drop this. + + TODO(axw) 2017-03-16 #1673323 + Drop this in Juju 3.0. + + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Destroy', + version=14, + params=_params) + _params['application'] = application + 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=14, + 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=14, + 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=14, + 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=14, + params=_params) + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyUnits(self, unit_names=None): + ''' + DestroyUnits removes a given set of application units. + + NOTE(axw) this exists only for backwards compatibility, + for API facade versions 1-3; clients should prefer its + successor, DestroyUnit, below. Until all consumers have + been updated, or we bump a major version, we can't drop + this. + + TODO(axw) 2017-03-16 #1673323 + Drop this in Juju 3.0. + + unit_names : typing.Sequence[str] + Returns -> None + ''' + if unit_names is not None and not isinstance(unit_names, (bytes, str, list)): + raise Exception("Expected unit_names to be a Sequence, received: {}".format(type(unit_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnits', + version=14, + params=_params) + _params['unit-names'] = unit_names + 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=14, + 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=14, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def GetCharmURL(self, application=None, branch=None): + ''' + GetCharmURL returns the charm URL the given application is + running at present. + + application : str + branch : str + Returns -> StringResult + ''' + 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='GetCharmURL', + version=14, + 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=14, + 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=14, + 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=14, + 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=14, + 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=14, + 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=14, + 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=14, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Set(self, application=None, branch=None, options=None): + ''' + Set implements the server side of Application.Set. + It does not unset values that are set to an empty string. + Unset should be used for that. + + application : str + branch : str + options : typing.Mapping[str, 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, dict): + raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Set', + version=14, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + 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_series=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_series : 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_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + 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=14, + 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-series'] = force_series + _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): + ''' + SetConfig 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=14, + 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=14, + 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. + + 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=14, + 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=14, + 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=14, + 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=14, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unset(self, application=None, branch=None, options=None): + ''' + Unset implements the server side of Client.Unset. + + application : str + branch : str + options : 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, (bytes, str, list)): + raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unset', + version=14, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + 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=14, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateApplicationSeries(self, args=None): + ''' + UpdateApplicationSeries updates the application series. Series for + subordinates updated too. + + args : typing.Sequence[~UpdateSeriesArg] + 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='UpdateApplicationSeries', + version=14, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/_client18.py b/juju/client/_client18.py index e664a192d..8986ffec0 100644 --- a/juju/client/_client18.py +++ b/juju/client/_client18.py @@ -15,7 +15,9 @@ class UniterFacade(Type): 'required': ['servers'], 'type': 'object'}, 'Action': {'additionalProperties': False, - 'properties': {'name': {'type': 'string'}, + 'properties': {'execution-group': {'type': 'string'}, + 'name': {'type': 'string'}, + 'parallel': {'type': 'boolean'}, 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, @@ -348,25 +350,6 @@ class UniterFacade(Type): 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, - 'MachinePortRange': {'additionalProperties': False, - 'properties': {'port-range': {'$ref': '#/definitions/PortRange'}, - 'relation-tag': {'type': 'string'}, - 'unit-tag': {'type': 'string'}}, - 'required': ['unit-tag', - 'relation-tag', - 'port-range'], - 'type': 'object'}, - 'MachinePortsResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'ports': {'items': {'$ref': '#/definitions/MachinePortRange'}, - 'type': 'array'}}, - 'required': ['ports'], - 'type': 'object'}, - 'MachinePortsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/MachinePortsResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, 'MergeLeadershipSettingsBulkParams': {'additionalProperties': False, 'properties': {'params': {'items': {'$ref': '#/definitions/MergeLeadershipSettingsParam'}, 'type': 'array'}}, @@ -880,26 +863,6 @@ class UniterFacade(Type): 'properties': {'Params': {'$ref': '#/definitions/StoragesAddParams'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, - 'AllMachinePorts': {'description': 'AllMachinePorts returns ' - 'all opened port ranges for ' - 'each given\n' - 'machine (on all ' - 'networks).\n' - '\n' - 'DEPRECATED: clients should ' - 'switch to the ' - 'OpenedMachinePortRanges ' - 'API call\n' - 'when using the V17+ API.\n' - '\n' - 'TODO(achilleasa): remove ' - 'from V17 once all client ' - 'references to this API\n' - 'have been changed to use ' - 'the new API.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/MachinePortsResults'}}, - 'type': 'object'}, 'ApplicationStatus': {'description': 'ApplicationStatus ' 'returns the status of ' 'the Applications and its ' @@ -1824,36 +1787,6 @@ async def AddUnitStorage(self, storages=None): - @ReturnMapping(MachinePortsResults) - async def AllMachinePorts(self, entities=None): - ''' - AllMachinePorts returns all opened port ranges for each given - machine (on all networks). - - DEPRECATED: clients should switch to the OpenedMachinePortRanges API call - when using the V17+ API. - - TODO(achilleasa): remove from V17 once all client references to this API - have been changed to use the new API. - - entities : typing.Sequence[~Entity] - Returns -> MachinePortsResults - ''' - if entities is not None and not isinstance(entities, (bytes, str, 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='AllMachinePorts', - version=18, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - @ReturnMapping(ApplicationStatusResults) async def ApplicationStatus(self, entities=None): ''' diff --git a/juju/client/_client2.py b/juju/client/_client2.py index 3f772b233..b40b5980c 100644 --- a/juju/client/_client2.py +++ b/juju/client/_client2.py @@ -3610,6 +3610,18 @@ class CAASUnitProvisionerFacade(Type): 'error': {'$ref': '#/definitions/Error'}}, 'required': ['config'], 'type': 'object'}, + 'DockerImageInfo': {'additionalProperties': False, + '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'}}, + 'required': ['image-name'], + 'type': 'object'}, 'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, @@ -3736,7 +3748,7 @@ class CAASUnitProvisionerFacade(Type): 'type': 'array'}, 'filesystems': {'items': {'$ref': '#/definitions/KubernetesFilesystemParams'}, 'type': 'array'}, - 'operator-image-path': {'type': 'string'}, + 'image-repo': {'$ref': '#/definitions/DockerImageInfo'}, 'pod-spec': {'type': 'string'}, 'raw-k8s-spec': {'type': 'string'}, 'tags': {'patternProperties': {'.*': {'type': 'string'}}, @@ -6999,7 +7011,8 @@ class CrossModelRelationsFacade(Type): 'unit-count': {'type': 'integer'}}, 'required': ['relation-token', 'application-token', - 'life'], + 'life', + 'unit-count'], 'type': 'object'}, 'RemoteRelationDetails': {'additionalProperties': False, 'properties': {'bakery-version': {'type': 'integer'}, @@ -11858,13 +11871,15 @@ class RemoteRelationsFacade(Type): 'remote-application-name': {'type': 'string'}, 'remote-endpoint-name': {'type': 'string'}, 'source-model-uuid': {'type': 'string'}, - 'suspended': {'type': 'boolean'}}, + 'suspended': {'type': 'boolean'}, + 'unit-count': {'type': 'integer'}}, 'required': ['life', 'suspended', 'id', 'key', 'application-name', 'endpoint', + 'unit-count', 'remote-application-name', 'remote-endpoint-name', 'source-model-uuid'], @@ -11889,7 +11904,8 @@ class RemoteRelationsFacade(Type): 'unit-count': {'type': 'integer'}}, 'required': ['relation-token', 'application-token', - 'life'], + 'life', + 'unit-count'], 'type': 'object'}, 'RemoteRelationResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, diff --git a/juju/client/_client3.py b/juju/client/_client3.py index e04e708fe..f25d588ca 100644 --- a/juju/client/_client3.py +++ b/juju/client/_client3.py @@ -2585,6 +2585,108 @@ async def RemoteApplicationInfo(self, bakery_version=None, offer_urls=None): +class BackupsFacade(Type): + name = 'Backups' + version = 3 + schema = {'definitions': {'BackupsCreateArgs': {'additionalProperties': False, + 'properties': {'no-download': {'type': 'boolean'}, + 'notes': {'type': 'string'}}, + 'required': ['notes', 'no-download'], + 'type': 'object'}, + 'BackupsMetadataResult': {'additionalProperties': False, + 'properties': {'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': {'format': 'date-time', + 'type': 'string'}, + 'format-version': {'type': 'integer'}, + 'ha-nodes': {'type': 'integer'}, + 'hostname': {'type': 'string'}, + 'id': {'type': 'string'}, + 'machine': {'type': 'string'}, + 'model': {'type': 'string'}, + 'notes': {'type': 'string'}, + 'series': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'stored': {'format': 'date-time', + 'type': 'string'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'required': ['id', + 'checksum', + 'checksum-format', + 'size', + 'stored', + 'started', + 'finished', + 'notes', + 'model', + 'machine', + 'hostname', + 'version', + 'series', + 'filename', + 'format-version', + 'controller-uuid', + 'controller-machine-id', + 'controller-machine-inst-id', + 'ha-nodes'], + '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'}}, + 'properties': {'Create': {'description': 'Create is the API method that ' + 'requests juju to create a new ' + 'backup\n' + 'of its state.', + 'properties': {'Params': {'$ref': '#/definitions/BackupsCreateArgs'}, + 'Result': {'$ref': '#/definitions/BackupsMetadataResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(BackupsMetadataResult) + async def 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 = await self.rpc(msg) + return reply + + + class BundleFacade(Type): name = 'Bundle' version = 3 @@ -6830,27 +6932,40 @@ async def UpdateFromPublishedImages(self): -class InstancePollerFacade(Type): - name = 'InstancePoller' +class InstanceMutaterFacade(Type): + name = 'InstanceMutater' version = 3 - schema = {'definitions': {'Address': {'additionalProperties': False, - 'properties': {'scope': {'type': 'string'}, - 'space-id': {'type': 'string'}, - 'space-name': {'type': 'string'}, - 'type': {'type': 'string'}, - 'value': {'type': 'string'}}, - 'required': ['value', 'type', 'scope'], - 'type': 'object'}, - 'BoolResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'boolean'}}, - 'required': ['result'], - 'type': 'object'}, - 'BoolResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, + schema = {'definitions': {'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CharmProfilingInfoResult': {'additionalProperties': False, + 'properties': {'current-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'instance-id': {'type': 'string'}, + 'model-name': {'type': 'string'}, + 'profile-changes': {'items': {'$ref': '#/definitions/ProfileInfoResult'}, + 'type': 'array'}}, + 'required': ['instance-id', + 'model-name', + 'profile-changes', + 'current-profiles', + 'error'], + 'type': 'object'}, + 'ContainerTypeResult': {'additionalProperties': False, + 'properties': {'container-type': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['container-type', + 'error'], + 'type': 'object'}, 'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, @@ -6898,77 +7013,38 @@ class InstancePollerFacade(Type): 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, - 'MachineAddresses': {'additionalProperties': False, - 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, - 'type': 'array'}, - 'tag': {'type': 'string'}}, - 'required': ['tag', 'addresses'], - 'type': 'object'}, - 'MachineAddressesResult': {'additionalProperties': False, - 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, - 'type': 'array'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['addresses'], - 'type': 'object'}, - 'MachineAddressesResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/MachineAddressesResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'ModelConfigResult': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}}, - 'required': ['config'], - 'type': 'object'}, 'NotifyWatchResult': {'additionalProperties': False, 'properties': {'NotifyWatcherId': {'type': 'string'}, 'error': {'$ref': '#/definitions/Error'}}, 'required': ['NotifyWatcherId'], 'type': 'object'}, - 'SetMachinesAddresses': {'additionalProperties': False, - 'properties': {'machine-addresses': {'items': {'$ref': '#/definitions/MachineAddresses'}, - 'type': 'array'}}, - 'required': ['machine-addresses'], - 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ProfileInfoResult': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'profile': {'$ref': '#/definitions/CharmLXDProfile'}, + 'revision': {'type': 'integer'}}, + 'type': 'object'}, + 'SetProfileArg': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'profiles': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['entity', 'profiles'], + 'type': 'object'}, + 'SetProfileArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetProfileArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, 'SetStatus': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, - 'StatusResult': {'additionalProperties': False, - 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'error': {'$ref': '#/definitions/Error'}, - 'id': {'type': 'string'}, - 'info': {'type': 'string'}, - 'life': {'type': 'string'}, - 'since': {'format': 'date-time', - 'type': 'string'}, - 'status': {'type': 'string'}}, - 'required': ['id', - 'life', - 'status', - 'info', - 'data', - 'since'], - 'type': 'object'}, - 'StatusResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - 'type': 'object'}, - 'StringResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, 'StringsWatchResult': {'additionalProperties': False, 'properties': {'changes': {'items': {'type': 'string'}, 'type': 'array'}, @@ -6976,97 +7052,151 @@ class InstancePollerFacade(Type): 'watcher-id': {'type': 'string'}}, 'required': ['watcher-id'], 'type': 'object'}}, - 'properties': {'AreManuallyProvisioned': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/BoolResults'}}, - 'type': 'object'}, - 'InstanceId': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/StringResults'}}, - 'type': 'object'}, - 'InstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/StatusResults'}}, - 'type': 'object'}, - 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'properties': {'CharmProfilingInfo': {'description': 'CharmProfilingInfo ' + 'returns info to update ' + 'lxd profiles on the ' + 'machine. If\n' + 'the machine is not ' + 'provisioned, no profile ' + 'change info will be ' + 'returned,\n' + 'nor will an error.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/CharmProfilingInfoResult'}}, + 'type': 'object'}, + 'ContainerType': {'description': 'ContainerType returns the ' + 'container type of a machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/ContainerTypeResult'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/LifeResults'}}, 'type': 'object'}, - 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, - 'type': 'object'}, - 'ProviderAddresses': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/MachineAddressesResults'}}, - 'type': 'object'}, - 'SetInstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SetProviderAddresses': {'properties': {'Params': {'$ref': '#/definitions/SetMachinesAddresses'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'Status': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/StatusResults'}}, - 'type': 'object'}, - 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, - 'type': 'object'}, - 'WatchModelMachines': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'SetCharmProfiles': {'description': 'SetCharmProfiles records ' + 'the given slice of charm ' + 'profile names.', + 'properties': {'Params': {'$ref': '#/definitions/SetProfileArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModificationStatus': {'description': 'SetModificationStatus ' + 'updates the instance ' + 'whilst changes are ' + 'occurring. This\n' + 'is different from ' + 'SetStatus and ' + 'SetInstanceStatus, ' + 'by the fact this ' + 'holds\n' + 'information about ' + 'the ongoing changes ' + 'that are happening ' + 'to instances.\n' + 'Consider LXD Profile ' + 'updates that can ' + 'modify a instance, ' + 'but may not cause\n' + 'the instance to be ' + 'placed into a error ' + 'state. This ' + 'modification status\n' + 'serves the purpose ' + 'of highlighting that ' + 'to the operator.\n' + 'Only machine tags ' + 'are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchContainers': {'description': 'WatchContainers starts a ' + 'watcher to track ' + 'Containers on a given\n' + 'machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchLXDProfileVerificationNeeded': {'description': 'WatchLXDProfileVerificationNeeded ' + 'starts a ' + 'watcher ' + 'to track ' + 'Applications ' + 'with\n' + 'LXD ' + 'Profiles.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchMachines': {'description': 'WatchMachines starts a ' + 'watcher to track machines.\n' + 'WatchMachines does not ' + 'consume the initial event of ' + 'the watch response, as\n' + 'that returns the initial set ' + 'of machines that are ' + 'currently available.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'description': 'WatchModelMachines ' + 'starts a watcher to ' + 'track machines, but not ' + 'containers.\n' + 'WatchModelMachines does ' + 'not consume the initial ' + 'event of the watch ' + 'response, as\n' + 'that returns the ' + 'initial set of machines ' + 'that are currently ' + 'available.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, 'type': 'object'}}, 'type': 'object'} - @ReturnMapping(BoolResults) - async def AreManuallyProvisioned(self, entities=None): + @ReturnMapping(CharmProfilingInfoResult) + async def CharmProfilingInfo(self, tag=None): ''' - 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='InstancePoller', - request='AreManuallyProvisioned', - version=3, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - + 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. - - @ReturnMapping(StringResults) - async def InstanceId(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> StringResults + tag : str + Returns -> CharmProfilingInfoResult ''' - 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 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='InstancePoller', - request='InstanceId', + msg = dict(type='InstanceMutater', + request='CharmProfilingInfo', version=3, params=_params) - _params['entities'] = entities + _params['tag'] = tag reply = await self.rpc(msg) return reply - @ReturnMapping(StatusResults) - async def InstanceStatus(self, entities=None): + @ReturnMapping(ContainerTypeResult) + async def ContainerType(self, tag=None): ''' - entities : typing.Sequence[~Entity] - Returns -> StatusResults + ContainerType returns the container type of a machine. + + tag : str + Returns -> ContainerTypeResult ''' - 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 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='InstancePoller', - request='InstanceStatus', + msg = dict(type='InstanceMutater', + request='ContainerType', version=3, params=_params) - _params['entities'] = entities + _params['tag'] = tag reply = await self.rpc(msg) return reply @@ -7075,6 +7205,8 @@ async def InstanceStatus(self, entities=None): @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 ''' @@ -7083,7 +7215,7 @@ async def Life(self, entities=None): # map input types to rpc msg _params = dict() - msg = dict(type='InstancePoller', + msg = dict(type='InstanceMutater', request='Life', version=3, params=_params) @@ -7093,38 +7225,50 @@ async def Life(self, entities=None): - @ReturnMapping(ModelConfigResult) - async def ModelConfig(self): + @ReturnMapping(ErrorResults) + async def SetCharmProfiles(self, args=None): ''' + SetCharmProfiles records the given slice of charm profile names. - Returns -> ModelConfigResult + 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='InstancePoller', - request='ModelConfig', + msg = dict(type='InstanceMutater', + request='SetCharmProfiles', version=3, params=_params) - + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(MachineAddressesResults) - async def ProviderAddresses(self, entities=None): + @ReturnMapping(ErrorResults) + async def SetModificationStatus(self, entities=None): ''' - entities : typing.Sequence[~Entity] - Returns -> MachineAddressesResults + 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='InstancePoller', - request='ProviderAddresses', + msg = dict(type='InstanceMutater', + request='SetModificationStatus', version=3, params=_params) _params['entities'] = entities @@ -7133,14 +7277,411 @@ async def ProviderAddresses(self, entities=None): - @ReturnMapping(ErrorResults) - async def SetInstanceStatus(self, entities=None): + @ReturnMapping(StringsWatchResult) + async def WatchContainers(self, tag=None): ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + WatchContainers starts a watcher to track Containers on a given + machine. + + tag : str + 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))) + 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + +class InstancePollerFacade(Type): + name = 'InstancePoller' + version = 3 + schema = {'definitions': {'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineAddresses': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'addresses'], + 'type': 'object'}, + 'MachineAddressesResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses'], + 'type': 'object'}, + 'MachineAddressesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineAddressesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'SetMachinesAddresses': {'additionalProperties': False, + 'properties': {'machine-addresses': {'items': {'$ref': '#/definitions/MachineAddresses'}, + 'type': 'array'}}, + 'required': ['machine-addresses'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'AreManuallyProvisioned': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'InstanceId': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'InstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ProviderAddresses': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineAddressesResults'}}, + 'type': 'object'}, + 'SetInstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetProviderAddresses': {'properties': {'Params': {'$ref': '#/definitions/SetMachinesAddresses'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Status': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(BoolResults) + async def AreManuallyProvisioned(self, entities=None): + ''' + 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='InstancePoller', + request='AreManuallyProvisioned', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def InstanceStatus(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='ModelConfig', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineAddressesResults) + async def ProviderAddresses(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceStatus(self, entities=None): + ''' + 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() @@ -7573,6 +8114,10 @@ class MigrationMasterFacade(Type): 'Patch', 'Build'], 'type': 'object'}, + 'PrechecksArgs': {'additionalProperties': False, + 'properties': {'target-controller-version': {'$ref': '#/definitions/Number'}}, + 'required': ['target-controller-version'], + 'type': 'object'}, 'ProcessRelations': {'additionalProperties': False, 'properties': {'controller-alias': {'type': 'string'}}, 'required': ['controller-alias'], @@ -7682,6 +8227,7 @@ class MigrationMasterFacade(Type): 'Prechecks': {'description': 'Prechecks performs pre-migration ' 'checks on the model and\n' '(source) controller.', + 'properties': {'Params': {'$ref': '#/definitions/PrechecksArgs'}}, 'type': 'object'}, 'ProcessRelations': {'description': 'ProcessRelations ' 'processes any relations ' @@ -7802,17 +8348,204 @@ async def MinionReportTimeout(self): @ReturnMapping(MinionReports) async def MinionReports(self): ''' - MinionReports returns details of the reports made by migration - minions to the controller for the current migration phase. + 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(MigrationModelInfo) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchMinionReports(self): + ''' + WatchMinionReports sets up a watcher which reports when a report + for a migration minion has arrived. - Returns -> MinionReports + Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='MigrationMaster', - request='MinionReports', + request='WatchMinionReports', version=3, params=_params) @@ -7821,20 +8554,147 @@ async def MinionReports(self): - @ReturnMapping(MigrationModelInfo) - async def ModelInfo(self): +class ModelConfigFacade(Type): + name = 'ModelConfig' + version = 3 + schema = {'definitions': {'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'GetConstraintsResults': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelSLA': {'additionalProperties': False, + 'properties': {'ModelSLAInfo': {'$ref': '#/definitions/ModelSLAInfo'}, + 'creds': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', + 'owner', + 'ModelSLAInfo', + 'creds'], + 'type': 'object'}, + 'ModelSLAInfo': {'additionalProperties': False, + 'properties': {'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', 'owner'], + 'type': 'object'}, + 'ModelSequencesResult': {'additionalProperties': False, + 'properties': {'sequences': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}}, + 'required': ['sequences'], + 'type': 'object'}, + 'ModelSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelUnset': {'additionalProperties': False, + 'properties': {'keys': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['keys'], + 'type': 'object'}, + 'SetConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['application', 'constraints'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'GetModelConstraints': {'description': 'GetModelConstraints ' + 'returns the ' + 'constraints for the ' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, + 'type': 'object'}, + 'ModelGet': {'description': 'ModelGet implements the ' + 'server-side part of the\n' + 'model-config CLI command.', + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelSet': {'description': 'ModelSet implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, + 'type': 'object'}, + 'ModelUnset': {'description': 'ModelUnset implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, + 'type': 'object'}, + 'SLALevel': {'description': 'SLALevel returns the current sla ' + 'level for the model.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'Sequences': {'description': "Sequences returns the model's " + 'sequence names and next values.', + 'properties': {'Result': {'$ref': '#/definitions/ModelSequencesResult'}}, + 'type': 'object'}, + 'SetModelConstraints': {'description': 'SetModelConstraints ' + 'sets the constraints ' + 'for the model.', + 'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetSLALevel': {'description': 'SetSLALevel sets the sla level ' + 'on the model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(GetConstraintsResults) + async def GetModelConstraints(self): ''' - ModelInfo returns essential information about the model to be - migrated. + GetModelConstraints returns the constraints for the model. - Returns -> MigrationModelInfo + Returns -> GetConstraintsResults ''' # map input types to rpc msg _params = dict() - msg = dict(type='MigrationMaster', - request='ModelInfo', + msg = dict(type='ModelConfig', + request='GetModelConstraints', version=3, params=_params) @@ -7843,20 +8703,20 @@ async def ModelInfo(self): - @ReturnMapping(None) - async def Prechecks(self): + @ReturnMapping(ModelConfigResults) + async def ModelGet(self): ''' - Prechecks performs pre-migration checks on the model and - (source) controller. + ModelGet implements the server-side part of the + model-config CLI command. - Returns -> None + Returns -> ModelConfigResults ''' # map input types to rpc msg _params = dict() - msg = dict(type='MigrationMaster', - request='Prechecks', + msg = dict(type='ModelConfig', + request='ModelGet', version=3, params=_params) @@ -7866,141 +8726,156 @@ async def Prechecks(self): @ReturnMapping(None) - async def ProcessRelations(self, controller_alias=None): + async def ModelSet(self, config=None): ''' - ProcessRelations processes any relations that need updating after an export. - This should help fix any remoteApplications that have been migrated. + ModelSet implements the server-side part of the + set-model-config CLI command. - controller_alias : str + config : typing.Mapping[str, typing.Any] 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 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='MigrationMaster', - request='ProcessRelations', + msg = dict(type='ModelConfig', + request='ModelSet', version=3, params=_params) - _params['controller-alias'] = controller_alias + _params['config'] = config reply = await self.rpc(msg) return reply @ReturnMapping(None) - async def Reap(self): + async def ModelUnset(self, keys=None): ''' - Reap removes all documents for the model associated with the API - connection. - + 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='MigrationMaster', - request='Reap', + msg = dict(type='ModelConfig', + request='ModelUnset', version=3, params=_params) - + _params['keys'] = keys reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def SetPhase(self, phase=None): + @ReturnMapping(StringResult) + async def SLALevel(self): ''' - 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. + SLALevel returns the current sla level for the model. - phase : str - Returns -> None + + Returns -> StringResult ''' - 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', + msg = dict(type='ModelConfig', + request='SLALevel', version=3, params=_params) - _params['phase'] = phase + reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def SetStatusMessage(self, message=None): + @ReturnMapping(ModelSequencesResult) + async def Sequences(self): ''' - 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. + Sequences returns the model's sequence names and next values. - message : str - Returns -> None + + Returns -> ModelSequencesResult ''' - 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', + msg = dict(type='ModelConfig', + request='Sequences', version=3, params=_params) - _params['message'] = message + reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def Watch(self): + @ReturnMapping(None) + async def SetModelConstraints(self, application=None, constraints=None): ''' - 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. - + SetModelConstraints sets the constraints for the model. - Returns -> NotifyWatchResult + 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='MigrationMaster', - request='Watch', + msg = dict(type='ModelConfig', + request='SetModelConstraints', version=3, params=_params) - + _params['application'] = application + _params['constraints'] = constraints reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def WatchMinionReports(self): + @ReturnMapping(None) + async def SetSLALevel(self, modelslainfo=None, creds=None, level=None, owner=None): ''' - WatchMinionReports sets up a watcher which reports when a report - for a migration minion has arrived. + 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))) - Returns -> NotifyWatchResult - ''' + 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='MigrationMaster', - request='WatchMinionReports', + msg = dict(type='ModelConfig', + request='SetSLALevel', version=3, params=_params) - + _params['ModelSLAInfo'] = modelslainfo + _params['creds'] = creds + _params['level'] = level + _params['owner'] = owner reply = await self.rpc(msg) return reply @@ -13049,3 +13924,389 @@ async def WatchUpgradeSeriesNotifications(self, entities=None): return reply + +class UserManagerFacade(Type): + name = 'UserManager' + version = 3 + schema = {'definitions': {'AddUser': {'additionalProperties': False, + 'properties': {'display-name': {'type': 'string'}, + 'password': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['username', 'display-name'], + 'type': 'object'}, + 'AddUserResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'secret-key': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'type': 'object'}, + 'AddUserResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/AddUserResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'AddUsers': {'additionalProperties': False, + 'properties': {'users': {'items': {'$ref': '#/definitions/AddUser'}, + 'type': 'array'}}, + 'required': ['users'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + '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'}, + 'ModelUserInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ModelUserInfo'}}, + 'type': 'object'}, + 'ModelUserInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ModelUserInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UserInfo': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'created-by': {'type': 'string'}, + 'date-created': {'format': 'date-time', + 'type': 'string'}, + 'disabled': {'type': 'boolean'}, + 'display-name': {'type': 'string'}, + 'last-connection': {'format': 'date-time', + 'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['username', + 'display-name', + 'access', + 'created-by', + 'date-created', + 'disabled'], + 'type': 'object'}, + 'UserInfoRequest': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'include-disabled': {'type': 'boolean'}}, + 'required': ['entities', + 'include-disabled'], + 'type': 'object'}, + 'UserInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/UserInfo'}}, + 'type': 'object'}, + 'UserInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UserInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AddUser': {'description': 'AddUser adds a user with a ' + 'username, and either a password ' + 'or\n' + 'a randomly generated secret key ' + 'which will be returned.', + 'properties': {'Params': {'$ref': '#/definitions/AddUsers'}, + 'Result': {'$ref': '#/definitions/AddUserResults'}}, + 'type': 'object'}, + 'DisableUser': {'description': 'DisableUser disables one or ' + 'more users. If the user is ' + 'already disabled,\n' + 'the action is considered a ' + 'success.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnableUser': {'description': 'EnableUser enables one or more ' + 'users. If the user is already ' + 'enabled,\n' + 'the action is considered a ' + 'success.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelUserInfo': {'description': 'ModelUserInfo returns ' + 'information on all users in ' + 'the model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelUserInfoResults'}}, + 'type': 'object'}, + 'RemoveUser': {'description': 'RemoveUser permanently removes ' + 'a user from the current ' + 'controller for each\n' + 'entity provided. While the user ' + 'is permanently removed we keep ' + "it's\n" + 'information around for auditing ' + 'purposes.\n' + 'TODO(redir): Add information ' + 'about getting deleted user ' + 'information when we\n' + 'add that capability.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ResetPassword': {'description': 'ResetPassword resets ' + 'password for supplied users ' + 'by\n' + 'invalidating current ' + 'passwords (if any) and ' + 'generating\n' + 'new random secret keys which ' + 'will be returned.\n' + 'Users cannot reset their own ' + 'password.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/AddUserResults'}}, + 'type': 'object'}, + 'SetPassword': {'description': 'SetPassword changes the stored ' + 'password for the specified ' + 'users.', + 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UserInfo': {'description': 'UserInfo returns information on a ' + 'user.', + 'properties': {'Params': {'$ref': '#/definitions/UserInfoRequest'}, + 'Result': {'$ref': '#/definitions/UserInfoResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddUserResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelUserInfoResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddUserResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(UserInfoResults) + async def 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 = await self.rpc(msg) + return reply + + diff --git a/juju/client/_client4.py b/juju/client/_client4.py index 89192f27f..812956725 100644 --- a/juju/client/_client4.py +++ b/juju/client/_client4.py @@ -1333,8 +1333,8 @@ class ApplicationOffersFacade(Type): 'This call currently ' 'has no client side ' 'API, only there for ' - 'the GUI at this ' - 'stage.', + 'the Dashboard at ' + 'this stage.', 'properties': {'Params': {'$ref': '#/definitions/OfferURLs'}, 'Result': {'$ref': '#/definitions/RemoteApplicationInfoResults'}}, 'type': 'object'}}, @@ -1523,7 +1523,7 @@ async def Offer(self, offers=None): 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 GUI at this stage. + This call currently has no client side API, only there for the Dashboard at this stage. bakery_version : int offer_urls : typing.Sequence[str] diff --git a/juju/client/_client5.py b/juju/client/_client5.py index ea2258e3b..7cd679f6d 100644 --- a/juju/client/_client5.py +++ b/juju/client/_client5.py @@ -1715,84 +1715,7 @@ async def GetChangesMapArgs(self, bundleurl=None, yaml=None): class ClientFacade(Type): name = 'Client' version = 5 - schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, - 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, - 'type': 'array'}, - 'type': 'array'}}, - 'required': ['servers'], - 'type': 'object'}, - 'AddCharm': {'additionalProperties': False, - 'properties': {'channel': {'type': 'string'}, - 'force': {'type': 'boolean'}, - 'url': {'type': 'string'}}, - 'required': ['url', 'channel', 'force'], - 'type': 'object'}, - 'AddCharmWithAuthorization': {'additionalProperties': False, - 'properties': {'channel': {'type': 'string'}, - 'force': {'type': 'boolean'}, - 'macaroon': {'$ref': '#/definitions/Macaroon'}, - 'url': {'type': 'string'}}, - 'required': ['url', - 'channel', - 'macaroon', - 'force'], - 'type': 'object'}, - 'AddMachineParams': {'additionalProperties': False, - 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, - 'type': 'array'}, - 'constraints': {'$ref': '#/definitions/Value'}, - 'container-type': {'type': 'string'}, - 'disks': {'items': {'$ref': '#/definitions/Constraints'}, - 'type': 'array'}, - 'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, - 'instance-id': {'type': 'string'}, - 'jobs': {'items': {'type': 'string'}, - 'type': 'array'}, - 'nonce': {'type': 'string'}, - 'parent-id': {'type': 'string'}, - 'placement': {'$ref': '#/definitions/Placement'}, - 'series': {'type': 'string'}}, - 'required': ['series', - 'constraints', - 'jobs', - 'parent-id', - 'container-type', - 'instance-id', - 'nonce', - 'hardware-characteristics', - 'addresses'], - 'type': 'object'}, - 'AddMachines': {'additionalProperties': False, - 'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'}, - 'type': 'array'}}, - 'required': ['params'], - 'type': 'object'}, - 'AddMachinesResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'machine': {'type': 'string'}}, - 'required': ['machine'], - 'type': 'object'}, - 'AddMachinesResults': {'additionalProperties': False, - 'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'}, - 'type': 'array'}}, - 'required': ['machines'], - 'type': 'object'}, - 'Address': {'additionalProperties': False, - 'properties': {'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'}, - 'AgentVersionResult': {'additionalProperties': False, - 'properties': {'version': {'$ref': '#/definitions/Number'}}, - 'required': ['version'], - 'type': 'object'}, - 'AllWatcherId': {'additionalProperties': False, + schema = {'definitions': {'AllWatcherId': {'additionalProperties': False, 'properties': {'watcher-id': {'type': 'string'}}, 'required': ['watcher-id'], 'type': 'object'}, @@ -1884,53 +1807,6 @@ class ClientFacade(Type): 'created', 'created-by'], 'type': 'object'}, - 'BundleChange': {'additionalProperties': False, - 'properties': {'args': {'items': {'additionalProperties': True, - 'type': 'object'}, - 'type': 'array'}, - 'id': {'type': 'string'}, - 'method': {'type': 'string'}, - 'requires': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['id', - 'method', - 'args', - 'requires'], - 'type': 'object'}, - 'BundleChangesParams': {'additionalProperties': False, - 'properties': {'bundleURL': {'type': 'string'}, - 'yaml': {'type': 'string'}}, - 'required': ['yaml', 'bundleURL'], - 'type': 'object'}, - 'BundleChangesResults': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'}, - 'type': 'array'}, - 'errors': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'BytesResult': {'additionalProperties': False, - 'properties': {'result': {'items': {'type': 'integer'}, - 'type': 'array'}}, - 'required': ['result'], - 'type': 'object'}, - 'ConfigValue': {'additionalProperties': False, - 'properties': {'source': {'type': 'string'}, - 'value': {'additionalProperties': True, - 'type': 'object'}}, - 'required': ['value', 'source'], - 'type': 'object'}, - 'Constraints': {'additionalProperties': False, - 'properties': {'Count': {'type': 'integer'}, - 'Pool': {'type': 'string'}, - 'Size': {'type': 'integer'}}, - 'required': ['Pool', 'Size', 'Count'], - 'type': 'object'}, - 'DestroyMachines': {'additionalProperties': False, - 'properties': {'force': {'type': 'boolean'}, - 'machine-names': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['machine-names', 'force'], - 'type': 'object'}, 'DetailedStatus': {'additionalProperties': False, 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, @@ -1961,25 +1837,6 @@ class ClientFacade(Type): 'role', 'subordinate'], 'type': 'object'}, - 'Entities': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}}, - 'required': ['entities'], - 'type': 'object'}, - 'Entity': {'additionalProperties': False, - 'properties': {'tag': {'type': 'string'}}, - 'required': ['tag'], - 'type': 'object'}, - 'EntityStatus': {'additionalProperties': False, - 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'info': {'type': 'string'}, - 'since': {'format': 'date-time', - 'type': 'string'}, - 'status': {'type': 'string'}}, - 'required': ['status', 'info', 'since'], - 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, @@ -1988,14 +1845,6 @@ class ClientFacade(Type): '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'}, @@ -2008,13 +1857,11 @@ class ClientFacade(Type): 'major': {'type': 'integer'}, 'minor': {'type': 'integer'}, 'number': {'$ref': '#/definitions/Number'}, - 'os-type': {'type': 'string'}, - 'series': {'type': 'string'}}, + 'os-type': {'type': 'string'}}, 'required': ['number', 'major', 'minor', 'arch', - 'series', 'os-type', 'agentstream'], 'type': 'object'}, @@ -2049,44 +1896,12 @@ class ClientFacade(Type): 'controller-timestamp', 'branches'], 'type': 'object'}, - 'GetConstraintsResults': {'additionalProperties': False, - 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, - 'required': ['constraints'], - 'type': 'object'}, - 'HardwareCharacteristics': {'additionalProperties': False, - 'properties': {'arch': {'type': 'string'}, - 'availability-zone': {'type': 'string'}, - 'cpu-cores': {'type': 'integer'}, - 'cpu-power': {'type': 'integer'}, - 'mem': {'type': 'integer'}, - 'root-disk': {'type': 'integer'}, - 'root-disk-source': {'type': 'string'}, - 'tags': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, 'History': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'statuses': {'items': {'$ref': '#/definitions/DetailedStatus'}, 'type': 'array'}}, 'required': ['statuses'], 'type': 'object'}, - 'HostPort': {'additionalProperties': False, - 'properties': {'Address': {'$ref': '#/definitions/Address'}, - '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'}}, - 'required': ['value', - 'type', - 'scope', - 'Address', - 'port'], - 'type': 'object'}, 'LXDProfile': {'additionalProperties': False, 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, 'type': 'object'}, @@ -2098,17 +1913,6 @@ class ClientFacade(Type): 'description', 'devices'], 'type': 'object'}, - 'Macaroon': {'additionalProperties': False, 'type': 'object'}, - 'MachineHardware': {'additionalProperties': False, - 'properties': {'arch': {'type': 'string'}, - 'availability-zone': {'type': 'string'}, - 'cores': {'type': 'integer'}, - 'cpu-power': {'type': 'integer'}, - 'mem': {'type': 'integer'}, - 'root-disk': {'type': 'integer'}, - 'tags': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, 'MachineStatus': {'additionalProperties': False, 'properties': {'agent-status': {'$ref': '#/definitions/DetailedStatus'}, 'constraints': {'type': 'string'}, @@ -2154,90 +1958,6 @@ class ClientFacade(Type): 'message': {'type': 'string'}}, 'required': ['color', 'message'], 'type': 'object'}, - 'ModelConfigResults': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, - 'type': 'object'}}, - 'required': ['config'], - 'type': 'object'}, - 'ModelInfo': {'additionalProperties': False, - 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, - 'cloud-credential-tag': {'type': 'string'}, - 'cloud-credential-validity': {'type': 'boolean'}, - 'cloud-region': {'type': 'string'}, - 'cloud-tag': {'type': 'string'}, - 'controller-uuid': {'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'}, - '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', - 'sla', - 'agent-version'], - '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'}, - 'ModelSLA': {'additionalProperties': False, - 'properties': {'ModelSLAInfo': {'$ref': '#/definitions/ModelSLAInfo'}, - 'creds': {'items': {'type': 'integer'}, - 'type': 'array'}, - 'level': {'type': 'string'}, - 'owner': {'type': 'string'}}, - 'required': ['level', - 'owner', - 'ModelSLAInfo', - 'creds'], - 'type': 'object'}, - 'ModelSLAInfo': {'additionalProperties': False, - 'properties': {'level': {'type': 'string'}, - 'owner': {'type': 'string'}}, - 'required': ['level', 'owner'], - 'type': 'object'}, - 'ModelSet': {'additionalProperties': False, - 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}}, - 'required': ['config'], - 'type': 'object'}, 'ModelStatusInfo': {'additionalProperties': False, 'properties': {'available-version': {'type': 'string'}, 'cloud-tag': {'type': 'string'}, @@ -2257,1288 +1977,237 @@ class ClientFacade(Type): 'meter-status', 'sla'], 'type': 'object'}, - 'ModelUnset': {'additionalProperties': False, - 'properties': {'keys': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['keys'], - 'type': 'object'}, - 'ModelUserInfo': {'additionalProperties': False, - 'properties': {'access': {'type': 'string'}, - 'display-name': {'type': 'string'}, - 'last-connection': {'format': 'date-time', - 'type': 'string'}, - 'user': {'type': 'string'}}, - 'required': ['user', - 'display-name', - 'last-connection', - 'access'], - 'type': 'object'}, - 'ModelUserInfoResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'$ref': '#/definitions/ModelUserInfo'}}, - 'type': 'object'}, - 'ModelUserInfoResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ModelUserInfoResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, 'NetworkInterface': {'additionalProperties': False, 'properties': {'dns-nameservers': {'items': {'type': 'string'}, 'type': 'array'}, 'gateway': {'type': 'string'}, 'ip-addresses': {'items': {'type': 'string'}, - 'type': 'array'}, - 'is-up': {'type': 'boolean'}, - 'mac-address': {'type': 'string'}, - 'space': {'type': 'string'}}, - 'required': ['ip-addresses', - 'mac-address', - 'is-up'], - 'type': 'object'}, - 'Number': {'additionalProperties': False, - 'properties': {'Build': {'type': 'integer'}, - 'Major': {'type': 'integer'}, - 'Minor': {'type': 'integer'}, - 'Patch': {'type': 'integer'}, - 'Tag': {'type': 'string'}}, - 'required': ['Major', - 'Minor', - 'Tag', - 'Patch', - 'Build'], - 'type': 'object'}, - 'Placement': {'additionalProperties': False, - 'properties': {'directive': {'type': 'string'}, - 'scope': {'type': 'string'}}, - 'required': ['scope', 'directive'], - 'type': 'object'}, - 'PrivateAddress': {'additionalProperties': False, - 'properties': {'target': {'type': 'string'}}, - 'required': ['target'], - 'type': 'object'}, - 'PrivateAddressResults': {'additionalProperties': False, - 'properties': {'private-address': {'type': 'string'}}, - 'required': ['private-address'], - 'type': 'object'}, - 'ProvisioningScriptParams': {'additionalProperties': False, - 'properties': {'data-dir': {'type': 'string'}, - 'disable-package-commands': {'type': 'boolean'}, - 'machine-id': {'type': 'string'}, - 'nonce': {'type': 'string'}}, - 'required': ['machine-id', - 'nonce', - 'data-dir', - 'disable-package-commands'], - 'type': 'object'}, - 'ProvisioningScriptResult': {'additionalProperties': False, - 'properties': {'script': {'type': 'string'}}, - 'required': ['script'], - 'type': 'object'}, - 'PublicAddress': {'additionalProperties': False, - 'properties': {'target': {'type': 'string'}}, - 'required': ['target'], - 'type': 'object'}, - 'PublicAddressResults': {'additionalProperties': False, - 'properties': {'public-address': {'type': 'string'}}, - 'required': ['public-address'], - 'type': 'object'}, - 'RelationStatus': {'additionalProperties': False, - 'properties': {'endpoints': {'items': {'$ref': '#/definitions/EndpointStatus'}, - 'type': 'array'}, - 'id': {'type': 'integer'}, - 'interface': {'type': 'string'}, - 'key': {'type': 'string'}, - 'scope': {'type': 'string'}, - 'status': {'$ref': '#/definitions/DetailedStatus'}}, - 'required': ['id', - 'key', - 'interface', - 'scope', - 'endpoints', - 'status'], - 'type': 'object'}, - 'RemoteApplicationStatus': {'additionalProperties': False, - 'properties': {'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, - 'type': 'array'}, - 'err': {'$ref': '#/definitions/Error'}, - 'life': {'type': 'string'}, - 'offer-name': {'type': 'string'}, - 'offer-url': {'type': 'string'}, - 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'type': 'object'}, - 'status': {'$ref': '#/definitions/DetailedStatus'}}, - 'required': ['offer-url', - 'offer-name', - 'endpoints', - 'life', - 'relations', - 'status'], - 'type': 'object'}, - 'RemoteEndpoint': {'additionalProperties': False, - 'properties': {'interface': {'type': 'string'}, - 'limit': {'type': 'integer'}, - 'name': {'type': 'string'}, - 'role': {'type': 'string'}}, - 'required': ['name', - 'role', - 'interface', - 'limit'], - 'type': 'object'}, - 'ResolveCharmResult': {'additionalProperties': False, - 'properties': {'error': {'type': 'string'}, - 'url': {'type': 'string'}}, - 'type': 'object'}, - 'ResolveCharmResults': {'additionalProperties': False, - 'properties': {'urls': {'items': {'$ref': '#/definitions/ResolveCharmResult'}, - 'type': 'array'}}, - 'required': ['urls'], - 'type': 'object'}, - 'ResolveCharms': {'additionalProperties': False, - 'properties': {'references': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['references'], - 'type': 'object'}, - 'Resolved': {'additionalProperties': False, - 'properties': {'retry': {'type': 'boolean'}, - 'unit-name': {'type': 'string'}}, - 'required': ['unit-name', 'retry'], - 'type': 'object'}, - 'SetConstraints': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'constraints': {'$ref': '#/definitions/Value'}}, - 'required': ['application', 'constraints'], - 'type': 'object'}, - 'SetModelAgentVersion': {'additionalProperties': False, - 'properties': {'agent-stream': {'type': 'string'}, - 'force': {'type': 'boolean'}, - 'version': {'$ref': '#/definitions/Number'}}, - 'required': ['version'], - 'type': 'object'}, - 'StatusHistoryFilter': {'additionalProperties': False, - 'properties': {'date': {'format': 'date-time', - 'type': 'string'}, - 'delta': {'type': 'integer'}, - 'exclude': {'items': {'type': 'string'}, - 'type': 'array'}, - 'size': {'type': 'integer'}}, - 'required': ['size', - 'date', - 'delta', - 'exclude'], - 'type': 'object'}, - 'StatusHistoryRequest': {'additionalProperties': False, - 'properties': {'filter': {'$ref': '#/definitions/StatusHistoryFilter'}, - 'historyKind': {'type': 'string'}, - 'size': {'type': 'integer'}, - 'tag': {'type': 'string'}}, - 'required': ['historyKind', - 'size', - 'filter', - 'tag'], - 'type': 'object'}, - 'StatusHistoryRequests': {'additionalProperties': False, - 'properties': {'requests': {'items': {'$ref': '#/definitions/StatusHistoryRequest'}, - 'type': 'array'}}, - 'required': ['requests'], - 'type': 'object'}, - 'StatusHistoryResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'history': {'$ref': '#/definitions/History'}}, - 'required': ['history'], - 'type': 'object'}, - 'StatusHistoryResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StatusHistoryResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'StatusParams': {'additionalProperties': False, - 'properties': {'patterns': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['patterns'], - 'type': 'object'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - 'type': 'object'}, - 'SupportedFeature': {'additionalProperties': False, - 'properties': {'description': {'type': 'string'}, - 'name': {'type': 'string'}, - 'version': {'type': 'string'}}, - 'required': ['name', 'description'], - 'type': 'object'}, - 'Tools': {'additionalProperties': False, - 'properties': {'sha256': {'type': 'string'}, - 'size': {'type': 'integer'}, - 'url': {'type': 'string'}, - 'version': {'$ref': '#/definitions/Binary'}}, - 'required': ['version', 'url', 'size'], - 'type': 'object'}, - 'UnitStatus': {'additionalProperties': False, - 'properties': {'address': {'type': 'string'}, - 'agent-status': {'$ref': '#/definitions/DetailedStatus'}, - 'charm': {'type': 'string'}, - 'leader': {'type': 'boolean'}, - 'machine': {'type': 'string'}, - 'opened-ports': {'items': {'type': 'string'}, - 'type': 'array'}, - 'provider-id': {'type': 'string'}, - 'public-address': {'type': 'string'}, - 'subordinates': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, - 'type': 'object'}, - 'workload-status': {'$ref': '#/definitions/DetailedStatus'}, - 'workload-version': {'type': 'string'}}, - 'required': ['agent-status', - 'workload-status', - 'workload-version', - 'machine', - 'opened-ports', - 'public-address', - 'charm', - 'subordinates'], - 'type': 'object'}, - 'Value': {'additionalProperties': False, - 'properties': {'allocate-public-ip': {'type': 'boolean'}, - 'arch': {'type': 'string'}, - 'container': {'type': 'string'}, - 'cores': {'type': 'integer'}, - 'cpu-power': {'type': 'integer'}, - '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': {'APIHostPorts': {'description': 'APIHostPorts returns the API ' - 'host/port addresses stored in ' - 'state.', - 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, - 'type': 'object'}, - 'AbortCurrentUpgrade': {'description': 'AbortCurrentUpgrade ' - 'aborts and archives ' - 'the current upgrade\n' - 'synchronisation ' - 'record, if any.', - 'type': 'object'}, - 'AddCharm': {'description': 'NOTE: AddCharm is deprecated as ' - 'of juju 2.9 and charms facade ' - 'version 3.\n' - 'Please discontinue use and move ' - 'to the charms facade version.\n' - '\n' - 'TODO: remove in juju 3.0', - 'properties': {'Params': {'$ref': '#/definitions/AddCharm'}}, - 'type': 'object'}, - 'AddCharmWithAuthorization': {'description': 'AddCharmWithAuthorization ' - 'adds the given ' - 'charm URL (which ' - 'must include\n' - 'revision) to the ' - 'model, if it ' - 'does not exist ' - 'yet. Local ' - 'charms are not\n' - 'supported, only ' - 'charm store ' - 'URLs. See also ' - 'AddLocalCharm().\n' - '\n' - 'The ' - 'authorization ' - 'macaroon, ' - 'args.CharmStoreMacaroon, ' - 'may be omitted, ' - 'in\n' - 'which case this ' - 'call is ' - 'equivalent to ' - 'AddCharm.\n' - '\n' - 'NOTE: ' - 'AddCharmWithAuthorization ' - 'is deprecated as ' - 'of juju 2.9 and ' - 'charms\n' - 'facade version ' - '3. Please ' - 'discontinue use ' - 'and move to the ' - 'charms facade\n' - 'version.\n' - '\n' - 'TODO: remove in ' - 'juju 3.0', - 'properties': {'Params': {'$ref': '#/definitions/AddCharmWithAuthorization'}}, - 'type': 'object'}, - 'AddMachines': {'description': 'AddMachines adds new machines ' - 'with the supplied parameters.', - 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, - 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, - 'type': 'object'}, - 'AddMachinesV2': {'description': 'AddMachinesV2 adds new ' - 'machines with the supplied ' - 'parameters.', - 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, - 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, - 'type': 'object'}, - 'AgentVersion': {'description': 'AgentVersion returns the ' - 'current version that the API ' - 'server is running.', - 'properties': {'Result': {'$ref': '#/definitions/AgentVersionResult'}}, - 'type': 'object'}, - 'CACert': {'description': 'CACert returns the certificate used ' - 'to validate the state connection.', - 'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, - 'type': 'object'}, - 'DestroyMachines': {'description': 'DestroyMachines removes a ' - 'given set of machines.', - 'properties': {'Params': {'$ref': '#/definitions/DestroyMachines'}}, - 'type': 'object'}, - 'FindTools': {'description': 'FindTools returns a List ' - 'containing all tools matching ' - 'the given parameters.', - 'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, - 'Result': {'$ref': '#/definitions/FindToolsResult'}}, - 'type': 'object'}, - 'FullStatus': {'description': 'FullStatus gives the ' - 'information needed for juju ' - 'status over the api', - 'properties': {'Params': {'$ref': '#/definitions/StatusParams'}, - 'Result': {'$ref': '#/definitions/FullStatus'}}, - 'type': 'object'}, - 'GetBundleChanges': {'description': 'GetBundleChanges returns ' - 'the list of changes ' - 'required to deploy the ' - 'given\n' - 'bundle data. The changes ' - 'are sorted by ' - 'requirements, so that ' - 'they can be\n' - 'applied in order.\n' - 'Deprecated: clients ' - 'should use the GetChanges ' - 'endpoint on the Bundle ' - 'facade.\n' - 'Note: any new feature in ' - 'the future like devices ' - 'will never be supported ' - 'here.', - 'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, - 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, - 'type': 'object'}, - 'GetModelConstraints': {'description': 'GetModelConstraints ' - 'returns the ' - 'constraints for the ' - 'model.', - 'properties': {'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, - 'type': 'object'}, - 'InjectMachines': {'description': 'InjectMachines injects a ' - 'machine into state with ' - 'provisioned status.', - 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, - 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, - 'type': 'object'}, - 'ModelGet': {'description': 'ModelGet implements the ' - 'server-side part of the\n' - 'model-config CLI command.', - 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, - 'type': 'object'}, - 'ModelInfo': {'description': 'ModelInfo returns information ' - 'about the current model.', - 'properties': {'Result': {'$ref': '#/definitions/ModelInfo'}}, - 'type': 'object'}, - 'ModelSet': {'description': 'ModelSet implements the ' - 'server-side part of the\n' - 'set-model-config CLI command.', - 'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, - 'type': 'object'}, - 'ModelUnset': {'description': 'ModelUnset implements the ' - 'server-side part of the\n' - 'set-model-config CLI command.', - 'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, - 'type': 'object'}, - 'ModelUserInfo': {'description': 'ModelUserInfo returns ' - 'information on all users in ' - 'the model.', - 'properties': {'Result': {'$ref': '#/definitions/ModelUserInfoResults'}}, - 'type': 'object'}, - 'PrivateAddress': {'description': 'PrivateAddress implements ' - 'the server side of ' - 'Client.PrivateAddress.', - 'properties': {'Params': {'$ref': '#/definitions/PrivateAddress'}, - 'Result': {'$ref': '#/definitions/PrivateAddressResults'}}, - 'type': 'object'}, - 'ProvisioningScript': {'description': 'ProvisioningScript ' - 'returns a shell script ' - 'that, when run,\n' - 'provisions a machine ' - 'agent on the machine ' - 'executing the script.', - 'properties': {'Params': {'$ref': '#/definitions/ProvisioningScriptParams'}, - 'Result': {'$ref': '#/definitions/ProvisioningScriptResult'}}, - 'type': 'object'}, - 'PublicAddress': {'description': 'PublicAddress implements the ' - 'server side of ' - 'Client.PublicAddress.', - 'properties': {'Params': {'$ref': '#/definitions/PublicAddress'}, - 'Result': {'$ref': '#/definitions/PublicAddressResults'}}, - 'type': 'object'}, - 'ResolveCharms': {'description': 'ResolveCharms resolves the ' - 'best available charm URLs ' - 'with series, for charm\n' - 'locations without a series ' - 'specified.\n' - '\n' - 'NOTE: ResolveCharms is ' - 'deprecated as of juju 2.9 ' - 'and charms facade version ' - '3.\n' - 'Please discontinue use and ' - 'move to the charms facade ' - 'version.\n' - '\n' - 'TODO: remove in juju 3.0', - 'properties': {'Params': {'$ref': '#/definitions/ResolveCharms'}, - 'Result': {'$ref': '#/definitions/ResolveCharmResults'}}, - 'type': 'object'}, - 'Resolved': {'description': 'Resolved implements the server ' - 'side of Client.Resolved.', - 'properties': {'Params': {'$ref': '#/definitions/Resolved'}}, - 'type': 'object'}, - 'RetryProvisioning': {'description': 'RetryProvisioning marks ' - 'a provisioning error as ' - 'transient on the ' - 'machines.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SLALevel': {'description': 'SLALevel returns the current sla ' - 'level for the model.', - 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, - 'type': 'object'}, - 'SetModelAgentVersion': {'description': 'SetModelAgentVersion ' - 'sets the model agent ' - 'version.', - 'properties': {'Params': {'$ref': '#/definitions/SetModelAgentVersion'}}, - 'type': 'object'}, - 'SetModelConstraints': {'description': 'SetModelConstraints ' - 'sets the constraints ' - 'for the model.', - 'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, - 'type': 'object'}, - 'SetSLALevel': {'description': 'SetSLALevel sets the sla level ' - 'on the model.', - 'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, - 'type': 'object'}, - 'StatusHistory': {'description': 'StatusHistory returns a ' - 'slice of past statuses for ' - 'several entities.', - 'properties': {'Params': {'$ref': '#/definitions/StatusHistoryRequests'}, - 'Result': {'$ref': '#/definitions/StatusHistoryResults'}}, - 'type': 'object'}, - 'WatchAll': {'description': 'WatchAll initiates a watcher for ' - 'entities in the connected model.', - 'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(APIHostPortsResult) - async def APIHostPorts(self): - ''' - APIHostPorts returns the API host/port addresses stored in state. - - - Returns -> APIHostPortsResult - ''' - - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='APIHostPorts', - version=5, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def AbortCurrentUpgrade(self): - ''' - AbortCurrentUpgrade aborts and archives the current upgrade - synchronisation record, if any. - - - Returns -> None - ''' - - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AbortCurrentUpgrade', - version=5, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def AddCharm(self, channel=None, force=None, url=None): - ''' - NOTE: AddCharm is deprecated as of juju 2.9 and charms facade version 3. - Please discontinue use and move to the charms facade version. - - TODO: remove in juju 3.0 - - channel : str - force : bool - url : str - Returns -> None - ''' - 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 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='Client', - request='AddCharm', - version=5, - params=_params) - _params['channel'] = channel - _params['force'] = force - _params['url'] = url - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def AddCharmWithAuthorization(self, channel=None, force=None, macaroon=None, url=None): - ''' - AddCharmWithAuthorization adds the given charm URL (which must include - revision) to the model, if it does not exist yet. Local charms are not - supported, only charm store URLs. See also AddLocalCharm(). - - The authorization macaroon, args.CharmStoreMacaroon, may be omitted, in - which case this call is equivalent to AddCharm. - - NOTE: AddCharmWithAuthorization is deprecated as of juju 2.9 and charms - facade version 3. Please discontinue use and move to the charms facade - version. - - TODO: remove in juju 3.0 - - channel : str - force : bool - macaroon : Macaroon - url : str - Returns -> None - ''' - 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 macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): - raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) - - 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='Client', - request='AddCharmWithAuthorization', - version=5, - params=_params) - _params['channel'] = channel - _params['force'] = force - _params['macaroon'] = macaroon - _params['url'] = url - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AddMachinesResults) - async def AddMachines(self, params=None): - ''' - AddMachines adds new machines with the supplied parameters. - - 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='Client', - request='AddMachines', - version=5, - params=_params) - _params['params'] = params - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AddMachinesResults) - async def AddMachinesV2(self, params=None): - ''' - AddMachinesV2 adds new machines with the supplied parameters. - - 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='Client', - request='AddMachinesV2', - version=5, - params=_params) - _params['params'] = params - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AgentVersionResult) - async def AgentVersion(self): - ''' - AgentVersion returns the current version that the API server is running. - - - Returns -> AgentVersionResult - ''' - - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='AgentVersion', - version=5, - params=_params) - - 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='Client', - request='CACert', - version=5, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def DestroyMachines(self, force=None, machine_names=None): - ''' - DestroyMachines removes a given set of machines. - - force : bool - machine_names : typing.Sequence[str] - Returns -> None - ''' - if force is not None and not isinstance(force, bool): - raise Exception("Expected force to be a bool, received: {}".format(type(force))) - - if machine_names is not None and not isinstance(machine_names, (bytes, str, list)): - raise Exception("Expected machine_names to be a Sequence, received: {}".format(type(machine_names))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='DestroyMachines', - version=5, - params=_params) - _params['force'] = force - _params['machine-names'] = machine_names - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(FindToolsResult) - async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, number=None, os_type=None, series=None): - ''' - FindTools returns a List containing all tools matching the given parameters. - - agentstream : str - arch : str - major : int - minor : int - number : Number - os_type : str - series : 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 minor is not None and not isinstance(minor, int): - raise Exception("Expected minor to be a int, received: {}".format(type(minor))) - - 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))) - - if series is not None and not isinstance(series, (bytes, str)): - raise Exception("Expected series to be a str, received: {}".format(type(series))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='FindTools', - version=5, - params=_params) - _params['agentstream'] = agentstream - _params['arch'] = arch - _params['major'] = major - _params['minor'] = minor - _params['number'] = number - _params['os-type'] = os_type - _params['series'] = series - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(FullStatus) - async def 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=5, - params=_params) - _params['patterns'] = patterns - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(BundleChangesResults) - async def GetBundleChanges(self, bundleurl=None, yaml=None): - ''' - GetBundleChanges 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. - Deprecated: clients should use the GetChanges endpoint on the Bundle facade. - Note: any new feature in the future like devices will never be supported here. - - 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='Client', - request='GetBundleChanges', - version=5, - params=_params) - _params['bundleURL'] = bundleurl - _params['yaml'] = yaml - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(GetConstraintsResults) - async def GetModelConstraints(self): - ''' - GetModelConstraints returns the constraints for the model. - - - Returns -> GetConstraintsResults - ''' - - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='GetModelConstraints', - version=5, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(AddMachinesResults) - async def InjectMachines(self, params=None): - ''' - InjectMachines injects a machine into state with provisioned status. - - 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='Client', - request='InjectMachines', - version=5, - params=_params) - _params['params'] = params - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ModelConfigResults) - async def 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='Client', - request='ModelGet', - version=5, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ModelInfo) - async def ModelInfo(self): - ''' - ModelInfo returns information about the current model. - - - Returns -> ModelInfo - ''' - - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ModelInfo', - version=5, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def 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='Client', - request='ModelSet', - version=5, - params=_params) - _params['config'] = config - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def 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='Client', - request='ModelUnset', - version=5, - params=_params) - _params['keys'] = keys - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ModelUserInfoResults) - async def ModelUserInfo(self): - ''' - ModelUserInfo returns information on all users in the model. - - - Returns -> ModelUserInfoResults - ''' - - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ModelUserInfo', - version=5, - params=_params) - - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(PrivateAddressResults) - async def PrivateAddress(self, target=None): - ''' - PrivateAddress implements the server side of Client.PrivateAddress. - - target : str - Returns -> PrivateAddressResults - ''' - if target is not None and not isinstance(target, (bytes, str)): - raise Exception("Expected target to be a str, received: {}".format(type(target))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='PrivateAddress', - version=5, - params=_params) - _params['target'] = target - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ProvisioningScriptResult) - async def 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='Client', - request='ProvisioningScript', - version=5, - params=_params) - _params['data-dir'] = data_dir - _params['disable-package-commands'] = disable_package_commands - _params['machine-id'] = machine_id - _params['nonce'] = nonce - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(PublicAddressResults) - async def PublicAddress(self, target=None): - ''' - PublicAddress implements the server side of Client.PublicAddress. - - target : str - Returns -> PublicAddressResults - ''' - if target is not None and not isinstance(target, (bytes, str)): - raise Exception("Expected target to be a str, received: {}".format(type(target))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='PublicAddress', - version=5, - params=_params) - _params['target'] = target - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ResolveCharmResults) - async def ResolveCharms(self, references=None): - ''' - ResolveCharms resolves the best available charm URLs with series, for charm - locations without a series specified. - - NOTE: ResolveCharms is deprecated as of juju 2.9 and charms facade version 3. - Please discontinue use and move to the charms facade version. - - TODO: remove in juju 3.0 - - references : typing.Sequence[str] - Returns -> ResolveCharmResults - ''' - if references is not None and not isinstance(references, (bytes, str, list)): - raise Exception("Expected references to be a Sequence, received: {}".format(type(references))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='ResolveCharms', - version=5, - params=_params) - _params['references'] = references - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(None) - async def Resolved(self, retry=None, unit_name=None): - ''' - Resolved implements the server side of Client.Resolved. - - retry : bool - unit_name : str - Returns -> None - ''' - if retry is not None and not isinstance(retry, bool): - raise Exception("Expected retry to be a bool, received: {}".format(type(retry))) - - if unit_name is not None and not isinstance(unit_name, (bytes, str)): - raise Exception("Expected unit_name to be a str, received: {}".format(type(unit_name))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='Resolved', - version=5, - params=_params) - _params['retry'] = retry - _params['unit-name'] = unit_name - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(ErrorResults) - async def RetryProvisioning(self, entities=None): - ''' - RetryProvisioning marks a provisioning error as transient on the 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='Client', - request='RetryProvisioning', - version=5, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - - - @ReturnMapping(StringResult) - async def SLALevel(self): - ''' - SLALevel returns the current sla level for the model. - - - Returns -> StringResult - ''' - - # map input types to rpc msg - _params = dict() - msg = dict(type='Client', - request='SLALevel', - version=5, - params=_params) - - reply = await self.rpc(msg) - return reply - - + 'type': 'array'}, + 'is-up': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'space': {'type': 'string'}}, + 'required': ['ip-addresses', + 'mac-address', + 'is-up'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'RelationStatus': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'$ref': '#/definitions/EndpointStatus'}, + 'type': 'array'}, + 'id': {'type': 'integer'}, + 'interface': {'type': 'string'}, + 'key': {'type': 'string'}, + 'scope': {'type': 'string'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}}, + 'required': ['id', + 'key', + 'interface', + 'scope', + 'endpoints', + 'status'], + 'type': 'object'}, + 'RemoteApplicationStatus': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'err': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}}, + 'required': ['offer-url', + 'offer-name', + 'endpoints', + 'life', + 'relations', + 'status'], + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'StatusHistoryFilter': {'additionalProperties': False, + 'properties': {'date': {'format': 'date-time', + 'type': 'string'}, + 'delta': {'type': 'integer'}, + 'exclude': {'items': {'type': 'string'}, + 'type': 'array'}, + 'size': {'type': 'integer'}}, + 'required': ['size', + 'date', + 'delta', + 'exclude'], + 'type': 'object'}, + 'StatusHistoryRequest': {'additionalProperties': False, + 'properties': {'filter': {'$ref': '#/definitions/StatusHistoryFilter'}, + 'historyKind': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tag': {'type': 'string'}}, + 'required': ['historyKind', + 'size', + 'filter', + 'tag'], + 'type': 'object'}, + 'StatusHistoryRequests': {'additionalProperties': False, + 'properties': {'requests': {'items': {'$ref': '#/definitions/StatusHistoryRequest'}, + 'type': 'array'}}, + 'required': ['requests'], + 'type': 'object'}, + 'StatusHistoryResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'history': {'$ref': '#/definitions/History'}}, + 'required': ['history'], + 'type': 'object'}, + 'StatusHistoryResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusHistoryResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusParams': {'additionalProperties': False, + 'properties': {'patterns': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['patterns'], + 'type': 'object'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'UnitStatus': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'agent-status': {'$ref': '#/definitions/DetailedStatus'}, + 'charm': {'type': 'string'}, + 'leader': {'type': 'boolean'}, + 'machine': {'type': 'string'}, + 'opened-ports': {'items': {'type': 'string'}, + 'type': 'array'}, + 'provider-id': {'type': 'string'}, + 'public-address': {'type': 'string'}, + 'subordinates': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, + 'type': 'object'}, + 'workload-status': {'$ref': '#/definitions/DetailedStatus'}, + 'workload-version': {'type': 'string'}}, + 'required': ['agent-status', + 'workload-status', + 'workload-version', + 'machine', + 'opened-ports', + 'public-address', + 'charm', + 'subordinates'], + 'type': 'object'}}, + 'properties': {'FindTools': {'description': 'FindTools returns a List ' + 'containing all tools matching ' + 'the given parameters.', + 'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, + 'Result': {'$ref': '#/definitions/FindToolsResult'}}, + 'type': 'object'}, + 'FullStatus': {'description': 'FullStatus gives the ' + 'information needed for juju ' + 'status over the api', + 'properties': {'Params': {'$ref': '#/definitions/StatusParams'}, + 'Result': {'$ref': '#/definitions/FullStatus'}}, + 'type': 'object'}, + 'StatusHistory': {'description': 'StatusHistory returns a ' + 'slice of past statuses for ' + 'several entities.', + 'properties': {'Params': {'$ref': '#/definitions/StatusHistoryRequests'}, + 'Result': {'$ref': '#/definitions/StatusHistoryResults'}}, + 'type': 'object'}, + 'WatchAll': {'description': 'WatchAll initiates a watcher for ' + 'entities in the connected model.', + 'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, + 'type': 'object'}}, + 'type': 'object'} + - @ReturnMapping(None) - async def SetModelAgentVersion(self, agent_stream=None, force=None, version=None): + @ReturnMapping(FindToolsResult) + async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, number=None, os_type=None): ''' - SetModelAgentVersion sets the model agent version. + FindTools returns a List containing all tools matching the given parameters. - agent_stream : str - force : bool - version : Number - Returns -> None + agentstream : str + arch : str + major : int + minor : int + number : Number + os_type : str + Returns -> FindToolsResult ''' - 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 force is not None and not isinstance(force, bool): - raise Exception("Expected force to be a bool, received: {}".format(type(force))) - - 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='Client', - request='SetModelAgentVersion', - version=5, - params=_params) - _params['agent-stream'] = agent_stream - _params['force'] = force - _params['version'] = version - reply = await self.rpc(msg) - return reply + 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))) - @ReturnMapping(None) - async def SetModelConstraints(self, application=None, constraints=None): - ''' - SetModelConstraints sets the constraints for the model. + if minor is not None and not isinstance(minor, int): + raise Exception("Expected minor to be a int, received: {}".format(type(minor))) - 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 number is not None and not isinstance(number, (dict, Number)): + raise Exception("Expected number to be a Number, received: {}".format(type(number))) - if constraints is not None and not isinstance(constraints, (dict, Value)): - raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + 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='SetModelConstraints', + request='FindTools', version=5, params=_params) - _params['application'] = application - _params['constraints'] = constraints + _params['agentstream'] = agentstream + _params['arch'] = arch + _params['major'] = major + _params['minor'] = minor + _params['number'] = number + _params['os-type'] = os_type reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def SetSLALevel(self, modelslainfo=None, creds=None, level=None, owner=None): + @ReturnMapping(FullStatus) + async def FullStatus(self, patterns=None): ''' - SetSLALevel sets the sla level on the model. + FullStatus gives the information needed for juju status over the api - modelslainfo : ModelSLAInfo - creds : typing.Sequence[int] - level : str - owner : str - Returns -> None + patterns : typing.Sequence[str] + Returns -> FullStatus ''' - 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))) + 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='SetSLALevel', + request='FullStatus', version=5, params=_params) - _params['ModelSLAInfo'] = modelslainfo - _params['creds'] = creds - _params['level'] = level - _params['owner'] = owner + _params['patterns'] = patterns reply = await self.rpc(msg) return reply @@ -6657,11 +5326,6 @@ class MachinerFacade(Type): 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - 'type': 'object'}, 'StringsResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'result': {'items': {'type': 'string'}, @@ -6697,17 +5361,6 @@ class MachinerFacade(Type): 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/LifeResults'}}, 'type': 'object'}, - 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' - 'that this machine resides in.\n' - 'It is implemented here directly ' - 'as a result of removing it from\n' - 'embedded APIAddresser *without* ' - 'bumping the facade version.\n' - 'It should be blanked when this ' - 'facade version is next ' - 'incremented.', - 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, - 'type': 'object'}, 'RecordAgentStartInformation': {'description': 'RecordAgentStartInformation ' 'syncs the ' 'machine model ' @@ -6877,30 +5530,6 @@ async def Life(self, entities=None): - @ReturnMapping(StringResult) - async def ModelUUID(self): - ''' - ModelUUID returns the model UUID that this machine 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='Machiner', - request='ModelUUID', - version=5, - params=_params) - - reply = await self.rpc(msg) - return reply - - - @ReturnMapping(ErrorResults) async def RecordAgentStartInformation(self, args=None): ''' diff --git a/juju/client/_client7.py b/juju/client/_client7.py index 5b84a1e6f..fdb123ba9 100644 --- a/juju/client/_client7.py +++ b/juju/client/_client7.py @@ -5,6 +5,532 @@ from juju.client._definitions import * +class ActionFacade(Type): + name = 'Action' + version = 7 + schema = {'definitions': {'Action': {'additionalProperties': False, + 'properties': {'execution-group': {'type': 'string'}, + 'name': {'type': 'string'}, + 'parallel': {'type': 'boolean'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionMessage': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}}, + 'required': ['timestamp', 'message'], + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'log': {'items': {'$ref': '#/definitions/ActionMessage'}, + 'type': 'array'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'Actions': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/Action'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ApplicationCharmActionsResult': {'additionalProperties': False, + 'properties': {'actions': {'patternProperties': {'.*': {'$ref': '#/definitions/ActionSpec'}}, + 'type': 'object'}, + 'application-tag': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ApplicationsCharmActionsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationCharmActionsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'EnqueuedActions': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}, + 'operation': {'type': 'string'}}, + 'required': ['operation'], + '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'}, + 'OperationQueryArgs': {'additionalProperties': False, + 'properties': {'actions': {'items': {'type': 'string'}, + 'type': 'array'}, + 'applications': {'items': {'type': 'string'}, + 'type': 'array'}, + 'limit': {'type': 'integer'}, + 'machines': {'items': {'type': 'string'}, + 'type': 'array'}, + 'offset': {'type': 'integer'}, + 'status': {'items': {'type': 'string'}, + 'type': 'array'}, + 'units': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'OperationResult': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'fail': {'type': 'string'}, + 'operation': {'type': 'string'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}, + 'summary': {'type': 'string'}}, + 'required': ['operation', 'summary'], + 'type': 'object'}, + 'OperationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/OperationResult'}, + 'type': 'array'}, + 'truncated': {'type': 'boolean'}}, + 'type': 'object'}, + 'RunParams': {'additionalProperties': False, + 'properties': {'applications': {'items': {'type': 'string'}, + 'type': 'array'}, + 'commands': {'type': 'string'}, + 'execution-group': {'type': 'string'}, + 'machines': {'items': {'type': 'string'}, + 'type': 'array'}, + 'parallel': {'type': 'boolean'}, + 'timeout': {'type': 'integer'}, + 'units': {'items': {'type': 'string'}, + 'type': 'array'}, + 'workload-context': {'type': 'boolean'}}, + 'required': ['commands', 'timeout'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'Actions': {'description': 'Actions takes a list of ' + 'ActionTags, and returns the full ' + 'Action for\n' + 'each ID.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'ApplicationsCharmsActions': {'description': 'ApplicationsCharmsActions ' + 'returns a slice ' + 'of charm Actions ' + 'for a slice of\n' + 'services.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationsCharmActionsResults'}}, + 'type': 'object'}, + 'Cancel': {'description': 'Cancel attempts to cancel enqueued ' + 'Actions from running.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'EnqueueOperation': {'description': 'EnqueueOperation takes a ' + 'list of Actions and ' + 'queues them up to be ' + 'executed as\n' + 'an operation, each action ' + 'running as a task on the ' + 'designated ' + 'ActionReceiver.\n' + 'We return the ID of the ' + 'overall operation and ' + 'each individual task.', + 'properties': {'Params': {'$ref': '#/definitions/Actions'}, + 'Result': {'$ref': '#/definitions/EnqueuedActions'}}, + 'type': 'object'}, + 'ListOperations': {'description': 'ListOperations fetches the ' + 'called actions for ' + 'specified apps/units.', + 'properties': {'Params': {'$ref': '#/definitions/OperationQueryArgs'}, + 'Result': {'$ref': '#/definitions/OperationResults'}}, + 'type': 'object'}, + 'Operations': {'description': 'Operations fetches the ' + 'specified operation ids.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/OperationResults'}}, + 'type': 'object'}, + 'Run': {'description': 'Run the commands specified on the ' + 'machines identified through the\n' + 'list of machines, units and services.', + 'properties': {'Params': {'$ref': '#/definitions/RunParams'}, + 'Result': {'$ref': '#/definitions/EnqueuedActions'}}, + 'type': 'object'}, + 'RunOnAllMachines': {'description': 'RunOnAllMachines attempts ' + 'to run the specified ' + 'command on all the ' + 'machines.', + 'properties': {'Params': {'$ref': '#/definitions/RunParams'}, + 'Result': {'$ref': '#/definitions/EnqueuedActions'}}, + 'type': 'object'}, + 'WatchActionsProgress': {'description': 'WatchActionsProgress ' + 'creates a watcher ' + 'that reports on ' + 'action log messages.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ActionResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationsCharmActionsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(EnqueuedActions) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(OperationResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(OperationResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(EnqueuedActions) + async def 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. + + 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='Run', + 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(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) + 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 CloudFacade(Type): name = 'Cloud' version = 7 @@ -2827,6 +3353,640 @@ async def WatchUnits(self, entities=None): +class MachineManagerFacade(Type): + name = 'MachineManager' + version = 7 + schema = {'definitions': {'AddMachineParams': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'container-type': {'type': 'string'}, + 'disks': {'items': {'$ref': '#/definitions/Constraints'}, + 'type': 'array'}, + 'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'instance-id': {'type': 'string'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'parent-id': {'type': 'string'}, + 'placement': {'$ref': '#/definitions/Placement'}, + 'series': {'type': 'string'}}, + 'required': ['series', + 'constraints', + 'jobs', + 'parent-id', + 'container-type', + 'instance-id', + 'nonce', + 'hardware-characteristics', + 'addresses'], + 'type': 'object'}, + 'AddMachines': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'AddMachinesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'machine': {'type': 'string'}}, + 'required': ['machine'], + 'type': 'object'}, + 'AddMachinesResults': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'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'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'DestroyMachineInfo': {'additionalProperties': False, + 'properties': {'destroyed-containers': {'items': {'$ref': '#/definitions/DestroyMachineResult'}, + 'type': 'array'}, + 'destroyed-storage': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'destroyed-units': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'detached-storage': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'machine-id': {'type': 'string'}}, + 'required': ['machine-id'], + 'type': 'object'}, + 'DestroyMachineResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'$ref': '#/definitions/DestroyMachineInfo'}}, + 'type': 'object'}, + 'DestroyMachineResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/DestroyMachineResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'DestroyMachinesParams': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'keep': {'type': 'boolean'}, + 'machine-tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'max-wait': {'type': 'integer'}}, + 'required': ['machine-tags'], + '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'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'root-disk-source': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceType': {'additionalProperties': False, + 'properties': {'arches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cost': {'type': 'integer'}, + 'cpu-cores': {'type': 'integer'}, + 'deprecated': {'type': 'boolean'}, + 'memory': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'root-disk': {'type': 'integer'}, + 'virt-type': {'type': 'string'}}, + 'required': ['arches', 'cpu-cores', 'memory'], + 'type': 'object'}, + 'InstanceTypesResult': {'additionalProperties': False, + 'properties': {'cost-currency': {'type': 'string'}, + 'cost-divisor': {'type': 'integer'}, + 'cost-unit': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'instance-types': {'items': {'$ref': '#/definitions/InstanceType'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceTypesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InstanceTypesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelInstanceTypesConstraint': {'additionalProperties': False, + 'properties': {'value': {'$ref': '#/definitions/Value'}}, + 'type': 'object'}, + 'ModelInstanceTypesConstraints': {'additionalProperties': False, + 'properties': {'constraints': {'items': {'$ref': '#/definitions/ModelInstanceTypesConstraint'}, + 'type': 'array'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'ProvisioningScriptParams': {'additionalProperties': False, + 'properties': {'data-dir': {'type': 'string'}, + 'disable-package-commands': {'type': 'boolean'}, + 'machine-id': {'type': 'string'}, + 'nonce': {'type': 'string'}}, + 'required': ['machine-id', + 'nonce', + 'data-dir', + 'disable-package-commands'], + 'type': 'object'}, + 'ProvisioningScriptResult': {'additionalProperties': False, + 'properties': {'script': {'type': 'string'}}, + 'required': ['script'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpgradeSeriesNotificationParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['entity', + 'watcher-id'], + 'type': 'object'}, + 'UpgradeSeriesNotificationParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesNotificationParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesUnitsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + 'type': 'object'}, + 'UpgradeSeriesUnitsResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/UpgradeSeriesUnitsResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'AddMachines': {'description': 'AddMachines adds new machines ' + 'with the supplied parameters.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'DestroyMachineWithParams': {'description': 'DestroyMachineWithParams ' + 'removes a set of ' + 'machines from the ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyMachinesParams'}, + 'Result': {'$ref': '#/definitions/DestroyMachineResults'}}, + 'type': 'object'}, + 'GetUpgradeSeriesMessages': {'description': 'GetUpgradeSeriesMessages ' + 'returns all new ' + 'messages ' + 'associated with ' + 'upgrade\n' + 'series events. ' + 'Messages that ' + 'have already been ' + 'retrieved once ' + 'are not\n' + 'returned by this ' + 'method.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesNotificationParams'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'InstanceTypes': {'description': 'InstanceTypes returns ' + 'instance type information ' + 'for the cloud and region\n' + 'in which the current model ' + 'is deployed.', + 'properties': {'Params': {'$ref': '#/definitions/ModelInstanceTypesConstraints'}, + 'Result': {'$ref': '#/definitions/InstanceTypesResults'}}, + 'type': 'object'}, + 'ProvisioningScript': {'description': 'ProvisioningScript ' + 'returns a shell script ' + 'that, when run,\n' + 'provisions a machine ' + 'agent on the machine ' + 'executing the script.', + 'properties': {'Params': {'$ref': '#/definitions/ProvisioningScriptParams'}, + 'Result': {'$ref': '#/definitions/ProvisioningScriptResult'}}, + 'type': 'object'}, + 'RetryProvisioning': {'description': 'RetryProvisioning marks ' + 'a provisioning error as ' + 'transient on the ' + 'machines.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpgradeSeriesComplete': {'description': 'UpgradeSeriesComplete ' + 'marks a machine as ' + 'having completed a ' + 'managed series\n' + 'upgrade.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'UpgradeSeriesPrepare': {'description': 'UpgradeSeriesPrepare ' + 'prepares a machine ' + 'for a OS series ' + 'upgrade.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'UpgradeSeriesValidate': {'description': 'UpgradeSeriesValidate ' + 'validates that the ' + 'incoming arguments ' + 'correspond to a\n' + 'valid series upgrade ' + 'for the target ' + 'machine.\n' + 'If they do, a list ' + "of the machine's " + 'current units is ' + 'returned for use in\n' + 'soliciting user ' + 'confirmation of the ' + 'command.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesUnitsResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'description': 'WatchUpgradeSeriesNotifications ' + 'returns a ' + 'watcher ' + 'that fires ' + 'on ' + 'upgrade\n' + 'series ' + 'events.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddMachinesResults) + async def AddMachines(self, params=None): + ''' + AddMachines adds new machines with the supplied parameters. + + 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=7, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyMachineResults) + async def DestroyMachineWithParams(self, force=None, keep=None, machine_tags=None, max_wait=None): + ''' + DestroyMachineWithParams removes a set of machines from the model. + + force : bool + keep : bool + machine_tags : typing.Sequence[str] + max_wait : int + Returns -> DestroyMachineResults + ''' + 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=7, + params=_params) + _params['force'] = force + _params['keep'] = keep + _params['machine-tags'] = machine_tags + _params['max-wait'] = max_wait + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def 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=7, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InstanceTypesResults) + async def 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=7, + params=_params) + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProvisioningScriptResult) + async def 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=7, + params=_params) + _params['data-dir'] = data_dir + _params['disable-package-commands'] = disable_package_commands + _params['machine-id'] = machine_id + _params['nonce'] = nonce + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RetryProvisioning(self, entities=None): + ''' + RetryProvisioning marks a provisioning error as transient on the 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='MachineManager', + request='RetryProvisioning', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + async def UpgradeSeriesComplete(self, force=None, series=None, tag=None): + ''' + UpgradeSeriesComplete marks a machine as having completed a managed series + upgrade. + + force : bool + series : str + tag : Entity + Returns -> ErrorResult + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + 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=7, + params=_params) + _params['force'] = force + _params['series'] = series + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + async def UpgradeSeriesPrepare(self, force=None, series=None, tag=None): + ''' + UpgradeSeriesPrepare prepares a machine for a OS series upgrade. + + force : bool + series : str + tag : Entity + Returns -> ErrorResult + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + 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=7, + params=_params) + _params['force'] = force + _params['series'] = series + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesUnitsResults) + async def 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[~UpdateSeriesArg] + 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=7, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + class ModelManagerFacade(Type): name = 'ModelManager' version = 7 diff --git a/juju/client/_client9.py b/juju/client/_client9.py index c29cc236b..22a04a3f7 100644 --- a/juju/client/_client9.py +++ b/juju/client/_client9.py @@ -2851,8 +2851,10 @@ class ModelManagerFacade(Type): 'display-name': {'type': 'string'}, 'last-connection': {'format': 'date-time', 'type': 'string'}, + 'model-tag': {'type': 'string'}, 'user': {'type': 'string'}}, - 'required': ['user', + 'required': ['model-tag', + 'user', 'display-name', 'last-connection', 'access'], @@ -2934,17 +2936,7 @@ class ModelManagerFacade(Type): 'properties': {'user-models': {'items': {'$ref': '#/definitions/UserModel'}, 'type': 'array'}}, 'required': ['user-models'], - 'type': 'object'}, - 'ValidateModelUpgradeParam': {'additionalProperties': False, - 'properties': {'model-tag': {'type': 'string'}}, - 'required': ['model-tag'], - 'type': 'object'}, - 'ValidateModelUpgradeParams': {'additionalProperties': False, - 'properties': {'force': {'type': 'boolean'}, - 'model': {'items': {'$ref': '#/definitions/ValidateModelUpgradeParam'}, - 'type': 'array'}}, - 'required': ['model', 'force'], - 'type': 'object'}}, + 'type': 'object'}}, 'properties': {'ChangeModelCredential': {'description': 'ChangeModelCredential ' 'changes cloud ' 'credential reference ' @@ -3060,30 +3052,7 @@ class ModelManagerFacade(Type): 'default model settings.', 'properties': {'Params': {'$ref': '#/definitions/UnsetModelDefaults'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'ValidateModelUpgrades': {'description': 'ValidateModelUpgrades ' - 'validates if a model ' - 'is allowed to ' - 'perform an upgrade.\n' - 'Examples of why you ' - 'would want to block ' - 'a model upgrade, ' - 'would be situations\n' - 'like upgrade-series. ' - 'If performing an ' - 'upgrade-series we ' - "don't know the\n" - 'current status of ' - 'the machine, so ' - 'performing an ' - 'upgrade-model can ' - 'lead to\n' - 'bad unintended ' - 'errors down the ' - 'line.', - 'properties': {'Params': {'$ref': '#/definitions/ValidateModelUpgradeParams'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}}, + 'type': 'object'}}, 'type': 'object'} @@ -3436,38 +3405,6 @@ async def UnsetModelDefaults(self, keys=None): - @ReturnMapping(ErrorResults) - async def ValidateModelUpgrades(self, force=None, model=None): - ''' - ValidateModelUpgrades validates if a model is allowed to perform an upgrade. - Examples of why you would want to block a model upgrade, would be situations - like upgrade-series. If performing an upgrade-series we don't know the - current status of the machine, so performing an upgrade-model can lead to - bad unintended errors down the line. - - force : bool - model : typing.Sequence[~ValidateModelUpgradeParam] - 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 model is not None and not isinstance(model, (bytes, str, list)): - raise Exception("Expected model to be a Sequence, received: {}".format(type(model))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelManager', - request='ValidateModelUpgrades', - version=9, - params=_params) - _params['force'] = force - _params['model'] = model - reply = await self.rpc(msg) - return reply - - - class ProvisionerFacade(Type): name = 'Provisioner' version = 9 diff --git a/juju/client/_definitions.py b/juju/client/_definitions.py index 89d15c567..69c74c262 100644 --- a/juju/client/_definitions.py +++ b/juju/client/_definitions.py @@ -23,24 +23,34 @@ def __init__(self, servers=None, **unknown_fields): class Action(Type): - _toSchema = {'name': 'name', 'parameters': 'parameters', 'receiver': 'receiver', 'tag': 'tag'} - _toPy = {'name': 'name', 'parameters': 'parameters', 'receiver': 'receiver', 'tag': 'tag'} - def __init__(self, name=None, parameters=None, receiver=None, tag=None, **unknown_fields): + _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 name : str + parallel : bool parameters : typing.Mapping[str, typing.Any] receiver : str tag : str ''' + execution_group_ = execution_group name_ = name + parallel_ = parallel parameters_ = parameters receiver_ = receiver tag_ = tag # Validate arguments against known Juju API types. + 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 name_ is not None and not isinstance(name_, (bytes, str)): raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + if parallel_ is not None and not isinstance(parallel_, bool): + raise Exception("Expected parallel_ to be a bool, received: {}".format(type(parallel_))) + if parameters_ is not None and not isinstance(parameters_, dict): raise Exception("Expected parameters_ to be a Mapping, received: {}".format(type(parameters_))) @@ -50,7 +60,9 @@ def __init__(self, name=None, parameters=None, receiver=None, tag=None, **unknow if tag_ is not None and not isinstance(tag_, (bytes, str)): raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + self.execution_group = execution_group_ self.name = name_ + self.parallel = parallel_ self.parameters = parameters_ self.receiver = receiver_ self.tag = tag_ @@ -2639,9 +2651,9 @@ def __init__(self, applicationrelationswatcherid=None, changes=None, error=None, class ApplicationResult(Type): - _toSchema = {'channel': 'channel', 'charm': 'charm', 'constraints': 'constraints', 'endpoint_bindings': 'endpoint-bindings', 'exposed': 'exposed', 'exposed_endpoints': 'exposed-endpoints', 'principal': 'principal', 'remote': 'remote', 'series': 'series', 'tag': 'tag'} - _toPy = {'channel': 'channel', 'charm': 'charm', 'constraints': 'constraints', 'endpoint-bindings': 'endpoint_bindings', 'exposed': 'exposed', 'exposed-endpoints': 'exposed_endpoints', 'principal': 'principal', 'remote': 'remote', 'series': 'series', 'tag': 'tag'} - def __init__(self, channel=None, charm=None, constraints=None, endpoint_bindings=None, exposed=None, exposed_endpoints=None, principal=None, remote=None, series=None, tag=None, **unknown_fields): + _toSchema = {'channel': 'channel', 'charm': 'charm', 'constraints': 'constraints', 'endpoint_bindings': 'endpoint-bindings', 'exposed': 'exposed', 'exposed_endpoints': 'exposed-endpoints', 'life': 'life', 'principal': 'principal', 'remote': 'remote', 'series': 'series', 'tag': 'tag'} + _toPy = {'channel': 'channel', 'charm': 'charm', 'constraints': 'constraints', 'endpoint-bindings': 'endpoint_bindings', 'exposed': 'exposed', 'exposed-endpoints': 'exposed_endpoints', 'life': 'life', 'principal': 'principal', 'remote': 'remote', 'series': 'series', 'tag': 'tag'} + def __init__(self, channel=None, charm=None, constraints=None, endpoint_bindings=None, exposed=None, exposed_endpoints=None, life=None, principal=None, remote=None, series=None, tag=None, **unknown_fields): ''' channel : str charm : str @@ -2649,6 +2661,7 @@ def __init__(self, channel=None, charm=None, constraints=None, endpoint_bindings endpoint_bindings : typing.Mapping[str, str] exposed : bool exposed_endpoints : typing.Mapping[str, ~ExposedEndpoint] + life : str principal : bool remote : bool series : str @@ -2660,6 +2673,7 @@ def __init__(self, channel=None, charm=None, constraints=None, endpoint_bindings endpoint_bindings_ = endpoint_bindings exposed_ = exposed exposed_endpoints_ = {k: ExposedEndpoint.from_json(v) for k, v in (exposed_endpoints or dict()).items()} + life_ = life principal_ = principal remote_ = remote series_ = series @@ -2684,6 +2698,9 @@ def __init__(self, channel=None, charm=None, constraints=None, endpoint_bindings 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_))) + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + if principal_ is not None and not isinstance(principal_, bool): raise Exception("Expected principal_ to be a bool, received: {}".format(type(principal_))) @@ -2702,6 +2719,7 @@ def __init__(self, channel=None, charm=None, constraints=None, endpoint_bindings self.endpoint_bindings = endpoint_bindings_ self.exposed = exposed_ self.exposed_endpoints = exposed_endpoints_ + self.life = life_ self.principal = principal_ self.remote = remote_ self.series = series_ @@ -3442,12 +3460,10 @@ def __init__(self, list_=None, **unknown_fields): class BackupsMetadataResult(Type): - _toSchema = {'ca_cert': 'ca-cert', 'ca_private_key': 'ca-private-key', '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', 'series': 'series', 'size': 'size', 'started': 'started', 'stored': 'stored', 'version': 'version'} - _toPy = {'ca-cert': 'ca_cert', 'ca-private-key': 'ca_private_key', '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', 'series': 'series', 'size': 'size', 'started': 'started', 'stored': 'stored', 'version': 'version'} - def __init__(self, ca_cert=None, ca_private_key=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, series=None, size=None, started=None, stored=None, version=None, **unknown_fields): + _toSchema = {'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', 'series': 'series', 'size': 'size', 'started': 'started', 'stored': 'stored', 'version': 'version'} + _toPy = {'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', 'series': 'series', 'size': 'size', 'started': 'started', 'stored': 'stored', 'version': 'version'} + def __init__(self, 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, series=None, size=None, started=None, stored=None, version=None, **unknown_fields): ''' - ca_cert : str - ca_private_key : str checksum : str checksum_format : str controller_machine_id : str @@ -3468,8 +3484,6 @@ def __init__(self, ca_cert=None, ca_private_key=None, checksum=None, checksum_fo stored : str version : Number ''' - ca_cert_ = ca_cert - ca_private_key_ = ca_private_key checksum_ = checksum checksum_format_ = checksum_format controller_machine_id_ = controller_machine_id @@ -3491,12 +3505,6 @@ def __init__(self, ca_cert=None, ca_private_key=None, checksum=None, checksum_fo version_ = Number.from_json(version) if version else None # Validate arguments against known Juju API types. - if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): - raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) - - if ca_private_key_ is not None and not isinstance(ca_private_key_, (bytes, str)): - raise Exception("Expected ca_private_key_ to be a str, received: {}".format(type(ca_private_key_))) - if checksum_ is not None and not isinstance(checksum_, (bytes, str)): raise Exception("Expected checksum_ to be a str, received: {}".format(type(checksum_))) @@ -3554,8 +3562,6 @@ def __init__(self, ca_cert=None, ca_private_key=None, checksum=None, checksum_fo if version_ is not None and not isinstance(version_, (dict, Number)): raise Exception("Expected version_ to be a Number, received: {}".format(type(version_))) - self.ca_cert = ca_cert_ - self.ca_private_key = ca_private_key_ self.checksum = checksum_ self.checksum_format = checksum_format_ self.controller_machine_id = controller_machine_id_ @@ -4378,9 +4384,9 @@ def __init__(self, images=None, **unknown_fields): class CAASApplicationProvisioningInfo(Type): - _toSchema = {'api_addresses': 'api-addresses', 'ca_cert': 'ca-cert', 'charm_modified_version': 'charm-modified-version', 'charm_url': 'charm-url', 'constraints': 'constraints', 'devices': 'devices', 'error': 'error', 'filesystems': 'filesystems', 'image_path': 'image-path', 'image_repo': 'image-repo', 'scale': 'scale', 'series': 'series', 'tags': 'tags', 'trust': 'trust', 'version': 'version', 'volumes': 'volumes'} - _toPy = {'api-addresses': 'api_addresses', 'ca-cert': 'ca_cert', 'charm-modified-version': 'charm_modified_version', 'charm-url': 'charm_url', 'constraints': 'constraints', 'devices': 'devices', 'error': 'error', 'filesystems': 'filesystems', 'image-path': 'image_path', 'image-repo': 'image_repo', 'scale': 'scale', 'series': 'series', 'tags': 'tags', 'trust': 'trust', 'version': 'version', 'volumes': 'volumes'} - def __init__(self, api_addresses=None, ca_cert=None, charm_modified_version=None, charm_url=None, constraints=None, devices=None, error=None, filesystems=None, image_path=None, image_repo=None, scale=None, series=None, tags=None, trust=None, version=None, volumes=None, **unknown_fields): + _toSchema = {'api_addresses': 'api-addresses', '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', 'series': 'series', 'tags': 'tags', 'trust': 'trust', 'version': 'version', 'volumes': 'volumes'} + _toPy = {'api-addresses': 'api_addresses', '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', 'series': 'series', 'tags': 'tags', 'trust': 'trust', 'version': 'version', 'volumes': 'volumes'} + def __init__(self, api_addresses=None, ca_cert=None, charm_modified_version=None, charm_url=None, constraints=None, devices=None, error=None, filesystems=None, image_repo=None, scale=None, series=None, tags=None, trust=None, version=None, volumes=None, **unknown_fields): ''' api_addresses : typing.Sequence[str] ca_cert : str @@ -4390,7 +4396,6 @@ def __init__(self, api_addresses=None, ca_cert=None, charm_modified_version=None devices : typing.Sequence[~KubernetesDeviceParams] error : Error filesystems : typing.Sequence[~KubernetesFilesystemParams] - image_path : str image_repo : DockerImageInfo scale : int series : str @@ -4407,7 +4412,6 @@ def __init__(self, api_addresses=None, ca_cert=None, charm_modified_version=None devices_ = [KubernetesDeviceParams.from_json(o) for o in devices or []] error_ = Error.from_json(error) if error else None filesystems_ = [KubernetesFilesystemParams.from_json(o) for o in filesystems or []] - image_path_ = image_path image_repo_ = DockerImageInfo.from_json(image_repo) if image_repo else None scale_ = scale series_ = series @@ -4441,9 +4445,6 @@ def __init__(self, api_addresses=None, ca_cert=None, charm_modified_version=None if filesystems_ is not None and not isinstance(filesystems_, (bytes, str, list)): raise Exception("Expected filesystems_ to be a Sequence, received: {}".format(type(filesystems_))) - if image_path_ is not None and not isinstance(image_path_, (bytes, str)): - raise Exception("Expected image_path_ to be a str, received: {}".format(type(image_path_))) - if image_repo_ is not None and not isinstance(image_repo_, (dict, DockerImageInfo)): raise Exception("Expected image_repo_ to be a DockerImageInfo, received: {}".format(type(image_repo_))) @@ -4473,7 +4474,6 @@ def __init__(self, api_addresses=None, ca_cert=None, charm_modified_version=None self.devices = devices_ self.error = error_ self.filesystems = filesystems_ - self.image_path = image_path_ self.image_repo = image_repo_ self.scale = scale_ self.series = series_ @@ -8229,6 +8229,84 @@ 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 + proxy_connection : DashboardConnectionProxy + ssh_connection : DashboardConnectionSSHTunnel + ''' + error_ = Error.from_json(error) if error else None + proxy_connection_ = DashboardConnectionProxy.from_json(proxy_connection) if proxy_connection else None + ssh_connection_ = DashboardConnectionSSHTunnel.from_json(ssh_connection) if ssh_connection 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 proxy_connection_ is not None and not isinstance(proxy_connection_, (dict, DashboardConnectionProxy)): + raise Exception("Expected proxy_connection_ to be a DashboardConnectionProxy, received: {}".format(type(proxy_connection_))) + + if ssh_connection_ is not None and not isinstance(ssh_connection_, (dict, DashboardConnectionSSHTunnel)): + raise Exception("Expected ssh_connection_ to be a DashboardConnectionSSHTunnel, received: {}".format(type(ssh_connection_))) + + self.error = error_ + self.proxy_connection = proxy_connection_ + self.ssh_connection = ssh_connection_ + self.unknown_fields = unknown_fields + + + +class DashboardConnectionProxy(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] + type_ : str + ''' + config_ = config + type__ = type_ + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.config = config_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class DashboardConnectionSSHTunnel(Type): + _toSchema = {'host': 'host', 'port': 'port'} + _toPy = {'host': 'host', 'port': 'port'} + def __init__(self, host=None, port=None, **unknown_fields): + ''' + host : str + port : str + ''' + host_ = host + port_ = port + + # Validate arguments against known Juju API types. + if host_ is not None and not isinstance(host_, (bytes, str)): + raise Exception("Expected host_ to be a str, received: {}".format(type(host_))) + + if port_ is not None and not isinstance(port_, (bytes, str)): + raise Exception("Expected port_ to be a str, received: {}".format(type(port_))) + + self.host = host_ + self.port = port_ + self.unknown_fields = unknown_fields + + + class Delta(Type): _toSchema = {'entity': 'entity', 'removed': 'removed'} _toPy = {'entity': 'entity', 'removed': 'removed'} @@ -8527,19 +8605,26 @@ def __init__(self, destroy_models=None, destroy_storage=None, force=None, max_wa class DestroyMachineInfo(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): + _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] destroyed_storage : typing.Sequence[~Entity] destroyed_units : typing.Sequence[~Entity] detached_storage : typing.Sequence[~Entity] + machine_id : str ''' + destroyed_containers_ = [DestroyMachineResult.from_json(o) for o in destroyed_containers or []] destroyed_storage_ = [Entity.from_json(o) for o in destroyed_storage or []] destroyed_units_ = [Entity.from_json(o) for o in destroyed_units or []] detached_storage_ = [Entity.from_json(o) for o in detached_storage or []] + machine_id_ = machine_id # Validate arguments against known Juju API types. + if destroyed_containers_ is not None and not isinstance(destroyed_containers_, (bytes, str, list)): + raise Exception("Expected destroyed_containers_ to be a Sequence, received: {}".format(type(destroyed_containers_))) + if destroyed_storage_ is not None and not isinstance(destroyed_storage_, (bytes, str, list)): raise Exception("Expected destroyed_storage_ to be a Sequence, received: {}".format(type(destroyed_storage_))) @@ -8549,9 +8634,14 @@ def __init__(self, destroyed_storage=None, destroyed_units=None, detached_storag if detached_storage_ is not None and not isinstance(detached_storage_, (bytes, str, list)): raise Exception("Expected detached_storage_ to be a Sequence, received: {}".format(type(detached_storage_))) + 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_))) + + self.destroyed_containers = destroyed_containers_ self.destroyed_storage = destroyed_storage_ self.destroyed_units = destroyed_units_ self.detached_storage = detached_storage_ + self.machine_id = machine_id_ self.unknown_fields = unknown_fields @@ -9211,20 +9301,22 @@ 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', 'unit_relation_data': 'unit-relation-data'} - _toPy = {'ApplicationData': 'applicationdata', 'cross-model': 'cross_model', 'endpoint': 'endpoint', 'related-endpoint': 'related_endpoint', 'unit-relation-data': 'unit_relation_data'} - def __init__(self, applicationdata=None, cross_model=None, endpoint=None, related_endpoint=None, unit_relation_data=None, **unknown_fields): + _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] cross_model : bool endpoint : str related_endpoint : str + relation_id : int unit_relation_data : typing.Mapping[str, ~RelationData] ''' applicationdata_ = applicationdata cross_model_ = cross_model endpoint_ = endpoint related_endpoint_ = related_endpoint + relation_id_ = relation_id unit_relation_data_ = {k: RelationData.from_json(v) for k, v in (unit_relation_data or dict()).items()} # Validate arguments against known Juju API types. @@ -9240,6 +9332,9 @@ def __init__(self, applicationdata=None, cross_model=None, endpoint=None, relate if related_endpoint_ is not None and not isinstance(related_endpoint_, (bytes, str)): raise Exception("Expected related_endpoint_ to be a str, received: {}".format(type(related_endpoint_))) + 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_relation_data_ is not None and not isinstance(unit_relation_data_, dict): raise Exception("Expected unit_relation_data_ to be a Mapping, received: {}".format(type(unit_relation_data_))) @@ -9247,6 +9342,7 @@ def __init__(self, applicationdata=None, cross_model=None, endpoint=None, relate self.cross_model = cross_model_ self.endpoint = endpoint_ self.related_endpoint = related_endpoint_ + self.relation_id = relation_id_ self.unit_relation_data = unit_relation_data_ self.unknown_fields = unknown_fields @@ -9293,10 +9389,34 @@ class EnqueuedActions(Type): _toPy = {'actions': 'actions', 'operation': 'operation'} def __init__(self, actions=None, operation=None, **unknown_fields): ''' - actions : typing.Sequence[~StringResult] + actions : typing.Sequence[~ActionResult] + operation : str + ''' + actions_ = [ActionResult.from_json(o) for o in actions or []] + operation_ = operation + + # Validate arguments against known Juju API types. + 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 operation_ is not None and not isinstance(operation_, (bytes, str)): + raise Exception("Expected operation_ to be a str, received: {}".format(type(operation_))) + + self.actions = actions_ + self.operation = operation_ + self.unknown_fields = unknown_fields + + + +class EnqueuedActionsV2(Type): + _toSchema = {'actions': 'actions', 'operation': 'operation'} + _toPy = {'actions': 'actions', 'operation': 'operation'} + def __init__(self, actions=None, operation=None, **unknown_fields): + ''' + actions : typing.Sequence[~ActionResult] operation : str ''' - actions_ = [StringResult.from_json(o) for o in actions or []] + actions_ = [ActionResult.from_json(o) for o in actions or []] operation_ = operation # Validate arguments against known Juju API types. @@ -10930,9 +11050,9 @@ def __init__(self, matches=None, **unknown_fields): class FindToolsParams(Type): - _toSchema = {'agentstream': 'agentstream', 'arch': 'arch', 'major': 'major', 'minor': 'minor', 'number': 'number', 'os_type': 'os-type', 'series': 'series'} - _toPy = {'agentstream': 'agentstream', 'arch': 'arch', 'major': 'major', 'minor': 'minor', 'number': 'number', 'os-type': 'os_type', 'series': 'series'} - def __init__(self, agentstream=None, arch=None, major=None, minor=None, number=None, os_type=None, series=None, **unknown_fields): + _toSchema = {'agentstream': 'agentstream', 'arch': 'arch', 'major': 'major', 'minor': 'minor', 'number': 'number', 'os_type': 'os-type'} + _toPy = {'agentstream': 'agentstream', 'arch': 'arch', 'major': 'major', 'minor': 'minor', 'number': 'number', 'os-type': 'os_type'} + def __init__(self, agentstream=None, arch=None, major=None, minor=None, number=None, os_type=None, **unknown_fields): ''' agentstream : str arch : str @@ -10940,7 +11060,6 @@ def __init__(self, agentstream=None, arch=None, major=None, minor=None, number=N minor : int number : Number os_type : str - series : str ''' agentstream_ = agentstream arch_ = arch @@ -10948,7 +11067,6 @@ def __init__(self, agentstream=None, arch=None, major=None, minor=None, number=N minor_ = minor number_ = Number.from_json(number) if number else None os_type_ = os_type - series_ = series # Validate arguments against known Juju API types. if agentstream_ is not None and not isinstance(agentstream_, (bytes, str)): @@ -10969,16 +11087,12 @@ def __init__(self, agentstream=None, arch=None, major=None, minor=None, number=N 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_))) - if series_ is not None and not isinstance(series_, (bytes, str)): - raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) - self.agentstream = agentstream_ self.arch = arch_ self.major = major_ self.minor = minor_ self.number = number_ self.os_type = os_type_ - self.series = series_ self.unknown_fields = unknown_fields @@ -12940,16 +13054,16 @@ 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', 'operator_image_path': 'operator-image-path', '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', 'operator-image-path': 'operator_image_path', '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, operator_image_path=None, pod_spec=None, raw_k8s_spec=None, tags=None, volumes=None, **unknown_fields): + _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 constraints : Value deployment_info : KubernetesDeploymentInfo devices : typing.Sequence[~KubernetesDeviceParams] filesystems : typing.Sequence[~KubernetesFilesystemParams] - operator_image_path : str + image_repo : DockerImageInfo pod_spec : str raw_k8s_spec : str tags : typing.Mapping[str, str] @@ -12960,7 +13074,7 @@ def __init__(self, charm_modified_version=None, constraints=None, deployment_inf deployment_info_ = KubernetesDeploymentInfo.from_json(deployment_info) if deployment_info else None devices_ = [KubernetesDeviceParams.from_json(o) for o in devices or []] filesystems_ = [KubernetesFilesystemParams.from_json(o) for o in filesystems or []] - operator_image_path_ = operator_image_path + image_repo_ = DockerImageInfo.from_json(image_repo) if image_repo else None pod_spec_ = pod_spec raw_k8s_spec_ = raw_k8s_spec tags_ = tags @@ -12982,8 +13096,8 @@ def __init__(self, charm_modified_version=None, constraints=None, deployment_inf if filesystems_ is not None and not isinstance(filesystems_, (bytes, str, list)): raise Exception("Expected filesystems_ to be a Sequence, received: {}".format(type(filesystems_))) - if operator_image_path_ is not None and not isinstance(operator_image_path_, (bytes, str)): - raise Exception("Expected operator_image_path_ to be a str, received: {}".format(type(operator_image_path_))) + if image_repo_ is not None and not isinstance(image_repo_, (dict, DockerImageInfo)): + raise Exception("Expected image_repo_ to be a DockerImageInfo, received: {}".format(type(image_repo_))) if pod_spec_ is not None and not isinstance(pod_spec_, (bytes, str)): raise Exception("Expected pod_spec_ to be a str, received: {}".format(type(pod_spec_))) @@ -13002,7 +13116,7 @@ def __init__(self, charm_modified_version=None, constraints=None, deployment_inf self.deployment_info = deployment_info_ self.devices = devices_ self.filesystems = filesystems_ - self.operator_image_path = operator_image_path_ + self.image_repo = image_repo_ self.pod_spec = pod_spec_ self.raw_k8s_spec = raw_k8s_spec_ self.tags = tags_ @@ -16478,6 +16592,24 @@ 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 + ''' + model_tag_ = model_tag + + # Validate arguments against known Juju API types. + 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_))) + + self.model_tag = model_tag_ + self.unknown_fields = unknown_fields + + + class ModelResult(Type): _toSchema = {'error': 'error', 'name': 'name', 'type_': 'type', 'uuid': 'uuid'} _toPy = {'error': 'error', 'name': 'name', 'type': 'type_', 'uuid': 'uuid'} @@ -17072,18 +17204,20 @@ 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', 'user': 'user'} - _toPy = {'access': 'access', 'display-name': 'display_name', 'last-connection': 'last_connection', 'user': 'user'} - def __init__(self, access=None, display_name=None, last_connection=None, user=None, **unknown_fields): + _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 display_name : str last_connection : str + model_tag : str user : str ''' access_ = access display_name_ = display_name last_connection_ = last_connection + model_tag_ = model_tag user_ = user # Validate arguments against known Juju API types. @@ -17096,12 +17230,16 @@ def __init__(self, access=None, display_name=None, last_connection=None, user=No if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) + 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 user_ is not None and not isinstance(user_, (bytes, str)): raise Exception("Expected user_ to be a str, received: {}".format(type(user_))) self.access = access_ self.display_name = display_name_ self.last_connection = last_connection_ + self.model_tag = model_tag_ self.user = user_ self.unknown_fields = unknown_fields @@ -19081,6 +19219,24 @@ 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 + ''' + target_controller_version_ = Number.from_json(target_controller_version) if target_controller_version else None + + # Validate arguments against known Juju API types. + 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_))) + + self.target_controller_version = target_controller_version_ + self.unknown_fields = unknown_fields + + + class PrivateAddress(Type): _toSchema = {'target': 'target'} _toPy = {'target': 'target'} @@ -19370,10 +19526,11 @@ def __init__(self, error=None, name=None, provider_id=None, subnets=None, **unkn class ProvisioningInfo(Type): - _toSchema = {'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', 'series': 'series', 'subnets_to_zones': 'subnets-to-zones', 'tags': 'tags', 'volume_attachments': 'volume-attachments', 'volumes': 'volumes'} - _toPy = {'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', 'series': 'series', 'subnets-to-zones': 'subnets_to_zones', 'tags': 'tags', 'volume-attachments': 'volume_attachments', 'volumes': 'volumes'} - def __init__(self, charm_lxd_profiles=None, cloudinit_userdata=None, constraints=None, controller_config=None, endpoint_bindings=None, image_metadata=None, jobs=None, placement=None, series=None, subnets_to_zones=None, tags=None, volume_attachments=None, volumes=None, **unknown_fields): + _toSchema = {'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', 'series': 'series', 'space_subnets': 'space-subnets', 'subnet_zones': 'subnet-zones', 'tags': 'tags', 'volume_attachments': 'volume-attachments', 'volumes': 'volumes'} + _toPy = {'ProvisioningNetworkTopology': 'provisioningnetworktopology', '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', 'series': 'series', 'space-subnets': 'space_subnets', 'subnet-zones': 'subnet_zones', 'tags': 'tags', 'volume-attachments': 'volume_attachments', 'volumes': 'volumes'} + def __init__(self, provisioningnetworktopology=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, series=None, space_subnets=None, subnet_zones=None, tags=None, volume_attachments=None, volumes=None, **unknown_fields): ''' + provisioningnetworktopology : ProvisioningNetworkTopology charm_lxd_profiles : typing.Sequence[str] cloudinit_userdata : typing.Mapping[str, typing.Any] constraints : Value @@ -19382,12 +19539,15 @@ def __init__(self, charm_lxd_profiles=None, cloudinit_userdata=None, constraints image_metadata : typing.Sequence[~CloudImageMetadata] jobs : typing.Sequence[str] placement : str + root_disk : VolumeParams series : str - subnets_to_zones : typing.Mapping[str, typing.Sequence[str]] + space_subnets : typing.Mapping[str, typing.Sequence[str]] + subnet_zones : typing.Mapping[str, typing.Sequence[str]] tags : typing.Mapping[str, str] volume_attachments : typing.Sequence[~VolumeAttachmentParams] volumes : typing.Sequence[~VolumeParams] ''' + provisioningnetworktopology_ = ProvisioningNetworkTopology.from_json(provisioningnetworktopology) if provisioningnetworktopology else None charm_lxd_profiles_ = charm_lxd_profiles cloudinit_userdata_ = cloudinit_userdata constraints_ = Value.from_json(constraints) if constraints else None @@ -19396,13 +19556,18 @@ def __init__(self, charm_lxd_profiles=None, cloudinit_userdata=None, constraints image_metadata_ = [CloudImageMetadata.from_json(o) for o in image_metadata or []] jobs_ = jobs placement_ = placement + root_disk_ = VolumeParams.from_json(root_disk) if root_disk else None series_ = series - subnets_to_zones_ = subnets_to_zones + space_subnets_ = space_subnets + subnet_zones_ = subnet_zones tags_ = tags volume_attachments_ = [VolumeAttachmentParams.from_json(o) for o in volume_attachments or []] volumes_ = [VolumeParams.from_json(o) for o in volumes or []] # Validate arguments against known Juju API types. + if provisioningnetworktopology_ is not None and not isinstance(provisioningnetworktopology_, (dict, ProvisioningNetworkTopology)): + raise Exception("Expected provisioningnetworktopology_ to be a ProvisioningNetworkTopology, received: {}".format(type(provisioningnetworktopology_))) + if charm_lxd_profiles_ is not None and not isinstance(charm_lxd_profiles_, (bytes, str, list)): raise Exception("Expected charm_lxd_profiles_ to be a Sequence, received: {}".format(type(charm_lxd_profiles_))) @@ -19427,11 +19592,17 @@ def __init__(self, charm_lxd_profiles=None, cloudinit_userdata=None, constraints if placement_ is not None and not isinstance(placement_, (bytes, str)): raise Exception("Expected placement_ to be a str, received: {}".format(type(placement_))) + if root_disk_ is not None and not isinstance(root_disk_, (dict, VolumeParams)): + raise Exception("Expected root_disk_ to be a VolumeParams, received: {}".format(type(root_disk_))) + if series_ is not None and not isinstance(series_, (bytes, str)): raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) - if subnets_to_zones_ is not None and not isinstance(subnets_to_zones_, dict): - raise Exception("Expected subnets_to_zones_ to be a Mapping, received: {}".format(type(subnets_to_zones_))) + if space_subnets_ is not None and not isinstance(space_subnets_, dict): + raise Exception("Expected space_subnets_ to be a Mapping, received: {}".format(type(space_subnets_))) + + if subnet_zones_ is not None and not isinstance(subnet_zones_, dict): + raise Exception("Expected subnet_zones_ to be a Mapping, received: {}".format(type(subnet_zones_))) if tags_ is not None and not isinstance(tags_, dict): raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) @@ -19442,6 +19613,7 @@ def __init__(self, charm_lxd_profiles=None, cloudinit_userdata=None, constraints if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + self.provisioningnetworktopology = provisioningnetworktopology_ self.charm_lxd_profiles = charm_lxd_profiles_ self.cloudinit_userdata = cloudinit_userdata_ self.constraints = constraints_ @@ -19450,8 +19622,10 @@ def __init__(self, charm_lxd_profiles=None, cloudinit_userdata=None, constraints self.image_metadata = image_metadata_ self.jobs = jobs_ self.placement = placement_ + self.root_disk = root_disk_ self.series = series_ - self.subnets_to_zones = subnets_to_zones_ + self.space_subnets = space_subnets_ + self.subnet_zones = subnet_zones_ self.tags = tags_ self.volume_attachments = volume_attachments_ self.volumes = volumes_ @@ -21479,9 +21653,9 @@ 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'} - _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'} - 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, **unknown_fields): + _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 endpoint : RemoteEndpoint @@ -21492,6 +21666,7 @@ def __init__(self, application_name=None, endpoint=None, id_=None, key=None, lif remote_endpoint_name : str source_model_uuid : str suspended : bool + unit_count : int ''' application_name_ = application_name endpoint_ = RemoteEndpoint.from_json(endpoint) if endpoint else None @@ -21502,6 +21677,7 @@ def __init__(self, application_name=None, endpoint=None, id_=None, key=None, lif remote_endpoint_name_ = remote_endpoint_name source_model_uuid_ = source_model_uuid suspended_ = suspended + unit_count_ = unit_count # Validate arguments against known Juju API types. if application_name_ is not None and not isinstance(application_name_, (bytes, str)): @@ -21531,6 +21707,9 @@ def __init__(self, application_name=None, endpoint=None, id_=None, key=None, lif if suspended_ is not None and not isinstance(suspended_, bool): raise Exception("Expected suspended_ to be a bool, received: {}".format(type(suspended_))) + if unit_count_ is not None and not isinstance(unit_count_, int): + raise Exception("Expected unit_count_ to be a int, received: {}".format(type(unit_count_))) + self.application_name = application_name_ self.endpoint = endpoint_ self.id_ = id__ @@ -21540,6 +21719,7 @@ def __init__(self, application_name=None, endpoint=None, id_=None, key=None, lif self.remote_endpoint_name = remote_endpoint_name_ self.source_model_uuid = source_model_uuid_ self.suspended = suspended_ + self.unit_count = unit_count_ self.unknown_fields = unknown_fields @@ -22919,20 +23099,24 @@ def __init__(self, credentials=None, **unknown_fields): class RunParams(Type): - _toSchema = {'applications': 'applications', 'commands': 'commands', 'machines': 'machines', 'timeout': 'timeout', 'units': 'units', 'workload_context': 'workload-context'} - _toPy = {'applications': 'applications', 'commands': 'commands', 'machines': 'machines', 'timeout': 'timeout', 'units': 'units', 'workload-context': 'workload_context'} - def __init__(self, applications=None, commands=None, machines=None, timeout=None, units=None, workload_context=None, **unknown_fields): + _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] commands : str + execution_group : str machines : typing.Sequence[str] + parallel : bool timeout : int units : typing.Sequence[str] workload_context : bool ''' applications_ = applications commands_ = commands + execution_group_ = execution_group machines_ = machines + parallel_ = parallel timeout_ = timeout units_ = units workload_context_ = workload_context @@ -22944,9 +23128,15 @@ def __init__(self, applications=None, commands=None, machines=None, timeout=None 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_))) @@ -22958,7 +23148,9 @@ def __init__(self, applications=None, commands=None, machines=None, timeout=None self.applications = applications_ self.commands = commands_ + self.execution_group = execution_group_ self.machines = machines_ + self.parallel = parallel_ self.timeout = timeout_ self.units = units_ self.workload_context = workload_context_ @@ -26602,13 +26794,14 @@ def __init__(self, errorresult=None, error=None, resources=None, **unknown_field class UnitResult(Type): - _toSchema = {'address': 'address', 'charm': 'charm', 'leader': 'leader', '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', '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, machine=None, opened_ports=None, provider_id=None, public_address=None, relation_data=None, tag=None, workload_version=None, **unknown_fields): + _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 charm : str leader : bool + life : str machine : str opened_ports : typing.Sequence[str] provider_id : str @@ -26620,6 +26813,7 @@ def __init__(self, address=None, charm=None, leader=None, machine=None, opened_p address_ = address charm_ = charm leader_ = leader + life_ = life machine_ = machine opened_ports_ = opened_ports provider_id_ = provider_id @@ -26638,6 +26832,9 @@ def __init__(self, address=None, charm=None, leader=None, machine=None, opened_p if leader_ is not None and not isinstance(leader_, bool): raise Exception("Expected leader_ to be a bool, received: {}".format(type(leader_))) + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + if machine_ is not None and not isinstance(machine_, (bytes, str)): raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) @@ -26662,6 +26859,7 @@ def __init__(self, address=None, charm=None, leader=None, machine=None, opened_p self.address = address_ self.charm = charm_ self.leader = leader_ + self.life = life_ self.machine = machine_ self.opened_ports = opened_ports_ self.provider_id = provider_id_ @@ -27429,6 +27627,48 @@ def __init__(self, args=None, **unknown_fields): +class UpgradeModel(Type): + _toSchema = {'agent_stream': 'agent-stream', 'dry_run': 'dry-run', 'ignore_agent_versions': 'ignore-agent-versions', 'model_tag': 'model-tag', 'to_version': 'to-version'} + _toPy = {'agent-stream': 'agent_stream', 'dry-run': 'dry_run', 'ignore-agent-versions': 'ignore_agent_versions', 'model-tag': 'model_tag', 'to-version': 'to_version'} + def __init__(self, agent_stream=None, dry_run=None, ignore_agent_versions=None, model_tag=None, to_version=None, **unknown_fields): + ''' + agent_stream : str + dry_run : bool + ignore_agent_versions : bool + model_tag : str + to_version : Number + ''' + agent_stream_ = agent_stream + dry_run_ = dry_run + ignore_agent_versions_ = ignore_agent_versions + model_tag_ = model_tag + to_version_ = Number.from_json(to_version) if to_version else None + + # Validate arguments against known Juju API types. + 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 to_version_ is not None and not isinstance(to_version_, (dict, Number)): + raise Exception("Expected to_version_ to be a Number, received: {}".format(type(to_version_))) + + self.agent_stream = agent_stream_ + self.dry_run = dry_run_ + self.ignore_agent_versions = ignore_agent_versions_ + self.model_tag = model_tag_ + self.to_version = to_version_ + self.unknown_fields = unknown_fields + + + class UpgradeMongoParams(Type): _toSchema = {'target': 'target'} _toPy = {'target': 'target'} @@ -27945,10 +28185,10 @@ class ValidateModelUpgradeParams(Type): def __init__(self, force=None, model=None, **unknown_fields): ''' force : bool - model : typing.Sequence[~ValidateModelUpgradeParam] + model : typing.Sequence[~ModelParam] ''' force_ = force - model_ = [ValidateModelUpgradeParam.from_json(o) for o in model or []] + model_ = [ModelParam.from_json(o) for o in model or []] # Validate arguments against known Juju API types. if force_ is not None and not isinstance(force_, bool): diff --git a/juju/client/client.py b/juju/client/client.py index 2721d07f9..7cebca186 100644 --- a/juju/client/client.py +++ b/juju/client/client.py @@ -1,7 +1,10 @@ '''Replace auto-generated classes with our own, where necessary. ''' +import sys from . import _client, _definitions, overrides # isort:skip +from .old_clients import _client as _2_9_client +from .old_clients import _definitions as _2_9_definitions for o in overrides.__all__: if "Facade" not in o: @@ -10,6 +13,8 @@ # the ref in _client (import shenanigans are fun!) setattr(_definitions, o, getattr(overrides, o)) setattr(_client, o, getattr(overrides, o)) + setattr(_2_9_definitions, o, getattr(overrides, o)) + setattr(_2_9_client, o, getattr(overrides, o)) # We shouldn't be overriding Facades! else: raise ValueError( @@ -29,5 +34,55 @@ for a in dir(o_type): if not a.startswith('_'): setattr(c_type, a, getattr(o_type, a)) + # This unfortunately needs to be a separate loop + for old_client_version in _2_9_client.CLIENTS.values(): + try: + c_type = getattr(old_client_version, o) + except AttributeError: + # Not all the _client modules may have the + # facade. That's okay -- we just skip over them. + continue + o_type = getattr(overrides, o) + for a in dir(o_type): + if not a.startswith('_'): + setattr(c_type, a, getattr(o_type, a)) from ._client import * # noqa, isort:skip + + +class ClientModuleClass: + def __init__(self): + """ + new_client (bool): True if we're working with juju>3.0 + """ + self.new_client = None + self.client_module = _client + + __all__ = list(set(vars().keys()) - {'__module__', '__qualname__'}) + + def __getattr__(self, item): + return getattr(self.client_module, item) + + def set_new_client(self, server_version): + self.new_client = server_version.startswith('3.') + if not self.new_client: + self.client_module = _2_9_client + + +""" +This is basically a hack to turn this module into a dynamic +binding registry, by replacing this module object with a class +instance that acts like a module in sys.modules in the runtime. + +Based on the value of the 'new_client' variable +(True if >3.0, False if 2.9) we dynamically change the modules +from which we get the actual bindings behind the scenes. +Theoretically the new_client should only be set once, but we +have to keep it dynamic since there's no way for libjuju to +know when and with which juju version a connection will be +established. + +Bindings for >3.0 are coming from _client & _definitions +Bindings for 2.9 are coming from _2_9_client & _2_9_client +""" +sys.modules[__name__] = ClientModuleClass() diff --git a/juju/client/connection.py b/juju/client/connection.py index 8bac1946c..f7043177a 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -17,15 +17,15 @@ log = logging.getLogger('juju.client.connection') client_facades = { - 'Action': {'versions': [2]}, + 'Action': {'versions': [2, 7]}, 'ActionPruner': {'versions': [1]}, - 'Agent': {'versions': [2]}, + 'Agent': {'versions': [2, 3]}, 'AgentTools': {'versions': [1]}, 'Annotations': {'versions': [2]}, 'Application': {'versions': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]}, - 'ApplicationOffers': {'versions': [1, 2]}, + 'ApplicationOffers': {'versions': [1, 2, 4]}, 'ApplicationScaler': {'versions': [1]}, - 'Backups': {'versions': [1, 2]}, + 'Backups': {'versions': [1, 2, 3]}, 'Block': {'versions': [2]}, 'Bundle': {'versions': [1, 2, 3, 4, 5, 6]}, 'CharmHub': {'versions': [1]}, @@ -33,37 +33,37 @@ 'CharmDownloader': {'versions': [1]}, 'Charms': {'versions': [2, 3, 4]}, 'Cleaner': {'versions': [2]}, - 'Client': {'versions': [1, 2]}, - 'Cloud': {'versions': [1, 2, 3, 4, 5]}, + 'Client': {'versions': [1, 2, 5]}, + 'Cloud': {'versions': [1, 2, 3, 4, 5, 7]}, 'CAASAdmission': {'versions': [1]}, 'CAASApplication': {'versions': [1]}, 'CAASApplicationProvisioner': {'versions': [1]}, 'CAASFirewaller': {'versions': [1]}, 'CAASFirewallerEmbedded': {'versions': [1]}, 'CAASOperator': {'versions': [1]}, - 'CAASAgent': {'versions': [1]}, + 'CAASAgent': {'versions': [1, 2]}, 'CAASOperatorProvisioner': {'versions': [1]}, 'CAASUnitProvisioner': {'versions': [1, 2]}, 'CAASOperatorUpgrader': {'versions': [1]}, 'CAASModelOperator': {'versions': [1]}, 'CAASModelConfigManager': {'versions': [1]}, - 'Controller': {'versions': [3, 4, 5, 6, 7, 8, 9]}, - 'CrossModelRelations': {'versions': [1]}, + 'Controller': {'versions': [3, 4, 5, 6, 7, 8, 9, 11]}, + 'CrossModelRelations': {'versions': [1, 2]}, 'CrossController': {'versions': [1]}, 'CredentialManager': {'versions': [1]}, - 'CredentialValidator': {'versions': [1]}, + 'CredentialValidator': {'versions': [1, 2]}, 'ExternalControllerUpdater': {'versions': [1]}, 'Deployer': {'versions': [1]}, 'DiskManager': {'versions': [2]}, 'FanConfigurer': {'versions': [1]}, - 'Firewaller': {'versions': [3, 4, 5]}, + 'Firewaller': {'versions': [3, 4, 5, 7]}, 'FirewallRules': {'versions': [1]}, 'HighAvailability': {'versions': [2]}, 'HostKeyReporter': {'versions': [1]}, 'ImageManager': {'versions': [2]}, 'ImageMetadata': {'versions': [3]}, 'ImageMetadataManager': {'versions': [1]}, - 'InstanceMutater': {'versions': [2]}, + 'InstanceMutater': {'versions': [2, 3]}, 'InstancePoller': {'versions': [3, 4]}, 'KeyManager': {'versions': [1]}, 'KeyUpdater': {'versions': [1]}, @@ -72,30 +72,30 @@ 'Logger': {'versions': [1]}, 'LogForwarding': {'versions': [1]}, 'MachineActions': {'versions': [1]}, - 'MachineManager': {'versions': [2, 3, 4]}, + 'MachineManager': {'versions': [2, 3, 4, 7]}, 'MachineUndertaker': {'versions': [1]}, - 'Machiner': {'versions': [1, 2]}, - 'MeterStatus': {'versions': [1]}, + 'Machiner': {'versions': [1, 2, 5]}, + 'MeterStatus': {'versions': [1, 2]}, 'MetricsAdder': {'versions': [2]}, 'MetricsDebug': {'versions': [2]}, 'MetricsManager': {'versions': [1]}, 'MigrationFlag': {'versions': [1]}, - 'MigrationMaster': {'versions': [1]}, + 'MigrationMaster': {'versions': [1, 3]}, 'MigrationMinion': {'versions': [1]}, 'MigrationTarget': {'versions': [1]}, - 'ModelConfig': {'versions': [1, 2]}, - 'ModelGeneration': {'versions': [1, 2]}, - 'ModelManager': {'versions': [2, 3, 4, 5]}, + 'ModelConfig': {'versions': [1, 2, 3]}, + 'ModelGeneration': {'versions': [1, 2, 4]}, + 'ModelManager': {'versions': [2, 3, 4, 5, 9]}, 'ModelUpgrader': {'versions': [1]}, 'Payloads': {'versions': [1]}, 'PayloadsHookContext': {'versions': [1]}, 'Pinger': {'versions': [1]}, - 'Provisioner': {'versions': [3, 4, 5, 6]}, + 'Provisioner': {'versions': [3, 4, 5, 6, 11]}, 'ProxyUpdater': {'versions': [1, 2]}, - 'RaftLease': {'versions': [1]}, + 'RaftLease': {'versions': [1, 2]}, 'Reboot': {'versions': [2]}, - 'RemoteRelations': {'versions': [1]}, - 'Resources': {'versions': [1]}, + 'RemoteRelations': {'versions': [1, 2]}, + 'Resources': {'versions': [1, 2]}, 'ResourcesHookContext': {'versions': [1]}, 'Resumer': {'versions': [2]}, 'RetryStrategy': {'versions': [1]}, @@ -103,21 +103,21 @@ 'SecretsManager': {'versions': [1]}, 'SecretsRotationWatcher': {'versions': [1]}, 'Singular': {'versions': [2]}, - 'SSHClient': {'versions': [1, 2]}, + 'SSHClient': {'versions': [1, 2, 3]}, 'Spaces': {'versions': [2, 3, 4, 5, 6]}, 'StatusHistory': {'versions': [2]}, - 'Storage': {'versions': [3, 4]}, + 'Storage': {'versions': [3, 4, 6]}, 'StorageProvisioner': {'versions': [3, 4]}, - 'Subnets': {'versions': [2]}, + 'Subnets': {'versions': [2, 4]}, 'Undertaker': {'versions': [1]}, 'UnitAssigner': {'versions': [1]}, - 'Uniter': {'versions': [4, 5, 6, 7, 8]}, + 'Uniter': {'versions': [4, 5, 6, 7, 8, 18]}, 'Upgrader': {'versions': [1]}, - 'UpgradeSeries': {'versions': [1]}, - 'UpgradeSteps': {'versions': [1]}, - 'UserManager': {'versions': [1, 2]}, - 'AllWatcher': {'versions': [1]}, - 'AllModelWatcher': {'versions': [2]}, + 'UpgradeSeries': {'versions': [1, 3]}, + 'UpgradeSteps': {'versions': [1, 2]}, + 'UserManager': {'versions': [1, 2, 3]}, + 'AllWatcher': {'versions': [1, 2]}, + 'AllModelWatcher': {'versions': [2, 3]}, 'NotifyWatcher': {'versions': [1]}, 'StringsWatcher': {'versions': [1]}, 'OfferStatusWatcher': {'versions': [1]}, @@ -360,6 +360,12 @@ def username(self): return None return self.usertag[len('user-'):] + @property + def is_using_old_client(self): + if self.info is None: + raise errors.JujuError("Not connected yet.") + return self.info['server-version'].startswith('2.') + @property def is_open(self): return self.monitor.status == Monitor.CONNECTED @@ -825,6 +831,9 @@ async def _connect_with_login(self, endpoints): macaroonJSON = result.get('discharge-required') if macaroonJSON is None: self.info = result + # Whenever a connection is established, set + # the new_client flag in the Client module + client.set_new_client(self.info['server-version']) success = True return result macaroon = bakery.Macaroon.from_dict(macaroonJSON) diff --git a/juju/client/facade.py b/juju/client/facade.py index 1a294fe37..a2149eb83 100644 --- a/juju/client/facade.py +++ b/juju/client/facade.py @@ -60,7 +60,6 @@ def lookup_facade(name, version): raise ImportError("No supported version for facade: " "{}".format(name)) - ''' TYPE_FACTORY = ''' @@ -112,7 +111,6 @@ def best_facade_version(cls, connection): {clients} }} - ''' @@ -874,9 +872,13 @@ def write_client(captures, options): f.write(HEADER) f.write("from juju.client._definitions import *\n\n") clients = ", ".join("_client{}".format(v) for v in captures) - f.write("from juju.client import " + clients + "\n\n") + + # from juju.client import _client2, _client1, _client3 ... + f.write("\nfrom juju.client import " + clients + "\n\n") + # CLIENTS = { .... f.write(CLIENT_TABLE.format(clients=",\n ".join( ['"{}": _client{}'.format(v, v) for v in captures]))) + f.write(LOOKUP_FACADE) f.write(TYPE_FACTORY) for key in sorted([k for k in factories.keys() if "Facade" in k]): diff --git a/juju/client/jujudata.py b/juju/client/jujudata.py index d6125bd86..7e08b2ff5 100644 --- a/juju/client/jujudata.py +++ b/juju/client/jujudata.py @@ -3,7 +3,7 @@ import os import pathlib -import juju.client.client as jujuclient +from juju.client import client as jujuclient import yaml from juju import tag from juju.client.gocookies import GoCookieJar diff --git a/juju/client/old_clients/_client.py b/juju/client/old_clients/_client.py new file mode 100644 index 000000000..3ee94ddcb --- /dev/null +++ b/juju/client/old_clients/_client.py @@ -0,0 +1,566 @@ +# 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.old_clients._definitions import * + + +from juju.client.old_clients import _client2, _client1, _client3, _client4, _client5, _client8, _client7, _client9, _client10, _client6, _client12, _client11, _client13, _client15, _client16, _client17, _client18 + + +CLIENTS = { + "2": _client2, + "1": _client1, + "3": _client3, + "4": _client4, + "5": _client5, + "8": _client8, + "7": _client7, + "9": _client9, + "10": _client10, + "6": _client6, + "12": _client12, + "11": _client11, + "13": _client13, + "15": _client15, + "16": _client16, + "17": _client17, + "18": _client18 +} + + + +def lookup_facade(name, version): + """ + Given a facade name and version, attempt to pull that facade out + of the correct client.py file. + + """ + for _version in range(int(version), 0, -1): + try: + facade = getattr(CLIENTS[str(_version)], name) + return facade + except (KeyError, AttributeError): + continue + else: + raise ImportError("No supported version for facade: " + "{}".format(name)) + + + +class TypeFactory: + @classmethod + def from_connection(cls, connection): + """ + Given a connected Connection object, return an initialized and + connected instance of an API Interface matching the name of + this class. + + @param connection: initialized Connection object. + + """ + facade_name = cls.__name__ + if not facade_name.endswith('Facade'): + raise TypeError('Unexpected class name: {}'.format(facade_name)) + facade_name = facade_name[:-len('Facade')] + version = connection.facades.get(facade_name) + if version is None: + raise Exception('No facade {} in facades {}'.format(facade_name, + connection.facades)) + + c = lookup_facade(cls.__name__, version) + c = c() + c.connect(connection) + + return c + + @classmethod + def best_facade_version(cls, connection): + """ + Returns the best facade version for a given facade. This will help with + trying to provide different functionality for different facade versions. + + @param connection: initialized Connection object. + """ + facade_name = cls.__name__ + if not facade_name.endswith('Facade'): + raise TypeError('Unexpected class name: {}'.format(facade_name)) + facade_name = facade_name[:-len('Facade')] + return connection.facades.get(facade_name) + + +class ActionFacade(TypeFactory): + pass + + +class ActionPrunerFacade(TypeFactory): + pass + + +class AdminFacade(TypeFactory): + pass + + +class AgentFacade(TypeFactory): + pass + + +class AgentToolsFacade(TypeFactory): + pass + + +class AllModelWatcherFacade(TypeFactory): + pass + + +class AllWatcherFacade(TypeFactory): + pass + + +class AnnotationsFacade(TypeFactory): + pass + + +class ApplicationFacade(TypeFactory): + pass + + +class ApplicationOffersFacade(TypeFactory): + pass + + +class ApplicationRelationsWatcherFacade(TypeFactory): + pass + + +class ApplicationScalerFacade(TypeFactory): + pass + + +class BackupsFacade(TypeFactory): + pass + + +class BlockFacade(TypeFactory): + pass + + +class BundleFacade(TypeFactory): + pass + + +class CAASAdmissionFacade(TypeFactory): + pass + + +class CAASAgentFacade(TypeFactory): + pass + + +class CAASApplicationFacade(TypeFactory): + pass + + +class CAASApplicationProvisionerFacade(TypeFactory): + pass + + +class CAASFirewallerEmbeddedFacade(TypeFactory): + pass + + +class CAASFirewallerFacade(TypeFactory): + pass + + +class CAASModelConfigManagerFacade(TypeFactory): + pass + + +class CAASModelOperatorFacade(TypeFactory): + pass + + +class CAASOperatorFacade(TypeFactory): + pass + + +class CAASOperatorProvisionerFacade(TypeFactory): + pass + + +class CAASOperatorUpgraderFacade(TypeFactory): + pass + + +class CAASUnitProvisionerFacade(TypeFactory): + pass + + +class CharmDownloaderFacade(TypeFactory): + pass + + +class CharmHubFacade(TypeFactory): + pass + + +class CharmRevisionUpdaterFacade(TypeFactory): + pass + + +class CharmsFacade(TypeFactory): + pass + + +class CleanerFacade(TypeFactory): + pass + + +class ClientFacade(TypeFactory): + pass + + +class CloudFacade(TypeFactory): + pass + + +class ControllerFacade(TypeFactory): + pass + + +class CredentialManagerFacade(TypeFactory): + pass + + +class CredentialValidatorFacade(TypeFactory): + pass + + +class CrossControllerFacade(TypeFactory): + pass + + +class CrossModelRelationsFacade(TypeFactory): + pass + + +class DeployerFacade(TypeFactory): + pass + + +class DiscoverSpacesFacade(TypeFactory): + pass + + +class DiskManagerFacade(TypeFactory): + pass + + +class EntityWatcherFacade(TypeFactory): + pass + + +class ExternalControllerUpdaterFacade(TypeFactory): + pass + + +class FacadeVersions(TypeFactory): + pass + + +class FanConfigurerFacade(TypeFactory): + pass + + +class FilesystemAttachmentsWatcherFacade(TypeFactory): + pass + + +class FirewallRulesFacade(TypeFactory): + pass + + +class FirewallerFacade(TypeFactory): + pass + + +class HighAvailabilityFacade(TypeFactory): + pass + + +class HostKeyReporterFacade(TypeFactory): + pass + + +class ImageManagerFacade(TypeFactory): + pass + + +class ImageMetadataFacade(TypeFactory): + pass + + +class ImageMetadataManagerFacade(TypeFactory): + pass + + +class InstanceMutaterFacade(TypeFactory): + pass + + +class InstancePollerFacade(TypeFactory): + pass + + +class KeyManagerFacade(TypeFactory): + pass + + +class KeyUpdaterFacade(TypeFactory): + pass + + +class LeadershipServiceFacade(TypeFactory): + pass + + +class LifeFlagFacade(TypeFactory): + pass + + +class LogForwardingFacade(TypeFactory): + pass + + +class LoggerFacade(TypeFactory): + pass + + +class MachineActionsFacade(TypeFactory): + pass + + +class MachineManagerFacade(TypeFactory): + pass + + +class MachineUndertakerFacade(TypeFactory): + pass + + +class MachinerFacade(TypeFactory): + pass + + +class MeterStatusFacade(TypeFactory): + pass + + +class MetricsAdderFacade(TypeFactory): + pass + + +class MetricsDebugFacade(TypeFactory): + pass + + +class MetricsManagerFacade(TypeFactory): + pass + + +class MigrationFlagFacade(TypeFactory): + pass + + +class MigrationMasterFacade(TypeFactory): + pass + + +class MigrationMinionFacade(TypeFactory): + pass + + +class MigrationStatusWatcherFacade(TypeFactory): + pass + + +class MigrationTargetFacade(TypeFactory): + pass + + +class ModelConfigFacade(TypeFactory): + pass + + +class ModelGenerationFacade(TypeFactory): + pass + + +class ModelManagerFacade(TypeFactory): + pass + + +class ModelSummaryWatcherFacade(TypeFactory): + pass + + +class ModelUpgraderFacade(TypeFactory): + pass + + +class NotifyWatcherFacade(TypeFactory): + pass + + +class OfferStatusWatcherFacade(TypeFactory): + pass + + +class PayloadsFacade(TypeFactory): + pass + + +class PayloadsHookContextFacade(TypeFactory): + pass + + +class PingerFacade(TypeFactory): + pass + + +class ProvisionerFacade(TypeFactory): + pass + + +class ProxyUpdaterFacade(TypeFactory): + pass + + +class RaftLeaseFacade(TypeFactory): + pass + + +class RebootFacade(TypeFactory): + pass + + +class RelationStatusWatcherFacade(TypeFactory): + pass + + +class RelationUnitsWatcherFacade(TypeFactory): + pass + + +class RemoteApplicationWatcherFacade(TypeFactory): + pass + + +class RemoteRelationWatcherFacade(TypeFactory): + pass + + +class RemoteRelationsFacade(TypeFactory): + pass + + +class RemoteRelationsWatcherFacade(TypeFactory): + pass + + +class ResourcesFacade(TypeFactory): + pass + + +class ResourcesHookContextFacade(TypeFactory): + pass + + +class ResumerFacade(TypeFactory): + pass + + +class RetryStrategyFacade(TypeFactory): + pass + + +class SSHClientFacade(TypeFactory): + pass + + +class SecretsFacade(TypeFactory): + pass + + +class SecretsManagerFacade(TypeFactory): + pass + + +class SecretsRotationWatcherFacade(TypeFactory): + pass + + +class SingularFacade(TypeFactory): + pass + + +class SpacesFacade(TypeFactory): + pass + + +class StatusHistoryFacade(TypeFactory): + pass + + +class StorageFacade(TypeFactory): + pass + + +class StorageProvisionerFacade(TypeFactory): + pass + + +class StringsWatcherFacade(TypeFactory): + pass + + +class SubnetsFacade(TypeFactory): + pass + + +class UndertakerFacade(TypeFactory): + pass + + +class UnitAssignerFacade(TypeFactory): + pass + + +class UniterFacade(TypeFactory): + pass + + +class UpgradeSeriesFacade(TypeFactory): + pass + + +class UpgradeStepsFacade(TypeFactory): + pass + + +class UpgraderFacade(TypeFactory): + pass + + +class UserManagerFacade(TypeFactory): + pass + + +class VolumeAttachmentPlansWatcherFacade(TypeFactory): + pass + + +class VolumeAttachmentsWatcherFacade(TypeFactory): + pass + + diff --git a/juju/client/old_clients/_client1.py b/juju/client/old_clients/_client1.py new file mode 100644 index 000000000..201baff4b --- /dev/null +++ b/juju/client/old_clients/_client1.py @@ -0,0 +1,17680 @@ +# 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.old_clients._definitions import * + + +class ActionPrunerFacade(Type): + name = 'ActionPruner' + version = 1 + schema = {'definitions': {'ActionPruneArgs': {'additionalProperties': False, + 'properties': {'max-history-mb': {'type': 'integer'}, + 'max-history-time': {'type': 'integer'}}, + 'required': ['max-history-time', + 'max-history-mb'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}}, + 'properties': {'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'Prune': {'properties': {'Params': {'$ref': '#/definitions/ActionPruneArgs'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @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='ActionPruner', + request='ModelConfig', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Prune(self, max_history_mb=None, max_history_time=None): + ''' + 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 = await self.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='ActionPruner', + request='WatchForModelConfigChanges', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class AgentToolsFacade(Type): + name = 'AgentTools' + version = 1 + schema = {'properties': {'UpdateToolsAvailable': {'description': 'UpdateToolsAvailable ' + 'invokes a lookup and ' + 'further update in ' + 'environ\n' + 'for new patches of ' + 'the current tool ' + 'versions.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + +class AllWatcherFacade(Type): + name = 'AllWatcher' + version = 1 + schema = {'definitions': {'AllWatcherNextResults': {'additionalProperties': False, + 'properties': {'deltas': {'items': {'$ref': '#/definitions/Delta'}, + 'type': 'array'}}, + 'required': ['deltas'], + 'type': 'object'}, + 'Delta': {'additionalProperties': False, + 'properties': {'entity': {'additionalProperties': True, + 'type': 'object'}, + 'removed': {'type': 'boolean'}}, + 'required': ['removed', 'entity'], + 'type': 'object'}}, + 'properties': {'Next': {'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) + async def 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=1, + params=_params) + + reply = await self.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='AllWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class ApplicationRelationsWatcherFacade(Type): + name = 'ApplicationRelationsWatcher' + version = 1 + schema = {'definitions': {'ApplicationRelationsChange': {'additionalProperties': False, + 'properties': {'changed': {'items': {'$ref': '#/definitions/RelationChange'}, + 'type': 'array'}, + 'removed': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ApplicationRelationsWatchResult': {'additionalProperties': False, + 'properties': {'ApplicationRelationsWatcherId': {'type': 'string'}, + 'changes': {'$ref': '#/definitions/ApplicationRelationsChange'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['ApplicationRelationsWatcherId'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'RelationChange': {'additionalProperties': False, + 'properties': {'changedunits': {'patternProperties': {'.*': {'$ref': '#/definitions/RelationUnitChange'}}, + 'type': 'object'}, + 'departedunits': {'items': {'type': 'string'}, + 'type': 'array'}, + 'id': {'type': 'integer'}, + 'life': {'type': 'string'}}, + 'required': ['id', 'life'], + 'type': 'object'}, + 'RelationUnitChange': {'additionalProperties': False, + 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/ApplicationRelationsWatchResult'}}, + 'type': 'object'}, + 'Stop': {'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ApplicationRelationsWatchResult) + async def Next(self): + ''' + + Returns -> ApplicationRelationsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationRelationsWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ApplicationRelationsWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class ApplicationScalerFacade(Type): + name = 'ApplicationScaler' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'Rescale': {'description': 'Rescale causes any supplied ' + 'services to be scaled up to their\n' + 'minimum size.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch returns a watcher that sends ' + 'the names of services whose\n' + 'unit count may be below their ' + 'configured minimum.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + +class BackupsFacade(Type): + name = 'Backups' + version = 1 + schema = {'definitions': {'BackupsCreateArgs': {'additionalProperties': False, + 'properties': {'notes': {'type': 'string'}}, + 'required': ['notes'], + 'type': 'object'}, + 'BackupsInfoArgs': {'additionalProperties': False, + 'properties': {'id': {'type': 'string'}}, + 'required': ['id'], + 'type': 'object'}, + 'BackupsListArgs': {'additionalProperties': False, + 'type': 'object'}, + 'BackupsListResult': {'additionalProperties': False, + 'properties': {'list': {'items': {'$ref': '#/definitions/BackupsMetadataResult'}, + 'type': 'array'}}, + 'required': ['list'], + 'type': 'object'}, + 'BackupsMetadataResult': {'additionalProperties': False, + 'properties': {'ca-cert': {'type': 'string'}, + 'ca-private-key': {'type': 'string'}, + 'checksum': {'type': 'string'}, + 'checksum-format': {'type': 'string'}, + 'finished': {'format': 'date-time', + 'type': 'string'}, + 'hostname': {'type': 'string'}, + 'id': {'type': 'string'}, + 'machine': {'type': 'string'}, + 'model': {'type': 'string'}, + 'notes': {'type': 'string'}, + 'series': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'stored': {'format': 'date-time', + 'type': 'string'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'required': ['id', + 'checksum', + 'checksum-format', + 'size', + 'stored', + 'started', + 'finished', + 'notes', + 'model', + 'machine', + 'hostname', + 'version', + 'series', + 'ca-cert', + 'ca-private-key'], + 'type': 'object'}, + 'BackupsRemoveArgs': {'additionalProperties': False, + 'properties': {'id': {'type': 'string'}}, + 'required': ['id'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'RestoreArgs': {'additionalProperties': False, + 'properties': {'backup-id': {'type': 'string'}}, + 'required': ['backup-id'], + 'type': 'object'}}, + 'properties': {'Create': {'properties': {'Params': {'$ref': '#/definitions/BackupsCreateArgs'}, + 'Result': {'$ref': '#/definitions/BackupsMetadataResult'}}, + 'type': 'object'}, + 'FinishRestore': {'type': 'object'}, + 'Info': {'properties': {'Params': {'$ref': '#/definitions/BackupsInfoArgs'}, + 'Result': {'$ref': '#/definitions/BackupsMetadataResult'}}, + 'type': 'object'}, + 'List': {'properties': {'Params': {'$ref': '#/definitions/BackupsListArgs'}, + 'Result': {'$ref': '#/definitions/BackupsListResult'}}, + 'type': 'object'}, + 'PrepareRestore': {'type': 'object'}, + 'Remove': {'properties': {'Params': {'$ref': '#/definitions/BackupsRemoveArgs'}}, + 'type': 'object'}, + 'Restore': {'properties': {'Params': {'$ref': '#/definitions/RestoreArgs'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(BackupsMetadataResult) + async def Create(self, notes=None): + ''' + notes : str + Returns -> BackupsMetadataResult + ''' + 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=1, + params=_params) + _params['notes'] = notes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def FinishRestore(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Backups', + request='FinishRestore', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BackupsMetadataResult) + async def Info(self, id_=None): + ''' + id_ : str + Returns -> BackupsMetadataResult + ''' + if id_ is not None and not isinstance(id_, (bytes, str)): + raise Exception("Expected id_ to be a str, received: {}".format(type(id_))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Backups', + request='Info', + version=1, + params=_params) + _params['id'] = id_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BackupsListResult) + async def List(self): + ''' + + Returns -> BackupsListResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Backups', + request='List', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def PrepareRestore(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Backups', + request='PrepareRestore', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Remove(self, id_=None): + ''' + id_ : str + Returns -> None + ''' + if id_ is not None and not isinstance(id_, (bytes, str)): + raise Exception("Expected id_ to be a str, received: {}".format(type(id_))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Backups', + request='Remove', + version=1, + params=_params) + _params['id'] = id_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Restore(self, backup_id=None): + ''' + backup_id : str + Returns -> None + ''' + if backup_id is not None and not isinstance(backup_id, (bytes, str)): + raise Exception("Expected backup_id to be a str, received: {}".format(type(backup_id))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Backups', + request='Restore', + version=1, + params=_params) + _params['backup-id'] = backup_id + reply = await self.rpc(msg) + return reply + + + +class BundleFacade(Type): + name = 'Bundle' + version = 1 + schema = {'definitions': {'BundleChange': {'additionalProperties': False, + 'properties': {'args': {'items': {'additionalProperties': True, + 'type': 'object'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesParams': {'additionalProperties': False, + 'properties': {'yaml': {'type': 'string'}}, + 'required': ['yaml'], + 'type': 'object'}, + 'BundleChangesResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'GetChanges': {'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(BundleChangesResults) + async def GetChanges(self, yaml=None): + ''' + yaml : str + Returns -> BundleChangesResults + ''' + 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=1, + params=_params) + _params['yaml'] = yaml + reply = await self.rpc(msg) + return reply + + + +class CAASAdmissionFacade(Type): + name = 'CAASAdmission' + version = 1 + schema = {'definitions': {'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}}, + 'properties': {'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ControllerAPIInfoResults) + async def 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 = await self.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='CAASAdmission', + request='ControllerConfig', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CAASAgentFacade(Type): + name = 'CAASAgent' + version = 1 + schema = {'definitions': {'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + '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'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelTag': {'additionalProperties': False, 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'CloudSpec': {'description': "CloudSpec returns the model's " + 'cloud spec.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'GetCloudSpec': {'description': 'GetCloudSpec constructs the ' + 'CloudSpec for a validated and ' + 'authorized model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'description': 'WatchCloudSpecsChanges ' + 'returns a watcher ' + 'for cloud spec ' + 'changes.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(CloudSpecResults) + async def 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def 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=1, + params=_params) + _params['entities'] = entities + reply = await self.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='CAASAgent', + request='ControllerConfig', + version=1, + params=_params) + + reply = await self.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='CAASAgent', + request='GetCloudSpec', + version=1, + params=_params) + + reply = await self.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='CAASAgent', + request='ModelConfig', + version=1, + params=_params) + + reply = await self.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='CAASAgent', + request='WatchCloudSpecsChanges', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.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='CAASAgent', + request='WatchForModelConfigChanges', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CAASApplicationFacade(Type): + name = 'CAASApplication' + version = 1 + schema = {'definitions': {'CAASUnitIntroduction': {'additionalProperties': False, + 'properties': {'agent-conf': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'unit-name': {'type': 'string'}}, + 'required': ['unit-name', + 'agent-conf'], + 'type': 'object'}, + 'CAASUnitIntroductionArgs': {'additionalProperties': False, + 'properties': {'pod-name': {'type': 'string'}, + 'pod-uuid': {'type': 'string'}}, + 'required': ['pod-name', + 'pod-uuid'], + 'type': 'object'}, + 'CAASUnitIntroductionResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CAASUnitIntroduction'}}, + 'type': 'object'}, + 'CAASUnitTerminationResult': {'additionalProperties': False, + 'properties': {'Error': {'$ref': '#/definitions/Error'}, + 'WillRestart': {'type': 'boolean'}}, + 'required': ['WillRestart', + 'Error'], + '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'}}, + 'properties': {'UnitIntroduction': {'description': 'UnitIntroduction sets the ' + 'status of each given ' + 'entity.', + 'properties': {'Params': {'$ref': '#/definitions/CAASUnitIntroductionArgs'}, + 'Result': {'$ref': '#/definitions/CAASUnitIntroductionResult'}}, + 'type': 'object'}, + 'UnitTerminating': {'description': 'UnitTerminating should be ' + 'called by the ' + 'CAASUnitTerminationWorker ' + 'when\n' + 'the agent receives a ' + 'signal to exit. ' + 'UnitTerminating will ' + 'return how\n' + 'the agent should shutdown.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/CAASUnitTerminationResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(CAASUnitIntroductionResult) + async def 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 = await self.rpc(msg) + return reply + + + + @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'}, + 'ports': {'items': {'type': 'string'}, + 'type': 'array'}, + 'provider-id': {'type': 'string'}, + 'stateful': {'type': 'boolean'}, + 'status': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['provider-id', + 'unit-tag', + 'address', + 'ports', + 'status', + 'info'], + 'type': 'object'}, + 'CAASApplicationGarbageCollectArg': {'additionalProperties': False, + 'properties': {'active-pod-names': {'items': {'type': 'string'}, + 'type': 'array'}, + 'application': {'$ref': '#/definitions/Entity'}, + 'desired-replicas': {'type': 'integer'}, + 'force': {'type': 'boolean'}, + 'observed-units': {'$ref': '#/definitions/Entities'}}, + 'required': ['application', + 'observed-units', + 'desired-replicas', + 'active-pod-names', + 'force'], + 'type': 'object'}, + 'CAASApplicationGarbageCollectArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/CAASApplicationGarbageCollectArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'CAASApplicationOCIResourceResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CAASApplicationOCIResources'}}, + 'type': 'object'}, + 'CAASApplicationOCIResourceResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CAASApplicationOCIResourceResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'CAASApplicationOCIResources': {'additionalProperties': False, + 'properties': {'images': {'patternProperties': {'.*': {'$ref': '#/definitions/DockerImageInfo'}}, + 'type': 'object'}}, + 'required': ['images'], + 'type': 'object'}, + 'CAASApplicationProvisioningInfo': {'additionalProperties': False, + 'properties': {'api-addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'ca-cert': {'type': 'string'}, + 'charm-modified-version': {'type': 'integer'}, + 'charm-url': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'devices': {'items': {'$ref': '#/definitions/KubernetesDeviceParams'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'filesystems': {'items': {'$ref': '#/definitions/KubernetesFilesystemParams'}, + 'type': 'array'}, + 'image-path': {'type': 'string'}, + 'image-repo': {'$ref': '#/definitions/DockerImageInfo'}, + 'scale': {'type': 'integer'}, + 'series': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'trust': {'type': 'boolean'}, + 'version': {'$ref': '#/definitions/Number'}, + 'volumes': {'items': {'$ref': '#/definitions/KubernetesVolumeParams'}, + 'type': 'array'}}, + 'required': ['image-path', + 'version', + 'api-addresses', + 'ca-cert', + 'constraints'], + 'type': 'object'}, + 'CAASApplicationProvisioningInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CAASApplicationProvisioningInfo'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'CAASUnitInfo': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'unit-status': {'$ref': '#/definitions/UnitStatus'}}, + 'required': ['tag'], + 'type': 'object'}, + 'CAASUnitsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'units': {'items': {'$ref': '#/definitions/CAASUnitInfo'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CAASUnitsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CAASUnitsResult'}, + 'type': 'array'}}, + 'required': ['results'], + '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'}}, + 'required': ['revision', 'url', 'config'], + 'type': 'object'}, + 'CharmActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'CharmActions': {'additionalProperties': False, + 'properties': {'specs': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmActionSpec'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'CharmBase': {'additionalProperties': False, + 'properties': {'architectures': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'type': 'object'}, + 'CharmContainer': {'additionalProperties': False, + 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'type': 'array'}, + 'resource': {'type': 'string'}}, + 'type': 'object'}, + 'CharmDeployment': {'additionalProperties': False, + 'properties': {'min-version': {'type': 'string'}, + 'mode': {'type': 'string'}, + 'service': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', + 'mode', + 'service', + 'min-version'], + 'type': 'object'}, + 'CharmDevice': {'additionalProperties': False, + 'properties': {'CountMax': {'type': 'integer'}, + 'CountMin': {'type': 'integer'}, + 'Description': {'type': 'string'}, + 'Name': {'type': 'string'}, + 'Type': {'type': 'string'}}, + 'required': ['Name', + 'Description', + 'Type', + 'CountMin', + 'CountMax'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CharmManifest': {'additionalProperties': False, + 'properties': {'bases': {'items': {'$ref': '#/definitions/CharmBase'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CharmMeta': {'additionalProperties': False, + 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, + 'categories': {'items': {'type': 'string'}, + 'type': 'array'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, + 'type': 'object'}, + 'deployment': {'$ref': '#/definitions/CharmDeployment'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmDevice'}}, + 'type': 'object'}, + 'extra-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'min-juju-version': {'type': 'string'}, + 'name': {'type': 'string'}, + 'payload-classes': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmPayloadClass'}}, + 'type': 'object'}, + 'peers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'provides': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'requires': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'resources': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmResourceMeta'}}, + 'type': 'object'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmStorage'}}, + 'type': 'object'}, + 'subordinate': {'type': 'boolean'}, + 'summary': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'terms': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['name', + 'summary', + 'description', + 'subordinate'], + 'type': 'object'}, + 'CharmMetric': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'description'], + 'type': 'object'}, + 'CharmMetrics': {'additionalProperties': False, + 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, + 'type': 'object'}, + 'plan': {'$ref': '#/definitions/CharmPlan'}}, + 'required': ['metrics', 'plan'], + 'type': 'object'}, + 'CharmMount': {'additionalProperties': False, + 'properties': {'location': {'type': 'string'}, + 'storage': {'type': 'string'}}, + 'type': 'object'}, + 'CharmOption': {'additionalProperties': False, + 'properties': {'default': {'additionalProperties': True, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CharmPayloadClass': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', 'type'], + 'type': 'object'}, + 'CharmPlan': {'additionalProperties': False, + 'properties': {'required': {'type': 'boolean'}}, + 'required': ['required'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'CharmResourceMeta': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'path': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'description'], + 'type': 'object'}, + 'CharmStorage': {'additionalProperties': False, + 'properties': {'count-max': {'type': 'integer'}, + 'count-min': {'type': 'integer'}, + 'description': {'type': 'string'}, + 'location': {'type': 'string'}, + 'minimum-size': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'properties': {'items': {'type': 'string'}, + 'type': 'array'}, + 'read-only': {'type': 'boolean'}, + 'shared': {'type': 'boolean'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'description', + 'type', + 'shared', + 'read-only', + 'count-min', + 'count-max', + 'minimum-size'], + 'type': 'object'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'DetailedStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'err': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}, + 'kind': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['status', + 'info', + 'data', + 'since', + 'kind', + 'version', + 'life'], + 'type': 'object'}, + 'DockerImageInfo': {'additionalProperties': False, + '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'}}, + 'required': ['image-name'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + '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'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'ExpressionTree': {'additionalProperties': False, + 'properties': {'Expression': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['Expression'], + 'type': 'object'}, + 'KubernetesDeviceParams': {'additionalProperties': False, + 'properties': {'Attributes': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'Count': {'type': 'integer'}, + 'Type': {'type': 'string'}}, + 'required': ['Type', + 'Count', + 'Attributes'], + 'type': 'object'}, + 'KubernetesFilesystemAttachmentParams': {'additionalProperties': False, + 'properties': {'mount-point': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'required': ['provider'], + 'type': 'object'}, + 'KubernetesFilesystemInfo': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'filesystem-id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'mount-point': {'type': 'string'}, + 'pool': {'type': 'string'}, + 'read-only': {'type': 'boolean'}, + 'size': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'storagename': {'type': 'string'}, + 'volume': {'$ref': '#/definitions/KubernetesVolumeInfo'}}, + 'required': ['storagename', + 'pool', + 'size', + 'filesystem-id', + 'status', + 'info', + 'volume'], + 'type': 'object'}, + 'KubernetesFilesystemParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/KubernetesFilesystemAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'storagename': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['storagename', + 'size', + 'provider'], + 'type': 'object'}, + 'KubernetesVolumeAttachmentParams': {'additionalProperties': False, + 'properties': {'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'required': ['provider'], + 'type': 'object'}, + 'KubernetesVolumeInfo': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'volume-id': {'type': 'string'}}, + 'required': ['volume-id', + 'size', + 'persistent', + 'status', + 'info'], + 'type': 'object'}, + 'KubernetesVolumeParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/KubernetesVolumeAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'storagename': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['storagename', + 'size', + 'provider'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'UnitStatus': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'agent-status': {'$ref': '#/definitions/DetailedStatus'}, + 'charm': {'type': 'string'}, + 'leader': {'type': 'boolean'}, + 'machine': {'type': 'string'}, + 'opened-ports': {'items': {'type': 'string'}, + 'type': 'array'}, + 'provider-id': {'type': 'string'}, + 'public-address': {'type': 'string'}, + 'subordinates': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, + 'type': 'object'}, + 'workload-status': {'$ref': '#/definitions/DetailedStatus'}, + 'workload-version': {'type': 'string'}}, + 'required': ['agent-status', + 'workload-status', + 'workload-version', + 'machine', + 'opened-ports', + 'public-address', + 'charm', + 'subordinates'], + 'type': 'object'}, + 'UpdateApplicationUnitArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateApplicationUnits'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpdateApplicationUnitResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'$ref': '#/definitions/UpdateApplicationUnitsInfo'}}, + 'type': 'object'}, + 'UpdateApplicationUnitResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpdateApplicationUnitResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateApplicationUnits': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'generation': {'type': 'integer'}, + 'scale': {'type': 'integer'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'units': {'items': {'$ref': '#/definitions/ApplicationUnitParams'}, + 'type': 'array'}}, + 'required': ['application-tag', + 'units'], + 'type': 'object'}, + 'UpdateApplicationUnitsInfo': {'additionalProperties': False, + 'properties': {'units': {'items': {'$ref': '#/definitions/ApplicationUnitInfo'}, + 'type': 'array'}}, + 'required': ['units'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'ApplicationCharmInfo': {'description': 'ApplicationCharmInfo ' + 'returns information ' + 'about an ' + "application's charm.", + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'ApplicationOCIResources': {'description': 'ApplicationOCIResources ' + 'returns the OCI ' + 'image resources ' + 'for an ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CAASApplicationOCIResourceResults'}}, + 'type': 'object'}, + 'CAASApplicationGarbageCollect': {'description': 'CAASApplicationGarbageCollect ' + 'cleans up ' + 'units that ' + 'have gone ' + 'away ' + 'permanently.\n' + 'Only ' + 'observed ' + 'units will ' + 'be deleted ' + 'as new units ' + 'could have ' + 'surfaced ' + 'between\n' + 'the ' + 'capturing of ' + 'kuberentes ' + 'pod ' + 'state/application ' + 'state and ' + 'this call.', + 'properties': {'Params': {'$ref': '#/definitions/CAASApplicationGarbageCollectArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CharmInfo': {'description': 'CharmInfo returns information ' + 'about the requested charm.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ProvisioningInfo': {'description': 'ProvisioningInfo returns ' + 'the info needed to ' + 'provision a caas ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CAASApplicationProvisioningInfoResults'}}, + 'type': 'object'}, + 'SetOperatorStatus': {'description': 'SetOperatorStatus sets ' + 'the status of each given ' + 'entity.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetPasswords': {'description': 'SetPasswords sets the given ' + 'password for each supplied ' + 'entity, if possible.', + 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Units': {'description': 'Units returns all the units for each ' + 'application specified.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CAASUnitsResults'}}, + 'type': 'object'}, + 'UpdateApplicationsUnits': {'description': 'UpdateApplicationsUnits ' + 'updates the Juju ' + 'data model to ' + 'reflect the given\n' + 'units of the ' + 'specified ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateApplicationUnitArgs'}, + 'Result': {'$ref': '#/definitions/UpdateApplicationUnitResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchApplications': {'description': 'WatchApplications starts ' + 'a StringsWatcher to ' + 'watch applications\n' + 'deployed to this model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(Charm) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(CAASApplicationOCIResourceResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def CAASApplicationGarbageCollect(self, args=None): + ''' + CAASApplicationGarbageCollect cleans up units that have gone away permanently. + Only observed units will be deleted as new units could have surfaced between + the capturing of kuberentes pod state/application state and this call. + + args : typing.Sequence[~CAASApplicationGarbageCollectArg] + 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='CAASApplicationProvisioner', + request='CAASApplicationGarbageCollect', + version=1, + params=_params) + _params['args'] = args + reply = await self.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)): + 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 = await self.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='CAASApplicationProvisioner', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CAASApplicationProvisioningInfoResults) + async def 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 = await self.rpc(msg) + return reply + + + + @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) + 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(CAASUnitsResults) + async def 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 = await self.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='CAASApplicationProvisioner', + request='UpdateApplicationsUnits', + version=1, + params=_params) + _params['args'] = args + reply = await self.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='CAASApplicationProvisioner', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.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='CAASApplicationProvisioner', + request='WatchApplications', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CAASFirewallerEmbeddedFacade(Type): + name = 'CAASFirewallerEmbedded' + version = 1 + schema = {'definitions': {'ApplicationGetConfigResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/ConfigResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}}, + 'required': ['revision', 'url', 'config'], + 'type': 'object'}, + 'CharmActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'CharmActions': {'additionalProperties': False, + 'properties': {'specs': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmActionSpec'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'CharmBase': {'additionalProperties': False, + 'properties': {'architectures': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'type': 'object'}, + 'CharmContainer': {'additionalProperties': False, + 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'type': 'array'}, + 'resource': {'type': 'string'}}, + 'type': 'object'}, + 'CharmDeployment': {'additionalProperties': False, + 'properties': {'min-version': {'type': 'string'}, + 'mode': {'type': 'string'}, + 'service': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', + 'mode', + 'service', + 'min-version'], + 'type': 'object'}, + 'CharmDevice': {'additionalProperties': False, + 'properties': {'CountMax': {'type': 'integer'}, + 'CountMin': {'type': 'integer'}, + 'Description': {'type': 'string'}, + 'Name': {'type': 'string'}, + 'Type': {'type': 'string'}}, + 'required': ['Name', + 'Description', + 'Type', + 'CountMin', + 'CountMax'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CharmManifest': {'additionalProperties': False, + 'properties': {'bases': {'items': {'$ref': '#/definitions/CharmBase'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CharmMeta': {'additionalProperties': False, + 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, + 'categories': {'items': {'type': 'string'}, + 'type': 'array'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, + 'type': 'object'}, + 'deployment': {'$ref': '#/definitions/CharmDeployment'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmDevice'}}, + 'type': 'object'}, + 'extra-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'min-juju-version': {'type': 'string'}, + 'name': {'type': 'string'}, + 'payload-classes': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmPayloadClass'}}, + 'type': 'object'}, + 'peers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'provides': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'requires': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'resources': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmResourceMeta'}}, + 'type': 'object'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmStorage'}}, + 'type': 'object'}, + 'subordinate': {'type': 'boolean'}, + 'summary': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'terms': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['name', + 'summary', + 'description', + 'subordinate'], + 'type': 'object'}, + 'CharmMetric': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'description'], + 'type': 'object'}, + 'CharmMetrics': {'additionalProperties': False, + 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, + 'type': 'object'}, + 'plan': {'$ref': '#/definitions/CharmPlan'}}, + 'required': ['metrics', 'plan'], + 'type': 'object'}, + 'CharmMount': {'additionalProperties': False, + 'properties': {'location': {'type': 'string'}, + 'storage': {'type': 'string'}}, + 'type': 'object'}, + 'CharmOption': {'additionalProperties': False, + 'properties': {'default': {'additionalProperties': True, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CharmPayloadClass': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', 'type'], + 'type': 'object'}, + 'CharmPlan': {'additionalProperties': False, + 'properties': {'required': {'type': 'boolean'}}, + 'required': ['required'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'CharmResourceMeta': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'path': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'description'], + 'type': 'object'}, + 'CharmStorage': {'additionalProperties': False, + 'properties': {'count-max': {'type': 'integer'}, + 'count-min': {'type': 'integer'}, + 'description': {'type': 'string'}, + 'location': {'type': 'string'}, + 'minimum-size': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'properties': {'items': {'type': 'string'}, + 'type': 'array'}, + 'read-only': {'type': 'boolean'}, + 'shared': {'type': 'boolean'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'description', + 'type', + 'shared', + 'read-only', + 'count-min', + 'count-max', + 'minimum-size'], + 'type': 'object'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'ConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ExpressionTree': {'additionalProperties': False, + 'properties': {'Expression': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['Expression'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'ApplicationCharmInfo': {'description': 'ApplicationCharmInfo ' + 'returns information ' + 'about an ' + "application's charm.", + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'ApplicationsConfig': {'description': 'ApplicationsConfig ' + 'returns the config for ' + 'the specified ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'CharmInfo': {'description': 'CharmInfo returns information ' + 'about the requested charm.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'IsExposed': {'description': 'IsExposed returns whether the ' + 'specified applications are ' + 'exposed.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchApplications': {'description': 'WatchApplications starts ' + 'a StringsWatcher to ' + 'watch applications\n' + 'deployed to this model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchOpenedPorts': {'description': 'WatchOpenedPorts returns ' + 'a new StringsWatcher for ' + 'each given\n' + 'model tag.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(Charm) + async def 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='CAASFirewallerEmbedded', + request='ApplicationCharmInfo', + version=1, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def 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='CAASFirewallerEmbedded', + request='ApplicationsConfig', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.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)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewallerEmbedded', + request='CharmInfo', + version=1, + params=_params) + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def 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='CAASFirewallerEmbedded', + request='IsExposed', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.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='CAASFirewallerEmbedded', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.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='CAASFirewallerEmbedded', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.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='CAASFirewallerEmbedded', + request='WatchApplications', + version=1, + params=_params) + + reply = await self.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 + ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASFirewallerEmbedded', + request='WatchOpenedPorts', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class CAASFirewallerFacade(Type): + name = 'CAASFirewaller' + version = 1 + schema = {'definitions': {'ApplicationGetConfigResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/ConfigResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}}, + 'required': ['revision', 'url', 'config'], + 'type': 'object'}, + 'CharmActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'CharmActions': {'additionalProperties': False, + 'properties': {'specs': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmActionSpec'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'CharmBase': {'additionalProperties': False, + 'properties': {'architectures': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'type': 'object'}, + 'CharmContainer': {'additionalProperties': False, + 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'type': 'array'}, + 'resource': {'type': 'string'}}, + 'type': 'object'}, + 'CharmDeployment': {'additionalProperties': False, + 'properties': {'min-version': {'type': 'string'}, + 'mode': {'type': 'string'}, + 'service': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', + 'mode', + 'service', + 'min-version'], + 'type': 'object'}, + 'CharmDevice': {'additionalProperties': False, + 'properties': {'CountMax': {'type': 'integer'}, + 'CountMin': {'type': 'integer'}, + 'Description': {'type': 'string'}, + 'Name': {'type': 'string'}, + 'Type': {'type': 'string'}}, + 'required': ['Name', + 'Description', + 'Type', + 'CountMin', + 'CountMax'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CharmManifest': {'additionalProperties': False, + 'properties': {'bases': {'items': {'$ref': '#/definitions/CharmBase'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CharmMeta': {'additionalProperties': False, + 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, + 'categories': {'items': {'type': 'string'}, + 'type': 'array'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, + 'type': 'object'}, + 'deployment': {'$ref': '#/definitions/CharmDeployment'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmDevice'}}, + 'type': 'object'}, + 'extra-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'min-juju-version': {'type': 'string'}, + 'name': {'type': 'string'}, + 'payload-classes': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmPayloadClass'}}, + 'type': 'object'}, + 'peers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'provides': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'requires': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'resources': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmResourceMeta'}}, + 'type': 'object'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmStorage'}}, + 'type': 'object'}, + 'subordinate': {'type': 'boolean'}, + 'summary': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'terms': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['name', + 'summary', + 'description', + 'subordinate'], + 'type': 'object'}, + 'CharmMetric': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'description'], + 'type': 'object'}, + 'CharmMetrics': {'additionalProperties': False, + 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, + 'type': 'object'}, + 'plan': {'$ref': '#/definitions/CharmPlan'}}, + 'required': ['metrics', 'plan'], + 'type': 'object'}, + 'CharmMount': {'additionalProperties': False, + 'properties': {'location': {'type': 'string'}, + 'storage': {'type': 'string'}}, + 'type': 'object'}, + 'CharmOption': {'additionalProperties': False, + 'properties': {'default': {'additionalProperties': True, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CharmPayloadClass': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', 'type'], + 'type': 'object'}, + 'CharmPlan': {'additionalProperties': False, + 'properties': {'required': {'type': 'boolean'}}, + 'required': ['required'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'CharmResourceMeta': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'path': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'description'], + 'type': 'object'}, + 'CharmStorage': {'additionalProperties': False, + 'properties': {'count-max': {'type': 'integer'}, + 'count-min': {'type': 'integer'}, + 'description': {'type': 'string'}, + 'location': {'type': 'string'}, + 'minimum-size': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'properties': {'items': {'type': 'string'}, + 'type': 'array'}, + 'read-only': {'type': 'boolean'}, + 'shared': {'type': 'boolean'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'description', + 'type', + 'shared', + 'read-only', + 'count-min', + 'count-max', + 'minimum-size'], + 'type': 'object'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'ConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ExpressionTree': {'additionalProperties': False, + 'properties': {'Expression': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['Expression'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'ApplicationCharmInfo': {'description': 'ApplicationCharmInfo ' + 'returns information ' + 'about an ' + "application's charm.", + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'ApplicationsConfig': {'description': 'ApplicationsConfig ' + 'returns the config for ' + 'the specified ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'CharmInfo': {'description': 'CharmInfo returns information ' + 'about the requested charm.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'IsExposed': {'description': 'IsExposed returns whether the ' + 'specified applications are ' + 'exposed.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchApplications': {'description': 'WatchApplications starts ' + 'a StringsWatcher to ' + 'watch applications\n' + 'deployed to this model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(Charm) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def 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='CAASFirewaller', + request='ApplicationsConfig', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.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)): + 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def 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 = await self.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='CAASFirewaller', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.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='CAASFirewaller', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.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='CAASFirewaller', + request='WatchApplications', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CAASModelConfigManagerFacade(Type): + name = 'CAASModelConfigManager' + version = 1 + schema = {'definitions': {'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}}, + 'properties': {'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelConfigManager', + request='ControllerConfig', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CAASModelOperatorFacade(Type): + name = 'CAASModelOperator' + version = 1 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'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'}, + 'DockerImageInfo': {'additionalProperties': False, + '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'}}, + 'required': ['image-name'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'HostPort': {'additionalProperties': False, + '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'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'ModelOperatorInfo': {'additionalProperties': False, + 'properties': {'api-addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'image-details': {'$ref': '#/definitions/DockerImageInfo'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'required': ['api-addresses', + 'image-details', + 'version'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'ModelOperatorProvisioningInfo': {'description': 'ModelOperatorProvisioningInfo ' + 'returns the ' + 'information ' + 'needed for ' + 'provisioning\n' + 'a new model ' + 'operator ' + 'into a caas ' + 'cluster.', + 'properties': {'Result': {'$ref': '#/definitions/ModelOperatorInfo'}}, + 'type': 'object'}, + 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' + 'that this facade is used to ' + 'operate.\n' + 'It is implemented here directly ' + 'as a result of removing it from\n' + 'embedded APIAddresser *without* ' + 'bumping the facade version.\n' + 'It should be blanked when this ' + 'facade version is next ' + 'incremented.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetPasswords': {'description': 'SetPasswords sets the given ' + 'password for each supplied ' + 'entity, if possible.', + 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def 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 = await self.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='CAASModelOperator', + request='APIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelOperatorInfo) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def 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 = await self.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='CAASModelOperator', + request='SetPasswords', + version=1, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASModelOperator', + request='WatchAPIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CAASOperatorFacade(Type): + name = 'CAASOperator' + version = 1 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'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'}, + 'ApplicationCharm': {'additionalProperties': False, + 'properties': {'charm-modified-version': {'type': 'integer'}, + 'deployment-mode': {'type': 'string'}, + 'force-upgrade': {'type': 'boolean'}, + 'sha256': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'sha256', + 'charm-modified-version'], + 'type': 'object'}, + 'ApplicationCharmResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ApplicationCharm'}}, + 'type': 'object'}, + 'ApplicationCharmResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationCharmResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Binary': {'additionalProperties': False, + 'properties': {'Arch': {'type': 'string'}, + 'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Number': {'$ref': '#/definitions/Number'}, + 'Patch': {'type': 'integer'}, + 'Release': {'type': 'string'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build', + 'Number', + 'Release', + 'Arch'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesVersion': {'additionalProperties': False, + 'properties': {'agent-tools': {'items': {'$ref': '#/definitions/EntityVersion'}, + 'type': 'array'}}, + 'required': ['agent-tools'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'EntityString': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['tag', 'value'], + 'type': 'object'}, + 'EntityVersion': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'tools': {'$ref': '#/definitions/Version'}}, + 'required': ['tag', 'tools'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'HostPort': {'additionalProperties': False, + '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'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'type'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'SetPodSpecParams': {'additionalProperties': False, + 'properties': {'specs': {'items': {'$ref': '#/definitions/EntityString'}, + 'type': 'array'}}, + 'required': ['specs'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Version': {'additionalProperties': False, + 'properties': {'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version'], + 'type': 'object'}, + 'WatchContainerStartArg': {'additionalProperties': False, + 'properties': {'container': {'type': 'string'}, + 'entity': {'$ref': '#/definitions/Entity'}}, + 'required': ['entity'], + 'type': 'object'}, + 'WatchContainerStartArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/WatchContainerStartArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'Charm': {'description': 'Charm returns the charm info for all ' + 'given applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationCharmResults'}}, + 'type': 'object'}, + 'CurrentModel': {'description': 'CurrentModel returns the name ' + 'and UUID for the current juju ' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelResult'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' + 'that this facade is used to ' + 'operate.\n' + 'It is implemented here directly ' + 'as a result of removing it from\n' + 'embedded APIAddresser *without* ' + 'bumping the facade version.\n' + 'It should be blanked when this ' + 'facade version is next ' + 'incremented.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'Remove': {'description': 'Remove removes every given entity ' + 'from state, calling EnsureDead\n' + 'first, then Remove. It will fail if ' + 'the entity is not present.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetPodSpec': {'description': 'SetPodSpec sets the container ' + 'specs for a set of ' + 'applications.\n' + 'TODO(juju3) - remove', + 'properties': {'Params': {'$ref': '#/definitions/SetPodSpecParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the status of ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetTools': {'description': 'SetTools updates the recorded ' + 'tools version for the agents.', + 'properties': {'Params': {'$ref': '#/definitions/EntitiesVersion'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchContainerStart': {'description': 'WatchContainerStart ' + 'starts a StringWatcher ' + 'to watch for container ' + 'start events\n' + 'on the CAAS api for a ' + 'specific application ' + 'and container.', + 'properties': {'Params': {'$ref': '#/definitions/WatchContainerStartArgs'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnits': {'description': 'WatchUnits starts a ' + 'StringsWatcher to watch changes ' + 'to the\n' + 'lifecycle states of units for ' + 'the specified applications in\n' + 'this model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def 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 = await self.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='CAASOperator', + request='APIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationCharmResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelResult) + async def 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 = await self.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='CAASOperator', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.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='CAASOperator', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class CAASOperatorProvisionerFacade(Type): + name = 'CAASOperatorProvisioner' + version = 1 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'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'}, + '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'}}, + 'required': ['revision', 'url', 'config'], + 'type': 'object'}, + 'CharmActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'CharmActions': {'additionalProperties': False, + 'properties': {'specs': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmActionSpec'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'CharmBase': {'additionalProperties': False, + 'properties': {'architectures': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'type': 'object'}, + 'CharmContainer': {'additionalProperties': False, + 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'type': 'array'}, + 'resource': {'type': 'string'}}, + 'type': 'object'}, + 'CharmDeployment': {'additionalProperties': False, + 'properties': {'min-version': {'type': 'string'}, + 'mode': {'type': 'string'}, + 'service': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', + 'mode', + 'service', + 'min-version'], + 'type': 'object'}, + 'CharmDevice': {'additionalProperties': False, + 'properties': {'CountMax': {'type': 'integer'}, + 'CountMin': {'type': 'integer'}, + 'Description': {'type': 'string'}, + 'Name': {'type': 'string'}, + 'Type': {'type': 'string'}}, + 'required': ['Name', + 'Description', + 'Type', + 'CountMin', + 'CountMax'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CharmManifest': {'additionalProperties': False, + 'properties': {'bases': {'items': {'$ref': '#/definitions/CharmBase'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CharmMeta': {'additionalProperties': False, + 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, + 'categories': {'items': {'type': 'string'}, + 'type': 'array'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, + 'type': 'object'}, + 'deployment': {'$ref': '#/definitions/CharmDeployment'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmDevice'}}, + 'type': 'object'}, + 'extra-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'min-juju-version': {'type': 'string'}, + 'name': {'type': 'string'}, + 'payload-classes': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmPayloadClass'}}, + 'type': 'object'}, + 'peers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'provides': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'requires': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'resources': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmResourceMeta'}}, + 'type': 'object'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmStorage'}}, + 'type': 'object'}, + 'subordinate': {'type': 'boolean'}, + 'summary': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'terms': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['name', + 'summary', + 'description', + 'subordinate'], + 'type': 'object'}, + 'CharmMetric': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'description'], + 'type': 'object'}, + 'CharmMetrics': {'additionalProperties': False, + 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, + 'type': 'object'}, + 'plan': {'$ref': '#/definitions/CharmPlan'}}, + 'required': ['metrics', 'plan'], + 'type': 'object'}, + 'CharmMount': {'additionalProperties': False, + 'properties': {'location': {'type': 'string'}, + 'storage': {'type': 'string'}}, + 'type': 'object'}, + 'CharmOption': {'additionalProperties': False, + 'properties': {'default': {'additionalProperties': True, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CharmPayloadClass': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', 'type'], + 'type': 'object'}, + 'CharmPlan': {'additionalProperties': False, + 'properties': {'required': {'type': 'boolean'}}, + 'required': ['required'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'CharmResourceMeta': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'path': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'description'], + 'type': 'object'}, + 'CharmStorage': {'additionalProperties': False, + 'properties': {'count-max': {'type': 'integer'}, + 'count-min': {'type': 'integer'}, + 'description': {'type': 'string'}, + 'location': {'type': 'string'}, + 'minimum-size': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'properties': {'items': {'type': 'string'}, + 'type': 'array'}, + 'read-only': {'type': 'boolean'}, + 'shared': {'type': 'boolean'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'description', + 'type', + 'shared', + 'read-only', + 'count-min', + 'count-max', + 'minimum-size'], + 'type': 'object'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'DockerImageInfo': {'additionalProperties': False, + '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'}}, + 'required': ['image-name'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'ExpressionTree': {'additionalProperties': False, + 'properties': {'Expression': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['Expression'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + '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'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'IssueOperatorCertificateResult': {'additionalProperties': False, + 'properties': {'ca-cert': {'type': 'string'}, + 'cert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'private-key': {'type': 'string'}}, + 'required': ['ca-cert', + 'cert', + 'private-key'], + 'type': 'object'}, + 'IssueOperatorCertificateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IssueOperatorCertificateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'KubernetesFilesystemAttachmentParams': {'additionalProperties': False, + 'properties': {'mount-point': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'required': ['provider'], + 'type': 'object'}, + 'KubernetesFilesystemParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/KubernetesFilesystemAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'storagename': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['storagename', + 'size', + 'provider'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'OperatorProvisioningInfo': {'additionalProperties': False, + 'properties': {'api-addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'charm-storage': {'$ref': '#/definitions/KubernetesFilesystemParams'}, + 'error': {'$ref': '#/definitions/Error'}, + 'image-details': {'$ref': '#/definitions/DockerImageInfo'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'required': ['image-details', + 'version', + 'api-addresses'], + 'type': 'object'}, + 'OperatorProvisioningInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/OperatorProvisioningInfo'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'ApplicationCharmInfo': {'description': 'ApplicationCharmInfo ' + 'returns information ' + 'about an ' + "application's charm.", + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'CharmInfo': {'description': 'CharmInfo returns information ' + 'about the requested charm.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'IssueOperatorCertificate': {'description': 'IssueOperatorCertificate ' + 'issues an x509 ' + 'certificate for ' + 'use by the ' + 'specified ' + 'application ' + 'operator.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IssueOperatorCertificateResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' + 'that this facade is used to ' + 'operate.\n' + 'It is implemented here directly ' + 'as a result of removing it from\n' + 'embedded APIAddresser *without* ' + 'bumping the facade version.\n' + 'It should be blanked when this ' + 'facade version is next ' + 'incremented.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'OperatorProvisioningInfo': {'description': 'OperatorProvisioningInfo ' + 'returns the info ' + 'needed to ' + 'provision an ' + 'operator.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/OperatorProvisioningInfoResults'}}, + 'type': 'object'}, + 'SetPasswords': {'description': 'SetPasswords sets the given ' + 'password for each supplied ' + 'entity, if possible.', + 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchApplications': {'description': 'WatchApplications starts ' + 'a StringsWatcher to ' + 'watch applications\n' + 'deployed to this model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def 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 = await self.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='CAASOperatorProvisioner', + request='APIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(Charm) + async def 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 = await self.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)): + 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(IssueOperatorCertificateResults) + async def 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 = await self.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='CAASOperatorProvisioner', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(OperatorProvisioningInfoResults) + async def 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 = await self.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='CAASOperatorProvisioner', + request='SetPasswords', + version=1, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.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='CAASOperatorProvisioner', + request='WatchApplications', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CAASOperatorUpgraderFacade(Type): + name = 'CAASOperatorUpgrader' + 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'}, + 'KubernetesUpgradeArg': {'additionalProperties': False, + 'properties': {'agent-tag': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'required': ['agent-tag', 'version'], + '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'}}, + 'properties': {'UpgradeOperator': {'description': 'UpgradeOperator upgrades ' + 'the operator for the ' + 'specified agents.', + 'properties': {'Params': {'$ref': '#/definitions/KubernetesUpgradeArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def 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 = await self.rpc(msg) + return reply + + + +class CAASUnitProvisionerFacade(Type): + name = 'CAASUnitProvisioner' + version = 1 + schema = {'definitions': {'Address': {'additionalProperties': False, + 'properties': {'cidr': {'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'}}, + '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'}, + 'ports': {'items': {'type': 'string'}, + 'type': 'array'}, + 'provider-id': {'type': 'string'}, + 'stateful': {'type': 'boolean'}, + 'status': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['provider-id', + 'unit-tag', + 'address', + 'ports', + 'status', + 'info'], + 'type': 'object'}, + 'ConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + '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'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'KubernetesDeploymentInfo': {'additionalProperties': False, + 'properties': {'deployment-type': {'type': 'string'}, + 'service-type': {'type': 'string'}}, + 'required': ['deployment-type', + 'service-type'], + 'type': 'object'}, + 'KubernetesDeviceParams': {'additionalProperties': False, + 'properties': {'Attributes': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'Count': {'type': 'integer'}, + 'Type': {'type': 'string'}}, + 'required': ['Type', + 'Count', + 'Attributes'], + 'type': 'object'}, + 'KubernetesFilesystemAttachmentParams': {'additionalProperties': False, + 'properties': {'mount-point': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'required': ['provider'], + 'type': 'object'}, + 'KubernetesFilesystemInfo': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'filesystem-id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'mount-point': {'type': 'string'}, + 'pool': {'type': 'string'}, + 'read-only': {'type': 'boolean'}, + 'size': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'storagename': {'type': 'string'}, + 'volume': {'$ref': '#/definitions/KubernetesVolumeInfo'}}, + 'required': ['storagename', + 'pool', + 'size', + 'filesystem-id', + 'status', + 'info', + 'volume'], + 'type': 'object'}, + 'KubernetesFilesystemParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/KubernetesFilesystemAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'storagename': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['storagename', + 'size', + 'provider'], + 'type': 'object'}, + 'KubernetesProvisioningInfo': {'additionalProperties': False, + 'properties': {'charm-modified-version': {'type': 'integer'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'deployment-info': {'$ref': '#/definitions/KubernetesDeploymentInfo'}, + 'devices': {'items': {'$ref': '#/definitions/KubernetesDeviceParams'}, + 'type': 'array'}, + 'filesystems': {'items': {'$ref': '#/definitions/KubernetesFilesystemParams'}, + 'type': 'array'}, + 'operator-image-path': {'type': 'string'}, + 'pod-spec': {'type': 'string'}, + 'raw-k8s-spec': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volumes': {'items': {'$ref': '#/definitions/KubernetesVolumeParams'}, + 'type': 'array'}}, + 'required': ['pod-spec', + 'constraints'], + 'type': 'object'}, + 'KubernetesProvisioningInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/KubernetesProvisioningInfo'}}, + 'required': ['result'], + 'type': 'object'}, + 'KubernetesProvisioningInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/KubernetesProvisioningInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'KubernetesVolumeAttachmentParams': {'additionalProperties': False, + 'properties': {'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'required': ['provider'], + 'type': 'object'}, + 'KubernetesVolumeInfo': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'volume-id': {'type': 'string'}}, + 'required': ['volume-id', + 'size', + 'persistent', + 'status', + 'info'], + 'type': 'object'}, + 'KubernetesVolumeParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/KubernetesVolumeAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'storagename': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['storagename', + 'size', + 'provider'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'UpdateApplicationServiceArg': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'application-tag': {'type': 'string'}, + 'generation': {'type': 'integer'}, + 'provider-id': {'type': 'string'}, + 'scale': {'type': 'integer'}}, + 'required': ['application-tag', + 'provider-id', + 'addresses'], + 'type': 'object'}, + 'UpdateApplicationServiceArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateApplicationServiceArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpdateApplicationUnitArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateApplicationUnits'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpdateApplicationUnitResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'$ref': '#/definitions/UpdateApplicationUnitsInfo'}}, + 'type': 'object'}, + 'UpdateApplicationUnitResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpdateApplicationUnitResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateApplicationUnits': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'generation': {'type': 'integer'}, + 'scale': {'type': 'integer'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'units': {'items': {'$ref': '#/definitions/ApplicationUnitParams'}, + 'type': 'array'}}, + 'required': ['application-tag', + 'units'], + 'type': 'object'}, + 'UpdateApplicationUnitsInfo': {'additionalProperties': False, + 'properties': {'units': {'items': {'$ref': '#/definitions/ApplicationUnitInfo'}, + 'type': 'array'}}, + 'required': ['units'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'ApplicationsConfig': {'description': 'ApplicationsConfig ' + 'returns the config for ' + 'the specified ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'ApplicationsScale': {'description': 'ApplicationsScale ' + 'returns the scaling info ' + 'for specified ' + 'applications in this ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'ClearApplicationsResources': {'description': 'ClearApplicationsResources ' + 'clears the ' + 'flags which ' + 'indicate\n' + 'applications ' + 'still have ' + 'resources in ' + 'the cluster.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DeploymentMode': {'description': 'DeploymentMode returns the ' + 'deployment mode of the ' + "given applications' charms.", + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ProvisioningInfo': {'description': 'ProvisioningInfo returns ' + 'the provisioning info for ' + 'specified applications in ' + 'this model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/KubernetesProvisioningInfoResults'}}, + 'type': 'object'}, + 'SetOperatorStatus': {'description': 'SetOperatorStatus ' + 'updates the operator ' + 'status for each given ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateApplicationsService': {'description': 'UpdateApplicationsService ' + 'updates the Juju ' + 'data model to ' + 'reflect the ' + 'given\n' + 'service details ' + 'of the specified ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateApplicationServiceArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateApplicationsUnits': {'description': 'UpdateApplicationsUnits ' + 'updates the Juju ' + 'data model to ' + 'reflect the given\n' + 'units of the ' + 'specified ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateApplicationUnitArgs'}, + 'Result': {'$ref': '#/definitions/UpdateApplicationUnitResults'}}, + 'type': 'object'}, + 'WatchApplications': {'description': 'WatchApplications starts ' + 'a StringsWatcher to ' + 'watch applications ' + 'deployed to this model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchApplicationsScale': {'description': 'WatchApplicationsScale ' + 'starts a ' + 'NotifyWatcher to ' + 'watch changes\n' + 'to the ' + "applications' " + 'scale.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchPodSpec': {'description': 'WatchPodSpec starts a ' + 'NotifyWatcher to watch ' + 'changes to the\n' + 'pod spec for specified units ' + 'in this model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ApplicationGetConfigResults) + async def 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='CAASUnitProvisioner', + request='ApplicationsConfig', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def ApplicationsScale(self, entities=None): + ''' + ApplicationsScale returns the scaling info for specified applications in this model. + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='ApplicationsScale', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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='CAASUnitProvisioner', + request='ClearApplicationsResources', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def DeploymentMode(self, entities=None): + ''' + DeploymentMode returns the deployment mode of the given applications' charms. + + 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='CAASUnitProvisioner', + request='DeploymentMode', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.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='CAASUnitProvisioner', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @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=1, + params=_params) + _params['entities'] = entities + reply = await self.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=1, + params=_params) + _params['entities'] = entities + reply = await self.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=1, + params=_params) + _params['args'] = args + reply = await self.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=1, + params=_params) + _params['args'] = args + reply = await self.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=1, + params=_params) + + reply = await self.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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class CharmDownloaderFacade(Type): + name = 'CharmDownloader' + 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'}, + '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'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'DownloadApplicationCharms': {'description': 'DownloadApplicationCharms ' + 'iterates the ' + 'list of provided ' + 'applications ' + 'and\n' + 'downloads any ' + 'referenced ' + 'charms that have ' + 'not yet been ' + 'persisted to ' + 'the\n' + 'blob store.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchApplicationsWithPendingCharms': {'description': 'WatchApplicationsWithPendingCharms ' + 'registers ' + 'and ' + 'returns ' + 'a ' + 'watcher ' + 'instance\n' + 'that ' + 'reports ' + 'the ID ' + 'of ' + 'applications ' + 'that ' + 'reference ' + 'a charm ' + 'which ' + 'has not ' + 'yet\n' + 'been ' + 'downloaded.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + +class CharmHubFacade(Type): + name = 'CharmHub' + version = 1 + schema = {'definitions': {'BundleCharm': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'package-id': {'type': 'string'}}, + 'required': ['name', 'package-id'], + 'type': 'object'}, + 'Channel': {'additionalProperties': False, + 'properties': {'platforms': {'items': {'$ref': '#/definitions/Platform'}, + 'type': 'array'}, + 'released-at': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'risk': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'track': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['released-at', + 'track', + 'risk', + 'revision', + 'size', + 'version', + 'platforms'], + 'type': 'object'}, + 'CharmHubBundle': {'additionalProperties': False, + 'properties': {'charms': {'items': {'$ref': '#/definitions/BundleCharm'}, + 'type': 'array'}}, + 'required': ['charms'], + 'type': 'object'}, + 'CharmHubCharm': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmOption'}}, + 'type': 'object'}, + 'relations': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'subordinate': {'type': 'boolean'}, + 'used-by': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['config', + 'relations', + 'subordinate', + 'used-by'], + 'type': 'object'}, + 'CharmHubEntityFindResult': {'additionalProperties': False, + 'properties': {'errors': {'$ref': '#/definitions/ErrorResponse'}, + 'result': {'items': {'$ref': '#/definitions/FindResponse'}, + 'type': 'array'}}, + 'required': ['result', 'errors'], + 'type': 'object'}, + 'CharmHubEntityInfoResult': {'additionalProperties': False, + 'properties': {'errors': {'$ref': '#/definitions/ErrorResponse'}, + 'result': {'$ref': '#/definitions/InfoResponse'}}, + 'required': ['result', 'errors'], + 'type': 'object'}, + 'CharmHubError': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'message': {'type': 'string'}}, + 'required': ['code', 'message'], + 'type': 'object'}, + 'CharmOption': {'additionalProperties': False, + 'properties': {'default': {'additionalProperties': True, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'ErrorResponse': {'additionalProperties': False, + 'properties': {'error-list': {'$ref': '#/definitions/CharmHubError'}}, + 'required': ['error-list'], + 'type': 'object'}, + 'FindResponse': {'additionalProperties': False, + 'properties': {'architectures': {'items': {'type': 'string'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'name': {'type': 'string'}, + 'os': {'items': {'type': 'string'}, + 'type': 'array'}, + 'publisher': {'type': 'string'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'store-url': {'type': 'string'}, + 'summary': {'type': 'string'}, + 'type': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['type', + 'id', + 'name', + 'publisher', + 'summary', + 'version', + 'store-url'], + 'type': 'object'}, + 'Info': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'InfoResponse': {'additionalProperties': False, + 'properties': {'bundle': {'$ref': '#/definitions/CharmHubBundle'}, + 'channel-map': {'patternProperties': {'.*': {'$ref': '#/definitions/Channel'}}, + 'type': 'object'}, + 'charm': {'$ref': '#/definitions/CharmHubCharm'}, + 'description': {'type': 'string'}, + 'id': {'type': 'string'}, + 'name': {'type': 'string'}, + 'publisher': {'type': 'string'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'store-url': {'type': 'string'}, + 'summary': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tracks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'type': {'type': 'string'}}, + 'required': ['type', + 'id', + 'name', + 'description', + 'publisher', + 'summary', + 'series', + 'store-url', + 'tags', + 'channel-map', + 'tracks'], + 'type': 'object'}, + 'Platform': {'additionalProperties': False, + 'properties': {'architecture': {'type': 'string'}, + 'os': {'type': 'string'}, + 'series': {'type': 'string'}}, + 'required': ['architecture', 'os', 'series'], + 'type': 'object'}, + 'Query': {'additionalProperties': False, + 'properties': {'category': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'platforms': {'type': 'string'}, + 'publisher': {'type': 'string'}, + 'query': {'type': 'string'}, + 'relation-provides': {'type': 'string'}, + 'relation-requires': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['query'], + 'type': 'object'}}, + 'properties': {'Find': {'description': 'Find queries the CharmHub API with a ' + 'given entity ID.', + 'properties': {'Params': {'$ref': '#/definitions/Query'}, + 'Result': {'$ref': '#/definitions/CharmHubEntityFindResult'}}, + 'type': 'object'}, + 'Info': {'description': 'Info queries the CharmHub API with a ' + 'given entity ID.', + 'properties': {'Params': {'$ref': '#/definitions/Info'}, + 'Result': {'$ref': '#/definitions/CharmHubEntityInfoResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(CharmHubEntityFindResult) + async def Find(self, category=None, channel=None, platforms=None, publisher=None, query=None, relation_provides=None, relation_requires=None, type_=None): + ''' + Find queries the CharmHub API with a given entity ID. + + category : str + channel : str + platforms : str + publisher : str + query : str + relation_provides : str + relation_requires : str + type_ : str + Returns -> CharmHubEntityFindResult + ''' + if category is not None and not isinstance(category, (bytes, str)): + raise Exception("Expected category to be a str, received: {}".format(type(category))) + + if channel is not None and not isinstance(channel, (bytes, str)): + raise Exception("Expected channel to be a str, received: {}".format(type(channel))) + + if platforms is not None and not isinstance(platforms, (bytes, str)): + raise Exception("Expected platforms to be a str, received: {}".format(type(platforms))) + + if publisher is not None and not isinstance(publisher, (bytes, str)): + raise Exception("Expected publisher to be a str, received: {}".format(type(publisher))) + + if query is not None and not isinstance(query, (bytes, str)): + raise Exception("Expected query to be a str, received: {}".format(type(query))) + + if relation_provides is not None and not isinstance(relation_provides, (bytes, str)): + raise Exception("Expected relation_provides to be a str, received: {}".format(type(relation_provides))) + + if relation_requires is not None and not isinstance(relation_requires, (bytes, str)): + raise Exception("Expected relation_requires to be a str, received: {}".format(type(relation_requires))) + + 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='CharmHub', + request='Find', + version=1, + params=_params) + _params['category'] = category + _params['channel'] = channel + _params['platforms'] = platforms + _params['publisher'] = publisher + _params['query'] = query + _params['relation-provides'] = relation_provides + _params['relation-requires'] = relation_requires + _params['type'] = type_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CharmHubEntityInfoResult) + async def Info(self, channel=None, tag=None): + ''' + Info queries the CharmHub API with a given entity ID. + + channel : str + tag : str + Returns -> CharmHubEntityInfoResult + ''' + if channel is not None and not isinstance(channel, (bytes, str)): + raise Exception("Expected channel to be a str, received: {}".format(type(channel))) + + 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='CharmHub', + request='Info', + version=1, + params=_params) + _params['channel'] = channel + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + +class ClientFacade(Type): + name = 'Client' + version = 1 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'AddCharm': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'required': ['url', 'channel'], + 'type': 'object'}, + 'AddCharmWithAuthorization': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'channel', + 'macaroon'], + 'type': 'object'}, + 'AddMachineParams': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'container-type': {'type': 'string'}, + 'disks': {'items': {'$ref': '#/definitions/Constraints'}, + 'type': 'array'}, + 'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'instance-id': {'type': 'string'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'parent-id': {'type': 'string'}, + 'placement': {'$ref': '#/definitions/Placement'}, + 'series': {'type': 'string'}}, + 'required': ['series', + 'constraints', + 'jobs', + 'parent-id', + 'container-type', + 'instance-id', + 'nonce', + 'hardware-characteristics', + 'addresses'], + 'type': 'object'}, + 'AddMachines': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'AddMachinesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'machine': {'type': 'string'}}, + 'required': ['machine'], + 'type': 'object'}, + 'AddMachinesResults': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'AgentVersionResult': {'additionalProperties': False, + 'properties': {'version': {'$ref': '#/definitions/Number'}}, + 'required': ['version'], + 'type': 'object'}, + 'AllWatcherId': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'ApplicationStatus': {'additionalProperties': False, + 'properties': {'can-upgrade-to': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'err': {'additionalProperties': True, + 'type': 'object'}, + 'exposed': {'type': 'boolean'}, + 'life': {'type': 'string'}, + 'meter-statuses': {'patternProperties': {'.*': {'$ref': '#/definitions/MeterStatus'}}, + 'type': 'object'}, + 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'series': {'type': 'string'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}, + 'subordinate-to': {'items': {'type': 'string'}, + 'type': 'array'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, + 'type': 'object'}, + 'workload-version': {'type': 'string'}}, + 'required': ['charm', + 'series', + 'exposed', + 'life', + 'relations', + 'can-upgrade-to', + 'subordinate-to', + 'units', + 'meter-statuses', + 'status', + 'workload-version'], + 'type': 'object'}, + 'Binary': {'additionalProperties': False, + 'properties': {'Arch': {'type': 'string'}, + 'Number': {'$ref': '#/definitions/Number'}, + 'Series': {'type': 'string'}}, + 'required': ['Number', 'Series', 'Arch'], + 'type': 'object'}, + 'BundleChange': {'additionalProperties': False, + 'properties': {'args': {'items': {'additionalProperties': True, + 'type': 'object'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesParams': {'additionalProperties': False, + 'properties': {'yaml': {'type': 'string'}}, + 'required': ['yaml'], + 'type': 'object'}, + 'BundleChangesResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'DestroyMachines': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'machine-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['machine-names', 'force'], + 'type': 'object'}, + 'DetailedStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'err': {'additionalProperties': True, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'kind': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['status', + 'info', + 'data', + 'since', + 'kind', + 'version', + 'life'], + 'type': 'object'}, + 'EndpointStatus': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}, + 'subordinate': {'type': 'boolean'}}, + 'required': ['application', + 'name', + 'role', + 'subordinate'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'FindToolsParams': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'major': {'type': 'integer'}, + 'minor': {'type': 'integer'}, + 'number': {'$ref': '#/definitions/Number'}, + 'series': {'type': 'string'}}, + 'required': ['number', + 'major', + 'minor', + 'arch', + 'series'], + 'type': 'object'}, + 'FindToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'list': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['list'], + 'type': 'object'}, + 'FullStatus': {'additionalProperties': False, + 'properties': {'applications': {'patternProperties': {'.*': {'$ref': '#/definitions/ApplicationStatus'}}, + 'type': 'object'}, + 'machines': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}}, + 'type': 'object'}, + 'model': {'$ref': '#/definitions/ModelStatusInfo'}, + 'relations': {'items': {'$ref': '#/definitions/RelationStatus'}, + 'type': 'array'}, + 'remote-applications': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteApplicationStatus'}}, + 'type': 'object'}}, + 'required': ['model', + 'machines', + 'applications', + 'remote-applications', + 'relations'], + 'type': 'object'}, + 'GetConstraintsResults': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'History': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'statuses': {'items': {'$ref': '#/definitions/DetailedStatus'}, + 'type': 'array'}}, + 'required': ['statuses'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}}, + 'required': ['Address', 'port'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachineHardware': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'MachineStatus': {'additionalProperties': False, + 'properties': {'agent-status': {'$ref': '#/definitions/DetailedStatus'}, + 'constraints': {'type': 'string'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}}, + 'type': 'object'}, + 'dns-name': {'type': 'string'}, + 'hardware': {'type': 'string'}, + 'has-vote': {'type': 'boolean'}, + 'id': {'type': 'string'}, + 'instance-id': {'type': 'string'}, + 'instance-status': {'$ref': '#/definitions/DetailedStatus'}, + 'ip-addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'network-interfaces': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInterface'}}, + 'type': 'object'}, + 'series': {'type': 'string'}, + 'wants-vote': {'type': 'boolean'}}, + 'required': ['agent-status', + 'instance-status', + 'dns-name', + 'instance-id', + 'series', + 'id', + 'containers', + 'constraints', + 'hardware', + 'jobs', + 'has-vote', + 'wants-vote'], + 'type': 'object'}, + 'MeterStatus': {'additionalProperties': False, + 'properties': {'color': {'type': 'string'}, + 'message': {'type': 'string'}}, + 'required': ['color', 'message'], + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'cloud-credential-tag': {'type': 'string'}, + 'cloud-region': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'controller-uuid': {'type': 'string'}, + 'default-series': {'type': 'string'}, + 'life': {'type': 'string'}, + 'machines': {'items': {'$ref': '#/definitions/ModelMachineInfo'}, + 'type': 'array'}, + 'migration': {'$ref': '#/definitions/ModelMigrationStatus'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'provider-type': {'type': 'string'}, + 'sla': {'$ref': '#/definitions/ModelSLAInfo'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'users': {'items': {'$ref': '#/definitions/ModelUserInfo'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', + 'uuid', + 'controller-uuid', + 'cloud-tag', + 'owner-tag', + 'life', + 'users', + 'machines', + 'sla', + 'agent-version'], + 'type': 'object'}, + 'ModelMachineInfo': {'additionalProperties': False, + 'properties': {'hardware': {'$ref': '#/definitions/MachineHardware'}, + 'has-vote': {'type': 'boolean'}, + 'id': {'type': 'string'}, + 'instance-id': {'type': 'string'}, + 'status': {'type': 'string'}, + 'wants-vote': {'type': 'boolean'}}, + 'required': ['id'], + 'type': 'object'}, + 'ModelMigrationStatus': {'additionalProperties': False, + 'properties': {'end': {'format': 'date-time', + 'type': 'string'}, + 'start': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'start'], + 'type': 'object'}, + 'ModelSLA': {'additionalProperties': False, + 'properties': {'ModelSLAInfo': {'$ref': '#/definitions/ModelSLAInfo'}, + 'creds': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['ModelSLAInfo', 'creds'], + 'type': 'object'}, + 'ModelSLAInfo': {'additionalProperties': False, + 'properties': {'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', 'owner'], + 'type': 'object'}, + 'ModelSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelStatusInfo': {'additionalProperties': False, + 'properties': {'available-version': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'meter-status': {'$ref': '#/definitions/MeterStatus'}, + 'model-status': {'$ref': '#/definitions/DetailedStatus'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'sla': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['name', + 'cloud-tag', + 'version', + 'available-version', + 'model-status', + 'meter-status', + 'sla'], + 'type': 'object'}, + 'ModelUnset': {'additionalProperties': False, + 'properties': {'keys': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['keys'], + 'type': 'object'}, + 'ModelUserInfo': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'display-name': {'type': 'string'}, + 'last-connection': {'format': 'date-time', + 'type': 'string'}, + 'user': {'type': 'string'}}, + 'required': ['user', + 'display-name', + 'last-connection', + 'access'], + 'type': 'object'}, + 'ModelUserInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ModelUserInfo'}}, + 'type': 'object'}, + 'ModelUserInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ModelUserInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NetworkInterface': {'additionalProperties': False, + 'properties': {'dns-nameservers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway': {'type': 'string'}, + 'ip-addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'is-up': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'space': {'type': 'string'}}, + 'required': ['ip-addresses', + 'mac-address', + 'is-up'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'PrivateAddress': {'additionalProperties': False, + 'properties': {'target': {'type': 'string'}}, + 'required': ['target'], + 'type': 'object'}, + 'PrivateAddressResults': {'additionalProperties': False, + 'properties': {'private-address': {'type': 'string'}}, + 'required': ['private-address'], + 'type': 'object'}, + 'ProvisioningScriptParams': {'additionalProperties': False, + 'properties': {'data-dir': {'type': 'string'}, + 'disable-package-commands': {'type': 'boolean'}, + 'machine-id': {'type': 'string'}, + 'nonce': {'type': 'string'}}, + 'required': ['machine-id', + 'nonce', + 'data-dir', + 'disable-package-commands'], + 'type': 'object'}, + 'ProvisioningScriptResult': {'additionalProperties': False, + 'properties': {'script': {'type': 'string'}}, + 'required': ['script'], + 'type': 'object'}, + 'PublicAddress': {'additionalProperties': False, + 'properties': {'target': {'type': 'string'}}, + 'required': ['target'], + 'type': 'object'}, + 'PublicAddressResults': {'additionalProperties': False, + 'properties': {'public-address': {'type': 'string'}}, + 'required': ['public-address'], + 'type': 'object'}, + 'RelationStatus': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'$ref': '#/definitions/EndpointStatus'}, + 'type': 'array'}, + 'id': {'type': 'integer'}, + 'interface': {'type': 'string'}, + 'key': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['id', + 'key', + 'interface', + 'scope', + 'endpoints'], + 'type': 'object'}, + 'RemoteApplicationStatus': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'application-url': {'type': 'string'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'err': {'additionalProperties': True, + 'type': 'object'}, + 'life': {'type': 'string'}, + 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}}, + 'required': ['application-url', + 'application-name', + 'endpoints', + 'life', + 'relations', + 'status'], + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit', + 'scope'], + 'type': 'object'}, + 'ResolveCharmResult': {'additionalProperties': False, + 'properties': {'error': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'type': 'object'}, + 'ResolveCharmResults': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/ResolveCharmResult'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'ResolveCharms': {'additionalProperties': False, + 'properties': {'references': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['references'], + 'type': 'object'}, + 'Resolved': {'additionalProperties': False, + 'properties': {'retry': {'type': 'boolean'}, + 'unit-name': {'type': 'string'}}, + 'required': ['unit-name', 'retry'], + 'type': 'object'}, + 'SetConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['application', 'constraints'], + 'type': 'object'}, + 'SetModelAgentVersion': {'additionalProperties': False, + 'properties': {'version': {'$ref': '#/definitions/Number'}}, + 'required': ['version'], + 'type': 'object'}, + 'StatusHistoryFilter': {'additionalProperties': False, + 'properties': {'date': {'format': 'date-time', + 'type': 'string'}, + 'delta': {'type': 'integer'}, + 'exclude': {'items': {'type': 'string'}, + 'type': 'array'}, + 'size': {'type': 'integer'}}, + 'required': ['size', + 'date', + 'delta', + 'exclude'], + 'type': 'object'}, + 'StatusHistoryRequest': {'additionalProperties': False, + 'properties': {'filter': {'$ref': '#/definitions/StatusHistoryFilter'}, + 'historyKind': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tag': {'type': 'string'}}, + 'required': ['historyKind', + 'size', + 'filter', + 'tag'], + 'type': 'object'}, + 'StatusHistoryRequests': {'additionalProperties': False, + 'properties': {'requests': {'items': {'$ref': '#/definitions/StatusHistoryRequest'}, + 'type': 'array'}}, + 'required': ['requests'], + 'type': 'object'}, + 'StatusHistoryResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'history': {'$ref': '#/definitions/History'}}, + 'required': ['history'], + 'type': 'object'}, + 'StatusHistoryResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusHistoryResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusParams': {'additionalProperties': False, + 'properties': {'patterns': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['patterns'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'UnitStatus': {'additionalProperties': False, + 'properties': {'agent-status': {'$ref': '#/definitions/DetailedStatus'}, + 'charm': {'type': 'string'}, + 'leader': {'type': 'boolean'}, + 'machine': {'type': 'string'}, + 'opened-ports': {'items': {'type': 'string'}, + 'type': 'array'}, + 'public-address': {'type': 'string'}, + 'subordinates': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, + 'type': 'object'}, + 'workload-status': {'$ref': '#/definitions/DetailedStatus'}, + 'workload-version': {'type': 'string'}}, + 'required': ['agent-status', + 'workload-status', + 'workload-version', + 'machine', + 'opened-ports', + 'public-address', + 'charm', + 'subordinates'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'spaces': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}}, + 'type': 'object'}}, + 'properties': {'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'AbortCurrentUpgrade': {'type': 'object'}, + 'AddCharm': {'properties': {'Params': {'$ref': '#/definitions/AddCharm'}}, + 'type': 'object'}, + 'AddCharmWithAuthorization': {'properties': {'Params': {'$ref': '#/definitions/AddCharmWithAuthorization'}}, + 'type': 'object'}, + 'AddMachines': {'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'AddMachinesV2': {'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'AgentVersion': {'properties': {'Result': {'$ref': '#/definitions/AgentVersionResult'}}, + 'type': 'object'}, + 'CACert': {'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'DestroyMachines': {'properties': {'Params': {'$ref': '#/definitions/DestroyMachines'}}, + 'type': 'object'}, + 'FindTools': {'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, + 'Result': {'$ref': '#/definitions/FindToolsResult'}}, + 'type': 'object'}, + 'FullStatus': {'properties': {'Params': {'$ref': '#/definitions/StatusParams'}, + 'Result': {'$ref': '#/definitions/FullStatus'}}, + 'type': 'object'}, + 'GetBundleChanges': {'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, + 'type': 'object'}, + 'GetModelConstraints': {'properties': {'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, + 'type': 'object'}, + 'InjectMachines': {'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'ModelGet': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelInfo': {'properties': {'Result': {'$ref': '#/definitions/ModelInfo'}}, + 'type': 'object'}, + 'ModelSet': {'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, + 'type': 'object'}, + 'ModelUnset': {'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, + 'type': 'object'}, + 'ModelUserInfo': {'properties': {'Result': {'$ref': '#/definitions/ModelUserInfoResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'properties': {'Params': {'$ref': '#/definitions/PrivateAddress'}, + 'Result': {'$ref': '#/definitions/PrivateAddressResults'}}, + 'type': 'object'}, + 'ProvisioningScript': {'properties': {'Params': {'$ref': '#/definitions/ProvisioningScriptParams'}, + 'Result': {'$ref': '#/definitions/ProvisioningScriptResult'}}, + 'type': 'object'}, + 'PublicAddress': {'properties': {'Params': {'$ref': '#/definitions/PublicAddress'}, + 'Result': {'$ref': '#/definitions/PublicAddressResults'}}, + 'type': 'object'}, + 'ResolveCharms': {'properties': {'Params': {'$ref': '#/definitions/ResolveCharms'}, + 'Result': {'$ref': '#/definitions/ResolveCharmResults'}}, + 'type': 'object'}, + 'Resolved': {'properties': {'Params': {'$ref': '#/definitions/Resolved'}}, + 'type': 'object'}, + 'RetryProvisioning': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SLALevel': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetModelAgentVersion': {'properties': {'Params': {'$ref': '#/definitions/SetModelAgentVersion'}}, + 'type': 'object'}, + 'SetModelConstraints': {'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetSLALevel': {'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, + 'type': 'object'}, + 'StatusHistory': {'properties': {'Params': {'$ref': '#/definitions/StatusHistoryRequests'}, + 'Result': {'$ref': '#/definitions/StatusHistoryResults'}}, + 'type': 'object'}, + 'WatchAll': {'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='APIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AbortCurrentUpgrade(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='AbortCurrentUpgrade', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AddCharm(self, channel=None, url=None): + ''' + channel : str + url : str + Returns -> None + ''' + if channel is not None and not isinstance(channel, (bytes, str)): + raise Exception("Expected channel to be a str, received: {}".format(type(channel))) + + 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='Client', + request='AddCharm', + version=1, + params=_params) + _params['channel'] = channel + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AddCharmWithAuthorization(self, channel=None, macaroon=None, url=None): + ''' + channel : str + macaroon : Macaroon + url : str + Returns -> None + ''' + if channel is not None and not isinstance(channel, (bytes, str)): + raise Exception("Expected channel to be a str, received: {}".format(type(channel))) + + if macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): + raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) + + 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='Client', + request='AddCharmWithAuthorization', + version=1, + params=_params) + _params['channel'] = channel + _params['macaroon'] = macaroon + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def AddMachines(self, params=None): + ''' + 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='Client', + request='AddMachines', + version=1, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def AddMachinesV2(self, params=None): + ''' + 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='Client', + request='AddMachinesV2', + version=1, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AgentVersionResult) + async def AgentVersion(self): + ''' + + Returns -> AgentVersionResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='AgentVersion', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BytesResult) + async def CACert(self): + ''' + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='CACert', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyMachines(self, force=None, machine_names=None): + ''' + force : bool + machine_names : typing.Sequence[str] + Returns -> None + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if machine_names is not None and not isinstance(machine_names, (bytes, str, list)): + raise Exception("Expected machine_names to be a Sequence, received: {}".format(type(machine_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='DestroyMachines', + version=1, + params=_params) + _params['force'] = force + _params['machine-names'] = machine_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindToolsResult) + async def FindTools(self, arch=None, major=None, minor=None, number=None, series=None): + ''' + arch : str + major : int + minor : int + number : Number + series : str + Returns -> FindToolsResult + ''' + 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 minor is not None and not isinstance(minor, int): + raise Exception("Expected minor to be a int, received: {}".format(type(minor))) + + if number is not None and not isinstance(number, (dict, Number)): + raise Exception("Expected number to be a Number, received: {}".format(type(number))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='FindTools', + version=1, + params=_params) + _params['arch'] = arch + _params['major'] = major + _params['minor'] = minor + _params['number'] = number + _params['series'] = series + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FullStatus) + async def FullStatus(self, patterns=None): + ''' + 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=1, + params=_params) + _params['patterns'] = patterns + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BundleChangesResults) + async def GetBundleChanges(self, yaml=None): + ''' + yaml : str + Returns -> BundleChangesResults + ''' + 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='Client', + request='GetBundleChanges', + version=1, + params=_params) + _params['yaml'] = yaml + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetConstraintsResults) + async def GetModelConstraints(self): + ''' + + Returns -> GetConstraintsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='GetModelConstraints', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def InjectMachines(self, params=None): + ''' + 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='Client', + request='InjectMachines', + version=1, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResults) + async def ModelGet(self): + ''' + + Returns -> ModelConfigResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ModelGet', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelInfo) + async def ModelInfo(self): + ''' + + Returns -> ModelInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ModelInfo', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ModelSet(self, config=None): + ''' + 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='Client', + request='ModelSet', + version=1, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ModelUnset(self, keys=None): + ''' + 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='Client', + request='ModelUnset', + version=1, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelUserInfoResults) + async def ModelUserInfo(self): + ''' + + Returns -> ModelUserInfoResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ModelUserInfo', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PrivateAddressResults) + async def PrivateAddress(self, target=None): + ''' + target : str + Returns -> PrivateAddressResults + ''' + if target is not None and not isinstance(target, (bytes, str)): + raise Exception("Expected target to be a str, received: {}".format(type(target))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='PrivateAddress', + version=1, + params=_params) + _params['target'] = target + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProvisioningScriptResult) + async def ProvisioningScript(self, data_dir=None, disable_package_commands=None, machine_id=None, nonce=None): + ''' + 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='Client', + request='ProvisioningScript', + version=1, + params=_params) + _params['data-dir'] = data_dir + _params['disable-package-commands'] = disable_package_commands + _params['machine-id'] = machine_id + _params['nonce'] = nonce + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PublicAddressResults) + async def PublicAddress(self, target=None): + ''' + target : str + Returns -> PublicAddressResults + ''' + if target is not None and not isinstance(target, (bytes, str)): + raise Exception("Expected target to be a str, received: {}".format(type(target))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='PublicAddress', + version=1, + params=_params) + _params['target'] = target + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolveCharmResults) + async def ResolveCharms(self, references=None): + ''' + references : typing.Sequence[str] + Returns -> ResolveCharmResults + ''' + if references is not None and not isinstance(references, (bytes, str, list)): + raise Exception("Expected references to be a Sequence, received: {}".format(type(references))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ResolveCharms', + version=1, + params=_params) + _params['references'] = references + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Resolved(self, retry=None, unit_name=None): + ''' + retry : bool + unit_name : str + Returns -> None + ''' + if retry is not None and not isinstance(retry, bool): + raise Exception("Expected retry to be a bool, received: {}".format(type(retry))) + + if unit_name is not None and not isinstance(unit_name, (bytes, str)): + raise Exception("Expected unit_name to be a str, received: {}".format(type(unit_name))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='Resolved', + version=1, + params=_params) + _params['retry'] = retry + _params['unit-name'] = unit_name + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RetryProvisioning(self, entities=None): + ''' + 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='Client', + request='RetryProvisioning', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='SLALevel', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetModelAgentVersion(self, version=None): + ''' + version : Number + Returns -> None + ''' + 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='Client', + request='SetModelAgentVersion', + version=1, + params=_params) + _params['version'] = version + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetModelConstraints(self, application=None, constraints=None): + ''' + 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='Client', + request='SetModelConstraints', + version=1, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetSLALevel(self, modelslainfo=None, creds=None): + ''' + modelslainfo : ModelSLAInfo + creds : typing.Sequence[int] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='SetSLALevel', + version=1, + params=_params) + _params['ModelSLAInfo'] = modelslainfo + _params['creds'] = creds + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusHistoryResults) + async def StatusHistory(self, requests=None): + ''' + 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=1, + params=_params) + _params['requests'] = requests + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AllWatcherId) + async def WatchAll(self): + ''' + + Returns -> AllWatcherId + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='WatchAll', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CloudFacade(Type): + name = 'Cloud' + version = 1 + schema = {'definitions': {'Cloud': {'additionalProperties': False, + 'properties': {'auth-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'regions': {'items': {'$ref': '#/definitions/CloudRegion'}, + 'type': 'array'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudCredentialResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudCredential'}}, + 'type': 'object'}, + 'CloudCredentialResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudCredentialResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CloudInstanceTypesConstraint': {'additionalProperties': False, + 'properties': {'cloud-tag': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'region': {'type': 'string'}}, + 'required': ['cloud-tag', + 'region'], + 'type': 'object'}, + 'CloudInstanceTypesConstraints': {'additionalProperties': False, + 'properties': {'constraints': {'items': {'$ref': '#/definitions/CloudInstanceTypesConstraint'}, + 'type': 'array'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'CloudRegion': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}}, + 'required': ['name'], + 'type': 'object'}, + 'CloudResult': {'additionalProperties': False, + 'properties': {'cloud': {'$ref': '#/definitions/Cloud'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'CloudResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CloudsResult': {'additionalProperties': False, + 'properties': {'clouds': {'patternProperties': {'.*': {'$ref': '#/definitions/Cloud'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'InstanceType': {'additionalProperties': False, + 'properties': {'arches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cost': {'type': 'integer'}, + 'cpu-cores': {'type': 'integer'}, + 'deprecated': {'type': 'boolean'}, + 'memory': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'root-disk': {'type': 'integer'}, + 'virt-type': {'type': 'string'}}, + 'required': ['arches', 'cpu-cores', 'memory'], + 'type': 'object'}, + 'InstanceTypesResult': {'additionalProperties': False, + 'properties': {'cost-currency': {'type': 'string'}, + 'cost-divisor': {'type': 'integer'}, + 'cost-unit': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'instance-types': {'items': {'$ref': '#/definitions/InstanceType'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceTypesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InstanceTypesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateCloudCredential': {'additionalProperties': False, + 'properties': {'credential': {'$ref': '#/definitions/CloudCredential'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'credential'], + 'type': 'object'}, + 'UpdateCloudCredentials': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/UpdateCloudCredential'}, + 'type': 'array'}}, + 'type': 'object'}, + 'UserCloud': {'additionalProperties': False, + 'properties': {'cloud-tag': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', 'cloud-tag'], + 'type': 'object'}, + 'UserClouds': {'additionalProperties': False, + 'properties': {'user-clouds': {'items': {'$ref': '#/definitions/UserCloud'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'spaces': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}}, + 'type': 'object'}}, + 'properties': {'Cloud': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudResults'}}, + 'type': 'object'}, + 'Clouds': {'properties': {'Result': {'$ref': '#/definitions/CloudsResult'}}, + 'type': 'object'}, + 'Credential': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudCredentialResults'}}, + 'type': 'object'}, + 'DefaultCloud': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'InstanceTypes': {'properties': {'Params': {'$ref': '#/definitions/CloudInstanceTypesConstraints'}, + 'Result': {'$ref': '#/definitions/InstanceTypesResults'}}, + 'type': 'object'}, + 'RevokeCredentials': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateCredentials': {'properties': {'Params': {'$ref': '#/definitions/UpdateCloudCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UserCredentials': {'properties': {'Params': {'$ref': '#/definitions/UserClouds'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(CloudResults) + async def Cloud(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudsResult) + async def Clouds(self): + ''' + + Returns -> CloudsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='Clouds', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudCredentialResults) + async def Credential(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def DefaultCloud(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='DefaultCloud', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InstanceTypesResults) + async def InstanceTypes(self, constraints=None): + ''' + 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=1, + params=_params) + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RevokeCredentials(self, entities=None): + ''' + 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='RevokeCredentials', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateCredentials(self, credentials=None): + ''' + credentials : typing.Sequence[~UpdateCloudCredential] + 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='UpdateCredentials', + version=1, + params=_params) + _params['credentials'] = credentials + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def UserCredentials(self, user_clouds=None): + ''' + 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=1, + params=_params) + _params['user-clouds'] = user_clouds + reply = await self.rpc(msg) + return reply + + + +class CredentialManagerFacade(Type): + name = 'CredentialManager' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'InvalidateCredentialArg': {'additionalProperties': False, + 'properties': {'reason': {'type': 'string'}}, + 'type': 'object'}}, + 'properties': {'InvalidateModelCredential': {'description': 'InvalidateModelCredential ' + 'marks the cloud ' + 'credential for ' + 'this model as ' + 'invalid.', + 'properties': {'Params': {'$ref': '#/definitions/InvalidateCredentialArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def 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 = await self.rpc(msg) + return reply + + + +class CrossControllerFacade(Type): + name = 'CrossController' + version = 1 + schema = {'definitions': {'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'ControllerInfo': {'description': 'ControllerInfo returns the ' + 'API info for the ' + 'controller.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'WatchControllerInfo': {'description': 'WatchControllerInfo ' + 'creates a watcher that ' + 'notifies when the API ' + 'info\n' + 'for the controller ' + 'changes.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ControllerAPIInfoResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class CrossModelRelationsFacade(Type): + name = 'CrossModelRelations' + version = 1 + schema = {'definitions': {'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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': {'application-token': {'type': 'string'}, + 'ingress-required': {'type': 'boolean'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'networks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}}, + 'required': ['relation-token', + 'application-token', + 'ingress-required'], + 'type': 'object'}, + 'IngressNetworksChanges': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/IngressNetworksChangeEvent'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'OfferArg': {'additionalProperties': False, + 'properties': {'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'offer-uuid': {'type': 'string'}}, + 'required': ['offer-uuid'], + 'type': 'object'}, + 'OfferArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/OfferArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'OfferStatusChange': {'additionalProperties': False, + 'properties': {'offer-name': {'type': 'string'}, + 'status': {'$ref': '#/definitions/EntityStatus'}}, + 'required': ['offer-name', 'status'], + 'type': 'object'}, + 'OfferStatusWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/OfferStatusChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'OfferStatusWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/OfferStatusWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RegisterRemoteRelationArg': {'additionalProperties': False, + 'properties': {'application-token': {'type': 'string'}, + 'local-endpoint-name': {'type': 'string'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'offer-uuid': {'type': 'string'}, + 'relation-token': {'type': 'string'}, + 'remote-endpoint': {'$ref': '#/definitions/RemoteEndpoint'}, + 'remote-space': {'$ref': '#/definitions/RemoteSpace'}, + 'source-model-tag': {'type': 'string'}}, + 'required': ['application-token', + 'source-model-tag', + 'relation-token', + 'remote-endpoint', + 'remote-space', + 'offer-uuid', + 'local-endpoint-name'], + 'type': 'object'}, + 'RegisterRemoteRelationArgs': {'additionalProperties': False, + 'properties': {'relations': {'items': {'$ref': '#/definitions/RegisterRemoteRelationArg'}, + 'type': 'array'}}, + 'required': ['relations'], + 'type': 'object'}, + 'RegisterRemoteRelationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoteRelationDetails'}}, + 'type': 'object'}, + 'RegisterRemoteRelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RegisterRemoteRelationResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'RelationLifeSuspendedStatusChange': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'life': {'type': 'string'}, + 'suspended': {'type': 'boolean'}, + 'suspended-reason': {'type': 'string'}}, + 'required': ['key', + 'life', + 'suspended', + 'suspended-reason'], + 'type': 'object'}, + 'RelationLifeSuspendedStatusWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RelationLifeSuspendedStatusChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationStatusWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationLifeSuspendedStatusWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'app-changed': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}, + 'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationUnitsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'RemoteEntityArg': {'additionalProperties': False, + 'properties': {'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}}, + 'required': ['relation-token'], + 'type': 'object'}, + 'RemoteEntityArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RemoteEntityArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'RemoteRelationChangeEvent': {'additionalProperties': False, + 'properties': {'application-token': {'type': 'string'}, + 'changed-units': {'items': {'$ref': '#/definitions/RemoteRelationUnitChange'}, + 'type': 'array'}, + 'departed-units': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'force-cleanup': {'type': 'boolean'}, + 'life': {'type': 'string'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}, + 'suspended': {'type': 'boolean'}, + 'suspended-reason': {'type': 'string'}}, + 'required': ['relation-token', + 'application-token', + 'life'], + 'type': 'object'}, + 'RemoteRelationDetails': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'relation-token': {'type': 'string'}}, + 'required': ['relation-token'], + 'type': 'object'}, + 'RemoteRelationUnit': {'additionalProperties': False, + 'properties': {'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['relation-token', 'unit'], + 'type': 'object'}, + 'RemoteRelationUnitChange': {'additionalProperties': False, + 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'unit-id': {'type': 'integer'}}, + 'required': ['unit-id'], + 'type': 'object'}, + 'RemoteRelationUnits': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RemoteRelationUnit'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RemoteRelationsChanges': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, + 'type': 'array'}}, + 'type': 'object'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + 'SettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'SettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}}, + 'properties': {'PublishIngressNetworkChanges': {'properties': {'Params': {'$ref': '#/definitions/IngressNetworksChanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'PublishRelationChanges': {'properties': {'Params': {'$ref': '#/definitions/RemoteRelationsChanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RegisterRemoteRelations': {'properties': {'Params': {'$ref': '#/definitions/RegisterRemoteRelationArgs'}, + 'Result': {'$ref': '#/definitions/RegisterRemoteRelationResults'}}, + 'type': 'object'}, + 'RelationUnitSettings': {'properties': {'Params': {'$ref': '#/definitions/RemoteRelationUnits'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'WatchEgressAddressesForRelations': {'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchOfferStatus': {'properties': {'Params': {'$ref': '#/definitions/OfferArgs'}, + 'Result': {'$ref': '#/definitions/OfferStatusWatchResults'}}, + 'type': 'object'}, + 'WatchRelationUnits': {'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, + 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, + 'type': 'object'}, + 'WatchRelationsSuspendedStatus': {'properties': {'Params': {'$ref': '#/definitions/RemoteEntityArgs'}, + 'Result': {'$ref': '#/definitions/RelationStatusWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def PublishIngressNetworkChanges(self, changes=None): + ''' + 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=1, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def PublishRelationChanges(self, changes=None): + ''' + 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=1, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RegisterRemoteRelationResults) + async def RegisterRemoteRelations(self, relations=None): + ''' + 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=1, + params=_params) + _params['relations'] = relations + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def RelationUnitSettings(self, relation_units=None): + ''' + relation_units : typing.Sequence[~RemoteRelationUnit] + 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='CrossModelRelations', + request='RelationUnitSettings', + version=1, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchEgressAddressesForRelations(self, args=None): + ''' + 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=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OfferStatusWatchResults) + async def WatchOfferStatus(self, args=None): + ''' + 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=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitsWatchResults) + async def WatchRelationUnits(self, args=None): + ''' + args : typing.Sequence[~RemoteEntityArg] + Returns -> RelationUnitsWatchResults + ''' + 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='WatchRelationUnits', + version=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationStatusWatchResults) + async def WatchRelationsSuspendedStatus(self, args=None): + ''' + 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=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + +class DeployerFacade(Type): + name = 'Deployer' + version = 1 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'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'}, + 'DeployerConnectionValues': {'additionalProperties': False, + 'properties': {'api-addresses': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['api-addresses'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'HostPort': {'additionalProperties': False, + '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'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'ConnectionInfo': {'description': 'ConnectionInfo returns all ' + 'the address information ' + 'that the\n' + 'deployer task needs in one ' + 'call.', + 'properties': {'Result': {'$ref': '#/definitions/DeployerConnectionValues'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' + 'that this facade is deploying ' + 'into.\n' + 'It is implemented here directly ' + 'as a result of removing it from\n' + 'embedded APIAddresser *without* ' + 'bumping the facade version.\n' + 'It should be blanked when this ' + 'facade version is next ' + 'incremented.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'Remove': {'description': 'Remove removes every given entity ' + 'from state, calling EnsureDead\n' + 'first, then Remove. It will fail if ' + 'the entity is not present.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetPasswords': {'description': 'SetPasswords sets the given ' + 'password for each supplied ' + 'entity, if possible.', + 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the status of the ' + 'specified entities.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchUnits': {'description': 'WatchUnits starts a ' + 'StringsWatcher to watch all ' + 'units belonging to\n' + 'to any entity (machine or ' + 'service) passed in args.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def 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='Deployer', + request='APIAddresses', + version=1, + params=_params) + + reply = await self.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) + 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 + _params = dict() + msg = dict(type='Deployer', + request='ConnectionInfo', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.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='Deployer', + request='SetPasswords', + version=1, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class ExternalControllerUpdaterFacade(Type): + name = 'ExternalControllerUpdater' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'ExternalControllerInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ExternalControllerInfo'}}, + 'required': ['result', + 'error'], + 'type': 'object'}, + 'ExternalControllerInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ExternalControllerInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetExternalControllerInfoParams': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/ExternalControllerInfo'}}, + 'required': ['info'], + 'type': 'object'}, + 'SetExternalControllersInfoParams': {'additionalProperties': False, + 'properties': {'controllers': {'items': {'$ref': '#/definitions/SetExternalControllerInfoParams'}, + 'type': 'array'}}, + 'required': ['controllers'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'ExternalControllerInfo': {'description': 'ExternalControllerInfo ' + 'returns the info ' + 'for the specified ' + 'external ' + 'controllers.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ExternalControllerInfoResults'}}, + 'type': 'object'}, + 'SetExternalControllerInfo': {'description': 'SetExternalControllerInfo ' + 'saves the info ' + 'for the ' + 'specified ' + 'external ' + 'controllers.', + 'properties': {'Params': {'$ref': '#/definitions/SetExternalControllersInfoParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchExternalControllers': {'description': 'WatchExternalControllers ' + 'watches for the ' + 'addition and ' + 'removal of ' + 'external\n' + 'controller ' + 'records to the ' + 'local ' + "controller's " + 'database.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ExternalControllerInfoResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class FanConfigurerFacade(Type): + name = 'FanConfigurer' + 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'}, + 'FanConfigEntry': {'additionalProperties': False, + 'properties': {'overlay': {'type': 'string'}, + 'underlay': {'type': 'string'}}, + 'required': ['underlay', 'overlay'], + 'type': 'object'}, + 'FanConfigResult': {'additionalProperties': False, + 'properties': {'fans': {'items': {'$ref': '#/definitions/FanConfigEntry'}, + 'type': 'array'}}, + 'required': ['fans'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}}, + 'properties': {'FanConfig': {'description': 'FanConfig returns current FAN ' + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/FanConfigResult'}}, + 'type': 'object'}, + 'WatchForFanConfigChanges': {'description': 'WatchForFanConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'FAN ' + 'configuration.\n' + 'so we use the ' + 'regular error ' + 'return.\n' + 'TODO(wpk) ' + '2017-09-21 We ' + 'should use Model ' + 'directly, and ' + 'watch only for ' + 'FanConfig ' + 'changes.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(FanConfigResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + +class FirewallRulesFacade(Type): + name = 'FirewallRules' + 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'}, + 'FirewallRule': {'additionalProperties': False, + 'properties': {'known-service': {'type': 'string'}, + 'whitelist-cidrs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['known-service'], + 'type': 'object'}, + 'FirewallRuleArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/FirewallRule'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'ListFirewallRulesResults': {'additionalProperties': False, + 'properties': {'Rules': {'items': {'$ref': '#/definitions/FirewallRule'}, + 'type': 'array'}}, + 'required': ['Rules'], + 'type': 'object'}}, + 'properties': {'ListFirewallRules': {'description': 'ListFirewallRules ' + 'returns all the firewall ' + 'rules.', + 'properties': {'Result': {'$ref': '#/definitions/ListFirewallRulesResults'}}, + 'type': 'object'}, + 'SetFirewallRules': {'description': 'SetFirewallRules creates ' + 'or updates the specified ' + 'firewall rules.', + 'properties': {'Params': {'$ref': '#/definitions/FirewallRuleArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ListFirewallRulesResults) + async def 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 = await self.rpc(msg) + return reply + + + + @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, + 'properties': {'entity-keys': {'items': {'$ref': '#/definitions/SSHHostKeys'}, + 'type': 'array'}}, + 'required': ['entity-keys'], + 'type': 'object'}, + 'SSHHostKeys': {'additionalProperties': False, + 'properties': {'public-keys': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'public-keys'], + 'type': 'object'}}, + 'properties': {'ReportKeys': {'description': 'ReportKeys sets the SSH host ' + 'keys for one or more entities.', + 'properties': {'Params': {'$ref': '#/definitions/SSHHostKeySet'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + +class ImageMetadataManagerFacade(Type): + name = 'ImageMetadataManager' + version = 1 + schema = {'definitions': {'CloudImageMetadata': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'image-id': {'type': 'string'}, + 'priority': {'type': 'integer'}, + 'region': {'type': 'string'}, + 'root-storage-size': {'type': 'integer'}, + 'root-storage-type': {'type': 'string'}, + 'series': {'type': 'string'}, + 'source': {'type': 'string'}, + 'stream': {'type': 'string'}, + 'version': {'type': 'string'}, + 'virt-type': {'type': 'string'}}, + 'required': ['image-id', + 'region', + 'version', + 'series', + 'arch', + 'source', + 'priority'], + 'type': 'object'}, + 'CloudImageMetadataList': {'additionalProperties': False, + 'properties': {'metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'ImageMetadataFilter': {'additionalProperties': False, + 'properties': {'arches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'region': {'type': 'string'}, + 'root-storage-type': {'type': 'string'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'stream': {'type': 'string'}, + 'virt-type': {'type': 'string'}}, + 'type': 'object'}, + 'ListCloudImageMetadataResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'MetadataImageIds': {'additionalProperties': False, + 'properties': {'image-ids': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['image-ids'], + 'type': 'object'}, + 'MetadataSaveParams': {'additionalProperties': False, + 'properties': {'metadata': {'items': {'$ref': '#/definitions/CloudImageMetadataList'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'Delete': {'description': 'Delete deletes cloud image metadata ' + 'for given image ids.\n' + 'It supports bulk calls.', + 'properties': {'Params': {'$ref': '#/definitions/MetadataImageIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'List': {'description': 'List returns all found cloud image ' + 'metadata that satisfy\n' + 'given filter.\n' + 'Returned list contains metadata ' + 'ordered by priority.', + 'properties': {'Params': {'$ref': '#/definitions/ImageMetadataFilter'}, + 'Result': {'$ref': '#/definitions/ListCloudImageMetadataResult'}}, + 'type': 'object'}, + 'Save': {'description': 'Save stores given cloud image ' + 'metadata.\n' + 'It supports bulk calls.', + 'properties': {'Params': {'$ref': '#/definitions/MetadataSaveParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListCloudImageMetadataResult) + async def List(self, arches=None, region=None, root_storage_type=None, series=None, stream=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 + series : typing.Sequence[str] + stream : 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 series is not None and not isinstance(series, (bytes, str, list)): + raise Exception("Expected series to be a Sequence, received: {}".format(type(series))) + + if stream is not None and not isinstance(stream, (bytes, str)): + raise Exception("Expected stream to be a str, received: {}".format(type(stream))) + + 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['series'] = series + _params['stream'] = stream + _params['virt-type'] = virt_type + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + +class KeyManagerFacade(Type): + name = 'KeyManager' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'ListSSHKeys': {'additionalProperties': False, + 'properties': {'entities': {'$ref': '#/definitions/Entities'}, + 'mode': {'type': 'boolean'}}, + 'required': ['entities', 'mode'], + 'type': 'object'}, + 'ModifyUserSSHKeys': {'additionalProperties': False, + 'properties': {'ssh-keys': {'items': {'type': 'string'}, + 'type': 'array'}, + 'user': {'type': 'string'}}, + 'required': ['user', 'ssh-keys'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AddKeys': {'description': 'AddKeys adds new authorised ssh ' + 'keys for the specified user.', + 'properties': {'Params': {'$ref': '#/definitions/ModifyUserSSHKeys'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DeleteKeys': {'description': 'DeleteKeys deletes the ' + 'authorised ssh keys for the ' + 'specified user.', + 'properties': {'Params': {'$ref': '#/definitions/ModifyUserSSHKeys'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ImportKeys': {'description': 'ImportKeys imports new ' + 'authorised ssh keys from the ' + 'specified key ids for the ' + 'specified user.', + 'properties': {'Params': {'$ref': '#/definitions/ModifyUserSSHKeys'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ListKeys': {'description': 'ListKeys returns the authorised ' + 'ssh keys for the specified users.', + 'properties': {'Params': {'$ref': '#/definitions/ListSSHKeys'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @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, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AuthorisedKeys': {'description': 'AuthorisedKeys reports the ' + 'authorised ssh keys for the ' + 'specified machines.\n' + 'The current implementation ' + 'relies on global authorised ' + 'keys being stored in the ' + 'model config.\n' + 'This will change as new ' + 'user management and ' + 'authorisation functionality ' + 'is added.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'WatchAuthorisedKeys': {'description': 'WatchAuthorisedKeys ' + 'starts a watcher to ' + 'track changes to the ' + 'authorised ssh keys\n' + 'for the specified ' + 'machines.\n' + 'The current ' + 'implementation relies ' + 'on global authorised ' + 'keys being stored in ' + 'the model config.\n' + 'This will change as ' + 'new user management ' + 'and authorisation ' + 'functionality is ' + 'added.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class LifeFlagFacade(Type): + name = 'LifeFlag' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @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='LifeFlag', + request='Life', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.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='LifeFlag', + request='Watch', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class LogForwardingFacade(Type): + name = 'LogForwarding' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'LogForwardingGetLastSentParams': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/LogForwardingID'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'LogForwardingGetLastSentResult': {'additionalProperties': False, + 'properties': {'err': {'$ref': '#/definitions/Error'}, + 'record-id': {'type': 'integer'}, + 'record-timestamp': {'type': 'integer'}}, + 'required': ['record-id', + 'record-timestamp', + 'err'], + 'type': 'object'}, + 'LogForwardingGetLastSentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LogForwardingGetLastSentResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'LogForwardingID': {'additionalProperties': False, + 'properties': {'model': {'type': 'string'}, + 'sink': {'type': 'string'}}, + 'required': ['model', 'sink'], + 'type': 'object'}, + 'LogForwardingSetLastSentParam': {'additionalProperties': False, + 'properties': {'LogForwardingID': {'$ref': '#/definitions/LogForwardingID'}, + 'model': {'type': 'string'}, + 'record-id': {'type': 'integer'}, + 'record-timestamp': {'type': 'integer'}, + 'sink': {'type': 'string'}}, + 'required': ['model', + 'sink', + 'LogForwardingID', + 'record-id', + 'record-timestamp'], + 'type': 'object'}, + 'LogForwardingSetLastSentParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/LogForwardingSetLastSentParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}}, + 'properties': {'GetLastSent': {'description': 'GetLastSent is a bulk call ' + 'that gets the log forwarding ' + '"last sent"\n' + 'record ID for each requested ' + 'target.', + 'properties': {'Params': {'$ref': '#/definitions/LogForwardingGetLastSentParams'}, + 'Result': {'$ref': '#/definitions/LogForwardingGetLastSentResults'}}, + 'type': 'object'}, + 'SetLastSent': {'description': 'SetLastSent is a bulk call ' + 'that sets the log forwarding ' + '"last sent"\n' + 'record ID for each requested ' + 'target.', + 'properties': {'Params': {'$ref': '#/definitions/LogForwardingSetLastSentParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(LogForwardingGetLastSentResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + +class LoggerFacade(Type): + name = 'Logger' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'LoggingConfig': {'description': 'LoggingConfig reports the ' + 'logging configuration for ' + 'the agents specified.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'WatchLoggingConfig': {'description': 'WatchLoggingConfig ' + 'starts a watcher to ' + 'track changes to the ' + 'logging config\n' + 'for the agents ' + 'specified.. ' + 'Unfortunately the ' + 'current infrastructure ' + 'makes\n' + 'watching parts of the ' + 'config non-trivial, so ' + 'currently any change to ' + 'the\n' + 'config will cause the ' + 'watcher to notify the ' + 'client.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class MachineActionsFacade(Type): + name = 'MachineActions' + version = 1 + schema = {'definitions': {'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionExecutionResult': {'additionalProperties': False, + 'properties': {'action-tag': {'type': 'string'}, + 'message': {'type': 'string'}, + 'results': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'status': {'type': 'string'}}, + 'required': ['action-tag', 'status'], + 'type': 'object'}, + 'ActionExecutionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionExecutionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionMessage': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}}, + 'required': ['timestamp', 'message'], + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'log': {'items': {'$ref': '#/definitions/ActionMessage'}, + 'type': 'array'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionsByReceiver': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'receiver': {'type': 'string'}}, + 'type': 'object'}, + 'ActionsByReceivers': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByReceiver'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'Actions': {'description': 'Actions returns the Actions by ' + 'Tags passed and ensures that the ' + 'machine asking\n' + 'for them is the machine that has ' + 'the actions', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'BeginActions': {'description': 'BeginActions marks the ' + 'actions represented by the ' + 'passed in Tags as running.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FinishActions': {'description': 'FinishActions saves the ' + 'result of a completed Action', + 'properties': {'Params': {'$ref': '#/definitions/ActionExecutionResults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RunningActions': {'description': 'RunningActions lists the ' + 'actions running for the ' + 'entities passed in.\n' + 'If we end up needing more ' + 'than ListRunning at some ' + 'point we could ' + 'follow/abstract\n' + "what's done in the client " + 'actions package.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'WatchActionNotifications': {'description': 'WatchActionNotifications ' + 'returns a ' + 'StringsWatcher ' + 'for observing\n' + 'incoming action ' + 'calls to a ' + 'machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ActionResults) + async def 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 + + 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='MachineActions', + request='Actions', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.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) + 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) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class MachineUndertakerFacade(Type): + name = 'MachineUndertaker' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesResult': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/EntitiesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ProviderInterfaceInfo': {'additionalProperties': False, + 'properties': {'interface-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}, + 'provider-id': {'type': 'string'}}, + 'required': ['interface-name', + 'mac-address', + 'provider-id'], + 'type': 'object'}, + 'ProviderInterfaceInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'interfaces': {'items': {'$ref': '#/definitions/ProviderInterfaceInfo'}, + 'type': 'array'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'interfaces'], + 'type': 'object'}, + 'ProviderInterfaceInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProviderInterfaceInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AllMachineRemovals': {'description': 'AllMachineRemovals ' + 'returns tags for all of ' + 'the machines that have\n' + 'been marked for removal ' + 'in the requested model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/EntitiesResults'}}, + 'type': 'object'}, + 'CompleteMachineRemovals': {'description': 'CompleteMachineRemovals ' + 'removes the ' + 'specified machines ' + 'from the\n' + 'model database. It ' + 'should only be ' + 'called once any ' + 'provider-level\n' + 'cleanup has been ' + 'done for those ' + 'machines.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}}, + 'type': 'object'}, + 'GetMachineProviderInterfaceInfo': {'description': 'GetMachineProviderInterfaceInfo ' + 'returns ' + 'the ' + 'provider ' + 'details ' + 'for\n' + 'all ' + 'network ' + 'interfaces ' + 'attached ' + 'to the ' + 'machines ' + 'requested.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ProviderInterfaceInfoResults'}}, + 'type': 'object'}, + 'WatchMachineRemovals': {'description': 'WatchMachineRemovals ' + 'returns a watcher ' + 'that will signal each ' + 'time a\n' + 'machine is marked for ' + 'removal.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(EntitiesResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProviderInterfaceInfoResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class MachinerFacade(Type): + name = 'Machiner' + version = 1 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'JobsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['jobs'], + 'type': 'object'}, + 'JobsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/JobsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineAddresses': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'addresses'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'is-default-gateway': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + 'parent-interface-name': {'type': 'string'}, + 'provider-address-id': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'provider-subnet-id': {'type': 'string'}, + 'provider-vlan-id': {'type': 'string'}, + 'routes': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'vlan-tag': {'type': 'integer'}}, + 'required': ['device-index', + 'mac-address', + 'cidr', + 'mtu', + 'provider-id', + 'provider-network-id', + 'provider-subnet-id', + 'provider-space-id', + 'provider-address-id', + 'provider-vlan-id', + 'vlan-tag', + 'interface-name', + 'parent-interface-name', + 'interface-type', + 'disabled'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetMachineNetworkConfig': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'config'], + 'type': 'object'}, + 'SetMachinesAddresses': {'additionalProperties': False, + 'properties': {'machine-addresses': {'items': {'$ref': '#/definitions/MachineAddresses'}, + 'type': 'array'}}, + 'required': ['machine-addresses'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Jobs': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/JobsResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetMachineAddresses': {'properties': {'Params': {'$ref': '#/definitions/SetMachinesAddresses'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetObservedNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetProviderNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='APIAddresses', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='APIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + 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='EnsureDead', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(JobsResults) + async def Jobs(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='ModelUUID', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMachineAddresses(self, machine_addresses=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=1, + params=_params) + _params['machine-addresses'] = machine_addresses + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetObservedNetworkConfig(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='Machiner', + request='SetObservedNetworkConfig', + version=1, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetProviderNetworkConfig(self, entities=None): + ''' + 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='SetProviderNetworkConfig', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateStatus(self, entities=None): + ''' + 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='UpdateStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='WatchAPIHostPorts', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class MeterStatusFacade(Type): + name = 'MeterStatus' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'MeterStatusResult': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}}, + 'required': ['code', 'info'], + 'type': 'object'}, + 'MeterStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'GetMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, + 'type': 'object'}, + 'WatchMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMeterStatus(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class MetricsManagerFacade(Type): + name = 'MetricsManager' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}}, + 'properties': {'AddJujuMachineMetrics': {'description': 'AddJujuMachineMetrics ' + 'adds a metric that ' + 'counts the number ' + 'of\n' + 'non-container ' + 'machines in the ' + 'current model.', + 'type': 'object'}, + 'CleanupOldMetrics': {'description': 'CleanupOldMetrics ' + 'removes old metrics from ' + 'the collection.\n' + 'The single arg params is ' + 'expected to contain and ' + 'model uuid.\n' + 'Even though the call ' + 'will delete all metrics ' + 'across models\n' + 'it serves to validate ' + 'that the connection has ' + 'access to at least one ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SendMetrics': {'description': 'SendMetrics will send any ' + 'unsent metrics onto the metric ' + 'collection service.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @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'}, + '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, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PhaseResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'phase': {'type': 'string'}}, + 'type': 'object'}, + 'PhaseResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/PhaseResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'Phase': {'description': 'Phase returns the current migration ' + 'phase or an error for every\n' + 'supplied entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/PhaseResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch returns an id for use with the ' + 'NotifyWatcher facade, or an\n' + 'error, for every supplied entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(PhaseResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class MigrationMasterFacade(Type): + name = 'MigrationMaster' + 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'}, + 'MasterMigrationStatus': {'additionalProperties': False, + 'properties': {'migration-id': {'type': 'string'}, + 'phase': {'type': 'string'}, + 'phase-changed-time': {'format': 'date-time', + 'type': 'string'}, + 'spec': {'$ref': '#/definitions/MigrationSpec'}}, + 'required': ['spec', + 'migration-id', + 'phase', + 'phase-changed-time'], + 'type': 'object'}, + 'MigrationModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'controller-agent-version': {'$ref': '#/definitions/Number'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'name', + 'owner-tag', + 'agent-version', + 'controller-agent-version'], + 'type': 'object'}, + 'MigrationSpec': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'target-info': {'$ref': '#/definitions/MigrationTargetInfo'}}, + 'required': ['model-tag', 'target-info'], + 'type': 'object'}, + 'MigrationTargetInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'auth-tag': {'type': 'string'}, + 'ca-cert': {'type': 'string'}, + 'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}, + 'macaroons': {'type': 'string'}, + 'password': {'type': 'string'}}, + 'required': ['controller-tag', + 'addrs', + 'ca-cert', + 'auth-tag'], + 'type': 'object'}, + 'MinionReports': {'additionalProperties': False, + 'properties': {'failed': {'items': {'type': 'string'}, + 'type': 'array'}, + 'migration-id': {'type': 'string'}, + 'phase': {'type': 'string'}, + 'success-count': {'type': 'integer'}, + 'unknown-count': {'type': 'integer'}, + 'unknown-sample': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['migration-id', + 'phase', + 'success-count', + 'unknown-count', + 'unknown-sample', + 'failed'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'SerializedModel': {'additionalProperties': False, + 'properties': {'bytes': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'charms': {'items': {'type': 'string'}, + 'type': 'array'}, + 'resources': {'items': {'$ref': '#/definitions/SerializedModelResource'}, + 'type': 'array'}, + 'tools': {'items': {'$ref': '#/definitions/SerializedModelTools'}, + 'type': 'array'}}, + 'required': ['bytes', + 'charms', + 'tools', + 'resources'], + 'type': 'object'}, + 'SerializedModelResource': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'application-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, + 'charmstore-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, + 'name': {'type': 'string'}, + 'unit-revisions': {'patternProperties': {'.*': {'$ref': '#/definitions/SerializedModelResourceRevision'}}, + 'type': 'object'}}, + 'required': ['application', + 'name', + 'application-revision', + 'charmstore-revision', + 'unit-revisions'], + 'type': 'object'}, + 'SerializedModelResourceRevision': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'fingerprint': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}, + 'type': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['revision', + 'type', + 'path', + 'description', + 'origin', + 'fingerprint', + 'size', + 'timestamp'], + 'type': 'object'}, + 'SerializedModelTools': {'additionalProperties': False, + 'properties': {'uri': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['version', 'uri'], + 'type': 'object'}, + 'SetMigrationPhaseArgs': {'additionalProperties': False, + 'properties': {'phase': {'type': 'string'}}, + 'required': ['phase'], + 'type': 'object'}, + 'SetMigrationStatusMessageArgs': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}}, + 'required': ['message'], + 'type': 'object'}}, + 'properties': {'Export': {'properties': {'Result': {'$ref': '#/definitions/SerializedModel'}}, + 'type': 'object'}, + 'MigrationStatus': {'properties': {'Result': {'$ref': '#/definitions/MasterMigrationStatus'}}, + 'type': 'object'}, + 'MinionReports': {'properties': {'Result': {'$ref': '#/definitions/MinionReports'}}, + 'type': 'object'}, + 'ModelInfo': {'properties': {'Result': {'$ref': '#/definitions/MigrationModelInfo'}}, + 'type': 'object'}, + 'Prechecks': {'type': 'object'}, + 'Reap': {'type': 'object'}, + 'SetPhase': {'properties': {'Params': {'$ref': '#/definitions/SetMigrationPhaseArgs'}}, + 'type': 'object'}, + 'SetStatusMessage': {'properties': {'Params': {'$ref': '#/definitions/SetMigrationStatusMessageArgs'}}, + 'type': 'object'}, + 'Watch': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchMinionReports': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(SerializedModel) + async def Export(self): + ''' + + Returns -> SerializedModel + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Export', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MasterMigrationStatus) + async def MigrationStatus(self): + ''' + + Returns -> MasterMigrationStatus + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='MigrationStatus', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MinionReports) + async def MinionReports(self): + ''' + + Returns -> MinionReports + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='MinionReports', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MigrationModelInfo) + async def ModelInfo(self): + ''' + + Returns -> MigrationModelInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='ModelInfo', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Prechecks(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Prechecks', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Reap(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Reap', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetPhase(self, phase=None): + ''' + 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=1, + params=_params) + _params['phase'] = phase + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetStatusMessage(self, message=None): + ''' + 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=1, + params=_params) + _params['message'] = message + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def Watch(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Watch', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchMinionReports(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='WatchMinionReports', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class MigrationMinionFacade(Type): + name = 'MigrationMinion' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'MinionReport': {'additionalProperties': False, + 'properties': {'migration-id': {'type': 'string'}, + 'phase': {'type': 'string'}, + 'success': {'type': 'boolean'}}, + 'required': ['migration-id', + 'phase', + 'success'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}}, + 'properties': {'Report': {'description': 'Report allows a migration minion to ' + 'submit whether it succeeded or\n' + 'failed for a specific migration ' + 'phase.', + 'properties': {'Params': {'$ref': '#/definitions/MinionReport'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts watching for status ' + 'updates for a migration attempt\n' + 'for the model. It will report when a ' + 'migration starts and when its\n' + 'status changes (including when it ' + 'finishes). An initial event will\n' + 'be fired if there has ever been a ' + 'migration attempt for the model.\n' + '\n' + 'The MigrationStatusWatcher facade ' + 'must be used to receive events\n' + 'from the watcher.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + +class MigrationStatusWatcherFacade(Type): + name = 'MigrationStatusWatcher' + version = 1 + schema = {'definitions': {'MigrationStatus': {'additionalProperties': False, + 'properties': {'attempt': {'type': 'integer'}, + 'migration-id': {'type': 'string'}, + 'phase': {'type': 'string'}, + 'source-api-addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'source-ca-cert': {'type': 'string'}, + 'target-api-addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'target-ca-cert': {'type': 'string'}}, + 'required': ['migration-id', + 'attempt', + 'phase', + 'source-api-addrs', + 'source-ca-cert', + 'target-api-addrs', + 'target-ca-cert'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when the status for a ' + 'model migration for the\n' + 'associated model changes. The current ' + 'details for the active\n' + 'migration are returned.', + 'properties': {'Result': {'$ref': '#/definitions/MigrationStatus'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(MigrationStatus) + async def 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 = await self.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='MigrationStatusWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class MigrationTargetFacade(Type): + name = 'MigrationTarget' + version = 1 + schema = {'definitions': {'AdoptResourcesArgs': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'source-controller-version': {'$ref': '#/definitions/Number'}}, + 'required': ['model-tag', + 'source-controller-version'], + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + '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.', + 'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}}, + '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=1, + params=_params) + _params['model-tag'] = model_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Activate(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. + + 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='Activate', + version=1, + params=_params) + _params['model-tag'] = model_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AdoptResources(self, model_tag=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=1, + params=_params) + _params['model-tag'] = model_tag + _params['source-controller-version'] = source_controller_version + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BytesResult) + async def CACert(self): + ''' + 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) + 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) + 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=1, + 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=1, + 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, 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 = await self.rpc(msg) + return reply + + + +class ModelConfigFacade(Type): + name = 'ModelConfig' + version = 1 + schema = {'definitions': {'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelSLA': {'additionalProperties': False, + 'properties': {'ModelSLAInfo': {'$ref': '#/definitions/ModelSLAInfo'}, + 'creds': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['ModelSLAInfo', 'creds'], + 'type': 'object'}, + 'ModelSLAInfo': {'additionalProperties': False, + 'properties': {'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', 'owner'], + 'type': 'object'}, + 'ModelSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelUnset': {'additionalProperties': False, + 'properties': {'keys': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['keys'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'ModelGet': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelSet': {'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, + 'type': 'object'}, + 'ModelUnset': {'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, + 'type': 'object'}, + 'SLALevel': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetSLALevel': {'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ModelConfigResults) + async def ModelGet(self): + ''' + + Returns -> ModelConfigResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='ModelGet', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ModelSet(self, config=None): + ''' + 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=1, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ModelUnset(self, keys=None): + ''' + 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=1, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='SLALevel', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetSLALevel(self, modelslainfo=None, creds=None): + ''' + modelslainfo : ModelSLAInfo + creds : typing.Sequence[int] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelConfig', + request='SetSLALevel', + version=1, + params=_params) + _params['ModelSLAInfo'] = modelslainfo + _params['creds'] = creds + reply = await self.rpc(msg) + return reply + + + +class ModelGenerationFacade(Type): + name = 'ModelGeneration' + version = 1 + schema = {'definitions': {'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BranchArg': {'additionalProperties': False, + 'properties': {'branch': {'type': 'string'}}, + 'required': ['branch'], + 'type': 'object'}, + 'BranchInfoArgs': {'additionalProperties': False, + 'properties': {'branches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'detailed': {'type': 'boolean'}}, + 'required': ['branches', 'detailed'], + 'type': 'object'}, + 'BranchTrackArg': {'additionalProperties': False, + 'properties': {'branch': {'type': 'string'}, + 'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['branch', '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'}, + 'Generation': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/GenerationApplication'}, + 'type': 'array'}, + 'branch': {'type': 'string'}, + 'created': {'type': 'integer'}, + 'created-by': {'type': 'string'}}, + 'required': ['branch', + 'created', + 'created-by', + 'applications'], + 'type': 'object'}, + 'GenerationApplication': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'pending': {'items': {'type': 'string'}, + 'type': 'array'}, + 'progress': {'type': 'string'}, + 'tracking': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', + 'progress', + 'config'], + 'type': 'object'}, + 'GenerationResults': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'generations': {'items': {'$ref': '#/definitions/Generation'}, + 'type': 'array'}}, + 'required': ['generations'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'AddBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'BranchInfo': {'properties': {'Params': {'$ref': '#/definitions/BranchInfoArgs'}, + 'Result': {'$ref': '#/definitions/GenerationResults'}}, + 'type': 'object'}, + 'CommitBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/IntResult'}}, + 'type': 'object'}, + 'HasActiveBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/BoolResult'}}, + 'type': 'object'}, + 'TrackBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchTrackArg'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def AddBranch(self, branch=None): + ''' + 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=1, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GenerationResults) + async def BranchInfo(self, branches=None, detailed=None): + ''' + branches : typing.Sequence[str] + detailed : bool + Returns -> GenerationResults + ''' + 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=1, + params=_params) + _params['branches'] = branches + _params['detailed'] = detailed + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResult) + async def CommitBranch(self, branch=None): + ''' + 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=1, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResult) + async def HasActiveBranch(self, branch=None): + ''' + 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=1, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def TrackBranch(self, branch=None, entities=None): + ''' + branch : str + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='TrackBranch', + version=1, + params=_params) + _params['branch'] = branch + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class ModelSummaryWatcherFacade(Type): + name = 'ModelSummaryWatcher' + version = 1 + schema = {'definitions': {'ModelAbstract': {'additionalProperties': False, + 'properties': {'admins': {'items': {'type': 'string'}, + 'type': 'array'}, + 'annotations': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'cloud': {'type': 'string'}, + 'controller': {'type': 'string'}, + 'credential': {'type': 'string'}, + 'messages': {'items': {'$ref': '#/definitions/ModelSummaryMessage'}, + 'type': 'array'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'removed': {'type': 'boolean'}, + 'size': {'$ref': '#/definitions/ModelSummarySize'}, + 'status': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid'], + 'type': 'object'}, + 'ModelSummaryMessage': {'additionalProperties': False, + 'properties': {'agent': {'type': 'string'}, + 'message': {'type': 'string'}}, + 'required': ['agent', 'message'], + 'type': 'object'}, + 'ModelSummarySize': {'additionalProperties': False, + 'properties': {'applications': {'type': 'integer'}, + 'containers': {'type': 'integer'}, + 'machines': {'type': 'integer'}, + 'relations': {'type': 'integer'}, + 'units': {'type': 'integer'}}, + 'type': 'object'}, + 'SummaryWatcherNextResults': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/ModelAbstract'}, + 'type': 'array'}}, + 'required': ['models'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next will return the current state of ' + 'everything on the first call\n' + 'and subsequent calls will return just ' + 'those model summaries that have\n' + 'changed.', + 'properties': {'Result': {'$ref': '#/definitions/SummaryWatcherNextResults'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(SummaryWatcherNextResults) + async def 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 = await self.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='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. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class ModelUpgraderFacade(Type): + name = 'ModelUpgrader' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetModelEnvironVersion': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'version': {'type': 'integer'}}, + 'required': ['model-tag', + 'version'], + 'type': 'object'}, + 'SetModelEnvironVersions': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/SetModelEnvironVersion'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}}, + 'properties': {'ModelEnvironVersion': {'description': 'ModelEnvironVersion ' + 'returns the current ' + 'version of the environ ' + 'corresponding\n' + 'to each specified ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'ModelTargetEnvironVersion': {'description': 'ModelTargetEnvironVersion ' + 'returns the ' + 'target version ' + 'of the environ\n' + 'corresponding to ' + 'each specified ' + 'model. The ' + 'target version ' + 'is the\n' + 'environ ' + "provider's " + 'version.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'SetModelEnvironVersion': {'description': 'SetModelEnvironVersion ' + 'sets the current ' + 'version of the ' + 'environ ' + 'corresponding\n' + 'to each specified ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/SetModelEnvironVersions'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModelStatus': {'description': 'SetModelStatus sets the ' + 'status of each given model.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchModelEnvironVersion': {'description': 'WatchModelEnvironVersion ' + 'watches for ' + 'changes to the ' + 'environ version ' + 'of the\n' + 'specified ' + 'models.\n' + '\n' + 'NOTE(axw) this is ' + 'currently ' + 'implemented in ' + 'terms of ' + 'state.Model.Watch, ' + 'so\n' + 'the client may be ' + 'notified of ' + 'changes unrelated ' + 'to the environ ' + 'version.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(IntResults) + async def ModelEnvironVersion(self, entities=None): + ''' + ModelEnvironVersion returns the current version of the environ corresponding + to each specified model. + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelUpgrader', + request='ModelEnvironVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def ModelTargetEnvironVersion(self, entities=None): + ''' + 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[~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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelUpgrader', + request='ModelTargetEnvironVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModelEnvironVersion(self, models=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='ModelUpgrader', + request='SetModelEnvironVersion', + version=1, + params=_params) + _params['models'] = models + reply = await self.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='ModelUpgrader', + request='SetModelStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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='ModelUpgrader', + request='WatchModelEnvironVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class NotifyWatcherFacade(Type): + name = 'NotifyWatcher' + version = 1 + schema = {'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to the\n' + 'entity being watched since the most ' + 'recent call to Next\n' + 'or the Watch call that created the ' + 'NotifyWatcher.', + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def 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 = await self.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='NotifyWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class OfferStatusWatcherFacade(Type): + name = 'OfferStatusWatcher' + version = 1 + schema = {'definitions': {'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'OfferStatusChange': {'additionalProperties': False, + 'properties': {'offer-name': {'type': 'string'}, + 'status': {'$ref': '#/definitions/EntityStatus'}}, + 'required': ['offer-name', 'status'], + 'type': 'object'}, + 'OfferStatusWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/OfferStatusChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvOfferStatusWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/OfferStatusWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(OfferStatusWatchResult) + async def 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 = await self.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='OfferStatusWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class PayloadsFacade(Type): + name = 'Payloads' + version = 1 + schema = {'definitions': {'Payload': {'additionalProperties': False, + 'properties': {'class': {'type': 'string'}, + 'id': {'type': 'string'}, + 'labels': {'items': {'type': 'string'}, + 'type': 'array'}, + 'machine': {'type': 'string'}, + 'status': {'type': 'string'}, + 'type': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['class', + 'type', + 'id', + 'status', + 'labels', + 'unit', + 'machine'], + 'type': 'object'}, + 'PayloadListArgs': {'additionalProperties': False, + 'properties': {'patterns': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['patterns'], + 'type': 'object'}, + 'PayloadListResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/Payload'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'List': {'description': 'List builds the list of payloads ' + 'being tracked for\n' + 'the given unit and IDs. If no IDs are ' + 'provided then all tracked\n' + 'payloads for the unit are returned.', + 'properties': {'Params': {'$ref': '#/definitions/PayloadListArgs'}, + 'Result': {'$ref': '#/definitions/PayloadListResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(PayloadListResults) + async def 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 = await self.rpc(msg) + return reply + + + +class PayloadsHookContextFacade(Type): + name = 'PayloadsHookContext' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'LookUpPayloadArg': {'additionalProperties': False, + 'properties': {'id': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'required': ['name', 'id'], + 'type': 'object'}, + 'LookUpPayloadArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/LookUpPayloadArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'Payload': {'additionalProperties': False, + 'properties': {'class': {'type': 'string'}, + 'id': {'type': 'string'}, + 'labels': {'items': {'type': 'string'}, + 'type': 'array'}, + 'machine': {'type': 'string'}, + 'status': {'type': 'string'}, + 'type': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['class', + 'type', + 'id', + 'status', + 'labels', + 'unit', + 'machine'], + 'type': 'object'}, + 'PayloadResult': {'additionalProperties': False, + 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, + 'error': {'$ref': '#/definitions/Error'}, + 'not-found': {'type': 'boolean'}, + 'payload': {'$ref': '#/definitions/Payload'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'Entity', + 'payload', + 'not-found'], + 'type': 'object'}, + 'PayloadResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/PayloadResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetPayloadStatusArg': {'additionalProperties': False, + 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'Entity', + 'status'], + 'type': 'object'}, + 'SetPayloadStatusArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetPayloadStatusArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'TrackPayloadArgs': {'additionalProperties': False, + 'properties': {'payloads': {'items': {'$ref': '#/definitions/Payload'}, + 'type': 'array'}}, + 'required': ['payloads'], + 'type': 'object'}}, + 'properties': {'List': {'description': 'List builds the list of payload being ' + 'tracked for\n' + 'the given unit and IDs. If no IDs are ' + 'provided then all tracked\n' + 'payloads for the unit are returned.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/PayloadResults'}}, + 'type': 'object'}, + 'LookUp': {'description': 'LookUp identifies the payload with ' + 'the provided name and raw ID.', + 'properties': {'Params': {'$ref': '#/definitions/LookUpPayloadArgs'}, + 'Result': {'$ref': '#/definitions/PayloadResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the raw status of ' + 'a payload.', + 'properties': {'Params': {'$ref': '#/definitions/SetPayloadStatusArgs'}, + 'Result': {'$ref': '#/definitions/PayloadResults'}}, + 'type': 'object'}, + 'Track': {'description': 'Track stores a payload to be tracked ' + 'in state.', + 'properties': {'Params': {'$ref': '#/definitions/TrackPayloadArgs'}, + 'Result': {'$ref': '#/definitions/PayloadResults'}}, + 'type': 'object'}, + 'Untrack': {'description': 'Untrack marks the identified ' + 'payload as no longer being ' + 'tracked.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/PayloadResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(PayloadResults) + async def 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 + payloads for the unit are returned. + + 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='List', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PayloadResults) + async def LookUp(self, args=None): + ''' + LookUp identifies the payload with the provided name and raw ID. + + args : typing.Sequence[~LookUpPayloadArg] + 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='LookUp', + version=1, + params=_params) + _params['args'] = args + reply = await self.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) + 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) + async def 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 = await self.rpc(msg) + return reply + + + +class PingerFacade(Type): + name = 'Pinger' + version = 1 + schema = {'properties': {'Ping': {'type': 'object'}, 'Stop': {'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def Ping(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Pinger', + request='Ping', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Pinger', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class ProxyUpdaterFacade(Type): + name = 'ProxyUpdater' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ProxyConfig': {'additionalProperties': False, + 'properties': {'ftp': {'type': 'string'}, + 'http': {'type': 'string'}, + 'https': {'type': 'string'}, + 'no-proxy': {'type': 'string'}}, + 'required': ['http', + 'https', + 'ftp', + 'no-proxy'], + 'type': 'object'}, + 'ProxyConfigResult': {'additionalProperties': False, + 'properties': {'apt-proxy-settings': {'$ref': '#/definitions/ProxyConfig'}, + 'error': {'$ref': '#/definitions/Error'}, + 'proxy-settings': {'$ref': '#/definitions/ProxyConfig'}}, + 'required': ['proxy-settings', + 'apt-proxy-settings'], + 'type': 'object'}, + 'ProxyConfigResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProxyConfigResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'ProxyConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ProxyConfigResults'}}, + 'type': 'object'}, + 'WatchForProxyConfigAndAPIHostPortChanges': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ProxyConfigResults) + async def ProxyConfig(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchForProxyConfigAndAPIHostPortChanges(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class RaftLeaseFacade(Type): + name = 'RaftLease' + 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'}, + 'LeaseOperation': {'additionalProperties': False, + 'properties': {'command': {'type': 'string'}}, + 'required': ['command'], + 'type': 'object'}, + 'LeaseOperations': {'additionalProperties': False, + 'properties': {'commands': {'items': {'$ref': '#/definitions/LeaseOperation'}, + 'type': 'array'}}, + 'required': ['commands'], + 'type': 'object'}}, + 'properties': {'ApplyLease': {'description': 'ApplyLease is a bulk API to ' + 'allow applying lease operations ' + 'to a raft\n' + 'context. If the current ' + 'controller is not the leader, ' + 'then a NotLeaderError\n' + 'is returned. Information about ' + 'where they can locate the ' + 'leader maybe\n' + 'supplied in the error message, ' + "but isn't guaranteed.\n" + 'If no information is supplied, ' + 'it is expected that the client ' + 'performs their\n' + 'own algorithm to locate the ' + 'leader (roundrobin or listen to ' + 'the apidetails\n' + 'topic).', + 'properties': {'Params': {'$ref': '#/definitions/LeaseOperations'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def ApplyLease(self, commands=None): + ''' + ApplyLease is a bulk API to allow applying lease operations to a raft + context. If the current controller is not the leader, then a NotLeaderError + is returned. Information about where they can locate the leader maybe + supplied in the error message, but isn't guaranteed. + If no information is supplied, it is expected that the client performs their + own algorithm to locate the leader (roundrobin or listen to the apidetails + topic). + + commands : typing.Sequence[~LeaseOperation] + 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=1, + params=_params) + _params['commands'] = commands + reply = await self.rpc(msg) + return reply + + + +class RelationStatusWatcherFacade(Type): + name = 'RelationStatusWatcher' + 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'}, + 'RelationLifeSuspendedStatusChange': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'life': {'type': 'string'}, + 'suspended': {'type': 'boolean'}, + 'suspended-reason': {'type': 'string'}}, + 'required': ['key', + 'life', + 'suspended', + 'suspended-reason'], + 'type': 'object'}, + 'RelationLifeSuspendedStatusWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RelationLifeSuspendedStatusChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvRelationStatusWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/RelationLifeSuspendedStatusWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(RelationLifeSuspendedStatusWatchResult) + async def 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 = await self.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='RelationStatusWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class RelationUnitsWatcherFacade(Type): + name = 'RelationUnitsWatcher' + 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'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'app-changed': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}, + 'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvRelationUnitsWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/RelationUnitsWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(RelationUnitsWatchResult) + async def 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 = await self.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='RelationUnitsWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class RemoteApplicationWatcherFacade(Type): + name = 'RemoteApplicationWatcher' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'RemoteApplicationChange': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'life': {'type': 'string'}, + 'relations': {'$ref': '#/definitions/RemoteRelationsChange'}}, + 'required': ['application-tag', + 'life', + 'relations'], + 'type': 'object'}, + 'RemoteApplicationWatchResult': {'additionalProperties': False, + 'properties': {'change': {'$ref': '#/definitions/RemoteApplicationChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}}, + 'required': ['id'], + 'type': 'object'}, + 'RemoteEntityId': {'additionalProperties': False, + 'properties': {'model-uuid': {'type': 'string'}, + 'token': {'type': 'string'}}, + 'required': ['model-uuid', 'token'], + 'type': 'object'}, + 'RemoteRelationChange': {'additionalProperties': False, + 'properties': {'changed-units': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteRelationUnitChange'}}, + 'type': 'object'}, + 'departed-units': {'items': {'type': 'string'}, + 'type': 'array'}, + 'id': {'type': 'integer'}, + 'life': {'type': 'string'}}, + 'required': ['id', 'life'], + 'type': 'object'}, + 'RemoteRelationUnitChange': {'additionalProperties': False, + 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'unit-id': {'$ref': '#/definitions/RemoteEntityId'}}, + 'required': ['unit-id'], + 'type': 'object'}, + 'RemoteRelationsChange': {'additionalProperties': False, + 'properties': {'changed': {'items': {'$ref': '#/definitions/RemoteRelationChange'}, + 'type': 'array'}, + 'initial': {'type': 'boolean'}, + 'removed': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['initial'], + 'type': 'object'}}, + 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/RemoteApplicationWatchResult'}}, + 'type': 'object'}, + 'Stop': {'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(RemoteApplicationWatchResult) + async def Next(self): + ''' + + Returns -> RemoteApplicationWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteApplicationWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteApplicationWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class RemoteRelationWatcherFacade(Type): + name = 'RemoteRelationWatcher' + 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'}, + 'Macaroon': {'additionalProperties': False, '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'], + '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'}}, + 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/RemoteRelationWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(RemoteRelationWatchResult) + async def Next(self): + ''' + + Returns -> RemoteRelationWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelationWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.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. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id + + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class RemoteRelationsFacade(Type): + name = 'RemoteRelations' + version = 1 + schema = {'definitions': {'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityMacaroonArg': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'tag': {'type': 'string'}}, + 'required': ['macaroon', 'tag'], + 'type': 'object'}, + 'EntityMacaroonArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/EntityMacaroonArg'}, + 'type': 'array'}}, + 'required': ['Args'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'GetTokenArg': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'GetTokenArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/GetTokenArg'}, + 'type': 'array'}}, + 'required': ['Args'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'RelationUnit': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', 'unit'], + 'type': 'object'}, + 'RelationUnits': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnit'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'app-changed': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}, + 'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationUnitsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteApplication': {'additionalProperties': False, + 'properties': {'is-consumer-proxy': {'type': 'boolean'}, + 'life': {'type': 'string'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'model-uuid': {'type': 'string'}, + 'name': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['name', + 'offer-uuid', + 'model-uuid', + 'is-consumer-proxy'], + 'type': 'object'}, + 'RemoteApplicationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoteApplication'}}, + 'type': 'object'}, + 'RemoteApplicationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteApplicationResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'RemoteEntityTokenArg': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'token': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'RemoteEntityTokenArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/RemoteEntityTokenArg'}, + 'type': 'array'}}, + 'required': ['Args'], + 'type': 'object'}, + 'RemoteRelation': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'endpoint': {'$ref': '#/definitions/RemoteEndpoint'}, + 'id': {'type': 'integer'}, + 'key': {'type': 'string'}, + 'life': {'type': 'string'}, + 'remote-application-name': {'type': 'string'}, + 'remote-endpoint-name': {'type': 'string'}, + 'source-model-uuid': {'type': 'string'}, + 'suspended': {'type': 'boolean'}}, + 'required': ['life', + 'suspended', + 'id', + 'key', + 'application-name', + 'endpoint', + 'remote-application-name', + 'remote-endpoint-name', + 'source-model-uuid'], + 'type': 'object'}, + 'RemoteRelationChangeEvent': {'additionalProperties': False, + 'properties': {'application-token': {'type': 'string'}, + 'changed-units': {'items': {'$ref': '#/definitions/RemoteRelationUnitChange'}, + 'type': 'array'}, + 'departed-units': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'force-cleanup': {'type': 'boolean'}, + 'life': {'type': 'string'}, + 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'relation-token': {'type': 'string'}, + 'suspended': {'type': 'boolean'}, + 'suspended-reason': {'type': 'string'}}, + 'required': ['relation-token', + 'application-token', + 'life'], + 'type': 'object'}, + 'RemoteRelationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoteRelation'}}, + 'type': 'object'}, + 'RemoteRelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteRelationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteRelationUnitChange': {'additionalProperties': False, + 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'unit-id': {'type': 'integer'}}, + 'required': ['unit-id'], + 'type': 'object'}, + 'RemoteRelationsChanges': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'SettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'TokenResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'token': {'type': 'string'}}, + 'type': 'object'}, + 'TokenResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/TokenResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}}, + 'properties': {'ConsumeRemoteRelationChanges': {'properties': {'Params': {'$ref': '#/definitions/RemoteRelationsChanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'ExportEntities': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/TokenResults'}}, + 'type': 'object'}, + 'GetTokens': {'properties': {'Params': {'$ref': '#/definitions/GetTokenArgs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'ImportRemoteEntities': {'properties': {'Params': {'$ref': '#/definitions/RemoteEntityTokenArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RelationUnitSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'Relations': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RemoteRelationResults'}}, + 'type': 'object'}, + 'RemoteApplications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RemoteApplicationResults'}}, + 'type': 'object'}, + 'SaveMacaroons': {'properties': {'Params': {'$ref': '#/definitions/EntityMacaroonArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRemoteApplicationsStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchLocalRelationUnits': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, + 'type': 'object'}, + 'WatchRemoteApplicationRelations': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchRemoteApplications': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchRemoteRelations': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def ConsumeRemoteRelationChanges(self, changes=None): + ''' + 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=1, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ControllerConfig', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(TokenResults) + async def ExportEntities(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetTokens(self, args=None): + ''' + 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='GetTokens', + version=1, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ImportRemoteEntities(self, args=None): + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ImportRemoteEntities', + version=1, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def RelationUnitSettings(self, relation_units=None): + ''' + 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='RemoteRelations', + request='RelationUnitSettings', + version=1, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoteRelationResults) + async def Relations(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoteApplicationResults) + async def RemoteApplications(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SaveMacaroons(self, args=None): + ''' + 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=1, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRemoteApplicationsStatus(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitsWatchResults) + async def WatchLocalRelationUnits(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> RelationUnitsWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='WatchLocalRelationUnits', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchRemoteApplicationRelations(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchRemoteApplications(self): + ''' + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='WatchRemoteApplications', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchRemoteRelations(self): + ''' + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='WatchRemoteRelations', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class RemoteRelationsWatcherFacade(Type): + name = 'RemoteRelationsWatcher' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'RemoteEntityId': {'additionalProperties': False, + 'properties': {'model-uuid': {'type': 'string'}, + 'token': {'type': 'string'}}, + 'required': ['model-uuid', 'token'], + 'type': 'object'}, + 'RemoteRelationChange': {'additionalProperties': False, + 'properties': {'changed-units': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteRelationUnitChange'}}, + 'type': 'object'}, + 'departed-units': {'items': {'type': 'string'}, + 'type': 'array'}, + 'id': {'type': 'integer'}, + 'life': {'type': 'string'}}, + 'required': ['id', 'life'], + 'type': 'object'}, + 'RemoteRelationUnitChange': {'additionalProperties': False, + 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'unit-id': {'$ref': '#/definitions/RemoteEntityId'}}, + 'required': ['unit-id'], + 'type': 'object'}, + 'RemoteRelationsChange': {'additionalProperties': False, + 'properties': {'changed': {'items': {'$ref': '#/definitions/RemoteRelationChange'}, + 'type': 'array'}, + 'initial': {'type': 'boolean'}, + 'removed': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['initial'], + 'type': 'object'}, + 'RemoteRelationsWatchResult': {'additionalProperties': False, + 'properties': {'RemoteRelationsWatcherId': {'type': 'string'}, + 'change': {'$ref': '#/definitions/RemoteRelationsChange'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['RemoteRelationsWatcherId'], + 'type': 'object'}}, + 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/RemoteRelationsWatchResult'}}, + 'type': 'object'}, + 'Stop': {'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(RemoteRelationsWatchResult) + async def Next(self): + ''' + + Returns -> RemoteRelationsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelationsWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Stop(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelationsWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class ResourcesFacade(Type): + name = 'Resources' + version = 1 + schema = {'definitions': {'AddCharmWithAuthorization': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'channel', + 'macaroon', + 'force'], + 'type': 'object'}, + 'AddPendingResourcesArgs': {'additionalProperties': False, + 'properties': {'AddCharmWithAuthorization': {'$ref': '#/definitions/AddCharmWithAuthorization'}, + 'Entity': {'$ref': '#/definitions/Entity'}, + 'channel': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'resources': {'items': {'$ref': '#/definitions/CharmResource'}, + 'type': 'array'}, + 'tag': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'required': ['tag', + 'Entity', + 'url', + 'channel', + 'macaroon', + 'force', + 'AddCharmWithAuthorization', + 'resources'], + 'type': 'object'}, + 'AddPendingResourcesResult': {'additionalProperties': False, + 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'pending-ids': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['ErrorResult', + 'pending-ids'], + 'type': 'object'}, + 'CharmResource': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'fingerprint': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'name': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'origin', + 'revision', + 'fingerprint', + 'size'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'ListResourcesArgs': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'Resource': {'additionalProperties': False, + 'properties': {'CharmResource': {'$ref': '#/definitions/CharmResource'}, + 'application': {'type': 'string'}, + 'description': {'type': 'string'}, + 'fingerprint': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'name': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'pending-id': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}, + 'type': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'origin', + 'revision', + 'fingerprint', + 'size', + 'CharmResource', + 'id', + 'pending-id', + 'application', + 'username', + 'timestamp'], + 'type': 'object'}, + 'ResourcesResult': {'additionalProperties': False, + 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, + 'charm-store-resources': {'items': {'$ref': '#/definitions/CharmResource'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'resources': {'items': {'$ref': '#/definitions/Resource'}, + 'type': 'array'}, + 'unit-resources': {'items': {'$ref': '#/definitions/UnitResources'}, + 'type': 'array'}}, + 'required': ['ErrorResult', + 'resources', + 'charm-store-resources', + 'unit-resources'], + 'type': 'object'}, + 'ResourcesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResourcesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UnitResources': {'additionalProperties': False, + 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, + 'download-progress': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}, + 'resources': {'items': {'$ref': '#/definitions/Resource'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'Entity', + 'resources', + 'download-progress'], + 'type': 'object'}}, + 'properties': {'AddPendingResources': {'description': 'AddPendingResources ' + 'adds the provided ' + 'resources (info) to ' + 'the Juju\n' + 'model in a pending ' + 'state, meaning they ' + 'are not available ' + 'until\n' + 'resolved.', + 'properties': {'Params': {'$ref': '#/definitions/AddPendingResourcesArgs'}, + 'Result': {'$ref': '#/definitions/AddPendingResourcesResult'}}, + 'type': 'object'}, + 'ListResources': {'description': 'ListResources returns the ' + 'list of resources for the ' + 'given application.', + 'properties': {'Params': {'$ref': '#/definitions/ListResourcesArgs'}, + 'Result': {'$ref': '#/definitions/ResourcesResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddPendingResourcesResult) + async def AddPendingResources(self, addcharmwithauthorization=None, entity=None, channel=None, force=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. + + addcharmwithauthorization : AddCharmWithAuthorization + entity : Entity + channel : str + force : bool + macaroon : Macaroon + resources : typing.Sequence[~CharmResource] + tag : str + url : str + Returns -> AddPendingResourcesResult + ''' + if addcharmwithauthorization is not None and not isinstance(addcharmwithauthorization, (dict, AddCharmWithAuthorization)): + raise Exception("Expected addcharmwithauthorization to be a AddCharmWithAuthorization, received: {}".format(type(addcharmwithauthorization))) + + if entity is not None and not isinstance(entity, (dict, Entity)): + raise Exception("Expected entity to be a Entity, received: {}".format(type(entity))) + + 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 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=1, + params=_params) + _params['AddCharmWithAuthorization'] = addcharmwithauthorization + _params['Entity'] = entity + _params['channel'] = channel + _params['force'] = force + _params['macaroon'] = macaroon + _params['resources'] = resources + _params['tag'] = tag + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResourcesResults) + async def 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class ResourcesHookContextFacade(Type): + name = 'ResourcesHookContext' + version = 1 + schema = {'definitions': {'CharmResource': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'fingerprint': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'name': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'origin', + 'revision', + 'fingerprint', + 'size'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'ListUnitResourcesArgs': {'additionalProperties': False, + 'properties': {'resource-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['resource-names'], + 'type': 'object'}, + 'Resource': {'additionalProperties': False, + 'properties': {'CharmResource': {'$ref': '#/definitions/CharmResource'}, + 'application': {'type': 'string'}, + 'description': {'type': 'string'}, + 'fingerprint': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'name': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'pending-id': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}, + 'type': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'origin', + 'revision', + 'fingerprint', + 'size', + 'CharmResource', + 'id', + 'pending-id', + 'application', + 'username', + 'timestamp'], + 'type': 'object'}, + 'UnitResourceResult': {'additionalProperties': False, + 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'resource': {'$ref': '#/definitions/Resource'}}, + 'required': ['ErrorResult', 'resource'], + 'type': 'object'}, + 'UnitResourcesResult': {'additionalProperties': False, + 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'resources': {'items': {'$ref': '#/definitions/UnitResourceResult'}, + 'type': 'array'}}, + 'required': ['ErrorResult', + 'resources'], + 'type': 'object'}}, + 'properties': {'GetResourceInfo': {'description': 'GetResourceInfo returns ' + 'the resource info for each ' + 'of the given\n' + 'resource names (for the ' + 'implicit application). If ' + 'any one is missing then\n' + 'the corresponding result ' + 'is set with ' + 'errors.NotFound.', + 'properties': {'Params': {'$ref': '#/definitions/ListUnitResourcesArgs'}, + 'Result': {'$ref': '#/definitions/UnitResourcesResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(UnitResourcesResult) + async def 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 = await self.rpc(msg) + return reply + + + +class RetryStrategyFacade(Type): + name = 'RetryStrategy' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RetryStrategy': {'additionalProperties': False, + 'properties': {'jitter-retry-time': {'type': 'boolean'}, + 'max-retry-time': {'type': 'integer'}, + 'min-retry-time': {'type': 'integer'}, + 'retry-time-factor': {'type': 'integer'}, + 'should-retry': {'type': 'boolean'}}, + 'required': ['should-retry', + 'min-retry-time', + 'max-retry-time', + 'jitter-retry-time', + 'retry-time-factor'], + 'type': 'object'}, + 'RetryStrategyResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RetryStrategy'}}, + 'type': 'object'}, + 'RetryStrategyResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RetryStrategyResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'RetryStrategy': {'description': 'RetryStrategy returns ' + 'RetryStrategyResults that ' + 'can be used by any code that ' + 'uses\n' + 'to configure the retry timer ' + "that's currently in juju " + 'utils.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RetryStrategyResults'}}, + 'type': 'object'}, + 'WatchRetryStrategy': {'description': 'WatchRetryStrategy ' + 'watches for changes to ' + 'the model. Currently we ' + 'only allow\n' + 'changes to the boolean ' + 'that determines whether ' + 'retries should be ' + 'attempted or not.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(RetryStrategyResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class SSHClientFacade(Type): + name = 'SSHClient' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'SSHAddressResult': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'SSHAddressResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SSHProxyResult': {'additionalProperties': False, + 'properties': {'use-proxy': {'type': 'boolean'}}, + 'required': ['use-proxy'], + 'type': 'object'}, + 'SSHPublicKeysResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'public-keys': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SSHPublicKeysResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SSHPublicKeysResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'PrivateAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHAddressResults'}}, + 'type': 'object'}, + 'Proxy': {'properties': {'Result': {'$ref': '#/definitions/SSHProxyResult'}}, + 'type': 'object'}, + 'PublicAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHAddressResults'}}, + 'type': 'object'}, + 'PublicKeys': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHPublicKeysResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(SSHAddressResults) + async def PrivateAddress(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHProxyResult) + async def Proxy(self): + ''' + + Returns -> SSHProxyResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SSHClient', + request='Proxy', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHAddressResults) + async def PublicAddress(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHPublicKeysResults) + async def PublicKeys(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class SecretsFacade(Type): + name = 'Secrets' + 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'}, + 'ListSecretResult': {'additionalProperties': False, + 'properties': {'create-time': {'format': 'date-time', + 'type': 'string'}, + 'description': {'type': 'string'}, + 'int': {'type': 'integer'}, + 'path': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'rotate-interval': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'update-time': {'format': 'date-time', + 'type': 'string'}, + 'url': {'type': 'string'}, + 'value': {'$ref': '#/definitions/SecretValueResult'}, + 'version': {'type': 'integer'}}, + 'required': ['url', + 'path', + 'version', + 'rotate-interval', + 'status', + 'int', + 'provider', + 'revision', + 'create-time', + 'update-time'], + 'type': 'object'}, + 'ListSecretResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ListSecretResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListSecretsArgs': {'additionalProperties': False, + 'properties': {'show-secrets': {'type': 'boolean'}}, + 'required': ['show-secrets'], + 'type': 'object'}, + 'SecretValueResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}}, + 'properties': {'ListSecrets': {'description': 'ListSecrets lists available ' + 'secrets.', + 'properties': {'Params': {'$ref': '#/definitions/ListSecretsArgs'}, + 'Result': {'$ref': '#/definitions/ListSecretResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ListSecretResults) + async def ListSecrets(self, show_secrets=None): + ''' + ListSecrets lists available secrets. + + show_secrets : bool + Returns -> ListSecretResults + ''' + 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['show-secrets'] = show_secrets + reply = await self.rpc(msg) + return reply + + + +class SecretsManagerFacade(Type): + name = 'SecretsManager' + version = 1 + schema = {'definitions': {'CreateSecretArg': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'path': {'type': 'string'}, + 'rotate-interval': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'type': {'type': 'string'}}, + 'required': ['type', + 'path', + 'rotate-interval', + 'status'], + 'type': 'object'}, + 'CreateSecretArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/CreateSecretArg'}, + 'type': 'array'}}, + 'required': ['args'], + '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'}, + 'GetSecretArg': {'additionalProperties': False, + 'properties': {'id': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'type': 'object'}, + 'GetSecretArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/GetSecretArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SecretRotatedArg': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}, + 'when': {'format': 'date-time', + 'type': 'string'}}, + 'required': ['url', 'when'], + 'type': 'object'}, + 'SecretRotatedArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SecretRotatedArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SecretRotationChange': {'additionalProperties': False, + 'properties': {'last-rotate-time': {'format': 'date-time', + 'type': 'string'}, + 'rotate-interval': {'type': 'integer'}, + 'secret-id': {'type': 'integer'}, + 'url': {'type': 'string'}}, + 'required': ['secret-id', + 'url', + 'rotate-interval', + 'last-rotate-time'], + 'type': 'object'}, + 'SecretRotationWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/SecretRotationChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'SecretRotationWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SecretRotationWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SecretValueResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'SecretValueResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SecretValueResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateSecretArg': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'rotate-interval': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'rotate-interval', + 'status'], + 'type': 'object'}, + 'UpdateSecretArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSecretArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}}, + 'properties': {'CreateSecrets': {'description': 'CreateSecrets creates new ' + 'secrets.', + 'properties': {'Params': {'$ref': '#/definitions/CreateSecretArgs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GetSecretValues': {'description': 'GetSecretValues returns ' + 'the secret values for the ' + 'specified secrets.', + 'properties': {'Params': {'$ref': '#/definitions/GetSecretArgs'}, + 'Result': {'$ref': '#/definitions/SecretValueResults'}}, + 'type': 'object'}, + 'SecretsRotated': {'description': 'SecretsRotated records when ' + 'secrets were last rotated.', + 'properties': {'Params': {'$ref': '#/definitions/SecretRotatedArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateSecrets': {'description': 'UpdateSecrets updates the ' + 'specified secrets.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSecretArgs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'WatchSecretsRotationChanges': {'description': 'WatchSecretsRotationChanges ' + 'sets up a ' + 'watcher to ' + 'notify of ' + 'changes to ' + 'secret ' + 'rotation ' + 'config.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SecretRotationWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretValueResults) + async def GetSecretValues(self, args=None): + ''' + GetSecretValues returns the secret values for the specified secrets. + + args : typing.Sequence[~GetSecretArg] + Returns -> SecretValueResults + ''' + 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='GetSecretValues', + version=1, + params=_params) + _params['args'] = args + reply = await self.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='SecretsManager', + request='SecretsRotated', + version=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def UpdateSecrets(self, args=None): + ''' + UpdateSecrets updates the specified secrets. + + args : typing.Sequence[~UpdateSecretArg] + 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='UpdateSecrets', + version=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SecretRotationWatchResults) + async def WatchSecretsRotationChanges(self, entities=None): + ''' + WatchSecretsRotationChanges sets up a watcher to notify of changes to secret rotation config. + + entities : typing.Sequence[~Entity] + Returns -> SecretRotationWatchResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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 = await self.rpc(msg) + return reply + + + +class SecretsRotationWatcherFacade(Type): + name = 'SecretsRotationWatcher' + 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'}, + 'SecretRotationChange': {'additionalProperties': False, + 'properties': {'last-rotate-time': {'format': 'date-time', + 'type': 'string'}, + 'rotate-interval': {'type': 'integer'}, + 'secret-id': {'type': 'integer'}, + 'url': {'type': 'string'}}, + 'required': ['secret-id', + 'url', + 'rotate-interval', + 'last-rotate-time'], + 'type': 'object'}, + 'SecretRotationWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/SecretRotationChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvSecretRotationWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/SecretRotationWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(SecretRotationWatchResult) + async def 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 -> SecretRotationWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='SecretsRotationWatcher', + request='Next', + version=1, + params=_params) + + reply = await self.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='SecretsRotationWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class SingularFacade(Type): + name = 'Singular' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'SingularClaim': {'additionalProperties': False, + 'properties': {'controller-tag': {'type': 'string'}, + 'duration': {'type': 'integer'}, + 'model-tag': {'type': 'string'}}, + 'required': ['model-tag', + 'controller-tag', + 'duration'], + 'type': 'object'}, + 'SingularClaims': {'additionalProperties': False, + 'properties': {'claims': {'items': {'$ref': '#/definitions/SingularClaim'}, + 'type': 'array'}}, + 'required': ['claims'], + 'type': 'object'}}, + 'properties': {'Claim': {'properties': {'Params': {'$ref': '#/definitions/SingularClaims'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Wait': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def Claim(self, claims=None): + ''' + 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=1, + params=_params) + _params['claims'] = claims + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Wait(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class StringsWatcherFacade(Type): + name = 'StringsWatcher' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvStringsWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsWatchResult) + async def 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 = await self.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='StringsWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class UndertakerFacade(Type): + name = 'Undertaker' + version = 1 + schema = {'definitions': {'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'UndertakerModelInfo': {'additionalProperties': False, + 'properties': {'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'}}, + 'required': ['uuid', + 'name', + 'global-name', + 'is-system', + 'life'], + 'type': 'object'}, + 'UndertakerModelInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/UndertakerModelInfo'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'ModelConfig': {'description': 'ModelConfig returns the ' + "model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelInfo': {'description': 'ModelInfo returns information on ' + 'the model needed by the ' + 'undertaker worker.', + 'properties': {'Result': {'$ref': '#/definitions/UndertakerModelInfoResult'}}, + 'type': 'object'}, + 'ProcessDyingModel': {'description': 'ProcessDyingModel checks ' + 'if a dying model has any ' + 'machines or ' + 'applications.\n' + 'If there are none, the ' + "model's life is changed " + 'from dying to dead.', + 'type': 'object'}, + 'RemoveModel': {'description': 'RemoveModel removes any ' + 'records of this model from ' + 'Juju.', + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the status of ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchModelResources': {'description': 'WatchModelResources ' + 'creates watchers for ' + 'changes to the ' + 'lifecycle of an\n' + "model's machines and " + 'applications and ' + 'storage.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + ModelConfig returns the model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='ModelConfig', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UndertakerModelInfoResult) + async def ModelInfo(self): + ''' + 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 = await self.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) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def RemoveModel(self): + ''' + RemoveModel removes any records of this model from Juju. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Undertaker', + request='RemoveModel', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class UnitAssignerFacade(Type): + name = 'UnitAssigner' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'AssignUnits': {'description': 'AssignUnits assigns the units ' + 'with the given ids to the ' + 'correct machine. The\n' + ' error results are returned in ' + 'the same order as the given ' + 'entities.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetAgentStatus': {'description': 'SetAgentStatus will set ' + 'status for agents of Units ' + 'passed in args, if one\n' + 'of the args is not an Unit ' + 'it will fail.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchUnitAssignments': {'description': 'WatchUnitAssignments ' + 'returns a strings ' + 'watcher that is ' + 'notified when new ' + 'unit\n' + 'assignments are added ' + 'to the db.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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 = await self.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='UnitAssigner', + request='SetAgentStatus', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + +class UpgradeSeriesFacade(Type): + name = 'UpgradeSeries' + version = 1 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesResult': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/EntitiesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PinApplicationResult': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['application-name'], + 'type': 'object'}, + 'PinApplicationsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/PinApplicationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PinnedLeadershipResult': {'additionalProperties': False, + 'properties': {'result': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpgradeSeriesStartUnitCompletionParam': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'message': {'type': 'string'}}, + 'required': ['entities', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'message': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['entity', + 'status', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'UpgradeSeriesStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusResult'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'FinishUpgradeSeries': {'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'MachineStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'PinMachineApplications': {'properties': {'Result': {'$ref': '#/definitions/PinApplicationsResults'}}, + 'type': 'object'}, + 'PinnedLeadership': {'properties': {'Result': {'$ref': '#/definitions/PinnedLeadershipResult'}}, + 'type': 'object'}, + 'SetMachineStatus': {'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUpgradeSeriesUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StartUnitCompletion': {'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStartUnitCompletionParam'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'TargetSeries': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'UnitsCompleted': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/EntitiesResults'}}, + 'type': 'object'}, + 'UnitsPrepared': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/EntitiesResults'}}, + 'type': 'object'}, + 'UnpinMachineApplications': {'properties': {'Result': {'$ref': '#/definitions/PinApplicationsResults'}}, + 'type': 'object'}, + 'UpgradeSeriesUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def FinishUpgradeSeries(self, args=None): + ''' + args : typing.Sequence[~UpdateSeriesArg] + 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=1, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def MachineStatus(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PinApplicationsResults) + async def PinMachineApplications(self): + ''' + + Returns -> PinApplicationsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='PinMachineApplications', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PinnedLeadershipResult) + async def PinnedLeadership(self): + ''' + + Returns -> PinnedLeadershipResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='PinnedLeadership', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMachineStatus(self, params=None): + ''' + 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=1, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUpgradeSeriesUnitStatus(self, params=None): + ''' + 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=1, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def StartUnitCompletion(self, entities=None, message=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + _params['message'] = message + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def TargetSeries(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(EntitiesResults) + async def UnitsCompleted(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(EntitiesResults) + async def UnitsPrepared(self, entities=None): + ''' + 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='UnitsPrepared', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PinApplicationsResults) + async def UnpinMachineApplications(self): + ''' + + Returns -> PinApplicationsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='UpgradeSeries', + request='UnpinMachineApplications', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def UpgradeSeriesUnitStatus(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchUpgradeSeriesNotifications(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class UpgradeStepsFacade(Type): + name = 'UpgradeSteps' + version = 1 + schema = {'definitions': {'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'}}, + 'properties': {'ResetKVMMachineModificationStatusIdle': {'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def ResetKVMMachineModificationStatusIdle(self, tag=None): + ''' + 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=1, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + +class UpgraderFacade(Type): + name = 'Upgrader' + version = 1 + schema = {'definitions': {'Binary': {'additionalProperties': False, + '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'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build', + 'Number', + 'Release', + 'Arch'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesVersion': {'additionalProperties': False, + 'properties': {'agent-tools': {'items': {'$ref': '#/definitions/EntityVersion'}, + 'type': 'array'}}, + 'required': ['agent-tools'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityVersion': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'tools': {'$ref': '#/definitions/Version'}}, + 'required': ['tag', 'tools'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'ToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'tools': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['tools'], + 'type': 'object'}, + 'ToolsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ToolsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Version': {'additionalProperties': False, + 'properties': {'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version'], + 'type': 'object'}, + 'VersionResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'type': 'object'}, + 'VersionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VersionResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'DesiredVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/VersionResults'}}, + 'type': 'object'}, + 'SetTools': {'properties': {'Params': {'$ref': '#/definitions/EntitiesVersion'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Tools': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ToolsResults'}}, + 'type': 'object'}, + 'WatchAPIVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(VersionResults) + async def DesiredVersion(self, entities=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 = await self.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) + async def 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) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchAPIVersion(self, entities=None): + ''' + 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='Upgrader', + request='WatchAPIVersion', + version=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class UserManagerFacade(Type): + name = 'UserManager' + version = 1 + schema = {'definitions': {'AddUser': {'additionalProperties': False, + 'properties': {'display-name': {'type': 'string'}, + 'password': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['username', 'display-name'], + 'type': 'object'}, + 'AddUserResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'secret-key': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'type': 'object'}, + 'AddUserResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/AddUserResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'AddUsers': {'additionalProperties': False, + 'properties': {'users': {'items': {'$ref': '#/definitions/AddUser'}, + 'type': 'array'}}, + 'required': ['users'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'UserInfo': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'created-by': {'type': 'string'}, + 'date-created': {'format': 'date-time', + 'type': 'string'}, + 'disabled': {'type': 'boolean'}, + 'display-name': {'type': 'string'}, + 'last-connection': {'format': 'date-time', + 'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['username', + 'display-name', + 'access', + 'created-by', + 'date-created', + 'disabled'], + 'type': 'object'}, + 'UserInfoRequest': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'include-disabled': {'type': 'boolean'}}, + 'required': ['entities', + 'include-disabled'], + 'type': 'object'}, + 'UserInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/UserInfo'}}, + 'type': 'object'}, + 'UserInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UserInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AddUser': {'properties': {'Params': {'$ref': '#/definitions/AddUsers'}, + 'Result': {'$ref': '#/definitions/AddUserResults'}}, + 'type': 'object'}, + 'DisableUser': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnableUser': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveUser': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetPassword': {'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UserInfo': {'properties': {'Params': {'$ref': '#/definitions/UserInfoRequest'}, + 'Result': {'$ref': '#/definitions/UserInfoResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddUserResults) + async def AddUser(self, users=None): + ''' + 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=1, + params=_params) + _params['users'] = users + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DisableUser(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnableUser(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveUser(self, entities=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPassword(self, changes=None): + ''' + 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=1, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UserInfoResults) + async def UserInfo(self, entities=None, include_disabled=None): + ''' + 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=1, + params=_params) + _params['entities'] = entities + _params['include-disabled'] = include_disabled + reply = await self.rpc(msg) + return reply + + + +class VolumeAttachmentPlansWatcherFacade(Type): + name = 'VolumeAttachmentPlansWatcher' + version = 1 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'MachineStorageId': {'additionalProperties': False, + 'properties': {'attachment-tag': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'attachment-tag'], + 'type': 'object'}, + 'MachineStorageIdsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvMachineStorageIdsWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(MachineStorageIdsWatchResult) + async def 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 = await self.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='VolumeAttachmentPlansWatcher', + request='Stop', + version=1, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + diff --git a/juju/client/old_clients/_client10.py b/juju/client/old_clients/_client10.py new file mode 100644 index 000000000..5546feb76 --- /dev/null +++ b/juju/client/old_clients/_client10.py @@ -0,0 +1,3433 @@ +# 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.old_clients._definitions import * + + +class ApplicationFacade(Type): + name = 'Application' + version = 10 + 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'}, + 'ApplicationConfigSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'generation': {'type': 'string'}}, + 'required': ['application', + 'generation', + 'config'], + 'type': 'object'}, + 'ApplicationConfigSetArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/ApplicationConfigSet'}, + 'type': 'array'}}, + 'required': ['Args'], + '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': {'application': {'type': 'string'}, + 'attach-storage': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + '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'}, + 'series': {'type': 'string'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'series', + 'charm-url', + 'channel', + 'num-units', + 'config-yaml', + 'constraints'], + 'type': 'object'}, + 'ApplicationDestroy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationExpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + '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'}, + 'channel': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'series': {'type': 'string'}}, + 'required': ['application', + 'charm', + 'config', + 'constraints', + 'series', + 'channel'], + 'type': 'object'}, + 'ApplicationInfo': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'exposed': {'type': 'boolean'}, + 'principal': {'type': 'boolean'}, + 'remote': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'principal', + 'exposed', + 'remote'], + 'type': 'object'}, + 'ApplicationInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ApplicationInfo'}}, + 'type': 'object'}, + 'ApplicationInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + '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'}, + 'ApplicationOfferDetails': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description'], + 'type': 'object'}, + 'ApplicationSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'options': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', + 'branch', + 'options'], + 'type': 'object'}, + 'ApplicationSetCharm': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'config-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-settings-yaml': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'force-series': {'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-series'], + 'type': 'object'}, + 'ApplicationUnexpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationUnset': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'options': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', + 'branch', + 'options'], + 'type': 'object'}, + 'ApplicationUpdate': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'force': {'type': 'boolean'}, + 'force-charm-url': {'type': 'boolean'}, + 'force-series': {'type': 'boolean'}, + 'generation': {'type': 'string'}, + 'min-units': {'type': 'integer'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'settings-yaml': {'type': 'string'}}, + 'required': ['application', + 'charm-url', + 'force-charm-url', + 'force-series', + 'force', + 'settings-yaml', + 'generation'], + 'type': 'object'}, + 'ApplicationsDeploy': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/ApplicationDeploy'}, + 'type': 'array'}}, + 'required': ['applications'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'ConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['config'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'ConsumeApplicationArg': {'additionalProperties': False, + 'properties': {'ApplicationOfferDetails': {'$ref': '#/definitions/ApplicationOfferDetails'}, + 'application-alias': {'type': 'string'}, + 'external-controller': {'$ref': '#/definitions/ExternalControllerInfo'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}}, + 'required': ['ApplicationOfferDetails'], + 'type': 'object'}, + 'ConsumeApplicationArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ConsumeApplicationArg'}, + 'type': 'array'}}, + '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'}, + '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'}, + 'DestroyApplicationUnits': {'additionalProperties': False, + 'properties': {'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + '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'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', 'force'], + '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'}, + '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'}, + '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'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + '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'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + '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'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'UnitsResolved': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}, + 'retry': {'type': 'boolean'}, + 'tags': {'$ref': '#/definitions/Entities'}}, + 'type': 'object'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + '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': {'properties': {'Params': {'$ref': '#/definitions/AddRelation'}, + 'Result': {'$ref': '#/definitions/AddRelationResults'}}, + 'type': 'object'}, + 'AddUnits': {'properties': {'Params': {'$ref': '#/definitions/AddApplicationUnits'}, + 'Result': {'$ref': '#/definitions/AddApplicationUnitsResults'}}, + 'type': 'object'}, + 'ApplicationsInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationInfoResults'}}, + 'type': 'object'}, + 'CharmConfig': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGetArgs'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'CharmRelations': {'properties': {'Params': {'$ref': '#/definitions/ApplicationCharmRelations'}, + 'Result': {'$ref': '#/definitions/ApplicationCharmRelationsResults'}}, + 'type': 'object'}, + 'Consume': {'properties': {'Params': {'$ref': '#/definitions/ConsumeApplicationArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Deploy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationsDeploy'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}}, + 'type': 'object'}, + 'DestroyApplication': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationsParams'}, + 'Result': {'$ref': '#/definitions/DestroyApplicationResults'}}, + 'type': 'object'}, + 'DestroyConsumedApplications': {'properties': {'Params': {'$ref': '#/definitions/DestroyConsumedApplicationsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyRelation': {'properties': {'Params': {'$ref': '#/definitions/DestroyRelation'}}, + 'type': 'object'}, + 'DestroyUnit': {'properties': {'Params': {'$ref': '#/definitions/DestroyUnitsParams'}, + 'Result': {'$ref': '#/definitions/DestroyUnitResults'}}, + 'type': 'object'}, + 'DestroyUnits': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, + 'type': 'object'}, + 'Expose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationExpose'}}, + 'type': 'object'}, + 'Get': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/ApplicationGetResults'}}, + 'type': 'object'}, + 'GetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'GetConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'GetConstraints': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConstraintsResults'}}, + 'type': 'object'}, + 'ResolveUnitErrors': {'properties': {'Params': {'$ref': '#/definitions/UnitsResolved'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ScaleApplications': {'properties': {'Params': {'$ref': '#/definitions/ScaleApplicationsParams'}, + 'Result': {'$ref': '#/definitions/ScaleApplicationResults'}}, + 'type': 'object'}, + 'Set': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, + 'type': 'object'}, + 'SetApplicationsConfig': {'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigSetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharm': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, + 'type': 'object'}, + 'SetConstraints': {'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetMetricCredentials': {'properties': {'Params': {'$ref': '#/definitions/ApplicationMetricCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRelationsSuspended': {'properties': {'Params': {'$ref': '#/definitions/RelationSuspendedArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Unexpose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnexpose'}}, + 'type': 'object'}, + 'Unset': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, + 'type': 'object'}, + 'UnsetApplicationsConfig': {'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigUnsetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Update': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUpdate'}}, + 'type': 'object'}, + 'UpdateApplicationSeries': {'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddRelationResults) + async def AddRelation(self, endpoints=None, via_cidrs=None): + ''' + 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=10, + 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): + ''' + 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=10, + 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): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def CharmConfig(self, args=None): + ''' + 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=10, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationCharmRelationsResults) + async def CharmRelations(self, application=None): + ''' + 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=10, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Consume(self, args=None): + ''' + 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=10, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Deploy(self, applications=None): + ''' + 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=10, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Destroy(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Destroy', + version=10, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyApplicationResults) + async def DestroyApplication(self, applications=None): + ''' + 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=10, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyConsumedApplications(self, applications=None): + ''' + 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=10, + 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): + ''' + 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=10, + 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): + ''' + 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=10, + params=_params) + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyUnits(self, unit_names=None): + ''' + unit_names : typing.Sequence[str] + Returns -> None + ''' + if unit_names is not None and not isinstance(unit_names, (bytes, str, list)): + raise Exception("Expected unit_names to be a Sequence, received: {}".format(type(unit_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnits', + version=10, + params=_params) + _params['unit-names'] = unit_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Expose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=10, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetResults) + async def Get(self, application=None, branch=None): + ''' + 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=10, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def GetCharmURL(self, application=None, branch=None): + ''' + application : str + branch : str + Returns -> StringResult + ''' + 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='GetCharmURL', + version=10, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def GetConfig(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConstraintsResults) + async def GetConstraints(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): + ''' + 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=10, + 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): + ''' + 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=10, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Set(self, application=None, branch=None, options=None): + ''' + application : str + branch : str + options : typing.Mapping[str, 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, dict): + raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Set', + version=10, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationsConfig(self, args=None): + ''' + args : typing.Sequence[~ApplicationConfigSet] + 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='SetApplicationsConfig', + version=10, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetCharm(self, application=None, channel=None, charm_url=None, config_settings=None, config_settings_yaml=None, force=None, force_series=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None): + ''' + application : str + channel : str + charm_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + force : bool + force_series : 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_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 force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + 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=10, + params=_params) + _params['application'] = application + _params['channel'] = channel + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['force'] = force + _params['force-series'] = force_series + _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(None) + async def SetConstraints(self, application=None, constraints=None): + ''' + 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=10, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMetricCredentials(self, creds=None): + ''' + 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=10, + params=_params) + _params['creds'] = creds + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationsSuspended(self, args=None): + ''' + 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=10, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unexpose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=10, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unset(self, application=None, branch=None, options=None): + ''' + application : str + branch : str + options : 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, (bytes, str, list)): + raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unset', + version=10, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UnsetApplicationsConfig(self, args=None): + ''' + 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=10, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Update(self, application=None, charm_url=None, constraints=None, force=None, force_charm_url=None, force_series=None, generation=None, min_units=None, settings=None, settings_yaml=None): + ''' + application : str + charm_url : str + constraints : Value + force : bool + force_charm_url : bool + force_series : bool + generation : str + min_units : int + settings : typing.Mapping[str, str] + settings_yaml : 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 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 constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if force_charm_url is not None and not isinstance(force_charm_url, bool): + raise Exception("Expected force_charm_url to be a bool, received: {}".format(type(force_charm_url))) + + if force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + if generation is not None and not isinstance(generation, (bytes, str)): + raise Exception("Expected generation to be a str, received: {}".format(type(generation))) + + if min_units is not None and not isinstance(min_units, int): + raise Exception("Expected min_units to be a int, received: {}".format(type(min_units))) + + if settings is not None and not isinstance(settings, dict): + raise Exception("Expected settings to be a Mapping, received: {}".format(type(settings))) + + if settings_yaml is not None and not isinstance(settings_yaml, (bytes, str)): + raise Exception("Expected settings_yaml to be a str, received: {}".format(type(settings_yaml))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Update', + version=10, + params=_params) + _params['application'] = application + _params['charm-url'] = charm_url + _params['constraints'] = constraints + _params['force'] = force + _params['force-charm-url'] = force_charm_url + _params['force-series'] = force_series + _params['generation'] = generation + _params['min-units'] = min_units + _params['settings'] = settings + _params['settings-yaml'] = settings_yaml + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateApplicationSeries(self, args=None): + ''' + args : typing.Sequence[~UpdateSeriesArg] + 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='UpdateApplicationSeries', + version=10, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + +class ProvisionerFacade(Type): + name = 'Provisioner' + version = 10 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'Binary': {'additionalProperties': False, + 'properties': {'Arch': {'type': 'string'}, + 'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Number': {'$ref': '#/definitions/Number'}, + 'Patch': {'type': 'integer'}, + 'Series': {'type': 'string'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build', + 'Number', + 'Series', + 'Arch'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CloudImageMetadata': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'image-id': {'type': 'string'}, + 'priority': {'type': 'integer'}, + 'region': {'type': 'string'}, + 'root-storage-size': {'type': 'integer'}, + 'root-storage-type': {'type': 'string'}, + 'series': {'type': 'string'}, + 'source': {'type': 'string'}, + 'stream': {'type': 'string'}, + 'version': {'type': 'string'}, + 'virt-type': {'type': 'string'}}, + 'required': ['image-id', + 'region', + 'version', + 'series', + 'arch', + 'source', + 'priority'], + 'type': 'object'}, + 'ConstraintsResult': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'ConstraintsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConstraintsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ContainerConfig': {'additionalProperties': False, + 'properties': {'UpdateBehavior': {'$ref': '#/definitions/UpdateBehavior'}, + 'apt-mirror': {'type': 'string'}, + 'apt-proxy': {'$ref': '#/definitions/Settings'}, + 'authorized-keys': {'type': 'string'}, + 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + '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'}}, + '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', + 'apt-mirror', + 'UpdateBehavior'], + 'type': 'object'}, + 'ContainerLXDProfile': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'profile': {'$ref': '#/definitions/CharmLXDProfile'}}, + 'required': ['profile', 'name'], + 'type': 'object'}, + 'ContainerManagerConfig': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ContainerManagerConfigParams': {'additionalProperties': False, + 'properties': {'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'ContainerProfileResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'lxd-profiles': {'items': {'$ref': '#/definitions/ContainerLXDProfile'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ContainerProfileResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ContainerProfileResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'DeviceBridgeInfo': {'additionalProperties': False, + 'properties': {'bridge-name': {'type': 'string'}, + 'host-device-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['host-device-name', + 'bridge-name', + 'mac-address'], + 'type': 'object'}, + 'DistributionGroupResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'DistributionGroupResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/DistributionGroupResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'FindToolsParams': {'additionalProperties': False, + 'properties': {'agentstream': {'type': 'string'}, + 'arch': {'type': 'string'}, + 'major': {'type': 'integer'}, + 'minor': {'type': 'integer'}, + 'number': {'$ref': '#/definitions/Number'}, + 'series': {'type': 'string'}}, + 'required': ['number', + 'major', + 'minor', + 'arch', + 'series', + 'agentstream'], + 'type': 'object'}, + 'FindToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'list': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['list'], + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'root-disk-source': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'HostNetworkChange': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'new-bridges': {'items': {'$ref': '#/definitions/DeviceBridgeInfo'}, + 'type': 'array'}, + 'reconfigure-delay': {'type': 'integer'}}, + 'required': ['new-bridges', + 'reconfigure-delay'], + 'type': 'object'}, + 'HostNetworkChangeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/HostNetworkChange'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'InstanceInfo': {'additionalProperties': False, + 'properties': {'characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'charm-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'display-name': {'type': 'string'}, + 'instance-id': {'type': 'string'}, + 'network-config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'volume-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/VolumeAttachmentInfo'}}, + 'type': 'object'}, + 'volumes': {'items': {'$ref': '#/definitions/Volume'}, + 'type': 'array'}}, + 'required': ['tag', + 'instance-id', + 'display-name', + 'nonce', + 'characteristics', + 'volumes', + 'volume-attachments', + 'network-config', + 'charm-profiles'], + 'type': 'object'}, + 'InstancesInfo': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/InstanceInfo'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineContainerResult': {'additionalProperties': False, + 'properties': {'container-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'determined': {'type': 'boolean'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['container-types', + 'determined'], + 'type': 'object'}, + 'MachineContainerResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineContainerResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineContainers': {'additionalProperties': False, + 'properties': {'container-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'container-types'], + 'type': 'object'}, + 'MachineContainersParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MachineContainers'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MachineNetworkConfigResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}}, + 'required': ['info'], + 'type': 'object'}, + 'MachineNetworkConfigResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineNetworkConfigResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'is-default-gateway': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + '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': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'shadow-addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'vlan-tag': {'type': 'integer'}}, + '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'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + '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'}, + 'ProvisioningInfoBase': {'additionalProperties': False, + 'properties': {'charm-lxd-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'controller-config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'image-metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'placement': {'type': 'string'}, + 'series': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'type': 'array'}, + 'volumes': {'items': {'$ref': '#/definitions/VolumeParams'}, + 'type': 'array'}}, + 'required': ['constraints', + 'series', + 'placement', + 'jobs'], + 'type': 'object'}, + 'ProvisioningInfoResultV10': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ProvisioningInfoV10'}}, + 'required': ['result'], + 'type': 'object'}, + 'ProvisioningInfoResultsV10': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProvisioningInfoResultV10'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ProvisioningInfoV10': {'additionalProperties': False, + 'properties': {'ProvisioningInfoBase': {'$ref': '#/definitions/ProvisioningInfoBase'}, + 'ProvisioningNetworkTopology': {'$ref': '#/definitions/ProvisioningNetworkTopology'}, + 'charm-lxd-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'controller-config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'image-metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'placement': {'type': 'string'}, + 'series': {'type': 'string'}, + 'space-subnets': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'subnet-zones': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'type': 'array'}, + 'volumes': {'items': {'$ref': '#/definitions/VolumeParams'}, + 'type': 'array'}}, + 'required': ['constraints', + 'series', + 'placement', + 'jobs', + 'ProvisioningInfoBase', + 'subnet-zones', + 'space-subnets', + 'ProvisioningNetworkTopology'], + 'type': 'object'}, + 'ProvisioningNetworkTopology': {'additionalProperties': False, + 'properties': {'space-subnets': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'subnet-zones': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'required': ['subnet-zones', + 'space-subnets'], + 'type': 'object'}, + 'SetMachineNetworkConfig': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'config'], + 'type': 'object'}, + 'SetProfileArg': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'profiles': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['entity', 'profiles'], + 'type': 'object'}, + 'SetProfileArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetProfileArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Settings': {'additionalProperties': False, + 'properties': {'AutoNoProxy': {'type': 'string'}, + 'Ftp': {'type': 'string'}, + 'Http': {'type': 'string'}, + 'Https': {'type': 'string'}, + 'NoProxy': {'type': 'string'}}, + 'required': ['Http', + 'Https', + 'Ftp', + 'NoProxy', + 'AutoNoProxy'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'ToolsResult': {'additionalProperties': False, + 'properties': {'disable-ssl-hostname-verification': {'type': 'boolean'}, + 'error': {'$ref': '#/definitions/Error'}, + 'tools': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['tools', + 'disable-ssl-hostname-verification'], + 'type': 'object'}, + 'ToolsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ToolsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateBehavior': {'additionalProperties': False, + 'properties': {'enable-os-refresh-update': {'type': 'boolean'}, + 'enable-os-upgrade': {'type': 'boolean'}}, + 'required': ['enable-os-refresh-update', + 'enable-os-upgrade'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + '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'}, + 'Volume': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', 'info'], + 'type': 'object'}, + 'VolumeAttachmentInfo': {'additionalProperties': False, + 'properties': {'bus-address': {'type': 'string'}, + 'device-link': {'type': 'string'}, + 'device-name': {'type': 'string'}, + 'plan-info': {'$ref': '#/definitions/VolumeAttachmentPlanInfo'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'VolumeAttachmentParams': {'additionalProperties': False, + 'properties': {'instance-id': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}, + 'volume-id': {'type': 'string'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'provider'], + 'type': 'object'}, + 'VolumeAttachmentPlanInfo': {'additionalProperties': False, + 'properties': {'device-attributes': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'device-type': {'type': 'string'}}, + 'type': 'object'}, + 'VolumeInfo': {'additionalProperties': False, + 'properties': {'hardware-id': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'volume-id': {'type': 'string'}, + 'wwn': {'type': 'string'}}, + 'required': ['volume-id', 'size', 'persistent'], + 'type': 'object'}, + 'VolumeParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'size', + 'provider'], + 'type': 'object'}, + 'WatchContainer': {'additionalProperties': False, + 'properties': {'container-type': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'container-type'], + 'type': 'object'}, + 'WatchContainers': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/WatchContainer'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}}, + 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'AvailabilityZone': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CACert': {'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'Constraints': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConstraintsResults'}}, + 'type': 'object'}, + 'ContainerConfig': {'properties': {'Result': {'$ref': '#/definitions/ContainerConfig'}}, + 'type': 'object'}, + 'ContainerManagerConfig': {'properties': {'Params': {'$ref': '#/definitions/ContainerManagerConfigParams'}, + 'Result': {'$ref': '#/definitions/ContainerManagerConfig'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'DistributionGroup': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DistributionGroupResults'}}, + 'type': 'object'}, + 'DistributionGroupByMachineId': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FindTools': {'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, + 'Result': {'$ref': '#/definitions/FindToolsResult'}}, + 'type': 'object'}, + 'GetContainerInterfaceInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineNetworkConfigResults'}}, + 'type': 'object'}, + 'GetContainerProfileInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ContainerProfileResults'}}, + 'type': 'object'}, + 'HostChangesForContainers': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/HostNetworkChangeResults'}}, + 'type': 'object'}, + 'InstanceId': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'InstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'KeepInstance': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'MachinesWithTransientErrors': {'properties': {'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'MarkMachinesForRemoval': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PrepareContainerInterfaceInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineNetworkConfigResults'}}, + 'type': 'object'}, + 'ProvisioningInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ProvisioningInfoResultsV10'}}, + 'type': 'object'}, + 'ReleaseContainerAddresses': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Remove': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Series': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'SetCharmProfiles': {'properties': {'Params': {'$ref': '#/definitions/SetProfileArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetHostMachineNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetInstanceInfo': {'properties': {'Params': {'$ref': '#/definitions/InstancesInfo'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetInstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModificationStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetObservedNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetPasswords': {'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetProviderNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetSupportedContainers': {'properties': {'Params': {'$ref': '#/definitions/MachineContainersParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StateAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'Status': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'SupportedContainers': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineContainerResults'}}, + 'type': 'object'}, + 'Tools': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ToolsResults'}}, + 'type': 'object'}, + 'UpdateStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchAllContainers': {'properties': {'Params': {'$ref': '#/definitions/WatchContainers'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchContainers': {'properties': {'Params': {'$ref': '#/definitions/WatchContainers'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchMachineErrorRetry': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachineStartTimes': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='APIAddresses', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='APIHostPorts', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BytesResult) + async def CACert(self): + ''' + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='CACert', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConstraintsResults) + async def Constraints(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerConfig) + async def ContainerConfig(self): + ''' + + Returns -> ContainerConfig + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ContainerConfig', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerManagerConfig) + async def ContainerManagerConfig(self, type_=None): + ''' + 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=10, + params=_params) + _params['type'] = type_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ControllerConfig', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DistributionGroupResults) + async def DistributionGroup(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def DistributionGroupByMachineId(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindToolsResult) + async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, number=None, series=None): + ''' + agentstream : str + arch : str + major : int + minor : int + number : Number + series : 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 minor is not None and not isinstance(minor, int): + raise Exception("Expected minor to be a int, received: {}".format(type(minor))) + + if number is not None and not isinstance(number, (dict, Number)): + raise Exception("Expected number to be a Number, received: {}".format(type(number))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='FindTools', + version=10, + params=_params) + _params['agentstream'] = agentstream + _params['arch'] = arch + _params['major'] = major + _params['minor'] = minor + _params['number'] = number + _params['series'] = series + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) + async def GetContainerInterfaceInfo(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerProfileResults) + async def GetContainerProfileInfo(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(HostNetworkChangeResults) + async def HostChangesForContainers(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def InstanceStatus(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def KeepInstance(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def MachinesWithTransientErrors(self): + ''' + + Returns -> StatusResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='MachinesWithTransientErrors', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def MarkMachinesForRemoval(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelConfig', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelUUID', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) + async def PrepareContainerInterfaceInfo(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProvisioningInfoResultsV10) + async def ProvisioningInfo(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> ProvisioningInfoResultsV10 + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='ProvisioningInfo', + version=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ReleaseContainerAddresses(self, entities=None): + ''' + 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='ReleaseContainerAddresses', + version=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Remove(self, entities=None): + ''' + 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='Remove', + version=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def Series(self, entities=None): + ''' + 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='Series', + version=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmProfiles(self, args=None): + ''' + 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=10, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=10, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceInfo(self, machines=None): + ''' + 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=10, + params=_params) + _params['machines'] = machines + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceStatus(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModificationStatus(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetObservedNetworkConfig(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='SetObservedNetworkConfig', + version=10, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): + ''' + 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=10, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetProviderNetworkConfig(self, entities=None): + ''' + 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='SetProviderNetworkConfig', + version=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetSupportedContainers(self, params=None): + ''' + 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=10, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResult) + async def StateAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='StateAddresses', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def Status(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineContainerResults) + async def SupportedContainers(self, entities=None): + ''' + 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=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ToolsResults) + async def 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='Provisioner', + request='Tools', + version=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateStatus(self, entities=None): + ''' + 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='UpdateStatus', + version=10, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchAPIHostPorts', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchAllContainers(self, params=None): + ''' + 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=10, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchContainers(self, params=None): + ''' + 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=10, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchForModelConfigChanges', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchMachineErrorRetry(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchMachineErrorRetry', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachineStartTimes(self): + ''' + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchModelMachineStartTimes', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachines(self): + ''' + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchModelMachines', + version=10, + params=_params) + + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client11.py b/juju/client/old_clients/_client11.py new file mode 100644 index 000000000..db99edeb3 --- /dev/null +++ b/juju/client/old_clients/_client11.py @@ -0,0 +1,4976 @@ +# 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.old_clients._definitions import * + + +class ApplicationFacade(Type): + name = 'Application' + version = 11 + 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'}, + 'ApplicationConfigSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'generation': {'type': 'string'}}, + 'required': ['application', + 'generation', + 'config'], + 'type': 'object'}, + 'ApplicationConfigSetArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/ApplicationConfigSet'}, + 'type': 'array'}}, + 'required': ['Args'], + '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': {'application': {'type': 'string'}, + 'attach-storage': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + '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'}, + 'series': {'type': 'string'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'series', + 'charm-url', + 'channel', + 'num-units', + 'config-yaml', + 'constraints'], + 'type': 'object'}, + 'ApplicationDestroy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationExpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + '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'}, + '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'}, + 'series': {'type': 'string'}}, + 'required': ['application', + 'charm', + 'config', + 'constraints', + 'series', + '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'}, + 'ApplicationOfferDetails': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description'], + 'type': 'object'}, + 'ApplicationResult': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'exposed': {'type': 'boolean'}, + 'principal': {'type': 'boolean'}, + 'remote': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'principal', + 'exposed', + 'remote'], + 'type': 'object'}, + 'ApplicationSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'options': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', + 'branch', + 'options'], + 'type': 'object'}, + 'ApplicationSetCharm': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'config-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-settings-yaml': {'type': 'string'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'force': {'type': 'boolean'}, + 'force-series': {'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-series'], + 'type': 'object'}, + 'ApplicationUnexpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationUnset': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'options': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', + 'branch', + 'options'], + 'type': 'object'}, + 'ApplicationUpdate': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'force': {'type': 'boolean'}, + 'force-charm-url': {'type': 'boolean'}, + 'force-series': {'type': 'boolean'}, + 'generation': {'type': 'string'}, + 'min-units': {'type': 'integer'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'settings-yaml': {'type': 'string'}}, + 'required': ['application', + 'charm-url', + 'force-charm-url', + 'force-series', + 'force', + 'settings-yaml', + 'generation'], + 'type': 'object'}, + 'ApplicationsDeploy': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/ApplicationDeploy'}, + 'type': 'array'}}, + 'required': ['applications'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'ConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['config'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'ConsumeApplicationArg': {'additionalProperties': False, + 'properties': {'ApplicationOfferDetails': {'$ref': '#/definitions/ApplicationOfferDetails'}, + 'application-alias': {'type': 'string'}, + 'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + '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'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description', + 'ApplicationOfferDetails'], + 'type': 'object'}, + 'ConsumeApplicationArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ConsumeApplicationArg'}, + 'type': 'array'}}, + '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'}, + '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'}, + 'DestroyApplicationUnits': {'additionalProperties': False, + 'properties': {'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + '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'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', 'force'], + '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'}, + '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'}, + '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'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + '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'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + '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'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'UnitsResolved': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}, + 'retry': {'type': 'boolean'}, + 'tags': {'$ref': '#/definitions/Entities'}}, + 'type': 'object'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + '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': {'properties': {'Params': {'$ref': '#/definitions/AddRelation'}, + 'Result': {'$ref': '#/definitions/AddRelationResults'}}, + 'type': 'object'}, + 'AddUnits': {'properties': {'Params': {'$ref': '#/definitions/AddApplicationUnits'}, + 'Result': {'$ref': '#/definitions/AddApplicationUnitsResults'}}, + 'type': 'object'}, + 'ApplicationsInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationInfoResults'}}, + 'type': 'object'}, + 'CharmConfig': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGetArgs'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'CharmRelations': {'properties': {'Params': {'$ref': '#/definitions/ApplicationCharmRelations'}, + 'Result': {'$ref': '#/definitions/ApplicationCharmRelationsResults'}}, + 'type': 'object'}, + 'Consume': {'properties': {'Params': {'$ref': '#/definitions/ConsumeApplicationArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Deploy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationsDeploy'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}}, + 'type': 'object'}, + 'DestroyApplication': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationsParams'}, + 'Result': {'$ref': '#/definitions/DestroyApplicationResults'}}, + 'type': 'object'}, + 'DestroyConsumedApplications': {'properties': {'Params': {'$ref': '#/definitions/DestroyConsumedApplicationsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyRelation': {'properties': {'Params': {'$ref': '#/definitions/DestroyRelation'}}, + 'type': 'object'}, + 'DestroyUnit': {'properties': {'Params': {'$ref': '#/definitions/DestroyUnitsParams'}, + 'Result': {'$ref': '#/definitions/DestroyUnitResults'}}, + 'type': 'object'}, + 'DestroyUnits': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, + 'type': 'object'}, + 'Expose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationExpose'}}, + 'type': 'object'}, + 'Get': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/ApplicationGetResults'}}, + 'type': 'object'}, + 'GetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'GetConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'GetConstraints': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConstraintsResults'}}, + 'type': 'object'}, + 'MergeBindings': {'properties': {'Params': {'$ref': '#/definitions/ApplicationMergeBindingsArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ResolveUnitErrors': {'properties': {'Params': {'$ref': '#/definitions/UnitsResolved'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ScaleApplications': {'properties': {'Params': {'$ref': '#/definitions/ScaleApplicationsParams'}, + 'Result': {'$ref': '#/definitions/ScaleApplicationResults'}}, + 'type': 'object'}, + 'Set': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, + 'type': 'object'}, + 'SetApplicationsConfig': {'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigSetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharm': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, + 'type': 'object'}, + 'SetConstraints': {'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetMetricCredentials': {'properties': {'Params': {'$ref': '#/definitions/ApplicationMetricCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRelationsSuspended': {'properties': {'Params': {'$ref': '#/definitions/RelationSuspendedArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Unexpose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnexpose'}}, + 'type': 'object'}, + 'Unset': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, + 'type': 'object'}, + 'UnsetApplicationsConfig': {'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigUnsetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Update': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUpdate'}}, + 'type': 'object'}, + 'UpdateApplicationSeries': {'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddRelationResults) + async def AddRelation(self, endpoints=None, via_cidrs=None): + ''' + 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=11, + 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): + ''' + 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=11, + 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): + ''' + 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=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def CharmConfig(self, args=None): + ''' + 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=11, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationCharmRelationsResults) + async def CharmRelations(self, application=None): + ''' + 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=11, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Consume(self, args=None): + ''' + 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=11, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Deploy(self, applications=None): + ''' + 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=11, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Destroy(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Destroy', + version=11, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyApplicationResults) + async def DestroyApplication(self, applications=None): + ''' + 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=11, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyConsumedApplications(self, applications=None): + ''' + 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=11, + 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): + ''' + 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=11, + 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): + ''' + 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=11, + params=_params) + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyUnits(self, unit_names=None): + ''' + unit_names : typing.Sequence[str] + Returns -> None + ''' + if unit_names is not None and not isinstance(unit_names, (bytes, str, list)): + raise Exception("Expected unit_names to be a Sequence, received: {}".format(type(unit_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnits', + version=11, + params=_params) + _params['unit-names'] = unit_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Expose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=11, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetResults) + async def Get(self, application=None, branch=None): + ''' + 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=11, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def GetCharmURL(self, application=None, branch=None): + ''' + application : str + branch : str + Returns -> StringResult + ''' + 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='GetCharmURL', + version=11, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def GetConfig(self, entities=None): + ''' + 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=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConstraintsResults) + async def GetConstraints(self, entities=None): + ''' + 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=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def MergeBindings(self, args=None): + ''' + 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=11, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): + ''' + 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=11, + 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): + ''' + 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=11, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Set(self, application=None, branch=None, options=None): + ''' + application : str + branch : str + options : typing.Mapping[str, 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, dict): + raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Set', + version=11, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationsConfig(self, args=None): + ''' + args : typing.Sequence[~ApplicationConfigSet] + 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='SetApplicationsConfig', + version=11, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetCharm(self, application=None, channel=None, charm_url=None, config_settings=None, config_settings_yaml=None, endpoint_bindings=None, force=None, force_series=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None): + ''' + application : str + channel : str + charm_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + endpoint_bindings : typing.Mapping[str, str] + force : bool + force_series : 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_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_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + 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=11, + params=_params) + _params['application'] = application + _params['channel'] = channel + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['endpoint-bindings'] = endpoint_bindings + _params['force'] = force + _params['force-series'] = force_series + _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(None) + async def SetConstraints(self, application=None, constraints=None): + ''' + 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=11, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMetricCredentials(self, creds=None): + ''' + 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=11, + params=_params) + _params['creds'] = creds + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationsSuspended(self, args=None): + ''' + 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=11, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unexpose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=11, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unset(self, application=None, branch=None, options=None): + ''' + application : str + branch : str + options : 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, (bytes, str, list)): + raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unset', + version=11, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UnsetApplicationsConfig(self, args=None): + ''' + 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=11, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Update(self, application=None, charm_url=None, constraints=None, force=None, force_charm_url=None, force_series=None, generation=None, min_units=None, settings=None, settings_yaml=None): + ''' + application : str + charm_url : str + constraints : Value + force : bool + force_charm_url : bool + force_series : bool + generation : str + min_units : int + settings : typing.Mapping[str, str] + settings_yaml : 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 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 constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if force_charm_url is not None and not isinstance(force_charm_url, bool): + raise Exception("Expected force_charm_url to be a bool, received: {}".format(type(force_charm_url))) + + if force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + if generation is not None and not isinstance(generation, (bytes, str)): + raise Exception("Expected generation to be a str, received: {}".format(type(generation))) + + if min_units is not None and not isinstance(min_units, int): + raise Exception("Expected min_units to be a int, received: {}".format(type(min_units))) + + if settings is not None and not isinstance(settings, dict): + raise Exception("Expected settings to be a Mapping, received: {}".format(type(settings))) + + if settings_yaml is not None and not isinstance(settings_yaml, (bytes, str)): + raise Exception("Expected settings_yaml to be a str, received: {}".format(type(settings_yaml))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Update', + version=11, + params=_params) + _params['application'] = application + _params['charm-url'] = charm_url + _params['constraints'] = constraints + _params['force'] = force + _params['force-charm-url'] = force_charm_url + _params['force-series'] = force_series + _params['generation'] = generation + _params['min-units'] = min_units + _params['settings'] = settings + _params['settings-yaml'] = settings_yaml + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateApplicationSeries(self, args=None): + ''' + args : typing.Sequence[~UpdateSeriesArg] + 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='UpdateApplicationSeries', + version=11, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + +class ControllerFacade(Type): + name = 'Controller' + version = 11 + schema = {'definitions': {'AllWatcherId': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + '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'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ControllerConfigSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ControllerVersionResults': {'additionalProperties': False, + 'properties': {'git-commit': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['version', + 'git-commit'], + 'type': 'object'}, + 'DestroyControllerArgs': {'additionalProperties': False, + 'properties': {'destroy-models': {'type': 'boolean'}, + 'destroy-storage': {'type': 'boolean'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}, + 'model-timeout': {'type': 'integer'}}, + 'required': ['destroy-models'], + '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'}, + 'HostedModelConfig': {'additionalProperties': False, + 'properties': {'cloud-spec': {'$ref': '#/definitions/CloudSpec'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['name', 'owner'], + 'type': 'object'}, + 'HostedModelConfigsResults': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/HostedModelConfig'}, + 'type': 'array'}}, + 'required': ['models'], + 'type': 'object'}, + 'InitiateMigrationArgs': {'additionalProperties': False, + 'properties': {'specs': {'items': {'$ref': '#/definitions/MigrationSpec'}, + 'type': 'array'}}, + 'required': ['specs'], + 'type': 'object'}, + 'InitiateMigrationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'migration-id': {'type': 'string'}, + 'model-tag': {'type': 'string'}}, + 'required': ['model-tag', + 'migration-id'], + 'type': 'object'}, + 'InitiateMigrationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InitiateMigrationResult'}, + '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'}}, + 'type': 'object'}, + 'MigrationSpec': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'target-info': {'$ref': '#/definitions/MigrationTargetInfo'}}, + 'required': ['model-tag', 'target-info'], + 'type': 'object'}, + 'MigrationTargetInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'auth-tag': {'type': 'string'}, + 'ca-cert': {'type': 'string'}, + 'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}, + 'macaroons': {'type': 'string'}, + 'password': {'type': 'string'}}, + 'required': ['controller-tag', + 'addrs', + 'ca-cert', + 'auth-tag'], + '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'}, + 'ModelBlockInfo': {'additionalProperties': False, + 'properties': {'blocks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'model-uuid': {'type': 'string'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}}, + 'required': ['name', + 'model-uuid', + 'owner-tag', + 'blocks'], + 'type': 'object'}, + 'ModelBlockInfoList': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/ModelBlockInfo'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + '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'}, + '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'}, + 'ModelStatus': {'additionalProperties': False, + 'properties': {'application-count': {'type': 'integer'}, + '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'}, + 'ModelTag': {'additionalProperties': False, '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'}, + 'ModifyControllerAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'action': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', + 'action', + 'access'], + 'type': 'object'}, + 'ModifyControllerAccessRequest': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyControllerAccess'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoveBlocksArgs': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}}, + 'required': ['all'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'SummaryWatcherID': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'UserAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', 'access'], + 'type': 'object'}, + 'UserAccessResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/UserAccess'}}, + 'type': 'object'}, + 'UserAccessResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UserAccessResult'}, + 'type': 'array'}}, + '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': {'AllModels': {'description': 'AllModels allows controller ' + 'administrators to get the list ' + 'of all the\n' + 'models in the controller.', + 'properties': {'Result': {'$ref': '#/definitions/UserModelList'}}, + 'type': 'object'}, + 'CloudSpec': {'description': "CloudSpec returns the model's " + 'cloud spec.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ConfigSet': {'description': 'ConfigSet changes the value of ' + 'specified controller ' + 'configuration\n' + 'settings. Only some settings can ' + 'be changed after bootstrap.\n' + "Settings that aren't specified " + 'in the params are left ' + 'unchanged.', + 'properties': {'Params': {'$ref': '#/definitions/ControllerConfigSet'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'ControllerVersion': {'description': 'ControllerVersion ' + 'returns the version ' + 'information associated ' + 'with this\n' + 'controller binary.\n' + '\n' + 'NOTE: the implementation ' + 'intentionally does not ' + 'check for ' + 'SuperuserAccess\n' + 'as the Version is known ' + 'even to users with login ' + 'access.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerVersionResults'}}, + 'type': 'object'}, + 'DestroyController': {'description': 'DestroyController ' + 'destroys the ' + 'controller.\n' + '\n' + 'If the args specify the ' + 'destruction of the ' + 'models, this method ' + 'will\n' + 'attempt to do so. ' + 'Otherwise, if the ' + 'controller has any ' + 'non-empty,\n' + 'non-Dead hosted models, ' + 'then an error with the ' + 'code\n' + 'params.CodeHasHostedModels ' + 'will be transmitted.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyControllerArgs'}}, + 'type': 'object'}, + 'GetCloudSpec': {'description': 'GetCloudSpec constructs the ' + 'CloudSpec for a validated and ' + 'authorized model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetControllerAccess': {'description': 'GetControllerAccess ' + 'returns the level of ' + 'access the specified ' + 'users\n' + 'have on the ' + 'controller.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UserAccessResults'}}, + 'type': 'object'}, + 'HostedModelConfigs': {'description': 'HostedModelConfigs ' + 'returns all the ' + 'information that the ' + 'client needs in\n' + 'order to connect ' + 'directly with the host ' + "model's provider and " + 'destroy it\n' + 'directly.', + 'properties': {'Result': {'$ref': '#/definitions/HostedModelConfigsResults'}}, + 'type': 'object'}, + 'IdentityProviderURL': {'description': 'IdentityProviderURL ' + 'returns the URL of the ' + 'configured external ' + 'identity\n' + 'provider for this ' + 'controller or an empty ' + 'string if no external ' + 'identity\n' + 'provider has been ' + 'configured when the ' + 'controller was ' + 'bootstrapped.\n' + '\n' + 'NOTE: the ' + 'implementation ' + 'intentionally does not ' + 'check for ' + 'SuperuserAccess\n' + 'as the URL is known ' + 'even to users with ' + 'login access.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'InitiateMigration': {'description': 'InitiateMigration ' + 'attempts to begin the ' + 'migration of one or\n' + 'more models to other ' + 'controllers.', + 'properties': {'Params': {'$ref': '#/definitions/InitiateMigrationArgs'}, + 'Result': {'$ref': '#/definitions/InitiateMigrationResults'}}, + 'type': 'object'}, + 'ListBlockedModels': {'description': 'ListBlockedModels ' + 'returns a list of all ' + 'models on the ' + 'controller\n' + 'which have a block in ' + 'place. The resulting ' + 'slice is sorted by ' + 'model\n' + 'name, then owner. ' + 'Callers must be ' + 'controller ' + 'administrators to ' + 'retrieve the\n' + 'list.', + 'properties': {'Result': {'$ref': '#/definitions/ModelBlockInfoList'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the model ' + 'config for the controller\n' + 'model. For information on the ' + 'current model, use\n' + 'client.ModelGet', + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelStatus': {'description': 'ModelStatus returns a summary ' + 'of the model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelStatusResults'}}, + 'type': 'object'}, + 'ModifyControllerAccess': {'description': 'ModifyControllerAccess ' + 'changes the model ' + 'access granted to ' + 'users.', + 'properties': {'Params': {'$ref': '#/definitions/ModifyControllerAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'MongoVersion': {'description': 'MongoVersion allows the ' + 'introspection of the mongo ' + 'version per controller', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'RemoveBlocks': {'description': 'RemoveBlocks removes all the ' + 'blocks in the controller.', + 'properties': {'Params': {'$ref': '#/definitions/RemoveBlocksArgs'}}, + 'type': 'object'}, + 'WatchAllModelSummaries': {'description': 'WatchAllModelSummaries ' + 'starts watching the ' + 'summary updates ' + 'from the cache.\n' + 'This method is ' + 'superuser access ' + 'only, and watches ' + 'all models in the\n' + 'controller.', + 'properties': {'Result': {'$ref': '#/definitions/SummaryWatcherID'}}, + 'type': 'object'}, + 'WatchAllModels': {'description': 'WatchAllModels starts ' + 'watching events for all ' + 'models in the\n' + 'controller. The returned ' + 'AllWatcherId should be used ' + 'with Next on the\n' + 'AllModelWatcher endpoint to ' + 'receive deltas.', + 'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'description': 'WatchCloudSpecsChanges ' + 'returns a watcher ' + 'for cloud spec ' + 'changes.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchModelSummaries': {'description': 'WatchModelSummaries ' + 'starts watching the ' + 'summary updates from ' + 'the cache.\n' + 'Only models that the ' + 'user has access to are ' + 'returned.', + 'properties': {'Result': {'$ref': '#/definitions/SummaryWatcherID'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(UserModelList) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def 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 = await self.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='Controller', + request='ControllerConfig', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerVersionResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.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='Controller', + request='GetCloudSpec', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UserAccessResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(HostedModelConfigsResults) + async def 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 = await self.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 + 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(InitiateMigrationResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelBlockInfoList) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResults) + async def 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 = 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='Controller', + request='ModelStatus', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(SummaryWatcherID) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(AllWatcherId) + async def 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 = await self.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='Controller', + request='WatchCloudSpecsChanges', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SummaryWatcherID) + async def 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 = await self.rpc(msg) + return reply + + + +class ProvisionerFacade(Type): + name = 'Provisioner' + version = 11 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + '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'}, + 'Binary': {'additionalProperties': False, + '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'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build', + 'Number', + 'Release', + 'Arch'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CloudImageMetadata': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'image-id': {'type': 'string'}, + 'priority': {'type': 'integer'}, + 'region': {'type': 'string'}, + 'root-storage-size': {'type': 'integer'}, + 'root-storage-type': {'type': 'string'}, + 'series': {'type': 'string'}, + 'source': {'type': 'string'}, + 'stream': {'type': 'string'}, + 'version': {'type': 'string'}, + 'virt-type': {'type': 'string'}}, + 'required': ['image-id', + 'region', + 'version', + 'series', + 'arch', + 'source', + 'priority'], + 'type': 'object'}, + 'ConstraintsResult': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'ConstraintsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConstraintsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ContainerConfig': {'additionalProperties': False, + 'properties': {'UpdateBehavior': {'$ref': '#/definitions/UpdateBehavior'}, + 'apt-mirror': {'type': 'string'}, + 'apt-proxy': {'$ref': '#/definitions/Settings'}, + 'authorized-keys': {'type': 'string'}, + 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + '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'}}, + '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'], + 'type': 'object'}, + 'ContainerLXDProfile': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'profile': {'$ref': '#/definitions/CharmLXDProfile'}}, + 'required': ['profile', 'name'], + 'type': 'object'}, + 'ContainerManagerConfig': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ContainerManagerConfigParams': {'additionalProperties': False, + 'properties': {'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'ContainerProfileResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'lxd-profiles': {'items': {'$ref': '#/definitions/ContainerLXDProfile'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ContainerProfileResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ContainerProfileResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'DeviceBridgeInfo': {'additionalProperties': False, + 'properties': {'bridge-name': {'type': 'string'}, + 'host-device-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['host-device-name', + 'bridge-name', + 'mac-address'], + 'type': 'object'}, + 'DistributionGroupResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'DistributionGroupResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/DistributionGroupResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'FindToolsParams': {'additionalProperties': False, + 'properties': {'agentstream': {'type': 'string'}, + 'arch': {'type': 'string'}, + 'major': {'type': 'integer'}, + 'minor': {'type': 'integer'}, + 'number': {'$ref': '#/definitions/Number'}, + 'os-type': {'type': 'string'}, + 'series': {'type': 'string'}}, + 'required': ['number', + 'major', + 'minor', + 'arch', + 'series', + 'os-type', + 'agentstream'], + 'type': 'object'}, + 'FindToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'list': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['list'], + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'root-disk-source': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'HostNetworkChange': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'new-bridges': {'items': {'$ref': '#/definitions/DeviceBridgeInfo'}, + 'type': 'array'}, + 'reconfigure-delay': {'type': 'integer'}}, + 'required': ['new-bridges', + 'reconfigure-delay'], + 'type': 'object'}, + 'HostNetworkChangeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/HostNetworkChange'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + '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'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'InstanceInfo': {'additionalProperties': False, + 'properties': {'characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'charm-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'display-name': {'type': 'string'}, + 'instance-id': {'type': 'string'}, + 'network-config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'volume-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/VolumeAttachmentInfo'}}, + 'type': 'object'}, + 'volumes': {'items': {'$ref': '#/definitions/Volume'}, + 'type': 'array'}}, + 'required': ['tag', + 'instance-id', + 'display-name', + 'nonce', + 'characteristics', + 'volumes', + 'volume-attachments', + 'network-config', + 'charm-profiles'], + 'type': 'object'}, + 'InstancesInfo': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/InstanceInfo'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineContainerResult': {'additionalProperties': False, + 'properties': {'container-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'determined': {'type': 'boolean'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['container-types', + 'determined'], + 'type': 'object'}, + 'MachineContainerResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineContainerResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineContainers': {'additionalProperties': False, + 'properties': {'container-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'container-types'], + 'type': 'object'}, + 'MachineContainersParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MachineContainers'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MachineNetworkConfigResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}}, + 'required': ['info'], + 'type': 'object'}, + 'MachineNetworkConfigResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineNetworkConfigResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'is-default-gateway': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + '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': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'shadow-addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'virtual-port-type': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}}, + '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'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + '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'}, + 'ProvisioningInfoBase': {'additionalProperties': False, + 'properties': {'charm-lxd-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'controller-config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'image-metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'placement': {'type': 'string'}, + 'root-disk': {'$ref': '#/definitions/VolumeParams'}, + 'series': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'type': 'array'}, + 'volumes': {'items': {'$ref': '#/definitions/VolumeParams'}, + 'type': 'array'}}, + 'required': ['constraints', + 'series', + 'placement', + 'jobs'], + 'type': 'object'}, + 'ProvisioningInfoResultV10': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ProvisioningInfoV10'}}, + 'required': ['result'], + 'type': 'object'}, + 'ProvisioningInfoResultsV10': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProvisioningInfoResultV10'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ProvisioningInfoV10': {'additionalProperties': False, + 'properties': {'ProvisioningInfoBase': {'$ref': '#/definitions/ProvisioningInfoBase'}, + 'ProvisioningNetworkTopology': {'$ref': '#/definitions/ProvisioningNetworkTopology'}, + 'charm-lxd-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'controller-config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'image-metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'placement': {'type': 'string'}, + 'root-disk': {'$ref': '#/definitions/VolumeParams'}, + 'series': {'type': 'string'}, + 'space-subnets': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'subnet-zones': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'type': 'array'}, + 'volumes': {'items': {'$ref': '#/definitions/VolumeParams'}, + 'type': 'array'}}, + 'required': ['constraints', + 'series', + 'placement', + 'jobs', + 'ProvisioningInfoBase', + 'subnet-zones', + 'space-subnets', + 'ProvisioningNetworkTopology'], + 'type': 'object'}, + 'ProvisioningNetworkTopology': {'additionalProperties': False, + 'properties': {'space-subnets': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'subnet-zones': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'required': ['subnet-zones', + 'space-subnets'], + 'type': 'object'}, + 'SetMachineNetworkConfig': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'config'], + 'type': 'object'}, + 'SetProfileArg': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'profiles': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['entity', 'profiles'], + 'type': 'object'}, + 'SetProfileArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetProfileArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Settings': {'additionalProperties': False, + 'properties': {'AutoNoProxy': {'type': 'string'}, + 'Ftp': {'type': 'string'}, + 'Http': {'type': 'string'}, + 'Https': {'type': 'string'}, + 'NoProxy': {'type': 'string'}}, + 'required': ['Http', + 'Https', + 'Ftp', + 'NoProxy', + 'AutoNoProxy'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'ToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'tools': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['tools'], + 'type': 'object'}, + 'ToolsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ToolsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateBehavior': {'additionalProperties': False, + 'properties': {'enable-os-refresh-update': {'type': 'boolean'}, + 'enable-os-upgrade': {'type': 'boolean'}}, + 'required': ['enable-os-refresh-update', + 'enable-os-upgrade'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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'}, + 'Volume': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', 'info'], + 'type': 'object'}, + 'VolumeAttachmentInfo': {'additionalProperties': False, + 'properties': {'bus-address': {'type': 'string'}, + 'device-link': {'type': 'string'}, + 'device-name': {'type': 'string'}, + 'plan-info': {'$ref': '#/definitions/VolumeAttachmentPlanInfo'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'VolumeAttachmentParams': {'additionalProperties': False, + 'properties': {'instance-id': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}, + 'volume-id': {'type': 'string'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'provider'], + 'type': 'object'}, + 'VolumeAttachmentPlanInfo': {'additionalProperties': False, + 'properties': {'device-attributes': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'device-type': {'type': 'string'}}, + 'type': 'object'}, + 'VolumeInfo': {'additionalProperties': False, + 'properties': {'hardware-id': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'volume-id': {'type': 'string'}, + 'wwn': {'type': 'string'}}, + 'required': ['volume-id', 'size', 'persistent'], + 'type': 'object'}, + 'VolumeParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'size', + 'provider'], + 'type': 'object'}, + 'WatchContainer': {'additionalProperties': False, + 'properties': {'container-type': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'container-type'], + 'type': 'object'}, + 'WatchContainers': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/WatchContainer'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'AvailabilityZone': {'description': 'AvailabilityZone returns ' + 'a provider-specific ' + 'availability zone for ' + 'each given machine entity', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CACert': {'description': 'CACert returns the certificate used ' + 'to validate the state connection.', + 'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'Constraints': {'description': 'Constraints returns the ' + 'constraints for each given ' + 'machine entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConstraintsResults'}}, + 'type': 'object'}, + 'ContainerConfig': {'description': 'ContainerConfig returns ' + 'information from the model ' + 'config that is\n' + 'needed for container ' + 'cloud-init.', + 'properties': {'Result': {'$ref': '#/definitions/ContainerConfig'}}, + 'type': 'object'}, + 'ContainerManagerConfig': {'description': 'ContainerManagerConfig ' + 'returns information ' + 'from the model ' + 'config that is\n' + 'needed for ' + 'configuring the ' + 'container manager.', + 'properties': {'Params': {'$ref': '#/definitions/ContainerManagerConfigParams'}, + 'Result': {'$ref': '#/definitions/ContainerManagerConfig'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'DistributionGroup': {'description': 'DistributionGroup ' + 'returns, for each given ' + 'machine entity,\n' + 'a slice of instance.Ids ' + 'that belong to the same ' + 'distribution\n' + 'group as that machine. ' + 'This information may be ' + 'used to\n' + 'distribute instances for ' + 'high availability.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DistributionGroupResults'}}, + 'type': 'object'}, + 'DistributionGroupByMachineId': {'description': 'DistributionGroupByMachineId ' + 'returns, for ' + 'each given ' + 'machine ' + 'entity,\n' + 'a slice of ' + 'machine.Ids ' + 'that belong ' + 'to the same ' + 'distribution\n' + 'group as that ' + 'machine. This ' + 'information ' + 'may be used ' + 'to\n' + 'distribute ' + 'instances for ' + 'high ' + 'availability.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'EnsureDead': {'description': 'EnsureDead calls EnsureDead on ' + 'each given entity from state. ' + 'It\n' + 'will fail if the entity is not ' + "present. If it's Alive, nothing " + 'will\n' + 'happen (see state/EnsureDead() ' + 'for units or machines).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FindTools': {'description': 'FindTools returns a List ' + 'containing all tools matching ' + 'the given parameters.', + 'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, + 'Result': {'$ref': '#/definitions/FindToolsResult'}}, + 'type': 'object'}, + 'GetContainerInterfaceInfo': {'description': 'GetContainerInterfaceInfo ' + 'returns ' + 'information to ' + 'configure ' + 'networking for ' + 'a\n' + 'container. It ' + 'accepts ' + 'container tags ' + 'as arguments.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineNetworkConfigResults'}}, + 'type': 'object'}, + 'GetContainerProfileInfo': {'description': 'GetContainerProfileInfo ' + 'returns ' + 'information to ' + 'configure a lxd ' + 'profile(s) for a\n' + 'container based on ' + 'the charms ' + 'deployed to the ' + 'container. It ' + 'accepts container\n' + 'tags as arguments. ' + 'Unlike ' + 'machineLXDProfileNames ' + 'which has the ' + 'environ\n' + 'write the lxd ' + 'profiles and ' + 'returns the names ' + 'of profiles ' + 'already written.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ContainerProfileResults'}}, + 'type': 'object'}, + 'HostChangesForContainers': {'description': 'HostChangesForContainers ' + 'returns the set ' + 'of changes that ' + 'need to be done\n' + 'to the host ' + 'machine to ' + 'prepare it for ' + 'the containers to ' + 'be created.\n' + 'Pass in a list of ' + 'the containers ' + 'that you want the ' + 'changes for.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/HostNetworkChangeResults'}}, + 'type': 'object'}, + 'InstanceId': {'description': 'InstanceId returns the provider ' + 'specific instance id for each ' + 'given\n' + 'machine or an ' + 'CodeNotProvisioned error, if ' + 'not set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'InstanceStatus': {'description': 'InstanceStatus returns the ' + 'instance status for each ' + 'given entity.\n' + 'Only machine tags are ' + 'accepted.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'KeepInstance': {'description': 'KeepInstance returns the ' + 'keep-instance value for each ' + 'given machine entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'MachinesWithTransientErrors': {'description': 'MachinesWithTransientErrors ' + 'returns status ' + 'data for ' + 'machines with ' + 'provisioning\n' + 'errors which ' + 'are transient.', + 'properties': {'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'MarkMachinesForRemoval': {'description': 'MarkMachinesForRemoval ' + 'indicates that the ' + 'specified machines ' + 'are\n' + 'ready to have any ' + 'provider-level ' + 'resources cleaned ' + 'up and then be\n' + 'removed.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' + 'that the current connection is ' + 'for.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PrepareContainerInterfaceInfo': {'description': 'PrepareContainerInterfaceInfo ' + 'allocates an ' + 'address and ' + 'returns ' + 'information ' + 'to\n' + 'configure ' + 'networking ' + 'for a ' + 'container. ' + 'It accepts ' + 'container ' + 'tags as ' + 'arguments.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineNetworkConfigResults'}}, + 'type': 'object'}, + 'ProvisioningInfo': {'description': 'ProvisioningInfo returns ' + 'the provisioning ' + 'information for each ' + 'given machine entity.\n' + 'It supports all positive ' + 'space constraints.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ProvisioningInfoResultsV10'}}, + 'type': 'object'}, + 'ReleaseContainerAddresses': {'description': 'ReleaseContainerAddresses ' + 'finds addresses ' + 'allocated to a ' + 'container and ' + 'marks\n' + 'them as Dead, to ' + 'be released and ' + 'removed. It ' + 'accepts ' + 'container tags ' + 'as\n' + 'arguments.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Remove': {'description': 'Remove removes every given entity ' + 'from state, calling EnsureDead\n' + 'first, then Remove. It will fail if ' + 'the entity is not present.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Series': {'description': 'Series returns the deployed series ' + 'for each given machine entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'SetCharmProfiles': {'description': 'SetCharmProfiles records ' + 'the given slice of charm ' + 'profile names.', + 'properties': {'Params': {'$ref': '#/definitions/SetProfileArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetHostMachineNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetInstanceInfo': {'description': 'SetInstanceInfo sets the ' + 'provider specific machine ' + 'id, nonce,\n' + 'metadata and network info ' + 'for each given machine. ' + 'Once set, the\n' + 'instance id cannot be ' + 'changed.', + 'properties': {'Params': {'$ref': '#/definitions/InstancesInfo'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetInstanceStatus': {'description': 'SetInstanceStatus ' + 'updates the instance ' + 'status for each given\n' + 'entity. Only machine ' + 'tags are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModificationStatus': {'description': 'SetModificationStatus ' + 'updates the instance ' + 'whilst changes are ' + 'occurring. This\n' + 'is different from ' + 'SetStatus and ' + 'SetInstanceStatus, ' + 'by the fact this ' + 'holds\n' + 'information about ' + 'the ongoing changes ' + 'that are happening ' + 'to instances.\n' + 'Consider LXD Profile ' + 'updates that can ' + 'modify a instance, ' + 'but may not cause\n' + 'the instance to be ' + 'placed into a error ' + 'state. This ' + 'modification status\n' + 'serves the purpose ' + 'of highlighting that ' + 'to the operator.\n' + 'Only machine tags ' + 'are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetObservedNetworkConfig': {'description': 'SetObservedNetworkConfig ' + 'reads the network ' + 'config for the ' + 'machine\n' + 'identified by the ' + 'input args.\n' + 'This config is ' + 'merged with the ' + 'new network ' + 'config supplied ' + 'in the\n' + 'same args and ' + 'updated if it has ' + 'changed.', + 'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetPasswords': {'description': 'SetPasswords sets the given ' + 'password for each supplied ' + 'entity, if possible.', + 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the status of ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetSupportedContainers': {'description': 'SetSupportedContainers ' + 'updates the list of ' + 'containers ' + 'supported by the ' + 'machines passed in ' + 'args.', + 'properties': {'Params': {'$ref': '#/definitions/MachineContainersParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Status': {'description': 'Status returns the status of each ' + 'given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'SupportedContainers': {'description': 'SupportedContainers ' + 'returns the list of ' + 'containers supported ' + 'by the machines passed ' + 'in args.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineContainerResults'}}, + 'type': 'object'}, + 'Tools': {'description': 'Tools finds the tools necessary for ' + 'the given agents.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ToolsResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchAllContainers': {'description': 'WatchAllContainers ' + 'starts a StringsWatcher ' + 'to watch all containers ' + 'deployed to\n' + 'any machine passed in ' + 'args.', + 'properties': {'Params': {'$ref': '#/definitions/WatchContainers'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchContainers': {'description': 'WatchContainers starts a ' + 'StringsWatcher to watch ' + 'containers deployed to\n' + 'any machine passed in ' + 'args.', + 'properties': {'Params': {'$ref': '#/definitions/WatchContainers'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchMachineErrorRetry': {'description': 'WatchMachineErrorRetry ' + 'returns a ' + 'NotifyWatcher that ' + 'notifies when\n' + 'the provisioner ' + 'should retry ' + 'provisioning ' + 'machines with ' + 'transient errors.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachineStartTimes': {'description': 'WatchModelMachineStartTimes ' + 'watches the ' + 'non-container ' + 'machines in ' + 'the model\n' + 'for changes to ' + 'the Life or ' + 'AgentStartTime ' + 'fields and ' + 'reports them ' + 'as a batch.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'description': 'WatchModelMachines ' + 'returns a ' + 'StringsWatcher that ' + 'notifies of\n' + 'changes to the life ' + 'cycles of the top level ' + 'machines in the ' + 'current\n' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def 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 = await self.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='Provisioner', + request='APIHostPorts', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def 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 = 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='Provisioner', + request='CACert', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConstraintsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerConfig) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerManagerConfig) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def 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 = await self.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='Provisioner', + request='ControllerConfig', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DistributionGroupResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindToolsResult) + async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, number=None, os_type=None, series=None): + ''' + FindTools returns a List containing all tools matching the given parameters. + + agentstream : str + arch : str + major : int + minor : int + number : Number + os_type : str + series : 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 minor is not None and not isinstance(minor, int): + raise Exception("Expected minor to be a int, received: {}".format(type(minor))) + + 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))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + # 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['minor'] = minor + _params['number'] = number + _params['os-type'] = os_type + _params['series'] = series + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerProfileResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(HostNetworkChangeResults) + async def 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 = await self.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='Provisioner', + request='InstanceId', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.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. + + 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def 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 = await self.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='Provisioner', + request='Life', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def 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 = await self.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) + 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) + 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) + async def 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) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProvisioningInfoResultsV10) + async def ProvisioningInfo(self, entities=None): + ''' + ProvisioningInfo returns the provisioning information for each given machine entity. + It supports all positive space constraints. + + entities : typing.Sequence[~Entity] + Returns -> ProvisioningInfoResultsV10 + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='ProvisioningInfo', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ReleaseContainerAddresses(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. + + 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='ReleaseContainerAddresses', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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='Provisioner', + request='Remove', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def Series(self, entities=None): + ''' + Series returns the deployed series 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='Series', + version=11, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.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='Provisioner', + request='SetPasswords', + version=11, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineContainerResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ToolsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.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='Provisioner', + request='WatchForModelConfigChanges', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + + @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='Provisioner', + request='WatchModelMachineStartTimes', + version=11, + params=_params) + + reply = await self.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='Provisioner', + request='WatchModelMachines', + version=11, + params=_params) + + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client12.py b/juju/client/old_clients/_client12.py new file mode 100644 index 000000000..959f21cb9 --- /dev/null +++ b/juju/client/old_clients/_client12.py @@ -0,0 +1,4508 @@ +# 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.old_clients._definitions import * + + +class ApplicationFacade(Type): + name = 'Application' + version = 12 + 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'}, + 'ApplicationConfigSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'generation': {'type': 'string'}}, + 'required': ['application', + 'generation', + 'config'], + 'type': 'object'}, + 'ApplicationConfigSetArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/ApplicationConfigSet'}, + 'type': 'array'}}, + 'required': ['Args'], + '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': {'application': {'type': 'string'}, + 'attach-storage': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + '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'}, + 'series': {'type': 'string'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'series', + 'charm-url', + 'channel', + 'num-units', + 'config-yaml', + 'constraints'], + 'type': 'object'}, + 'ApplicationDestroy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationExpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + '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'}, + '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'}, + 'series': {'type': 'string'}}, + 'required': ['application', + 'charm', + 'config', + 'constraints', + 'series', + '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'}, + 'ApplicationOfferDetails': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description'], + 'type': 'object'}, + 'ApplicationResult': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'exposed': {'type': 'boolean'}, + 'principal': {'type': 'boolean'}, + 'remote': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'principal', + 'exposed', + 'remote'], + 'type': 'object'}, + 'ApplicationSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'options': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', + 'branch', + 'options'], + 'type': 'object'}, + 'ApplicationSetCharm': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'config-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-settings-yaml': {'type': 'string'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'force': {'type': 'boolean'}, + 'force-series': {'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-series'], + 'type': 'object'}, + 'ApplicationUnexpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationUnset': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'options': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', + 'branch', + 'options'], + 'type': 'object'}, + 'ApplicationUpdate': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'force': {'type': 'boolean'}, + 'force-charm-url': {'type': 'boolean'}, + 'force-series': {'type': 'boolean'}, + 'generation': {'type': 'string'}, + 'min-units': {'type': 'integer'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'settings-yaml': {'type': 'string'}}, + 'required': ['application', + 'charm-url', + 'force-charm-url', + 'force-series', + 'force', + 'settings-yaml', + 'generation'], + 'type': 'object'}, + 'ApplicationsDeploy': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/ApplicationDeploy'}, + 'type': 'array'}}, + 'required': ['applications'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'ConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['config'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'ConsumeApplicationArg': {'additionalProperties': False, + 'properties': {'ApplicationOfferDetails': {'$ref': '#/definitions/ApplicationOfferDetails'}, + 'application-alias': {'type': 'string'}, + 'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + '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'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description', + 'ApplicationOfferDetails'], + 'type': 'object'}, + 'ConsumeApplicationArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ConsumeApplicationArg'}, + 'type': 'array'}}, + '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'}, + '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'}, + 'DestroyApplicationUnits': {'additionalProperties': False, + 'properties': {'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + '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'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', 'force'], + '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'}, + 'unit-relation-data': {'patternProperties': {'.*': {'$ref': '#/definitions/RelationData'}}, + 'type': 'object'}}, + 'required': ['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'}, + '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'}, + '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'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + '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'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + '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'}, + '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'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + '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/ConsumeApplicationArgs'}, + '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'}, + 'Destroy': {'description': 'Destroy destroys a given ' + 'application, local or remote.\n' + '\n' + 'NOTE(axw) this exists only for ' + 'backwards compatibility,\n' + 'for API facade versions 1-3; ' + 'clients should prefer its\n' + 'successor, DestroyApplication, ' + 'below. Until all consumers\n' + 'have been updated, or we bump a ' + "major version, we can't\n" + 'drop this.\n' + '\n' + 'TODO(axw) 2017-03-16 #1673323\n' + 'Drop this in Juju 3.0.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}}, + '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'}, + 'DestroyUnits': {'description': 'DestroyUnits removes a given ' + 'set of application units.\n' + '\n' + 'NOTE(axw) this exists only ' + 'for backwards compatibility,\n' + 'for API facade versions 1-3; ' + 'clients should prefer its\n' + 'successor, DestroyUnit, ' + 'below. Until all consumers ' + 'have\n' + 'been updated, or we bump a ' + "major version, we can't drop\n" + 'this.\n' + '\n' + 'TODO(axw) 2017-03-16 ' + '#1673323\n' + 'Drop this in Juju 3.0.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, + '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'}, + 'GetCharmURL': {'description': 'GetCharmURL returns the charm ' + 'URL the given application is\n' + 'running at present.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + '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'}, + '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'}, + 'Set': {'description': 'Set implements the server side of ' + 'Application.Set.\n' + 'It does not unset values that are set ' + 'to an empty string.\n' + 'Unset should be used for that.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, + 'type': 'object'}, + 'SetApplicationsConfig': {'description': 'SetApplicationsConfig ' + 'implements the ' + 'server side of ' + 'Application.SetApplicationsConfig.\n' + 'It does not unset ' + 'values that are set ' + 'to an empty string.\n' + 'Unset should be used ' + 'for that.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigSetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharm': {'description': 'SetCharm sets the charm for a ' + 'given for the application.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, + '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.', + '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.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitInfoResults'}}, + 'type': 'object'}, + 'Unset': {'description': 'Unset implements the server side of ' + 'Client.Unset.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, + 'type': 'object'}, + 'UnsetApplicationsConfig': {'description': 'UnsetApplicationsConfig ' + 'implements the ' + 'server side of ' + 'Application.UnsetApplicationsConfig.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigUnsetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Update': {'description': 'Update updates the application ' + 'attributes, including charm URL,\n' + 'minimum number of units, charm ' + 'config and constraints.\n' + 'All parameters in ' + 'params.ApplicationUpdate except the ' + 'application name are optional.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationUpdate'}}, + 'type': 'object'}, + 'UpdateApplicationSeries': {'description': 'UpdateApplicationSeries ' + 'updates the ' + 'application ' + 'series. Series ' + 'for\n' + 'subordinates ' + 'updated too.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + '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=12, + 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=12, + 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=12, + 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=12, + 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=12, + 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[~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=12, + 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=12, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Destroy(self, application=None): + ''' + Destroy destroys a given application, local or remote. + + NOTE(axw) this exists only for backwards compatibility, + for API facade versions 1-3; clients should prefer its + successor, DestroyApplication, below. Until all consumers + have been updated, or we bump a major version, we can't + drop this. + + TODO(axw) 2017-03-16 #1673323 + Drop this in Juju 3.0. + + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Destroy', + version=12, + params=_params) + _params['application'] = application + 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=12, + 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=12, + 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=12, + 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=12, + params=_params) + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyUnits(self, unit_names=None): + ''' + DestroyUnits removes a given set of application units. + + NOTE(axw) this exists only for backwards compatibility, + for API facade versions 1-3; clients should prefer its + successor, DestroyUnit, below. Until all consumers have + been updated, or we bump a major version, we can't drop + this. + + TODO(axw) 2017-03-16 #1673323 + Drop this in Juju 3.0. + + unit_names : typing.Sequence[str] + Returns -> None + ''' + if unit_names is not None and not isinstance(unit_names, (bytes, str, list)): + raise Exception("Expected unit_names to be a Sequence, received: {}".format(type(unit_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnits', + version=12, + params=_params) + _params['unit-names'] = unit_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Expose(self, application=None): + ''' + Expose changes the juju-managed firewall to expose any ports that + were also explicitly marked by units as open. + + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=12, + params=_params) + _params['application'] = application + 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=12, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def GetCharmURL(self, application=None, branch=None): + ''' + GetCharmURL returns the charm URL the given application is + running at present. + + application : str + branch : str + Returns -> StringResult + ''' + 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='GetCharmURL', + version=12, + 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=12, + 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=12, + params=_params) + _params['entities'] = entities + 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=12, + 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=12, + 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=12, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Set(self, application=None, branch=None, options=None): + ''' + Set implements the server side of Application.Set. + It does not unset values that are set to an empty string. + Unset should be used for that. + + application : str + branch : str + options : typing.Mapping[str, 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, dict): + raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Set', + version=12, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationsConfig(self, args=None): + ''' + SetApplicationsConfig implements the server side of Application.SetApplicationsConfig. + It does not unset values that are set to an empty string. + Unset should be used for that. + + args : typing.Sequence[~ApplicationConfigSet] + 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='SetApplicationsConfig', + version=12, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetCharm(self, application=None, channel=None, charm_url=None, config_settings=None, config_settings_yaml=None, endpoint_bindings=None, force=None, force_series=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_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + endpoint_bindings : typing.Mapping[str, str] + force : bool + force_series : 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_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_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + 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=12, + params=_params) + _params['application'] = application + _params['channel'] = channel + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['endpoint-bindings'] = endpoint_bindings + _params['force'] = force + _params['force-series'] = force_series + _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(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=12, + 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. + + 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=12, + 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=12, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unexpose(self, application=None): + ''' + Unexpose changes the juju-managed firewall to unexpose any ports that + were also explicitly marked by units as open. + + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=12, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitInfoResults) + async def UnitsInfo(self, entities=None): + ''' + UnitsInfo returns unit information. + + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unset(self, application=None, branch=None, options=None): + ''' + Unset implements the server side of Client.Unset. + + application : str + branch : str + options : 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, (bytes, str, list)): + raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unset', + version=12, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + 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=12, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Update(self, application=None, charm_url=None, constraints=None, force=None, force_charm_url=None, force_series=None, generation=None, min_units=None, settings=None, settings_yaml=None): + ''' + Update updates the application attributes, including charm URL, + minimum number of units, charm config and constraints. + All parameters in params.ApplicationUpdate except the application name are optional. + + application : str + charm_url : str + constraints : Value + force : bool + force_charm_url : bool + force_series : bool + generation : str + min_units : int + settings : typing.Mapping[str, str] + settings_yaml : 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 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 constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if force_charm_url is not None and not isinstance(force_charm_url, bool): + raise Exception("Expected force_charm_url to be a bool, received: {}".format(type(force_charm_url))) + + if force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + if generation is not None and not isinstance(generation, (bytes, str)): + raise Exception("Expected generation to be a str, received: {}".format(type(generation))) + + if min_units is not None and not isinstance(min_units, int): + raise Exception("Expected min_units to be a int, received: {}".format(type(min_units))) + + if settings is not None and not isinstance(settings, dict): + raise Exception("Expected settings to be a Mapping, received: {}".format(type(settings))) + + if settings_yaml is not None and not isinstance(settings_yaml, (bytes, str)): + raise Exception("Expected settings_yaml to be a str, received: {}".format(type(settings_yaml))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Update', + version=12, + params=_params) + _params['application'] = application + _params['charm-url'] = charm_url + _params['constraints'] = constraints + _params['force'] = force + _params['force-charm-url'] = force_charm_url + _params['force-series'] = force_series + _params['generation'] = generation + _params['min-units'] = min_units + _params['settings'] = settings + _params['settings-yaml'] = settings_yaml + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateApplicationSeries(self, args=None): + ''' + UpdateApplicationSeries updates the application series. Series for + subordinates updated too. + + args : typing.Sequence[~UpdateSeriesArg] + 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='UpdateApplicationSeries', + version=12, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + +class UniterFacade(Type): + name = 'Uniter' + version = 12 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionExecutionResult': {'additionalProperties': False, + 'properties': {'action-tag': {'type': 'string'}, + 'message': {'type': 'string'}, + 'results': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'status': {'type': 'string'}}, + 'required': ['action-tag', 'status'], + 'type': 'object'}, + 'ActionExecutionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionExecutionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'ApplicationStatusResult': {'additionalProperties': False, + 'properties': {'application': {'$ref': '#/definitions/StatusResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/StatusResult'}}, + 'type': 'object'}}, + 'required': ['application', + 'units'], + 'type': 'object'}, + 'ApplicationStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'CharmURLs': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/CharmURL'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'ConfigSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'ConfigSettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConfigSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Endpoint': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'relation': {'$ref': '#/definitions/CharmRelation'}}, + 'required': ['application-name', 'relation'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesCharmURL': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityCharmURL'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesPortRanges': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityCharmURL': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'charm-url'], + 'type': 'object'}, + 'EntityPortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['tag', + 'protocol', + 'from-port', + 'to-port'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'EntityString': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['tag', 'value'], + 'type': 'object'}, + 'EntityWorkloadVersion': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'workload-version': {'type': 'string'}}, + 'required': ['tag', + 'workload-version'], + 'type': 'object'}, + 'EntityWorkloadVersions': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityWorkloadVersion'}, + 'type': 'array'}}, + 'required': ['entities'], + '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'}, + 'GetLeadershipSettingsBulkResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GetLeadershipSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'GoalState': {'additionalProperties': False, + 'properties': {'relations': {'patternProperties': {'.*': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'required': ['units', 'relations'], + 'type': 'object'}, + 'GoalStateResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/GoalState'}}, + 'required': ['result', 'error'], + 'type': 'object'}, + 'GoalStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GoalStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GoalStateStatus': {'additionalProperties': False, + 'properties': {'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'since'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'InterfaceAddress': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'hostname': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['hostname', 'value', 'cidr'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachinePortRange': {'additionalProperties': False, + 'properties': {'port-range': {'$ref': '#/definitions/PortRange'}, + 'relation-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-tag', + 'port-range'], + 'type': 'object'}, + 'MachinePortsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ports': {'items': {'$ref': '#/definitions/MachinePortRange'}, + 'type': 'array'}}, + 'required': ['ports'], + 'type': 'object'}, + 'MachinePortsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachinePortsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MergeLeadershipSettingsBulkParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MergeLeadershipSettingsParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MergeLeadershipSettingsParam': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['settings'], + 'type': 'object'}, + 'MeterStatusResult': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}}, + 'required': ['code', 'info'], + 'type': 'object'}, + 'MeterStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Metric': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'labels': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['key', 'value', 'time'], + 'type': 'object'}, + 'MetricBatch': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'created': {'format': 'date-time', + 'type': 'string'}, + 'metrics': {'items': {'$ref': '#/definitions/Metric'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'charm-url', + 'created', + 'metrics'], + 'type': 'object'}, + 'MetricBatchParam': {'additionalProperties': False, + 'properties': {'batch': {'$ref': '#/definitions/MetricBatch'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'batch'], + 'type': 'object'}, + 'MetricBatchParams': {'additionalProperties': False, + 'properties': {'batches': {'items': {'$ref': '#/definitions/MetricBatchParam'}, + 'type': 'array'}}, + 'required': ['batches'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'type'], + 'type': 'object'}, + 'NetworkInfo': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/InterfaceAddress'}, + 'type': 'array'}, + 'interface-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['mac-address', + 'interface-name', + 'addresses'], + 'type': 'object'}, + 'NetworkInfoParams': {'additionalProperties': False, + 'properties': {'bindings': {'items': {'type': 'string'}, + 'type': 'array'}, + 'relation-id': {'type': 'integer'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'bindings'], + 'type': 'object'}, + 'NetworkInfoResult': {'additionalProperties': False, + 'properties': {'bind-addresses': {'items': {'$ref': '#/definitions/NetworkInfo'}, + 'type': 'array'}, + 'egress-subnets': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'ingress-addresses': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'NetworkInfoResults': {'additionalProperties': False, + 'properties': {'results': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInfoResult'}}, + 'type': 'object'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'RelationIds': {'additionalProperties': False, + 'properties': {'relation-ids': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['relation-ids'], + 'type': 'object'}, + 'RelationResult': {'additionalProperties': False, + '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'}}, + 'required': ['life', + 'id', + 'key', + 'endpoint'], + 'type': 'object'}, + 'RelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationStatusArg': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'relation-id': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-id', + 'status', + 'message'], + 'type': 'object'}, + 'RelationStatusArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RelationStatusArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'RelationUnit': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', 'unit'], + 'type': 'object'}, + 'RelationUnitPair': {'additionalProperties': False, + 'properties': {'local-unit': {'type': 'string'}, + 'relation': {'type': 'string'}, + 'remote-unit': {'type': 'string'}}, + 'required': ['relation', + 'local-unit', + 'remote-unit'], + 'type': 'object'}, + 'RelationUnitPairs': {'additionalProperties': False, + 'properties': {'relation-unit-pairs': {'items': {'$ref': '#/definitions/RelationUnitPair'}, + 'type': 'array'}}, + 'required': ['relation-unit-pairs'], + 'type': 'object'}, + 'RelationUnitSettings': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', + 'unit', + 'settings'], + 'type': 'object'}, + 'RelationUnitStatus': {'additionalProperties': False, + 'properties': {'in-scope': {'type': 'boolean'}, + 'relation-tag': {'type': 'string'}, + 'suspended': {'type': 'boolean'}}, + 'required': ['relation-tag', + 'in-scope', + 'suspended'], + 'type': 'object'}, + 'RelationUnitStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'results': {'items': {'$ref': '#/definitions/RelationUnitStatus'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnitStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnits': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnit'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsSettings': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationUnitsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ResolvedModeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'mode': {'type': 'string'}}, + 'required': ['mode'], + 'type': 'object'}, + 'ResolvedModeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResolvedModeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetPodSpecParams': {'additionalProperties': False, + 'properties': {'specs': {'items': {'$ref': '#/definitions/EntityString'}, + 'type': 'array'}}, + 'required': ['specs'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'SettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StorageAddParams': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'storage': {'$ref': '#/definitions/StorageConstraints'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'name', 'storage'], + 'type': 'object'}, + 'StorageAttachment': {'additionalProperties': False, + 'properties': {'kind': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'location': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'owner-tag', + 'unit-tag', + 'kind', + 'location', + 'life'], + 'type': 'object'}, + 'StorageAttachmentId': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag'], + 'type': 'object'}, + 'StorageAttachmentIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/StorageAttachmentId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageAttachmentIdsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachmentIds'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentIdsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentIdsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StoragesAddParams': {'additionalProperties': False, + 'properties': {'storages': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}}, + 'required': ['storages'], + 'type': 'object'}, + 'StringBoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ok': {'type': 'boolean'}, + 'result': {'type': 'string'}}, + 'required': ['result', 'ok'], + 'type': 'object'}, + 'StringBoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringBoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UnitRefreshResult': {'additionalProperties': False, + 'properties': {'Error': {'$ref': '#/definitions/Error'}, + 'Life': {'type': 'string'}, + 'Resolved': {'type': 'string'}}, + 'required': ['Life', + 'Resolved', + 'Error'], + 'type': 'object'}, + 'UnitRefreshResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/UnitRefreshResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}, + 'UpgradeSeriesStatusParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'message': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['entity', + 'status', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'UpgradeSeriesStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusResult'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'Actions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'AddMetricBatches': {'properties': {'Params': {'$ref': '#/definitions/MetricBatchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AddUnitStorage': {'properties': {'Params': {'$ref': '#/definitions/StoragesAddParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AllMachinePorts': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachinePortsResults'}}, + 'type': 'object'}, + 'ApplicationStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationStatusResults'}}, + 'type': 'object'}, + 'AssignedMachine': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'AvailabilityZone': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'BeginActions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CharmArchiveSha256': {'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CharmModifiedVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'CharmURL': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'ClearResolved': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ClosePorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CloudAPIVersion': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'CloudSpec': {'properties': {'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'ConfigSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConfigSettingsResults'}}, + 'type': 'object'}, + 'CurrentModel': {'properties': {'Result': {'$ref': '#/definitions/ModelResult'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyAllSubordinates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyUnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnterScope': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FinishActions': {'properties': {'Params': {'$ref': '#/definitions/ActionExecutionResults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'GetMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, + 'type': 'object'}, + 'GetPrincipal': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'GoalStates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GoalStateResults'}}, + 'type': 'object'}, + 'HasSubordinates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'LeaveScope': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'Merge': {'properties': {'Params': {'$ref': '#/definitions/MergeLeadershipSettingsBulkParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'NetworkInfo': {'properties': {'Params': {'$ref': '#/definitions/NetworkInfoParams'}, + 'Result': {'$ref': '#/definitions/NetworkInfoResults'}}, + 'type': 'object'}, + 'OpenPorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'ProviderType': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PublicAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Read': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GetLeadershipSettingsBulkResults'}}, + 'type': 'object'}, + 'ReadRemoteSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnitPairs'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'ReadSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'Refresh': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitRefreshResults'}}, + 'type': 'object'}, + 'Relation': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationById': {'properties': {'Params': {'$ref': '#/definitions/RelationIds'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationsStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RelationUnitStatusResults'}}, + 'type': 'object'}, + 'RemoveStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RequestReboot': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Resolved': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ResolvedModeResults'}}, + 'type': 'object'}, + 'SLALevel': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetAgentStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetApplicationStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/EntitiesCharmURL'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetPodSpec': {'properties': {'Params': {'$ref': '#/definitions/SetPodSpecParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRelationStatus': {'properties': {'Params': {'$ref': '#/definitions/RelationStatusArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUpgradeSeriesUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetWorkloadVersion': {'properties': {'Params': {'$ref': '#/definitions/EntityWorkloadVersions'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StorageAttachmentLife': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'StorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentResults'}}, + 'type': 'object'}, + 'UnitStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'UnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentIdsResults'}}, + 'type': 'object'}, + 'UpdateSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnitsSettings'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpgradeSeriesUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchActionNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchConfigSettingsHash': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchLeadershipSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchRelationUnits': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, + 'type': 'object'}, + 'WatchStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchTrustConfigSettingsHash': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitAddressesHash': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitRelations': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WorkloadVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIAddresses', + version=12, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIHostPorts', + version=12, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Actions(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddMetricBatches(self, batches=None): + ''' + 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=12, + params=_params) + _params['batches'] = batches + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddUnitStorage(self, storages=None): + ''' + storages : typing.Sequence[~StorageAddParams] + Returns -> ErrorResults + ''' + 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='Uniter', + request='AddUnitStorage', + version=12, + params=_params) + _params['storages'] = storages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachinePortsResults) + async def AllMachinePorts(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> MachinePortsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='AllMachinePorts', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationStatusResults) + async def ApplicationStatus(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ApplicationStatus', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AssignedMachine(self, entities=None): + ''' + 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='AssignedMachine', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + 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='AvailabilityZone', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def BeginActions(self, entities=None): + ''' + 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='BeginActions', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def CharmArchiveSha256(self, urls=None): + ''' + 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='CharmArchiveSha256', + version=12, + params=_params) + _params['urls'] = urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def CharmModifiedVersion(self, entities=None): + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CharmModifiedVersion', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def CharmURL(self, entities=None): + ''' + 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='CharmURL', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClearResolved(self, entities=None): + ''' + 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='ClearResolved', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClosePorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='ClosePorts', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def CloudAPIVersion(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudAPIVersion', + version=12, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def CloudSpec(self): + ''' + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudSpec', + version=12, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConfigSettingsResults) + async def ConfigSettings(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ConfigSettings', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelResult) + async def CurrentModel(self): + ''' + + Returns -> ModelResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CurrentModel', + version=12, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Destroy(self, entities=None): + ''' + 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='Destroy', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyAllSubordinates(self, entities=None): + ''' + 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='DestroyAllSubordinates', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyUnitStorageAttachments(self, entities=None): + ''' + 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='DestroyUnitStorageAttachments', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + 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='EnsureDead', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnterScope(self, relation_units=None): + ''' + 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='EnterScope', + version=12, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def FinishActions(self, results=None): + ''' + 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='FinishActions', + version=12, + params=_params) + _params['results'] = results + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): + ''' + 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='GetMeterStatus', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def GetPrincipal(self, entities=None): + ''' + 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='GetPrincipal', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GoalStateResults) + async def GoalStates(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def HasSubordinates(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LeaveScope(self, relation_units=None): + ''' + 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=12, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Merge(self, params=None): + ''' + 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=12, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelConfig', + version=12, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelUUID', + version=12, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NetworkInfoResults) + async def NetworkInfo(self, bindings=None, relation_id=None, unit=None): + ''' + 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=12, + params=_params) + _params['bindings'] = bindings + _params['relation-id'] = relation_id + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def OpenPorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='OpenPorts', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PrivateAddress(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ProviderType(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ProviderType', + version=12, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PublicAddress(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetLeadershipSettingsBulkResults) + async def Read(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadRemoteSettings(self, relation_unit_pairs=None): + ''' + 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=12, + params=_params) + _params['relation-unit-pairs'] = relation_unit_pairs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadSettings(self, relation_units=None): + ''' + 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=12, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitRefreshResults) + async def Refresh(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def Relation(self, relation_units=None): + ''' + 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=12, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def RelationById(self, relation_ids=None): + ''' + 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=12, + params=_params) + _params['relation-ids'] = relation_ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitStatusResults) + async def RelationsStatus(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveStorageAttachments(self, ids=None): + ''' + 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=12, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RequestReboot(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolvedModeResults) + async def Resolved(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SLALevel', + version=12, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetAgentStatus(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationStatus(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmURL(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPodSpec(self, specs=None): + ''' + 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='Uniter', + request='SetPodSpec', + version=12, + params=_params) + _params['specs'] = specs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationStatus(self, args=None): + ''' + 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=12, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUnitStatus(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUpgradeSeriesUnitStatus(self, params=None): + ''' + 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=12, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetWorkloadVersion(self, entities=None): + ''' + 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='SetWorkloadVersion', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def StorageAttachmentLife(self, ids=None): + ''' + ids : typing.Sequence[~StorageAttachmentId] + 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='Uniter', + request='StorageAttachmentLife', + version=12, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentResults) + async def StorageAttachments(self, ids=None): + ''' + 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='StorageAttachments', + version=12, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def UnitStatus(self, entities=None): + ''' + 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='Uniter', + request='UnitStatus', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentIdsResults) + async def UnitStorageAttachments(self, entities=None): + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='UnitStorageAttachments', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateSettings(self, relation_units=None): + ''' + relation_units : typing.Sequence[~RelationUnitSettings] + 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='UpdateSettings', + version=12, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def UpgradeSeriesUnitStatus(self, entities=None): + ''' + 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='Uniter', + request='UpgradeSeriesUnitStatus', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + 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='Watch', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchAPIHostPorts', + version=12, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(self, entities=None): + ''' + 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='WatchActionNotifications', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchConfigSettingsHash(self, entities=None): + ''' + 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='WatchConfigSettingsHash', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchForModelConfigChanges', + version=12, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchLeadershipSettings(self, entities=None): + ''' + 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='WatchLeadershipSettings', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMeterStatus(self, entities=None): + ''' + 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='WatchMeterStatus', + version=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitsWatchResults) + async def WatchRelationUnits(self, relation_units=None): + ''' + 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=12, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchStorageAttachments(self, ids=None): + ''' + 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=12, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchTrustConfigSettingsHash(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitAddressesHash(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitRelations(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitStorageAttachments(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchUpgradeSeriesNotifications(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def WorkloadVersion(self, entities=None): + ''' + 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=12, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client13.py b/juju/client/old_clients/_client13.py new file mode 100644 index 000000000..f4c9a36de --- /dev/null +++ b/juju/client/old_clients/_client13.py @@ -0,0 +1,4571 @@ +# 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.old_clients._definitions import * + + +class ApplicationFacade(Type): + name = 'Application' + version = 13 + 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'}, + 'series': {'type': 'string'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'series', + 'charm-url', + 'channel', + 'num-units', + 'config-yaml', + 'constraints', + 'Force'], + 'type': 'object'}, + 'ApplicationDestroy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + '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'}, + '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'}, + 'series': {'type': 'string'}}, + 'required': ['application', + 'charm', + 'config', + 'constraints', + 'series', + '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'}, + 'ApplicationOfferDetails': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description'], + 'type': 'object'}, + 'ApplicationResult': {'additionalProperties': False, + 'properties': {'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'}, + 'principal': {'type': 'boolean'}, + 'remote': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'principal', + 'exposed', + 'remote'], + 'type': 'object'}, + 'ApplicationSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'options': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', + 'branch', + 'options'], + '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-series': {'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-series'], + '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'}, + 'CharmOrigin': {'additionalProperties': False, + 'properties': {'architecture': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'hash': {'type': 'string'}, + 'id': {'type': 'string'}, + 'instance-key': {'type': 'string'}, + 'os': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'risk': {'type': 'string'}, + 'series': {'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'}, + 'ConsumeApplicationArg': {'additionalProperties': False, + 'properties': {'ApplicationOfferDetails': {'$ref': '#/definitions/ApplicationOfferDetails'}, + 'application-alias': {'type': 'string'}, + 'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + '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'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description', + 'ApplicationOfferDetails'], + 'type': 'object'}, + 'ConsumeApplicationArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ConsumeApplicationArg'}, + 'type': 'array'}}, + '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'}, + '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'}, + 'DestroyApplicationUnits': {'additionalProperties': False, + 'properties': {'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + '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'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', 'force'], + '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'}, + 'unit-relation-data': {'patternProperties': {'.*': {'$ref': '#/definitions/RelationData'}}, + 'type': 'object'}}, + 'required': ['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'}, + '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'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + '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'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + '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'}, + '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'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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/ConsumeApplicationArgs'}, + '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'}, + 'Destroy': {'description': 'Destroy destroys a given ' + 'application, local or remote.\n' + '\n' + 'NOTE(axw) this exists only for ' + 'backwards compatibility,\n' + 'for API facade versions 1-3; ' + 'clients should prefer its\n' + 'successor, DestroyApplication, ' + 'below. Until all consumers\n' + 'have been updated, or we bump a ' + "major version, we can't\n" + 'drop this.\n' + '\n' + 'TODO(axw) 2017-03-16 #1673323\n' + 'Drop this in Juju 3.0.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}}, + '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'}, + 'DestroyUnits': {'description': 'DestroyUnits removes a given ' + 'set of application units.\n' + '\n' + 'NOTE(axw) this exists only ' + 'for backwards compatibility,\n' + 'for API facade versions 1-3; ' + 'clients should prefer its\n' + 'successor, DestroyUnit, ' + 'below. Until all consumers ' + 'have\n' + 'been updated, or we bump a ' + "major version, we can't drop\n" + 'this.\n' + '\n' + 'TODO(axw) 2017-03-16 ' + '#1673323\n' + 'Drop this in Juju 3.0.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, + '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'}, + 'GetCharmURL': {'description': 'GetCharmURL returns the charm ' + 'URL the given application is\n' + 'running at present.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + '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'}, + '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'}, + 'Set': {'description': 'Set implements the server side of ' + 'Application.Set.\n' + 'It does not unset values that are set ' + 'to an empty string.\n' + 'Unset should be used for that.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, + 'type': 'object'}, + 'SetCharm': {'description': 'SetCharm sets the charm for a ' + 'given for the application.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, + 'type': 'object'}, + 'SetConfigs': {'description': 'SetConfig 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.', + '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.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitInfoResults'}}, + 'type': 'object'}, + 'Unset': {'description': 'Unset implements the server side of ' + 'Client.Unset.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, + 'type': 'object'}, + 'UnsetApplicationsConfig': {'description': 'UnsetApplicationsConfig ' + 'implements the ' + 'server side of ' + 'Application.UnsetApplicationsConfig.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigUnsetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateApplicationSeries': {'description': 'UpdateApplicationSeries ' + 'updates the ' + 'application ' + 'series. Series ' + 'for\n' + 'subordinates ' + 'updated too.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + '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=13, + 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=13, + 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=13, + 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=13, + 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=13, + 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[~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=13, + 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=13, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Destroy(self, application=None): + ''' + Destroy destroys a given application, local or remote. + + NOTE(axw) this exists only for backwards compatibility, + for API facade versions 1-3; clients should prefer its + successor, DestroyApplication, below. Until all consumers + have been updated, or we bump a major version, we can't + drop this. + + TODO(axw) 2017-03-16 #1673323 + Drop this in Juju 3.0. + + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Destroy', + version=13, + params=_params) + _params['application'] = application + 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=13, + 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=13, + 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=13, + 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=13, + params=_params) + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyUnits(self, unit_names=None): + ''' + DestroyUnits removes a given set of application units. + + NOTE(axw) this exists only for backwards compatibility, + for API facade versions 1-3; clients should prefer its + successor, DestroyUnit, below. Until all consumers have + been updated, or we bump a major version, we can't drop + this. + + TODO(axw) 2017-03-16 #1673323 + Drop this in Juju 3.0. + + unit_names : typing.Sequence[str] + Returns -> None + ''' + if unit_names is not None and not isinstance(unit_names, (bytes, str, list)): + raise Exception("Expected unit_names to be a Sequence, received: {}".format(type(unit_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnits', + version=13, + params=_params) + _params['unit-names'] = unit_names + 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=13, + 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=13, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def GetCharmURL(self, application=None, branch=None): + ''' + GetCharmURL returns the charm URL the given application is + running at present. + + application : str + branch : str + Returns -> StringResult + ''' + 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='GetCharmURL', + version=13, + 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=13, + 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=13, + 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=13, + params=_params) + _params['entities'] = entities + 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=13, + 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=13, + 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=13, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Set(self, application=None, branch=None, options=None): + ''' + Set implements the server side of Application.Set. + It does not unset values that are set to an empty string. + Unset should be used for that. + + application : str + branch : str + options : typing.Mapping[str, 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, dict): + raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Set', + version=13, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + 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_series=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_series : 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_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + 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=13, + 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-series'] = force_series + _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): + ''' + SetConfig 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=13, + 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=13, + 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. + + 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=13, + 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=13, + 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=13, + 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. + + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unset(self, application=None, branch=None, options=None): + ''' + Unset implements the server side of Client.Unset. + + application : str + branch : str + options : 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, (bytes, str, list)): + raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unset', + version=13, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + 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=13, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateApplicationSeries(self, args=None): + ''' + UpdateApplicationSeries updates the application series. Series for + subordinates updated too. + + args : typing.Sequence[~UpdateSeriesArg] + 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='UpdateApplicationSeries', + version=13, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + +class UniterFacade(Type): + name = 'Uniter' + version = 13 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionExecutionResult': {'additionalProperties': False, + 'properties': {'action-tag': {'type': 'string'}, + 'message': {'type': 'string'}, + 'results': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'status': {'type': 'string'}}, + 'required': ['action-tag', 'status'], + 'type': 'object'}, + 'ActionExecutionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionExecutionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionMessage': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}}, + 'required': ['timestamp', 'message'], + 'type': 'object'}, + 'ActionMessageParams': {'additionalProperties': False, + 'properties': {'messages': {'items': {'$ref': '#/definitions/EntityString'}, + 'type': 'array'}}, + 'required': ['messages'], + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'log': {'items': {'$ref': '#/definitions/ActionMessage'}, + 'type': 'array'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'ApplicationStatusResult': {'additionalProperties': False, + 'properties': {'application': {'$ref': '#/definitions/StatusResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/StatusResult'}}, + 'type': 'object'}}, + 'required': ['application', + 'units'], + 'type': 'object'}, + 'ApplicationStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'CharmURLs': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/CharmURL'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'ConfigSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'ConfigSettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConfigSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Endpoint': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'relation': {'$ref': '#/definitions/CharmRelation'}}, + 'required': ['application-name', 'relation'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesCharmURL': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityCharmURL'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesPortRanges': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityCharmURL': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'charm-url'], + 'type': 'object'}, + 'EntityPortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['tag', + 'protocol', + 'from-port', + 'to-port'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'EntityString': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['tag', 'value'], + 'type': 'object'}, + 'EntityWorkloadVersion': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'workload-version': {'type': 'string'}}, + 'required': ['tag', + 'workload-version'], + 'type': 'object'}, + 'EntityWorkloadVersions': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityWorkloadVersion'}, + 'type': 'array'}}, + 'required': ['entities'], + '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'}, + 'GetLeadershipSettingsBulkResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GetLeadershipSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'GoalState': {'additionalProperties': False, + 'properties': {'relations': {'patternProperties': {'.*': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'required': ['units', 'relations'], + 'type': 'object'}, + 'GoalStateResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/GoalState'}}, + 'required': ['result', 'error'], + 'type': 'object'}, + 'GoalStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GoalStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GoalStateStatus': {'additionalProperties': False, + 'properties': {'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'since'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'InterfaceAddress': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'hostname': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['hostname', 'value', 'cidr'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachinePortRange': {'additionalProperties': False, + 'properties': {'port-range': {'$ref': '#/definitions/PortRange'}, + 'relation-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-tag', + 'port-range'], + 'type': 'object'}, + 'MachinePortsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ports': {'items': {'$ref': '#/definitions/MachinePortRange'}, + 'type': 'array'}}, + 'required': ['ports'], + 'type': 'object'}, + 'MachinePortsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachinePortsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MergeLeadershipSettingsBulkParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MergeLeadershipSettingsParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MergeLeadershipSettingsParam': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['settings'], + 'type': 'object'}, + 'MeterStatusResult': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}}, + 'required': ['code', 'info'], + 'type': 'object'}, + 'MeterStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Metric': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'labels': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['key', 'value', 'time'], + 'type': 'object'}, + 'MetricBatch': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'created': {'format': 'date-time', + 'type': 'string'}, + 'metrics': {'items': {'$ref': '#/definitions/Metric'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'charm-url', + 'created', + 'metrics'], + 'type': 'object'}, + 'MetricBatchParam': {'additionalProperties': False, + 'properties': {'batch': {'$ref': '#/definitions/MetricBatch'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'batch'], + 'type': 'object'}, + 'MetricBatchParams': {'additionalProperties': False, + 'properties': {'batches': {'items': {'$ref': '#/definitions/MetricBatchParam'}, + 'type': 'array'}}, + 'required': ['batches'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'type'], + 'type': 'object'}, + 'NetworkInfo': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/InterfaceAddress'}, + 'type': 'array'}, + 'interface-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['mac-address', + 'interface-name', + 'addresses'], + 'type': 'object'}, + 'NetworkInfoParams': {'additionalProperties': False, + 'properties': {'bindings': {'items': {'type': 'string'}, + 'type': 'array'}, + 'relation-id': {'type': 'integer'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'bindings'], + 'type': 'object'}, + 'NetworkInfoResult': {'additionalProperties': False, + 'properties': {'bind-addresses': {'items': {'$ref': '#/definitions/NetworkInfo'}, + 'type': 'array'}, + 'egress-subnets': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'ingress-addresses': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'NetworkInfoResults': {'additionalProperties': False, + 'properties': {'results': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInfoResult'}}, + 'type': 'object'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'RelationIds': {'additionalProperties': False, + 'properties': {'relation-ids': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['relation-ids'], + 'type': 'object'}, + 'RelationResult': {'additionalProperties': False, + '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'}}, + 'required': ['life', + 'id', + 'key', + 'endpoint'], + 'type': 'object'}, + 'RelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationStatusArg': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'relation-id': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-id', + 'status', + 'message'], + 'type': 'object'}, + 'RelationStatusArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RelationStatusArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'RelationUnit': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', 'unit'], + 'type': 'object'}, + 'RelationUnitPair': {'additionalProperties': False, + 'properties': {'local-unit': {'type': 'string'}, + 'relation': {'type': 'string'}, + 'remote-unit': {'type': 'string'}}, + 'required': ['relation', + 'local-unit', + 'remote-unit'], + 'type': 'object'}, + 'RelationUnitPairs': {'additionalProperties': False, + 'properties': {'relation-unit-pairs': {'items': {'$ref': '#/definitions/RelationUnitPair'}, + 'type': 'array'}}, + 'required': ['relation-unit-pairs'], + 'type': 'object'}, + 'RelationUnitSettings': {'additionalProperties': False, + 'properties': {'application-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'relation': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', + 'unit', + 'settings', + 'application-settings'], + 'type': 'object'}, + 'RelationUnitStatus': {'additionalProperties': False, + 'properties': {'in-scope': {'type': 'boolean'}, + 'relation-tag': {'type': 'string'}, + 'suspended': {'type': 'boolean'}}, + 'required': ['relation-tag', + 'in-scope', + 'suspended'], + 'type': 'object'}, + 'RelationUnitStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'results': {'items': {'$ref': '#/definitions/RelationUnitStatus'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnitStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnits': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnit'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'app-changed': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}, + 'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsSettings': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationUnitsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ResolvedModeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'mode': {'type': 'string'}}, + 'required': ['mode'], + 'type': 'object'}, + 'ResolvedModeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResolvedModeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetPodSpecParams': {'additionalProperties': False, + 'properties': {'specs': {'items': {'$ref': '#/definitions/EntityString'}, + 'type': 'array'}}, + 'required': ['specs'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'SettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StorageAddParams': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'storage': {'$ref': '#/definitions/StorageConstraints'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'name', 'storage'], + 'type': 'object'}, + 'StorageAttachment': {'additionalProperties': False, + 'properties': {'kind': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'location': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'owner-tag', + 'unit-tag', + 'kind', + 'location', + 'life'], + 'type': 'object'}, + 'StorageAttachmentId': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag'], + 'type': 'object'}, + 'StorageAttachmentIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/StorageAttachmentId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageAttachmentIdsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachmentIds'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentIdsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentIdsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StoragesAddParams': {'additionalProperties': False, + 'properties': {'storages': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}}, + 'required': ['storages'], + 'type': 'object'}, + 'StringBoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ok': {'type': 'boolean'}, + 'result': {'type': 'string'}}, + 'required': ['result', 'ok'], + 'type': 'object'}, + 'StringBoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringBoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UnitRefreshResult': {'additionalProperties': False, + 'properties': {'Error': {'$ref': '#/definitions/Error'}, + 'Life': {'type': 'string'}, + 'Resolved': {'type': 'string'}, + 'provider-id': {'type': 'string'}}, + 'required': ['Life', + 'Resolved', + 'Error'], + 'type': 'object'}, + 'UnitRefreshResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/UnitRefreshResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}, + 'UpgradeSeriesStatusParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'message': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['entity', + 'status', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'UpgradeSeriesStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusResult'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'Actions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'AddMetricBatches': {'properties': {'Params': {'$ref': '#/definitions/MetricBatchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AddUnitStorage': {'properties': {'Params': {'$ref': '#/definitions/StoragesAddParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AllMachinePorts': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachinePortsResults'}}, + 'type': 'object'}, + 'ApplicationStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationStatusResults'}}, + 'type': 'object'}, + 'AssignedMachine': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'AvailabilityZone': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'BeginActions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CharmArchiveSha256': {'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CharmModifiedVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'CharmURL': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'ClearResolved': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ClosePorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CloudAPIVersion': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'CloudSpec': {'properties': {'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'ConfigSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConfigSettingsResults'}}, + 'type': 'object'}, + 'CurrentModel': {'properties': {'Result': {'$ref': '#/definitions/ModelResult'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyAllSubordinates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyUnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnterScope': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FinishActions': {'properties': {'Params': {'$ref': '#/definitions/ActionExecutionResults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'GetMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, + 'type': 'object'}, + 'GetPrincipal': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'GoalStates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GoalStateResults'}}, + 'type': 'object'}, + 'HasSubordinates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'LeaveScope': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'LogActionsMessages': {'properties': {'Params': {'$ref': '#/definitions/ActionMessageParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Merge': {'properties': {'Params': {'$ref': '#/definitions/MergeLeadershipSettingsBulkParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'NetworkInfo': {'properties': {'Params': {'$ref': '#/definitions/NetworkInfoParams'}, + 'Result': {'$ref': '#/definitions/NetworkInfoResults'}}, + 'type': 'object'}, + 'OpenPorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'ProviderType': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PublicAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Read': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GetLeadershipSettingsBulkResults'}}, + 'type': 'object'}, + 'ReadRemoteSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnitPairs'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'ReadSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'Refresh': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitRefreshResults'}}, + 'type': 'object'}, + 'Relation': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationById': {'properties': {'Params': {'$ref': '#/definitions/RelationIds'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationsStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RelationUnitStatusResults'}}, + 'type': 'object'}, + 'RemoveStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RequestReboot': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Resolved': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ResolvedModeResults'}}, + 'type': 'object'}, + 'SLALevel': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetAgentStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetApplicationStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/EntitiesCharmURL'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetPodSpec': {'properties': {'Params': {'$ref': '#/definitions/SetPodSpecParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRelationStatus': {'properties': {'Params': {'$ref': '#/definitions/RelationStatusArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUpgradeSeriesUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetWorkloadVersion': {'properties': {'Params': {'$ref': '#/definitions/EntityWorkloadVersions'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StorageAttachmentLife': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'StorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentResults'}}, + 'type': 'object'}, + 'UnitStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'UnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentIdsResults'}}, + 'type': 'object'}, + 'UpdateNetworkInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnitsSettings'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpgradeSeriesUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchActionNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchConfigSettingsHash': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchLeadershipSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchRelationUnits': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, + 'type': 'object'}, + 'WatchStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchTrustConfigSettingsHash': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitAddressesHash': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitRelations': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WorkloadVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIAddresses', + version=13, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIHostPorts', + version=13, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Actions(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddMetricBatches(self, batches=None): + ''' + 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=13, + params=_params) + _params['batches'] = batches + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddUnitStorage(self, storages=None): + ''' + storages : typing.Sequence[~StorageAddParams] + Returns -> ErrorResults + ''' + 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='Uniter', + request='AddUnitStorage', + version=13, + params=_params) + _params['storages'] = storages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachinePortsResults) + async def AllMachinePorts(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> MachinePortsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='AllMachinePorts', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationStatusResults) + async def ApplicationStatus(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ApplicationStatus', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AssignedMachine(self, entities=None): + ''' + 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='AssignedMachine', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + 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='AvailabilityZone', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def BeginActions(self, entities=None): + ''' + 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='BeginActions', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def CharmArchiveSha256(self, urls=None): + ''' + 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='CharmArchiveSha256', + version=13, + params=_params) + _params['urls'] = urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def CharmModifiedVersion(self, entities=None): + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CharmModifiedVersion', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def CharmURL(self, entities=None): + ''' + 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='CharmURL', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClearResolved(self, entities=None): + ''' + 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='ClearResolved', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClosePorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='ClosePorts', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def CloudAPIVersion(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudAPIVersion', + version=13, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def CloudSpec(self): + ''' + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudSpec', + version=13, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConfigSettingsResults) + async def ConfigSettings(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ConfigSettings', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelResult) + async def CurrentModel(self): + ''' + + Returns -> ModelResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CurrentModel', + version=13, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Destroy(self, entities=None): + ''' + 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='Destroy', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyAllSubordinates(self, entities=None): + ''' + 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='DestroyAllSubordinates', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyUnitStorageAttachments(self, entities=None): + ''' + 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='DestroyUnitStorageAttachments', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + 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='EnsureDead', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnterScope(self, relation_units=None): + ''' + 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='EnterScope', + version=13, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def FinishActions(self, results=None): + ''' + 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='FinishActions', + version=13, + params=_params) + _params['results'] = results + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): + ''' + 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='GetMeterStatus', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def GetPrincipal(self, entities=None): + ''' + 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='GetPrincipal', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GoalStateResults) + async def GoalStates(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def HasSubordinates(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LeaveScope(self, relation_units=None): + ''' + 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=13, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LogActionsMessages(self, messages=None): + ''' + 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=13, + params=_params) + _params['messages'] = messages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Merge(self, params=None): + ''' + 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=13, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelConfig', + version=13, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelUUID', + version=13, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NetworkInfoResults) + async def NetworkInfo(self, bindings=None, relation_id=None, unit=None): + ''' + 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=13, + params=_params) + _params['bindings'] = bindings + _params['relation-id'] = relation_id + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def OpenPorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='OpenPorts', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PrivateAddress(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ProviderType(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ProviderType', + version=13, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PublicAddress(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetLeadershipSettingsBulkResults) + async def Read(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadRemoteSettings(self, relation_unit_pairs=None): + ''' + 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=13, + params=_params) + _params['relation-unit-pairs'] = relation_unit_pairs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadSettings(self, relation_units=None): + ''' + 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=13, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitRefreshResults) + async def Refresh(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def Relation(self, relation_units=None): + ''' + 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=13, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def RelationById(self, relation_ids=None): + ''' + 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=13, + params=_params) + _params['relation-ids'] = relation_ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitStatusResults) + async def RelationsStatus(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveStorageAttachments(self, ids=None): + ''' + 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=13, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RequestReboot(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolvedModeResults) + async def Resolved(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SLALevel', + version=13, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetAgentStatus(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationStatus(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmURL(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPodSpec(self, specs=None): + ''' + 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='Uniter', + request='SetPodSpec', + version=13, + params=_params) + _params['specs'] = specs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationStatus(self, args=None): + ''' + 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=13, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUnitStatus(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUpgradeSeriesUnitStatus(self, params=None): + ''' + 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=13, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetWorkloadVersion(self, entities=None): + ''' + 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='SetWorkloadVersion', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def StorageAttachmentLife(self, ids=None): + ''' + ids : typing.Sequence[~StorageAttachmentId] + 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='Uniter', + request='StorageAttachmentLife', + version=13, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentResults) + async def StorageAttachments(self, ids=None): + ''' + 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='StorageAttachments', + version=13, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def UnitStatus(self, entities=None): + ''' + 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='Uniter', + request='UnitStatus', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentIdsResults) + async def UnitStorageAttachments(self, entities=None): + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='UnitStorageAttachments', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateNetworkInfo(self, entities=None): + ''' + 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='UpdateNetworkInfo', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateSettings(self, relation_units=None): + ''' + relation_units : typing.Sequence[~RelationUnitSettings] + 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='UpdateSettings', + version=13, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def UpgradeSeriesUnitStatus(self, entities=None): + ''' + 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='Uniter', + request='UpgradeSeriesUnitStatus', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + 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='Watch', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchAPIHostPorts', + version=13, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(self, entities=None): + ''' + 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='WatchActionNotifications', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchConfigSettingsHash(self, entities=None): + ''' + 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='WatchConfigSettingsHash', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchForModelConfigChanges', + version=13, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchLeadershipSettings(self, entities=None): + ''' + 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='WatchLeadershipSettings', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMeterStatus(self, entities=None): + ''' + 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='WatchMeterStatus', + version=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitsWatchResults) + async def WatchRelationUnits(self, relation_units=None): + ''' + 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=13, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchStorageAttachments(self, ids=None): + ''' + 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=13, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchTrustConfigSettingsHash(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitAddressesHash(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitRelations(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitStorageAttachments(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchUpgradeSeriesNotifications(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def WorkloadVersion(self, entities=None): + ''' + 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=13, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client14.py b/juju/client/old_clients/_client14.py new file mode 100644 index 000000000..e4e10bf90 --- /dev/null +++ b/juju/client/old_clients/_client14.py @@ -0,0 +1,1908 @@ +# 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.old_clients._definitions import * + + +class ApplicationFacade(Type): + name = 'Application' + version = 14 + 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'}, + 'series': {'type': 'string'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'series', + 'charm-url', + 'channel', + 'num-units', + 'config-yaml', + 'constraints', + 'Force'], + 'type': 'object'}, + 'ApplicationDestroy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + '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'}, + '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'}, + 'series': {'type': 'string'}}, + 'required': ['application', + 'charm', + 'config', + 'constraints', + 'series', + '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'}, + 'ApplicationOfferDetails': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description'], + 'type': 'object'}, + 'ApplicationResult': {'additionalProperties': False, + 'properties': {'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'}, + 'series': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'principal', + 'exposed', + 'remote', + 'life'], + 'type': 'object'}, + 'ApplicationSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'options': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', + 'branch', + 'options'], + '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-series': {'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-series'], + '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'}, + 'CharmOrigin': {'additionalProperties': False, + 'properties': {'architecture': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'hash': {'type': 'string'}, + 'id': {'type': 'string'}, + 'instance-key': {'type': 'string'}, + 'os': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'risk': {'type': 'string'}, + 'series': {'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'}, + 'ConsumeApplicationArg': {'additionalProperties': False, + 'properties': {'ApplicationOfferDetails': {'$ref': '#/definitions/ApplicationOfferDetails'}, + 'application-alias': {'type': 'string'}, + 'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + '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'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description', + 'ApplicationOfferDetails'], + 'type': 'object'}, + 'ConsumeApplicationArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ConsumeApplicationArg'}, + 'type': 'array'}}, + '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'}, + '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'}, + 'DestroyApplicationUnits': {'additionalProperties': False, + 'properties': {'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + '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'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', 'force'], + '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'}, + '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'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + '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'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + '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'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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/ConsumeApplicationArgs'}, + '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'}, + 'Destroy': {'description': 'Destroy destroys a given ' + 'application, local or remote.\n' + '\n' + 'NOTE(axw) this exists only for ' + 'backwards compatibility,\n' + 'for API facade versions 1-3; ' + 'clients should prefer its\n' + 'successor, DestroyApplication, ' + 'below. Until all consumers\n' + 'have been updated, or we bump a ' + "major version, we can't\n" + 'drop this.\n' + '\n' + 'TODO(axw) 2017-03-16 #1673323\n' + 'Drop this in Juju 3.0.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}}, + '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'}, + 'DestroyUnits': {'description': 'DestroyUnits removes a given ' + 'set of application units.\n' + '\n' + 'NOTE(axw) this exists only ' + 'for backwards compatibility,\n' + 'for API facade versions 1-3; ' + 'clients should prefer its\n' + 'successor, DestroyUnit, ' + 'below. Until all consumers ' + 'have\n' + 'been updated, or we bump a ' + "major version, we can't drop\n" + 'this.\n' + '\n' + 'TODO(axw) 2017-03-16 ' + '#1673323\n' + 'Drop this in Juju 3.0.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, + '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'}, + 'GetCharmURL': {'description': 'GetCharmURL returns the charm ' + 'URL the given application is\n' + 'running at present.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + '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'}, + 'Set': {'description': 'Set implements the server side of ' + 'Application.Set.\n' + 'It does not unset values that are set ' + 'to an empty string.\n' + 'Unset should be used for that.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, + 'type': 'object'}, + 'SetCharm': {'description': 'SetCharm sets the charm for a ' + 'given for the application.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, + 'type': 'object'}, + 'SetConfigs': {'description': 'SetConfig 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.', + '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'}, + 'Unset': {'description': 'Unset implements the server side of ' + 'Client.Unset.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, + 'type': 'object'}, + 'UnsetApplicationsConfig': {'description': 'UnsetApplicationsConfig ' + 'implements the ' + 'server side of ' + 'Application.UnsetApplicationsConfig.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigUnsetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateApplicationSeries': {'description': 'UpdateApplicationSeries ' + 'updates the ' + 'application ' + 'series. Series ' + 'for\n' + 'subordinates ' + 'updated too.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + '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=14, + 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=14, + 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=14, + 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=14, + 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=14, + 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[~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=14, + 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=14, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Destroy(self, application=None): + ''' + Destroy destroys a given application, local or remote. + + NOTE(axw) this exists only for backwards compatibility, + for API facade versions 1-3; clients should prefer its + successor, DestroyApplication, below. Until all consumers + have been updated, or we bump a major version, we can't + drop this. + + TODO(axw) 2017-03-16 #1673323 + Drop this in Juju 3.0. + + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Destroy', + version=14, + params=_params) + _params['application'] = application + 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=14, + 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=14, + 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=14, + 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=14, + params=_params) + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyUnits(self, unit_names=None): + ''' + DestroyUnits removes a given set of application units. + + NOTE(axw) this exists only for backwards compatibility, + for API facade versions 1-3; clients should prefer its + successor, DestroyUnit, below. Until all consumers have + been updated, or we bump a major version, we can't drop + this. + + TODO(axw) 2017-03-16 #1673323 + Drop this in Juju 3.0. + + unit_names : typing.Sequence[str] + Returns -> None + ''' + if unit_names is not None and not isinstance(unit_names, (bytes, str, list)): + raise Exception("Expected unit_names to be a Sequence, received: {}".format(type(unit_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnits', + version=14, + params=_params) + _params['unit-names'] = unit_names + 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=14, + 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=14, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def GetCharmURL(self, application=None, branch=None): + ''' + GetCharmURL returns the charm URL the given application is + running at present. + + application : str + branch : str + Returns -> StringResult + ''' + 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='GetCharmURL', + version=14, + 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=14, + 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=14, + 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=14, + 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=14, + 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=14, + 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=14, + 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=14, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Set(self, application=None, branch=None, options=None): + ''' + Set implements the server side of Application.Set. + It does not unset values that are set to an empty string. + Unset should be used for that. + + application : str + branch : str + options : typing.Mapping[str, 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, dict): + raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Set', + version=14, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + 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_series=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_series : 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_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + 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=14, + 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-series'] = force_series + _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): + ''' + SetConfig 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=14, + 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=14, + 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. + + 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=14, + 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=14, + 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=14, + 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=14, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unset(self, application=None, branch=None, options=None): + ''' + Unset implements the server side of Client.Unset. + + application : str + branch : str + options : 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, (bytes, str, list)): + raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unset', + version=14, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + 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=14, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateApplicationSeries(self, args=None): + ''' + UpdateApplicationSeries updates the application series. Series for + subordinates updated too. + + args : typing.Sequence[~UpdateSeriesArg] + 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='UpdateApplicationSeries', + version=14, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client15.py b/juju/client/old_clients/_client15.py new file mode 100644 index 000000000..31c803fc4 --- /dev/null +++ b/juju/client/old_clients/_client15.py @@ -0,0 +1,2907 @@ +# 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.old_clients._definitions import * + + +class UniterFacade(Type): + name = 'Uniter' + version = 15 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionExecutionResult': {'additionalProperties': False, + 'properties': {'action-tag': {'type': 'string'}, + 'message': {'type': 'string'}, + 'results': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'status': {'type': 'string'}}, + 'required': ['action-tag', 'status'], + 'type': 'object'}, + 'ActionExecutionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionExecutionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionMessage': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}}, + 'required': ['timestamp', 'message'], + 'type': 'object'}, + 'ActionMessageParams': {'additionalProperties': False, + 'properties': {'messages': {'items': {'$ref': '#/definitions/EntityString'}, + 'type': 'array'}}, + 'required': ['messages'], + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'log': {'items': {'$ref': '#/definitions/ActionMessage'}, + 'type': 'array'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'ApplicationStatusResult': {'additionalProperties': False, + 'properties': {'application': {'$ref': '#/definitions/StatusResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/StatusResult'}}, + 'type': 'object'}}, + 'required': ['application', + 'units'], + 'type': 'object'}, + 'ApplicationStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'CharmURLs': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/CharmURL'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CommitHookChangesArg': {'additionalProperties': False, + 'properties': {'add-storage': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}, + 'close-ports': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}, + 'open-ports': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}, + 'pod-spec': {'$ref': '#/definitions/PodSpec'}, + 'relation-unit-settings': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}, + 'set-raw-k8s-spec': {'$ref': '#/definitions/PodSpec'}, + 'tag': {'type': 'string'}, + 'unit-state': {'$ref': '#/definitions/SetUnitStateArg'}, + 'update-network-info': {'type': 'boolean'}}, + 'required': ['tag', + 'update-network-info'], + 'type': 'object'}, + 'CommitHookChangesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/CommitHookChangesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'ConfigSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'ConfigSettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConfigSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Endpoint': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'relation': {'$ref': '#/definitions/CharmRelation'}}, + 'required': ['application-name', 'relation'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesCharmURL': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityCharmURL'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesPortRanges': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityCharmURL': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'charm-url'], + 'type': 'object'}, + 'EntityPortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['tag', + 'protocol', + 'from-port', + 'to-port'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'EntityString': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['tag', 'value'], + 'type': 'object'}, + 'EntityWorkloadVersion': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'workload-version': {'type': 'string'}}, + 'required': ['tag', + 'workload-version'], + 'type': 'object'}, + 'EntityWorkloadVersions': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityWorkloadVersion'}, + 'type': 'array'}}, + 'required': ['entities'], + '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'}, + 'GetLeadershipSettingsBulkResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GetLeadershipSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'GoalState': {'additionalProperties': False, + 'properties': {'relations': {'patternProperties': {'.*': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'required': ['units', 'relations'], + 'type': 'object'}, + 'GoalStateResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/GoalState'}}, + 'required': ['result', 'error'], + 'type': 'object'}, + 'GoalStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GoalStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GoalStateStatus': {'additionalProperties': False, + 'properties': {'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'since'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'InterfaceAddress': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'hostname': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['hostname', 'value', 'cidr'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachinePortRange': {'additionalProperties': False, + 'properties': {'port-range': {'$ref': '#/definitions/PortRange'}, + 'relation-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-tag', + 'port-range'], + 'type': 'object'}, + 'MachinePortsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ports': {'items': {'$ref': '#/definitions/MachinePortRange'}, + 'type': 'array'}}, + 'required': ['ports'], + 'type': 'object'}, + 'MachinePortsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachinePortsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MergeLeadershipSettingsBulkParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MergeLeadershipSettingsParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MergeLeadershipSettingsParam': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['settings'], + 'type': 'object'}, + 'MeterStatusResult': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}}, + 'required': ['code', 'info'], + 'type': 'object'}, + 'MeterStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Metric': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'labels': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['key', 'value', 'time'], + 'type': 'object'}, + 'MetricBatch': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'created': {'format': 'date-time', + 'type': 'string'}, + 'metrics': {'items': {'$ref': '#/definitions/Metric'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'charm-url', + 'created', + 'metrics'], + 'type': 'object'}, + 'MetricBatchParam': {'additionalProperties': False, + 'properties': {'batch': {'$ref': '#/definitions/MetricBatch'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'batch'], + 'type': 'object'}, + 'MetricBatchParams': {'additionalProperties': False, + 'properties': {'batches': {'items': {'$ref': '#/definitions/MetricBatchParam'}, + 'type': 'array'}}, + 'required': ['batches'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'type'], + 'type': 'object'}, + 'NetworkInfo': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/InterfaceAddress'}, + 'type': 'array'}, + 'interface-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['mac-address', + 'interface-name', + 'addresses'], + 'type': 'object'}, + 'NetworkInfoParams': {'additionalProperties': False, + 'properties': {'bindings': {'items': {'type': 'string'}, + 'type': 'array'}, + 'relation-id': {'type': 'integer'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'bindings'], + 'type': 'object'}, + 'NetworkInfoResult': {'additionalProperties': False, + 'properties': {'bind-addresses': {'items': {'$ref': '#/definitions/NetworkInfo'}, + 'type': 'array'}, + 'egress-subnets': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'ingress-addresses': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'NetworkInfoResults': {'additionalProperties': False, + 'properties': {'results': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInfoResult'}}, + 'type': 'object'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PodSpec': {'additionalProperties': False, + 'properties': {'spec': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'RelationIds': {'additionalProperties': False, + 'properties': {'relation-ids': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['relation-ids'], + 'type': 'object'}, + 'RelationResult': {'additionalProperties': False, + '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'}}, + 'required': ['life', + 'id', + 'key', + 'endpoint'], + 'type': 'object'}, + 'RelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationStatusArg': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'relation-id': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-id', + 'status', + 'message'], + 'type': 'object'}, + 'RelationStatusArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RelationStatusArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'RelationUnit': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', 'unit'], + 'type': 'object'}, + 'RelationUnitPair': {'additionalProperties': False, + 'properties': {'local-unit': {'type': 'string'}, + 'relation': {'type': 'string'}, + 'remote-unit': {'type': 'string'}}, + 'required': ['relation', + 'local-unit', + 'remote-unit'], + 'type': 'object'}, + 'RelationUnitPairs': {'additionalProperties': False, + 'properties': {'relation-unit-pairs': {'items': {'$ref': '#/definitions/RelationUnitPair'}, + 'type': 'array'}}, + 'required': ['relation-unit-pairs'], + 'type': 'object'}, + 'RelationUnitSettings': {'additionalProperties': False, + 'properties': {'application-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'relation': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', + 'unit', + 'settings', + 'application-settings'], + 'type': 'object'}, + 'RelationUnitStatus': {'additionalProperties': False, + 'properties': {'in-scope': {'type': 'boolean'}, + 'relation-tag': {'type': 'string'}, + 'suspended': {'type': 'boolean'}}, + 'required': ['relation-tag', + 'in-scope', + 'suspended'], + 'type': 'object'}, + 'RelationUnitStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'results': {'items': {'$ref': '#/definitions/RelationUnitStatus'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnitStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnits': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnit'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'app-changed': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}, + 'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsSettings': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationUnitsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ResolvedModeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'mode': {'type': 'string'}}, + 'required': ['mode'], + 'type': 'object'}, + 'ResolvedModeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResolvedModeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SetUnitStateArg': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-state': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'SetUnitStateArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetUnitStateArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'SettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StorageAddParams': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'storage': {'$ref': '#/definitions/StorageConstraints'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'name', 'storage'], + 'type': 'object'}, + 'StorageAttachment': {'additionalProperties': False, + 'properties': {'kind': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'location': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'owner-tag', + 'unit-tag', + 'kind', + 'location', + 'life'], + 'type': 'object'}, + 'StorageAttachmentId': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag'], + 'type': 'object'}, + 'StorageAttachmentIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/StorageAttachmentId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageAttachmentIdsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachmentIds'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentIdsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentIdsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StoragesAddParams': {'additionalProperties': False, + 'properties': {'storages': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}}, + 'required': ['storages'], + 'type': 'object'}, + 'StringBoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ok': {'type': 'boolean'}, + 'result': {'type': 'string'}}, + 'required': ['result', 'ok'], + 'type': 'object'}, + 'StringBoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringBoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UnitRefreshResult': {'additionalProperties': False, + 'properties': {'Error': {'$ref': '#/definitions/Error'}, + 'Life': {'type': 'string'}, + 'Resolved': {'type': 'string'}, + 'provider-id': {'type': 'string'}}, + 'required': ['Life', + 'Resolved', + 'Error'], + 'type': 'object'}, + 'UnitRefreshResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/UnitRefreshResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}, + 'UnitStateResult': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-state': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'type': 'object'}, + 'UnitStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UnitStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpgradeSeriesStatusParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'message': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['entity', + 'status', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'UpgradeSeriesStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusResult'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'ActionStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Actions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'AddMetricBatches': {'properties': {'Params': {'$ref': '#/definitions/MetricBatchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AddUnitStorage': {'properties': {'Params': {'$ref': '#/definitions/StoragesAddParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AllMachinePorts': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachinePortsResults'}}, + 'type': 'object'}, + 'ApplicationStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationStatusResults'}}, + 'type': 'object'}, + 'AssignedMachine': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'AvailabilityZone': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'BeginActions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CharmArchiveSha256': {'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CharmModifiedVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'CharmURL': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'ClearResolved': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ClosePorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CloudAPIVersion': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'CloudSpec': {'properties': {'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'CommitHookChanges': {'properties': {'Params': {'$ref': '#/definitions/CommitHookChangesArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ConfigSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConfigSettingsResults'}}, + 'type': 'object'}, + 'CurrentModel': {'properties': {'Result': {'$ref': '#/definitions/ModelResult'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyAllSubordinates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyUnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnterScope': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FinishActions': {'properties': {'Params': {'$ref': '#/definitions/ActionExecutionResults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'GetMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, + 'type': 'object'}, + 'GetPodSpec': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GetPrincipal': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'GetRawK8sSpec': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GoalStates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GoalStateResults'}}, + 'type': 'object'}, + 'HasSubordinates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'LeaveScope': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'LogActionsMessages': {'properties': {'Params': {'$ref': '#/definitions/ActionMessageParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Merge': {'properties': {'Params': {'$ref': '#/definitions/MergeLeadershipSettingsBulkParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'NetworkInfo': {'properties': {'Params': {'$ref': '#/definitions/NetworkInfoParams'}, + 'Result': {'$ref': '#/definitions/NetworkInfoResults'}}, + 'type': 'object'}, + 'OpenPorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'ProviderType': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PublicAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Read': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GetLeadershipSettingsBulkResults'}}, + 'type': 'object'}, + 'ReadLocalApplicationSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnit'}, + 'Result': {'$ref': '#/definitions/SettingsResult'}}, + 'type': 'object'}, + 'ReadRemoteSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnitPairs'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'ReadSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'Refresh': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitRefreshResults'}}, + 'type': 'object'}, + 'Relation': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationById': {'properties': {'Params': {'$ref': '#/definitions/RelationIds'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationsStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RelationUnitStatusResults'}}, + 'type': 'object'}, + 'RemoveStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RequestReboot': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Resolved': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ResolvedModeResults'}}, + 'type': 'object'}, + 'SLALevel': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetAgentStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetApplicationStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/EntitiesCharmURL'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRelationStatus': {'properties': {'Params': {'$ref': '#/definitions/RelationStatusArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetState': {'properties': {'Params': {'$ref': '#/definitions/SetUnitStateArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUpgradeSeriesUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetWorkloadVersion': {'properties': {'Params': {'$ref': '#/definitions/EntityWorkloadVersions'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'State': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitStateResults'}}, + 'type': 'object'}, + 'StorageAttachmentLife': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'StorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentResults'}}, + 'type': 'object'}, + 'UnitStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'UnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentIdsResults'}}, + 'type': 'object'}, + 'UpdateNetworkInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnitsSettings'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpgradeSeriesUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchActionNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchConfigSettingsHash': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchLeadershipSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchRelationUnits': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, + 'type': 'object'}, + 'WatchStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchTrustConfigSettingsHash': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitAddressesHash': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitRelations': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WorkloadVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIAddresses', + version=15, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIHostPorts', + version=15, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def ActionStatus(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Actions(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddMetricBatches(self, batches=None): + ''' + 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=15, + params=_params) + _params['batches'] = batches + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddUnitStorage(self, storages=None): + ''' + storages : typing.Sequence[~StorageAddParams] + Returns -> ErrorResults + ''' + 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='Uniter', + request='AddUnitStorage', + version=15, + params=_params) + _params['storages'] = storages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachinePortsResults) + async def AllMachinePorts(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> MachinePortsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='AllMachinePorts', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationStatusResults) + async def ApplicationStatus(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ApplicationStatus', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AssignedMachine(self, entities=None): + ''' + 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='AssignedMachine', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + 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='AvailabilityZone', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def BeginActions(self, entities=None): + ''' + 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='BeginActions', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def CharmArchiveSha256(self, urls=None): + ''' + 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='CharmArchiveSha256', + version=15, + params=_params) + _params['urls'] = urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def CharmModifiedVersion(self, entities=None): + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CharmModifiedVersion', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def CharmURL(self, entities=None): + ''' + 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='CharmURL', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClearResolved(self, entities=None): + ''' + 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='ClearResolved', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClosePorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='ClosePorts', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def CloudAPIVersion(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudAPIVersion', + version=15, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def CloudSpec(self): + ''' + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudSpec', + version=15, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def CommitHookChanges(self, args=None): + ''' + 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='CommitHookChanges', + version=15, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConfigSettingsResults) + async def ConfigSettings(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ConfigSettings', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelResult) + async def CurrentModel(self): + ''' + + Returns -> ModelResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CurrentModel', + version=15, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Destroy(self, entities=None): + ''' + 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='Destroy', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyAllSubordinates(self, entities=None): + ''' + 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='DestroyAllSubordinates', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyUnitStorageAttachments(self, entities=None): + ''' + 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='DestroyUnitStorageAttachments', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + 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='EnsureDead', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnterScope(self, relation_units=None): + ''' + 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='EnterScope', + version=15, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def FinishActions(self, results=None): + ''' + 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='FinishActions', + version=15, + params=_params) + _params['results'] = results + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): + ''' + 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='GetMeterStatus', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetPodSpec(self, entities=None): + ''' + 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='GetPodSpec', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def GetPrincipal(self, entities=None): + ''' + 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='GetPrincipal', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetRawK8sSpec(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GoalStateResults) + async def GoalStates(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def HasSubordinates(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LeaveScope(self, relation_units=None): + ''' + 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=15, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LogActionsMessages(self, messages=None): + ''' + 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=15, + params=_params) + _params['messages'] = messages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Merge(self, params=None): + ''' + 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=15, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelConfig', + version=15, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelUUID', + version=15, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NetworkInfoResults) + async def NetworkInfo(self, bindings=None, relation_id=None, unit=None): + ''' + 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=15, + params=_params) + _params['bindings'] = bindings + _params['relation-id'] = relation_id + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def OpenPorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='OpenPorts', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PrivateAddress(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ProviderType(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ProviderType', + version=15, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PublicAddress(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetLeadershipSettingsBulkResults) + async def Read(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResult) + async def ReadLocalApplicationSettings(self, relation=None, unit=None): + ''' + 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=15, + params=_params) + _params['relation'] = relation + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadRemoteSettings(self, relation_unit_pairs=None): + ''' + 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=15, + params=_params) + _params['relation-unit-pairs'] = relation_unit_pairs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadSettings(self, relation_units=None): + ''' + 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=15, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitRefreshResults) + async def Refresh(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def Relation(self, relation_units=None): + ''' + 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=15, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def RelationById(self, relation_ids=None): + ''' + 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=15, + params=_params) + _params['relation-ids'] = relation_ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitStatusResults) + async def RelationsStatus(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveStorageAttachments(self, ids=None): + ''' + 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=15, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RequestReboot(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolvedModeResults) + async def Resolved(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SLALevel', + version=15, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetAgentStatus(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationStatus(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmURL(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationStatus(self, args=None): + ''' + 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=15, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetState(self, args=None): + ''' + 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=15, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUnitStatus(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUpgradeSeriesUnitStatus(self, params=None): + ''' + 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=15, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetWorkloadVersion(self, entities=None): + ''' + 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='SetWorkloadVersion', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitStateResults) + async def State(self, entities=None): + ''' + 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='Uniter', + request='State', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def StorageAttachmentLife(self, ids=None): + ''' + ids : typing.Sequence[~StorageAttachmentId] + 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='Uniter', + request='StorageAttachmentLife', + version=15, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentResults) + async def StorageAttachments(self, ids=None): + ''' + 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='StorageAttachments', + version=15, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def UnitStatus(self, entities=None): + ''' + 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='Uniter', + request='UnitStatus', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentIdsResults) + async def UnitStorageAttachments(self, entities=None): + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='UnitStorageAttachments', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateNetworkInfo(self, entities=None): + ''' + 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='UpdateNetworkInfo', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateSettings(self, relation_units=None): + ''' + relation_units : typing.Sequence[~RelationUnitSettings] + 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='UpdateSettings', + version=15, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def UpgradeSeriesUnitStatus(self, entities=None): + ''' + 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='Uniter', + request='UpgradeSeriesUnitStatus', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + 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='Watch', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchAPIHostPorts', + version=15, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(self, entities=None): + ''' + 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='WatchActionNotifications', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchConfigSettingsHash(self, entities=None): + ''' + 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='WatchConfigSettingsHash', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchForModelConfigChanges', + version=15, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchLeadershipSettings(self, entities=None): + ''' + 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='WatchLeadershipSettings', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMeterStatus(self, entities=None): + ''' + 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='WatchMeterStatus', + version=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitsWatchResults) + async def WatchRelationUnits(self, relation_units=None): + ''' + 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=15, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchStorageAttachments(self, ids=None): + ''' + 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=15, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchTrustConfigSettingsHash(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitAddressesHash(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitRelations(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitStorageAttachments(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchUpgradeSeriesNotifications(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def WorkloadVersion(self, entities=None): + ''' + 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=15, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client16.py b/juju/client/old_clients/_client16.py new file mode 100644 index 000000000..d86c45727 --- /dev/null +++ b/juju/client/old_clients/_client16.py @@ -0,0 +1,3821 @@ +# 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.old_clients._definitions import * + + +class UniterFacade(Type): + name = 'Uniter' + version = 16 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionExecutionResult': {'additionalProperties': False, + 'properties': {'action-tag': {'type': 'string'}, + 'message': {'type': 'string'}, + 'results': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'status': {'type': 'string'}}, + 'required': ['action-tag', 'status'], + 'type': 'object'}, + 'ActionExecutionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionExecutionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionMessage': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}}, + 'required': ['timestamp', 'message'], + 'type': 'object'}, + 'ActionMessageParams': {'additionalProperties': False, + 'properties': {'messages': {'items': {'$ref': '#/definitions/EntityString'}, + 'type': 'array'}}, + 'required': ['messages'], + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'log': {'items': {'$ref': '#/definitions/ActionMessage'}, + 'type': 'array'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'ApplicationStatusResult': {'additionalProperties': False, + 'properties': {'application': {'$ref': '#/definitions/StatusResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/StatusResult'}}, + 'type': 'object'}}, + 'required': ['application', + 'units'], + 'type': 'object'}, + 'ApplicationStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'CharmURLs': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/CharmURL'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CommitHookChangesArg': {'additionalProperties': False, + 'properties': {'add-storage': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}, + 'close-ports': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}, + 'open-ports': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}, + 'pod-spec': {'$ref': '#/definitions/PodSpec'}, + 'relation-unit-settings': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}, + 'set-raw-k8s-spec': {'$ref': '#/definitions/PodSpec'}, + 'tag': {'type': 'string'}, + 'unit-state': {'$ref': '#/definitions/SetUnitStateArg'}, + 'update-network-info': {'type': 'boolean'}}, + 'required': ['tag', + 'update-network-info'], + 'type': 'object'}, + 'CommitHookChangesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/CommitHookChangesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'ConfigSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'ConfigSettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConfigSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Endpoint': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'relation': {'$ref': '#/definitions/CharmRelation'}}, + 'required': ['application-name', 'relation'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesCharmURL': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityCharmURL'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesPortRanges': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityCharmURL': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'charm-url'], + 'type': 'object'}, + 'EntityPortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['tag', + 'protocol', + 'from-port', + 'to-port'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'EntityString': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['tag', 'value'], + 'type': 'object'}, + 'EntityWorkloadVersion': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'workload-version': {'type': 'string'}}, + 'required': ['tag', + 'workload-version'], + 'type': 'object'}, + 'EntityWorkloadVersions': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityWorkloadVersion'}, + 'type': 'array'}}, + 'required': ['entities'], + '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'}, + 'GetLeadershipSettingsBulkResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GetLeadershipSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'GoalState': {'additionalProperties': False, + 'properties': {'relations': {'patternProperties': {'.*': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'required': ['units', 'relations'], + 'type': 'object'}, + 'GoalStateResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/GoalState'}}, + 'required': ['result', 'error'], + 'type': 'object'}, + 'GoalStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GoalStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GoalStateStatus': {'additionalProperties': False, + 'properties': {'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'since'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'InterfaceAddress': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'hostname': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['hostname', 'value', 'cidr'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachinePortRange': {'additionalProperties': False, + 'properties': {'port-range': {'$ref': '#/definitions/PortRange'}, + 'relation-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-tag', + 'port-range'], + 'type': 'object'}, + 'MachinePortsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ports': {'items': {'$ref': '#/definitions/MachinePortRange'}, + 'type': 'array'}}, + 'required': ['ports'], + 'type': 'object'}, + 'MachinePortsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachinePortsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MergeLeadershipSettingsBulkParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MergeLeadershipSettingsParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MergeLeadershipSettingsParam': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['settings'], + 'type': 'object'}, + 'MeterStatusResult': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}}, + 'required': ['code', 'info'], + 'type': 'object'}, + 'MeterStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Metric': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'labels': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['key', 'value', 'time'], + 'type': 'object'}, + 'MetricBatch': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'created': {'format': 'date-time', + 'type': 'string'}, + 'metrics': {'items': {'$ref': '#/definitions/Metric'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'charm-url', + 'created', + 'metrics'], + 'type': 'object'}, + 'MetricBatchParam': {'additionalProperties': False, + 'properties': {'batch': {'$ref': '#/definitions/MetricBatch'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'batch'], + 'type': 'object'}, + 'MetricBatchParams': {'additionalProperties': False, + 'properties': {'batches': {'items': {'$ref': '#/definitions/MetricBatchParam'}, + 'type': 'array'}}, + 'required': ['batches'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'type'], + 'type': 'object'}, + 'NetworkInfo': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/InterfaceAddress'}, + 'type': 'array'}, + 'interface-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['mac-address', + 'interface-name', + 'addresses'], + 'type': 'object'}, + 'NetworkInfoParams': {'additionalProperties': False, + 'properties': {'bindings': {'items': {'type': 'string'}, + 'type': 'array'}, + 'relation-id': {'type': 'integer'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'bindings'], + 'type': 'object'}, + 'NetworkInfoResult': {'additionalProperties': False, + 'properties': {'bind-addresses': {'items': {'$ref': '#/definitions/NetworkInfo'}, + 'type': 'array'}, + 'egress-subnets': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'ingress-addresses': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'NetworkInfoResults': {'additionalProperties': False, + 'properties': {'results': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInfoResult'}}, + 'type': 'object'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PodSpec': {'additionalProperties': False, + 'properties': {'spec': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'RelationIds': {'additionalProperties': False, + 'properties': {'relation-ids': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['relation-ids'], + 'type': 'object'}, + 'RelationResult': {'additionalProperties': False, + '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'}}, + 'required': ['life', + 'id', + 'key', + 'endpoint'], + 'type': 'object'}, + 'RelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationStatusArg': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'relation-id': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-id', + 'status', + 'message'], + 'type': 'object'}, + 'RelationStatusArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RelationStatusArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'RelationUnit': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', 'unit'], + 'type': 'object'}, + 'RelationUnitPair': {'additionalProperties': False, + 'properties': {'local-unit': {'type': 'string'}, + 'relation': {'type': 'string'}, + 'remote-unit': {'type': 'string'}}, + 'required': ['relation', + 'local-unit', + 'remote-unit'], + 'type': 'object'}, + 'RelationUnitPairs': {'additionalProperties': False, + 'properties': {'relation-unit-pairs': {'items': {'$ref': '#/definitions/RelationUnitPair'}, + 'type': 'array'}}, + 'required': ['relation-unit-pairs'], + 'type': 'object'}, + 'RelationUnitSettings': {'additionalProperties': False, + 'properties': {'application-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'relation': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', + 'unit', + 'settings', + 'application-settings'], + 'type': 'object'}, + 'RelationUnitStatus': {'additionalProperties': False, + 'properties': {'in-scope': {'type': 'boolean'}, + 'relation-tag': {'type': 'string'}, + 'suspended': {'type': 'boolean'}}, + 'required': ['relation-tag', + 'in-scope', + 'suspended'], + 'type': 'object'}, + 'RelationUnitStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'results': {'items': {'$ref': '#/definitions/RelationUnitStatus'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnitStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnits': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnit'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'app-changed': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}, + 'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsSettings': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationUnitsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ResolvedModeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'mode': {'type': 'string'}}, + 'required': ['mode'], + 'type': 'object'}, + 'ResolvedModeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResolvedModeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SetUnitStateArg': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-state': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'SetUnitStateArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetUnitStateArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'SettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StorageAddParams': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'storage': {'$ref': '#/definitions/StorageConstraints'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'name', 'storage'], + 'type': 'object'}, + 'StorageAttachment': {'additionalProperties': False, + 'properties': {'kind': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'location': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'owner-tag', + 'unit-tag', + 'kind', + 'location', + 'life'], + 'type': 'object'}, + 'StorageAttachmentId': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag'], + 'type': 'object'}, + 'StorageAttachmentIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/StorageAttachmentId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageAttachmentIdsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachmentIds'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentIdsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentIdsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StoragesAddParams': {'additionalProperties': False, + 'properties': {'storages': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}}, + 'required': ['storages'], + 'type': 'object'}, + 'StringBoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ok': {'type': 'boolean'}, + 'result': {'type': 'string'}}, + 'required': ['result', 'ok'], + 'type': 'object'}, + 'StringBoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringBoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UnitRefreshResult': {'additionalProperties': False, + 'properties': {'Error': {'$ref': '#/definitions/Error'}, + 'Life': {'type': 'string'}, + 'Resolved': {'type': 'string'}, + 'provider-id': {'type': 'string'}}, + 'required': ['Life', + 'Resolved', + 'Error'], + 'type': 'object'}, + 'UnitRefreshResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/UnitRefreshResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}, + 'UnitStateResult': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-state': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'type': 'object'}, + 'UnitStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UnitStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpgradeSeriesStatusParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'message': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['entity', + 'status', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'UpgradeSeriesStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusResult'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'ActionStatus': {'description': 'ActionStatus returns the ' + 'status of Actions by Tags ' + 'passed in.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Actions': {'description': 'Actions returns the Actions by ' + 'Tags passed and ensures that the ' + 'Unit asking\n' + 'for them is the same Unit that has ' + 'the Actions.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'AddMetricBatches': {'description': 'AddMetricBatches adds the ' + 'metrics for the specified ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/MetricBatchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AddUnitStorage': {'description': 'AddUnitStorage validates ' + 'and creates additional ' + 'storage instances for ' + 'units.\n' + 'Failures on an individual ' + 'storage instance do not ' + 'block remaining\n' + 'instances from being ' + 'processed.', + 'properties': {'Params': {'$ref': '#/definitions/StoragesAddParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AllMachinePorts': {'description': 'AllMachinePorts returns ' + 'all opened port ranges for ' + 'each given\n' + 'machine (on all networks).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachinePortsResults'}}, + 'type': 'object'}, + 'ApplicationStatus': {'description': 'ApplicationStatus ' + 'returns the status of ' + 'the Applications and its ' + 'workloads\n' + 'if the given unit is the ' + 'leader.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationStatusResults'}}, + 'type': 'object'}, + 'AssignedMachine': {'description': 'AssignedMachine returns ' + 'the machine tag for each ' + 'given unit tag, or\n' + 'an error satisfying ' + 'params.IsCodeNotAssigned ' + 'when a unit has no\n' + 'assigned machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'AvailabilityZone': {'description': 'AvailabilityZone returns ' + 'the availability zone for ' + 'each given unit, if ' + 'applicable.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'BeginActions': {'description': 'BeginActions marks the ' + 'actions represented by the ' + 'passed in Tags as running.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CanApplyLXDProfile': {'description': 'CanApplyLXDProfile is a ' + 'shim to call the ' + 'LXDProfileAPIv2 version ' + 'of this method.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'CharmArchiveSha256': {'description': 'CharmArchiveSha256 ' + 'returns the SHA256 ' + 'digest of the charm ' + 'archive\n' + '(bundle) data for each ' + 'charm url in the given ' + 'parameters.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CharmModifiedVersion': {'description': 'CharmModifiedVersion ' + 'returns the most ' + 'CharmModifiedVersion ' + 'for all given\n' + 'units or ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'CharmURL': {'description': 'CharmURL returns the charm URL ' + 'for all given units or ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'ClearResolved': {'description': 'ClearResolved removes any ' + 'resolved setting from each ' + 'given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ClosePorts': {'description': 'ClosePorts sets the policy of ' + 'the port range with protocol to ' + 'be\n' + 'closed, for all given units.', + 'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CloudAPIVersion': {'description': 'CloudAPIVersion returns ' + 'the cloud API version, if ' + 'available.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'CloudSpec': {'description': 'CloudSpec returns the cloud spec ' + 'used by the model in which the\n' + 'authenticated unit or ' + 'application resides.\n' + 'A check is made beforehand to ' + 'ensure that the request is made ' + 'by an entity\n' + 'that has been granted the ' + 'appropriate trust.', + 'properties': {'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'CommitHookChanges': {'description': 'CommitHookChanges ' + 'batches together all ' + 'required API calls for ' + 'applying\n' + 'a set of changes after a ' + 'hook successfully ' + 'completes and executes ' + 'them in a\n' + 'single transaction.', + 'properties': {'Params': {'$ref': '#/definitions/CommitHookChangesArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ConfigSettings': {'description': 'ConfigSettings returns the ' + 'complete set of application ' + 'charm config\n' + 'settings available to each ' + 'given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConfigSettingsResults'}}, + 'type': 'object'}, + 'CurrentModel': {'description': 'CurrentModel returns the name ' + 'and UUID for the current juju ' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelResult'}}, + 'type': 'object'}, + 'Destroy': {'description': 'Destroy advances all given Alive ' + "units' lifecycles as far as\n" + 'possible. See ' + 'state/Unit.Destroy().', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyAllSubordinates': {'description': 'DestroyAllSubordinates ' + 'destroys all ' + 'subordinates of ' + 'each given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyUnitStorageAttachments': {'description': 'DestroyUnitStorageAttachments ' + 'marks each ' + 'storage ' + 'attachment ' + 'of the\n' + 'specified ' + 'units as ' + 'Dying.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnsureDead': {'description': 'EnsureDead calls EnsureDead on ' + 'each given entity from state. ' + 'It\n' + 'will fail if the entity is not ' + "present. If it's Alive, nothing " + 'will\n' + 'happen (see state/EnsureDead() ' + 'for units or machines).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnterScope': {'description': 'EnterScope ensures each unit ' + 'has entered its scope in the ' + 'relation,\n' + 'for all of the given ' + 'relation/unit pairs. See also\n' + 'state.RelationUnit.EnterScope().', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FinishActions': {'description': 'FinishActions saves the ' + 'result of a completed Action', + 'properties': {'Params': {'$ref': '#/definitions/ActionExecutionResults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'GetMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, + 'type': 'object'}, + 'GetPodSpec': {'description': 'GetPodSpec gets the pod specs ' + 'for a set of applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GetPrincipal': {'description': 'GetPrincipal returns the ' + 'result of calling ' + 'PrincipalName() and\n' + 'converting it to a tag, on ' + 'each given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'GetRawK8sSpec': {'description': 'GetRawK8sSpec gets the raw ' + 'k8s specs for a set of ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GoalStates': {'description': 'GoalStates returns information ' + 'of charm units and relations.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GoalStateResults'}}, + 'type': 'object'}, + 'HasSubordinates': {'description': 'HasSubordinates returns ' + 'the whether each given ' + 'unit has any subordinates.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'LXDProfileName': {'description': 'LXDProfileName is a shim to ' + 'call the LXDProfileAPIv2 ' + 'version of this method.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'LXDProfileRequired': {'description': 'LXDProfileRequired is a ' + 'shim to call the ' + 'LXDProfileAPIv2 version ' + 'of this method.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'LeaveScope': {'description': 'LeaveScope signals each unit ' + 'has left its scope in the ' + 'relation,\n' + 'for all of the given ' + 'relation/unit pairs. See also\n' + 'state.RelationUnit.LeaveScope().', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'LogActionsMessages': {'description': 'LogActionsMessages ' + 'records the log ' + 'messages against the ' + 'specified actions.', + 'properties': {'Params': {'$ref': '#/definitions/ActionMessageParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Merge': {'description': 'Merge merges in the provided ' + 'leadership settings. Only leaders ' + 'for\n' + 'the given service may perform this ' + 'operation.', + 'properties': {'Params': {'$ref': '#/definitions/MergeLeadershipSettingsBulkParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' + 'to connect to the model\n' + 'that the current connection is ' + 'for.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'NetworkInfo': {'description': 'NetworkInfo returns network ' + 'interfaces/addresses for ' + 'specified bindings.', + 'properties': {'Params': {'$ref': '#/definitions/NetworkInfoParams'}, + 'Result': {'$ref': '#/definitions/NetworkInfoResults'}}, + 'type': 'object'}, + 'OpenPorts': {'description': 'OpenPorts sets the policy of the ' + 'port range with protocol to be\n' + 'opened, for all given units.', + 'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'description': 'PrivateAddress returns the ' + 'private address for each ' + 'given unit, if set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'ProviderType': {'description': 'ProviderType returns the ' + 'provider type used by the ' + 'current juju\n' + 'model.\n' + '\n' + 'TODO(dimitern): Refactor the ' + 'uniter to call this instead ' + 'of calling\n' + 'ModelConfig() just to get the ' + 'provider type. Once we have ' + 'machine\n' + 'addresses, this might be ' + 'completely unnecessary ' + 'though.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PublicAddress': {'description': 'PublicAddress returns the ' + 'public address for each ' + 'given unit, if set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Read': {'description': 'Read reads leadership settings for ' + 'the provided service ID. Any\n' + 'unit of the service may perform this ' + 'operation.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GetLeadershipSettingsBulkResults'}}, + 'type': 'object'}, + 'ReadLocalApplicationSettings': {'description': 'ReadLocalApplicationSettings ' + 'returns the ' + 'local ' + 'application ' + 'settings for ' + 'a\n' + 'particular ' + 'relation when ' + 'invoked by ' + 'the leader ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnit'}, + 'Result': {'$ref': '#/definitions/SettingsResult'}}, + 'type': 'object'}, + 'ReadRemoteSettings': {'description': 'ReadRemoteSettings ' + 'returns the remote ' + 'settings of each given ' + 'set of\n' + 'relation/local ' + 'unit/remote unit.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnitPairs'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'ReadSettings': {'description': 'ReadSettings returns the ' + 'local settings of each given ' + 'set of\n' + 'relation/unit.\n' + '\n' + 'NOTE(achilleasa): Using this ' + 'call to read application data ' + 'is deprecated\n' + 'and will not work for k8s ' + 'charms (see LP1876097). ' + 'Instead, clients should\n' + 'use ' + 'ReadLocalApplicationSettings.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'Refresh': {'description': 'Refresh retrieves the latest ' + 'values for attributes on this ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitRefreshResults'}}, + 'type': 'object'}, + 'Relation': {'description': 'Relation returns information ' + 'about all given relation/unit ' + 'pairs,\n' + 'including their id, key and the ' + 'local endpoint.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationById': {'description': 'RelationById returns ' + 'information about all given ' + 'relations,\n' + 'specified by their ids, ' + 'including their key and the ' + 'local\n' + 'endpoint.', + 'properties': {'Params': {'$ref': '#/definitions/RelationIds'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationsStatus': {'description': 'RelationsStatus returns ' + 'for each unit the ' + 'corresponding relation and ' + 'status information.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RelationUnitStatusResults'}}, + 'type': 'object'}, + 'RemoveStorageAttachments': {'description': 'RemoveStorageAttachments ' + 'removes the ' + 'specified ' + 'storage\n' + 'attachments from ' + 'state.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RequestReboot': {'description': 'RequestReboot sets the ' + 'reboot flag on the provided ' + 'machines', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Resolved': {'description': 'Resolved returns the current ' + 'resolved setting for each given ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ResolvedModeResults'}}, + 'type': 'object'}, + 'SLALevel': {'description': "SLALevel returns the model's SLA " + 'level.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetAgentStatus': {'description': 'SetAgentStatus will set ' + 'status for agents of Units ' + 'passed in args, if one\n' + 'of the args is not an Unit ' + 'it will fail.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetApplicationStatus': {'description': 'SetApplicationStatus ' + 'sets the status for ' + 'all the Applications ' + 'in args if the given ' + 'Unit is\n' + 'the leader.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharmURL': {'description': 'SetCharmURL sets the charm URL ' + 'for each given unit. An error ' + 'will\n' + 'be returned if a unit is dead, ' + 'or the charm URL is not known.', + 'properties': {'Params': {'$ref': '#/definitions/EntitiesCharmURL'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRelationStatus': {'description': 'SetRelationStatus ' + 'updates the status of ' + 'the specified relations.', + 'properties': {'Params': {'$ref': '#/definitions/RelationStatusArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetState': {'description': 'SetState sets the state persisted ' + 'by the charm running in this ' + 'unit\n' + 'and the state internal to the ' + 'uniter for this unit.', + 'properties': {'Params': {'$ref': '#/definitions/SetUnitStateArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus will set status for a ' + 'entities passed in args. If the ' + 'entity is\n' + 'a Unit it will instead set ' + 'status to its agent, to emulate ' + 'backwards\n' + 'compatibility.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUnitStatus': {'description': 'SetUnitStatus sets status ' + 'for all elements passed in ' + 'args, the difference\n' + 'with SetStatus is that if an ' + 'entity is a Unit it will set ' + 'its status instead\n' + 'of its agent.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUpgradeSeriesUnitStatus': {'description': 'SetUpgradeSeriesUnitStatus ' + 'sets the ' + 'upgrade series ' + 'status of the ' + 'unit.\n' + 'If no upgrade ' + 'is in progress ' + 'an error is ' + 'returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetWorkloadVersion': {'description': 'SetWorkloadVersion sets ' + 'the workload version ' + 'for each given unit. An ' + 'error will\n' + 'be returned if a unit ' + 'is dead.', + 'properties': {'Params': {'$ref': '#/definitions/EntityWorkloadVersions'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'State': {'description': 'State returns the state persisted by ' + 'the charm running in this unit\n' + 'and the state internal to the uniter ' + 'for this unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitStateResults'}}, + 'type': 'object'}, + 'StorageAttachmentLife': {'description': 'StorageAttachmentLife ' + 'returns the ' + 'lifecycle state of ' + 'the storage ' + 'attachments\n' + 'with the specified ' + 'tags.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'StorageAttachments': {'description': 'StorageAttachments ' + 'returns the storage ' + 'attachments with the ' + 'specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentResults'}}, + 'type': 'object'}, + 'UnitStatus': {'description': 'UnitStatus returns the workload ' + 'status information for the ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'UnitStorageAttachments': {'description': 'UnitStorageAttachments ' + 'returns the IDs of ' + 'storage attachments ' + 'for a collection of ' + 'units.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentIdsResults'}}, + 'type': 'object'}, + 'UpdateNetworkInfo': {'description': 'UpdateNetworkInfo ' + 'refreshes the network ' + "settings for a unit's " + 'bound\n' + 'endpoints.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateSettings': {'description': 'UpdateSettings persists all ' + 'changes made to the local ' + 'settings of\n' + 'all given pairs of relation ' + 'and unit. Keys with empty ' + 'values are\n' + 'considered a signal to ' + 'delete these values.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnitsSettings'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpgradeSeriesUnitStatus': {'description': 'UpgradeSeriesUnitStatus ' + 'returns the ' + 'current ' + 'preparation status ' + 'of an\n' + 'upgrading unit.\n' + 'If no series ' + 'upgrade is in ' + 'progress an error ' + 'is returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchActionNotifications': {'description': 'WatchActionNotifications ' + 'returns a ' + 'StringsWatcher ' + 'for observing\n' + 'incoming action ' + 'calls to a unit. ' + 'See also ' + 'state/watcher.go\n' + 'Unit.WatchActionNotifications(). ' + 'This method is ' + 'called from\n' + 'api/uniter/uniter.go ' + 'WatchActionNotifications().', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchConfigSettingsHash': {'description': 'WatchConfigSettingsHash ' + 'returns a ' + 'StringsWatcher ' + 'that yields a ' + 'hash\n' + 'of the config ' + 'values every time ' + 'the config ' + 'changes. The ' + 'uniter can\n' + 'save this hash and ' + 'use it to decide ' + 'whether the ' + 'config-changed ' + 'hook\n' + 'needs to be run ' + '(or whether this ' + 'was just an agent ' + 'restart with no\n' + 'substantive config ' + 'change).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchInstanceData': {'description': 'WatchInstanceData is a ' + 'shim to call the ' + 'LXDProfileAPIv2 version ' + 'of this method.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchLeadershipSettings': {'description': 'WatchLeadershipSettings ' + 'will block the ' + 'caller until ' + 'leadership ' + 'settings\n' + 'for the given ' + 'service ID change.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchRelationUnits': {'description': 'WatchRelationUnits ' + 'returns a ' + 'RelationUnitsWatcher ' + 'for observing\n' + 'changes to every unit ' + 'in the supplied ' + 'relation that is ' + 'visible to\n' + 'the supplied unit. See ' + 'also ' + 'state/watcher.go:RelationUnit.Watch().', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, + 'type': 'object'}, + 'WatchStorageAttachments': {'description': 'WatchStorageAttachments ' + 'creates watchers ' + 'for a collection ' + 'of storage\n' + 'attachments, each ' + 'of which can be ' + 'used to watch ' + 'changes to ' + 'storage\n' + 'attachment info.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchTrustConfigSettingsHash': {'description': 'WatchTrustConfigSettingsHash ' + 'returns a ' + 'StringsWatcher ' + 'that yields ' + 'a\n' + 'hash of the ' + 'application ' + 'config values ' + 'whenever they ' + 'change. The\n' + 'uniter can ' + 'use the hash ' + 'to determine ' + 'whether the ' + 'actual values ' + 'have\n' + 'changed since ' + 'it last saw ' + 'the config.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitAddressesHash': {'description': 'WatchUnitAddressesHash ' + 'returns a ' + 'StringsWatcher that ' + 'yields the\n' + 'hashes of the ' + 'addresses for the ' + 'unit whenever the ' + 'addresses\n' + 'change. The uniter ' + 'can use the hash to ' + 'determine whether ' + 'the actual\n' + 'address values have ' + 'changed since it ' + 'last saw the ' + 'config.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitRelations': {'description': 'WatchUnitRelations ' + 'returns a ' + 'StringsWatcher, for ' + 'each given\n' + 'unit, that notifies of ' + 'changes to the ' + 'lifecycles of ' + 'relations\n' + 'relevant to that unit. ' + 'For principal units, ' + 'this will be all of ' + 'the\n' + 'relations for the ' + 'application. For ' + 'subordinate units, ' + 'only\n' + 'relations with the ' + "principal unit's " + 'application will be ' + 'monitored.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitStorageAttachments': {'description': 'WatchUnitStorageAttachments ' + 'creates ' + 'watchers for a ' + 'collection of ' + 'units,\n' + 'each of which ' + 'can be used to ' + 'watch for ' + 'lifecycle ' + 'changes to the ' + 'corresponding\n' + "unit's storage " + 'attachments.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'description': 'WatchUpgradeSeriesNotifications ' + 'returns a ' + 'NotifyWatcher ' + 'for ' + 'observing ' + 'changes to ' + 'upgrade ' + 'series ' + 'locks.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WorkloadVersion': {'description': 'WorkloadVersion returns ' + 'the workload version for ' + 'all given units or ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def 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=16, + params=_params) + + reply = await self.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='Uniter', + request='APIHostPorts', + version=16, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def 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=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def 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=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=16, + params=_params) + _params['batches'] = batches + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddUnitStorage(self, storages=None): + ''' + AddUnitStorage validates and creates additional storage instances for units. + Failures on an individual storage instance do not block remaining + instances from being processed. + + storages : typing.Sequence[~StorageAddParams] + Returns -> ErrorResults + ''' + 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='Uniter', + request='AddUnitStorage', + version=16, + params=_params) + _params['storages'] = storages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachinePortsResults) + async def AllMachinePorts(self, entities=None): + ''' + AllMachinePorts returns all opened port ranges for each given + machine (on all networks). + + entities : typing.Sequence[~Entity] + Returns -> MachinePortsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='AllMachinePorts', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationStatusResults) + async def ApplicationStatus(self, entities=None): + ''' + ApplicationStatus returns the status of the Applications and its workloads + if the given unit is the leader. + + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ApplicationStatus', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AssignedMachine(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. + + 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='AssignedMachine', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + AvailabilityZone returns the availability zone for each given unit, if applicable. + + 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='AvailabilityZone', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.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='Uniter', + request='BeginActions', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def CanApplyLXDProfile(self, entities=None): + ''' + CanApplyLXDProfile is a shim to call the LXDProfileAPIv2 version of this method. + + 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='CanApplyLXDProfile', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def CharmArchiveSha256(self, urls=None): + ''' + CharmArchiveSha256 returns the SHA256 digest of the charm archive + (bundle) data for each charm url in the given parameters. + + 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='CharmArchiveSha256', + version=16, + params=_params) + _params['urls'] = urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def CharmModifiedVersion(self, entities=None): + ''' + CharmModifiedVersion returns the most CharmModifiedVersion for all given + units or applications. + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CharmModifiedVersion', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def CharmURL(self, entities=None): + ''' + CharmURL returns the charm URL for all given units or applications. + + 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='CharmURL', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClearResolved(self, entities=None): + ''' + ClearResolved removes any resolved setting from each given unit. + + 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='ClearResolved', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClosePorts(self, entities=None): + ''' + ClosePorts sets the policy of the port range with protocol to be + closed, for all given units. + + entities : typing.Sequence[~EntityPortRange] + 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='ClosePorts', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def CloudAPIVersion(self): + ''' + CloudAPIVersion returns the cloud API version, if available. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudAPIVersion', + version=16, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def CloudSpec(self): + ''' + 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. + + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudSpec', + version=16, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def CommitHookChanges(self, args=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. + + 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='CommitHookChanges', + version=16, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConfigSettingsResults) + async def ConfigSettings(self, entities=None): + ''' + ConfigSettings returns the complete set of application charm config + settings available to each given unit. + + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ConfigSettings', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelResult) + async def 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='Uniter', + request='CurrentModel', + version=16, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Destroy(self, entities=None): + ''' + Destroy advances all given Alive units' lifecycles as far as + possible. See state/Unit.Destroy(). + + 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='Destroy', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyAllSubordinates(self, entities=None): + ''' + DestroyAllSubordinates destroys all subordinates of each given unit. + + 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='DestroyAllSubordinates', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyUnitStorageAttachments(self, entities=None): + ''' + DestroyUnitStorageAttachments marks each storage attachment of the + specified units as Dying. + + 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='DestroyUnitStorageAttachments', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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='Uniter', + request='EnsureDead', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnterScope(self, relation_units=None): + ''' + EnterScope ensures each unit has entered its scope in the relation, + for all of the given relation/unit pairs. See also + state.RelationUnit.EnterScope(). + + 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='EnterScope', + version=16, + params=_params) + _params['relation-units'] = relation_units + reply = await self.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='Uniter', + request='FinishActions', + version=16, + params=_params) + _params['results'] = results + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): + ''' + 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='GetMeterStatus', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetPodSpec(self, entities=None): + ''' + GetPodSpec gets the pod 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='GetPodSpec', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def GetPrincipal(self, entities=None): + ''' + GetPrincipal returns the result of calling PrincipalName() and + converting it to a tag, on each given unit. + + 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='GetPrincipal', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetRawK8sSpec(self, entities=None): + ''' + 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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['urls'] = urls + reply = await self.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=16, + params=_params) + _params['relation-units'] = relation_units + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['messages'] = messages + reply = await self.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=16, + params=_params) + _params['params'] = params + reply = await self.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=16, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + ModelUUID returns the model UUID to connect to the model + that the current connection is for. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelUUID', + version=16, + params=_params) + + reply = await self.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=16, + params=_params) + _params['bindings'] = bindings + _params['relation-id'] = relation_id + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def OpenPorts(self, entities=None): + ''' + OpenPorts sets the policy of the port range with protocol to be + opened, for all given units. + + entities : typing.Sequence[~EntityPortRange] + 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='OpenPorts', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['relation'] = relation + _params['unit'] = unit + reply = await self.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=16, + params=_params) + _params['relation-unit-pairs'] = relation_unit_pairs + reply = await self.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=16, + params=_params) + _params['relation-units'] = relation_units + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['relation-units'] = relation_units + reply = await self.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=16, + params=_params) + _params['relation-ids'] = relation_ids + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['ids'] = ids + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['args'] = args + reply = await self.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=16, + params=_params) + _params['args'] = args + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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='SetWorkloadVersion', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitStateResults) + async def 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='Uniter', + request='State', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def StorageAttachmentLife(self, ids=None): + ''' + StorageAttachmentLife returns the lifecycle state of the storage attachments + with the specified tags. + + ids : typing.Sequence[~StorageAttachmentId] + 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='Uniter', + request='StorageAttachmentLife', + version=16, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentResults) + async def StorageAttachments(self, ids=None): + ''' + StorageAttachments returns the storage attachments with the specified tags. + + 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='StorageAttachments', + version=16, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def UnitStatus(self, entities=None): + ''' + UnitStatus returns the workload status information for the unit. + + 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='Uniter', + request='UnitStatus', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentIdsResults) + async def UnitStorageAttachments(self, entities=None): + ''' + UnitStorageAttachments returns the IDs of storage attachments for a collection of units. + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='UnitStorageAttachments', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateNetworkInfo(self, entities=None): + ''' + UpdateNetworkInfo refreshes the network settings for a unit's bound + endpoints. + + 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='UpdateNetworkInfo', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateSettings(self, relation_units=None): + ''' + UpdateSettings persists all changes made to the local settings of + all given pairs of relation and unit. Keys with empty values are + considered a signal to delete these values. + + relation_units : typing.Sequence[~RelationUnitSettings] + 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='UpdateSettings', + version=16, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def 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='Uniter', + request='UpgradeSeriesUnitStatus', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.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='Uniter', + request='Watch', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchAPIHostPorts', + version=16, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(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(). + + 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='WatchActionNotifications', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchConfigSettingsHash(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). + + 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='WatchConfigSettingsHash', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.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=16, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchInstanceData(self, entities=None): + ''' + WatchInstanceData is a shim to call the LXDProfileAPIv2 version of this method. + + 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='WatchInstanceData', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchLeadershipSettings(self, entities=None): + ''' + WatchLeadershipSettings will block the caller until leadership settings + for the given service ID change. + + 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='WatchLeadershipSettings', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMeterStatus(self, entities=None): + ''' + 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='WatchMeterStatus', + version=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitsWatchResults) + async def 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=16, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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=16, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def 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=16, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client17.py b/juju/client/old_clients/_client17.py new file mode 100644 index 000000000..9855113e7 --- /dev/null +++ b/juju/client/old_clients/_client17.py @@ -0,0 +1,3911 @@ +# 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.old_clients._definitions import * + + +class UniterFacade(Type): + name = 'Uniter' + version = 17 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionExecutionResult': {'additionalProperties': False, + 'properties': {'action-tag': {'type': 'string'}, + 'message': {'type': 'string'}, + 'results': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'status': {'type': 'string'}}, + 'required': ['action-tag', 'status'], + 'type': 'object'}, + 'ActionExecutionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionExecutionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionMessage': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}}, + 'required': ['timestamp', 'message'], + 'type': 'object'}, + 'ActionMessageParams': {'additionalProperties': False, + 'properties': {'messages': {'items': {'$ref': '#/definitions/EntityString'}, + 'type': 'array'}}, + 'required': ['messages'], + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'log': {'items': {'$ref': '#/definitions/ActionMessage'}, + 'type': 'array'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + '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'}, + 'ApplicationStatusResult': {'additionalProperties': False, + 'properties': {'application': {'$ref': '#/definitions/StatusResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/StatusResult'}}, + 'type': 'object'}}, + 'required': ['application', + 'units'], + 'type': 'object'}, + 'ApplicationStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'CharmURLs': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/CharmURL'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + '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'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CommitHookChangesArg': {'additionalProperties': False, + 'properties': {'add-storage': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}, + 'close-ports': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}, + 'open-ports': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}, + 'pod-spec': {'$ref': '#/definitions/PodSpec'}, + 'relation-unit-settings': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}, + 'set-raw-k8s-spec': {'$ref': '#/definitions/PodSpec'}, + 'tag': {'type': 'string'}, + 'unit-state': {'$ref': '#/definitions/SetUnitStateArg'}, + 'update-network-info': {'type': 'boolean'}}, + 'required': ['tag', + 'update-network-info'], + 'type': 'object'}, + 'CommitHookChangesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/CommitHookChangesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'ConfigSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'ConfigSettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConfigSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Endpoint': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'relation': {'$ref': '#/definitions/CharmRelation'}}, + 'required': ['application-name', 'relation'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesCharmURL': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityCharmURL'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesPortRanges': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityCharmURL': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'charm-url'], + 'type': 'object'}, + 'EntityPortRange': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['tag', + 'protocol', + 'from-port', + 'to-port', + 'endpoint'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'EntityString': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['tag', 'value'], + 'type': 'object'}, + 'EntityWorkloadVersion': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'workload-version': {'type': 'string'}}, + 'required': ['tag', + 'workload-version'], + 'type': 'object'}, + 'EntityWorkloadVersions': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityWorkloadVersion'}, + 'type': 'array'}}, + 'required': ['entities'], + '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'}, + 'GetLeadershipSettingsBulkResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GetLeadershipSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'GoalState': {'additionalProperties': False, + 'properties': {'relations': {'patternProperties': {'.*': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'required': ['units', 'relations'], + 'type': 'object'}, + 'GoalStateResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/GoalState'}}, + 'required': ['result', 'error'], + 'type': 'object'}, + 'GoalStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GoalStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GoalStateStatus': {'additionalProperties': False, + 'properties': {'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'since'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + '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'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'InterfaceAddress': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'hostname': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['hostname', 'value', 'cidr'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachinePortRange': {'additionalProperties': False, + 'properties': {'port-range': {'$ref': '#/definitions/PortRange'}, + 'relation-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-tag', + 'port-range'], + 'type': 'object'}, + 'MachinePortsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ports': {'items': {'$ref': '#/definitions/MachinePortRange'}, + 'type': 'array'}}, + 'required': ['ports'], + 'type': 'object'}, + 'MachinePortsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachinePortsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MergeLeadershipSettingsBulkParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MergeLeadershipSettingsParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MergeLeadershipSettingsParam': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['settings'], + 'type': 'object'}, + 'MeterStatusResult': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}}, + 'required': ['code', 'info'], + 'type': 'object'}, + 'MeterStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Metric': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'labels': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['key', 'value', 'time'], + 'type': 'object'}, + 'MetricBatch': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'created': {'format': 'date-time', + 'type': 'string'}, + 'metrics': {'items': {'$ref': '#/definitions/Metric'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'charm-url', + 'created', + 'metrics'], + 'type': 'object'}, + 'MetricBatchParam': {'additionalProperties': False, + 'properties': {'batch': {'$ref': '#/definitions/MetricBatch'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'batch'], + 'type': 'object'}, + 'MetricBatchParams': {'additionalProperties': False, + 'properties': {'batches': {'items': {'$ref': '#/definitions/MetricBatchParam'}, + 'type': 'array'}}, + 'required': ['batches'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'type'], + 'type': 'object'}, + 'NetworkInfo': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/InterfaceAddress'}, + 'type': 'array'}, + 'interface-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['mac-address', + 'interface-name', + 'addresses'], + 'type': 'object'}, + 'NetworkInfoParams': {'additionalProperties': False, + 'properties': {'bindings': {'items': {'type': 'string'}, + 'type': 'array'}, + 'relation-id': {'type': 'integer'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'bindings'], + 'type': 'object'}, + 'NetworkInfoResult': {'additionalProperties': False, + 'properties': {'bind-addresses': {'items': {'$ref': '#/definitions/NetworkInfo'}, + 'type': 'array'}, + 'egress-subnets': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'ingress-addresses': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'NetworkInfoResults': {'additionalProperties': False, + 'properties': {'results': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInfoResult'}}, + 'type': 'object'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'OpenMachinePortRangesByEndpointResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'unit-port-ranges': {'patternProperties': {'.*': {'items': {'$ref': '#/definitions/OpenUnitPortRangesByEndpoint'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'required': ['unit-port-ranges'], + 'type': 'object'}, + 'OpenMachinePortRangesByEndpointResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/OpenMachinePortRangesByEndpointResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'OpenUnitPortRangesByEndpoint': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'port-ranges': {'items': {'$ref': '#/definitions/PortRange'}, + 'type': 'array'}}, + 'required': ['endpoint', + 'port-ranges'], + 'type': 'object'}, + 'PodSpec': {'additionalProperties': False, + 'properties': {'spec': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'RelationIds': {'additionalProperties': False, + 'properties': {'relation-ids': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['relation-ids'], + 'type': 'object'}, + 'RelationResult': {'additionalProperties': False, + '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'}}, + 'required': ['life', + 'id', + 'key', + 'endpoint'], + 'type': 'object'}, + 'RelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationStatusArg': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'relation-id': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-id', + 'status', + 'message'], + 'type': 'object'}, + 'RelationStatusArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RelationStatusArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'RelationUnit': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', 'unit'], + 'type': 'object'}, + 'RelationUnitPair': {'additionalProperties': False, + 'properties': {'local-unit': {'type': 'string'}, + 'relation': {'type': 'string'}, + 'remote-unit': {'type': 'string'}}, + 'required': ['relation', + 'local-unit', + 'remote-unit'], + 'type': 'object'}, + 'RelationUnitPairs': {'additionalProperties': False, + 'properties': {'relation-unit-pairs': {'items': {'$ref': '#/definitions/RelationUnitPair'}, + 'type': 'array'}}, + 'required': ['relation-unit-pairs'], + 'type': 'object'}, + 'RelationUnitSettings': {'additionalProperties': False, + 'properties': {'application-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'relation': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', + 'unit', + 'settings', + 'application-settings'], + 'type': 'object'}, + 'RelationUnitStatus': {'additionalProperties': False, + 'properties': {'in-scope': {'type': 'boolean'}, + 'relation-tag': {'type': 'string'}, + 'suspended': {'type': 'boolean'}}, + 'required': ['relation-tag', + 'in-scope', + 'suspended'], + 'type': 'object'}, + 'RelationUnitStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'results': {'items': {'$ref': '#/definitions/RelationUnitStatus'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnitStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnits': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnit'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'app-changed': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}, + 'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsSettings': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationUnitsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ResolvedModeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'mode': {'type': 'string'}}, + 'required': ['mode'], + 'type': 'object'}, + 'ResolvedModeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResolvedModeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SetUnitStateArg': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-state': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'SetUnitStateArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetUnitStateArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'SettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StorageAddParams': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'storage': {'$ref': '#/definitions/StorageConstraints'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'name', 'storage'], + 'type': 'object'}, + 'StorageAttachment': {'additionalProperties': False, + 'properties': {'kind': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'location': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'owner-tag', + 'unit-tag', + 'kind', + 'location', + 'life'], + 'type': 'object'}, + 'StorageAttachmentId': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag'], + 'type': 'object'}, + 'StorageAttachmentIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/StorageAttachmentId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageAttachmentIdsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachmentIds'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentIdsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentIdsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StoragesAddParams': {'additionalProperties': False, + 'properties': {'storages': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}}, + 'required': ['storages'], + 'type': 'object'}, + 'StringBoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ok': {'type': 'boolean'}, + 'result': {'type': 'string'}}, + 'required': ['result', 'ok'], + 'type': 'object'}, + 'StringBoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringBoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UnitRefreshResult': {'additionalProperties': False, + 'properties': {'Error': {'$ref': '#/definitions/Error'}, + 'Life': {'type': 'string'}, + 'Resolved': {'type': 'string'}, + 'provider-id': {'type': 'string'}}, + 'required': ['Life', + 'Resolved', + 'Error'], + 'type': 'object'}, + 'UnitRefreshResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/UnitRefreshResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}, + 'UnitStateResult': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-state': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'type': 'object'}, + 'UnitStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UnitStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpgradeSeriesStatusParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'message': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['entity', + 'status', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'UpgradeSeriesStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusResult'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'ActionStatus': {'description': 'ActionStatus returns the ' + 'status of Actions by Tags ' + 'passed in.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Actions': {'description': 'Actions returns the Actions by ' + 'Tags passed and ensures that the ' + 'Unit asking\n' + 'for them is the same Unit that has ' + 'the Actions.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'AddMetricBatches': {'description': 'AddMetricBatches adds the ' + 'metrics for the specified ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/MetricBatchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AddUnitStorage': {'description': 'AddUnitStorage validates ' + 'and creates additional ' + 'storage instances for ' + 'units.\n' + 'Failures on an individual ' + 'storage instance do not ' + 'block remaining\n' + 'instances from being ' + 'processed.', + 'properties': {'Params': {'$ref': '#/definitions/StoragesAddParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AllMachinePorts': {'description': 'AllMachinePorts returns ' + 'all opened port ranges for ' + 'each given\n' + 'machine (on all ' + 'networks).\n' + '\n' + 'DEPRECATED: clients should ' + 'switch to the ' + 'OpenedMachinePortRanges ' + 'API call\n' + 'when using the V17+ API.\n' + '\n' + 'TODO(achilleasa): remove ' + 'from V17 once all client ' + 'references to this API\n' + 'have been changed to use ' + 'the new API.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachinePortsResults'}}, + 'type': 'object'}, + 'ApplicationStatus': {'description': 'ApplicationStatus ' + 'returns the status of ' + 'the Applications and its ' + 'workloads\n' + 'if the given unit is the ' + 'leader.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationStatusResults'}}, + 'type': 'object'}, + 'AssignedMachine': {'description': 'AssignedMachine returns ' + 'the machine tag for each ' + 'given unit tag, or\n' + 'an error satisfying ' + 'params.IsCodeNotAssigned ' + 'when a unit has no\n' + 'assigned machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'AvailabilityZone': {'description': 'AvailabilityZone returns ' + 'the availability zone for ' + 'each given unit, if ' + 'applicable.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'BeginActions': {'description': 'BeginActions marks the ' + 'actions represented by the ' + 'passed in Tags as running.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CanApplyLXDProfile': {'description': 'CanApplyLXDProfile is a ' + 'shim to call the ' + 'LXDProfileAPIv2 version ' + 'of this method.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'CharmArchiveSha256': {'description': 'CharmArchiveSha256 ' + 'returns the SHA256 ' + 'digest of the charm ' + 'archive\n' + '(bundle) data for each ' + 'charm url in the given ' + 'parameters.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CharmModifiedVersion': {'description': 'CharmModifiedVersion ' + 'returns the most ' + 'CharmModifiedVersion ' + 'for all given\n' + 'units or ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'CharmURL': {'description': 'CharmURL returns the charm URL ' + 'for all given units or ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'ClearResolved': {'description': 'ClearResolved removes any ' + 'resolved setting from each ' + 'given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ClosePorts': {'description': 'ClosePorts sets the policy of ' + 'the port range with protocol to ' + 'be\n' + 'closed, for all given units.', + 'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CloudAPIVersion': {'description': 'CloudAPIVersion returns ' + 'the cloud API version, if ' + 'available.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'CloudSpec': {'description': 'CloudSpec returns the cloud spec ' + 'used by the model in which the\n' + 'authenticated unit or ' + 'application resides.\n' + 'A check is made beforehand to ' + 'ensure that the request is made ' + 'by an entity\n' + 'that has been granted the ' + 'appropriate trust.', + 'properties': {'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'CommitHookChanges': {'description': 'CommitHookChanges ' + 'batches together all ' + 'required API calls for ' + 'applying\n' + 'a set of changes after a ' + 'hook successfully ' + 'completes and executes ' + 'them in a\n' + 'single transaction.', + 'properties': {'Params': {'$ref': '#/definitions/CommitHookChangesArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ConfigSettings': {'description': 'ConfigSettings returns the ' + 'complete set of application ' + 'charm config\n' + 'settings available to each ' + 'given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConfigSettingsResults'}}, + 'type': 'object'}, + 'CurrentModel': {'description': 'CurrentModel returns the name ' + 'and UUID for the current juju ' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelResult'}}, + 'type': 'object'}, + 'Destroy': {'description': 'Destroy advances all given Alive ' + "units' lifecycles as far as\n" + 'possible. See ' + 'state/Unit.Destroy().', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyAllSubordinates': {'description': 'DestroyAllSubordinates ' + 'destroys all ' + 'subordinates of ' + 'each given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyUnitStorageAttachments': {'description': 'DestroyUnitStorageAttachments ' + 'marks each ' + 'storage ' + 'attachment ' + 'of the\n' + 'specified ' + 'units as ' + 'Dying.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnsureDead': {'description': 'EnsureDead calls EnsureDead on ' + 'each given entity from state. ' + 'It\n' + 'will fail if the entity is not ' + "present. If it's Alive, nothing " + 'will\n' + 'happen (see state/EnsureDead() ' + 'for units or machines).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnterScope': {'description': 'EnterScope ensures each unit ' + 'has entered its scope in the ' + 'relation,\n' + 'for all of the given ' + 'relation/unit pairs. See also\n' + 'state.RelationUnit.EnterScope().', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FinishActions': {'description': 'FinishActions saves the ' + 'result of a completed Action', + 'properties': {'Params': {'$ref': '#/definitions/ActionExecutionResults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'GetMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, + 'type': 'object'}, + 'GetPodSpec': {'description': 'GetPodSpec gets the pod specs ' + 'for a set of applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GetPrincipal': {'description': 'GetPrincipal returns the ' + 'result of calling ' + 'PrincipalName() and\n' + 'converting it to a tag, on ' + 'each given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'GetRawK8sSpec': {'description': 'GetRawK8sSpec gets the raw ' + 'k8s specs for a set of ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GoalStates': {'description': 'GoalStates returns information ' + 'of charm units and relations.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GoalStateResults'}}, + 'type': 'object'}, + 'HasSubordinates': {'description': 'HasSubordinates returns ' + 'the whether each given ' + 'unit has any subordinates.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'LXDProfileName': {'description': 'LXDProfileName is a shim to ' + 'call the LXDProfileAPIv2 ' + 'version of this method.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'LXDProfileRequired': {'description': 'LXDProfileRequired is a ' + 'shim to call the ' + 'LXDProfileAPIv2 version ' + 'of this method.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'LeaveScope': {'description': 'LeaveScope signals each unit ' + 'has left its scope in the ' + 'relation,\n' + 'for all of the given ' + 'relation/unit pairs. See also\n' + 'state.RelationUnit.LeaveScope().', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'LogActionsMessages': {'description': 'LogActionsMessages ' + 'records the log ' + 'messages against the ' + 'specified actions.', + 'properties': {'Params': {'$ref': '#/definitions/ActionMessageParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Merge': {'description': 'Merge merges in the provided ' + 'leadership settings. Only leaders ' + 'for\n' + 'the given service may perform this ' + 'operation.', + 'properties': {'Params': {'$ref': '#/definitions/MergeLeadershipSettingsBulkParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' + 'that this unit resides in.\n' + 'It is implemented here directly ' + 'as a result of removing it from\n' + 'embedded APIAddresser *without* ' + 'bumping the facade version.\n' + 'It should be blanked when this ' + 'facade version is next ' + 'incremented.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'NetworkInfo': {'description': 'NetworkInfo returns network ' + 'interfaces/addresses for ' + 'specified bindings.', + 'properties': {'Params': {'$ref': '#/definitions/NetworkInfoParams'}, + 'Result': {'$ref': '#/definitions/NetworkInfoResults'}}, + 'type': 'object'}, + 'OpenPorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'OpenedMachinePortRangesByEndpoint': {'description': 'OpenedMachinePortRangesByEndpoint ' + 'returns ' + 'the port ' + 'ranges ' + 'opened ' + 'by each\n' + 'unit on ' + 'the ' + 'provided ' + 'machines ' + 'grouped ' + 'by ' + 'application ' + 'endpoint.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/OpenMachinePortRangesByEndpointResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'description': 'PrivateAddress returns the ' + 'private address for each ' + 'given unit, if set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'ProviderType': {'description': 'ProviderType returns the ' + 'provider type used by the ' + 'current juju\n' + 'model.\n' + '\n' + 'TODO(dimitern): Refactor the ' + 'uniter to call this instead ' + 'of calling\n' + 'ModelConfig() just to get the ' + 'provider type. Once we have ' + 'machine\n' + 'addresses, this might be ' + 'completely unnecessary ' + 'though.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PublicAddress': {'description': 'PublicAddress returns the ' + 'public address for each ' + 'given unit, if set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Read': {'description': 'Read reads leadership settings for ' + 'the provided service ID. Any\n' + 'unit of the service may perform this ' + 'operation.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GetLeadershipSettingsBulkResults'}}, + 'type': 'object'}, + 'ReadLocalApplicationSettings': {'description': 'ReadLocalApplicationSettings ' + 'returns the ' + 'local ' + 'application ' + 'settings for ' + 'a\n' + 'particular ' + 'relation when ' + 'invoked by ' + 'the leader ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnit'}, + 'Result': {'$ref': '#/definitions/SettingsResult'}}, + 'type': 'object'}, + 'ReadRemoteSettings': {'description': 'ReadRemoteSettings ' + 'returns the remote ' + 'settings of each given ' + 'set of\n' + 'relation/local ' + 'unit/remote unit.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnitPairs'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'ReadSettings': {'description': 'ReadSettings returns the ' + 'local settings of each given ' + 'set of\n' + 'relation/unit.\n' + '\n' + 'NOTE(achilleasa): Using this ' + 'call to read application data ' + 'is deprecated\n' + 'and will not work for k8s ' + 'charms (see LP1876097). ' + 'Instead, clients should\n' + 'use ' + 'ReadLocalApplicationSettings.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'Refresh': {'description': 'Refresh retrieves the latest ' + 'values for attributes on this ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitRefreshResults'}}, + 'type': 'object'}, + 'Relation': {'description': 'Relation returns information ' + 'about all given relation/unit ' + 'pairs,\n' + 'including their id, key and the ' + 'local endpoint.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationById': {'description': 'RelationById returns ' + 'information about all given ' + 'relations,\n' + 'specified by their ids, ' + 'including their key and the ' + 'local\n' + 'endpoint.', + 'properties': {'Params': {'$ref': '#/definitions/RelationIds'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationsStatus': {'description': 'RelationsStatus returns ' + 'for each unit the ' + 'corresponding relation and ' + 'status information.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RelationUnitStatusResults'}}, + 'type': 'object'}, + 'RemoveStorageAttachments': {'description': 'RemoveStorageAttachments ' + 'removes the ' + 'specified ' + 'storage\n' + 'attachments from ' + 'state.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RequestReboot': {'description': 'RequestReboot sets the ' + 'reboot flag on the provided ' + 'machines', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Resolved': {'description': 'Resolved returns the current ' + 'resolved setting for each given ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ResolvedModeResults'}}, + 'type': 'object'}, + 'SLALevel': {'description': "SLALevel returns the model's SLA " + 'level.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetAgentStatus': {'description': 'SetAgentStatus will set ' + 'status for agents of Units ' + 'passed in args, if one\n' + 'of the args is not an Unit ' + 'it will fail.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetApplicationStatus': {'description': 'SetApplicationStatus ' + 'sets the status for ' + 'all the Applications ' + 'in args if the given ' + 'Unit is\n' + 'the leader.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharmURL': {'description': 'SetCharmURL sets the charm URL ' + 'for each given unit. An error ' + 'will\n' + 'be returned if a unit is dead, ' + 'or the charm URL is not known.', + 'properties': {'Params': {'$ref': '#/definitions/EntitiesCharmURL'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRelationStatus': {'description': 'SetRelationStatus ' + 'updates the status of ' + 'the specified relations.', + 'properties': {'Params': {'$ref': '#/definitions/RelationStatusArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetState': {'description': 'SetState sets the state persisted ' + 'by the charm running in this ' + 'unit\n' + 'and the state internal to the ' + 'uniter for this unit.', + 'properties': {'Params': {'$ref': '#/definitions/SetUnitStateArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus will set status for a ' + 'entities passed in args. If the ' + 'entity is\n' + 'a Unit it will instead set ' + 'status to its agent, to emulate ' + 'backwards\n' + 'compatibility.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUnitStatus': {'description': 'SetUnitStatus sets status ' + 'for all elements passed in ' + 'args, the difference\n' + 'with SetStatus is that if an ' + 'entity is a Unit it will set ' + 'its status instead\n' + 'of its agent.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUpgradeSeriesUnitStatus': {'description': 'SetUpgradeSeriesUnitStatus ' + 'sets the ' + 'upgrade series ' + 'status of the ' + 'unit.\n' + 'If no upgrade ' + 'is in progress ' + 'an error is ' + 'returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetWorkloadVersion': {'description': 'SetWorkloadVersion sets ' + 'the workload version ' + 'for each given unit. An ' + 'error will\n' + 'be returned if a unit ' + 'is dead.', + 'properties': {'Params': {'$ref': '#/definitions/EntityWorkloadVersions'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'State': {'description': 'State returns the state persisted by ' + 'the charm running in this unit\n' + 'and the state internal to the uniter ' + 'for this unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitStateResults'}}, + 'type': 'object'}, + 'StorageAttachmentLife': {'description': 'StorageAttachmentLife ' + 'returns the ' + 'lifecycle state of ' + 'the storage ' + 'attachments\n' + 'with the specified ' + 'tags.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'StorageAttachments': {'description': 'StorageAttachments ' + 'returns the storage ' + 'attachments with the ' + 'specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentResults'}}, + 'type': 'object'}, + 'UnitStatus': {'description': 'UnitStatus returns the workload ' + 'status information for the ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'UnitStorageAttachments': {'description': 'UnitStorageAttachments ' + 'returns the IDs of ' + 'storage attachments ' + 'for a collection of ' + 'units.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentIdsResults'}}, + 'type': 'object'}, + 'UpdateNetworkInfo': {'description': 'UpdateNetworkInfo ' + 'refreshes the network ' + "settings for a unit's " + 'bound\n' + 'endpoints.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateSettings': {'description': 'UpdateSettings persists all ' + 'changes made to the local ' + 'settings of\n' + 'all given pairs of relation ' + 'and unit. Keys with empty ' + 'values are\n' + 'considered a signal to ' + 'delete these values.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnitsSettings'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpgradeSeriesUnitStatus': {'description': 'UpgradeSeriesUnitStatus ' + 'returns the ' + 'current ' + 'preparation status ' + 'of an\n' + 'upgrading unit.\n' + 'If no series ' + 'upgrade is in ' + 'progress an error ' + 'is returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchActionNotifications': {'description': 'WatchActionNotifications ' + 'returns a ' + 'StringsWatcher ' + 'for observing\n' + 'incoming action ' + 'calls to a unit. ' + 'See also ' + 'state/watcher.go\n' + 'Unit.WatchActionNotifications(). ' + 'This method is ' + 'called from\n' + 'api/uniter/uniter.go ' + 'WatchActionNotifications().', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchConfigSettingsHash': {'description': 'WatchConfigSettingsHash ' + 'returns a ' + 'StringsWatcher ' + 'that yields a ' + 'hash\n' + 'of the config ' + 'values every time ' + 'the config ' + 'changes. The ' + 'uniter can\n' + 'save this hash and ' + 'use it to decide ' + 'whether the ' + 'config-changed ' + 'hook\n' + 'needs to be run ' + '(or whether this ' + 'was just an agent ' + 'restart with no\n' + 'substantive config ' + 'change).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchInstanceData': {'description': 'WatchInstanceData is a ' + 'shim to call the ' + 'LXDProfileAPIv2 version ' + 'of this method.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchLeadershipSettings': {'description': 'WatchLeadershipSettings ' + 'will block the ' + 'caller until ' + 'leadership ' + 'settings\n' + 'for the given ' + 'service ID change.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchRelationUnits': {'description': 'WatchRelationUnits ' + 'returns a ' + 'RelationUnitsWatcher ' + 'for observing\n' + 'changes to every unit ' + 'in the supplied ' + 'relation that is ' + 'visible to\n' + 'the supplied unit. See ' + 'also ' + 'state/watcher.go:RelationUnit.Watch().', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, + 'type': 'object'}, + 'WatchStorageAttachments': {'description': 'WatchStorageAttachments ' + 'creates watchers ' + 'for a collection ' + 'of storage\n' + 'attachments, each ' + 'of which can be ' + 'used to watch ' + 'changes to ' + 'storage\n' + 'attachment info.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchTrustConfigSettingsHash': {'description': 'WatchTrustConfigSettingsHash ' + 'returns a ' + 'StringsWatcher ' + 'that yields ' + 'a\n' + 'hash of the ' + 'application ' + 'config values ' + 'whenever they ' + 'change. The\n' + 'uniter can ' + 'use the hash ' + 'to determine ' + 'whether the ' + 'actual values ' + 'have\n' + 'changed since ' + 'it last saw ' + 'the config.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitAddressesHash': {'description': 'WatchUnitAddressesHash ' + 'returns a ' + 'StringsWatcher that ' + 'yields the\n' + 'hashes of the ' + 'addresses for the ' + 'unit whenever the ' + 'addresses\n' + 'change. The uniter ' + 'can use the hash to ' + 'determine whether ' + 'the actual\n' + 'address values have ' + 'changed since it ' + 'last saw the ' + 'config.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitRelations': {'description': 'WatchUnitRelations ' + 'returns a ' + 'StringsWatcher, for ' + 'each given\n' + 'unit, that notifies of ' + 'changes to the ' + 'lifecycles of ' + 'relations\n' + 'relevant to that unit. ' + 'For principal units, ' + 'this will be all of ' + 'the\n' + 'relations for the ' + 'application. For ' + 'subordinate units, ' + 'only\n' + 'relations with the ' + "principal unit's " + 'application will be ' + 'monitored.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitStorageAttachments': {'description': 'WatchUnitStorageAttachments ' + 'creates ' + 'watchers for a ' + 'collection of ' + 'units,\n' + 'each of which ' + 'can be used to ' + 'watch for ' + 'lifecycle ' + 'changes to the ' + 'corresponding\n' + "unit's storage " + 'attachments.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'description': 'WatchUpgradeSeriesNotifications ' + 'returns a ' + 'NotifyWatcher ' + 'for ' + 'observing ' + 'changes to ' + 'upgrade ' + 'series ' + 'locks.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WorkloadVersion': {'description': 'WorkloadVersion returns ' + 'the workload version for ' + 'all given units or ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def 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=17, + params=_params) + + reply = await self.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='Uniter', + request='APIHostPorts', + version=17, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def 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=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def 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=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=17, + params=_params) + _params['batches'] = batches + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddUnitStorage(self, storages=None): + ''' + AddUnitStorage validates and creates additional storage instances for units. + Failures on an individual storage instance do not block remaining + instances from being processed. + + storages : typing.Sequence[~StorageAddParams] + Returns -> ErrorResults + ''' + 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='Uniter', + request='AddUnitStorage', + version=17, + params=_params) + _params['storages'] = storages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachinePortsResults) + async def AllMachinePorts(self, entities=None): + ''' + AllMachinePorts returns all opened port ranges for each given + machine (on all networks). + + DEPRECATED: clients should switch to the OpenedMachinePortRanges API call + when using the V17+ API. + + TODO(achilleasa): remove from V17 once all client references to this API + have been changed to use the new API. + + entities : typing.Sequence[~Entity] + Returns -> MachinePortsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='AllMachinePorts', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationStatusResults) + async def ApplicationStatus(self, entities=None): + ''' + ApplicationStatus returns the status of the Applications and its workloads + if the given unit is the leader. + + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ApplicationStatus', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AssignedMachine(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. + + 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='AssignedMachine', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + AvailabilityZone returns the availability zone for each given unit, if applicable. + + 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='AvailabilityZone', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.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='Uniter', + request='BeginActions', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def CanApplyLXDProfile(self, entities=None): + ''' + CanApplyLXDProfile is a shim to call the LXDProfileAPIv2 version of this method. + + 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='CanApplyLXDProfile', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def CharmArchiveSha256(self, urls=None): + ''' + CharmArchiveSha256 returns the SHA256 digest of the charm archive + (bundle) data for each charm url in the given parameters. + + 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='CharmArchiveSha256', + version=17, + params=_params) + _params['urls'] = urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def CharmModifiedVersion(self, entities=None): + ''' + CharmModifiedVersion returns the most CharmModifiedVersion for all given + units or applications. + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CharmModifiedVersion', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def CharmURL(self, entities=None): + ''' + CharmURL returns the charm URL for all given units or applications. + + 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='CharmURL', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClearResolved(self, entities=None): + ''' + ClearResolved removes any resolved setting from each given unit. + + 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='ClearResolved', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClosePorts(self, entities=None): + ''' + ClosePorts sets the policy of the port range with protocol to be + closed, for all given units. + + entities : typing.Sequence[~EntityPortRange] + 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='ClosePorts', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def CloudAPIVersion(self): + ''' + CloudAPIVersion returns the cloud API version, if available. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudAPIVersion', + version=17, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def CloudSpec(self): + ''' + 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. + + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudSpec', + version=17, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def CommitHookChanges(self, args=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. + + 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='CommitHookChanges', + version=17, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConfigSettingsResults) + async def ConfigSettings(self, entities=None): + ''' + ConfigSettings returns the complete set of application charm config + settings available to each given unit. + + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ConfigSettings', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelResult) + async def 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='Uniter', + request='CurrentModel', + version=17, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Destroy(self, entities=None): + ''' + Destroy advances all given Alive units' lifecycles as far as + possible. See state/Unit.Destroy(). + + 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='Destroy', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyAllSubordinates(self, entities=None): + ''' + DestroyAllSubordinates destroys all subordinates of each given unit. + + 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='DestroyAllSubordinates', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyUnitStorageAttachments(self, entities=None): + ''' + DestroyUnitStorageAttachments marks each storage attachment of the + specified units as Dying. + + 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='DestroyUnitStorageAttachments', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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='Uniter', + request='EnsureDead', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnterScope(self, relation_units=None): + ''' + EnterScope ensures each unit has entered its scope in the relation, + for all of the given relation/unit pairs. See also + state.RelationUnit.EnterScope(). + + 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='EnterScope', + version=17, + params=_params) + _params['relation-units'] = relation_units + reply = await self.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='Uniter', + request='FinishActions', + version=17, + params=_params) + _params['results'] = results + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): + ''' + 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='GetMeterStatus', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetPodSpec(self, entities=None): + ''' + GetPodSpec gets the pod 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='GetPodSpec', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def GetPrincipal(self, entities=None): + ''' + GetPrincipal returns the result of calling PrincipalName() and + converting it to a tag, on each given unit. + + 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='GetPrincipal', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetRawK8sSpec(self, entities=None): + ''' + 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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['urls'] = urls + reply = await self.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=17, + params=_params) + _params['relation-units'] = relation_units + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['messages'] = messages + reply = await self.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=17, + params=_params) + _params['params'] = params + reply = await self.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=17, + params=_params) + + reply = await self.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=17, + params=_params) + + reply = await self.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=17, + params=_params) + _params['bindings'] = bindings + _params['relation-id'] = relation_id + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def OpenPorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='OpenPorts', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OpenMachinePortRangesByEndpointResults) + 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 -> OpenMachinePortRangesByEndpointResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['relation'] = relation + _params['unit'] = unit + reply = await self.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=17, + params=_params) + _params['relation-unit-pairs'] = relation_unit_pairs + reply = await self.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=17, + params=_params) + _params['relation-units'] = relation_units + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['relation-units'] = relation_units + reply = await self.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=17, + params=_params) + _params['relation-ids'] = relation_ids + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['ids'] = ids + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['args'] = args + reply = await self.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=17, + params=_params) + _params['args'] = args + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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='SetWorkloadVersion', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitStateResults) + async def 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='Uniter', + request='State', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def StorageAttachmentLife(self, ids=None): + ''' + StorageAttachmentLife returns the lifecycle state of the storage attachments + with the specified tags. + + ids : typing.Sequence[~StorageAttachmentId] + 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='Uniter', + request='StorageAttachmentLife', + version=17, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentResults) + async def StorageAttachments(self, ids=None): + ''' + StorageAttachments returns the storage attachments with the specified tags. + + 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='StorageAttachments', + version=17, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def UnitStatus(self, entities=None): + ''' + UnitStatus returns the workload status information for the unit. + + 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='Uniter', + request='UnitStatus', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentIdsResults) + async def UnitStorageAttachments(self, entities=None): + ''' + UnitStorageAttachments returns the IDs of storage attachments for a collection of units. + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='UnitStorageAttachments', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateNetworkInfo(self, entities=None): + ''' + UpdateNetworkInfo refreshes the network settings for a unit's bound + endpoints. + + 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='UpdateNetworkInfo', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateSettings(self, relation_units=None): + ''' + UpdateSettings persists all changes made to the local settings of + all given pairs of relation and unit. Keys with empty values are + considered a signal to delete these values. + + relation_units : typing.Sequence[~RelationUnitSettings] + 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='UpdateSettings', + version=17, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def 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='Uniter', + request='UpgradeSeriesUnitStatus', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.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='Uniter', + request='Watch', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchAPIHostPorts', + version=17, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(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(). + + 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='WatchActionNotifications', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchConfigSettingsHash(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). + + 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='WatchConfigSettingsHash', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.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=17, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchInstanceData(self, entities=None): + ''' + WatchInstanceData is a shim to call the LXDProfileAPIv2 version of this method. + + 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='WatchInstanceData', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchLeadershipSettings(self, entities=None): + ''' + WatchLeadershipSettings will block the caller until leadership settings + for the given service ID change. + + 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='WatchLeadershipSettings', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMeterStatus(self, entities=None): + ''' + 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='WatchMeterStatus', + version=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitsWatchResults) + async def 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=17, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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=17, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def 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=17, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client18.py b/juju/client/old_clients/_client18.py new file mode 100644 index 000000000..9ee3b3477 --- /dev/null +++ b/juju/client/old_clients/_client18.py @@ -0,0 +1,3912 @@ +# 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.old_clients._definitions import * + + +class UniterFacade(Type): + name = 'Uniter' + version = 18 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionExecutionResult': {'additionalProperties': False, + 'properties': {'action-tag': {'type': 'string'}, + 'message': {'type': 'string'}, + 'results': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'status': {'type': 'string'}}, + 'required': ['action-tag', 'status'], + 'type': 'object'}, + 'ActionExecutionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionExecutionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionMessage': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}}, + 'required': ['timestamp', 'message'], + 'type': 'object'}, + 'ActionMessageParams': {'additionalProperties': False, + 'properties': {'messages': {'items': {'$ref': '#/definitions/EntityString'}, + 'type': 'array'}}, + 'required': ['messages'], + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'log': {'items': {'$ref': '#/definitions/ActionMessage'}, + 'type': 'array'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + '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'}, + 'ApplicationStatusResult': {'additionalProperties': False, + 'properties': {'application': {'$ref': '#/definitions/StatusResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/StatusResult'}}, + 'type': 'object'}}, + 'required': ['application', + 'units'], + 'type': 'object'}, + 'ApplicationStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'CharmURLs': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/CharmURL'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + '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'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CommitHookChangesArg': {'additionalProperties': False, + 'properties': {'add-storage': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}, + 'close-ports': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}, + 'open-ports': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}, + 'pod-spec': {'$ref': '#/definitions/PodSpec'}, + 'relation-unit-settings': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}, + 'set-raw-k8s-spec': {'$ref': '#/definitions/PodSpec'}, + 'tag': {'type': 'string'}, + 'unit-state': {'$ref': '#/definitions/SetUnitStateArg'}, + 'update-network-info': {'type': 'boolean'}}, + 'required': ['tag', + 'update-network-info'], + 'type': 'object'}, + 'CommitHookChangesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/CommitHookChangesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'ConfigSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'ConfigSettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConfigSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Endpoint': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'relation': {'$ref': '#/definitions/CharmRelation'}}, + 'required': ['application-name', 'relation'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesCharmURL': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityCharmURL'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesPortRanges': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityCharmURL': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'charm-url'], + 'type': 'object'}, + 'EntityPortRange': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['tag', + 'protocol', + 'from-port', + 'to-port', + 'endpoint'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'EntityString': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['tag', 'value'], + 'type': 'object'}, + 'EntityWorkloadVersion': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'workload-version': {'type': 'string'}}, + 'required': ['tag', + 'workload-version'], + 'type': 'object'}, + 'EntityWorkloadVersions': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityWorkloadVersion'}, + 'type': 'array'}}, + 'required': ['entities'], + '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'}, + 'GetLeadershipSettingsBulkResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GetLeadershipSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'GoalState': {'additionalProperties': False, + 'properties': {'relations': {'patternProperties': {'.*': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'required': ['units', 'relations'], + 'type': 'object'}, + 'GoalStateResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/GoalState'}}, + 'required': ['result', 'error'], + 'type': 'object'}, + 'GoalStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GoalStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GoalStateStatus': {'additionalProperties': False, + 'properties': {'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'since'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + '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'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'InterfaceAddress': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'hostname': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['hostname', 'value', 'cidr'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachinePortRange': {'additionalProperties': False, + 'properties': {'port-range': {'$ref': '#/definitions/PortRange'}, + 'relation-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-tag', + 'port-range'], + 'type': 'object'}, + 'MachinePortsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ports': {'items': {'$ref': '#/definitions/MachinePortRange'}, + 'type': 'array'}}, + 'required': ['ports'], + 'type': 'object'}, + 'MachinePortsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachinePortsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MergeLeadershipSettingsBulkParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MergeLeadershipSettingsParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MergeLeadershipSettingsParam': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['settings'], + 'type': 'object'}, + 'MeterStatusResult': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}}, + 'required': ['code', 'info'], + 'type': 'object'}, + 'MeterStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Metric': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'labels': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['key', 'value', 'time'], + 'type': 'object'}, + 'MetricBatch': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'created': {'format': 'date-time', + 'type': 'string'}, + 'metrics': {'items': {'$ref': '#/definitions/Metric'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'charm-url', + 'created', + 'metrics'], + 'type': 'object'}, + 'MetricBatchParam': {'additionalProperties': False, + 'properties': {'batch': {'$ref': '#/definitions/MetricBatch'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'batch'], + 'type': 'object'}, + 'MetricBatchParams': {'additionalProperties': False, + 'properties': {'batches': {'items': {'$ref': '#/definitions/MetricBatchParam'}, + 'type': 'array'}}, + 'required': ['batches'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'type'], + 'type': 'object'}, + 'NetworkInfo': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/InterfaceAddress'}, + 'type': 'array'}, + 'interface-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['mac-address', + 'interface-name', + 'addresses'], + 'type': 'object'}, + 'NetworkInfoParams': {'additionalProperties': False, + 'properties': {'bindings': {'items': {'type': 'string'}, + 'type': 'array'}, + 'relation-id': {'type': 'integer'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'bindings'], + 'type': 'object'}, + 'NetworkInfoResult': {'additionalProperties': False, + 'properties': {'bind-addresses': {'items': {'$ref': '#/definitions/NetworkInfo'}, + 'type': 'array'}, + 'egress-subnets': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'ingress-addresses': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'NetworkInfoResults': {'additionalProperties': False, + 'properties': {'results': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInfoResult'}}, + 'type': 'object'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'OpenMachinePortRangesByEndpointResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'unit-port-ranges': {'patternProperties': {'.*': {'items': {'$ref': '#/definitions/OpenUnitPortRangesByEndpoint'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'required': ['unit-port-ranges'], + 'type': 'object'}, + 'OpenMachinePortRangesByEndpointResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/OpenMachinePortRangesByEndpointResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'OpenUnitPortRangesByEndpoint': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'port-ranges': {'items': {'$ref': '#/definitions/PortRange'}, + 'type': 'array'}}, + 'required': ['endpoint', + 'port-ranges'], + 'type': 'object'}, + 'PodSpec': {'additionalProperties': False, + 'properties': {'spec': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'RelationIds': {'additionalProperties': False, + 'properties': {'relation-ids': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['relation-ids'], + 'type': 'object'}, + 'RelationResult': {'additionalProperties': False, + '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'}}, + 'required': ['life', + 'id', + 'key', + 'endpoint'], + 'type': 'object'}, + 'RelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationStatusArg': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'relation-id': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-id', + 'status', + 'message'], + 'type': 'object'}, + 'RelationStatusArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RelationStatusArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'RelationUnit': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', 'unit'], + 'type': 'object'}, + 'RelationUnitPair': {'additionalProperties': False, + 'properties': {'local-unit': {'type': 'string'}, + 'relation': {'type': 'string'}, + 'remote-unit': {'type': 'string'}}, + 'required': ['relation', + 'local-unit', + 'remote-unit'], + 'type': 'object'}, + 'RelationUnitPairs': {'additionalProperties': False, + 'properties': {'relation-unit-pairs': {'items': {'$ref': '#/definitions/RelationUnitPair'}, + 'type': 'array'}}, + 'required': ['relation-unit-pairs'], + 'type': 'object'}, + 'RelationUnitSettings': {'additionalProperties': False, + 'properties': {'application-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'relation': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', + 'unit', + 'settings', + 'application-settings'], + 'type': 'object'}, + 'RelationUnitStatus': {'additionalProperties': False, + 'properties': {'in-scope': {'type': 'boolean'}, + 'relation-tag': {'type': 'string'}, + 'suspended': {'type': 'boolean'}}, + 'required': ['relation-tag', + 'in-scope', + 'suspended'], + 'type': 'object'}, + 'RelationUnitStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'results': {'items': {'$ref': '#/definitions/RelationUnitStatus'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnitStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnits': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnit'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'app-changed': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}, + 'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsSettings': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationUnitsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ResolvedModeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'mode': {'type': 'string'}}, + 'required': ['mode'], + 'type': 'object'}, + 'ResolvedModeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResolvedModeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SetUnitStateArg': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-state': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'SetUnitStateArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetUnitStateArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'SettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StorageAddParams': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'storage': {'$ref': '#/definitions/StorageConstraints'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'name', 'storage'], + 'type': 'object'}, + 'StorageAttachment': {'additionalProperties': False, + 'properties': {'kind': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'location': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'owner-tag', + 'unit-tag', + 'kind', + 'location', + 'life'], + 'type': 'object'}, + 'StorageAttachmentId': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag'], + 'type': 'object'}, + 'StorageAttachmentIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/StorageAttachmentId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageAttachmentIdsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachmentIds'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentIdsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentIdsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StoragesAddParams': {'additionalProperties': False, + 'properties': {'storages': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}}, + 'required': ['storages'], + 'type': 'object'}, + 'StringBoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ok': {'type': 'boolean'}, + 'result': {'type': 'string'}}, + 'required': ['result', 'ok'], + 'type': 'object'}, + 'StringBoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringBoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UnitRefreshResult': {'additionalProperties': False, + 'properties': {'Error': {'$ref': '#/definitions/Error'}, + 'Life': {'type': 'string'}, + 'Resolved': {'type': 'string'}, + 'provider-id': {'type': 'string'}}, + 'required': ['Life', + 'Resolved', + 'Error'], + 'type': 'object'}, + 'UnitRefreshResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/UnitRefreshResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}, + 'UnitStateResult': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-state': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'type': 'object'}, + 'UnitStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UnitStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpgradeSeriesStatusParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'message': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['entity', + 'status', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'status': {'type': 'string'}, + 'target': {'type': 'string'}}, + 'type': 'object'}, + 'UpgradeSeriesStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusResult'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'ActionStatus': {'description': 'ActionStatus returns the ' + 'status of Actions by Tags ' + 'passed in.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Actions': {'description': 'Actions returns the Actions by ' + 'Tags passed and ensures that the ' + 'Unit asking\n' + 'for them is the same Unit that has ' + 'the Actions.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'AddMetricBatches': {'description': 'AddMetricBatches adds the ' + 'metrics for the specified ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/MetricBatchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AddUnitStorage': {'description': 'AddUnitStorage validates ' + 'and creates additional ' + 'storage instances for ' + 'units.\n' + 'Failures on an individual ' + 'storage instance do not ' + 'block remaining\n' + 'instances from being ' + 'processed.', + 'properties': {'Params': {'$ref': '#/definitions/StoragesAddParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AllMachinePorts': {'description': 'AllMachinePorts returns ' + 'all opened port ranges for ' + 'each given\n' + 'machine (on all ' + 'networks).\n' + '\n' + 'DEPRECATED: clients should ' + 'switch to the ' + 'OpenedMachinePortRanges ' + 'API call\n' + 'when using the V17+ API.\n' + '\n' + 'TODO(achilleasa): remove ' + 'from V17 once all client ' + 'references to this API\n' + 'have been changed to use ' + 'the new API.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachinePortsResults'}}, + 'type': 'object'}, + 'ApplicationStatus': {'description': 'ApplicationStatus ' + 'returns the status of ' + 'the Applications and its ' + 'workloads\n' + 'if the given unit is the ' + 'leader.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationStatusResults'}}, + 'type': 'object'}, + 'AssignedMachine': {'description': 'AssignedMachine returns ' + 'the machine tag for each ' + 'given unit tag, or\n' + 'an error satisfying ' + 'params.IsCodeNotAssigned ' + 'when a unit has no\n' + 'assigned machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'AvailabilityZone': {'description': 'AvailabilityZone returns ' + 'the availability zone for ' + 'each given unit, if ' + 'applicable.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'BeginActions': {'description': 'BeginActions marks the ' + 'actions represented by the ' + 'passed in Tags as running.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CanApplyLXDProfile': {'description': 'CanApplyLXDProfile is a ' + 'shim to call the ' + 'LXDProfileAPIv2 version ' + 'of this method.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'CharmArchiveSha256': {'description': 'CharmArchiveSha256 ' + 'returns the SHA256 ' + 'digest of the charm ' + 'archive\n' + '(bundle) data for each ' + 'charm url in the given ' + 'parameters.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CharmModifiedVersion': {'description': 'CharmModifiedVersion ' + 'returns the most ' + 'CharmModifiedVersion ' + 'for all given\n' + 'units or ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'CharmURL': {'description': 'CharmURL returns the charm URL ' + 'for all given units or ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'ClearResolved': {'description': 'ClearResolved removes any ' + 'resolved setting from each ' + 'given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ClosePorts': {'description': 'ClosePorts sets the policy of ' + 'the port range with protocol to ' + 'be\n' + 'closed, for all given units.', + 'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CloudAPIVersion': {'description': 'CloudAPIVersion returns ' + 'the cloud API version, if ' + 'available.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'CloudSpec': {'description': 'CloudSpec returns the cloud spec ' + 'used by the model in which the\n' + 'authenticated unit or ' + 'application resides.\n' + 'A check is made beforehand to ' + 'ensure that the request is made ' + 'by an entity\n' + 'that has been granted the ' + 'appropriate trust.', + 'properties': {'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'CommitHookChanges': {'description': 'CommitHookChanges ' + 'batches together all ' + 'required API calls for ' + 'applying\n' + 'a set of changes after a ' + 'hook successfully ' + 'completes and executes ' + 'them in a\n' + 'single transaction.', + 'properties': {'Params': {'$ref': '#/definitions/CommitHookChangesArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ConfigSettings': {'description': 'ConfigSettings returns the ' + 'complete set of application ' + 'charm config\n' + 'settings available to each ' + 'given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConfigSettingsResults'}}, + 'type': 'object'}, + 'CurrentModel': {'description': 'CurrentModel returns the name ' + 'and UUID for the current juju ' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelResult'}}, + 'type': 'object'}, + 'Destroy': {'description': 'Destroy advances all given Alive ' + "units' lifecycles as far as\n" + 'possible. See ' + 'state/Unit.Destroy().', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyAllSubordinates': {'description': 'DestroyAllSubordinates ' + 'destroys all ' + 'subordinates of ' + 'each given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyUnitStorageAttachments': {'description': 'DestroyUnitStorageAttachments ' + 'marks each ' + 'storage ' + 'attachment ' + 'of the\n' + 'specified ' + 'units as ' + 'Dying.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnsureDead': {'description': 'EnsureDead calls EnsureDead on ' + 'each given entity from state. ' + 'It\n' + 'will fail if the entity is not ' + "present. If it's Alive, nothing " + 'will\n' + 'happen (see state/EnsureDead() ' + 'for units or machines).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnterScope': {'description': 'EnterScope ensures each unit ' + 'has entered its scope in the ' + 'relation,\n' + 'for all of the given ' + 'relation/unit pairs. See also\n' + 'state.RelationUnit.EnterScope().', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FinishActions': {'description': 'FinishActions saves the ' + 'result of a completed Action', + 'properties': {'Params': {'$ref': '#/definitions/ActionExecutionResults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'GetMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, + 'type': 'object'}, + 'GetPodSpec': {'description': 'GetPodSpec gets the pod specs ' + 'for a set of applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GetPrincipal': {'description': 'GetPrincipal returns the ' + 'result of calling ' + 'PrincipalName() and\n' + 'converting it to a tag, on ' + 'each given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'GetRawK8sSpec': {'description': 'GetRawK8sSpec gets the raw ' + 'k8s specs for a set of ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GoalStates': {'description': 'GoalStates returns information ' + 'of charm units and relations.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GoalStateResults'}}, + 'type': 'object'}, + 'HasSubordinates': {'description': 'HasSubordinates returns ' + 'the whether each given ' + 'unit has any subordinates.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'LXDProfileName': {'description': 'LXDProfileName is a shim to ' + 'call the LXDProfileAPIv2 ' + 'version of this method.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'LXDProfileRequired': {'description': 'LXDProfileRequired is a ' + 'shim to call the ' + 'LXDProfileAPIv2 version ' + 'of this method.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'LeaveScope': {'description': 'LeaveScope signals each unit ' + 'has left its scope in the ' + 'relation,\n' + 'for all of the given ' + 'relation/unit pairs. See also\n' + 'state.RelationUnit.LeaveScope().', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'LogActionsMessages': {'description': 'LogActionsMessages ' + 'records the log ' + 'messages against the ' + 'specified actions.', + 'properties': {'Params': {'$ref': '#/definitions/ActionMessageParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Merge': {'description': 'Merge merges in the provided ' + 'leadership settings. Only leaders ' + 'for\n' + 'the given service may perform this ' + 'operation.', + 'properties': {'Params': {'$ref': '#/definitions/MergeLeadershipSettingsBulkParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' + 'that this unit resides in.\n' + 'It is implemented here directly ' + 'as a result of removing it from\n' + 'embedded APIAddresser *without* ' + 'bumping the facade version.\n' + 'It should be blanked when this ' + 'facade version is next ' + 'incremented.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'NetworkInfo': {'description': 'NetworkInfo returns network ' + 'interfaces/addresses for ' + 'specified bindings.', + 'properties': {'Params': {'$ref': '#/definitions/NetworkInfoParams'}, + 'Result': {'$ref': '#/definitions/NetworkInfoResults'}}, + 'type': 'object'}, + 'OpenPorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'OpenedMachinePortRangesByEndpoint': {'description': 'OpenedMachinePortRangesByEndpoint ' + 'returns ' + 'the port ' + 'ranges ' + 'opened ' + 'by each\n' + 'unit on ' + 'the ' + 'provided ' + 'machines ' + 'grouped ' + 'by ' + 'application ' + 'endpoint.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/OpenMachinePortRangesByEndpointResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'description': 'PrivateAddress returns the ' + 'private address for each ' + 'given unit, if set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'ProviderType': {'description': 'ProviderType returns the ' + 'provider type used by the ' + 'current juju\n' + 'model.\n' + '\n' + 'TODO(dimitern): Refactor the ' + 'uniter to call this instead ' + 'of calling\n' + 'ModelConfig() just to get the ' + 'provider type. Once we have ' + 'machine\n' + 'addresses, this might be ' + 'completely unnecessary ' + 'though.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PublicAddress': {'description': 'PublicAddress returns the ' + 'public address for each ' + 'given unit, if set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Read': {'description': 'Read reads leadership settings for ' + 'the provided service ID. Any\n' + 'unit of the service may perform this ' + 'operation.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GetLeadershipSettingsBulkResults'}}, + 'type': 'object'}, + 'ReadLocalApplicationSettings': {'description': 'ReadLocalApplicationSettings ' + 'returns the ' + 'local ' + 'application ' + 'settings for ' + 'a\n' + 'particular ' + 'relation when ' + 'invoked by ' + 'the leader ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnit'}, + 'Result': {'$ref': '#/definitions/SettingsResult'}}, + 'type': 'object'}, + 'ReadRemoteSettings': {'description': 'ReadRemoteSettings ' + 'returns the remote ' + 'settings of each given ' + 'set of\n' + 'relation/local ' + 'unit/remote unit.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnitPairs'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'ReadSettings': {'description': 'ReadSettings returns the ' + 'local settings of each given ' + 'set of\n' + 'relation/unit.\n' + '\n' + 'NOTE(achilleasa): Using this ' + 'call to read application data ' + 'is deprecated\n' + 'and will not work for k8s ' + 'charms (see LP1876097). ' + 'Instead, clients should\n' + 'use ' + 'ReadLocalApplicationSettings.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'Refresh': {'description': 'Refresh retrieves the latest ' + 'values for attributes on this ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitRefreshResults'}}, + 'type': 'object'}, + 'Relation': {'description': 'Relation returns information ' + 'about all given relation/unit ' + 'pairs,\n' + 'including their id, key and the ' + 'local endpoint.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationById': {'description': 'RelationById returns ' + 'information about all given ' + 'relations,\n' + 'specified by their ids, ' + 'including their key and the ' + 'local\n' + 'endpoint.', + 'properties': {'Params': {'$ref': '#/definitions/RelationIds'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationsStatus': {'description': 'RelationsStatus returns ' + 'for each unit the ' + 'corresponding relation and ' + 'status information.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RelationUnitStatusResults'}}, + 'type': 'object'}, + 'RemoveStorageAttachments': {'description': 'RemoveStorageAttachments ' + 'removes the ' + 'specified ' + 'storage\n' + 'attachments from ' + 'state.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RequestReboot': {'description': 'RequestReboot sets the ' + 'reboot flag on the provided ' + 'machines', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Resolved': {'description': 'Resolved returns the current ' + 'resolved setting for each given ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ResolvedModeResults'}}, + 'type': 'object'}, + 'SLALevel': {'description': "SLALevel returns the model's SLA " + 'level.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetAgentStatus': {'description': 'SetAgentStatus will set ' + 'status for agents of Units ' + 'passed in args, if one\n' + 'of the args is not an Unit ' + 'it will fail.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetApplicationStatus': {'description': 'SetApplicationStatus ' + 'sets the status for ' + 'all the Applications ' + 'in args if the given ' + 'Unit is\n' + 'the leader.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharmURL': {'description': 'SetCharmURL sets the charm URL ' + 'for each given unit. An error ' + 'will\n' + 'be returned if a unit is dead, ' + 'or the charm URL is not known.', + 'properties': {'Params': {'$ref': '#/definitions/EntitiesCharmURL'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRelationStatus': {'description': 'SetRelationStatus ' + 'updates the status of ' + 'the specified relations.', + 'properties': {'Params': {'$ref': '#/definitions/RelationStatusArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetState': {'description': 'SetState sets the state persisted ' + 'by the charm running in this ' + 'unit\n' + 'and the state internal to the ' + 'uniter for this unit.', + 'properties': {'Params': {'$ref': '#/definitions/SetUnitStateArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus will set status for a ' + 'entities passed in args. If the ' + 'entity is\n' + 'a Unit it will instead set ' + 'status to its agent, to emulate ' + 'backwards\n' + 'compatibility.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUnitStatus': {'description': 'SetUnitStatus sets status ' + 'for all elements passed in ' + 'args, the difference\n' + 'with SetStatus is that if an ' + 'entity is a Unit it will set ' + 'its status instead\n' + 'of its agent.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUpgradeSeriesUnitStatus': {'description': 'SetUpgradeSeriesUnitStatus ' + 'sets the ' + 'upgrade series ' + 'status of the ' + 'unit.\n' + 'If no upgrade ' + 'is in progress ' + 'an error is ' + 'returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetWorkloadVersion': {'description': 'SetWorkloadVersion sets ' + 'the workload version ' + 'for each given unit. An ' + 'error will\n' + 'be returned if a unit ' + 'is dead.', + 'properties': {'Params': {'$ref': '#/definitions/EntityWorkloadVersions'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'State': {'description': 'State returns the state persisted by ' + 'the charm running in this unit\n' + 'and the state internal to the uniter ' + 'for this unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitStateResults'}}, + 'type': 'object'}, + 'StorageAttachmentLife': {'description': 'StorageAttachmentLife ' + 'returns the ' + 'lifecycle state of ' + 'the storage ' + 'attachments\n' + 'with the specified ' + 'tags.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'StorageAttachments': {'description': 'StorageAttachments ' + 'returns the storage ' + 'attachments with the ' + 'specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentResults'}}, + 'type': 'object'}, + 'UnitStatus': {'description': 'UnitStatus returns the workload ' + 'status information for the ' + 'unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'UnitStorageAttachments': {'description': 'UnitStorageAttachments ' + 'returns the IDs of ' + 'storage attachments ' + 'for a collection of ' + 'units.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentIdsResults'}}, + 'type': 'object'}, + 'UpdateNetworkInfo': {'description': 'UpdateNetworkInfo ' + 'refreshes the network ' + "settings for a unit's " + 'bound\n' + 'endpoints.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateSettings': {'description': 'UpdateSettings persists all ' + 'changes made to the local ' + 'settings of\n' + 'all given pairs of relation ' + 'and unit. Keys with empty ' + 'values are\n' + 'considered a signal to ' + 'delete these values.', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnitsSettings'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpgradeSeriesUnitStatus': {'description': 'UpgradeSeriesUnitStatus ' + 'returns the ' + 'current ' + 'preparation status ' + 'of an\n' + 'upgrading unit.\n' + 'If no series ' + 'upgrade is in ' + 'progress an error ' + 'is returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchActionNotifications': {'description': 'WatchActionNotifications ' + 'returns a ' + 'StringsWatcher ' + 'for observing\n' + 'incoming action ' + 'calls to a unit. ' + 'See also ' + 'state/watcher.go\n' + 'Unit.WatchActionNotifications(). ' + 'This method is ' + 'called from\n' + 'api/uniter/uniter.go ' + 'WatchActionNotifications().', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchConfigSettingsHash': {'description': 'WatchConfigSettingsHash ' + 'returns a ' + 'StringsWatcher ' + 'that yields a ' + 'hash\n' + 'of the config ' + 'values every time ' + 'the config ' + 'changes. The ' + 'uniter can\n' + 'save this hash and ' + 'use it to decide ' + 'whether the ' + 'config-changed ' + 'hook\n' + 'needs to be run ' + '(or whether this ' + 'was just an agent ' + 'restart with no\n' + 'substantive config ' + 'change).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchInstanceData': {'description': 'WatchInstanceData is a ' + 'shim to call the ' + 'LXDProfileAPIv2 version ' + 'of this method.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchLeadershipSettings': {'description': 'WatchLeadershipSettings ' + 'will block the ' + 'caller until ' + 'leadership ' + 'settings\n' + 'for the given ' + 'service ID change.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchRelationUnits': {'description': 'WatchRelationUnits ' + 'returns a ' + 'RelationUnitsWatcher ' + 'for observing\n' + 'changes to every unit ' + 'in the supplied ' + 'relation that is ' + 'visible to\n' + 'the supplied unit. See ' + 'also ' + 'state/watcher.go:RelationUnit.Watch().', + 'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, + 'type': 'object'}, + 'WatchStorageAttachments': {'description': 'WatchStorageAttachments ' + 'creates watchers ' + 'for a collection ' + 'of storage\n' + 'attachments, each ' + 'of which can be ' + 'used to watch ' + 'changes to ' + 'storage\n' + 'attachment info.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchTrustConfigSettingsHash': {'description': 'WatchTrustConfigSettingsHash ' + 'returns a ' + 'StringsWatcher ' + 'that yields ' + 'a\n' + 'hash of the ' + 'application ' + 'config values ' + 'whenever they ' + 'change. The\n' + 'uniter can ' + 'use the hash ' + 'to determine ' + 'whether the ' + 'actual values ' + 'have\n' + 'changed since ' + 'it last saw ' + 'the config.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitAddressesHash': {'description': 'WatchUnitAddressesHash ' + 'returns a ' + 'StringsWatcher that ' + 'yields the\n' + 'hashes of the ' + 'addresses for the ' + 'unit whenever the ' + 'addresses\n' + 'change. The uniter ' + 'can use the hash to ' + 'determine whether ' + 'the actual\n' + 'address values have ' + 'changed since it ' + 'last saw the ' + 'config.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitRelations': {'description': 'WatchUnitRelations ' + 'returns a ' + 'StringsWatcher, for ' + 'each given\n' + 'unit, that notifies of ' + 'changes to the ' + 'lifecycles of ' + 'relations\n' + 'relevant to that unit. ' + 'For principal units, ' + 'this will be all of ' + 'the\n' + 'relations for the ' + 'application. For ' + 'subordinate units, ' + 'only\n' + 'relations with the ' + "principal unit's " + 'application will be ' + 'monitored.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitStorageAttachments': {'description': 'WatchUnitStorageAttachments ' + 'creates ' + 'watchers for a ' + 'collection of ' + 'units,\n' + 'each of which ' + 'can be used to ' + 'watch for ' + 'lifecycle ' + 'changes to the ' + 'corresponding\n' + "unit's storage " + 'attachments.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'description': 'WatchUpgradeSeriesNotifications ' + 'returns a ' + 'NotifyWatcher ' + 'for ' + 'observing ' + 'changes to ' + 'upgrade ' + 'series ' + 'locks.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WorkloadVersion': {'description': 'WorkloadVersion returns ' + 'the workload version for ' + 'all given units or ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def 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 = await self.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='Uniter', + request='APIHostPorts', + version=18, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddUnitStorage(self, storages=None): + ''' + AddUnitStorage validates and creates additional storage instances for units. + Failures on an individual storage instance do not block remaining + instances from being processed. + + storages : typing.Sequence[~StorageAddParams] + Returns -> ErrorResults + ''' + 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='Uniter', + request='AddUnitStorage', + version=18, + params=_params) + _params['storages'] = storages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachinePortsResults) + async def AllMachinePorts(self, entities=None): + ''' + AllMachinePorts returns all opened port ranges for each given + machine (on all networks). + + DEPRECATED: clients should switch to the OpenedMachinePortRanges API call + when using the V17+ API. + + TODO(achilleasa): remove from V17 once all client references to this API + have been changed to use the new API. + + entities : typing.Sequence[~Entity] + Returns -> MachinePortsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='AllMachinePorts', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationStatusResults) + async def ApplicationStatus(self, entities=None): + ''' + ApplicationStatus returns the status of the Applications and its workloads + if the given unit is the leader. + + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ApplicationStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AssignedMachine(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. + + 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='AssignedMachine', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + AvailabilityZone returns the availability zone for each given unit, if applicable. + + 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='AvailabilityZone', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.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='Uniter', + request='BeginActions', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def CanApplyLXDProfile(self, entities=None): + ''' + CanApplyLXDProfile is a shim to call the LXDProfileAPIv2 version of this method. + + 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='CanApplyLXDProfile', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def CharmArchiveSha256(self, urls=None): + ''' + CharmArchiveSha256 returns the SHA256 digest of the charm archive + (bundle) data for each charm url in the given parameters. + + 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='CharmArchiveSha256', + version=18, + params=_params) + _params['urls'] = urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def CharmModifiedVersion(self, entities=None): + ''' + CharmModifiedVersion returns the most CharmModifiedVersion for all given + units or applications. + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CharmModifiedVersion', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def CharmURL(self, entities=None): + ''' + CharmURL returns the charm URL for all given units or applications. + + 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='CharmURL', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClearResolved(self, entities=None): + ''' + ClearResolved removes any resolved setting from each given unit. + + 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='ClearResolved', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClosePorts(self, entities=None): + ''' + ClosePorts sets the policy of the port range with protocol to be + closed, for all given units. + + entities : typing.Sequence[~EntityPortRange] + 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='ClosePorts', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def CloudAPIVersion(self): + ''' + CloudAPIVersion returns the cloud API version, if available. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudAPIVersion', + version=18, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def CloudSpec(self): + ''' + 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. + + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudSpec', + version=18, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def CommitHookChanges(self, args=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. + + 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='CommitHookChanges', + version=18, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConfigSettingsResults) + async def ConfigSettings(self, entities=None): + ''' + ConfigSettings returns the complete set of application charm config + settings available to each given unit. + + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ConfigSettings', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelResult) + async def 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='Uniter', + request='CurrentModel', + version=18, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Destroy(self, entities=None): + ''' + Destroy advances all given Alive units' lifecycles as far as + possible. See state/Unit.Destroy(). + + 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='Destroy', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyAllSubordinates(self, entities=None): + ''' + DestroyAllSubordinates destroys all subordinates of each given unit. + + 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='DestroyAllSubordinates', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyUnitStorageAttachments(self, entities=None): + ''' + DestroyUnitStorageAttachments marks each storage attachment of the + specified units as Dying. + + 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='DestroyUnitStorageAttachments', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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='Uniter', + request='EnsureDead', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnterScope(self, relation_units=None): + ''' + EnterScope ensures each unit has entered its scope in the relation, + for all of the given relation/unit pairs. See also + state.RelationUnit.EnterScope(). + + 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='EnterScope', + version=18, + params=_params) + _params['relation-units'] = relation_units + reply = await self.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='Uniter', + request='FinishActions', + version=18, + params=_params) + _params['results'] = results + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): + ''' + 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='GetMeterStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetPodSpec(self, entities=None): + ''' + GetPodSpec gets the pod 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='GetPodSpec', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def GetPrincipal(self, entities=None): + ''' + GetPrincipal returns the result of calling PrincipalName() and + converting it to a tag, on each given unit. + + 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='GetPrincipal', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetRawK8sSpec(self, entities=None): + ''' + 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=18, + params=_params) + _params['entities'] = entities + reply = await self.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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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(ErrorResults) + async def OpenPorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='OpenPorts', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OpenMachinePortRangesByEndpointResults) + 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 -> OpenMachinePortRangesByEndpointResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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(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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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=18, + params=_params) + _params['relation-units'] = relation_units + reply = await self.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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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(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) + 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) + 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) + 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) + async def 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='SetWorkloadVersion', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitStateResults) + async def 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='Uniter', + request='State', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def StorageAttachmentLife(self, ids=None): + ''' + StorageAttachmentLife returns the lifecycle state of the storage attachments + with the specified tags. + + ids : typing.Sequence[~StorageAttachmentId] + 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='Uniter', + request='StorageAttachmentLife', + version=18, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentResults) + async def StorageAttachments(self, ids=None): + ''' + StorageAttachments returns the storage attachments with the specified tags. + + 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='StorageAttachments', + version=18, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def UnitStatus(self, entities=None): + ''' + UnitStatus returns the workload status information for the unit. + + 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='Uniter', + request='UnitStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentIdsResults) + async def UnitStorageAttachments(self, entities=None): + ''' + UnitStorageAttachments returns the IDs of storage attachments for a collection of units. + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='UnitStorageAttachments', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateNetworkInfo(self, entities=None): + ''' + UpdateNetworkInfo refreshes the network settings for a unit's bound + endpoints. + + 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='UpdateNetworkInfo', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateSettings(self, relation_units=None): + ''' + UpdateSettings persists all changes made to the local settings of + all given pairs of relation and unit. Keys with empty values are + considered a signal to delete these values. + + relation_units : typing.Sequence[~RelationUnitSettings] + 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='UpdateSettings', + version=18, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def 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='Uniter', + request='UpgradeSeriesUnitStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.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='Uniter', + request='Watch', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + WatchAPIHostPorts watches the API server addresses. + + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchAPIHostPorts', + version=18, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(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(). + + 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='WatchActionNotifications', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchConfigSettingsHash(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). + + 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='WatchConfigSettingsHash', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.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) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchInstanceData(self, entities=None): + ''' + WatchInstanceData is a shim to call the LXDProfileAPIv2 version of this method. + + 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='WatchInstanceData', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchLeadershipSettings(self, entities=None): + ''' + WatchLeadershipSettings will block the caller until leadership settings + for the given service ID change. + + 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='WatchLeadershipSettings', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMeterStatus(self, entities=None): + ''' + 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='WatchMeterStatus', + version=18, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def 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 = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client2.py b/juju/client/old_clients/_client2.py new file mode 100644 index 000000000..3a5a9762e --- /dev/null +++ b/juju/client/old_clients/_client2.py @@ -0,0 +1,14705 @@ +# 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.old_clients._definitions import * + + +class ActionFacade(Type): + name = 'Action' + version = 2 + schema = {'definitions': {'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'Actions': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/Action'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionsByName': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}}, + 'type': 'object'}, + 'ActionsByNames': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByName'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionsByReceiver': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'receiver': {'type': 'string'}}, + 'type': 'object'}, + 'ActionsByReceivers': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByReceiver'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ApplicationCharmActionsResult': {'additionalProperties': False, + 'properties': {'actions': {'patternProperties': {'.*': {'$ref': '#/definitions/ActionSpec'}}, + 'type': 'object'}, + 'application-tag': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ApplicationsCharmActionsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationCharmActionsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'FindActionsByNames': {'additionalProperties': False, + 'properties': {'names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FindTags': {'additionalProperties': False, + 'properties': {'prefixes': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['prefixes'], + 'type': 'object'}, + 'FindTagsResults': {'additionalProperties': False, + 'properties': {'matches': {'patternProperties': {'.*': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'required': ['matches'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'RunParams': {'additionalProperties': False, + 'properties': {'applications': {'items': {'type': 'string'}, + 'type': 'array'}, + 'commands': {'type': 'string'}, + 'machines': {'items': {'type': 'string'}, + 'type': 'array'}, + 'timeout': {'type': 'integer'}, + 'units': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['commands', 'timeout'], + 'type': 'object'}}, + 'properties': {'Actions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'ApplicationsCharmsActions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationsCharmActionsResults'}}, + 'type': 'object'}, + 'Cancel': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'Enqueue': {'properties': {'Params': {'$ref': '#/definitions/Actions'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'FindActionTagsByPrefix': {'properties': {'Params': {'$ref': '#/definitions/FindTags'}, + 'Result': {'$ref': '#/definitions/FindTagsResults'}}, + 'type': 'object'}, + 'FindActionsByNames': {'properties': {'Params': {'$ref': '#/definitions/FindActionsByNames'}, + 'Result': {'$ref': '#/definitions/ActionsByNames'}}, + 'type': 'object'}, + 'ListAll': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'ListCompleted': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'ListPending': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'ListRunning': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'Run': {'properties': {'Params': {'$ref': '#/definitions/RunParams'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'RunOnAllMachines': {'properties': {'Params': {'$ref': '#/definitions/RunParams'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ActionResults) + async def Actions(self, entities=None): + ''' + 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationsCharmActionsResults) + async def ApplicationsCharmsActions(self, entities=None): + ''' + 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Cancel(self, entities=None): + ''' + 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Enqueue(self, actions=None): + ''' + actions : typing.Sequence[~Action] + Returns -> ActionResults + ''' + 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='Enqueue', + version=2, + params=_params) + _params['actions'] = actions + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindTagsResults) + async def FindActionTagsByPrefix(self, prefixes=None): + ''' + prefixes : typing.Sequence[str] + Returns -> FindTagsResults + ''' + if prefixes is not None and not isinstance(prefixes, (bytes, str, list)): + raise Exception("Expected prefixes to be a Sequence, received: {}".format(type(prefixes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='FindActionTagsByPrefix', + version=2, + params=_params) + _params['prefixes'] = prefixes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByNames) + async def FindActionsByNames(self, names=None): + ''' + names : typing.Sequence[str] + Returns -> ActionsByNames + ''' + 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='Action', + request='FindActionsByNames', + version=2, + params=_params) + _params['names'] = names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListAll(self, entities=None): + ''' + 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='Action', + request='ListAll', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListCompleted(self, entities=None): + ''' + 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='Action', + request='ListCompleted', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListPending(self, entities=None): + ''' + 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='Action', + request='ListPending', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListRunning(self, entities=None): + ''' + 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='Action', + request='ListRunning', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Run(self, applications=None, commands=None, machines=None, timeout=None, units=None): + ''' + applications : typing.Sequence[str] + commands : str + machines : typing.Sequence[str] + timeout : int + units : typing.Sequence[str] + Returns -> ActionResults + ''' + 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 machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='Run', + version=2, + params=_params) + _params['applications'] = applications + _params['commands'] = commands + _params['machines'] = machines + _params['timeout'] = timeout + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def RunOnAllMachines(self, applications=None, commands=None, machines=None, timeout=None, units=None): + ''' + applications : typing.Sequence[str] + commands : str + machines : typing.Sequence[str] + timeout : int + units : typing.Sequence[str] + Returns -> ActionResults + ''' + 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 machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='RunOnAllMachines', + version=2, + params=_params) + _params['applications'] = applications + _params['commands'] = commands + _params['machines'] = machines + _params['timeout'] = timeout + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + +class AgentFacade(Type): + name = 'Agent' + version = 2 + schema = {'definitions': {'AgentGetEntitiesResult': {'additionalProperties': False, + 'properties': {'container-type': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'life': {'type': 'string'}}, + 'required': ['life', + 'jobs', + 'container-type'], + 'type': 'object'}, + 'AgentGetEntitiesResults': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/AgentGetEntitiesResult'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + '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'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'IsMasterResult': {'additionalProperties': False, + 'properties': {'master': {'type': 'boolean'}}, + 'required': ['master'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelTag': {'additionalProperties': False, 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StateServingInfo': {'additionalProperties': False, + 'properties': {'api-port': {'type': 'integer'}, + 'ca-private-key': {'type': 'string'}, + 'cert': {'type': 'string'}, + 'controller-api-port': {'type': 'integer'}, + 'private-key': {'type': 'string'}, + 'shared-secret': {'type': 'string'}, + 'state-port': {'type': 'integer'}, + 'system-identity': {'type': 'string'}}, + 'required': ['api-port', + 'state-port', + 'cert', + 'private-key', + 'ca-private-key', + 'shared-secret', + 'system-identity'], + 'type': 'object'}}, + 'properties': {'ClearReboot': {'description': 'ClearReboot will clear the ' + 'reboot flag on provided ' + 'machines, if it exists.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CloudSpec': {'description': "CloudSpec returns the model's " + 'cloud spec.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'GetCloudSpec': {'description': 'GetCloudSpec constructs the ' + 'CloudSpec for a validated and ' + 'authorized model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetEntities': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/AgentGetEntitiesResults'}}, + 'type': 'object'}, + 'IsMaster': {'properties': {'Result': {'$ref': '#/definitions/IsMasterResult'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'SetPasswords': {'description': 'SetPasswords sets the given ' + 'password for each supplied ' + 'entity, if possible.', + 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StateServingInfo': {'properties': {'Result': {'$ref': '#/definitions/StateServingInfo'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'description': 'WatchCloudSpecsChanges ' + 'returns a watcher ' + 'for cloud spec ' + 'changes.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchCredentials': {'description': 'WatchCredentials watches ' + 'for changes to the ' + 'specified credentials.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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='Agent', + request='ClearReboot', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResults) + async def 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='Agent', + request='CloudSpec', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def 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='Agent', + request='ControllerAPIInfoForModels', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.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='Agent', + request='ControllerConfig', + version=2, + params=_params) + + reply = await self.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='Agent', + request='GetCloudSpec', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AgentGetEntitiesResults) + async def GetEntities(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='GetEntities', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IsMasterResult) + async def IsMaster(self): + ''' + + Returns -> IsMasterResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='IsMaster', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + ModelConfig returns the current model's configuration. + + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='ModelConfig', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=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=2, + params=_params) + _params['changes'] = changes + reply = await self.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=2, + params=_params) + + reply = await self.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=2, + params=_params) + _params['entities'] = entities + reply = await self.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=2, + params=_params) + _params['entities'] = entities + reply = await self.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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class AllModelWatcherFacade(Type): + name = 'AllModelWatcher' + version = 2 + schema = {'definitions': {'AllWatcherNextResults': {'additionalProperties': False, + 'properties': {'deltas': {'items': {'$ref': '#/definitions/Delta'}, + 'type': 'array'}}, + 'required': ['deltas'], + 'type': 'object'}, + 'Delta': {'additionalProperties': False, + 'properties': {'entity': {'additionalProperties': True, + 'type': 'object'}, + 'removed': {'type': 'boolean'}}, + 'required': ['removed', 'entity'], + 'type': 'object'}}, + 'properties': {'Next': {'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) + async def 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=2, + params=_params) + + reply = await self.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='AllModelWatcher', + request='Stop', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class AllWatcherFacade(Type): + name = 'AllWatcher' + version = 2 + schema = {'definitions': {'AllWatcherNextResults': {'additionalProperties': False, + 'properties': {'deltas': {'items': {'$ref': '#/definitions/Delta'}, + 'type': 'array'}}, + 'required': ['deltas'], + 'type': 'object'}, + 'Delta': {'additionalProperties': False, + 'properties': {'entity': {'additionalProperties': True, + 'type': 'object'}, + 'removed': {'type': 'boolean'}}, + 'required': ['removed', 'entity'], + 'type': 'object'}}, + 'properties': {'Next': {'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) + async def 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=2, + params=_params) + + reply = await self.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='AllWatcher', + request='Stop', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class AnnotationsFacade(Type): + name = 'Annotations' + version = 2 + schema = {'definitions': {'AnnotationsGetResult': {'additionalProperties': False, + 'properties': {'annotations': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'entity': {'type': 'string'}, + 'error': {'$ref': '#/definitions/ErrorResult'}}, + 'required': ['entity', 'annotations'], + 'type': 'object'}, + 'AnnotationsGetResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/AnnotationsGetResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'AnnotationsSet': {'additionalProperties': False, + 'properties': {'annotations': {'items': {'$ref': '#/definitions/EntityAnnotations'}, + 'type': 'array'}}, + 'required': ['annotations'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityAnnotations': {'additionalProperties': False, + 'properties': {'annotations': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'entity': {'type': 'string'}}, + 'required': ['entity', 'annotations'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}}, + 'properties': {'Get': {'description': 'Get returns annotations for given ' + 'entities.\n' + 'If annotations cannot be retrieved for ' + 'a given entity, an error is returned.\n' + 'Each entity is treated independently ' + 'and, hence, will fail or succeed ' + 'independently.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/AnnotationsGetResults'}}, + 'type': 'object'}, + 'Set': {'description': 'Set stores annotations for given ' + 'entities', + 'properties': {'Params': {'$ref': '#/definitions/AnnotationsSet'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AnnotationsGetResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + +class ApplicationFacade(Type): + name = 'Application' + version = 2 + schema = {'definitions': {'AddApplicationUnits': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'num-units': {'type': 'integer'}, + 'placement': {'items': {'$ref': '#/definitions/Placement'}, + 'type': 'array'}}, + 'required': ['application', + 'num-units', + 'placement'], + 'type': 'object'}, + 'AddApplicationUnitsResults': {'additionalProperties': False, + 'properties': {'units': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['units'], + 'type': 'object'}, + 'AddRelation': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['endpoints'], + 'type': 'object'}, + 'AddRelationResults': {'additionalProperties': False, + 'properties': {'endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}}, + 'required': ['endpoints'], + 'type': 'object'}, + 'ApplicationCharmRelations': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationCharmRelationsResults': {'additionalProperties': False, + 'properties': {'charm-relations': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['charm-relations'], + 'type': 'object'}, + 'ApplicationDeploy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-yaml': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'num-units': {'type': 'integer'}, + 'placement': {'items': {'$ref': '#/definitions/Placement'}, + 'type': 'array'}, + 'resources': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'series': {'type': 'string'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'series', + 'charm-url', + 'channel', + 'num-units', + 'config-yaml', + 'constraints'], + 'type': 'object'}, + 'ApplicationDestroy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationExpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGetResults': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'series': {'type': 'string'}}, + 'required': ['application', + 'charm', + 'config', + 'constraints', + 'series'], + 'type': 'object'}, + 'ApplicationMetricCredential': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'metrics-credentials': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['application', + 'metrics-credentials'], + 'type': 'object'}, + 'ApplicationMetricCredentials': {'additionalProperties': False, + 'properties': {'creds': {'items': {'$ref': '#/definitions/ApplicationMetricCredential'}, + 'type': 'array'}}, + 'required': ['creds'], + 'type': 'object'}, + 'ApplicationSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'options': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', 'options'], + 'type': 'object'}, + 'ApplicationSetCharm': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'config-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-settings-yaml': {'type': 'string'}, + 'force-series': {'type': 'boolean'}, + 'force-units': {'type': 'boolean'}, + 'resource-ids': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-constraints': {'patternProperties': {'.*': {'$ref': '#/definitions/StorageConstraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'charm-url', + 'channel', + 'force-units', + 'force-series'], + 'type': 'object'}, + 'ApplicationUnexpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationUnset': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'options': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', 'options'], + 'type': 'object'}, + 'ApplicationUpdate': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'force-charm-url': {'type': 'boolean'}, + 'force-series': {'type': 'boolean'}, + 'min-units': {'type': 'integer'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'settings-yaml': {'type': 'string'}}, + 'required': ['application', + 'charm-url', + 'force-charm-url', + 'force-series', + 'settings-yaml'], + 'type': 'object'}, + 'ApplicationsDeploy': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/ApplicationDeploy'}, + 'type': 'array'}}, + 'required': ['applications'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'DestroyApplicationUnits': {'additionalProperties': False, + 'properties': {'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + 'type': 'object'}, + 'DestroyRelation': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['endpoints'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetApplicationConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'GetConstraintsResults': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'SetConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['application', 'constraints'], + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'spaces': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}}, + 'type': 'object'}}, + 'properties': {'AddRelation': {'properties': {'Params': {'$ref': '#/definitions/AddRelation'}, + 'Result': {'$ref': '#/definitions/AddRelationResults'}}, + 'type': 'object'}, + 'AddUnits': {'properties': {'Params': {'$ref': '#/definitions/AddApplicationUnits'}, + 'Result': {'$ref': '#/definitions/AddApplicationUnitsResults'}}, + 'type': 'object'}, + 'CharmRelations': {'properties': {'Params': {'$ref': '#/definitions/ApplicationCharmRelations'}, + 'Result': {'$ref': '#/definitions/ApplicationCharmRelationsResults'}}, + 'type': 'object'}, + 'Deploy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationsDeploy'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}}, + 'type': 'object'}, + 'DestroyRelation': {'properties': {'Params': {'$ref': '#/definitions/DestroyRelation'}}, + 'type': 'object'}, + 'DestroyUnits': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, + 'type': 'object'}, + 'Expose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationExpose'}}, + 'type': 'object'}, + 'Get': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/ApplicationGetResults'}}, + 'type': 'object'}, + 'GetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'GetConstraints': {'properties': {'Params': {'$ref': '#/definitions/GetApplicationConstraints'}, + 'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, + 'type': 'object'}, + 'Set': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, + 'type': 'object'}, + 'SetCharm': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, + 'type': 'object'}, + 'SetConstraints': {'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetMetricCredentials': {'properties': {'Params': {'$ref': '#/definitions/ApplicationMetricCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Unexpose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnexpose'}}, + 'type': 'object'}, + 'Unset': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, + 'type': 'object'}, + 'Update': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUpdate'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddRelationResults) + async def AddRelation(self, endpoints=None): + ''' + endpoints : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddRelation', + version=2, + params=_params) + _params['endpoints'] = endpoints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddApplicationUnitsResults) + async def AddUnits(self, application=None, num_units=None, placement=None): + ''' + application : str + num_units : int + placement : typing.Sequence[~Placement] + 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 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddUnits', + version=2, + params=_params) + _params['application'] = application + _params['num-units'] = num_units + _params['placement'] = placement + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationCharmRelationsResults) + async def CharmRelations(self, application=None): + ''' + 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=2, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Deploy(self, applications=None): + ''' + 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=2, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Destroy(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Destroy', + version=2, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyRelation(self, endpoints=None): + ''' + endpoints : typing.Sequence[str] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyRelation', + version=2, + params=_params) + _params['endpoints'] = endpoints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyUnits(self, unit_names=None): + ''' + unit_names : typing.Sequence[str] + Returns -> None + ''' + if unit_names is not None and not isinstance(unit_names, (bytes, str, list)): + raise Exception("Expected unit_names to be a Sequence, received: {}".format(type(unit_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnits', + version=2, + params=_params) + _params['unit-names'] = unit_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Expose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=2, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetResults) + async def Get(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Get', + version=2, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def GetCharmURL(self, application=None): + ''' + application : str + Returns -> StringResult + ''' + 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='GetCharmURL', + version=2, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetConstraintsResults) + async def GetConstraints(self, application=None): + ''' + application : str + Returns -> GetConstraintsResults + ''' + 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='GetConstraints', + version=2, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Set(self, application=None, options=None): + ''' + application : str + options : typing.Mapping[str, 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 options is not None and not isinstance(options, dict): + raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Set', + version=2, + params=_params) + _params['application'] = application + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetCharm(self, application=None, channel=None, charm_url=None, config_settings=None, config_settings_yaml=None, force_series=None, force_units=None, resource_ids=None, storage_constraints=None): + ''' + application : str + channel : str + charm_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + force_series : bool + force_units : bool + resource_ids : typing.Mapping[str, str] + storage_constraints : typing.Mapping[str, ~StorageConstraints] + Returns -> None + ''' + 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_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 force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + 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 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=2, + params=_params) + _params['application'] = application + _params['channel'] = channel + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['force-series'] = force_series + _params['force-units'] = force_units + _params['resource-ids'] = resource_ids + _params['storage-constraints'] = storage_constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetConstraints(self, application=None, constraints=None): + ''' + 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=2, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMetricCredentials(self, creds=None): + ''' + 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=2, + params=_params) + _params['creds'] = creds + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unexpose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=2, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unset(self, application=None, options=None): + ''' + application : str + options : 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 options is not None and not isinstance(options, (bytes, str, list)): + raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unset', + version=2, + params=_params) + _params['application'] = application + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Update(self, application=None, charm_url=None, constraints=None, force_charm_url=None, force_series=None, min_units=None, settings=None, settings_yaml=None): + ''' + application : str + charm_url : str + constraints : Value + force_charm_url : bool + force_series : bool + min_units : int + settings : typing.Mapping[str, str] + settings_yaml : str + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + 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 constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + if force_charm_url is not None and not isinstance(force_charm_url, bool): + raise Exception("Expected force_charm_url to be a bool, received: {}".format(type(force_charm_url))) + + if force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + if min_units is not None and not isinstance(min_units, int): + raise Exception("Expected min_units to be a int, received: {}".format(type(min_units))) + + if settings is not None and not isinstance(settings, dict): + raise Exception("Expected settings to be a Mapping, received: {}".format(type(settings))) + + if settings_yaml is not None and not isinstance(settings_yaml, (bytes, str)): + raise Exception("Expected settings_yaml to be a str, received: {}".format(type(settings_yaml))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Update', + version=2, + params=_params) + _params['application'] = application + _params['charm-url'] = charm_url + _params['constraints'] = constraints + _params['force-charm-url'] = force_charm_url + _params['force-series'] = force_series + _params['min-units'] = min_units + _params['settings'] = settings + _params['settings-yaml'] = settings_yaml + reply = await self.rpc(msg) + return reply + + + +class ApplicationOffersFacade(Type): + name = 'ApplicationOffers' + version = 2 + schema = {'definitions': {'AddApplicationOffer': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'application-name': {'type': 'string'}, + 'endpoints': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'model-tag': {'type': 'string'}, + 'offer-name': {'type': 'string'}}, + 'required': ['model-tag', + 'offer-name', + 'application-name', + 'application-description', + 'endpoints'], + 'type': 'object'}, + 'AddApplicationOffers': {'additionalProperties': False, + 'properties': {'Offers': {'items': {'$ref': '#/definitions/AddApplicationOffer'}, + 'type': 'array'}}, + 'required': ['Offers'], + 'type': 'object'}, + 'ApplicationOfferAdminDetails': {'additionalProperties': False, + 'properties': {'ApplicationOfferDetails': {'$ref': '#/definitions/ApplicationOfferDetails'}, + 'application-description': {'type': 'string'}, + 'application-name': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + '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'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description', + 'ApplicationOfferDetails', + 'application-name', + 'charm-url'], + 'type': 'object'}, + 'ApplicationOfferDetails': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description'], + 'type': 'object'}, + 'ApplicationOfferResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ApplicationOfferAdminDetails'}}, + 'type': 'object'}, + 'ApplicationOffersResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationOfferResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ConsumeOfferDetails': {'additionalProperties': False, + 'properties': {'external-controller': {'$ref': '#/definitions/ExternalControllerInfo'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'offer': {'$ref': '#/definitions/ApplicationOfferDetails'}}, + 'type': 'object'}, + 'ConsumeOfferDetailsResult': {'additionalProperties': False, + 'properties': {'ConsumeOfferDetails': {'$ref': '#/definitions/ConsumeOfferDetails'}, + 'error': {'$ref': '#/definitions/Error'}, + 'external-controller': {'$ref': '#/definitions/ExternalControllerInfo'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'offer': {'$ref': '#/definitions/ApplicationOfferDetails'}}, + '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'}, + 'QueryApplicationOffersResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationOfferAdminDetails'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteApplicationInfo': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'icon-url-path': {'type': 'string'}, + 'model-tag': {'type': 'string'}, + 'name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'source-model-label': {'type': 'string'}}, + 'required': ['model-tag', + 'name', + 'description', + 'offer-url', + 'endpoints', + 'icon-url-path'], + 'type': 'object'}, + 'RemoteApplicationInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoteApplicationInfo'}}, + 'type': 'object'}, + 'RemoteApplicationInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteApplicationInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}}, + 'properties': {'ApplicationOffers': {'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/QueryApplicationOffersResults'}}, + 'type': 'object'}, + 'GetConsumeDetails': {'description': 'GetConsumeDetails ' + 'returns the details ' + 'necessary to pass to ' + 'another model to\n' + 'consume the specified ' + 'offers represented by ' + 'the urls.', + 'properties': {'Params': {'$ref': '#/definitions/OfferURLs'}, + '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/QueryApplicationOffersResults'}}, + '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 GUI 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=2, + 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=2, + params=_params) + _params['force'] = force + _params['offer-urls'] = offer_urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(QueryApplicationOffersResults) + async def FindApplicationOffers(self, filters=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=2, + params=_params) + _params['Filters'] = filters + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConsumeOfferDetailsResults) + async def GetConsumeDetails(self, bakery_version=None, offer_urls=None): + ''' + GetConsumeDetails returns the details necessary to pass to another model to + consume the specified offers represented by the urls. + + bakery_version : int + offer_urls : typing.Sequence[str] + Returns -> ConsumeOfferDetailsResults + ''' + 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='GetConsumeDetails', + version=2, + params=_params) + _params['bakery-version'] = bakery_version + _params['offer-urls'] = offer_urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(QueryApplicationOffersResults) + 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 -> 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=2, + 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=2, + 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=2, + 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 GUI 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=2, + params=_params) + _params['bakery-version'] = bakery_version + _params['offer-urls'] = offer_urls + reply = await self.rpc(msg) + return reply + + + +class BackupsFacade(Type): + name = 'Backups' + version = 2 + schema = {'definitions': {'BackupsCreateArgs': {'additionalProperties': False, + 'properties': {'no-download': {'type': 'boolean'}, + 'notes': {'type': 'string'}}, + 'required': ['notes', 'no-download'], + 'type': 'object'}, + 'BackupsInfoArgs': {'additionalProperties': False, + 'properties': {'id': {'type': 'string'}}, + 'required': ['id'], + 'type': 'object'}, + 'BackupsListArgs': {'additionalProperties': False, + 'type': 'object'}, + 'BackupsListResult': {'additionalProperties': False, + 'properties': {'list': {'items': {'$ref': '#/definitions/BackupsMetadataResult'}, + 'type': 'array'}}, + 'required': ['list'], + 'type': 'object'}, + 'BackupsMetadataResult': {'additionalProperties': False, + 'properties': {'ca-cert': {'type': 'string'}, + 'ca-private-key': {'type': 'string'}, + 'checksum': {'type': 'string'}, + 'checksum-format': {'type': 'string'}, + 'controller-machine-id': {'type': 'string'}, + 'controller-machine-inst-id': {'type': 'string'}, + 'controller-uuid': {'type': 'string'}, + 'filename': {'type': 'string'}, + 'finished': {'format': 'date-time', + 'type': 'string'}, + 'format-version': {'type': 'integer'}, + 'ha-nodes': {'type': 'integer'}, + 'hostname': {'type': 'string'}, + 'id': {'type': 'string'}, + 'machine': {'type': 'string'}, + 'model': {'type': 'string'}, + 'notes': {'type': 'string'}, + 'series': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'stored': {'format': 'date-time', + 'type': 'string'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'required': ['id', + 'checksum', + 'checksum-format', + 'size', + 'stored', + 'started', + 'finished', + 'notes', + 'model', + 'machine', + 'hostname', + 'version', + 'series', + 'ca-cert', + 'ca-private-key', + 'filename', + 'format-version', + 'controller-uuid', + 'controller-machine-id', + 'controller-machine-inst-id', + 'ha-nodes'], + 'type': 'object'}, + 'BackupsRemoveArgs': {'additionalProperties': False, + 'properties': {'ids': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['ids'], + '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'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'RestoreArgs': {'additionalProperties': False, + 'properties': {'backup-id': {'type': 'string'}}, + 'required': ['backup-id'], + 'type': 'object'}}, + 'properties': {'Create': {'properties': {'Params': {'$ref': '#/definitions/BackupsCreateArgs'}, + 'Result': {'$ref': '#/definitions/BackupsMetadataResult'}}, + 'type': 'object'}, + 'Info': {'description': 'Info provides the implementation of ' + 'the API method.', + 'properties': {'Params': {'$ref': '#/definitions/BackupsInfoArgs'}, + 'Result': {'$ref': '#/definitions/BackupsMetadataResult'}}, + 'type': 'object'}, + 'List': {'description': 'List provides the implementation of ' + 'the API method.', + 'properties': {'Params': {'$ref': '#/definitions/BackupsListArgs'}, + 'Result': {'$ref': '#/definitions/BackupsListResult'}}, + 'type': 'object'}, + 'Remove': {'description': 'Remove deletes the backups defined ' + 'by ID from the database.', + 'properties': {'Params': {'$ref': '#/definitions/BackupsRemoveArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Restore': {'description': 'Restore implements the server side ' + 'of Backups.Restore.', + 'properties': {'Params': {'$ref': '#/definitions/RestoreArgs'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(BackupsMetadataResult) + async def Create(self, no_download=None, notes=None): + ''' + 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=2, + params=_params) + _params['no-download'] = no_download + _params['notes'] = notes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BackupsMetadataResult) + async def Info(self, id_=None): + ''' + Info provides the implementation of the API method. + + id_ : str + Returns -> BackupsMetadataResult + ''' + if id_ is not None and not isinstance(id_, (bytes, str)): + raise Exception("Expected id_ to be a str, received: {}".format(type(id_))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Backups', + request='Info', + version=2, + params=_params) + _params['id'] = id_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BackupsListResult) + async def List(self): + ''' + List provides the implementation of the API method. + + + Returns -> BackupsListResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Backups', + request='List', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Remove(self, ids=None): + ''' + Remove deletes the backups defined by ID from the database. + + ids : typing.Sequence[str] + 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='Backups', + request='Remove', + version=2, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Restore(self, backup_id=None): + ''' + Restore implements the server side of Backups.Restore. + + backup_id : str + Returns -> None + ''' + if backup_id is not None and not isinstance(backup_id, (bytes, str)): + raise Exception("Expected backup_id to be a str, received: {}".format(type(backup_id))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Backups', + request='Restore', + version=2, + params=_params) + _params['backup-id'] = backup_id + reply = await self.rpc(msg) + return reply + + + +class BlockFacade(Type): + name = 'Block' + version = 2 + schema = {'definitions': {'Block': {'additionalProperties': False, + 'properties': {'id': {'type': 'string'}, + 'message': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['id', 'tag', 'type'], + 'type': 'object'}, + 'BlockResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/Block'}}, + 'required': ['result'], + 'type': 'object'}, + 'BlockResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BlockResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'BlockSwitchParams': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}}, + 'properties': {'List': {'description': 'List implements Block.List().', + 'properties': {'Result': {'$ref': '#/definitions/BlockResults'}}, + 'type': 'object'}, + 'SwitchBlockOff': {'description': 'SwitchBlockOff implements ' + 'Block.SwitchBlockOff().', + 'properties': {'Params': {'$ref': '#/definitions/BlockSwitchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'SwitchBlockOn': {'description': 'SwitchBlockOn implements ' + 'Block.SwitchBlockOn().', + 'properties': {'Params': {'$ref': '#/definitions/BlockSwitchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(BlockResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + async def 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 = await self.rpc(msg) + return reply + + + +class BundleFacade(Type): + name = 'Bundle' + version = 2 + schema = {'definitions': {'BundleChange': {'additionalProperties': False, + 'properties': {'args': {'items': {'additionalProperties': True, + 'type': 'object'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesParams': {'additionalProperties': False, + 'properties': {'bundleURL': {'type': 'string'}, + 'yaml': {'type': 'string'}}, + 'required': ['yaml', 'bundleURL'], + 'type': 'object'}, + 'BundleChangesResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'ExportBundle': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'GetChanges': {'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringResult) + async def ExportBundle(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Bundle', + request='ExportBundle', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BundleChangesResults) + async def GetChanges(self, bundleurl=None, yaml=None): + ''' + 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=2, + params=_params) + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml + reply = await self.rpc(msg) + return reply + + + +class CAASAgentFacade(Type): + name = 'CAASAgent' + version = 2 + 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'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelTag': {'additionalProperties': False, 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'CloudSpec': {'description': "CloudSpec returns the model's " + 'cloud spec.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'GetCloudSpec': {'description': 'GetCloudSpec constructs the ' + 'CloudSpec for a validated and ' + 'authorized model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'description': 'WatchCloudSpecsChanges ' + 'returns a watcher ' + 'for cloud spec ' + 'changes.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(CloudSpecResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def 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 = await self.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='CAASAgent', + request='ControllerConfig', + version=2, + params=_params) + + reply = await self.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='CAASAgent', + request='GetCloudSpec', + version=2, + params=_params) + + reply = await self.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='CAASAgent', + request='ModelConfig', + version=2, + params=_params) + + reply = await self.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='CAASAgent', + request='WatchCloudSpecsChanges', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.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='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'}}, + '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'}, + 'ports': {'items': {'type': 'string'}, + 'type': 'array'}, + 'provider-id': {'type': 'string'}, + 'stateful': {'type': 'boolean'}, + 'status': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['provider-id', + 'unit-tag', + 'address', + 'ports', + 'status', + 'info'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}}, + 'required': ['revision', 'url', 'config'], + 'type': 'object'}, + 'CharmActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'CharmActions': {'additionalProperties': False, + 'properties': {'specs': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmActionSpec'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'CharmBase': {'additionalProperties': False, + 'properties': {'architectures': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'type': 'object'}, + 'CharmContainer': {'additionalProperties': False, + 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'type': 'array'}, + 'resource': {'type': 'string'}}, + 'type': 'object'}, + 'CharmDeployment': {'additionalProperties': False, + 'properties': {'min-version': {'type': 'string'}, + 'mode': {'type': 'string'}, + 'service': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', + 'mode', + 'service', + 'min-version'], + 'type': 'object'}, + 'CharmDevice': {'additionalProperties': False, + 'properties': {'CountMax': {'type': 'integer'}, + 'CountMin': {'type': 'integer'}, + 'Description': {'type': 'string'}, + 'Name': {'type': 'string'}, + 'Type': {'type': 'string'}}, + 'required': ['Name', + 'Description', + 'Type', + 'CountMin', + 'CountMax'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CharmManifest': {'additionalProperties': False, + 'properties': {'bases': {'items': {'$ref': '#/definitions/CharmBase'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CharmMeta': {'additionalProperties': False, + 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, + 'categories': {'items': {'type': 'string'}, + 'type': 'array'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, + 'type': 'object'}, + 'deployment': {'$ref': '#/definitions/CharmDeployment'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmDevice'}}, + 'type': 'object'}, + 'extra-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'min-juju-version': {'type': 'string'}, + 'name': {'type': 'string'}, + 'payload-classes': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmPayloadClass'}}, + 'type': 'object'}, + 'peers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'provides': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'requires': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'resources': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmResourceMeta'}}, + 'type': 'object'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmStorage'}}, + 'type': 'object'}, + 'subordinate': {'type': 'boolean'}, + 'summary': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'terms': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['name', + 'summary', + 'description', + 'subordinate'], + 'type': 'object'}, + 'CharmMetric': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'description'], + 'type': 'object'}, + 'CharmMetrics': {'additionalProperties': False, + 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, + 'type': 'object'}, + 'plan': {'$ref': '#/definitions/CharmPlan'}}, + 'required': ['metrics', 'plan'], + 'type': 'object'}, + 'CharmMount': {'additionalProperties': False, + 'properties': {'location': {'type': 'string'}, + 'storage': {'type': 'string'}}, + 'type': 'object'}, + 'CharmOption': {'additionalProperties': False, + 'properties': {'default': {'additionalProperties': True, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CharmPayloadClass': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', 'type'], + 'type': 'object'}, + 'CharmPlan': {'additionalProperties': False, + 'properties': {'required': {'type': 'boolean'}}, + 'required': ['required'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'CharmResourceMeta': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'path': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'description'], + 'type': 'object'}, + 'CharmStorage': {'additionalProperties': False, + 'properties': {'count-max': {'type': 'integer'}, + 'count-min': {'type': 'integer'}, + 'description': {'type': 'string'}, + 'location': {'type': 'string'}, + 'minimum-size': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'properties': {'items': {'type': 'string'}, + 'type': 'array'}, + 'read-only': {'type': 'boolean'}, + 'shared': {'type': 'boolean'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'description', + 'type', + 'shared', + 'read-only', + 'count-min', + 'count-max', + 'minimum-size'], + 'type': 'object'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'ConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + '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'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'ExpressionTree': {'additionalProperties': False, + 'properties': {'Expression': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['Expression'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'KubernetesDeploymentInfo': {'additionalProperties': False, + 'properties': {'deployment-type': {'type': 'string'}, + 'service-type': {'type': 'string'}}, + 'required': ['deployment-type', + 'service-type'], + 'type': 'object'}, + 'KubernetesDeviceParams': {'additionalProperties': False, + 'properties': {'Attributes': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'Count': {'type': 'integer'}, + 'Type': {'type': 'string'}}, + 'required': ['Type', + 'Count', + 'Attributes'], + 'type': 'object'}, + 'KubernetesFilesystemAttachmentParams': {'additionalProperties': False, + 'properties': {'mount-point': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'required': ['provider'], + 'type': 'object'}, + 'KubernetesFilesystemInfo': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'filesystem-id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'mount-point': {'type': 'string'}, + 'pool': {'type': 'string'}, + 'read-only': {'type': 'boolean'}, + 'size': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'storagename': {'type': 'string'}, + 'volume': {'$ref': '#/definitions/KubernetesVolumeInfo'}}, + 'required': ['storagename', + 'pool', + 'size', + 'filesystem-id', + 'status', + 'info', + 'volume'], + 'type': 'object'}, + 'KubernetesFilesystemParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/KubernetesFilesystemAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'storagename': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['storagename', + 'size', + 'provider'], + 'type': 'object'}, + 'KubernetesProvisioningInfo': {'additionalProperties': False, + 'properties': {'charm-modified-version': {'type': 'integer'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'deployment-info': {'$ref': '#/definitions/KubernetesDeploymentInfo'}, + 'devices': {'items': {'$ref': '#/definitions/KubernetesDeviceParams'}, + 'type': 'array'}, + 'filesystems': {'items': {'$ref': '#/definitions/KubernetesFilesystemParams'}, + 'type': 'array'}, + 'operator-image-path': {'type': 'string'}, + 'pod-spec': {'type': 'string'}, + 'raw-k8s-spec': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volumes': {'items': {'$ref': '#/definitions/KubernetesVolumeParams'}, + 'type': 'array'}}, + 'required': ['pod-spec', + 'constraints'], + 'type': 'object'}, + 'KubernetesProvisioningInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/KubernetesProvisioningInfo'}}, + 'required': ['result'], + 'type': 'object'}, + 'KubernetesProvisioningInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/KubernetesProvisioningInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'KubernetesVolumeAttachmentParams': {'additionalProperties': False, + 'properties': {'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'required': ['provider'], + 'type': 'object'}, + 'KubernetesVolumeInfo': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'volume-id': {'type': 'string'}}, + 'required': ['volume-id', + 'size', + 'persistent', + 'status', + 'info'], + 'type': 'object'}, + 'KubernetesVolumeParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/KubernetesVolumeAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'storagename': {'type': 'string'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['storagename', + 'size', + 'provider'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateApplicationServiceArg': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'application-tag': {'type': 'string'}, + 'generation': {'type': 'integer'}, + 'provider-id': {'type': 'string'}, + 'scale': {'type': 'integer'}}, + 'required': ['application-tag', + 'provider-id', + 'addresses'], + 'type': 'object'}, + 'UpdateApplicationServiceArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateApplicationServiceArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpdateApplicationUnitArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateApplicationUnits'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpdateApplicationUnitResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'$ref': '#/definitions/UpdateApplicationUnitsInfo'}}, + 'type': 'object'}, + 'UpdateApplicationUnitResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpdateApplicationUnitResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateApplicationUnits': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'generation': {'type': 'integer'}, + 'scale': {'type': 'integer'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'units': {'items': {'$ref': '#/definitions/ApplicationUnitParams'}, + 'type': 'array'}}, + 'required': ['application-tag', + 'units'], + 'type': 'object'}, + 'UpdateApplicationUnitsInfo': {'additionalProperties': False, + 'properties': {'units': {'items': {'$ref': '#/definitions/ApplicationUnitInfo'}, + 'type': 'array'}}, + 'required': ['units'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'ApplicationCharmInfo': {'description': 'ApplicationCharmInfo ' + 'returns information ' + 'about an ' + "application's charm.", + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'ApplicationsConfig': {'description': 'ApplicationsConfig ' + 'returns the config for ' + 'the specified ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'ApplicationsScale': {'description': 'ApplicationsScale ' + 'returns the scaling info ' + 'for specified ' + 'applications in this ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'ApplicationsTrust': {'description': 'ApplicationsTrust ' + 'returns the trust status ' + 'for specified ' + 'applications in this ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'CharmInfo': {'description': 'CharmInfo returns information ' + 'about the requested charm.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'ClearApplicationsResources': {'description': 'ClearApplicationsResources ' + 'clears the ' + 'flags which ' + 'indicate\n' + 'applications ' + 'still have ' + 'resources in ' + 'the cluster.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DeploymentMode': {'description': 'DeploymentMode returns the ' + 'deployment mode of the ' + "given applications' charms.", + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ProvisioningInfo': {'description': 'ProvisioningInfo returns ' + 'the provisioning info for ' + 'specified applications in ' + 'this model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/KubernetesProvisioningInfoResults'}}, + 'type': 'object'}, + 'SetOperatorStatus': {'description': 'SetOperatorStatus ' + 'updates the operator ' + 'status for each given ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateApplicationsService': {'description': 'UpdateApplicationsService ' + 'updates the Juju ' + 'data model to ' + 'reflect the ' + 'given\n' + 'service details ' + 'of the specified ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateApplicationServiceArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateApplicationsUnits': {'description': 'UpdateApplicationsUnits ' + 'updates the Juju ' + 'data model to ' + 'reflect the given\n' + 'units of the ' + 'specified ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateApplicationUnitArgs'}, + 'Result': {'$ref': '#/definitions/UpdateApplicationUnitResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts a NotifyWatcher for ' + 'each entity given.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchApplications': {'description': 'WatchApplications starts ' + 'a StringsWatcher to ' + 'watch applications\n' + 'deployed to this model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchApplicationsScale': {'description': 'WatchApplicationsScale ' + 'starts a ' + 'NotifyWatcher to ' + 'watch changes\n' + 'to the ' + "applications' " + 'scale.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchApplicationsTrustHash': {'description': 'WatchApplicationsTrustHash ' + 'starts a ' + 'StringsWatcher ' + 'to watch ' + 'changes\n' + 'to the ' + "applications' " + 'trust status.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchPodSpec': {'description': 'WatchPodSpec starts a ' + 'NotifyWatcher to watch ' + 'changes to the\n' + 'pod spec for specified units ' + 'in this model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(Charm) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def 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='CAASUnitProvisioner', + request='ApplicationsConfig', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def ApplicationsScale(self, entities=None): + ''' + ApplicationsScale returns the scaling info for specified applications in this model. + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='CAASUnitProvisioner', + request='ApplicationsScale', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def ApplicationsTrust(self, entities=None): + ''' + ApplicationsTrust returns the trust status for specified applications in this model. + + 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='CAASUnitProvisioner', + request='ApplicationsTrust', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.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)): + 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='CharmInfo', + version=2, + params=_params) + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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='CAASUnitProvisioner', + request='ClearApplicationsResources', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def DeploymentMode(self, entities=None): + ''' + DeploymentMode returns the deployment mode of the given applications' charms. + + 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='CAASUnitProvisioner', + request='DeploymentMode', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.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='CAASUnitProvisioner', + request='Life', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + async def 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 = await self.rpc(msg) + return reply + + + +class CharmRevisionUpdaterFacade(Type): + name = 'CharmRevisionUpdater' + version = 2 + 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'}}, + 'properties': {'UpdateLatestRevisions': {'description': 'UpdateLatestRevisions ' + 'retrieves the latest ' + 'revision information ' + 'from the charm store ' + 'for all deployed ' + 'charms\n' + 'and records this ' + 'information in ' + 'state.', + 'properties': {'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def 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 = await self.rpc(msg) + return reply + + + +class CharmsFacade(Type): + name = 'Charms' + version = 2 + schema = {'definitions': {'Charm': {'additionalProperties': False, + 'properties': {'actions': {'$ref': '#/definitions/CharmActions'}, + 'config': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmOption'}}, + 'type': 'object'}, + 'lxd-profile': {'$ref': '#/definitions/CharmLXDProfile'}, + 'meta': {'$ref': '#/definitions/CharmMeta'}, + 'metrics': {'$ref': '#/definitions/CharmMetrics'}, + 'revision': {'type': 'integer'}, + 'url': {'type': 'string'}}, + 'required': ['revision', 'url', 'config'], + 'type': 'object'}, + 'CharmActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'CharmActions': {'additionalProperties': False, + 'properties': {'specs': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmActionSpec'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'CharmDevice': {'additionalProperties': False, + 'properties': {'CountMax': {'type': 'integer'}, + 'CountMin': {'type': 'integer'}, + 'Description': {'type': 'string'}, + 'Name': {'type': 'string'}, + 'Type': {'type': 'string'}}, + 'required': ['Name', + 'Description', + 'Type', + 'CountMin', + 'CountMax'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CharmMeta': {'additionalProperties': False, + 'properties': {'categories': {'items': {'type': 'string'}, + 'type': 'array'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmDevice'}}, + 'type': 'object'}, + 'extra-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'min-juju-version': {'type': 'string'}, + 'name': {'type': 'string'}, + 'payload-classes': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmPayloadClass'}}, + 'type': 'object'}, + 'peers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'provides': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'requires': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'resources': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmResourceMeta'}}, + 'type': 'object'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmStorage'}}, + 'type': 'object'}, + 'subordinate': {'type': 'boolean'}, + 'summary': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'terms': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['name', + 'summary', + 'description', + 'subordinate'], + 'type': 'object'}, + 'CharmMetric': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'description'], + 'type': 'object'}, + 'CharmMetrics': {'additionalProperties': False, + 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, + 'type': 'object'}, + 'plan': {'$ref': '#/definitions/CharmPlan'}}, + 'required': ['metrics', 'plan'], + 'type': 'object'}, + 'CharmOption': {'additionalProperties': False, + 'properties': {'default': {'additionalProperties': True, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CharmPayloadClass': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', 'type'], + 'type': 'object'}, + 'CharmPlan': {'additionalProperties': False, + 'properties': {'required': {'type': 'boolean'}}, + 'required': ['required'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'CharmResourceMeta': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'path': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'description'], + 'type': 'object'}, + 'CharmStorage': {'additionalProperties': False, + 'properties': {'count-max': {'type': 'integer'}, + 'count-min': {'type': 'integer'}, + 'description': {'type': 'string'}, + 'location': {'type': 'string'}, + 'minimum-size': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'properties': {'items': {'type': 'string'}, + 'type': 'array'}, + 'read-only': {'type': 'boolean'}, + 'shared': {'type': 'boolean'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'description', + 'type', + 'shared', + 'read-only', + 'count-min', + 'count-max', + 'minimum-size'], + 'type': 'object'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'CharmsList': {'additionalProperties': False, + 'properties': {'names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['names'], + 'type': 'object'}, + 'CharmsListResult': {'additionalProperties': False, + 'properties': {'charm-urls': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['charm-urls'], + 'type': 'object'}, + 'IsMeteredResult': {'additionalProperties': False, + 'properties': {'metered': {'type': 'boolean'}}, + 'required': ['metered'], + 'type': 'object'}}, + 'properties': {'CharmInfo': {'description': 'CharmInfo returns information ' + 'about the requested charm.\n' + 'NOTE: thumper 2016-06-29, this ' + 'is not a bulk call and probably ' + 'should be.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'IsMetered': {'description': 'IsMetered returns whether or not ' + 'the charm is metered.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, + 'Result': {'$ref': '#/definitions/IsMeteredResult'}}, + 'type': 'object'}, + 'List': {'description': 'List returns a list of charm URLs ' + 'currently in the state.\n' + 'If supplied parameter contains any ' + 'names, the result will be filtered\n' + 'to return only the charms with ' + 'supplied names.', + 'properties': {'Params': {'$ref': '#/definitions/CharmsList'}, + 'Result': {'$ref': '#/definitions/CharmsListResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(Charm) + async def CharmInfo(self, url=None): + ''' + CharmInfo returns information about the requested charm. + NOTE: thumper 2016-06-29, this is not a bulk call and probably should be. + + 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=2, + params=_params) + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IsMeteredResult) + async def 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=2, + params=_params) + _params['url'] = url + reply = await self.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=2, + params=_params) + _params['names'] = names + reply = await self.rpc(msg) + return reply + + + +class CleanerFacade(Type): + name = 'Cleaner' + version = 2 + schema = {'definitions': {'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}}, + 'properties': {'Cleanup': {'description': 'Cleanup triggers a state cleanup', + 'type': 'object'}, + 'WatchCleanups': {'description': 'WatchCleanups watches for ' + 'cleanups to be performed in ' + 'state.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + +class ClientFacade(Type): + name = 'Client' + version = 2 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'AddCharm': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'url': {'type': 'string'}}, + 'required': ['url', 'channel', 'force'], + 'type': 'object'}, + 'AddCharmWithAuthorization': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'channel', + 'macaroon', + 'force'], + 'type': 'object'}, + 'AddMachineParams': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'container-type': {'type': 'string'}, + 'disks': {'items': {'$ref': '#/definitions/Constraints'}, + 'type': 'array'}, + 'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'instance-id': {'type': 'string'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'parent-id': {'type': 'string'}, + 'placement': {'$ref': '#/definitions/Placement'}, + 'series': {'type': 'string'}}, + 'required': ['series', + 'constraints', + 'jobs', + 'parent-id', + 'container-type', + 'instance-id', + 'nonce', + 'hardware-characteristics', + 'addresses'], + 'type': 'object'}, + 'AddMachines': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'AddMachinesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'machine': {'type': 'string'}}, + 'required': ['machine'], + 'type': 'object'}, + 'AddMachinesResults': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'AgentVersionResult': {'additionalProperties': False, + 'properties': {'version': {'$ref': '#/definitions/Number'}}, + 'required': ['version'], + 'type': 'object'}, + 'AllWatcherId': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'ApplicationOfferStatus': {'additionalProperties': False, + 'properties': {'active-connected-count': {'type': 'integer'}, + 'application-name': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteEndpoint'}}, + 'type': 'object'}, + 'err': {'$ref': '#/definitions/Error'}, + 'offer-name': {'type': 'string'}, + 'total-connected-count': {'type': 'integer'}}, + 'required': ['offer-name', + 'application-name', + 'charm', + 'endpoints', + 'active-connected-count', + 'total-connected-count'], + 'type': 'object'}, + 'ApplicationStatus': {'additionalProperties': False, + 'properties': {'can-upgrade-to': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'charm-profile': {'type': 'string'}, + 'charm-version': {'type': 'string'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'err': {'$ref': '#/definitions/Error'}, + 'exposed': {'type': 'boolean'}, + 'exposed-endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/ExposedEndpoint'}}, + 'type': 'object'}, + 'int': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'meter-statuses': {'patternProperties': {'.*': {'$ref': '#/definitions/MeterStatus'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'public-address': {'type': 'string'}, + 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'series': {'type': 'string'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}, + 'subordinate-to': {'items': {'type': 'string'}, + 'type': 'array'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, + 'type': 'object'}, + 'workload-version': {'type': 'string'}}, + 'required': ['charm', + 'series', + 'exposed', + 'life', + 'relations', + 'can-upgrade-to', + 'subordinate-to', + 'units', + 'meter-statuses', + 'status', + 'workload-version', + 'charm-version', + 'charm-profile', + 'endpoint-bindings', + 'public-address'], + 'type': 'object'}, + 'Binary': {'additionalProperties': False, + 'properties': {'Arch': {'type': 'string'}, + 'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Number': {'$ref': '#/definitions/Number'}, + 'Patch': {'type': 'integer'}, + 'Series': {'type': 'string'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build', + 'Number', + 'Series', + 'Arch'], + 'type': 'object'}, + 'BranchStatus': {'additionalProperties': False, + 'properties': {'assigned-units': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'created': {'type': 'integer'}, + 'created-by': {'type': 'string'}}, + 'required': ['assigned-units', + 'created', + 'created-by'], + 'type': 'object'}, + 'BundleChange': {'additionalProperties': False, + 'properties': {'args': {'items': {'additionalProperties': True, + 'type': 'object'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesParams': {'additionalProperties': False, + 'properties': {'bundleURL': {'type': 'string'}, + 'yaml': {'type': 'string'}}, + 'required': ['yaml', 'bundleURL'], + 'type': 'object'}, + 'BundleChangesResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'DestroyMachines': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'machine-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['machine-names', 'force'], + 'type': 'object'}, + 'DetailedStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'err': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}, + 'kind': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['status', + 'info', + 'data', + 'since', + 'kind', + 'version', + 'life'], + 'type': 'object'}, + 'EndpointStatus': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}, + 'subordinate': {'type': 'boolean'}}, + 'required': ['application', + 'name', + 'role', + 'subordinate'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'FindToolsParams': {'additionalProperties': False, + 'properties': {'agentstream': {'type': 'string'}, + 'arch': {'type': 'string'}, + 'major': {'type': 'integer'}, + 'minor': {'type': 'integer'}, + 'number': {'$ref': '#/definitions/Number'}, + 'series': {'type': 'string'}}, + 'required': ['number', + 'major', + 'minor', + 'arch', + 'series', + 'agentstream'], + 'type': 'object'}, + 'FindToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'list': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['list'], + 'type': 'object'}, + 'FullStatus': {'additionalProperties': False, + 'properties': {'applications': {'patternProperties': {'.*': {'$ref': '#/definitions/ApplicationStatus'}}, + 'type': 'object'}, + 'branches': {'patternProperties': {'.*': {'$ref': '#/definitions/BranchStatus'}}, + 'type': 'object'}, + 'controller-timestamp': {'format': 'date-time', + 'type': 'string'}, + 'machines': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}}, + 'type': 'object'}, + 'model': {'$ref': '#/definitions/ModelStatusInfo'}, + 'offers': {'patternProperties': {'.*': {'$ref': '#/definitions/ApplicationOfferStatus'}}, + 'type': 'object'}, + 'relations': {'items': {'$ref': '#/definitions/RelationStatus'}, + 'type': 'array'}, + 'remote-applications': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteApplicationStatus'}}, + 'type': 'object'}}, + 'required': ['model', + 'machines', + 'applications', + 'remote-applications', + 'offers', + 'relations', + 'controller-timestamp', + 'branches'], + 'type': 'object'}, + 'GetConstraintsResults': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'root-disk-source': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'History': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'statuses': {'items': {'$ref': '#/definitions/DetailedStatus'}, + 'type': 'array'}}, + 'required': ['statuses'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'LXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachineHardware': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'MachineStatus': {'additionalProperties': False, + 'properties': {'agent-status': {'$ref': '#/definitions/DetailedStatus'}, + 'constraints': {'type': 'string'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}}, + 'type': 'object'}, + 'display-name': {'type': 'string'}, + 'dns-name': {'type': 'string'}, + 'hardware': {'type': 'string'}, + 'has-vote': {'type': 'boolean'}, + 'id': {'type': 'string'}, + 'instance-id': {'type': 'string'}, + 'instance-status': {'$ref': '#/definitions/DetailedStatus'}, + 'ip-addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'lxd-profiles': {'patternProperties': {'.*': {'$ref': '#/definitions/LXDProfile'}}, + 'type': 'object'}, + 'modification-status': {'$ref': '#/definitions/DetailedStatus'}, + 'network-interfaces': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInterface'}}, + 'type': 'object'}, + 'primary-controller-machine': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'wants-vote': {'type': 'boolean'}}, + 'required': ['agent-status', + 'instance-status', + 'modification-status', + 'dns-name', + 'instance-id', + 'display-name', + 'series', + 'id', + 'containers', + 'constraints', + 'hardware', + 'jobs', + 'has-vote', + 'wants-vote'], + 'type': 'object'}, + 'MeterStatus': {'additionalProperties': False, + 'properties': {'color': {'type': 'string'}, + 'message': {'type': 'string'}}, + 'required': ['color', 'message'], + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'cloud-credential-tag': {'type': 'string'}, + 'cloud-credential-validity': {'type': 'boolean'}, + 'cloud-region': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'controller-uuid': {'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'}, + 'sla': {'$ref': '#/definitions/ModelSLAInfo'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'type': {'type': 'string'}, + 'users': {'items': {'$ref': '#/definitions/ModelUserInfo'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', + 'type', + 'uuid', + 'controller-uuid', + 'is-controller', + 'cloud-tag', + 'owner-tag', + 'life', + 'users', + 'machines', + 'sla', + 'agent-version'], + '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'}, + 'ModelSLA': {'additionalProperties': False, + 'properties': {'ModelSLAInfo': {'$ref': '#/definitions/ModelSLAInfo'}, + 'creds': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', + 'owner', + 'ModelSLAInfo', + 'creds'], + 'type': 'object'}, + 'ModelSLAInfo': {'additionalProperties': False, + 'properties': {'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', 'owner'], + 'type': 'object'}, + 'ModelSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelStatusInfo': {'additionalProperties': False, + 'properties': {'available-version': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'meter-status': {'$ref': '#/definitions/MeterStatus'}, + 'model-status': {'$ref': '#/definitions/DetailedStatus'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'sla': {'type': 'string'}, + 'type': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['name', + 'type', + 'cloud-tag', + 'version', + 'available-version', + 'model-status', + 'meter-status', + 'sla'], + 'type': 'object'}, + 'ModelUnset': {'additionalProperties': False, + 'properties': {'keys': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['keys'], + 'type': 'object'}, + 'ModelUserInfo': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'display-name': {'type': 'string'}, + 'last-connection': {'format': 'date-time', + 'type': 'string'}, + 'user': {'type': 'string'}}, + 'required': ['user', + 'display-name', + 'last-connection', + 'access'], + 'type': 'object'}, + 'ModelUserInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ModelUserInfo'}}, + 'type': 'object'}, + 'ModelUserInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ModelUserInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NetworkInterface': {'additionalProperties': False, + 'properties': {'dns-nameservers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway': {'type': 'string'}, + 'ip-addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'is-up': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'space': {'type': 'string'}}, + 'required': ['ip-addresses', + 'mac-address', + 'is-up'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'PrivateAddress': {'additionalProperties': False, + 'properties': {'target': {'type': 'string'}}, + 'required': ['target'], + 'type': 'object'}, + 'PrivateAddressResults': {'additionalProperties': False, + 'properties': {'private-address': {'type': 'string'}}, + 'required': ['private-address'], + 'type': 'object'}, + 'ProvisioningScriptParams': {'additionalProperties': False, + 'properties': {'data-dir': {'type': 'string'}, + 'disable-package-commands': {'type': 'boolean'}, + 'machine-id': {'type': 'string'}, + 'nonce': {'type': 'string'}}, + 'required': ['machine-id', + 'nonce', + 'data-dir', + 'disable-package-commands'], + 'type': 'object'}, + 'ProvisioningScriptResult': {'additionalProperties': False, + 'properties': {'script': {'type': 'string'}}, + 'required': ['script'], + 'type': 'object'}, + 'PublicAddress': {'additionalProperties': False, + 'properties': {'target': {'type': 'string'}}, + 'required': ['target'], + 'type': 'object'}, + 'PublicAddressResults': {'additionalProperties': False, + 'properties': {'public-address': {'type': 'string'}}, + 'required': ['public-address'], + 'type': 'object'}, + 'RelationStatus': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'$ref': '#/definitions/EndpointStatus'}, + 'type': 'array'}, + 'id': {'type': 'integer'}, + 'interface': {'type': 'string'}, + 'key': {'type': 'string'}, + 'scope': {'type': 'string'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}}, + 'required': ['id', + 'key', + 'interface', + 'scope', + 'endpoints', + 'status'], + 'type': 'object'}, + 'RemoteApplicationStatus': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'err': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}}, + 'required': ['offer-url', + 'offer-name', + 'endpoints', + 'life', + 'relations', + 'status'], + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'ResolveCharmResult': {'additionalProperties': False, + 'properties': {'error': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'type': 'object'}, + 'ResolveCharmResults': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/ResolveCharmResult'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'ResolveCharms': {'additionalProperties': False, + 'properties': {'references': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['references'], + 'type': 'object'}, + 'Resolved': {'additionalProperties': False, + 'properties': {'retry': {'type': 'boolean'}, + 'unit-name': {'type': 'string'}}, + 'required': ['unit-name', 'retry'], + 'type': 'object'}, + 'SetConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['application', 'constraints'], + 'type': 'object'}, + 'SetModelAgentVersion': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'required': ['version'], + 'type': 'object'}, + 'StatusHistoryFilter': {'additionalProperties': False, + 'properties': {'date': {'format': 'date-time', + 'type': 'string'}, + 'delta': {'type': 'integer'}, + 'exclude': {'items': {'type': 'string'}, + 'type': 'array'}, + 'size': {'type': 'integer'}}, + 'required': ['size', + 'date', + 'delta', + 'exclude'], + 'type': 'object'}, + 'StatusHistoryRequest': {'additionalProperties': False, + 'properties': {'filter': {'$ref': '#/definitions/StatusHistoryFilter'}, + 'historyKind': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tag': {'type': 'string'}}, + 'required': ['historyKind', + 'size', + 'filter', + 'tag'], + 'type': 'object'}, + 'StatusHistoryRequests': {'additionalProperties': False, + 'properties': {'requests': {'items': {'$ref': '#/definitions/StatusHistoryRequest'}, + 'type': 'array'}}, + 'required': ['requests'], + 'type': 'object'}, + 'StatusHistoryResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'history': {'$ref': '#/definitions/History'}}, + 'required': ['history'], + 'type': 'object'}, + 'StatusHistoryResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusHistoryResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusParams': {'additionalProperties': False, + 'properties': {'patterns': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['patterns'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'UnitStatus': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'agent-status': {'$ref': '#/definitions/DetailedStatus'}, + 'charm': {'type': 'string'}, + 'leader': {'type': 'boolean'}, + 'machine': {'type': 'string'}, + 'opened-ports': {'items': {'type': 'string'}, + 'type': 'array'}, + 'provider-id': {'type': 'string'}, + 'public-address': {'type': 'string'}, + 'subordinates': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, + 'type': 'object'}, + 'workload-status': {'$ref': '#/definitions/DetailedStatus'}, + 'workload-version': {'type': 'string'}}, + 'required': ['agent-status', + 'workload-status', + 'workload-version', + 'machine', + 'opened-ports', + 'public-address', + 'charm', + 'subordinates'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'host/port addresses stored in ' + 'state.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'AbortCurrentUpgrade': {'description': 'AbortCurrentUpgrade ' + 'aborts and archives ' + 'the current upgrade\n' + 'synchronisation ' + 'record, if any.', + 'type': 'object'}, + 'AddCharm': {'description': 'NOTE: AddCharm is deprecated as ' + 'of juju 2.9 and charms facade ' + 'version 3.\n' + 'Please discontinue use and move ' + 'to the charms facade version.\n' + '\n' + 'TODO: remove in juju 3.0', + 'properties': {'Params': {'$ref': '#/definitions/AddCharm'}}, + 'type': 'object'}, + 'AddCharmWithAuthorization': {'description': 'AddCharmWithAuthorization ' + 'adds the given ' + 'charm URL (which ' + 'must include\n' + 'revision) to the ' + 'model, if it ' + 'does not exist ' + 'yet. Local ' + 'charms are not\n' + 'supported, only ' + 'charm store ' + 'URLs. See also ' + 'AddLocalCharm().\n' + '\n' + 'The ' + 'authorization ' + 'macaroon, ' + 'args.CharmStoreMacaroon, ' + 'may be omitted, ' + 'in\n' + 'which case this ' + 'call is ' + 'equivalent to ' + 'AddCharm.\n' + '\n' + 'NOTE: ' + 'AddCharmWithAuthorization ' + 'is deprecated as ' + 'of juju 2.9 and ' + 'charms\n' + 'facade version ' + '3. Please ' + 'discontinue use ' + 'and move to the ' + 'charms facade\n' + 'version.\n' + '\n' + 'TODO: remove in ' + 'juju 3.0', + 'properties': {'Params': {'$ref': '#/definitions/AddCharmWithAuthorization'}}, + 'type': 'object'}, + 'AddMachines': {'description': 'AddMachines adds new machines ' + 'with the supplied parameters.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'AddMachinesV2': {'description': 'AddMachinesV2 adds new ' + 'machines with the supplied ' + 'parameters.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'AgentVersion': {'description': 'AgentVersion returns the ' + 'current version that the API ' + 'server is running.', + 'properties': {'Result': {'$ref': '#/definitions/AgentVersionResult'}}, + 'type': 'object'}, + 'CACert': {'description': 'CACert returns the certificate used ' + 'to validate the state connection.', + 'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'DestroyMachines': {'description': 'DestroyMachines removes a ' + 'given set of machines.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyMachines'}}, + 'type': 'object'}, + 'FindTools': {'description': 'FindTools returns a List ' + 'containing all tools matching ' + 'the given parameters.', + 'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, + 'Result': {'$ref': '#/definitions/FindToolsResult'}}, + 'type': 'object'}, + 'FullStatus': {'description': 'FullStatus gives the ' + 'information needed for juju ' + 'status over the api', + 'properties': {'Params': {'$ref': '#/definitions/StatusParams'}, + 'Result': {'$ref': '#/definitions/FullStatus'}}, + 'type': 'object'}, + 'GetBundleChanges': {'description': 'GetBundleChanges returns ' + 'the list of changes ' + 'required to deploy the ' + 'given\n' + 'bundle data. The changes ' + 'are sorted by ' + 'requirements, so that ' + 'they can be\n' + 'applied in order.\n' + 'This call is deprecated, ' + 'clients should use the ' + 'GetChanges endpoint on ' + 'the\n' + 'Bundle facade.\n' + 'Note: any new feature in ' + 'the future like devices ' + 'will never be supported ' + 'here.', + 'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, + 'type': 'object'}, + 'GetModelConstraints': {'description': 'GetModelConstraints ' + 'returns the ' + 'constraints for the ' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, + 'type': 'object'}, + 'InjectMachines': {'description': 'InjectMachines injects a ' + 'machine into state with ' + 'provisioned status.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'ModelGet': {'description': 'ModelGet implements the ' + 'server-side part of the\n' + 'model-config CLI command.', + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelInfo': {'description': 'ModelInfo returns information ' + 'about the current model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelInfo'}}, + 'type': 'object'}, + 'ModelSet': {'description': 'ModelSet implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, + 'type': 'object'}, + 'ModelUnset': {'description': 'ModelUnset implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, + 'type': 'object'}, + 'ModelUserInfo': {'description': 'ModelUserInfo returns ' + 'information on all users in ' + 'the model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelUserInfoResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'description': 'PrivateAddress implements ' + 'the server side of ' + 'Client.PrivateAddress.', + 'properties': {'Params': {'$ref': '#/definitions/PrivateAddress'}, + 'Result': {'$ref': '#/definitions/PrivateAddressResults'}}, + 'type': 'object'}, + 'ProvisioningScript': {'description': 'ProvisioningScript ' + 'returns a shell script ' + 'that, when run,\n' + 'provisions a machine ' + 'agent on the machine ' + 'executing the script.', + 'properties': {'Params': {'$ref': '#/definitions/ProvisioningScriptParams'}, + 'Result': {'$ref': '#/definitions/ProvisioningScriptResult'}}, + 'type': 'object'}, + 'PublicAddress': {'description': 'PublicAddress implements the ' + 'server side of ' + 'Client.PublicAddress.', + 'properties': {'Params': {'$ref': '#/definitions/PublicAddress'}, + 'Result': {'$ref': '#/definitions/PublicAddressResults'}}, + 'type': 'object'}, + 'ResolveCharms': {'description': 'ResolveCharm resolves the ' + 'best available charm URLs ' + 'with series, for charm\n' + 'locations without a series ' + 'specified.\n' + '\n' + 'NOTE: ResolveCharms is ' + 'deprecated as of juju 2.9 ' + 'and charms facade version ' + '3.\n' + 'Please discontinue use and ' + 'move to the charms facade ' + 'version.\n' + '\n' + 'TODO: remove in juju 3.0', + 'properties': {'Params': {'$ref': '#/definitions/ResolveCharms'}, + 'Result': {'$ref': '#/definitions/ResolveCharmResults'}}, + 'type': 'object'}, + 'Resolved': {'description': 'Resolved implements the server ' + 'side of Client.Resolved.', + 'properties': {'Params': {'$ref': '#/definitions/Resolved'}}, + 'type': 'object'}, + 'RetryProvisioning': {'description': 'RetryProvisioning marks ' + 'a provisioning error as ' + 'transient on the ' + 'machines.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SLALevel': {'description': 'SLALevel returns the current sla ' + 'level for the model.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetModelAgentVersion': {'description': 'SetModelAgentVersion ' + 'sets the model agent ' + 'version.', + 'properties': {'Params': {'$ref': '#/definitions/SetModelAgentVersion'}}, + 'type': 'object'}, + 'SetModelConstraints': {'description': 'SetModelConstraints ' + 'sets the constraints ' + 'for the model.', + 'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetSLALevel': {'description': 'SetSLALevel sets the sla level ' + 'on the model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, + 'type': 'object'}, + 'StatusHistory': {'description': 'StatusHistory returns a ' + 'slice of past statuses for ' + 'several entities.', + 'properties': {'Params': {'$ref': '#/definitions/StatusHistoryRequests'}, + 'Result': {'$ref': '#/definitions/StatusHistoryResults'}}, + 'type': 'object'}, + 'WatchAll': {'description': 'WatchAll initiates a watcher for ' + 'entities in the connected model.', + 'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + APIHostPorts returns the API host/port addresses stored in state. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='APIHostPorts', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AbortCurrentUpgrade(self): + ''' + AbortCurrentUpgrade aborts and archives the current upgrade + synchronisation record, if any. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='AbortCurrentUpgrade', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AddCharm(self, channel=None, force=None, url=None): + ''' + NOTE: AddCharm is deprecated as of juju 2.9 and charms facade version 3. + Please discontinue use and move to the charms facade version. + + TODO: remove in juju 3.0 + + channel : str + force : bool + url : str + Returns -> None + ''' + 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 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='Client', + request='AddCharm', + version=2, + params=_params) + _params['channel'] = channel + _params['force'] = force + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AddCharmWithAuthorization(self, channel=None, force=None, macaroon=None, url=None): + ''' + AddCharmWithAuthorization adds the given charm URL (which must include + revision) to the model, if it does not exist yet. Local charms are not + supported, only charm store URLs. See also AddLocalCharm(). + + The authorization macaroon, args.CharmStoreMacaroon, may be omitted, in + which case this call is equivalent to AddCharm. + + NOTE: AddCharmWithAuthorization is deprecated as of juju 2.9 and charms + facade version 3. Please discontinue use and move to the charms facade + version. + + TODO: remove in juju 3.0 + + channel : str + force : bool + macaroon : Macaroon + url : str + Returns -> None + ''' + 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 macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): + raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) + + 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='Client', + request='AddCharmWithAuthorization', + version=2, + params=_params) + _params['channel'] = channel + _params['force'] = force + _params['macaroon'] = macaroon + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def AddMachines(self, params=None): + ''' + AddMachines adds new machines with the supplied parameters. + + 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='Client', + request='AddMachines', + version=2, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def AddMachinesV2(self, params=None): + ''' + AddMachinesV2 adds new machines with the supplied parameters. + + 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='Client', + request='AddMachinesV2', + version=2, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AgentVersionResult) + async def AgentVersion(self): + ''' + AgentVersion returns the current version that the API server is running. + + + Returns -> AgentVersionResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='AgentVersion', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BytesResult) + async def CACert(self): + ''' + CACert returns the certificate used to validate the state connection. + + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='CACert', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyMachines(self, force=None, machine_names=None): + ''' + DestroyMachines removes a given set of machines. + + force : bool + machine_names : typing.Sequence[str] + Returns -> None + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if machine_names is not None and not isinstance(machine_names, (bytes, str, list)): + raise Exception("Expected machine_names to be a Sequence, received: {}".format(type(machine_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='DestroyMachines', + version=2, + params=_params) + _params['force'] = force + _params['machine-names'] = machine_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindToolsResult) + async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, number=None, series=None): + ''' + FindTools returns a List containing all tools matching the given parameters. + + agentstream : str + arch : str + major : int + minor : int + number : Number + series : 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 minor is not None and not isinstance(minor, int): + raise Exception("Expected minor to be a int, received: {}".format(type(minor))) + + if number is not None and not isinstance(number, (dict, Number)): + raise Exception("Expected number to be a Number, received: {}".format(type(number))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='FindTools', + version=2, + params=_params) + _params['agentstream'] = agentstream + _params['arch'] = arch + _params['major'] = major + _params['minor'] = minor + _params['number'] = number + _params['series'] = series + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FullStatus) + async def FullStatus(self, patterns=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=2, + params=_params) + _params['patterns'] = patterns + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BundleChangesResults) + async def GetBundleChanges(self, bundleurl=None, yaml=None): + ''' + GetBundleChanges 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. + This call is deprecated, clients should use the GetChanges endpoint on the + Bundle facade. + Note: any new feature in the future like devices will never be supported here. + + 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='Client', + request='GetBundleChanges', + version=2, + params=_params) + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetConstraintsResults) + async def GetModelConstraints(self): + ''' + GetModelConstraints returns the constraints for the model. + + + Returns -> GetConstraintsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='GetModelConstraints', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def InjectMachines(self, params=None): + ''' + InjectMachines injects a machine into state with provisioned status. + + 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='Client', + request='InjectMachines', + version=2, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResults) + async def 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='Client', + request='ModelGet', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelInfo) + async def ModelInfo(self): + ''' + ModelInfo returns information about the current model. + + + Returns -> ModelInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ModelInfo', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ModelSet(self, config=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='Client', + request='ModelSet', + version=2, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='ModelUnset', + version=2, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelUserInfoResults) + async def ModelUserInfo(self): + ''' + ModelUserInfo returns information on all users in the model. + + + Returns -> ModelUserInfoResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ModelUserInfo', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PrivateAddressResults) + async def PrivateAddress(self, target=None): + ''' + PrivateAddress implements the server side of Client.PrivateAddress. + + target : str + Returns -> PrivateAddressResults + ''' + if target is not None and not isinstance(target, (bytes, str)): + raise Exception("Expected target to be a str, received: {}".format(type(target))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='PrivateAddress', + version=2, + params=_params) + _params['target'] = target + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProvisioningScriptResult) + async def ProvisioningScript(self, data_dir=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='Client', + request='ProvisioningScript', + version=2, + params=_params) + _params['data-dir'] = data_dir + _params['disable-package-commands'] = disable_package_commands + _params['machine-id'] = machine_id + _params['nonce'] = nonce + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PublicAddressResults) + async def PublicAddress(self, target=None): + ''' + PublicAddress implements the server side of Client.PublicAddress. + + target : str + Returns -> PublicAddressResults + ''' + if target is not None and not isinstance(target, (bytes, str)): + raise Exception("Expected target to be a str, received: {}".format(type(target))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='PublicAddress', + version=2, + params=_params) + _params['target'] = target + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolveCharmResults) + async def ResolveCharms(self, references=None): + ''' + ResolveCharm resolves the best available charm URLs with series, for charm + locations without a series specified. + + NOTE: ResolveCharms is deprecated as of juju 2.9 and charms facade version 3. + Please discontinue use and move to the charms facade version. + + TODO: remove in juju 3.0 + + references : typing.Sequence[str] + Returns -> ResolveCharmResults + ''' + if references is not None and not isinstance(references, (bytes, str, list)): + raise Exception("Expected references to be a Sequence, received: {}".format(type(references))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ResolveCharms', + version=2, + params=_params) + _params['references'] = references + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Resolved(self, retry=None, unit_name=None): + ''' + Resolved implements the server side of Client.Resolved. + + retry : bool + unit_name : str + Returns -> None + ''' + if retry is not None and not isinstance(retry, bool): + raise Exception("Expected retry to be a bool, received: {}".format(type(retry))) + + if unit_name is not None and not isinstance(unit_name, (bytes, str)): + raise Exception("Expected unit_name to be a str, received: {}".format(type(unit_name))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='Resolved', + version=2, + params=_params) + _params['retry'] = retry + _params['unit-name'] = unit_name + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RetryProvisioning(self, entities=None): + ''' + RetryProvisioning marks a provisioning error as transient on the 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='Client', + request='RetryProvisioning', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + SLALevel returns the current sla level for the model. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='SLALevel', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetModelAgentVersion(self, force=None, version=None): + ''' + SetModelAgentVersion sets the model agent version. + + force : bool + version : Number + Returns -> None + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + 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='Client', + request='SetModelAgentVersion', + version=2, + params=_params) + _params['force'] = force + _params['version'] = version + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='SetModelConstraints', + version=2, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetSLALevel(self, 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='Client', + request='SetSLALevel', + version=2, + params=_params) + _params['ModelSLAInfo'] = modelslainfo + _params['creds'] = creds + _params['level'] = level + _params['owner'] = owner + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusHistoryResults) + async def 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=2, + params=_params) + _params['requests'] = requests + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AllWatcherId) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CredentialValidatorFacade(Type): + name = 'CredentialValidator' + version = 2 + schema = {'definitions': {'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'InvalidateCredentialArg': {'additionalProperties': False, + 'properties': {'reason': {'type': 'string'}}, + 'type': 'object'}, + 'ModelCredential': {'additionalProperties': False, + 'properties': {'credential-tag': {'type': 'string'}, + 'exists': {'type': 'boolean'}, + 'model-tag': {'type': 'string'}, + 'valid': {'type': 'boolean'}}, + 'required': ['model-tag', + 'credential-tag'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}}, + 'properties': {'InvalidateModelCredential': {'description': 'InvalidateModelCredential ' + 'marks the cloud ' + 'credential for ' + 'this model as ' + 'invalid.', + 'properties': {'Params': {'$ref': '#/definitions/InvalidateCredentialArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'ModelCredential': {'description': 'ModelCredential returns ' + 'cloud credential ' + 'information for a model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelCredential'}}, + 'type': 'object'}, + 'WatchCredential': {'description': 'WatchCredential returns a ' + 'NotifyWatcher that ' + 'observes\n' + 'changes to a given cloud ' + 'credential.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelCredential': {'description': 'WatchModelCredential ' + 'returns a ' + 'NotifyWatcher that ' + 'watches what cloud ' + 'credential a model ' + 'uses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelCredential) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + +class CrossModelRelationsFacade(Type): + name = 'CrossModelRelations' + version = 2 + 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': {'application-token': {'type': 'string'}, + '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', + 'application-token', + 'ingress-required'], + 'type': 'object'}, + 'IngressNetworksChanges': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/IngressNetworksChangeEvent'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'OfferArg': {'additionalProperties': False, + 'properties': {'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'}, + 'remote-space': {'$ref': '#/definitions/RemoteSpace'}, + 'source-model-tag': {'type': 'string'}}, + 'required': ['application-token', + 'source-model-tag', + 'relation-token', + 'remote-endpoint', + 'remote-space', + 'offer-uuid', + 'local-endpoint-name'], + 'type': 'object'}, + 'RegisterRemoteRelationArgs': {'additionalProperties': False, + 'properties': {'relations': {'items': {'$ref': '#/definitions/RegisterRemoteRelationArg'}, + 'type': 'array'}}, + 'required': ['relations'], + 'type': 'object'}, + 'RegisterRemoteRelationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoteRelationDetails'}}, + 'type': 'object'}, + 'RegisterRemoteRelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RegisterRemoteRelationResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'RelationLifeSuspendedStatusChange': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'life': {'type': 'string'}, + 'suspended': {'type': 'boolean'}, + 'suspended-reason': {'type': 'string'}}, + 'required': ['key', + 'life', + 'suspended', + 'suspended-reason'], + 'type': 'object'}, + 'RelationLifeSuspendedStatusWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RelationLifeSuspendedStatusChange'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationStatusWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationLifeSuspendedStatusWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'], + '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'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}}, + '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'}, + '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=2, + 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=2, + 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=2, + 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=2, + 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=2, + 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=2, + 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=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + +class DiscoverSpacesFacade(Type): + name = 'DiscoverSpaces' + version = 2 + schema = {'definitions': {'AddSubnetParams': {'additionalProperties': False, + 'properties': {'provider-network-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'subnet-provider-id': {'type': 'string'}, + 'subnet-tag': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['space-tag'], + 'type': 'object'}, + 'AddSubnetsParams': {'additionalProperties': False, + 'properties': {'subnets': {'items': {'$ref': '#/definitions/AddSubnetParams'}, + 'type': 'array'}}, + 'required': ['subnets'], + 'type': 'object'}, + 'CreateSpaceParams': {'additionalProperties': False, + 'properties': {'provider-id': {'type': 'string'}, + 'public': {'type': 'boolean'}, + 'space-tag': {'type': 'string'}, + 'subnet-tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['subnet-tags', + 'space-tag', + 'public'], + 'type': 'object'}, + 'CreateSpacesParams': {'additionalProperties': False, + 'properties': {'spaces': {'items': {'$ref': '#/definitions/CreateSpaceParams'}, + 'type': 'array'}}, + 'required': ['spaces'], + 'type': 'object'}, + 'DiscoverSpacesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProviderSpace'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListSubnetsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ProviderSpace': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['name', + 'provider-id', + 'subnets'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'SubnetsFilters': {'additionalProperties': False, + 'properties': {'space-tag': {'type': 'string'}, + 'zone': {'type': 'string'}}, + 'type': 'object'}}, + 'properties': {'AddSubnets': {'properties': {'Params': {'$ref': '#/definitions/AddSubnetsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CreateSpaces': {'properties': {'Params': {'$ref': '#/definitions/CreateSpacesParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ListSpaces': {'properties': {'Result': {'$ref': '#/definitions/DiscoverSpacesResults'}}, + 'type': 'object'}, + 'ListSubnets': {'properties': {'Params': {'$ref': '#/definitions/SubnetsFilters'}, + 'Result': {'$ref': '#/definitions/ListSubnetsResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def AddSubnets(self, subnets=None): + ''' + subnets : typing.Sequence[~AddSubnetParams] + Returns -> ErrorResults + ''' + if subnets is not None and not isinstance(subnets, (bytes, str, list)): + raise Exception("Expected subnets to be a Sequence, received: {}".format(type(subnets))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='DiscoverSpaces', + request='AddSubnets', + version=2, + params=_params) + _params['subnets'] = subnets + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def CreateSpaces(self, spaces=None): + ''' + 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='DiscoverSpaces', + request='CreateSpaces', + version=2, + params=_params) + _params['spaces'] = spaces + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DiscoverSpacesResults) + async def ListSpaces(self): + ''' + + Returns -> DiscoverSpacesResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='DiscoverSpaces', + request='ListSpaces', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListSubnetsResults) + async def ListSubnets(self, space_tag=None, zone=None): + ''' + 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='DiscoverSpaces', + request='ListSubnets', + version=2, + params=_params) + _params['space-tag'] = space_tag + _params['zone'] = zone + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='DiscoverSpaces', + request='ModelConfig', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class DiskManagerFacade(Type): + name = 'DiskManager' + version = 2 + schema = {'definitions': {'BlockDevice': {'additionalProperties': False, + 'properties': {'BusAddress': {'type': 'string'}, + 'DeviceLinks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'DeviceName': {'type': 'string'}, + 'FilesystemType': {'type': 'string'}, + 'HardwareId': {'type': 'string'}, + 'InUse': {'type': 'boolean'}, + 'Label': {'type': 'string'}, + 'MountPoint': {'type': 'string'}, + 'SerialId': {'type': 'string'}, + 'Size': {'type': 'integer'}, + 'UUID': {'type': 'string'}, + 'WWN': {'type': 'string'}}, + 'required': ['DeviceName', + 'DeviceLinks', + 'Label', + 'UUID', + 'HardwareId', + 'WWN', + 'BusAddress', + 'Size', + 'FilesystemType', + 'InUse', + 'MountPoint', + 'SerialId'], + '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'}, + 'MachineBlockDevices': {'additionalProperties': False, + 'properties': {'block-devices': {'items': {'$ref': '#/definitions/BlockDevice'}, + 'type': 'array'}, + 'machine': {'type': 'string'}}, + 'required': ['machine'], + 'type': 'object'}, + 'SetMachineBlockDevices': {'additionalProperties': False, + 'properties': {'machine-block-devices': {'items': {'$ref': '#/definitions/MachineBlockDevices'}, + 'type': 'array'}}, + 'required': ['machine-block-devices'], + 'type': 'object'}}, + 'properties': {'SetMachineBlockDevices': {'properties': {'Params': {'$ref': '#/definitions/SetMachineBlockDevices'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def SetMachineBlockDevices(self, machine_block_devices=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 = await self.rpc(msg) + return reply + + + +class EntityWatcherFacade(Type): + name = 'EntityWatcher' + version = 2 + schema = {'definitions': {'EntitiesWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvEntitiesWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/EntitiesWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(EntitiesWatchResult) + async def 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 = await self.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='EntityWatcher', + request='Stop', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class FilesystemAttachmentsWatcherFacade(Type): + name = 'FilesystemAttachmentsWatcher' + version = 2 + 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'}, + 'MachineStorageId': {'additionalProperties': False, + 'properties': {'attachment-tag': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'attachment-tag'], + 'type': 'object'}, + 'MachineStorageIdsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvMachineStorageIdsWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(MachineStorageIdsWatchResult) + async def 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 = await self.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='FilesystemAttachmentsWatcher', + request='Stop', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class HighAvailabilityFacade(Type): + name = 'HighAvailability' + version = 2 + schema = {'definitions': {'ControllersChangeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ControllersChanges'}}, + 'required': ['result'], + 'type': 'object'}, + 'ControllersChangeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllersChangeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllersChanges': {'additionalProperties': False, + 'properties': {'added': {'items': {'type': 'string'}, + 'type': 'array'}, + 'converted': {'items': {'type': 'string'}, + 'type': 'array'}, + 'maintained': {'items': {'type': 'string'}, + 'type': 'array'}, + 'removed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ControllersSpec': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}, + 'num-controllers': {'type': 'integer'}, + 'placement': {'items': {'type': 'string'}, + 'type': 'array'}, + 'series': {'type': 'string'}}, + 'required': ['num-controllers'], + 'type': 'object'}, + 'ControllersSpecs': {'additionalProperties': False, + 'properties': {'specs': {'items': {'$ref': '#/definitions/ControllersSpec'}, + 'type': 'array'}}, + 'required': ['specs'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'EnableHA': {'description': 'EnableHA adds controller machines ' + 'as necessary to ensure the\n' + 'controller has the number of ' + 'machines specified.', + 'properties': {'Params': {'$ref': '#/definitions/ControllersSpecs'}, + 'Result': {'$ref': '#/definitions/ControllersChangeResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ControllersChangeResults) + async def 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 = await self.rpc(msg) + return reply + + + +class ImageManagerFacade(Type): + name = 'ImageManager' + version = 2 + 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'}, + 'ImageFilterParams': {'additionalProperties': False, + 'properties': {'images': {'items': {'$ref': '#/definitions/ImageSpec'}, + 'type': 'array'}}, + 'required': ['images'], + 'type': 'object'}, + 'ImageMetadata': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'created': {'format': 'date-time', + 'type': 'string'}, + 'kind': {'type': 'string'}, + 'series': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'required': ['kind', + 'arch', + 'series', + 'url', + 'created'], + 'type': 'object'}, + 'ImageSpec': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'kind': {'type': 'string'}, + 'series': {'type': 'string'}}, + 'required': ['kind', 'arch', 'series'], + 'type': 'object'}, + 'ListImageResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'$ref': '#/definitions/ImageMetadata'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'DeleteImages': {'description': 'DeleteImages deletes the ' + 'images matching the specified ' + 'filter.', + 'properties': {'Params': {'$ref': '#/definitions/ImageFilterParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ListImages': {'description': 'ListImages returns images ' + 'matching the specified filter.', + 'properties': {'Params': {'$ref': '#/definitions/ImageFilterParams'}, + 'Result': {'$ref': '#/definitions/ListImageResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def DeleteImages(self, images=None): + ''' + DeleteImages deletes the images matching the specified filter. + + images : typing.Sequence[~ImageSpec] + Returns -> ErrorResults + ''' + if images is not None and not isinstance(images, (bytes, str, list)): + raise Exception("Expected images to be a Sequence, received: {}".format(type(images))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ImageManager', + request='DeleteImages', + version=2, + params=_params) + _params['images'] = images + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListImageResult) + async def ListImages(self, images=None): + ''' + ListImages returns images matching the specified filter. + + images : typing.Sequence[~ImageSpec] + Returns -> ListImageResult + ''' + if images is not None and not isinstance(images, (bytes, str, list)): + raise Exception("Expected images to be a Sequence, received: {}".format(type(images))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ImageManager', + request='ListImages', + version=2, + params=_params) + _params['images'] = images + reply = await self.rpc(msg) + return reply + + + +class ImageMetadataFacade(Type): + name = 'ImageMetadata' + version = 2 + schema = {'definitions': {'CloudImageMetadata': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'image-id': {'type': 'string'}, + 'priority': {'type': 'integer'}, + 'region': {'type': 'string'}, + 'root-storage-size': {'type': 'integer'}, + 'root-storage-type': {'type': 'string'}, + 'series': {'type': 'string'}, + 'source': {'type': 'string'}, + 'stream': {'type': 'string'}, + 'version': {'type': 'string'}, + 'virt-type': {'type': 'string'}}, + 'required': ['image-id', + 'region', + 'version', + 'series', + 'arch', + 'source', + 'priority'], + 'type': 'object'}, + 'CloudImageMetadataList': {'additionalProperties': False, + 'properties': {'metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ImageMetadataFilter': {'additionalProperties': False, + 'properties': {'arches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'region': {'type': 'string'}, + 'root-storage-type': {'type': 'string'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'stream': {'type': 'string'}, + 'virt-type': {'type': 'string'}}, + 'type': 'object'}, + 'ListCloudImageMetadataResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MetadataImageIds': {'additionalProperties': False, + 'properties': {'image-ids': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['image-ids'], + 'type': 'object'}, + 'MetadataSaveParams': {'additionalProperties': False, + 'properties': {'metadata': {'items': {'$ref': '#/definitions/CloudImageMetadataList'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'Delete': {'properties': {'Params': {'$ref': '#/definitions/MetadataImageIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'List': {'properties': {'Params': {'$ref': '#/definitions/ImageMetadataFilter'}, + 'Result': {'$ref': '#/definitions/ListCloudImageMetadataResult'}}, + 'type': 'object'}, + 'Save': {'properties': {'Params': {'$ref': '#/definitions/MetadataSaveParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateFromPublishedImages': {'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def Delete(self, image_ids=None): + ''' + 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='ImageMetadata', + request='Delete', + version=2, + params=_params) + _params['image-ids'] = image_ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListCloudImageMetadataResult) + async def List(self, arches=None, region=None, root_storage_type=None, series=None, stream=None, virt_type=None): + ''' + arches : typing.Sequence[str] + region : str + root_storage_type : str + series : typing.Sequence[str] + stream : 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 series is not None and not isinstance(series, (bytes, str, list)): + raise Exception("Expected series to be a Sequence, received: {}".format(type(series))) + + if stream is not None and not isinstance(stream, (bytes, str)): + raise Exception("Expected stream to be a str, received: {}".format(type(stream))) + + 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='ImageMetadata', + request='List', + version=2, + params=_params) + _params['arches'] = arches + _params['region'] = region + _params['root-storage-type'] = root_storage_type + _params['series'] = series + _params['stream'] = stream + _params['virt-type'] = virt_type + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Save(self, metadata=None): + ''' + 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='ImageMetadata', + request='Save', + version=2, + params=_params) + _params['metadata'] = metadata + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def UpdateFromPublishedImages(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ImageMetadata', + request='UpdateFromPublishedImages', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class InstanceMutaterFacade(Type): + name = 'InstanceMutater' + version = 2 + schema = {'definitions': {'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CharmProfilingInfoResult': {'additionalProperties': False, + 'properties': {'current-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'instance-id': {'type': 'string'}, + 'model-name': {'type': 'string'}, + 'profile-changes': {'items': {'$ref': '#/definitions/ProfileInfoResult'}, + 'type': 'array'}}, + 'required': ['instance-id', + 'model-name', + 'profile-changes', + 'current-profiles', + 'error'], + 'type': 'object'}, + 'ContainerTypeResult': {'additionalProperties': False, + 'properties': {'container-type': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['container-type', + 'error'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ProfileInfoResult': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'profile': {'$ref': '#/definitions/CharmLXDProfile'}, + 'revision': {'type': 'integer'}}, + 'type': 'object'}, + 'SetProfileArg': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'profiles': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['entity', 'profiles'], + 'type': 'object'}, + 'SetProfileArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetProfileArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'CharmProfilingInfo': {'description': 'CharmProfilingInfo ' + 'returns info to update ' + 'lxd profiles on the ' + 'machine. If\n' + 'the machine is not ' + 'provisioned, no profile ' + 'change info will be ' + 'returned,\n' + 'nor will an error.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/CharmProfilingInfoResult'}}, + 'type': 'object'}, + 'ContainerType': {'description': 'ContainerType returns the ' + 'container type of a machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/ContainerTypeResult'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'SetCharmProfiles': {'description': 'SetCharmProfiles records ' + 'the given slice of charm ' + 'profile names.', + 'properties': {'Params': {'$ref': '#/definitions/SetProfileArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModificationStatus': {'description': 'SetModificationStatus ' + 'updates the instance ' + 'whilst changes are ' + 'occurring. This\n' + 'is different from ' + 'SetStatus and ' + 'SetInstanceStatus, ' + 'by the fact this ' + 'holds\n' + 'information about ' + 'the ongoing changes ' + 'that are happening ' + 'to instances.\n' + 'Consider LXD Profile ' + 'updates that can ' + 'modify a instance, ' + 'but may not cause\n' + 'the instance to be ' + 'placed into a error ' + 'state. This ' + 'modification status\n' + 'serves the purpose ' + 'of highlighting that ' + 'to the operator.\n' + 'Only machine tags ' + 'are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchContainers': {'description': 'WatchContainers starts a ' + 'watcher to track ' + 'Containers on a given\n' + 'machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchLXDProfileVerificationNeeded': {'description': 'WatchLXDProfileVerificationNeeded ' + 'starts a ' + 'watcher ' + 'to track ' + 'Applications ' + 'with\n' + 'LXD ' + 'Profiles.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchMachines': {'description': 'WatchMachines starts a ' + 'watcher to track machines.\n' + 'WatchMachines does not ' + 'consume the initial event of ' + 'the watch response, as\n' + 'that returns the initial set ' + 'of machines that are ' + 'currently available.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(CharmProfilingInfoResult) + async def 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=2, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerTypeResult) + async def 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=2, + params=_params) + _params['tag'] = tag + reply = await self.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='InstanceMutater', + request='Life', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def 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=2, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class LeadershipServiceFacade(Type): + name = 'LeadershipService' + version = 2 + schema = {'definitions': {'ApplicationTag': {'additionalProperties': False, + 'properties': {'Name': {'type': 'string'}}, + 'required': ['Name'], + 'type': 'object'}, + 'ClaimLeadershipBulkParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/ClaimLeadershipParams'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'ClaimLeadershipBulkResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ClaimLeadershipParams': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'duration': {'type': 'number'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['application-tag', + 'unit-tag', + 'duration'], + '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'}}, + 'properties': {'BlockUntilLeadershipReleased': {'description': 'BlockUntilLeadershipReleased ' + 'blocks the ' + 'caller until ' + 'leadership ' + 'is\n' + 'released for ' + 'the given ' + 'service.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationTag'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'ClaimLeadership': {'description': 'ClaimLeadership makes a ' + 'leadership claim with the ' + 'given parameters.', + 'properties': {'Params': {'$ref': '#/definitions/ClaimLeadershipBulkParams'}, + 'Result': {'$ref': '#/definitions/ClaimLeadershipBulkResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ClaimLeadershipBulkResults) + async def 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 = await self.rpc(msg) + return reply + + + +class MachineManagerFacade(Type): + name = 'MachineManager' + version = 2 + schema = {'definitions': {'AddMachineParams': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'container-type': {'type': 'string'}, + 'disks': {'items': {'$ref': '#/definitions/Constraints'}, + 'type': 'array'}, + 'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'instance-id': {'type': 'string'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'parent-id': {'type': 'string'}, + 'placement': {'$ref': '#/definitions/Placement'}, + 'series': {'type': 'string'}}, + 'required': ['series', + 'constraints', + 'jobs', + 'parent-id', + 'container-type', + 'instance-id', + 'nonce', + 'hardware-characteristics', + 'addresses'], + 'type': 'object'}, + 'AddMachines': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'AddMachinesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'machine': {'type': 'string'}}, + 'required': ['machine'], + 'type': 'object'}, + 'AddMachinesResults': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceType': {'additionalProperties': False, + 'properties': {'arches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cost': {'type': 'integer'}, + 'cpu-cores': {'type': 'integer'}, + 'deprecated': {'type': 'boolean'}, + 'memory': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'root-disk': {'type': 'integer'}, + 'virt-type': {'type': 'string'}}, + 'required': ['arches', 'cpu-cores', 'memory'], + 'type': 'object'}, + 'InstanceTypesResult': {'additionalProperties': False, + 'properties': {'cost-currency': {'type': 'string'}, + 'cost-divisor': {'type': 'integer'}, + 'cost-unit': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'instance-types': {'items': {'$ref': '#/definitions/InstanceType'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceTypesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InstanceTypesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'ModelInstanceTypesConstraint': {'additionalProperties': False, + 'properties': {'value': {'$ref': '#/definitions/Value'}}, + 'type': 'object'}, + 'ModelInstanceTypesConstraints': {'additionalProperties': False, + 'properties': {'constraints': {'items': {'$ref': '#/definitions/ModelInstanceTypesConstraint'}, + 'type': 'array'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'spaces': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}}, + 'type': 'object'}}, + 'properties': {'AddMachines': {'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'InstanceTypes': {'properties': {'Params': {'$ref': '#/definitions/ModelInstanceTypesConstraints'}, + 'Result': {'$ref': '#/definitions/InstanceTypesResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddMachinesResults) + async def AddMachines(self, params=None): + ''' + 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=2, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InstanceTypesResults) + async def InstanceTypes(self, constraints=None): + ''' + 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=2, + params=_params) + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + +class MachinerFacade(Type): + name = 'Machiner' + version = 2 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'JobsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['jobs'], + 'type': 'object'}, + 'JobsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/JobsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineAddresses': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'addresses'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'is-default-gateway': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + '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': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'shadow-addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'vlan-tag': {'type': 'integer'}}, + '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'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetMachineNetworkConfig': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'config'], + 'type': 'object'}, + 'SetMachinesAddresses': {'additionalProperties': False, + 'properties': {'machine-addresses': {'items': {'$ref': '#/definitions/MachineAddresses'}, + 'type': 'array'}}, + 'required': ['machine-addresses'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Jobs': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/JobsResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'RecordAgentStartTime': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetMachineAddresses': {'properties': {'Params': {'$ref': '#/definitions/SetMachinesAddresses'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetObservedNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetProviderNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='APIAddresses', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='APIHostPorts', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + 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='EnsureDead', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(JobsResults) + async def Jobs(self, entities=None): + ''' + 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='ModelUUID', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RecordAgentStartTime(self, entities=None): + ''' + 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=2, + params=_params) + _params['machine-addresses'] = machine_addresses + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetObservedNetworkConfig(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='Machiner', + request='SetObservedNetworkConfig', + version=2, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetProviderNetworkConfig(self, entities=None): + ''' + 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='SetProviderNetworkConfig', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateStatus(self, entities=None): + ''' + 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='UpdateStatus', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Machiner', + request='WatchAPIHostPorts', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class MeterStatusFacade(Type): + name = 'MeterStatus' + version = 2 + 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'}, + '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'}, + 'MeterStatusResult': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}}, + 'required': ['code', 'info'], + 'type': 'object'}, + 'MeterStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetUnitStateArg': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-state': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'SetUnitStateArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetUnitStateArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UnitStateResult': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-state': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'type': 'object'}, + 'UnitStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UnitStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'GetMeterStatus': {'description': 'GetMeterStatus returns ' + 'meter status information ' + 'for each unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, + 'type': 'object'}, + 'SetState': {'description': 'SetState sets the state persisted ' + 'by the charm running in this ' + 'unit\n' + 'and the state internal to the ' + 'uniter for this unit.', + 'properties': {'Params': {'$ref': '#/definitions/SetUnitStateArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'State': {'description': 'State returns the state persisted by ' + 'the charm running in this unit\n' + 'and the state internal to the uniter ' + 'for this unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitStateResults'}}, + 'type': 'object'}, + 'WatchMeterStatus': {'description': 'WatchMeterStatus returns ' + 'a NotifyWatcher for ' + 'observing changes\n' + "to each unit's meter " + 'status.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(MeterStatusResults) + async def 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 = await self.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='MeterStatus', + request='SetState', + version=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitStateResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class MetricsAdderFacade(Type): + name = 'MetricsAdder' + version = 2 + 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'}, + 'Metric': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'labels': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['key', 'value', 'time'], + 'type': 'object'}, + 'MetricBatch': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'created': {'format': 'date-time', + 'type': 'string'}, + 'metrics': {'items': {'$ref': '#/definitions/Metric'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'charm-url', + 'created', + 'metrics'], + 'type': 'object'}, + 'MetricBatchParam': {'additionalProperties': False, + 'properties': {'batch': {'$ref': '#/definitions/MetricBatch'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'batch'], + 'type': 'object'}, + 'MetricBatchParams': {'additionalProperties': False, + 'properties': {'batches': {'items': {'$ref': '#/definitions/MetricBatchParam'}, + 'type': 'array'}}, + 'required': ['batches'], + 'type': 'object'}}, + 'properties': {'AddMetricBatches': {'description': 'AddMetricBatches ' + 'implements the ' + 'MetricsAdder interface.', + 'properties': {'Params': {'$ref': '#/definitions/MetricBatchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + +class MetricsDebugFacade(Type): + name = 'MetricsDebug' + version = 2 + 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'}, + 'EntityMetrics': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'metrics': {'items': {'$ref': '#/definitions/MetricResult'}, + 'type': 'array'}}, + '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'}, + 'MeterStatusParam': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'code'], + 'type': 'object'}, + 'MeterStatusParams': {'additionalProperties': False, + 'properties': {'statues': {'items': {'$ref': '#/definitions/MeterStatusParam'}, + 'type': 'array'}}, + 'required': ['statues'], + 'type': 'object'}, + 'MetricResult': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'labels': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'unit': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['time', + 'key', + 'value', + 'unit', + 'labels'], + 'type': 'object'}, + 'MetricResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/EntityMetrics'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'GetMetrics': {'description': 'GetMetrics returns all metrics ' + 'stored by the state server.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MetricResults'}}, + 'type': 'object'}, + 'SetMeterStatus': {'description': 'SetMeterStatus sets meter ' + 'statuses for entities.', + 'properties': {'Params': {'$ref': '#/definitions/MeterStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(MetricResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + +class MigrationMasterFacade(Type): + name = 'MigrationMaster' + version = 2 + 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'}, + 'MasterMigrationStatus': {'additionalProperties': False, + 'properties': {'migration-id': {'type': 'string'}, + 'phase': {'type': 'string'}, + 'phase-changed-time': {'format': 'date-time', + 'type': 'string'}, + 'spec': {'$ref': '#/definitions/MigrationSpec'}}, + 'required': ['spec', + 'migration-id', + 'phase', + 'phase-changed-time'], + 'type': 'object'}, + 'MigrationModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'controller-agent-version': {'$ref': '#/definitions/Number'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'name', + 'owner-tag', + 'agent-version', + 'controller-agent-version'], + 'type': 'object'}, + 'MigrationSpec': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'target-info': {'$ref': '#/definitions/MigrationTargetInfo'}}, + 'required': ['model-tag', 'target-info'], + 'type': 'object'}, + 'MigrationTargetInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'auth-tag': {'type': 'string'}, + 'ca-cert': {'type': 'string'}, + 'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}, + 'macaroons': {'type': 'string'}, + 'password': {'type': 'string'}}, + 'required': ['controller-tag', + 'addrs', + 'ca-cert', + 'auth-tag'], + 'type': 'object'}, + 'MinionReports': {'additionalProperties': False, + 'properties': {'failed': {'items': {'type': 'string'}, + 'type': 'array'}, + 'migration-id': {'type': 'string'}, + 'phase': {'type': 'string'}, + 'success-count': {'type': 'integer'}, + 'unknown-count': {'type': 'integer'}, + 'unknown-sample': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['migration-id', + 'phase', + 'success-count', + 'unknown-count', + 'unknown-sample', + 'failed'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'ProcessRelations': {'additionalProperties': False, + 'properties': {'controller-alias': {'type': 'string'}}, + 'required': ['controller-alias'], + 'type': 'object'}, + 'SerializedModel': {'additionalProperties': False, + 'properties': {'bytes': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'charms': {'items': {'type': 'string'}, + 'type': 'array'}, + 'resources': {'items': {'$ref': '#/definitions/SerializedModelResource'}, + 'type': 'array'}, + 'tools': {'items': {'$ref': '#/definitions/SerializedModelTools'}, + 'type': 'array'}}, + 'required': ['bytes', + 'charms', + 'tools', + 'resources'], + 'type': 'object'}, + 'SerializedModelResource': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'application-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, + 'charmstore-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, + 'name': {'type': 'string'}, + 'unit-revisions': {'patternProperties': {'.*': {'$ref': '#/definitions/SerializedModelResourceRevision'}}, + 'type': 'object'}}, + 'required': ['application', + 'name', + 'application-revision', + 'charmstore-revision', + 'unit-revisions'], + 'type': 'object'}, + 'SerializedModelResourceRevision': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'fingerprint': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}, + 'type': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['revision', + 'type', + 'path', + 'description', + 'origin', + 'fingerprint', + 'size', + 'timestamp'], + 'type': 'object'}, + 'SerializedModelTools': {'additionalProperties': False, + 'properties': {'uri': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['version', 'uri'], + 'type': 'object'}, + 'SetMigrationPhaseArgs': {'additionalProperties': False, + 'properties': {'phase': {'type': 'string'}}, + 'required': ['phase'], + 'type': 'object'}, + 'SetMigrationStatusMessageArgs': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}}, + 'required': ['message'], + 'type': 'object'}}, + 'properties': {'Export': {'description': 'Export serializes the model ' + 'associated with the API connection.', + 'properties': {'Result': {'$ref': '#/definitions/SerializedModel'}}, + 'type': 'object'}, + 'MigrationStatus': {'description': 'MigrationStatus returns ' + 'the details and progress ' + 'of the latest\n' + 'model migration.', + 'properties': {'Result': {'$ref': '#/definitions/MasterMigrationStatus'}}, + 'type': 'object'}, + 'MinionReports': {'description': 'MinionReports returns ' + 'details of the reports made ' + 'by migration\n' + 'minions to the controller ' + 'for the current migration ' + 'phase.', + 'properties': {'Result': {'$ref': '#/definitions/MinionReports'}}, + 'type': 'object'}, + 'ModelInfo': {'description': 'ModelInfo returns essential ' + 'information about the model to ' + 'be\n' + 'migrated.', + 'properties': {'Result': {'$ref': '#/definitions/MigrationModelInfo'}}, + 'type': 'object'}, + 'Prechecks': {'description': 'Prechecks performs pre-migration ' + 'checks on the model and\n' + '(source) controller.', + 'type': 'object'}, + 'ProcessRelations': {'description': 'ProcessRelations ' + 'processes any relations ' + 'that need updating after ' + 'an export.\n' + 'This should help fix any ' + 'remoteApplications that ' + 'have been migrated.', + 'properties': {'Params': {'$ref': '#/definitions/ProcessRelations'}}, + 'type': 'object'}, + 'Reap': {'description': 'Reap removes all documents for the ' + 'model associated with the API\n' + 'connection.', + 'type': 'object'}, + 'SetPhase': {'description': 'SetPhase sets the phase of the ' + 'active model migration. The ' + 'provided\n' + 'phase must be a valid phase ' + 'value, for example QUIESCE" or\n' + '"ABORT". See the core/migration ' + 'package for the complete list.', + 'properties': {'Params': {'$ref': '#/definitions/SetMigrationPhaseArgs'}}, + 'type': 'object'}, + 'SetStatusMessage': {'description': 'SetStatusMessage sets a ' + 'human readable status ' + 'message containing\n' + 'information about the ' + "migration's progress. " + 'This will be shown in\n' + 'status output shown to ' + 'the end user.', + 'properties': {'Params': {'$ref': '#/definitions/SetMigrationStatusMessageArgs'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts watching for an active ' + 'migration for the model\n' + 'associated with the API connection. ' + 'The returned id should be used\n' + 'with the NotifyWatcher facade to ' + 'receive events.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchMinionReports': {'description': 'WatchMinionReports sets ' + 'up a watcher which ' + 'reports when a report\n' + 'for a migration minion ' + 'has arrived.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(SerializedModel) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MasterMigrationStatus) + async def MigrationStatus(self): + ''' + MigrationStatus returns the details and progress of the latest + model migration. + + + Returns -> MasterMigrationStatus + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='MigrationStatus', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MinionReports) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MigrationModelInfo) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Prechecks(self): + ''' + Prechecks performs pre-migration checks on the model and + (source) controller. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Prechecks', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=2, + params=_params) + _params['controller-alias'] = controller_alias + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=2, + params=_params) + _params['phase'] = phase + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=2, + params=_params) + _params['message'] = message + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class ModelConfigFacade(Type): + name = 'ModelConfig' + version = 2 + schema = {'definitions': {'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelSLA': {'additionalProperties': False, + 'properties': {'ModelSLAInfo': {'$ref': '#/definitions/ModelSLAInfo'}, + 'creds': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', + 'owner', + 'ModelSLAInfo', + 'creds'], + 'type': 'object'}, + 'ModelSLAInfo': {'additionalProperties': False, + 'properties': {'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', 'owner'], + 'type': 'object'}, + 'ModelSequencesResult': {'additionalProperties': False, + 'properties': {'sequences': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}}, + 'required': ['sequences'], + 'type': 'object'}, + 'ModelSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelUnset': {'additionalProperties': False, + 'properties': {'keys': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['keys'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'ModelGet': {'description': 'ModelGet implements the ' + 'server-side part of the\n' + 'model-config CLI command.', + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelSet': {'description': 'ModelSet implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, + 'type': 'object'}, + 'ModelUnset': {'description': 'ModelUnset implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, + 'type': 'object'}, + 'SLALevel': {'description': 'SLALevel returns the current sla ' + 'level for the model.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'Sequences': {'description': "Sequences returns the model's " + 'sequence names and next values.', + 'properties': {'Result': {'$ref': '#/definitions/ModelSequencesResult'}}, + 'type': 'object'}, + 'SetSLALevel': {'description': 'SetSLALevel sets the sla level ' + 'on the model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ModelConfigResults) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=2, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=2, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelSequencesResult) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=2, + params=_params) + _params['ModelSLAInfo'] = modelslainfo + _params['creds'] = creds + _params['level'] = level + _params['owner'] = owner + reply = await self.rpc(msg) + return reply + + + +class ModelGenerationFacade(Type): + name = 'ModelGeneration' + version = 2 + schema = {'definitions': {'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BranchArg': {'additionalProperties': False, + 'properties': {'branch': {'type': 'string'}}, + 'required': ['branch'], + 'type': 'object'}, + 'BranchInfoArgs': {'additionalProperties': False, + 'properties': {'branches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'detailed': {'type': 'boolean'}}, + 'required': ['branches', 'detailed'], + 'type': 'object'}, + 'BranchTrackArg': {'additionalProperties': False, + 'properties': {'branch': {'type': 'string'}, + 'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['branch', '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'}, + 'Generation': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/GenerationApplication'}, + 'type': 'array'}, + 'branch': {'type': 'string'}, + 'created': {'type': 'integer'}, + 'created-by': {'type': 'string'}}, + 'required': ['branch', + 'created', + 'created-by', + 'applications'], + 'type': 'object'}, + 'GenerationApplication': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'pending': {'items': {'type': 'string'}, + 'type': 'array'}, + 'progress': {'type': 'string'}, + 'tracking': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', + 'progress', + 'config'], + 'type': 'object'}, + 'GenerationResults': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'generations': {'items': {'$ref': '#/definitions/Generation'}, + 'type': 'array'}}, + 'required': ['generations'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'AbortBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'AddBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'BranchInfo': {'properties': {'Params': {'$ref': '#/definitions/BranchInfoArgs'}, + 'Result': {'$ref': '#/definitions/GenerationResults'}}, + 'type': 'object'}, + 'CommitBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/IntResult'}}, + 'type': 'object'}, + 'HasActiveBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/BoolResult'}}, + 'type': 'object'}, + 'TrackBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchTrackArg'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def AbortBranch(self, branch=None): + ''' + 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=2, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + async def AddBranch(self, branch=None): + ''' + 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=2, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GenerationResults) + async def BranchInfo(self, branches=None, detailed=None): + ''' + branches : typing.Sequence[str] + detailed : bool + Returns -> GenerationResults + ''' + 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=2, + params=_params) + _params['branches'] = branches + _params['detailed'] = detailed + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResult) + async def CommitBranch(self, branch=None): + ''' + 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=2, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResult) + async def HasActiveBranch(self, branch=None): + ''' + 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=2, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def TrackBranch(self, branch=None, entities=None): + ''' + branch : str + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelGeneration', + request='TrackBranch', + version=2, + params=_params) + _params['branch'] = branch + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class ModelManagerFacade(Type): + name = 'ModelManager' + version = 2 + 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'}, + 'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachineHardware': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + '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'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'owner-tag'], + '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'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'cloud-credential-tag': {'type': 'string'}, + 'cloud-region': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'controller-uuid': {'type': 'string'}, + 'default-series': {'type': 'string'}, + 'life': {'type': 'string'}, + 'machines': {'items': {'$ref': '#/definitions/ModelMachineInfo'}, + 'type': 'array'}, + 'migration': {'$ref': '#/definitions/ModelMigrationStatus'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'provider-type': {'type': 'string'}, + 'sla': {'$ref': '#/definitions/ModelSLAInfo'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'users': {'items': {'$ref': '#/definitions/ModelUserInfo'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', + 'uuid', + 'controller-uuid', + 'cloud-tag', + 'owner-tag', + 'life', + 'users', + 'machines', + 'sla', + 'agent-version'], + 'type': 'object'}, + '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': {'hardware': {'$ref': '#/definitions/MachineHardware'}, + 'has-vote': {'type': 'boolean'}, + 'id': {'type': 'string'}, + 'instance-id': {'type': 'string'}, + 'status': {'type': 'string'}, + 'wants-vote': {'type': 'boolean'}}, + 'required': ['id'], + 'type': 'object'}, + 'ModelMigrationStatus': {'additionalProperties': False, + 'properties': {'end': {'format': 'date-time', + 'type': 'string'}, + 'start': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'start'], + 'type': 'object'}, + 'ModelSLAInfo': {'additionalProperties': False, + 'properties': {'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', 'owner'], + 'type': 'object'}, + 'ModelStatus': {'additionalProperties': False, + 'properties': {'application-count': {'type': 'integer'}, + 'hosted-machine-count': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'machines': {'items': {'$ref': '#/definitions/ModelMachineInfo'}, + 'type': 'array'}, + 'model-tag': {'type': 'string'}, + 'owner-tag': {'type': 'string'}}, + 'required': ['model-tag', + 'life', + 'hosted-machine-count', + 'application-count', + 'owner-tag'], + 'type': 'object'}, + 'ModelStatusResults': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/ModelStatus'}, + 'type': 'array'}}, + 'required': ['models'], + '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'}, + 'user': {'type': 'string'}}, + 'required': ['user', + 'display-name', + 'last-connection', + 'access'], + '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'}, + 'SetModelDefaults': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/ModelDefaultValues'}, + 'type': 'array'}}, + 'required': ['config'], + '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': {'CreateModel': {'properties': {'Params': {'$ref': '#/definitions/ModelCreateArgs'}, + 'Result': {'$ref': '#/definitions/ModelInfo'}}, + 'type': 'object'}, + 'DestroyModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DumpModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MapResults'}}, + 'type': 'object'}, + 'DumpModelsDB': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MapResults'}}, + 'type': 'object'}, + 'ListModels': {'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/UserModelList'}}, + 'type': 'object'}, + 'ModelDefaults': {'properties': {'Result': {'$ref': '#/definitions/ModelDefaultsResult'}}, + 'type': 'object'}, + 'ModelInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelInfoResults'}}, + 'type': 'object'}, + 'ModelStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelStatusResults'}}, + 'type': 'object'}, + 'ModifyModelAccess': {'properties': {'Params': {'$ref': '#/definitions/ModifyModelAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModelDefaults': {'properties': {'Params': {'$ref': '#/definitions/SetModelDefaults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UnsetModelDefaults': {'properties': {'Params': {'$ref': '#/definitions/UnsetModelDefaults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ModelInfo) + async def CreateModel(self, cloud_tag=None, config=None, credential=None, name=None, owner_tag=None, region=None): + ''' + 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=2, + 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, entities=None): + ''' + 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='ModelManager', + request='DestroyModels', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MapResults) + async def DumpModels(self, entities=None): + ''' + 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='DumpModels', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MapResults) + async def DumpModelsDB(self, entities=None): + ''' + 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UserModelList) + async def ListModels(self, tag=None): + ''' + 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=2, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelDefaultsResult) + async def ModelDefaults(self): + ''' + + Returns -> ModelDefaultsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModelDefaults', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelInfoResults) + async def ModelInfo(self, entities=None): + ''' + 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelStatusResults) + async def ModelStatus(self, entities=None): + ''' + 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyModelAccess(self, changes=None): + ''' + 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=2, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModelDefaults(self, config=None): + ''' + 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=2, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UnsetModelDefaults(self, keys=None): + ''' + 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=2, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + + +class ProxyUpdaterFacade(Type): + name = 'ProxyUpdater' + version = 2 + 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, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ProxyConfig': {'additionalProperties': False, + 'properties': {'ftp': {'type': 'string'}, + 'http': {'type': 'string'}, + 'https': {'type': 'string'}, + 'no-proxy': {'type': 'string'}}, + 'required': ['http', + 'https', + 'ftp', + 'no-proxy'], + 'type': 'object'}, + 'ProxyConfigResult': {'additionalProperties': False, + 'properties': {'apt-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'}}, + 'required': ['legacy-proxy-settings', + 'juju-proxy-settings'], + 'type': 'object'}, + 'ProxyConfigResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProxyConfigResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'ProxyConfig': {'description': 'ProxyConfig returns the proxy ' + 'settings for the current ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ProxyConfigResults'}}, + 'type': 'object'}, + 'WatchForProxyConfigAndAPIHostPortChanges': {'description': 'WatchForProxyConfigAndAPIHostPortChanges ' + 'watches ' + 'for ' + 'changes ' + 'to ' + 'the ' + 'proxy ' + 'and ' + 'api ' + 'host ' + 'port ' + 'settings.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ProxyConfigResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class RaftLeaseFacade(Type): + name = 'RaftLease' + version = 2 + 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'}, + 'LeaseOperationCommand': {'additionalProperties': False, + 'properties': {'duration': {'type': 'integer'}, + 'holder': {'type': 'string'}, + 'lease': {'type': 'string'}, + 'model-uuid': {'type': 'string'}, + 'namespace': {'type': 'string'}, + 'new-time': {'format': 'date-time', + 'type': 'string'}, + 'old-time': {'format': 'date-time', + 'type': 'string'}, + 'operation': {'type': 'string'}, + 'pin-entity': {'type': 'string'}, + 'version': {'type': 'integer'}}, + 'required': ['version', 'operation'], + 'type': 'object'}, + 'LeaseOperationsV2': {'additionalProperties': False, + 'properties': {'commands': {'items': {'$ref': '#/definitions/LeaseOperationCommand'}, + 'type': 'array'}}, + 'required': ['commands'], + 'type': 'object'}}, + 'properties': {'ApplyLease': {'properties': {'Params': {'$ref': '#/definitions/LeaseOperationsV2'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + +class RebootFacade(Type): + name = 'Reboot' + version = 2 + 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'}, + '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'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'RebootActionResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'type': 'object'}, + 'RebootActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RebootActionResult'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'ClearReboot': {'description': 'ClearReboot will clear the ' + 'reboot flag on provided ' + 'machines, if it exists.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'GetRebootAction': {'description': 'GetRebootAction returns ' + 'the action a machine agent ' + 'should take.\n' + 'If a reboot flag is set on ' + 'the machine, then that ' + 'machine is\n' + 'expected to reboot ' + '(params.ShouldReboot).\n' + 'a reboot flag set on the ' + 'machine parent or ' + 'grandparent, will\n' + 'cause the machine to ' + 'shutdown ' + '(params.ShouldShutdown).\n' + 'If no reboot flag is set, ' + 'the machine should do ' + 'nothing ' + '(params.ShouldDoNothing).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RebootActionResults'}}, + 'type': 'object'}, + 'RequestReboot': {'description': 'RequestReboot sets the ' + 'reboot flag on the provided ' + 'machines', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchForRebootEvent': {'description': 'WatchForRebootEvent ' + 'starts a watcher to ' + 'track if there is a ' + 'new\n' + 'reboot request on the ' + 'machines ID or any of ' + 'its parents (in case ' + 'we are a container).', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(RebootActionResults) + async def 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 = await self.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='Reboot', + request='RequestReboot', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + +class RemoteRelationsFacade(Type): + name = 'RemoteRelations' + version = 2 + schema = {'definitions': {'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityMacaroonArg': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'tag': {'type': 'string'}}, + 'required': ['macaroon', 'tag'], + 'type': 'object'}, + 'EntityMacaroonArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/EntityMacaroonArg'}, + 'type': 'array'}}, + 'required': ['Args'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'GetTokenArg': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'GetTokenArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/GetTokenArg'}, + 'type': 'array'}}, + 'required': ['Args'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'RemoteApplication': {'additionalProperties': False, + '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'}}, + 'required': ['name', + 'offer-uuid', + 'model-uuid', + 'is-consumer-proxy'], + 'type': 'object'}, + 'RemoteApplicationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoteApplication'}}, + 'type': 'object'}, + 'RemoteApplicationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteApplicationResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'RemoteEntityTokenArg': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'token': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'RemoteEntityTokenArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/RemoteEntityTokenArg'}, + 'type': 'array'}}, + 'required': ['Args'], + 'type': 'object'}, + 'RemoteRelation': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'endpoint': {'$ref': '#/definitions/RemoteEndpoint'}, + 'id': {'type': 'integer'}, + 'key': {'type': 'string'}, + 'life': {'type': 'string'}, + 'remote-application-name': {'type': 'string'}, + 'remote-endpoint-name': {'type': 'string'}, + 'source-model-uuid': {'type': 'string'}, + 'suspended': {'type': 'boolean'}}, + 'required': ['life', + 'suspended', + 'id', + 'key', + 'application-name', + 'endpoint', + 'remote-application-name', + 'remote-endpoint-name', + 'source-model-uuid'], + 'type': 'object'}, + 'RemoteRelationChangeEvent': {'additionalProperties': False, + 'properties': {'application-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'], + 'type': 'object'}, + 'RemoteRelationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoteRelation'}}, + 'type': 'object'}, + 'RemoteRelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteRelationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteRelationUnitChange': {'additionalProperties': False, + 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'unit-id': {'type': 'integer'}}, + 'required': ['unit-id'], + 'type': 'object'}, + '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'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'TokenResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'token': {'type': 'string'}}, + 'type': 'object'}, + 'TokenResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/TokenResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'UpdateControllerForModel': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/ExternalControllerInfo'}, + 'model-tag': {'type': 'string'}}, + 'required': ['model-tag', 'info'], + 'type': 'object'}, + 'UpdateControllersForModelsParams': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/UpdateControllerForModel'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}}, + 'properties': {'ConsumeRemoteRelationChanges': {'description': 'ConsumeRemoteRelationChanges ' + 'consumes ' + 'changes to ' + 'settings ' + 'originating\n' + 'from the ' + 'remote/offering ' + 'side of ' + 'relations.', + 'properties': {'Params': {'$ref': '#/definitions/RemoteRelationsChanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'ExportEntities': {'description': 'ExportEntities allocates ' + 'unique, remote entity IDs ' + 'for the given entities in ' + 'the local model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/TokenResults'}}, + 'type': 'object'}, + 'GetTokens': {'description': 'GetTokens returns the token ' + 'associated with the entities ' + 'with the given tags for the ' + 'given models.', + 'properties': {'Params': {'$ref': '#/definitions/GetTokenArgs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'ImportRemoteEntities': {'description': 'ImportRemoteEntities ' + 'adds entities to the ' + 'remote entities ' + 'collection with the ' + 'specified opaque ' + 'tokens.', + 'properties': {'Params': {'$ref': '#/definitions/RemoteEntityTokenArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Relations': {'description': 'Relations returns information ' + 'about the cross-model relations ' + 'with the specified keys\n' + 'in the local model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RemoteRelationResults'}}, + 'type': 'object'}, + 'RemoteApplications': {'description': 'RemoteApplications ' + 'returns the current ' + 'state of the remote ' + 'applications with\n' + 'the specified names in ' + 'the local model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RemoteApplicationResults'}}, + 'type': 'object'}, + 'SaveMacaroons': {'description': 'SaveMacaroons saves the ' + 'macaroons for the given ' + 'entities.', + 'properties': {'Params': {'$ref': '#/definitions/EntityMacaroonArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRemoteApplicationsStatus': {'description': 'SetRemoteApplicationsStatus ' + 'sets the ' + 'status for the ' + 'specified ' + 'remote ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateControllersForModels': {'description': 'UpdateControllersForModels ' + 'changes the ' + 'external ' + 'controller ' + 'records for ' + 'the\n' + 'associated ' + 'model entities. ' + 'This is used ' + 'when the remote ' + 'relations ' + 'worker gets\n' + 'redirected ' + 'following ' + 'migration of an ' + 'offering model.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateControllersForModelsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchLocalRelationChanges': {'description': 'WatchLocalRelationChanges ' + 'starts a ' + 'RemoteRelationWatcher ' + '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/Entities'}, + 'Result': {'$ref': '#/definitions/RemoteRelationWatchResults'}}, + 'type': 'object'}, + 'WatchRemoteApplicationRelations': {'description': 'WatchRemoteApplicationRelations ' + 'starts a ' + 'StringsWatcher ' + 'for ' + 'watching ' + 'the ' + 'relations ' + 'of\n' + 'each ' + 'specified ' + 'application ' + 'in the ' + 'local ' + 'model, and ' + 'returns ' + 'the ' + 'watcher ' + 'IDs\n' + 'and ' + 'initial ' + 'values, or ' + 'an error ' + 'if the ' + "services' " + 'relations ' + 'could not ' + 'be\n' + 'watched.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchRemoteApplications': {'description': 'WatchRemoteApplications ' + 'starts a strings ' + 'watcher that ' + 'notifies of the ' + 'addition,\n' + 'removal, and ' + 'lifecycle changes ' + 'of remote ' + 'applications in ' + 'the model; and\n' + 'returns the ' + 'watcher ID and ' + 'initial IDs of ' + 'remote ' + 'applications, or ' + 'an error if\n' + 'watching failed.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchRemoteRelations': {'description': 'WatchRemoteRelations ' + 'starts a strings ' + 'watcher that notifies ' + 'of the addition,\n' + 'removal, and ' + 'lifecycle changes of ' + 'remote relations in ' + 'the model; and\n' + 'returns the watcher ' + 'ID and initial IDs of ' + 'remote relations, or ' + 'an error if\n' + 'watching failed.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def 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 = await self.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) + 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 + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetTokens(self, args=None): + ''' + GetTokens returns the token associated with the entities with the given tags for the given models. + + 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='GetTokens', + version=2, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ImportRemoteEntities(self, args=None): + ''' + ImportRemoteEntities adds entities to the remote entities collection with the specified opaque tokens. + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='RemoteRelations', + request='ImportRemoteEntities', + version=2, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoteRelationResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoteApplicationResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoteRelationWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + +class ResourcesFacade(Type): + name = 'Resources' + version = 2 + schema = {'definitions': {'AddPendingResourcesArgsV2': {'additionalProperties': False, + 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, + 'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'resources': {'items': {'$ref': '#/definitions/CharmResource'}, + 'type': 'array'}, + 'tag': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'required': ['tag', + 'Entity', + 'url', + 'charm-origin', + 'macaroon', + 'resources'], + 'type': 'object'}, + 'AddPendingResourcesResult': {'additionalProperties': False, + 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'pending-ids': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['ErrorResult', + 'pending-ids'], + 'type': 'object'}, + 'CharmOrigin': {'additionalProperties': False, + 'properties': {'architecture': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'hash': {'type': 'string'}, + 'id': {'type': 'string'}, + 'instance-key': {'type': 'string'}, + 'os': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'risk': {'type': 'string'}, + 'series': {'type': 'string'}, + 'source': {'type': 'string'}, + 'track': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['source', 'type', 'id'], + 'type': 'object'}, + 'CharmResource': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'fingerprint': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'name': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'origin', + 'revision', + 'fingerprint', + 'size'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'ListResourcesArgs': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'Resource': {'additionalProperties': False, + 'properties': {'CharmResource': {'$ref': '#/definitions/CharmResource'}, + 'application': {'type': 'string'}, + 'description': {'type': 'string'}, + 'fingerprint': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'name': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'pending-id': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}, + 'type': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'origin', + 'revision', + 'fingerprint', + 'size', + 'CharmResource', + 'id', + 'pending-id', + 'application', + 'username', + 'timestamp'], + 'type': 'object'}, + 'ResourcesResult': {'additionalProperties': False, + 'properties': {'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, + 'charm-store-resources': {'items': {'$ref': '#/definitions/CharmResource'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'resources': {'items': {'$ref': '#/definitions/Resource'}, + 'type': 'array'}, + 'unit-resources': {'items': {'$ref': '#/definitions/UnitResources'}, + 'type': 'array'}}, + 'required': ['ErrorResult', + 'resources', + 'charm-store-resources', + 'unit-resources'], + 'type': 'object'}, + 'ResourcesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResourcesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UnitResources': {'additionalProperties': False, + 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, + 'download-progress': {'patternProperties': {'.*': {'type': 'integer'}}, + 'type': 'object'}, + 'resources': {'items': {'$ref': '#/definitions/Resource'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'Entity', + 'resources', + 'download-progress'], + 'type': 'object'}}, + 'properties': {'AddPendingResources': {'description': 'AddPendingResources ' + 'adds the provided ' + 'resources (info) to ' + 'the Juju\n' + 'model in a pending ' + 'state, meaning they ' + 'are not available ' + 'until\n' + 'resolved. Handles ' + 'CharmHub, CharmStore ' + 'and Local charms.', + 'properties': {'Params': {'$ref': '#/definitions/AddPendingResourcesArgsV2'}, + 'Result': {'$ref': '#/definitions/AddPendingResourcesResult'}}, + 'type': 'object'}, + 'ListResources': {'description': 'ListResources returns the ' + 'list of resources for the ' + 'given application.', + 'properties': {'Params': {'$ref': '#/definitions/ListResourcesArgs'}, + 'Result': {'$ref': '#/definitions/ResourcesResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddPendingResourcesResult) + async def 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, CharmStore 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=2, + params=_params) + _params['Entity'] = entity + _params['charm-origin'] = charm_origin + _params['macaroon'] = macaroon + _params['resources'] = resources + _params['tag'] = tag + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResourcesResults) + async def 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class ResumerFacade(Type): + name = 'Resumer' + version = 2 + schema = {'properties': {'ResumeTransactions': {'type': 'object'}}, 'type': 'object'} + + + @ReturnMapping(None) + async def ResumeTransactions(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Resumer', + request='ResumeTransactions', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class SSHClientFacade(Type): + name = 'SSHClient' + version = 2 + 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'}, + 'SSHAddressResult': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'SSHAddressResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SSHAddressesResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses'], + 'type': 'object'}, + 'SSHAddressesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SSHProxyResult': {'additionalProperties': False, + 'properties': {'use-proxy': {'type': 'boolean'}}, + 'required': ['use-proxy'], + 'type': 'object'}, + 'SSHPublicKeysResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'public-keys': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SSHPublicKeysResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SSHPublicKeysResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AllAddresses': {'description': 'AllAddresses reports all ' + 'addresses that might have SSH ' + 'listening for each given\n' + 'entity in args. Machines and ' + 'units are supported as entity ' + 'types.\n' + 'TODO(wpk): 2017-05-17 This is ' + 'a temporary solution, we ' + 'should not fetch environ ' + 'here\n' + 'but get the addresses from ' + 'state. We will be changing it ' + 'since we want to have ' + 'space-aware\n' + 'SSH settings.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHAddressesResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'description': 'PrivateAddress reports the ' + 'preferred private network ' + 'address for one or\n' + 'more entities. Machines and ' + 'units are supported.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHAddressResults'}}, + 'type': 'object'}, + 'Proxy': {'description': 'Proxy returns whether SSH ' + 'connections should be proxied ' + 'through the\n' + 'controller hosts for the model ' + 'associated with the API connection.', + 'properties': {'Result': {'$ref': '#/definitions/SSHProxyResult'}}, + 'type': 'object'}, + 'PublicAddress': {'description': 'PublicAddress reports the ' + 'preferred public network ' + 'address for one\n' + 'or more entities. Machines ' + 'and units are supported.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHAddressResults'}}, + 'type': 'object'}, + 'PublicKeys': {'description': 'PublicKeys returns the public ' + 'SSH hosts for one or more\n' + 'entities. Machines and units ' + 'are supported.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHPublicKeysResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(SSHAddressesResults) + async def AllAddresses(self, entities=None): + ''' + AllAddresses reports all addresses that might have SSH listening for each given + entity in args. Machines and units are supported as entity types. + TODO(wpk): 2017-05-17 This is a temporary solution, we should not fetch environ here + but get the addresses from state. We will be changing it since we want to have space-aware + SSH settings. + + 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHAddressResults) + async def 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHProxyResult) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHAddressResults) + async def 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHPublicKeysResults) + async def 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class SingularFacade(Type): + name = 'Singular' + version = 2 + 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'}, + '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'}, + 'SingularClaim': {'additionalProperties': False, + 'properties': {'claimant-tag': {'type': 'string'}, + 'duration': {'type': 'integer'}, + 'entity-tag': {'type': 'string'}}, + 'required': ['entity-tag', + 'claimant-tag', + 'duration'], + 'type': 'object'}, + 'SingularClaims': {'additionalProperties': False, + 'properties': {'claims': {'items': {'$ref': '#/definitions/SingularClaim'}, + 'type': 'array'}}, + 'required': ['claims'], + 'type': 'object'}}, + 'properties': {'Claim': {'description': 'Claim makes the supplied ' + 'singular-controller lease requests. ' + '(In practice,\n' + 'any requests not for the ' + "connection's model or controller, or " + 'not on behalf\n' + 'of the connected ModelManager ' + 'machine, will be rejected.)', + 'properties': {'Params': {'$ref': '#/definitions/SingularClaims'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Wait': {'description': 'Wait waits for the ' + 'singular-controller lease to expire ' + 'for all supplied\n' + 'entities. (In practice, any requests ' + 'that do not refer to the ' + "connection's\n" + 'model or controller will be ' + 'rejected.)', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + +class SpacesFacade(Type): + name = 'Spaces' + version = 2 + schema = {'definitions': {'CreateSpaceParams': {'additionalProperties': False, + 'properties': {'provider-id': {'type': 'string'}, + 'public': {'type': 'boolean'}, + 'space-tag': {'type': 'string'}, + 'subnet-tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['subnet-tags', + 'space-tag', + 'public'], + 'type': 'object'}, + 'CreateSpacesParams': {'additionalProperties': False, + 'properties': {'spaces': {'items': {'$ref': '#/definitions/CreateSpaceParams'}, + 'type': 'array'}}, + 'required': ['spaces'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListSpacesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/Space'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'Space': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['name', 'subnets'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}}, + 'properties': {'CreateSpaces': {'properties': {'Params': {'$ref': '#/definitions/CreateSpacesParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ListSpaces': {'properties': {'Result': {'$ref': '#/definitions/ListSpacesResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def CreateSpaces(self, spaces=None): + ''' + 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=2, + params=_params) + _params['spaces'] = spaces + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListSpacesResults) + async def ListSpaces(self): + ''' + + Returns -> ListSpacesResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Spaces', + request='ListSpaces', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class StatusHistoryFacade(Type): + name = 'StatusHistory' + version = 2 + 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'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'StatusHistoryPruneArgs': {'additionalProperties': False, + 'properties': {'max-history-mb': {'type': 'integer'}, + 'max-history-time': {'type': 'integer'}}, + 'required': ['max-history-time', + 'max-history-mb'], + 'type': 'object'}}, + 'properties': {'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'Prune': {'description': 'Prune endpoint removes status ' + 'history entries until\n' + 'only the ones newer than now - ' + 'p.MaxHistoryTime remain and\n' + 'the history is smaller than ' + 'p.MaxHistoryMB.', + 'properties': {'Params': {'$ref': '#/definitions/StatusHistoryPruneArgs'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @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='StatusHistory', + request='ModelConfig', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.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='StatusHistory', + request='WatchForModelConfigChanges', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class SubnetsFacade(Type): + name = 'Subnets' + version = 2 + schema = {'definitions': {'AddSubnetParams': {'additionalProperties': False, + 'properties': {'provider-network-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'subnet-provider-id': {'type': 'string'}, + 'subnet-tag': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['space-tag'], + 'type': 'object'}, + 'AddSubnetsParams': {'additionalProperties': False, + 'properties': {'subnets': {'items': {'$ref': '#/definitions/AddSubnetParams'}, + 'type': 'array'}}, + 'required': ['subnets'], + 'type': 'object'}, + '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'}, + 'ListSubnetsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SpaceResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'SpaceResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SpaceResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'SubnetsFilters': {'additionalProperties': False, + 'properties': {'space-tag': {'type': 'string'}, + 'zone': {'type': 'string'}}, + 'type': 'object'}, + 'ZoneResult': {'additionalProperties': False, + 'properties': {'available': {'type': 'boolean'}, + 'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}}, + 'required': ['name', 'available'], + 'type': 'object'}, + 'ZoneResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ZoneResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AddSubnets': {'properties': {'Params': {'$ref': '#/definitions/AddSubnetsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AllSpaces': {'properties': {'Result': {'$ref': '#/definitions/SpaceResults'}}, + 'type': 'object'}, + 'AllZones': {'properties': {'Result': {'$ref': '#/definitions/ZoneResults'}}, + 'type': 'object'}, + 'ListSubnets': {'properties': {'Params': {'$ref': '#/definitions/SubnetsFilters'}, + 'Result': {'$ref': '#/definitions/ListSubnetsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def AddSubnets(self, subnets=None): + ''' + subnets : typing.Sequence[~AddSubnetParams] + Returns -> ErrorResults + ''' + if subnets is not None and not isinstance(subnets, (bytes, str, list)): + raise Exception("Expected subnets to be a Sequence, received: {}".format(type(subnets))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Subnets', + request='AddSubnets', + version=2, + params=_params) + _params['subnets'] = subnets + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SpaceResults) + async def AllSpaces(self): + ''' + + Returns -> SpaceResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Subnets', + request='AllSpaces', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ZoneResults) + async def AllZones(self): + ''' + + Returns -> ZoneResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Subnets', + request='AllZones', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListSubnetsResults) + async def ListSubnets(self, space_tag=None, zone=None): + ''' + 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=2, + params=_params) + _params['space-tag'] = space_tag + _params['zone'] = zone + reply = await self.rpc(msg) + return reply + + + +class UpgradeSeriesFacade(Type): + name = 'UpgradeSeries' + version = 2 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesResult': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/EntitiesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PinApplicationResult': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['application-name'], + 'type': 'object'}, + 'PinApplicationsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/PinApplicationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PinnedLeadershipResult': {'additionalProperties': False, + 'properties': {'result': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpgradeSeriesStartUnitCompletionParam': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'message': {'type': 'string'}}, + 'required': ['entities', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'message': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['entity', + 'status', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'UpgradeSeriesStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusResult'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'CurrentSeries': {'description': 'CurrentSeries returns what ' + 'Juju thinks the current ' + 'series of the machine is.\n' + 'Note that a machine could ' + 'have been upgraded ' + 'out-of-band by running\n' + 'do-release-upgrade outside ' + 'of the upgrade-series ' + 'workflow,\n' + 'making this value incorrect.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'FinishUpgradeSeries': {'description': 'FinishUpgradeSeries is ' + 'the last action in the ' + 'upgrade workflow and ' + 'is\n' + 'called after all ' + 'machine and unit ' + 'statuses are ' + '"completed".\n' + 'It updates the machine ' + 'series to reflect the ' + 'completed upgrade, ' + 'then\n' + 'removes the ' + 'upgrade-series lock.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'MachineStatus': {'description': 'MachineStatus gets the ' + 'current upgrade-series ' + 'status of a machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'PinMachineApplications': {'description': 'PinMachineApplications ' + 'pins leadership for ' + 'applications ' + 'represented by ' + 'units\n' + 'running on the ' + "auth'd machine.", + 'properties': {'Result': {'$ref': '#/definitions/PinApplicationsResults'}}, + 'type': 'object'}, + 'PinnedLeadership': {'description': 'PinnedLeadership returns ' + 'all pinned applications ' + 'and the entities that\n' + 'require their pinned ' + 'behaviour, for leadership ' + 'in the current model.', + 'properties': {'Result': {'$ref': '#/definitions/PinnedLeadershipResult'}}, + 'type': 'object'}, + 'SetMachineStatus': {'description': 'SetMachineStatus sets the ' + 'current upgrade-series ' + 'status of a machine.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUpgradeSeriesUnitStatus': {'description': 'SetUpgradeSeriesUnitStatus ' + 'sets the ' + 'upgrade series ' + 'status of the ' + 'unit.\n' + 'If no upgrade ' + 'is in progress ' + 'an error is ' + 'returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StartUnitCompletion': {'description': 'StartUnitCompletion ' + 'starts the upgrade ' + 'series completion ' + 'phase for all ' + 'subordinate\n' + 'units of a given ' + 'machine.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStartUnitCompletionParam'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'TargetSeries': {'description': 'TargetSeries returns the ' + 'series that a machine has ' + 'been locked\n' + 'for upgrading to.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'UnitsCompleted': {'description': 'UnitsCompleted returns the ' + 'units running on this ' + 'machine that have ' + 'completed\n' + 'the upgrade-series workflow ' + 'and are in their normal ' + 'running state.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/EntitiesResults'}}, + 'type': 'object'}, + 'UnitsPrepared': {'description': 'UnitsPrepared returns the ' + 'units running on this ' + 'machine that have completed\n' + 'their upgrade-series ' + 'preparation, and are ready ' + 'to be stopped and have ' + 'their\n' + 'unit agent services ' + 'converted for the target ' + 'series.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/EntitiesResults'}}, + 'type': 'object'}, + 'UnpinMachineApplications': {'description': 'UnpinMachineApplications ' + 'unpins leadership ' + 'for applications ' + 'represented by\n' + 'units running on ' + "the auth'd " + 'machine.', + 'properties': {'Result': {'$ref': '#/definitions/PinApplicationsResults'}}, + 'type': 'object'}, + 'UpgradeSeriesUnitStatus': {'description': 'UpgradeSeriesUnitStatus ' + 'returns the ' + 'current ' + 'preparation status ' + 'of an\n' + 'upgrading unit.\n' + 'If no series ' + 'upgrade is in ' + 'progress an error ' + 'is returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'description': 'WatchUpgradeSeriesNotifications ' + 'returns a ' + 'NotifyWatcher ' + 'for ' + 'observing ' + 'changes to ' + 'upgrade ' + 'series ' + 'locks.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringResults) + async def 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-series 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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-series lock. + + args : typing.Sequence[~UpdateSeriesArg] + 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=2, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def MachineStatus(self, entities=None): + ''' + MachineStatus gets the current upgrade-series 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PinApplicationsResults) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PinnedLeadershipResult) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMachineStatus(self, params=None): + ''' + SetMachineStatus sets the current upgrade-series 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=2, + params=_params) + _params['params'] = params + reply = await self.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='UpgradeSeries', + request='SetUpgradeSeriesUnitStatus', + version=2, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=2, + params=_params) + _params['entities'] = entities + _params['message'] = message + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def 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=2, + params=_params) + _params['entities'] = entities + reply = await self.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-series 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(EntitiesResults) + async def UnitsPrepared(self, entities=None): + ''' + UnitsPrepared returns the units running on this machine that have completed + their upgrade-series preparation, and are ready to be stopped and have their + unit agent services converted for the target series. + + 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='UnitsPrepared', + version=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PinApplicationsResults) + async def 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=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class UpgradeStepsFacade(Type): + name = 'UpgradeSteps' + version = 2 + schema = {'definitions': {'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'}, + 'SetUnitStateArg': {'additionalProperties': False, + 'properties': {'charm-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'meter-status-state': {'type': 'string'}, + 'relation-state': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-state': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'uniter-state': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'SetUnitStateArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetUnitStateArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}}, + 'properties': {'ResetKVMMachineModificationStatusIdle': {'description': 'ResetKVMMachineModificationStatusIdle ' + 'sets ' + 'the ' + 'modification ' + 'status\n' + 'of a ' + 'kvm ' + 'machine ' + 'to ' + 'idle ' + 'if ' + 'it ' + 'is ' + 'in ' + 'an ' + 'error ' + 'state ' + 'before ' + 'upgrade.\n' + 'Related ' + 'to ' + 'lp:1829393.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'WriteAgentState': {'description': 'WriteAgentState writes the ' + 'agent state for the set of ' + 'units provided. This\n' + 'call presently deals with ' + 'the state for the unit ' + 'agent.', + 'properties': {'Params': {'$ref': '#/definitions/SetUnitStateArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + +class UserManagerFacade(Type): + name = 'UserManager' + version = 2 + schema = {'definitions': {'AddUser': {'additionalProperties': False, + 'properties': {'display-name': {'type': 'string'}, + 'password': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['username', 'display-name'], + 'type': 'object'}, + 'AddUserResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'secret-key': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'type': 'object'}, + 'AddUserResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/AddUserResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'AddUsers': {'additionalProperties': False, + 'properties': {'users': {'items': {'$ref': '#/definitions/AddUser'}, + 'type': 'array'}}, + 'required': ['users'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'UserInfo': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'created-by': {'type': 'string'}, + 'date-created': {'format': 'date-time', + 'type': 'string'}, + 'disabled': {'type': 'boolean'}, + 'display-name': {'type': 'string'}, + 'last-connection': {'format': 'date-time', + 'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['username', + 'display-name', + 'access', + 'created-by', + 'date-created', + 'disabled'], + 'type': 'object'}, + 'UserInfoRequest': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'include-disabled': {'type': 'boolean'}}, + 'required': ['entities', + 'include-disabled'], + 'type': 'object'}, + 'UserInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/UserInfo'}}, + 'type': 'object'}, + 'UserInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UserInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AddUser': {'description': 'AddUser adds a user with a ' + 'username, and either a password ' + 'or\n' + 'a randomly generated secret key ' + 'which will be returned.', + 'properties': {'Params': {'$ref': '#/definitions/AddUsers'}, + 'Result': {'$ref': '#/definitions/AddUserResults'}}, + 'type': 'object'}, + 'DisableUser': {'description': 'DisableUser disables one or ' + 'more users. If the user is ' + 'already disabled,\n' + 'the action is considered a ' + 'success.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnableUser': {'description': 'EnableUser enables one or more ' + 'users. If the user is already ' + 'enabled,\n' + 'the action is considered a ' + 'success.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveUser': {'description': 'RemoveUser permanently removes ' + 'a user from the current ' + 'controller for each\n' + 'entity provided. While the user ' + 'is permanently removed we keep ' + "it's\n" + 'information around for auditing ' + 'purposes.\n' + 'TODO(redir): Add information ' + 'about getting deleted user ' + 'information when we\n' + 'add that capability.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ResetPassword': {'description': 'ResetPassword resets ' + 'password for supplied users ' + 'by\n' + 'invalidating current ' + 'passwords (if any) and ' + 'generating\n' + 'new random secret keys which ' + 'will be returned.\n' + 'Users cannot reset their own ' + 'password.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/AddUserResults'}}, + 'type': 'object'}, + 'SetPassword': {'description': 'SetPassword changes the stored ' + 'password for the specified ' + 'users.', + 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UserInfo': {'description': 'UserInfo returns information on a ' + 'user.', + 'properties': {'Params': {'$ref': '#/definitions/UserInfoRequest'}, + 'Result': {'$ref': '#/definitions/UserInfoResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddUserResults) + async def 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=2, + params=_params) + _params['users'] = users + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddUserResults) + async def 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=2, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=2, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UserInfoResults) + async def 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=2, + params=_params) + _params['entities'] = entities + _params['include-disabled'] = include_disabled + reply = await self.rpc(msg) + return reply + + + +class VolumeAttachmentsWatcherFacade(Type): + name = 'VolumeAttachmentsWatcher' + version = 2 + 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'}, + 'MachineStorageId': {'additionalProperties': False, + 'properties': {'attachment-tag': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'attachment-tag'], + 'type': 'object'}, + 'MachineStorageIdsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}}, + 'properties': {'Next': {'description': 'Next returns when a change has ' + 'occurred to an entity of the\n' + 'collection being watched since the ' + 'most recent call to Next\n' + 'or the Watch call that created the ' + 'srvMachineStorageIdsWatcher.', + 'properties': {'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}}, + 'type': 'object'}, + 'Stop': {'description': 'Stop stops the watcher.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(MachineStorageIdsWatchResult) + async def 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 = await self.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='VolumeAttachmentsWatcher', + request='Stop', + version=2, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + diff --git a/juju/client/old_clients/_client3.py b/juju/client/old_clients/_client3.py new file mode 100644 index 000000000..2c630009d --- /dev/null +++ b/juju/client/old_clients/_client3.py @@ -0,0 +1,13051 @@ +# 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.old_clients._definitions import * + + +class ActionFacade(Type): + name = 'Action' + version = 3 + schema = {'definitions': {'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'Actions': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/Action'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionsByName': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}}, + 'type': 'object'}, + 'ActionsByNames': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByName'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionsByReceiver': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'receiver': {'type': 'string'}}, + 'type': 'object'}, + 'ActionsByReceivers': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByReceiver'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ApplicationCharmActionsResult': {'additionalProperties': False, + 'properties': {'actions': {'patternProperties': {'.*': {'$ref': '#/definitions/ActionSpec'}}, + 'type': 'object'}, + 'application-tag': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ApplicationsCharmActionsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationCharmActionsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'FindActionsByNames': {'additionalProperties': False, + 'properties': {'names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FindTags': {'additionalProperties': False, + 'properties': {'prefixes': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['prefixes'], + 'type': 'object'}, + 'FindTagsResults': {'additionalProperties': False, + 'properties': {'matches': {'patternProperties': {'.*': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'required': ['matches'], + 'type': 'object'}, + 'RunParams': {'additionalProperties': False, + 'properties': {'applications': {'items': {'type': 'string'}, + 'type': 'array'}, + 'commands': {'type': 'string'}, + 'machines': {'items': {'type': 'string'}, + 'type': 'array'}, + 'timeout': {'type': 'integer'}, + 'units': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['commands', 'timeout'], + 'type': 'object'}}, + 'properties': {'Actions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'ApplicationsCharmsActions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationsCharmActionsResults'}}, + 'type': 'object'}, + 'Cancel': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'Enqueue': {'properties': {'Params': {'$ref': '#/definitions/Actions'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'FindActionTagsByPrefix': {'properties': {'Params': {'$ref': '#/definitions/FindTags'}, + 'Result': {'$ref': '#/definitions/FindTagsResults'}}, + 'type': 'object'}, + 'FindActionsByNames': {'properties': {'Params': {'$ref': '#/definitions/FindActionsByNames'}, + 'Result': {'$ref': '#/definitions/ActionsByNames'}}, + 'type': 'object'}, + 'ListAll': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'ListCompleted': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'ListPending': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'ListRunning': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'Run': {'properties': {'Params': {'$ref': '#/definitions/RunParams'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'RunOnAllMachines': {'properties': {'Params': {'$ref': '#/definitions/RunParams'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ActionResults) + async def Actions(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationsCharmActionsResults) + async def ApplicationsCharmsActions(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Cancel(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Enqueue(self, actions=None): + ''' + actions : typing.Sequence[~Action] + Returns -> ActionResults + ''' + 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='Enqueue', + version=3, + params=_params) + _params['actions'] = actions + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindTagsResults) + async def FindActionTagsByPrefix(self, prefixes=None): + ''' + prefixes : typing.Sequence[str] + Returns -> FindTagsResults + ''' + if prefixes is not None and not isinstance(prefixes, (bytes, str, list)): + raise Exception("Expected prefixes to be a Sequence, received: {}".format(type(prefixes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='FindActionTagsByPrefix', + version=3, + params=_params) + _params['prefixes'] = prefixes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByNames) + async def FindActionsByNames(self, names=None): + ''' + names : typing.Sequence[str] + Returns -> ActionsByNames + ''' + 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='Action', + request='FindActionsByNames', + version=3, + params=_params) + _params['names'] = names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListAll(self, entities=None): + ''' + 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='Action', + request='ListAll', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListCompleted(self, entities=None): + ''' + 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='Action', + request='ListCompleted', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListPending(self, entities=None): + ''' + 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='Action', + request='ListPending', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListRunning(self, entities=None): + ''' + 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='Action', + request='ListRunning', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Run(self, applications=None, commands=None, machines=None, timeout=None, units=None): + ''' + applications : typing.Sequence[str] + commands : str + machines : typing.Sequence[str] + timeout : int + units : typing.Sequence[str] + Returns -> ActionResults + ''' + 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 machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='Run', + version=3, + params=_params) + _params['applications'] = applications + _params['commands'] = commands + _params['machines'] = machines + _params['timeout'] = timeout + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def RunOnAllMachines(self, applications=None, commands=None, machines=None, timeout=None, units=None): + ''' + applications : typing.Sequence[str] + commands : str + machines : typing.Sequence[str] + timeout : int + units : typing.Sequence[str] + Returns -> ActionResults + ''' + 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 machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='RunOnAllMachines', + version=3, + params=_params) + _params['applications'] = applications + _params['commands'] = commands + _params['machines'] = machines + _params['timeout'] = timeout + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + +class AdminFacade(Type): + name = 'Admin' + version = 3 + 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'}, + 'AuthUserInfo': {'additionalProperties': False, + 'properties': {'controller-access': {'type': 'string'}, + 'credentials': {'type': 'string'}, + 'display-name': {'type': 'string'}, + 'identity': {'type': 'string'}, + 'last-connection': {'format': 'date-time', + 'type': 'string'}, + 'model-access': {'type': 'string'}}, + 'required': ['display-name', + 'identity', + 'controller-access', + 'model-access'], + 'type': 'object'}, + 'FacadeVersions': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'versions': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['name', 'versions'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + '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'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'LoginRequest': {'additionalProperties': False, + 'properties': {'auth-tag': {'type': 'string'}, + 'bakery-version': {'type': 'integer'}, + 'cli-args': {'type': 'string'}, + 'client-version': {'type': 'string'}, + 'credentials': {'type': 'string'}, + 'macaroons': {'items': {'items': {'$ref': '#/definitions/Macaroon'}, + 'type': 'array'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'user-data': {'type': 'string'}}, + 'required': ['auth-tag', + 'credentials', + 'nonce', + 'macaroons', + 'user-data'], + 'type': 'object'}, + 'LoginResult': {'additionalProperties': False, + 'properties': {'bakery-discharge-required': {'$ref': '#/definitions/Macaroon'}, + 'controller-tag': {'type': 'string'}, + 'discharge-required': {'$ref': '#/definitions/Macaroon'}, + 'discharge-required-error': {'type': 'string'}, + 'facades': {'items': {'$ref': '#/definitions/FacadeVersions'}, + 'type': 'array'}, + 'model-tag': {'type': 'string'}, + 'public-dns-name': {'type': 'string'}, + 'server-version': {'type': 'string'}, + 'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}, + 'user-info': {'$ref': '#/definitions/AuthUserInfo'}}, + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'RedirectInfoResult': {'additionalProperties': False, + 'properties': {'ca-cert': {'type': 'string'}, + 'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers', 'ca-cert'], + 'type': 'object'}}, + 'properties': {'Login': {'description': 'Login logs in with the provided ' + 'credentials. All subsequent ' + 'requests on the\n' + 'connection will act as the ' + 'authenticated user.', + 'properties': {'Params': {'$ref': '#/definitions/LoginRequest'}, + 'Result': {'$ref': '#/definitions/LoginResult'}}, + 'type': 'object'}, + 'RedirectInfo': {'description': 'RedirectInfo returns ' + 'redirected host information ' + 'for the model.\n' + 'In Juju it always returns an ' + 'error because the Juju ' + 'controller\n' + 'does not multiplex ' + 'controllers.', + 'properties': {'Result': {'$ref': '#/definitions/RedirectInfoResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(LoginResult) + async def Login(self, auth_tag=None, bakery_version=None, cli_args=None, client_version=None, credentials=None, macaroons=None, nonce=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 + 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 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['user-data'] = user_data + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RedirectInfoResult) + async def 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 = await self.rpc(msg) + return reply + + + +class AgentFacade(Type): + name = 'Agent' + version = 3 + schema = {'definitions': {'AgentGetEntitiesResult': {'additionalProperties': False, + 'properties': {'container-type': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'life': {'type': 'string'}}, + 'required': ['life', + 'jobs', + 'container-type'], + 'type': 'object'}, + 'AgentGetEntitiesResults': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/AgentGetEntitiesResult'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + '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'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'IsMasterResult': {'additionalProperties': False, + 'properties': {'master': {'type': 'boolean'}}, + 'required': ['master'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelTag': {'additionalProperties': False, 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StateServingInfo': {'additionalProperties': False, + 'properties': {'api-port': {'type': 'integer'}, + 'ca-private-key': {'type': 'string'}, + 'cert': {'type': 'string'}, + 'controller-api-port': {'type': 'integer'}, + 'private-key': {'type': 'string'}, + 'shared-secret': {'type': 'string'}, + 'state-port': {'type': 'integer'}, + 'system-identity': {'type': 'string'}}, + 'required': ['api-port', + 'state-port', + 'cert', + 'private-key', + 'ca-private-key', + 'shared-secret', + 'system-identity'], + 'type': 'object'}}, + 'properties': {'ClearReboot': {'description': 'ClearReboot will clear the ' + 'reboot flag on provided ' + 'machines, if it exists.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CloudSpec': {'description': "CloudSpec returns the model's " + 'cloud spec.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'GetCloudSpec': {'description': 'GetCloudSpec constructs the ' + 'CloudSpec for a validated and ' + 'authorized model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetEntities': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/AgentGetEntitiesResults'}}, + 'type': 'object'}, + 'IsMaster': {'properties': {'Result': {'$ref': '#/definitions/IsMasterResult'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'SetPasswords': {'description': 'SetPasswords sets the given ' + 'password for each supplied ' + 'entity, if possible.', + 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StateServingInfo': {'properties': {'Result': {'$ref': '#/definitions/StateServingInfo'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'description': 'WatchCloudSpecsChanges ' + 'returns a watcher ' + 'for cloud spec ' + 'changes.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchCredentials': {'description': 'WatchCredentials watches ' + 'for changes to the ' + 'specified credentials.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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='Agent', + request='ClearReboot', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResults) + async def 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='Agent', + request='CloudSpec', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def 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='Agent', + request='ControllerAPIInfoForModels', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.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='Agent', + request='ControllerConfig', + version=3, + params=_params) + + reply = await self.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='Agent', + request='GetCloudSpec', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AgentGetEntitiesResults) + async def GetEntities(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Agent', + request='GetEntities', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IsMasterResult) + async def IsMaster(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) + 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) + 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) + 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) + 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) + 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) + 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 AllModelWatcherFacade(Type): + name = 'AllModelWatcher' + 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) + async def 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=3, + params=_params) + + reply = await self.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='AllModelWatcher', + request='Stop', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + async def 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 + reply = await self.connection.rpc(msg, encoder=TypeEncoder) + return reply + + + +class ApplicationFacade(Type): + name = 'Application' + version = 3 + schema = {'definitions': {'AddApplicationUnits': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'num-units': {'type': 'integer'}, + 'placement': {'items': {'$ref': '#/definitions/Placement'}, + 'type': 'array'}}, + 'required': ['application', + 'num-units', + 'placement'], + 'type': 'object'}, + 'AddApplicationUnitsResults': {'additionalProperties': False, + 'properties': {'units': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['units'], + 'type': 'object'}, + 'AddRelation': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['endpoints'], + 'type': 'object'}, + 'AddRelationResults': {'additionalProperties': False, + 'properties': {'endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}}, + 'required': ['endpoints'], + 'type': 'object'}, + 'ApplicationCharmRelations': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationCharmRelationsResults': {'additionalProperties': False, + 'properties': {'charm-relations': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['charm-relations'], + 'type': 'object'}, + 'ApplicationDeploy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-yaml': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'num-units': {'type': 'integer'}, + 'placement': {'items': {'$ref': '#/definitions/Placement'}, + 'type': 'array'}, + 'resources': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'series': {'type': 'string'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'series', + 'charm-url', + 'channel', + 'num-units', + 'config-yaml', + 'constraints'], + 'type': 'object'}, + 'ApplicationDestroy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationExpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGetResults': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'series': {'type': 'string'}}, + 'required': ['application', + 'charm', + 'config', + 'constraints', + 'series'], + 'type': 'object'}, + 'ApplicationMetricCredential': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'metrics-credentials': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['application', + 'metrics-credentials'], + 'type': 'object'}, + 'ApplicationMetricCredentials': {'additionalProperties': False, + 'properties': {'creds': {'items': {'$ref': '#/definitions/ApplicationMetricCredential'}, + 'type': 'array'}}, + 'required': ['creds'], + 'type': 'object'}, + 'ApplicationSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'options': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', 'options'], + 'type': 'object'}, + 'ApplicationSetCharm': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'config-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-settings-yaml': {'type': 'string'}, + 'force-series': {'type': 'boolean'}, + 'force-units': {'type': 'boolean'}, + 'resource-ids': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-constraints': {'patternProperties': {'.*': {'$ref': '#/definitions/StorageConstraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'charm-url', + 'channel', + 'force-units', + 'force-series'], + 'type': 'object'}, + 'ApplicationUnexpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationUnset': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'options': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', 'options'], + 'type': 'object'}, + 'ApplicationUpdate': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'force-charm-url': {'type': 'boolean'}, + 'force-series': {'type': 'boolean'}, + 'min-units': {'type': 'integer'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'settings-yaml': {'type': 'string'}}, + 'required': ['application', + 'charm-url', + 'force-charm-url', + 'force-series', + 'settings-yaml'], + 'type': 'object'}, + 'ApplicationsDeploy': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/ApplicationDeploy'}, + 'type': 'array'}}, + 'required': ['applications'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'DestroyApplicationUnits': {'additionalProperties': False, + 'properties': {'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + 'type': 'object'}, + 'DestroyRelation': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['endpoints'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetApplicationConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'GetConstraintsResults': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'SetConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['application', 'constraints'], + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'spaces': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}}, + 'type': 'object'}}, + 'properties': {'AddRelation': {'properties': {'Params': {'$ref': '#/definitions/AddRelation'}, + 'Result': {'$ref': '#/definitions/AddRelationResults'}}, + 'type': 'object'}, + 'AddUnits': {'properties': {'Params': {'$ref': '#/definitions/AddApplicationUnits'}, + 'Result': {'$ref': '#/definitions/AddApplicationUnitsResults'}}, + 'type': 'object'}, + 'CharmRelations': {'properties': {'Params': {'$ref': '#/definitions/ApplicationCharmRelations'}, + 'Result': {'$ref': '#/definitions/ApplicationCharmRelationsResults'}}, + 'type': 'object'}, + 'Deploy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationsDeploy'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}}, + 'type': 'object'}, + 'DestroyRelation': {'properties': {'Params': {'$ref': '#/definitions/DestroyRelation'}}, + 'type': 'object'}, + 'DestroyUnits': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, + 'type': 'object'}, + 'Expose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationExpose'}}, + 'type': 'object'}, + 'Get': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/ApplicationGetResults'}}, + 'type': 'object'}, + 'GetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'GetConstraints': {'properties': {'Params': {'$ref': '#/definitions/GetApplicationConstraints'}, + 'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, + 'type': 'object'}, + 'Set': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, + 'type': 'object'}, + 'SetCharm': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, + 'type': 'object'}, + 'SetConstraints': {'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetMetricCredentials': {'properties': {'Params': {'$ref': '#/definitions/ApplicationMetricCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Unexpose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnexpose'}}, + 'type': 'object'}, + 'Unset': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, + 'type': 'object'}, + 'Update': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUpdate'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddRelationResults) + async def AddRelation(self, endpoints=None): + ''' + endpoints : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddRelation', + version=3, + params=_params) + _params['endpoints'] = endpoints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddApplicationUnitsResults) + async def AddUnits(self, application=None, num_units=None, placement=None): + ''' + application : str + num_units : int + placement : typing.Sequence[~Placement] + 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 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddUnits', + version=3, + params=_params) + _params['application'] = application + _params['num-units'] = num_units + _params['placement'] = placement + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationCharmRelationsResults) + async def CharmRelations(self, application=None): + ''' + 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=3, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Deploy(self, applications=None): + ''' + 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=3, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Destroy(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Destroy', + version=3, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyRelation(self, endpoints=None): + ''' + endpoints : typing.Sequence[str] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyRelation', + version=3, + params=_params) + _params['endpoints'] = endpoints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyUnits(self, unit_names=None): + ''' + unit_names : typing.Sequence[str] + Returns -> None + ''' + if unit_names is not None and not isinstance(unit_names, (bytes, str, list)): + raise Exception("Expected unit_names to be a Sequence, received: {}".format(type(unit_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnits', + version=3, + params=_params) + _params['unit-names'] = unit_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Expose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=3, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetResults) + async def Get(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Get', + version=3, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def GetCharmURL(self, application=None): + ''' + application : str + Returns -> StringResult + ''' + 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='GetCharmURL', + version=3, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetConstraintsResults) + async def GetConstraints(self, application=None): + ''' + application : str + Returns -> GetConstraintsResults + ''' + 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='GetConstraints', + version=3, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Set(self, application=None, options=None): + ''' + application : str + options : typing.Mapping[str, 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 options is not None and not isinstance(options, dict): + raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Set', + version=3, + params=_params) + _params['application'] = application + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetCharm(self, application=None, channel=None, charm_url=None, config_settings=None, config_settings_yaml=None, force_series=None, force_units=None, resource_ids=None, storage_constraints=None): + ''' + application : str + channel : str + charm_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + force_series : bool + force_units : bool + resource_ids : typing.Mapping[str, str] + storage_constraints : typing.Mapping[str, ~StorageConstraints] + Returns -> None + ''' + 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_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 force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + 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 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=3, + params=_params) + _params['application'] = application + _params['channel'] = channel + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['force-series'] = force_series + _params['force-units'] = force_units + _params['resource-ids'] = resource_ids + _params['storage-constraints'] = storage_constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetConstraints(self, application=None, constraints=None): + ''' + 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=3, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMetricCredentials(self, creds=None): + ''' + 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=3, + params=_params) + _params['creds'] = creds + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unexpose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=3, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unset(self, application=None, options=None): + ''' + application : str + options : 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 options is not None and not isinstance(options, (bytes, str, list)): + raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unset', + version=3, + params=_params) + _params['application'] = application + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Update(self, application=None, charm_url=None, constraints=None, force_charm_url=None, force_series=None, min_units=None, settings=None, settings_yaml=None): + ''' + application : str + charm_url : str + constraints : Value + force_charm_url : bool + force_series : bool + min_units : int + settings : typing.Mapping[str, str] + settings_yaml : str + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + 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 constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + if force_charm_url is not None and not isinstance(force_charm_url, bool): + raise Exception("Expected force_charm_url to be a bool, received: {}".format(type(force_charm_url))) + + if force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + if min_units is not None and not isinstance(min_units, int): + raise Exception("Expected min_units to be a int, received: {}".format(type(min_units))) + + if settings is not None and not isinstance(settings, dict): + raise Exception("Expected settings to be a Mapping, received: {}".format(type(settings))) + + if settings_yaml is not None and not isinstance(settings_yaml, (bytes, str)): + raise Exception("Expected settings_yaml to be a str, received: {}".format(type(settings_yaml))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Update', + version=3, + params=_params) + _params['application'] = application + _params['charm-url'] = charm_url + _params['constraints'] = constraints + _params['force-charm-url'] = force_charm_url + _params['force-series'] = force_series + _params['min-units'] = min_units + _params['settings'] = settings + _params['settings-yaml'] = settings_yaml + reply = await self.rpc(msg) + return reply + + + +class ApplicationOffersFacade(Type): + name = 'ApplicationOffers' + version = 3 + schema = {'definitions': {'AddApplicationOffer': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'application-name': {'type': 'string'}, + 'endpoints': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'model-tag': {'type': 'string'}, + 'offer-name': {'type': 'string'}}, + 'required': ['model-tag', + 'offer-name', + 'application-name', + 'application-description', + 'endpoints'], + 'type': 'object'}, + 'AddApplicationOffers': {'additionalProperties': False, + 'properties': {'Offers': {'items': {'$ref': '#/definitions/AddApplicationOffer'}, + 'type': 'array'}}, + 'required': ['Offers'], + 'type': 'object'}, + 'ApplicationOfferAdminDetails': {'additionalProperties': False, + 'properties': {'ApplicationOfferDetails': {'$ref': '#/definitions/ApplicationOfferDetails'}, + 'application-description': {'type': 'string'}, + 'application-name': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + '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'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description', + 'ApplicationOfferDetails', + 'application-name', + 'charm-url'], + 'type': 'object'}, + 'ApplicationOfferDetails': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description'], + 'type': 'object'}, + 'ApplicationOfferResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ApplicationOfferAdminDetails'}}, + 'type': 'object'}, + 'ApplicationOffersResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationOfferResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ConsumeOfferDetails': {'additionalProperties': False, + 'properties': {'external-controller': {'$ref': '#/definitions/ExternalControllerInfo'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'offer': {'$ref': '#/definitions/ApplicationOfferDetails'}}, + 'type': 'object'}, + '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/ApplicationOfferDetails'}}, + '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'}, + 'QueryApplicationOffersResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationOfferAdminDetails'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteApplicationInfo': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'icon-url-path': {'type': 'string'}, + 'model-tag': {'type': 'string'}, + 'name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'source-model-label': {'type': 'string'}}, + 'required': ['model-tag', + 'name', + 'description', + 'offer-url', + 'endpoints', + 'icon-url-path'], + 'type': 'object'}, + 'RemoteApplicationInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoteApplicationInfo'}}, + 'type': 'object'}, + 'RemoteApplicationInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteApplicationInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}}, + 'properties': {'ApplicationOffers': {'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/QueryApplicationOffersResults'}}, + '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/QueryApplicationOffersResults'}}, + '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 GUI 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=3, + 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=3, + params=_params) + _params['force'] = force + _params['offer-urls'] = offer_urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(QueryApplicationOffersResults) + async def 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=3, + 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=3, + params=_params) + _params['offer-urls'] = offer_urls + _params['user-tag'] = user_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(QueryApplicationOffersResults) + 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 -> 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=3, + 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=3, + 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=3, + 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 GUI 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=3, + params=_params) + _params['bakery-version'] = bakery_version + _params['offer-urls'] = offer_urls + reply = await self.rpc(msg) + return reply + + + +class BundleFacade(Type): + name = 'Bundle' + version = 3 + schema = {'definitions': {'BundleChange': {'additionalProperties': False, + 'properties': {'args': {'items': {'additionalProperties': True, + 'type': 'object'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesParams': {'additionalProperties': False, + 'properties': {'bundleURL': {'type': 'string'}, + 'yaml': {'type': 'string'}}, + 'required': ['yaml', 'bundleURL'], + 'type': 'object'}, + 'BundleChangesResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'ExportBundle': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'GetChanges': {'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringResult) + async def ExportBundle(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Bundle', + request='ExportBundle', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BundleChangesResults) + async def GetChanges(self, bundleurl=None, yaml=None): + ''' + 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=3, + params=_params) + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml + reply = await self.rpc(msg) + return reply + + + +class CharmsFacade(Type): + name = 'Charms' + version = 3 + schema = {'definitions': {'AddCharmWithAuth': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'force': {'type': 'boolean'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'series': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'charm-origin', + 'macaroon', + 'force', + 'series'], + 'type': 'object'}, + 'AddCharmWithOrigin': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'charm-origin', + 'force', + 'series'], + 'type': 'object'}, + 'Charm': {'additionalProperties': False, + 'properties': {'actions': {'$ref': '#/definitions/CharmActions'}, + 'config': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmOption'}}, + 'type': 'object'}, + 'lxd-profile': {'$ref': '#/definitions/CharmLXDProfile'}, + 'meta': {'$ref': '#/definitions/CharmMeta'}, + 'metrics': {'$ref': '#/definitions/CharmMetrics'}, + 'revision': {'type': 'integer'}, + 'url': {'type': 'string'}}, + 'required': ['revision', 'url', 'config'], + 'type': 'object'}, + 'CharmActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'CharmActions': {'additionalProperties': False, + 'properties': {'specs': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmActionSpec'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'CharmDevice': {'additionalProperties': False, + 'properties': {'CountMax': {'type': 'integer'}, + 'CountMin': {'type': 'integer'}, + 'Description': {'type': 'string'}, + 'Name': {'type': 'string'}, + 'Type': {'type': 'string'}}, + 'required': ['Name', + 'Description', + 'Type', + 'CountMin', + 'CountMax'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CharmMeta': {'additionalProperties': False, + 'properties': {'categories': {'items': {'type': 'string'}, + 'type': 'array'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmDevice'}}, + 'type': 'object'}, + 'extra-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'min-juju-version': {'type': 'string'}, + 'name': {'type': 'string'}, + 'payload-classes': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmPayloadClass'}}, + 'type': 'object'}, + 'peers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'provides': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'requires': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'resources': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmResourceMeta'}}, + 'type': 'object'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmStorage'}}, + 'type': 'object'}, + 'subordinate': {'type': 'boolean'}, + 'summary': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'terms': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['name', + 'summary', + 'description', + 'subordinate'], + 'type': 'object'}, + 'CharmMetric': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'description'], + 'type': 'object'}, + 'CharmMetrics': {'additionalProperties': False, + 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, + 'type': 'object'}, + 'plan': {'$ref': '#/definitions/CharmPlan'}}, + 'required': ['metrics', 'plan'], + 'type': 'object'}, + 'CharmOption': {'additionalProperties': False, + 'properties': {'default': {'additionalProperties': True, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CharmOrigin': {'additionalProperties': False, + 'properties': {'hash': {'type': 'string'}, + 'id': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'risk': {'type': 'string'}, + 'source': {'type': 'string'}, + 'track': {'type': 'string'}}, + 'required': ['source', 'id'], + 'type': 'object'}, + 'CharmOriginResult': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['charm-origin'], + 'type': 'object'}, + 'CharmPayloadClass': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', 'type'], + 'type': 'object'}, + 'CharmPlan': {'additionalProperties': False, + 'properties': {'required': {'type': 'boolean'}}, + 'required': ['required'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'CharmResourceMeta': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'path': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'description'], + 'type': 'object'}, + 'CharmStorage': {'additionalProperties': False, + 'properties': {'count-max': {'type': 'integer'}, + 'count-min': {'type': 'integer'}, + 'description': {'type': 'string'}, + 'location': {'type': 'string'}, + 'minimum-size': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'properties': {'items': {'type': 'string'}, + 'type': 'array'}, + 'read-only': {'type': 'boolean'}, + 'shared': {'type': 'boolean'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'description', + 'type', + 'shared', + 'read-only', + 'count-min', + 'count-max', + 'minimum-size'], + 'type': 'object'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'CharmsList': {'additionalProperties': False, + 'properties': {'names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['names'], + 'type': 'object'}, + 'CharmsListResult': {'additionalProperties': False, + 'properties': {'charm-urls': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['charm-urls'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'IsMeteredResult': {'additionalProperties': False, + 'properties': {'metered': {'type': 'boolean'}}, + 'required': ['metered'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'ResolveCharmWithChannel': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'reference': {'type': 'string'}}, + 'required': ['reference', + 'charm-origin'], + 'type': 'object'}, + 'ResolveCharmWithChannelResult': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'error': {'$ref': '#/definitions/Error'}, + 'supported-series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'charm-origin', + 'supported-series'], + 'type': 'object'}, + 'ResolveCharmWithChannelResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/ResolveCharmWithChannelResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'ResolveCharmsWithChannel': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'resolve': {'items': {'$ref': '#/definitions/ResolveCharmWithChannel'}, + 'type': 'array'}}, + 'required': ['resolve'], + 'type': 'object'}}, + 'properties': {'AddCharm': {'description': 'AddCharm adds the given charm URL ' + '(which must include revision) to ' + 'the\n' + 'environment, if it does not exist ' + 'yet. Local charms are not ' + 'supported,\n' + 'only charm store and charm hub ' + 'URLs. See also AddLocalCharm().', + 'properties': {'Params': {'$ref': '#/definitions/AddCharmWithOrigin'}, + 'Result': {'$ref': '#/definitions/CharmOriginResult'}}, + 'type': 'object'}, + 'AddCharmWithAuthorization': {'description': 'AddCharmWithAuthorization ' + 'adds the given ' + 'charm URL (which ' + 'must include\n' + 'revision) to the ' + 'environment, if ' + 'it does not ' + 'exist yet. Local ' + 'charms are\n' + 'not supported, ' + 'only charm store ' + 'and charm hub ' + 'URLs. See also ' + 'AddLocalCharm().\n' + '\n' + 'The ' + 'authorization ' + 'macaroon, ' + 'args.CharmStoreMacaroon, ' + 'may be\n' + 'omitted, in ' + 'which case this ' + 'call is ' + 'equivalent to ' + 'AddCharm.', + 'properties': {'Params': {'$ref': '#/definitions/AddCharmWithAuth'}, + 'Result': {'$ref': '#/definitions/CharmOriginResult'}}, + 'type': 'object'}, + 'CharmInfo': {'description': 'CharmInfo returns information ' + 'about the requested charm.\n' + 'NOTE: thumper 2016-06-29, this ' + 'is not a bulk call and probably ' + 'should be.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'IsMetered': {'description': 'IsMetered returns whether or not ' + 'the charm is metered.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, + 'Result': {'$ref': '#/definitions/IsMeteredResult'}}, + 'type': 'object'}, + 'List': {'description': 'List returns a list of charm URLs ' + 'currently in the state.\n' + 'If supplied parameter contains any ' + 'names, the result will\n' + 'be filtered to return only the charms ' + 'with supplied names.', + 'properties': {'Params': {'$ref': '#/definitions/CharmsList'}, + 'Result': {'$ref': '#/definitions/CharmsListResult'}}, + 'type': 'object'}, + 'ResolveCharms': {'description': 'ResolveCharms resolves the ' + 'given charm URLs with an ' + 'optionally specified\n' + 'preferred channel. Channel ' + 'provided via CharmOrigin.', + 'properties': {'Params': {'$ref': '#/definitions/ResolveCharmsWithChannel'}, + 'Result': {'$ref': '#/definitions/ResolveCharmWithChannelResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(CharmOriginResult) + async def AddCharm(self, charm_origin=None, force=None, series=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 + series : str + 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 series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + 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=3, + params=_params) + _params['charm-origin'] = charm_origin + _params['force'] = force + _params['series'] = series + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CharmOriginResult) + async def AddCharmWithAuthorization(self, charm_origin=None, force=None, macaroon=None, series=None, url=None): + ''' + AddCharmWithAuthorization 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(). + + The authorization macaroon, args.CharmStoreMacaroon, may be + omitted, in which case this call is equivalent to AddCharm. + + charm_origin : CharmOrigin + force : bool + macaroon : Macaroon + series : str + 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 macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): + raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + 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='AddCharmWithAuthorization', + version=3, + params=_params) + _params['charm-origin'] = charm_origin + _params['force'] = force + _params['macaroon'] = macaroon + _params['series'] = series + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(Charm) + async def CharmInfo(self, url=None): + ''' + CharmInfo returns information about the requested charm. + NOTE: thumper 2016-06-29, this is not a bulk call and probably should be. + + 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=3, + params=_params) + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IsMeteredResult) + async def 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=3, + params=_params) + _params['url'] = url + reply = await self.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=3, + params=_params) + _params['names'] = names + reply = await self.rpc(msg) + return reply + + + + @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=3, + params=_params) + _params['macaroon'] = macaroon + _params['resolve'] = resolve + reply = await self.rpc(msg) + return reply + + + +class ClientFacade(Type): + name = 'Client' + version = 3 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'AddCharm': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'url': {'type': 'string'}}, + 'required': ['url', 'channel', 'force'], + 'type': 'object'}, + 'AddCharmWithAuthorization': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'channel', + 'macaroon', + 'force'], + 'type': 'object'}, + 'AddMachineParams': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'container-type': {'type': 'string'}, + 'disks': {'items': {'$ref': '#/definitions/Constraints'}, + 'type': 'array'}, + 'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'instance-id': {'type': 'string'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'parent-id': {'type': 'string'}, + 'placement': {'$ref': '#/definitions/Placement'}, + 'series': {'type': 'string'}}, + 'required': ['series', + 'constraints', + 'jobs', + 'parent-id', + 'container-type', + 'instance-id', + 'nonce', + 'hardware-characteristics', + 'addresses'], + 'type': 'object'}, + 'AddMachines': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'AddMachinesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'machine': {'type': 'string'}}, + 'required': ['machine'], + 'type': 'object'}, + 'AddMachinesResults': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'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'}, + 'AgentVersionResult': {'additionalProperties': False, + 'properties': {'version': {'$ref': '#/definitions/Number'}}, + 'required': ['version'], + 'type': 'object'}, + 'AllWatcherId': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'ApplicationOfferStatus': {'additionalProperties': False, + 'properties': {'active-connected-count': {'type': 'integer'}, + 'application-name': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteEndpoint'}}, + 'type': 'object'}, + 'err': {'$ref': '#/definitions/Error'}, + 'offer-name': {'type': 'string'}, + 'total-connected-count': {'type': 'integer'}}, + 'required': ['offer-name', + 'application-name', + 'charm', + 'endpoints', + 'active-connected-count', + 'total-connected-count'], + 'type': 'object'}, + 'ApplicationStatus': {'additionalProperties': False, + 'properties': {'can-upgrade-to': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'charm-channel': {'type': 'string'}, + 'charm-profile': {'type': 'string'}, + 'charm-version': {'type': 'string'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'err': {'$ref': '#/definitions/Error'}, + 'exposed': {'type': 'boolean'}, + 'exposed-endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/ExposedEndpoint'}}, + 'type': 'object'}, + 'int': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'meter-statuses': {'patternProperties': {'.*': {'$ref': '#/definitions/MeterStatus'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'public-address': {'type': 'string'}, + 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'series': {'type': 'string'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}, + 'subordinate-to': {'items': {'type': 'string'}, + 'type': 'array'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, + 'type': 'object'}, + 'workload-version': {'type': 'string'}}, + 'required': ['charm', + 'charm-version', + 'charm-profile', + 'series', + 'exposed', + 'life', + 'relations', + 'can-upgrade-to', + 'subordinate-to', + 'units', + 'meter-statuses', + 'status', + 'workload-version', + 'endpoint-bindings', + 'public-address'], + 'type': 'object'}, + 'Binary': {'additionalProperties': False, + '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'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build', + 'Number', + 'Release', + 'Arch'], + 'type': 'object'}, + 'BranchStatus': {'additionalProperties': False, + 'properties': {'assigned-units': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'created': {'type': 'integer'}, + 'created-by': {'type': 'string'}}, + 'required': ['assigned-units', + 'created', + 'created-by'], + 'type': 'object'}, + 'BundleChange': {'additionalProperties': False, + 'properties': {'args': {'items': {'additionalProperties': True, + 'type': 'object'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesParams': {'additionalProperties': False, + 'properties': {'bundleURL': {'type': 'string'}, + 'yaml': {'type': 'string'}}, + 'required': ['yaml', 'bundleURL'], + 'type': 'object'}, + 'BundleChangesResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'DestroyMachines': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'machine-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['machine-names', 'force'], + 'type': 'object'}, + 'DetailedStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'err': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}, + 'kind': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['status', + 'info', + 'data', + 'since', + 'kind', + 'version', + 'life'], + 'type': 'object'}, + 'EndpointStatus': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}, + 'subordinate': {'type': 'boolean'}}, + 'required': ['application', + 'name', + 'role', + 'subordinate'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'FindToolsParams': {'additionalProperties': False, + 'properties': {'agentstream': {'type': 'string'}, + 'arch': {'type': 'string'}, + 'major': {'type': 'integer'}, + 'minor': {'type': 'integer'}, + 'number': {'$ref': '#/definitions/Number'}, + 'os-type': {'type': 'string'}, + 'series': {'type': 'string'}}, + 'required': ['number', + 'major', + 'minor', + 'arch', + 'series', + 'os-type', + 'agentstream'], + 'type': 'object'}, + 'FindToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'list': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['list'], + 'type': 'object'}, + 'FullStatus': {'additionalProperties': False, + 'properties': {'applications': {'patternProperties': {'.*': {'$ref': '#/definitions/ApplicationStatus'}}, + 'type': 'object'}, + 'branches': {'patternProperties': {'.*': {'$ref': '#/definitions/BranchStatus'}}, + 'type': 'object'}, + 'controller-timestamp': {'format': 'date-time', + 'type': 'string'}, + 'machines': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}}, + 'type': 'object'}, + 'model': {'$ref': '#/definitions/ModelStatusInfo'}, + 'offers': {'patternProperties': {'.*': {'$ref': '#/definitions/ApplicationOfferStatus'}}, + 'type': 'object'}, + 'relations': {'items': {'$ref': '#/definitions/RelationStatus'}, + 'type': 'array'}, + 'remote-applications': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteApplicationStatus'}}, + 'type': 'object'}}, + 'required': ['model', + 'machines', + 'applications', + 'remote-applications', + 'offers', + 'relations', + 'controller-timestamp', + 'branches'], + 'type': 'object'}, + 'GetConstraintsResults': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'root-disk-source': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'History': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'statuses': {'items': {'$ref': '#/definitions/DetailedStatus'}, + 'type': 'array'}}, + 'required': ['statuses'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + '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'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'LXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachineHardware': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'MachineStatus': {'additionalProperties': False, + 'properties': {'agent-status': {'$ref': '#/definitions/DetailedStatus'}, + 'constraints': {'type': 'string'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}}, + 'type': 'object'}, + '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': {'items': {'type': 'string'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'lxd-profiles': {'patternProperties': {'.*': {'$ref': '#/definitions/LXDProfile'}}, + 'type': 'object'}, + 'modification-status': {'$ref': '#/definitions/DetailedStatus'}, + 'network-interfaces': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInterface'}}, + 'type': 'object'}, + 'primary-controller-machine': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'wants-vote': {'type': 'boolean'}}, + 'required': ['agent-status', + 'instance-status', + 'modification-status', + 'dns-name', + 'instance-id', + 'display-name', + 'series', + 'id', + 'containers', + 'constraints', + 'hardware', + 'jobs', + 'has-vote', + 'wants-vote'], + 'type': 'object'}, + 'MeterStatus': {'additionalProperties': False, + 'properties': {'color': {'type': 'string'}, + 'message': {'type': 'string'}}, + 'required': ['color', 'message'], + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'cloud-credential-tag': {'type': 'string'}, + 'cloud-credential-validity': {'type': 'boolean'}, + 'cloud-region': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'controller-uuid': {'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'}, + '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', + 'sla', + 'agent-version'], + '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'}, + 'ModelSLA': {'additionalProperties': False, + 'properties': {'ModelSLAInfo': {'$ref': '#/definitions/ModelSLAInfo'}, + 'creds': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', + 'owner', + 'ModelSLAInfo', + 'creds'], + 'type': 'object'}, + 'ModelSLAInfo': {'additionalProperties': False, + 'properties': {'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', 'owner'], + 'type': 'object'}, + 'ModelSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelStatusInfo': {'additionalProperties': False, + 'properties': {'available-version': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'meter-status': {'$ref': '#/definitions/MeterStatus'}, + 'model-status': {'$ref': '#/definitions/DetailedStatus'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'sla': {'type': 'string'}, + 'type': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['name', + 'type', + 'cloud-tag', + 'version', + 'available-version', + 'model-status', + 'meter-status', + 'sla'], + 'type': 'object'}, + 'ModelUnset': {'additionalProperties': False, + 'properties': {'keys': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['keys'], + 'type': 'object'}, + 'ModelUserInfo': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'display-name': {'type': 'string'}, + 'last-connection': {'format': 'date-time', + 'type': 'string'}, + 'user': {'type': 'string'}}, + 'required': ['user', + 'display-name', + 'last-connection', + 'access'], + 'type': 'object'}, + 'ModelUserInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ModelUserInfo'}}, + 'type': 'object'}, + 'ModelUserInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ModelUserInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NetworkInterface': {'additionalProperties': False, + 'properties': {'dns-nameservers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway': {'type': 'string'}, + 'ip-addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'is-up': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'space': {'type': 'string'}}, + 'required': ['ip-addresses', + 'mac-address', + 'is-up'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'PrivateAddress': {'additionalProperties': False, + 'properties': {'target': {'type': 'string'}}, + 'required': ['target'], + 'type': 'object'}, + 'PrivateAddressResults': {'additionalProperties': False, + 'properties': {'private-address': {'type': 'string'}}, + 'required': ['private-address'], + 'type': 'object'}, + 'ProvisioningScriptParams': {'additionalProperties': False, + 'properties': {'data-dir': {'type': 'string'}, + 'disable-package-commands': {'type': 'boolean'}, + 'machine-id': {'type': 'string'}, + 'nonce': {'type': 'string'}}, + 'required': ['machine-id', + 'nonce', + 'data-dir', + 'disable-package-commands'], + 'type': 'object'}, + 'ProvisioningScriptResult': {'additionalProperties': False, + 'properties': {'script': {'type': 'string'}}, + 'required': ['script'], + 'type': 'object'}, + 'PublicAddress': {'additionalProperties': False, + 'properties': {'target': {'type': 'string'}}, + 'required': ['target'], + 'type': 'object'}, + 'PublicAddressResults': {'additionalProperties': False, + 'properties': {'public-address': {'type': 'string'}}, + 'required': ['public-address'], + 'type': 'object'}, + 'RelationStatus': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'$ref': '#/definitions/EndpointStatus'}, + 'type': 'array'}, + 'id': {'type': 'integer'}, + 'interface': {'type': 'string'}, + 'key': {'type': 'string'}, + 'scope': {'type': 'string'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}}, + 'required': ['id', + 'key', + 'interface', + 'scope', + 'endpoints', + 'status'], + 'type': 'object'}, + 'RemoteApplicationStatus': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'err': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}}, + 'required': ['offer-url', + 'offer-name', + 'endpoints', + 'life', + 'relations', + 'status'], + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'ResolveCharmResult': {'additionalProperties': False, + 'properties': {'error': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'type': 'object'}, + 'ResolveCharmResults': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/ResolveCharmResult'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'ResolveCharms': {'additionalProperties': False, + 'properties': {'references': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['references'], + 'type': 'object'}, + 'Resolved': {'additionalProperties': False, + 'properties': {'retry': {'type': 'boolean'}, + 'unit-name': {'type': 'string'}}, + 'required': ['unit-name', 'retry'], + 'type': 'object'}, + 'SetConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['application', 'constraints'], + 'type': 'object'}, + 'SetModelAgentVersion': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'required': ['version'], + 'type': 'object'}, + 'StatusHistoryFilter': {'additionalProperties': False, + 'properties': {'date': {'format': 'date-time', + 'type': 'string'}, + 'delta': {'type': 'integer'}, + 'exclude': {'items': {'type': 'string'}, + 'type': 'array'}, + 'size': {'type': 'integer'}}, + 'required': ['size', + 'date', + 'delta', + 'exclude'], + 'type': 'object'}, + 'StatusHistoryRequest': {'additionalProperties': False, + 'properties': {'filter': {'$ref': '#/definitions/StatusHistoryFilter'}, + 'historyKind': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tag': {'type': 'string'}}, + 'required': ['historyKind', + 'size', + 'filter', + 'tag'], + 'type': 'object'}, + 'StatusHistoryRequests': {'additionalProperties': False, + 'properties': {'requests': {'items': {'$ref': '#/definitions/StatusHistoryRequest'}, + 'type': 'array'}}, + 'required': ['requests'], + 'type': 'object'}, + 'StatusHistoryResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'history': {'$ref': '#/definitions/History'}}, + 'required': ['history'], + 'type': 'object'}, + 'StatusHistoryResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusHistoryResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusParams': {'additionalProperties': False, + 'properties': {'patterns': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['patterns'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'SupportedFeature': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['name', 'description'], + 'type': 'object'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'UnitStatus': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'agent-status': {'$ref': '#/definitions/DetailedStatus'}, + 'charm': {'type': 'string'}, + 'leader': {'type': 'boolean'}, + 'machine': {'type': 'string'}, + 'opened-ports': {'items': {'type': 'string'}, + 'type': 'array'}, + 'provider-id': {'type': 'string'}, + 'public-address': {'type': 'string'}, + 'subordinates': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, + 'type': 'object'}, + 'workload-status': {'$ref': '#/definitions/DetailedStatus'}, + 'workload-version': {'type': 'string'}}, + 'required': ['agent-status', + 'workload-status', + 'workload-version', + 'machine', + 'opened-ports', + 'public-address', + 'charm', + 'subordinates'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'host/port addresses stored in ' + 'state.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'AbortCurrentUpgrade': {'description': 'AbortCurrentUpgrade ' + 'aborts and archives ' + 'the current upgrade\n' + 'synchronisation ' + 'record, if any.', + 'type': 'object'}, + 'AddCharm': {'description': 'NOTE: AddCharm is deprecated as ' + 'of juju 2.9 and charms facade ' + 'version 3.\n' + 'Please discontinue use and move ' + 'to the charms facade version.\n' + '\n' + 'TODO: remove in juju 3.0', + 'properties': {'Params': {'$ref': '#/definitions/AddCharm'}}, + 'type': 'object'}, + 'AddCharmWithAuthorization': {'description': 'AddCharmWithAuthorization ' + 'adds the given ' + 'charm URL (which ' + 'must include\n' + 'revision) to the ' + 'model, if it ' + 'does not exist ' + 'yet. Local ' + 'charms are not\n' + 'supported, only ' + 'charm store ' + 'URLs. See also ' + 'AddLocalCharm().\n' + '\n' + 'The ' + 'authorization ' + 'macaroon, ' + 'args.CharmStoreMacaroon, ' + 'may be omitted, ' + 'in\n' + 'which case this ' + 'call is ' + 'equivalent to ' + 'AddCharm.\n' + '\n' + 'NOTE: ' + 'AddCharmWithAuthorization ' + 'is deprecated as ' + 'of juju 2.9 and ' + 'charms\n' + 'facade version ' + '3. Please ' + 'discontinue use ' + 'and move to the ' + 'charms facade\n' + 'version.\n' + '\n' + 'TODO: remove in ' + 'juju 3.0', + 'properties': {'Params': {'$ref': '#/definitions/AddCharmWithAuthorization'}}, + 'type': 'object'}, + 'AddMachines': {'description': 'AddMachines adds new machines ' + 'with the supplied parameters.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'AddMachinesV2': {'description': 'AddMachinesV2 adds new ' + 'machines with the supplied ' + 'parameters.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'AgentVersion': {'description': 'AgentVersion returns the ' + 'current version that the API ' + 'server is running.', + 'properties': {'Result': {'$ref': '#/definitions/AgentVersionResult'}}, + 'type': 'object'}, + 'CACert': {'description': 'CACert returns the certificate used ' + 'to validate the state connection.', + 'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'DestroyMachines': {'description': 'DestroyMachines removes a ' + 'given set of machines.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyMachines'}}, + 'type': 'object'}, + 'FindTools': {'description': 'FindTools returns a List ' + 'containing all tools matching ' + 'the given parameters.', + 'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, + 'Result': {'$ref': '#/definitions/FindToolsResult'}}, + 'type': 'object'}, + 'FullStatus': {'description': 'FullStatus gives the ' + 'information needed for juju ' + 'status over the api', + 'properties': {'Params': {'$ref': '#/definitions/StatusParams'}, + 'Result': {'$ref': '#/definitions/FullStatus'}}, + 'type': 'object'}, + 'GetBundleChanges': {'description': 'GetBundleChanges returns ' + 'the list of changes ' + 'required to deploy the ' + 'given\n' + 'bundle data. The changes ' + 'are sorted by ' + 'requirements, so that ' + 'they can be\n' + 'applied in order.\n' + 'Deprecated: clients ' + 'should use the GetChanges ' + 'endpoint on the Bundle ' + 'facade.\n' + 'Note: any new feature in ' + 'the future like devices ' + 'will never be supported ' + 'here.', + 'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, + 'type': 'object'}, + 'GetModelConstraints': {'description': 'GetModelConstraints ' + 'returns the ' + 'constraints for the ' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, + 'type': 'object'}, + 'InjectMachines': {'description': 'InjectMachines injects a ' + 'machine into state with ' + 'provisioned status.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'ModelGet': {'description': 'ModelGet implements the ' + 'server-side part of the\n' + 'model-config CLI command.', + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelInfo': {'description': 'ModelInfo returns information ' + 'about the current model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelInfo'}}, + 'type': 'object'}, + 'ModelSet': {'description': 'ModelSet implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, + 'type': 'object'}, + 'ModelUnset': {'description': 'ModelUnset implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, + 'type': 'object'}, + 'ModelUserInfo': {'description': 'ModelUserInfo returns ' + 'information on all users in ' + 'the model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelUserInfoResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'description': 'PrivateAddress implements ' + 'the server side of ' + 'Client.PrivateAddress.', + 'properties': {'Params': {'$ref': '#/definitions/PrivateAddress'}, + 'Result': {'$ref': '#/definitions/PrivateAddressResults'}}, + 'type': 'object'}, + 'ProvisioningScript': {'description': 'ProvisioningScript ' + 'returns a shell script ' + 'that, when run,\n' + 'provisions a machine ' + 'agent on the machine ' + 'executing the script.', + 'properties': {'Params': {'$ref': '#/definitions/ProvisioningScriptParams'}, + 'Result': {'$ref': '#/definitions/ProvisioningScriptResult'}}, + 'type': 'object'}, + 'PublicAddress': {'description': 'PublicAddress implements the ' + 'server side of ' + 'Client.PublicAddress.', + 'properties': {'Params': {'$ref': '#/definitions/PublicAddress'}, + 'Result': {'$ref': '#/definitions/PublicAddressResults'}}, + 'type': 'object'}, + 'ResolveCharms': {'description': 'ResolveCharms resolves the ' + 'best available charm URLs ' + 'with series, for charm\n' + 'locations without a series ' + 'specified.\n' + '\n' + 'NOTE: ResolveCharms is ' + 'deprecated as of juju 2.9 ' + 'and charms facade version ' + '3.\n' + 'Please discontinue use and ' + 'move to the charms facade ' + 'version.\n' + '\n' + 'TODO: remove in juju 3.0', + 'properties': {'Params': {'$ref': '#/definitions/ResolveCharms'}, + 'Result': {'$ref': '#/definitions/ResolveCharmResults'}}, + 'type': 'object'}, + 'Resolved': {'description': 'Resolved implements the server ' + 'side of Client.Resolved.', + 'properties': {'Params': {'$ref': '#/definitions/Resolved'}}, + 'type': 'object'}, + 'RetryProvisioning': {'description': 'RetryProvisioning marks ' + 'a provisioning error as ' + 'transient on the ' + 'machines.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SLALevel': {'description': 'SLALevel returns the current sla ' + 'level for the model.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetModelAgentVersion': {'description': 'SetModelAgentVersion ' + 'sets the model agent ' + 'version.', + 'properties': {'Params': {'$ref': '#/definitions/SetModelAgentVersion'}}, + 'type': 'object'}, + 'SetModelConstraints': {'description': 'SetModelConstraints ' + 'sets the constraints ' + 'for the model.', + 'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetSLALevel': {'description': 'SetSLALevel sets the sla level ' + 'on the model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, + 'type': 'object'}, + 'StatusHistory': {'description': 'StatusHistory returns a ' + 'slice of past statuses for ' + 'several entities.', + 'properties': {'Params': {'$ref': '#/definitions/StatusHistoryRequests'}, + 'Result': {'$ref': '#/definitions/StatusHistoryResults'}}, + 'type': 'object'}, + 'WatchAll': {'description': 'WatchAll initiates a watcher for ' + 'entities in the connected model.', + 'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + APIHostPorts returns the API host/port addresses stored in state. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='APIHostPorts', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AbortCurrentUpgrade(self): + ''' + AbortCurrentUpgrade aborts and archives the current upgrade + synchronisation record, if any. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='AbortCurrentUpgrade', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AddCharm(self, channel=None, force=None, url=None): + ''' + NOTE: AddCharm is deprecated as of juju 2.9 and charms facade version 3. + Please discontinue use and move to the charms facade version. + + TODO: remove in juju 3.0 + + channel : str + force : bool + url : str + Returns -> None + ''' + 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 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='Client', + request='AddCharm', + version=3, + params=_params) + _params['channel'] = channel + _params['force'] = force + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AddCharmWithAuthorization(self, channel=None, force=None, macaroon=None, url=None): + ''' + AddCharmWithAuthorization adds the given charm URL (which must include + revision) to the model, if it does not exist yet. Local charms are not + supported, only charm store URLs. See also AddLocalCharm(). + + The authorization macaroon, args.CharmStoreMacaroon, may be omitted, in + which case this call is equivalent to AddCharm. + + NOTE: AddCharmWithAuthorization is deprecated as of juju 2.9 and charms + facade version 3. Please discontinue use and move to the charms facade + version. + + TODO: remove in juju 3.0 + + channel : str + force : bool + macaroon : Macaroon + url : str + Returns -> None + ''' + 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 macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): + raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) + + 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='Client', + request='AddCharmWithAuthorization', + version=3, + params=_params) + _params['channel'] = channel + _params['force'] = force + _params['macaroon'] = macaroon + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def AddMachines(self, params=None): + ''' + AddMachines adds new machines with the supplied parameters. + + 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='Client', + request='AddMachines', + version=3, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def AddMachinesV2(self, params=None): + ''' + AddMachinesV2 adds new machines with the supplied parameters. + + 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='Client', + request='AddMachinesV2', + version=3, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AgentVersionResult) + async def AgentVersion(self): + ''' + AgentVersion returns the current version that the API server is running. + + + Returns -> AgentVersionResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='AgentVersion', + version=3, + params=_params) + + 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='Client', + request='CACert', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyMachines(self, force=None, machine_names=None): + ''' + DestroyMachines removes a given set of machines. + + force : bool + machine_names : typing.Sequence[str] + Returns -> None + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if machine_names is not None and not isinstance(machine_names, (bytes, str, list)): + raise Exception("Expected machine_names to be a Sequence, received: {}".format(type(machine_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='DestroyMachines', + version=3, + params=_params) + _params['force'] = force + _params['machine-names'] = machine_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindToolsResult) + async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, number=None, os_type=None, series=None): + ''' + FindTools returns a List containing all tools matching the given parameters. + + agentstream : str + arch : str + major : int + minor : int + number : Number + os_type : str + series : 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 minor is not None and not isinstance(minor, int): + raise Exception("Expected minor to be a int, received: {}".format(type(minor))) + + 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))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='FindTools', + version=3, + params=_params) + _params['agentstream'] = agentstream + _params['arch'] = arch + _params['major'] = major + _params['minor'] = minor + _params['number'] = number + _params['os-type'] = os_type + _params['series'] = series + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FullStatus) + async def 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=3, + params=_params) + _params['patterns'] = patterns + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BundleChangesResults) + async def GetBundleChanges(self, bundleurl=None, yaml=None): + ''' + GetBundleChanges 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. + Deprecated: clients should use the GetChanges endpoint on the Bundle facade. + Note: any new feature in the future like devices will never be supported here. + + 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='Client', + request='GetBundleChanges', + version=3, + params=_params) + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetConstraintsResults) + async def GetModelConstraints(self): + ''' + GetModelConstraints returns the constraints for the model. + + + Returns -> GetConstraintsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='GetModelConstraints', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def InjectMachines(self, params=None): + ''' + InjectMachines injects a machine into state with provisioned status. + + 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='Client', + request='InjectMachines', + version=3, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResults) + async def 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='Client', + request='ModelGet', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelInfo) + async def ModelInfo(self): + ''' + ModelInfo returns information about the current model. + + + Returns -> ModelInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ModelInfo', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='ModelSet', + version=3, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='ModelUnset', + version=3, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelUserInfoResults) + async def ModelUserInfo(self): + ''' + ModelUserInfo returns information on all users in the model. + + + Returns -> ModelUserInfoResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ModelUserInfo', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PrivateAddressResults) + async def PrivateAddress(self, target=None): + ''' + PrivateAddress implements the server side of Client.PrivateAddress. + + target : str + Returns -> PrivateAddressResults + ''' + if target is not None and not isinstance(target, (bytes, str)): + raise Exception("Expected target to be a str, received: {}".format(type(target))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='PrivateAddress', + version=3, + params=_params) + _params['target'] = target + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProvisioningScriptResult) + async def 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='Client', + request='ProvisioningScript', + version=3, + params=_params) + _params['data-dir'] = data_dir + _params['disable-package-commands'] = disable_package_commands + _params['machine-id'] = machine_id + _params['nonce'] = nonce + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PublicAddressResults) + async def PublicAddress(self, target=None): + ''' + PublicAddress implements the server side of Client.PublicAddress. + + target : str + Returns -> PublicAddressResults + ''' + if target is not None and not isinstance(target, (bytes, str)): + raise Exception("Expected target to be a str, received: {}".format(type(target))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='PublicAddress', + version=3, + params=_params) + _params['target'] = target + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolveCharmResults) + async def ResolveCharms(self, references=None): + ''' + ResolveCharms resolves the best available charm URLs with series, for charm + locations without a series specified. + + NOTE: ResolveCharms is deprecated as of juju 2.9 and charms facade version 3. + Please discontinue use and move to the charms facade version. + + TODO: remove in juju 3.0 + + references : typing.Sequence[str] + Returns -> ResolveCharmResults + ''' + if references is not None and not isinstance(references, (bytes, str, list)): + raise Exception("Expected references to be a Sequence, received: {}".format(type(references))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ResolveCharms', + version=3, + params=_params) + _params['references'] = references + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Resolved(self, retry=None, unit_name=None): + ''' + Resolved implements the server side of Client.Resolved. + + retry : bool + unit_name : str + Returns -> None + ''' + if retry is not None and not isinstance(retry, bool): + raise Exception("Expected retry to be a bool, received: {}".format(type(retry))) + + if unit_name is not None and not isinstance(unit_name, (bytes, str)): + raise Exception("Expected unit_name to be a str, received: {}".format(type(unit_name))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='Resolved', + version=3, + params=_params) + _params['retry'] = retry + _params['unit-name'] = unit_name + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RetryProvisioning(self, entities=None): + ''' + RetryProvisioning marks a provisioning error as transient on the 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='Client', + request='RetryProvisioning', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + SLALevel returns the current sla level for the model. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='SLALevel', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetModelAgentVersion(self, force=None, version=None): + ''' + SetModelAgentVersion sets the model agent version. + + force : bool + version : Number + Returns -> None + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + 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='Client', + request='SetModelAgentVersion', + version=3, + params=_params) + _params['force'] = force + _params['version'] = version + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='SetModelConstraints', + version=3, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='SetSLALevel', + version=3, + params=_params) + _params['ModelSLAInfo'] = modelslainfo + _params['creds'] = creds + _params['level'] = level + _params['owner'] = owner + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusHistoryResults) + async def 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=3, + params=_params) + _params['requests'] = requests + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AllWatcherId) + async def 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=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CloudFacade(Type): + name = 'Cloud' + version = 3 + schema = {'definitions': {'AddCloudArgs': {'additionalProperties': False, + 'properties': {'cloud': {'$ref': '#/definitions/Cloud'}, + 'name': {'type': 'string'}}, + 'required': ['cloud', 'name'], + 'type': 'object'}, + 'Cloud': {'additionalProperties': False, + 'properties': {'auth-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'ca-certificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'regions': {'items': {'$ref': '#/definitions/CloudRegion'}, + 'type': 'array'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudCredentialArg': {'additionalProperties': False, + 'properties': {'cloud-name': {'type': 'string'}, + 'credential-name': {'type': 'string'}}, + 'required': ['cloud-name', + 'credential-name'], + 'type': 'object'}, + 'CloudCredentialArgs': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/CloudCredentialArg'}, + 'type': 'array'}, + 'include-secrets': {'type': 'boolean'}}, + 'required': ['include-secrets'], + 'type': 'object'}, + 'CloudCredentialResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudCredential'}}, + 'type': 'object'}, + 'CloudCredentialResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudCredentialResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CloudDetails': {'additionalProperties': False, + 'properties': {'auth-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'regions': {'items': {'$ref': '#/definitions/CloudRegion'}, + 'type': 'array'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CloudInfo': {'additionalProperties': False, + 'properties': {'CloudDetails': {'$ref': '#/definitions/CloudDetails'}, + 'users': {'items': {'$ref': '#/definitions/CloudUserInfo'}, + 'type': 'array'}}, + 'required': ['CloudDetails', 'users'], + 'type': 'object'}, + 'CloudInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudInfo'}}, + 'type': 'object'}, + 'CloudInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'CloudInstanceTypesConstraint': {'additionalProperties': False, + 'properties': {'cloud-tag': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'region': {'type': 'string'}}, + 'required': ['cloud-tag', + 'region'], + 'type': 'object'}, + 'CloudInstanceTypesConstraints': {'additionalProperties': False, + 'properties': {'constraints': {'items': {'$ref': '#/definitions/CloudInstanceTypesConstraint'}, + 'type': 'array'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'CloudRegion': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}}, + 'required': ['name'], + 'type': 'object'}, + 'CloudResult': {'additionalProperties': False, + 'properties': {'cloud': {'$ref': '#/definitions/Cloud'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'CloudResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CloudUserInfo': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'display-name': {'type': 'string'}, + 'user': {'type': 'string'}}, + 'required': ['user', + 'display-name', + 'access'], + 'type': 'object'}, + 'CloudsResult': {'additionalProperties': False, + 'properties': {'clouds': {'patternProperties': {'.*': {'$ref': '#/definitions/Cloud'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'ControllerCredentialInfo': {'additionalProperties': False, + 'properties': {'content': {'$ref': '#/definitions/CredentialContent'}, + 'models': {'items': {'$ref': '#/definitions/ModelAccess'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CredentialContent': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'cloud': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'required': ['name', + 'cloud', + 'auth-type'], + 'type': 'object'}, + 'CredentialContentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ControllerCredentialInfo'}}, + 'type': 'object'}, + 'CredentialContentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CredentialContentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'InstanceType': {'additionalProperties': False, + 'properties': {'arches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cost': {'type': 'integer'}, + 'cpu-cores': {'type': 'integer'}, + 'deprecated': {'type': 'boolean'}, + 'memory': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'root-disk': {'type': 'integer'}, + 'virt-type': {'type': 'string'}}, + 'required': ['arches', 'cpu-cores', 'memory'], + 'type': 'object'}, + 'InstanceTypesResult': {'additionalProperties': False, + 'properties': {'cost-currency': {'type': 'string'}, + 'cost-divisor': {'type': 'integer'}, + 'cost-unit': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'instance-types': {'items': {'$ref': '#/definitions/InstanceType'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceTypesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InstanceTypesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListCloudInfo': {'additionalProperties': False, + 'properties': {'CloudDetails': {'$ref': '#/definitions/CloudDetails'}, + 'user-access': {'type': 'string'}}, + 'required': ['CloudDetails', 'user-access'], + 'type': 'object'}, + 'ListCloudInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ListCloudInfo'}}, + 'type': 'object'}, + 'ListCloudInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ListCloudInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListCloudsRequest': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'ModelAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'model': {'type': 'string'}}, + 'type': 'object'}, + 'ModifyCloudAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'action': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', + 'cloud-tag', + 'action', + 'access'], + 'type': 'object'}, + 'ModifyCloudAccessRequest': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyCloudAccess'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'RevokeCredentialArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'force'], + 'type': 'object'}, + 'RevokeCredentialArgs': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/RevokeCredentialArg'}, + 'type': 'array'}}, + 'required': ['credentials'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'TaggedCredential': {'additionalProperties': False, + 'properties': {'credential': {'$ref': '#/definitions/CloudCredential'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'credential'], + 'type': 'object'}, + 'TaggedCredentials': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/TaggedCredential'}, + 'type': 'array'}}, + 'type': 'object'}, + 'UpdateCredentialArgs': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/TaggedCredential'}, + 'type': 'array'}, + 'force': {'type': 'boolean'}}, + 'required': ['credentials', 'force'], + 'type': 'object'}, + 'UpdateCredentialModelResult': {'additionalProperties': False, + 'properties': {'errors': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}, + 'name': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', 'name'], + 'type': 'object'}, + 'UpdateCredentialResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'models': {'items': {'$ref': '#/definitions/UpdateCredentialModelResult'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'UpdateCredentialResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpdateCredentialResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'UserCloud': {'additionalProperties': False, + 'properties': {'cloud-tag': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', 'cloud-tag'], + 'type': 'object'}, + 'UserClouds': {'additionalProperties': False, + 'properties': {'user-clouds': {'items': {'$ref': '#/definitions/UserCloud'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'spaces': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'AddCloud': {'properties': {'Params': {'$ref': '#/definitions/AddCloudArgs'}}, + 'type': 'object'}, + 'AddCredentials': {'properties': {'Params': {'$ref': '#/definitions/TaggedCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CheckCredentialsModels': {'properties': {'Params': {'$ref': '#/definitions/TaggedCredentials'}, + 'Result': {'$ref': '#/definitions/UpdateCredentialResults'}}, + 'type': 'object'}, + 'Cloud': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudResults'}}, + 'type': 'object'}, + 'CloudInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudInfoResults'}}, + 'type': 'object'}, + 'Clouds': {'properties': {'Result': {'$ref': '#/definitions/CloudsResult'}}, + 'type': 'object'}, + 'Credential': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudCredentialResults'}}, + 'type': 'object'}, + 'CredentialContents': {'properties': {'Params': {'$ref': '#/definitions/CloudCredentialArgs'}, + 'Result': {'$ref': '#/definitions/CredentialContentResults'}}, + 'type': 'object'}, + 'DefaultCloud': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'InstanceTypes': {'properties': {'Params': {'$ref': '#/definitions/CloudInstanceTypesConstraints'}, + 'Result': {'$ref': '#/definitions/InstanceTypesResults'}}, + 'type': 'object'}, + 'ListCloudInfo': {'properties': {'Params': {'$ref': '#/definitions/ListCloudsRequest'}, + 'Result': {'$ref': '#/definitions/ListCloudInfoResults'}}, + 'type': 'object'}, + 'ModifyCloudAccess': {'properties': {'Params': {'$ref': '#/definitions/ModifyCloudAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveClouds': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RevokeCredentialsCheckModels': {'properties': {'Params': {'$ref': '#/definitions/RevokeCredentialArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateCredentialsCheckModels': {'properties': {'Params': {'$ref': '#/definitions/UpdateCredentialArgs'}, + 'Result': {'$ref': '#/definitions/UpdateCredentialResults'}}, + 'type': 'object'}, + 'UserCredentials': {'properties': {'Params': {'$ref': '#/definitions/UserClouds'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def AddCloud(self, cloud=None, name=None): + ''' + cloud : Cloud + 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 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=3, + params=_params) + _params['cloud'] = cloud + _params['name'] = name + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddCredentials(self, credentials=None): + ''' + credentials : typing.Sequence[~TaggedCredential] + 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='AddCredentials', + version=3, + params=_params) + _params['credentials'] = credentials + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpdateCredentialResults) + async def CheckCredentialsModels(self, credentials=None): + ''' + 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=3, + params=_params) + _params['credentials'] = credentials + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudResults) + async def Cloud(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudInfoResults) + async def CloudInfo(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudsResult) + async def Clouds(self): + ''' + + Returns -> CloudsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='Clouds', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudCredentialResults) + async def Credential(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CredentialContentResults) + async def CredentialContents(self, credentials=None, include_secrets=None): + ''' + 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=3, + params=_params) + _params['credentials'] = credentials + _params['include-secrets'] = include_secrets + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def DefaultCloud(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='DefaultCloud', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InstanceTypesResults) + async def InstanceTypes(self, constraints=None): + ''' + 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=3, + params=_params) + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListCloudInfoResults) + async def ListCloudInfo(self, all_=None, user_tag=None): + ''' + 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=3, + params=_params) + _params['all'] = all_ + _params['user-tag'] = user_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyCloudAccess(self, changes=None): + ''' + changes : typing.Sequence[~ModifyCloudAccess] + 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='Cloud', + request='ModifyCloudAccess', + version=3, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveClouds(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RevokeCredentialsCheckModels(self, credentials=None): + ''' + 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=3, + params=_params) + _params['credentials'] = credentials + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpdateCredentialResults) + async def UpdateCredentialsCheckModels(self, credentials=None, force=None): + ''' + 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=3, + params=_params) + _params['credentials'] = credentials + _params['force'] = force + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def UserCredentials(self, user_clouds=None): + ''' + 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=3, + params=_params) + _params['user-clouds'] = user_clouds + reply = await self.rpc(msg) + return reply + + + +class ControllerFacade(Type): + name = 'Controller' + version = 3 + schema = {'definitions': {'AllWatcherId': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'DestroyControllerArgs': {'additionalProperties': False, + 'properties': {'destroy-models': {'type': 'boolean'}}, + 'required': ['destroy-models'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'HostedModelConfig': {'additionalProperties': False, + 'properties': {'cloud-spec': {'$ref': '#/definitions/CloudSpec'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['name', 'owner'], + 'type': 'object'}, + 'HostedModelConfigsResults': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/HostedModelConfig'}, + 'type': 'array'}}, + 'required': ['models'], + 'type': 'object'}, + 'InitiateMigrationArgs': {'additionalProperties': False, + 'properties': {'specs': {'items': {'$ref': '#/definitions/MigrationSpec'}, + 'type': 'array'}}, + 'required': ['specs'], + 'type': 'object'}, + 'InitiateMigrationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'migration-id': {'type': 'string'}, + 'model-tag': {'type': 'string'}}, + 'required': ['model-tag', + 'migration-id'], + 'type': 'object'}, + 'InitiateMigrationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InitiateMigrationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachineHardware': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'MigrationSpec': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'target-info': {'$ref': '#/definitions/MigrationTargetInfo'}}, + 'required': ['model-tag', 'target-info'], + 'type': 'object'}, + 'MigrationTargetInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'auth-tag': {'type': 'string'}, + 'ca-cert': {'type': 'string'}, + 'controller-tag': {'type': 'string'}, + 'macaroons': {'type': 'string'}, + 'password': {'type': 'string'}}, + 'required': ['controller-tag', + 'addrs', + 'ca-cert', + 'auth-tag'], + 'type': 'object'}, + 'Model': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'owner-tag'], + 'type': 'object'}, + 'ModelBlockInfo': {'additionalProperties': False, + 'properties': {'blocks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'model-uuid': {'type': 'string'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}}, + 'required': ['name', + 'model-uuid', + 'owner-tag', + 'blocks'], + 'type': 'object'}, + 'ModelBlockInfoList': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/ModelBlockInfo'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelMachineInfo': {'additionalProperties': False, + 'properties': {'hardware': {'$ref': '#/definitions/MachineHardware'}, + 'has-vote': {'type': 'boolean'}, + 'id': {'type': 'string'}, + 'instance-id': {'type': 'string'}, + 'status': {'type': 'string'}, + 'wants-vote': {'type': 'boolean'}}, + 'required': ['id'], + 'type': 'object'}, + 'ModelStatus': {'additionalProperties': False, + 'properties': {'application-count': {'type': 'integer'}, + 'hosted-machine-count': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'machines': {'items': {'$ref': '#/definitions/ModelMachineInfo'}, + 'type': 'array'}, + 'model-tag': {'type': 'string'}, + 'owner-tag': {'type': 'string'}}, + 'required': ['model-tag', + 'life', + 'hosted-machine-count', + 'application-count', + 'owner-tag'], + 'type': 'object'}, + 'ModelStatusResults': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/ModelStatus'}, + 'type': 'array'}}, + 'required': ['models'], + 'type': 'object'}, + 'ModelTag': {'additionalProperties': False, 'type': 'object'}, + 'ModifyControllerAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'action': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', + 'action', + 'access'], + 'type': 'object'}, + 'ModifyControllerAccessRequest': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyControllerAccess'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'RemoveBlocksArgs': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}}, + 'required': ['all'], + 'type': 'object'}, + 'UserAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', 'access'], + 'type': 'object'}, + 'UserAccessResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/UserAccess'}}, + 'type': 'object'}, + 'UserAccessResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UserAccessResult'}, + 'type': 'array'}}, + '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': {'AllModels': {'properties': {'Result': {'$ref': '#/definitions/UserModelList'}}, + 'type': 'object'}, + 'CloudSpec': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'DestroyController': {'properties': {'Params': {'$ref': '#/definitions/DestroyControllerArgs'}}, + 'type': 'object'}, + 'GetCloudSpec': {'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetControllerAccess': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UserAccessResults'}}, + 'type': 'object'}, + 'HostedModelConfigs': {'properties': {'Result': {'$ref': '#/definitions/HostedModelConfigsResults'}}, + 'type': 'object'}, + 'InitiateMigration': {'properties': {'Params': {'$ref': '#/definitions/InitiateMigrationArgs'}, + 'Result': {'$ref': '#/definitions/InitiateMigrationResults'}}, + 'type': 'object'}, + 'ListBlockedModels': {'properties': {'Result': {'$ref': '#/definitions/ModelBlockInfoList'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelStatusResults'}}, + 'type': 'object'}, + 'ModifyControllerAccess': {'properties': {'Params': {'$ref': '#/definitions/ModifyControllerAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveBlocks': {'properties': {'Params': {'$ref': '#/definitions/RemoveBlocksArgs'}}, + 'type': 'object'}, + 'WatchAllModels': {'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(UserModelList) + async def AllModels(self): + ''' + + Returns -> UserModelList + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='AllModels', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResults) + async def CloudSpec(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ControllerConfig', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyController(self, destroy_models=None): + ''' + destroy_models : bool + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='DestroyController', + version=3, + params=_params) + _params['destroy-models'] = destroy_models + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def GetCloudSpec(self): + ''' + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='GetCloudSpec', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UserAccessResults) + async def GetControllerAccess(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(HostedModelConfigsResults) + async def HostedModelConfigs(self): + ''' + + Returns -> HostedModelConfigsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='HostedModelConfigs', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InitiateMigrationResults) + async def InitiateMigration(self, specs=None): + ''' + 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=3, + params=_params) + _params['specs'] = specs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelBlockInfoList) + async def ListBlockedModels(self): + ''' + + Returns -> ModelBlockInfoList + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ListBlockedModels', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResults) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ModelConfig', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelStatusResults) + async def ModelStatus(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyControllerAccess(self, changes=None): + ''' + 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=3, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def RemoveBlocks(self, all_=None): + ''' + 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=3, + params=_params) + _params['all'] = all_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AllWatcherId) + async def WatchAllModels(self): + ''' + + Returns -> AllWatcherId + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='WatchAllModels', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class FirewallerFacade(Type): + name = 'Firewaller' + version = 3 + schema = {'definitions': {'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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': {'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachinePortRange': {'additionalProperties': False, + 'properties': {'port-range': {'$ref': '#/definitions/PortRange'}, + 'relation-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-tag', + 'port-range'], + 'type': 'object'}, + 'MachinePorts': {'additionalProperties': False, + 'properties': {'machine-tag': {'type': 'string'}, + 'subnet-tag': {'type': 'string'}}, + 'required': ['machine-tag', 'subnet-tag'], + 'type': 'object'}, + 'MachinePortsParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MachinePorts'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MachinePortsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ports': {'items': {'$ref': '#/definitions/MachinePortRange'}, + 'type': 'array'}}, + 'required': ['ports'], + 'type': 'object'}, + 'MachinePortsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachinePortsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelTag': {'additionalProperties': False, 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + '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'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'CloudSpec': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'GetAssignedMachine': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GetCloudSpec': {'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetExposed': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'GetMachineActiveSubnets': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'GetMachinePorts': {'properties': {'Params': {'$ref': '#/definitions/MachinePortsParams'}, + 'Result': {'$ref': '#/definitions/MachinePortsResults'}}, + 'type': 'object'}, + 'InstanceId': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchOpenedPorts': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnits': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(CloudSpecResults) + async def CloudSpec(self, entities=None): + ''' + 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='Firewaller', + request='CloudSpec', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetAssignedMachine(self, entities=None): + ''' + 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='GetAssignedMachine', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def GetCloudSpec(self): + ''' + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='GetCloudSpec', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def GetExposed(self, entities=None): + ''' + 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='GetExposed', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def GetMachineActiveSubnets(self, entities=None): + ''' + 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='Firewaller', + request='GetMachineActiveSubnets', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachinePortsResults) + async def GetMachinePorts(self, params=None): + ''' + params : typing.Sequence[~MachinePorts] + Returns -> MachinePortsResults + ''' + 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='Firewaller', + request='GetMachinePorts', + version=3, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='ModelConfig', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + 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='Firewaller', + request='Watch', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchForModelConfigChanges', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachines(self): + ''' + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='WatchModelMachines', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchOpenedPorts(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnits(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class ImageMetadataFacade(Type): + name = 'ImageMetadata' + version = 3 + schema = {'properties': {'UpdateFromPublishedImages': {'description': 'UpdateFromPublishedImages ' + 'is now a no-op.\n' + 'It is retained ' + 'for ' + 'compatibility.', + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + +class InstancePollerFacade(Type): + name = 'InstancePoller' + version = 3 + schema = {'definitions': {'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineAddresses': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'addresses'], + 'type': 'object'}, + 'MachineAddressesResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses'], + 'type': 'object'}, + 'MachineAddressesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineAddressesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'SetMachinesAddresses': {'additionalProperties': False, + 'properties': {'machine-addresses': {'items': {'$ref': '#/definitions/MachineAddresses'}, + 'type': 'array'}}, + 'required': ['machine-addresses'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'AreManuallyProvisioned': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'InstanceId': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'InstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ProviderAddresses': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineAddressesResults'}}, + 'type': 'object'}, + 'SetInstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetProviderAddresses': {'properties': {'Params': {'$ref': '#/definitions/SetMachinesAddresses'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Status': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(BoolResults) + async def AreManuallyProvisioned(self, entities=None): + ''' + 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='InstancePoller', + request='AreManuallyProvisioned', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def InstanceStatus(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='ModelConfig', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineAddressesResults) + async def ProviderAddresses(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceStatus(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetProviderAddresses(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='InstancePoller', + request='SetProviderAddresses', + version=3, + params=_params) + _params['machine-addresses'] = machine_addresses + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def Status(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='WatchForModelConfigChanges', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachines(self): + ''' + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='InstancePoller', + request='WatchModelMachines', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class MachineManagerFacade(Type): + name = 'MachineManager' + version = 3 + schema = {'definitions': {'AddMachineParams': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'container-type': {'type': 'string'}, + 'disks': {'items': {'$ref': '#/definitions/Constraints'}, + 'type': 'array'}, + 'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'instance-id': {'type': 'string'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'parent-id': {'type': 'string'}, + 'placement': {'$ref': '#/definitions/Placement'}, + 'series': {'type': 'string'}}, + 'required': ['series', + 'constraints', + 'jobs', + 'parent-id', + 'container-type', + 'instance-id', + 'nonce', + 'hardware-characteristics', + 'addresses'], + 'type': 'object'}, + 'AddMachines': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'AddMachinesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'machine': {'type': 'string'}}, + 'required': ['machine'], + 'type': 'object'}, + 'AddMachinesResults': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'DestroyMachineInfo': {'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'}, + 'DestroyMachineResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'$ref': '#/definitions/DestroyMachineInfo'}}, + 'type': 'object'}, + 'DestroyMachineResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/DestroyMachineResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceType': {'additionalProperties': False, + 'properties': {'arches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cost': {'type': 'integer'}, + 'cpu-cores': {'type': 'integer'}, + 'deprecated': {'type': 'boolean'}, + 'memory': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'root-disk': {'type': 'integer'}, + 'virt-type': {'type': 'string'}}, + 'required': ['arches', 'cpu-cores', 'memory'], + 'type': 'object'}, + 'InstanceTypesResult': {'additionalProperties': False, + 'properties': {'cost-currency': {'type': 'string'}, + 'cost-divisor': {'type': 'integer'}, + 'cost-unit': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'instance-types': {'items': {'$ref': '#/definitions/InstanceType'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceTypesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InstanceTypesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'ModelInstanceTypesConstraint': {'additionalProperties': False, + 'properties': {'value': {'$ref': '#/definitions/Value'}}, + 'type': 'object'}, + 'ModelInstanceTypesConstraints': {'additionalProperties': False, + 'properties': {'constraints': {'items': {'$ref': '#/definitions/ModelInstanceTypesConstraint'}, + 'type': 'array'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'spaces': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}}, + 'type': 'object'}}, + 'properties': {'AddMachines': {'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'DestroyMachine': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DestroyMachineResults'}}, + 'type': 'object'}, + 'ForceDestroyMachine': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DestroyMachineResults'}}, + 'type': 'object'}, + 'InstanceTypes': {'properties': {'Params': {'$ref': '#/definitions/ModelInstanceTypesConstraints'}, + 'Result': {'$ref': '#/definitions/InstanceTypesResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddMachinesResults) + async def AddMachines(self, params=None): + ''' + 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=3, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyMachineResults) + async def DestroyMachine(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> DestroyMachineResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='DestroyMachine', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyMachineResults) + async def ForceDestroyMachine(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> DestroyMachineResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='ForceDestroyMachine', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InstanceTypesResults) + async def InstanceTypes(self, constraints=None): + ''' + 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=3, + params=_params) + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + +class MigrationMasterFacade(Type): + name = 'MigrationMaster' + version = 3 + 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'}, + 'MasterMigrationStatus': {'additionalProperties': False, + 'properties': {'migration-id': {'type': 'string'}, + 'phase': {'type': 'string'}, + 'phase-changed-time': {'format': 'date-time', + 'type': 'string'}, + 'spec': {'$ref': '#/definitions/MigrationSpec'}}, + 'required': ['spec', + 'migration-id', + 'phase', + 'phase-changed-time'], + 'type': 'object'}, + 'MigrationModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'controller-agent-version': {'$ref': '#/definitions/Number'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'name', + 'owner-tag', + 'agent-version', + 'controller-agent-version'], + 'type': 'object'}, + 'MigrationSpec': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'target-info': {'$ref': '#/definitions/MigrationTargetInfo'}}, + 'required': ['model-tag', 'target-info'], + 'type': 'object'}, + 'MigrationTargetInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'auth-tag': {'type': 'string'}, + 'ca-cert': {'type': 'string'}, + 'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}, + 'macaroons': {'type': 'string'}, + 'password': {'type': 'string'}}, + 'required': ['controller-tag', + 'addrs', + 'ca-cert', + 'auth-tag'], + 'type': 'object'}, + 'MinionReports': {'additionalProperties': False, + 'properties': {'failed': {'items': {'type': 'string'}, + 'type': 'array'}, + 'migration-id': {'type': 'string'}, + 'phase': {'type': 'string'}, + 'success-count': {'type': 'integer'}, + 'unknown-count': {'type': 'integer'}, + 'unknown-sample': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['migration-id', + 'phase', + 'success-count', + 'unknown-count', + 'unknown-sample', + 'failed'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'ProcessRelations': {'additionalProperties': False, + 'properties': {'controller-alias': {'type': 'string'}}, + 'required': ['controller-alias'], + 'type': 'object'}, + 'SerializedModel': {'additionalProperties': False, + 'properties': {'bytes': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'charms': {'items': {'type': 'string'}, + 'type': 'array'}, + 'resources': {'items': {'$ref': '#/definitions/SerializedModelResource'}, + 'type': 'array'}, + 'tools': {'items': {'$ref': '#/definitions/SerializedModelTools'}, + 'type': 'array'}}, + 'required': ['bytes', + 'charms', + 'tools', + 'resources'], + 'type': 'object'}, + 'SerializedModelResource': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'application-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, + 'charmstore-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, + 'name': {'type': 'string'}, + 'unit-revisions': {'patternProperties': {'.*': {'$ref': '#/definitions/SerializedModelResourceRevision'}}, + 'type': 'object'}}, + 'required': ['application', + 'name', + 'application-revision', + 'charmstore-revision', + 'unit-revisions'], + 'type': 'object'}, + 'SerializedModelResourceRevision': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'fingerprint': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}, + 'type': {'type': 'string'}, + 'username': {'type': 'string'}}, + 'required': ['revision', + 'type', + 'path', + 'description', + 'origin', + 'fingerprint', + 'size', + 'timestamp'], + 'type': 'object'}, + 'SerializedModelTools': {'additionalProperties': False, + 'properties': {'uri': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['version', 'uri'], + 'type': 'object'}, + 'SetMigrationPhaseArgs': {'additionalProperties': False, + 'properties': {'phase': {'type': 'string'}}, + 'required': ['phase'], + 'type': 'object'}, + 'SetMigrationStatusMessageArgs': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}}, + 'required': ['message'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'Export': {'description': 'Export serializes the model ' + 'associated with the API connection.', + 'properties': {'Result': {'$ref': '#/definitions/SerializedModel'}}, + 'type': 'object'}, + 'MigrationStatus': {'description': 'MigrationStatus returns ' + 'the details and progress ' + 'of the latest\n' + 'model migration.', + 'properties': {'Result': {'$ref': '#/definitions/MasterMigrationStatus'}}, + 'type': 'object'}, + 'MinionReportTimeout': {'description': 'MinionReportTimeout ' + 'returns the ' + 'configuration value ' + 'for this controller ' + 'that\n' + 'indicates how long the ' + 'migration master ' + 'worker should wait for ' + 'minions to\n' + 'reported on phases of ' + 'a migration.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'MinionReports': {'description': 'MinionReports returns ' + 'details of the reports made ' + 'by migration\n' + 'minions to the controller ' + 'for the current migration ' + 'phase.', + 'properties': {'Result': {'$ref': '#/definitions/MinionReports'}}, + 'type': 'object'}, + 'ModelInfo': {'description': 'ModelInfo returns essential ' + 'information about the model to ' + 'be\n' + 'migrated.', + 'properties': {'Result': {'$ref': '#/definitions/MigrationModelInfo'}}, + 'type': 'object'}, + 'Prechecks': {'description': 'Prechecks performs pre-migration ' + 'checks on the model and\n' + '(source) controller.', + 'type': 'object'}, + 'ProcessRelations': {'description': 'ProcessRelations ' + 'processes any relations ' + 'that need updating after ' + 'an export.\n' + 'This should help fix any ' + 'remoteApplications that ' + 'have been migrated.', + 'properties': {'Params': {'$ref': '#/definitions/ProcessRelations'}}, + 'type': 'object'}, + 'Reap': {'description': 'Reap removes all documents for the ' + 'model associated with the API\n' + 'connection.', + 'type': 'object'}, + 'SetPhase': {'description': 'SetPhase sets the phase of the ' + 'active model migration. The ' + 'provided\n' + 'phase must be a valid phase ' + 'value, for example QUIESCE" or\n' + '"ABORT". See the core/migration ' + 'package for the complete list.', + 'properties': {'Params': {'$ref': '#/definitions/SetMigrationPhaseArgs'}}, + 'type': 'object'}, + 'SetStatusMessage': {'description': 'SetStatusMessage sets a ' + 'human readable status ' + 'message containing\n' + 'information about the ' + "migration's progress. " + 'This will be shown in\n' + 'status output shown to ' + 'the end user.', + 'properties': {'Params': {'$ref': '#/definitions/SetMigrationStatusMessageArgs'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts watching for an active ' + 'migration for the model\n' + 'associated with the API connection. ' + 'The returned id should be used\n' + 'with the NotifyWatcher facade to ' + 'receive events.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchMinionReports': {'description': 'WatchMinionReports sets ' + 'up a watcher which ' + 'reports when a report\n' + 'for a migration minion ' + 'has arrived.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(SerializedModel) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(MasterMigrationStatus) + async def MigrationStatus(self): + ''' + MigrationStatus returns the details and progress of the latest + model migration. + + + Returns -> MasterMigrationStatus + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='MigrationStatus', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(MinionReports) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(MigrationModelInfo) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Prechecks(self): + ''' + Prechecks performs pre-migration checks on the model and + (source) controller. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='MigrationMaster', + request='Prechecks', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + +class ModelGenerationFacade(Type): + name = 'ModelGeneration' + version = 3 + schema = {'definitions': {'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BranchArg': {'additionalProperties': False, + 'properties': {'branch': {'type': 'string'}}, + 'required': ['branch'], + 'type': 'object'}, + 'BranchInfoArgs': {'additionalProperties': False, + 'properties': {'branches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'detailed': {'type': 'boolean'}}, + 'required': ['branches', 'detailed'], + 'type': 'object'}, + 'BranchTrackArg': {'additionalProperties': False, + 'properties': {'branch': {'type': 'string'}, + 'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'num-units': {'type': 'integer'}}, + 'required': ['branch', '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'}, + 'Generation': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/GenerationApplication'}, + 'type': 'array'}, + 'branch': {'type': 'string'}, + 'created': {'type': 'integer'}, + 'created-by': {'type': 'string'}}, + 'required': ['branch', + 'created', + 'created-by', + 'applications'], + 'type': 'object'}, + 'GenerationApplication': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'pending': {'items': {'type': 'string'}, + 'type': 'array'}, + 'progress': {'type': 'string'}, + 'tracking': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', + 'progress', + 'config'], + 'type': 'object'}, + 'GenerationResults': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'generations': {'items': {'$ref': '#/definitions/Generation'}, + 'type': 'array'}}, + 'required': ['generations'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'AbortBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'AddBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'BranchInfo': {'properties': {'Params': {'$ref': '#/definitions/BranchInfoArgs'}, + 'Result': {'$ref': '#/definitions/GenerationResults'}}, + 'type': 'object'}, + 'CommitBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/IntResult'}}, + 'type': 'object'}, + 'HasActiveBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/BoolResult'}}, + 'type': 'object'}, + 'TrackBranch': {'properties': {'Params': {'$ref': '#/definitions/BranchTrackArg'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def AbortBranch(self, branch=None): + ''' + 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=3, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + async def AddBranch(self, branch=None): + ''' + 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=3, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GenerationResults) + async def BranchInfo(self, branches=None, detailed=None): + ''' + branches : typing.Sequence[str] + detailed : bool + Returns -> GenerationResults + ''' + 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=3, + params=_params) + _params['branches'] = branches + _params['detailed'] = detailed + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResult) + async def CommitBranch(self, branch=None): + ''' + 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=3, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResult) + async def HasActiveBranch(self, branch=None): + ''' + 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=3, + params=_params) + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def TrackBranch(self, branch=None, entities=None, num_units=None): + ''' + 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=3, + params=_params) + _params['branch'] = branch + _params['entities'] = entities + _params['num-units'] = num_units + reply = await self.rpc(msg) + return reply + + + +class ModelManagerFacade(Type): + name = 'ModelManager' + version = 3 + schema = {'definitions': {'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': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachineHardware': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + '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'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'owner-tag'], + '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'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'cloud-credential-tag': {'type': 'string'}, + 'cloud-region': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'controller-uuid': {'type': 'string'}, + 'default-series': {'type': 'string'}, + 'life': {'type': 'string'}, + 'machines': {'items': {'$ref': '#/definitions/ModelMachineInfo'}, + 'type': 'array'}, + 'migration': {'$ref': '#/definitions/ModelMigrationStatus'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'provider-type': {'type': 'string'}, + 'sla': {'$ref': '#/definitions/ModelSLAInfo'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'users': {'items': {'$ref': '#/definitions/ModelUserInfo'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', + 'uuid', + 'controller-uuid', + 'cloud-tag', + 'owner-tag', + 'life', + 'users', + 'machines', + 'sla', + 'agent-version'], + 'type': 'object'}, + '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': {'hardware': {'$ref': '#/definitions/MachineHardware'}, + 'has-vote': {'type': 'boolean'}, + 'id': {'type': 'string'}, + 'instance-id': {'type': 'string'}, + 'status': {'type': 'string'}, + 'wants-vote': {'type': 'boolean'}}, + 'required': ['id'], + 'type': 'object'}, + 'ModelMigrationStatus': {'additionalProperties': False, + 'properties': {'end': {'format': 'date-time', + 'type': 'string'}, + 'start': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'start'], + 'type': 'object'}, + 'ModelSLAInfo': {'additionalProperties': False, + 'properties': {'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', 'owner'], + 'type': 'object'}, + 'ModelStatus': {'additionalProperties': False, + 'properties': {'application-count': {'type': 'integer'}, + 'hosted-machine-count': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'machines': {'items': {'$ref': '#/definitions/ModelMachineInfo'}, + 'type': 'array'}, + 'model-tag': {'type': 'string'}, + 'owner-tag': {'type': 'string'}}, + 'required': ['model-tag', + 'life', + 'hosted-machine-count', + 'application-count', + 'owner-tag'], + 'type': 'object'}, + 'ModelStatusResults': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/ModelStatus'}, + 'type': 'array'}}, + 'required': ['models'], + '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'}, + 'user': {'type': 'string'}}, + 'required': ['user', + 'display-name', + 'last-connection', + 'access'], + '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'}, + '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'}, + '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': {'CreateModel': {'properties': {'Params': {'$ref': '#/definitions/ModelCreateArgs'}, + 'Result': {'$ref': '#/definitions/ModelInfo'}}, + 'type': 'object'}, + 'DestroyModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DumpModels': {'properties': {'Params': {'$ref': '#/definitions/DumpModelRequest'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'DumpModelsDB': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MapResults'}}, + 'type': 'object'}, + 'ListModels': {'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/UserModelList'}}, + 'type': 'object'}, + 'ModelDefaults': {'properties': {'Result': {'$ref': '#/definitions/ModelDefaultsResult'}}, + 'type': 'object'}, + 'ModelInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelInfoResults'}}, + 'type': 'object'}, + 'ModelStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelStatusResults'}}, + 'type': 'object'}, + 'ModifyModelAccess': {'properties': {'Params': {'$ref': '#/definitions/ModifyModelAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModelDefaults': {'properties': {'Params': {'$ref': '#/definitions/SetModelDefaults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UnsetModelDefaults': {'properties': {'Params': {'$ref': '#/definitions/UnsetModelDefaults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ModelInfo) + async def CreateModel(self, cloud_tag=None, config=None, credential=None, name=None, owner_tag=None, region=None): + ''' + 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=3, + 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, entities=None): + ''' + 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='ModelManager', + request='DestroyModels', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def DumpModels(self, entities=None, simplified=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + _params['simplified'] = simplified + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MapResults) + async def DumpModelsDB(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UserModelList) + async def ListModels(self, tag=None): + ''' + 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=3, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelDefaultsResult) + async def ModelDefaults(self): + ''' + + Returns -> ModelDefaultsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModelDefaults', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelInfoResults) + async def ModelInfo(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelStatusResults) + async def ModelStatus(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyModelAccess(self, changes=None): + ''' + 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=3, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModelDefaults(self, config=None): + ''' + 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=3, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UnsetModelDefaults(self, keys=None): + ''' + 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=3, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + + +class ProvisionerFacade(Type): + name = 'Provisioner' + version = 3 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'Binary': {'additionalProperties': False, + 'properties': {'Arch': {'type': 'string'}, + 'Number': {'$ref': '#/definitions/Number'}, + 'Series': {'type': 'string'}}, + 'required': ['Number', 'Series', 'Arch'], + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'CloudImageMetadata': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'image-id': {'type': 'string'}, + 'priority': {'type': 'integer'}, + 'region': {'type': 'string'}, + 'root-storage-size': {'type': 'integer'}, + 'root-storage-type': {'type': 'string'}, + 'series': {'type': 'string'}, + 'source': {'type': 'string'}, + 'stream': {'type': 'string'}, + 'version': {'type': 'string'}, + 'virt-type': {'type': 'string'}}, + 'required': ['image-id', + 'region', + 'version', + 'series', + 'arch', + 'source', + 'priority'], + 'type': 'object'}, + 'ConstraintsResult': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'ConstraintsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConstraintsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ContainerConfig': {'additionalProperties': False, + 'properties': {'UpdateBehavior': {'$ref': '#/definitions/UpdateBehavior'}, + 'apt-mirror': {'type': 'string'}, + 'apt-proxy': {'$ref': '#/definitions/Settings'}, + 'authorized-keys': {'type': 'string'}, + 'provider-type': {'type': 'string'}, + 'proxy': {'$ref': '#/definitions/Settings'}, + 'ssl-hostname-verification': {'type': 'boolean'}}, + 'required': ['provider-type', + 'authorized-keys', + 'ssl-hostname-verification', + 'proxy', + 'apt-proxy', + 'apt-mirror', + 'UpdateBehavior'], + 'type': 'object'}, + 'ContainerManagerConfig': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ContainerManagerConfigParams': {'additionalProperties': False, + 'properties': {'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'DeviceBridgeInfo': {'additionalProperties': False, + 'properties': {'bridge-name': {'type': 'string'}, + 'host-device-name': {'type': 'string'}}, + 'required': ['host-device-name', + 'bridge-name'], + 'type': 'object'}, + 'DistributionGroupResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'DistributionGroupResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/DistributionGroupResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'FindToolsParams': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'major': {'type': 'integer'}, + 'minor': {'type': 'integer'}, + 'number': {'$ref': '#/definitions/Number'}, + 'series': {'type': 'string'}}, + 'required': ['number', + 'major', + 'minor', + 'arch', + 'series'], + 'type': 'object'}, + 'FindToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'list': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['list'], + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'HostNetworkChange': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'new-bridges': {'items': {'$ref': '#/definitions/DeviceBridgeInfo'}, + 'type': 'array'}, + 'reconfigure-delay': {'type': 'integer'}}, + 'required': ['new-bridges', + 'reconfigure-delay'], + 'type': 'object'}, + 'HostNetworkChangeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/HostNetworkChange'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}}, + 'required': ['Address', 'port'], + 'type': 'object'}, + 'InstanceInfo': {'additionalProperties': False, + 'properties': {'characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'instance-id': {'type': 'string'}, + 'network-config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'volume-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/VolumeAttachmentInfo'}}, + 'type': 'object'}, + 'volumes': {'items': {'$ref': '#/definitions/Volume'}, + 'type': 'array'}}, + 'required': ['tag', + 'instance-id', + 'nonce', + 'characteristics', + 'volumes', + 'volume-attachments', + 'network-config'], + 'type': 'object'}, + 'InstancesInfo': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/InstanceInfo'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachineContainers': {'additionalProperties': False, + 'properties': {'container-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'container-types'], + 'type': 'object'}, + 'MachineContainersParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MachineContainers'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MachineNetworkConfigResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}}, + 'required': ['info'], + 'type': 'object'}, + 'MachineNetworkConfigResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineNetworkConfigResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + 'parent-interface-name': {'type': 'string'}, + 'provider-address-id': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'provider-subnet-id': {'type': 'string'}, + 'provider-vlan-id': {'type': 'string'}, + 'routes': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'vlan-tag': {'type': 'integer'}}, + 'required': ['device-index', + 'mac-address', + 'cidr', + 'mtu', + 'provider-id', + 'provider-subnet-id', + 'provider-space-id', + 'provider-address-id', + 'provider-vlan-id', + 'vlan-tag', + 'interface-name', + 'parent-interface-name', + 'interface-type', + 'disabled'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + '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'}, + 'ProvisioningInfo': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}, + 'controller-config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'image-metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'placement': {'type': 'string'}, + 'series': {'type': 'string'}, + 'subnets-to-zones': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'type': 'array'}, + 'volumes': {'items': {'$ref': '#/definitions/VolumeParams'}, + 'type': 'array'}}, + 'required': ['constraints', + 'series', + 'placement', + 'jobs'], + 'type': 'object'}, + 'ProvisioningInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ProvisioningInfo'}}, + 'required': ['result'], + 'type': 'object'}, + 'ProvisioningInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProvisioningInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetMachineNetworkConfig': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'config'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Settings': {'additionalProperties': False, + 'properties': {'AutoNoProxy': {'type': 'string'}, + 'Ftp': {'type': 'string'}, + 'Http': {'type': 'string'}, + 'Https': {'type': 'string'}, + 'NoProxy': {'type': 'string'}}, + 'required': ['Http', + 'Https', + 'Ftp', + 'NoProxy', + 'AutoNoProxy'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'ToolsResult': {'additionalProperties': False, + 'properties': {'disable-ssl-hostname-verification': {'type': 'boolean'}, + 'error': {'$ref': '#/definitions/Error'}, + 'tools': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['tools', + 'disable-ssl-hostname-verification'], + 'type': 'object'}, + 'ToolsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ToolsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateBehavior': {'additionalProperties': False, + 'properties': {'enable-os-refresh-update': {'type': 'boolean'}, + 'enable-os-upgrade': {'type': 'boolean'}}, + 'required': ['enable-os-refresh-update', + 'enable-os-upgrade'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'spaces': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}}, + 'type': 'object'}, + 'Volume': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', 'info'], + 'type': 'object'}, + 'VolumeAttachmentInfo': {'additionalProperties': False, + 'properties': {'bus-address': {'type': 'string'}, + 'device-link': {'type': 'string'}, + 'device-name': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'VolumeAttachmentParams': {'additionalProperties': False, + 'properties': {'instance-id': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}, + 'volume-id': {'type': 'string'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'provider'], + 'type': 'object'}, + 'VolumeInfo': {'additionalProperties': False, + 'properties': {'hardware-id': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'volume-id': {'type': 'string'}, + 'wwn': {'type': 'string'}}, + 'required': ['volume-id', 'size', 'persistent'], + 'type': 'object'}, + 'VolumeParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'size', + 'provider'], + 'type': 'object'}, + 'WatchContainer': {'additionalProperties': False, + 'properties': {'container-type': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'container-type'], + 'type': 'object'}, + 'WatchContainers': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/WatchContainer'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}}, + 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'CACert': {'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'Constraints': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConstraintsResults'}}, + 'type': 'object'}, + 'ContainerConfig': {'properties': {'Result': {'$ref': '#/definitions/ContainerConfig'}}, + 'type': 'object'}, + 'ContainerManagerConfig': {'properties': {'Params': {'$ref': '#/definitions/ContainerManagerConfigParams'}, + 'Result': {'$ref': '#/definitions/ContainerManagerConfig'}}, + 'type': 'object'}, + 'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'DistributionGroup': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DistributionGroupResults'}}, + 'type': 'object'}, + 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FindTools': {'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, + 'Result': {'$ref': '#/definitions/FindToolsResult'}}, + 'type': 'object'}, + 'GetContainerInterfaceInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineNetworkConfigResults'}}, + 'type': 'object'}, + 'HostChangesForContainers': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/HostNetworkChangeResults'}}, + 'type': 'object'}, + 'InstanceId': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'InstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'MachinesWithTransientErrors': {'properties': {'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'MarkMachinesForRemoval': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PrepareContainerInterfaceInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineNetworkConfigResults'}}, + 'type': 'object'}, + 'ProvisioningInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ProvisioningInfoResults'}}, + 'type': 'object'}, + 'ReleaseContainerAddresses': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Remove': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Series': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'SetHostMachineNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetInstanceInfo': {'properties': {'Params': {'$ref': '#/definitions/InstancesInfo'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetInstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetObservedNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetPasswords': {'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetProviderNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetSupportedContainers': {'properties': {'Params': {'$ref': '#/definitions/MachineContainersParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StateAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'Status': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'Tools': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ToolsResults'}}, + 'type': 'object'}, + 'UpdateStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchAllContainers': {'properties': {'Params': {'$ref': '#/definitions/WatchContainers'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchContainers': {'properties': {'Params': {'$ref': '#/definitions/WatchContainers'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchMachineErrorRetry': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='APIAddresses', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='APIHostPorts', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BytesResult) + async def CACert(self): + ''' + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='CACert', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConstraintsResults) + async def Constraints(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerConfig) + async def ContainerConfig(self): + ''' + + Returns -> ContainerConfig + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ContainerConfig', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerManagerConfig) + async def ContainerManagerConfig(self, type_=None): + ''' + 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=3, + params=_params) + _params['type'] = type_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ControllerConfig', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DistributionGroupResults) + async def DistributionGroup(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindToolsResult) + async def FindTools(self, arch=None, major=None, minor=None, number=None, series=None): + ''' + arch : str + major : int + minor : int + number : Number + series : str + Returns -> FindToolsResult + ''' + 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 minor is not None and not isinstance(minor, int): + raise Exception("Expected minor to be a int, received: {}".format(type(minor))) + + if number is not None and not isinstance(number, (dict, Number)): + raise Exception("Expected number to be a Number, received: {}".format(type(number))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='FindTools', + version=3, + params=_params) + _params['arch'] = arch + _params['major'] = major + _params['minor'] = minor + _params['number'] = number + _params['series'] = series + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) + async def GetContainerInterfaceInfo(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(HostNetworkChangeResults) + async def HostChangesForContainers(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def InstanceStatus(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def MachinesWithTransientErrors(self): + ''' + + Returns -> StatusResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='MachinesWithTransientErrors', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def MarkMachinesForRemoval(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelConfig', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelUUID', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) + async def PrepareContainerInterfaceInfo(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProvisioningInfoResults) + async def ProvisioningInfo(self, entities=None): + ''' + 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='ProvisioningInfo', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ReleaseContainerAddresses(self, entities=None): + ''' + 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='ReleaseContainerAddresses', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Remove(self, entities=None): + ''' + 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='Remove', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def Series(self, entities=None): + ''' + 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='Series', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=3, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceInfo(self, machines=None): + ''' + 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=3, + params=_params) + _params['machines'] = machines + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceStatus(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetObservedNetworkConfig(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='SetObservedNetworkConfig', + version=3, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): + ''' + 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=3, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetProviderNetworkConfig(self, entities=None): + ''' + 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='SetProviderNetworkConfig', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetSupportedContainers(self, params=None): + ''' + 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=3, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResult) + async def StateAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='StateAddresses', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def Status(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ToolsResults) + async def 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='Provisioner', + request='Tools', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateStatus(self, entities=None): + ''' + 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='UpdateStatus', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchAPIHostPorts', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchAllContainers(self, params=None): + ''' + 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=3, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchContainers(self, params=None): + ''' + 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=3, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchForModelConfigChanges', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchMachineErrorRetry(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchMachineErrorRetry', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachines(self): + ''' + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchModelMachines', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class SSHClientFacade(Type): + name = 'SSHClient' + version = 3 + 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'}, + 'SSHAddressResult': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'SSHAddressResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SSHAddressesResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses'], + 'type': 'object'}, + 'SSHAddressesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SSHProxyResult': {'additionalProperties': False, + 'properties': {'use-proxy': {'type': 'boolean'}}, + 'required': ['use-proxy'], + 'type': 'object'}, + 'SSHPublicKeysResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'public-keys': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SSHPublicKeysResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SSHPublicKeysResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'AllAddresses': {'description': 'AllAddresses reports all ' + 'addresses that might have SSH ' + 'listening for each given\n' + 'entity in args. Machines and ' + 'units are supported as entity ' + 'types.\n' + 'TODO(wpk): 2017-05-17 This is ' + 'a temporary solution, we ' + 'should not fetch environ ' + 'here\n' + 'but get the addresses from ' + 'state. We will be changing it ' + 'since we want to have ' + 'space-aware\n' + 'SSH settings.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHAddressesResults'}}, + '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'}, + 'PrivateAddress': {'description': 'PrivateAddress reports the ' + 'preferred private network ' + 'address for one or\n' + 'more entities. Machines and ' + 'units are supported.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHAddressResults'}}, + 'type': 'object'}, + 'Proxy': {'description': 'Proxy returns whether SSH ' + 'connections should be proxied ' + 'through the\n' + 'controller hosts for the model ' + 'associated with the API connection.', + 'properties': {'Result': {'$ref': '#/definitions/SSHProxyResult'}}, + 'type': 'object'}, + 'PublicAddress': {'description': 'PublicAddress reports the ' + 'preferred public network ' + 'address for one\n' + 'or more entities. Machines ' + 'and units are supported.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHAddressResults'}}, + 'type': 'object'}, + 'PublicKeys': {'description': 'PublicKeys returns the public ' + 'SSH hosts for one or more\n' + 'entities. Machines and units ' + 'are supported.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHPublicKeysResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(SSHAddressesResults) + async def AllAddresses(self, entities=None): + ''' + AllAddresses reports all addresses that might have SSH listening for each given + entity in args. Machines and units are supported as entity types. + TODO(wpk): 2017-05-17 This is a temporary solution, we should not fetch environ here + but get the addresses from state. We will be changing it since we want to have space-aware + SSH settings. + + 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=3, + 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='SSHClient', + request='Leader', + version=3, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHAddressResults) + async def 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHProxyResult) + async def 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=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHAddressResults) + async def 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SSHPublicKeysResults) + async def 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class SpacesFacade(Type): + name = 'Spaces' + version = 3 + schema = {'definitions': {'CreateSpaceParams': {'additionalProperties': False, + 'properties': {'provider-id': {'type': 'string'}, + 'public': {'type': 'boolean'}, + 'space-tag': {'type': 'string'}, + 'subnet-tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['subnet-tags', + 'space-tag', + 'public'], + 'type': 'object'}, + 'CreateSpacesParams': {'additionalProperties': False, + 'properties': {'spaces': {'items': {'$ref': '#/definitions/CreateSpaceParams'}, + 'type': 'array'}}, + 'required': ['spaces'], + 'type': 'object'}, + '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'}, + 'ListSpacesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/Space'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Space': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['name', 'subnets'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}}, + 'properties': {'CreateSpaces': {'properties': {'Params': {'$ref': '#/definitions/CreateSpacesParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ListSpaces': {'properties': {'Result': {'$ref': '#/definitions/ListSpacesResults'}}, + 'type': 'object'}, + 'ReloadSpaces': {'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def CreateSpaces(self, spaces=None): + ''' + 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=3, + params=_params) + _params['spaces'] = spaces + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListSpacesResults) + async def ListSpaces(self): + ''' + + Returns -> ListSpacesResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Spaces', + request='ListSpaces', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ReloadSpaces(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Spaces', + request='ReloadSpaces', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class StorageFacade(Type): + name = 'Storage' + version = 3 + 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'}, + 'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'FilesystemAttachmentDetails': {'additionalProperties': False, + 'properties': {'FilesystemAttachmentInfo': {'$ref': '#/definitions/FilesystemAttachmentInfo'}, + 'life': {'type': 'string'}}, + 'required': ['FilesystemAttachmentInfo'], + 'type': 'object'}, + 'FilesystemAttachmentInfo': {'additionalProperties': False, + 'properties': {'mount-point': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'FilesystemDetails': {'additionalProperties': False, + 'properties': {'filesystem-tag': {'type': 'string'}, + 'info': {'$ref': '#/definitions/FilesystemInfo'}, + 'life': {'type': 'string'}, + 'machine-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/FilesystemAttachmentDetails'}}, + 'type': 'object'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'storage': {'$ref': '#/definitions/StorageDetails'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['filesystem-tag', + 'info', + 'status'], + 'type': 'object'}, + 'FilesystemDetailsListResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'$ref': '#/definitions/FilesystemDetails'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemDetailsListResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemDetailsListResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemFilter': {'additionalProperties': False, + 'properties': {'machines': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemFilters': {'additionalProperties': False, + 'properties': {'filters': {'items': {'$ref': '#/definitions/FilesystemFilter'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemInfo': {'additionalProperties': False, + 'properties': {'filesystem-id': {'type': 'string'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'required': ['filesystem-id', + 'pool', + 'size'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'StorageAddParams': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'storage': {'$ref': '#/definitions/StorageConstraints'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'name', 'storage'], + 'type': 'object'}, + 'StorageAttachmentDetails': {'additionalProperties': False, + 'properties': {'life': {'type': 'string'}, + 'location': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag', + 'machine-tag'], + 'type': 'object'}, + 'StorageAttachmentId': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag'], + 'type': 'object'}, + 'StorageAttachmentIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/StorageAttachmentId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StorageDetails': {'additionalProperties': False, + 'properties': {'attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/StorageAttachmentDetails'}}, + 'type': 'object'}, + 'kind': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'storage-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'owner-tag', + 'kind', + 'status', + 'persistent'], + 'type': 'object'}, + 'StorageDetailsListResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'$ref': '#/definitions/StorageDetails'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageDetailsListResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageDetailsListResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageDetailsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageDetails'}}, + 'type': 'object'}, + 'StorageDetailsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageDetailsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageFilter': {'additionalProperties': False, + 'type': 'object'}, + 'StorageFilters': {'additionalProperties': False, + 'properties': {'filters': {'items': {'$ref': '#/definitions/StorageFilter'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragePool': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'name': {'type': 'string'}, + 'provider': {'type': 'string'}}, + 'required': ['name', 'provider', 'attrs'], + 'type': 'object'}, + 'StoragePoolFilter': {'additionalProperties': False, + 'properties': {'names': {'items': {'type': 'string'}, + 'type': 'array'}, + 'providers': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragePoolFilters': {'additionalProperties': False, + 'properties': {'filters': {'items': {'$ref': '#/definitions/StoragePoolFilter'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragePoolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'storage-pools': {'items': {'$ref': '#/definitions/StoragePool'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragePoolsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StoragePoolsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragesAddParams': {'additionalProperties': False, + 'properties': {'storages': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}}, + 'required': ['storages'], + 'type': 'object'}, + 'VolumeAttachmentDetails': {'additionalProperties': False, + 'properties': {'VolumeAttachmentInfo': {'$ref': '#/definitions/VolumeAttachmentInfo'}, + 'life': {'type': 'string'}}, + 'required': ['VolumeAttachmentInfo'], + 'type': 'object'}, + 'VolumeAttachmentInfo': {'additionalProperties': False, + 'properties': {'bus-address': {'type': 'string'}, + 'device-link': {'type': 'string'}, + 'device-name': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'VolumeDetails': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeInfo'}, + 'life': {'type': 'string'}, + 'machine-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/VolumeAttachmentDetails'}}, + 'type': 'object'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'storage': {'$ref': '#/definitions/StorageDetails'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', 'info', 'status'], + 'type': 'object'}, + 'VolumeDetailsListResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'$ref': '#/definitions/VolumeDetails'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeDetailsListResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeDetailsListResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeFilter': {'additionalProperties': False, + 'properties': {'machines': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeFilters': {'additionalProperties': False, + 'properties': {'filters': {'items': {'$ref': '#/definitions/VolumeFilter'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeInfo': {'additionalProperties': False, + 'properties': {'hardware-id': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'volume-id': {'type': 'string'}, + 'wwn': {'type': 'string'}}, + 'required': ['volume-id', 'size', 'persistent'], + 'type': 'object'}}, + 'properties': {'AddToUnit': {'properties': {'Params': {'$ref': '#/definitions/StoragesAddParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Attach': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CreatePool': {'properties': {'Params': {'$ref': '#/definitions/StoragePool'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Detach': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ListFilesystems': {'properties': {'Params': {'$ref': '#/definitions/FilesystemFilters'}, + 'Result': {'$ref': '#/definitions/FilesystemDetailsListResults'}}, + 'type': 'object'}, + 'ListPools': {'properties': {'Params': {'$ref': '#/definitions/StoragePoolFilters'}, + 'Result': {'$ref': '#/definitions/StoragePoolsResults'}}, + 'type': 'object'}, + 'ListStorageDetails': {'properties': {'Params': {'$ref': '#/definitions/StorageFilters'}, + 'Result': {'$ref': '#/definitions/StorageDetailsListResults'}}, + 'type': 'object'}, + 'ListVolumes': {'properties': {'Params': {'$ref': '#/definitions/VolumeFilters'}, + 'Result': {'$ref': '#/definitions/VolumeDetailsListResults'}}, + 'type': 'object'}, + 'StorageDetails': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StorageDetailsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def AddToUnit(self, storages=None): + ''' + storages : typing.Sequence[~StorageAddParams] + Returns -> ErrorResults + ''' + 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=3, + params=_params) + _params['storages'] = storages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Attach(self, ids=None): + ''' + 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=3, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def CreatePool(self, attrs=None, name=None, provider=None): + ''' + attrs : typing.Mapping[str, typing.Any] + name : str + provider : str + Returns -> None + ''' + if attrs is not None and not isinstance(attrs, dict): + raise Exception("Expected attrs to be a Mapping, received: {}".format(type(attrs))) + + if name is not None and not isinstance(name, (bytes, str)): + raise Exception("Expected name to be a str, received: {}".format(type(name))) + + if provider is not None and not isinstance(provider, (bytes, str)): + raise Exception("Expected provider to be a str, received: {}".format(type(provider))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='CreatePool', + version=3, + params=_params) + _params['attrs'] = attrs + _params['name'] = name + _params['provider'] = provider + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Destroy(self, entities=None): + ''' + 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='Storage', + request='Destroy', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Detach(self, ids=None): + ''' + 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='Detach', + version=3, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemDetailsListResults) + async def ListFilesystems(self, filters=None): + ''' + 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=3, + params=_params) + _params['filters'] = filters + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StoragePoolsResults) + async def ListPools(self, filters=None): + ''' + 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=3, + params=_params) + _params['filters'] = filters + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageDetailsListResults) + async def ListStorageDetails(self, filters=None): + ''' + 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=3, + params=_params) + _params['filters'] = filters + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeDetailsListResults) + async def ListVolumes(self, filters=None): + ''' + 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=3, + params=_params) + _params['filters'] = filters + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageDetailsResults) + async def StorageDetails(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class StorageProvisionerFacade(Type): + name = 'StorageProvisioner' + version = 3 + schema = {'definitions': {'BlockDevice': {'additionalProperties': False, + 'properties': {'BusAddress': {'type': 'string'}, + 'DeviceLinks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'DeviceName': {'type': 'string'}, + 'FilesystemType': {'type': 'string'}, + 'HardwareId': {'type': 'string'}, + 'InUse': {'type': 'boolean'}, + 'Label': {'type': 'string'}, + 'MountPoint': {'type': 'string'}, + 'Size': {'type': 'integer'}, + 'UUID': {'type': 'string'}, + 'WWN': {'type': 'string'}}, + 'required': ['DeviceName', + 'DeviceLinks', + 'Label', + 'UUID', + 'HardwareId', + 'WWN', + 'BusAddress', + 'Size', + 'FilesystemType', + 'InUse', + 'MountPoint'], + 'type': 'object'}, + 'BlockDeviceResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/BlockDevice'}}, + 'required': ['result'], + 'type': 'object'}, + 'BlockDeviceResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BlockDeviceResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Filesystem': {'additionalProperties': False, + 'properties': {'filesystem-tag': {'type': 'string'}, + 'info': {'$ref': '#/definitions/FilesystemInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['filesystem-tag', 'info'], + 'type': 'object'}, + 'FilesystemAttachment': {'additionalProperties': False, + 'properties': {'filesystem-tag': {'type': 'string'}, + 'info': {'$ref': '#/definitions/FilesystemAttachmentInfo'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['filesystem-tag', + 'machine-tag', + 'info'], + 'type': 'object'}, + 'FilesystemAttachmentInfo': {'additionalProperties': False, + 'properties': {'mount-point': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'FilesystemAttachmentParams': {'additionalProperties': False, + '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'}}, + 'required': ['filesystem-tag', + 'machine-tag', + 'provider'], + 'type': 'object'}, + 'FilesystemAttachmentParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/FilesystemAttachmentParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'FilesystemAttachmentParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemAttachmentParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/FilesystemAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'FilesystemAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemAttachments': {'additionalProperties': False, + 'properties': {'filesystem-attachments': {'items': {'$ref': '#/definitions/FilesystemAttachment'}, + 'type': 'array'}}, + 'required': ['filesystem-attachments'], + 'type': 'object'}, + 'FilesystemInfo': {'additionalProperties': False, + 'properties': {'filesystem-id': {'type': 'string'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'required': ['filesystem-id', + 'pool', + 'size'], + 'type': 'object'}, + 'FilesystemParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/FilesystemAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'filesystem-tag': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['filesystem-tag', + 'size', + 'provider'], + 'type': 'object'}, + 'FilesystemParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/FilesystemParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'FilesystemParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/Filesystem'}}, + 'required': ['result'], + 'type': 'object'}, + 'FilesystemResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Filesystems': {'additionalProperties': False, + 'properties': {'filesystems': {'items': {'$ref': '#/definitions/Filesystem'}, + 'type': 'array'}}, + 'required': ['filesystems'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachineStorageId': {'additionalProperties': False, + 'properties': {'attachment-tag': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'attachment-tag'], + 'type': 'object'}, + 'MachineStorageIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/MachineStorageId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'MachineStorageIdsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'MachineStorageIdsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Volume': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', 'info'], + 'type': 'object'}, + 'VolumeAttachment': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeAttachmentInfo'}, + 'machine-tag': {'type': 'string'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'info'], + 'type': 'object'}, + 'VolumeAttachmentInfo': {'additionalProperties': False, + 'properties': {'bus-address': {'type': 'string'}, + 'device-link': {'type': 'string'}, + 'device-name': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'VolumeAttachmentParams': {'additionalProperties': False, + 'properties': {'instance-id': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}, + 'volume-id': {'type': 'string'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'provider'], + 'type': 'object'}, + 'VolumeAttachmentParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/VolumeAttachmentParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeAttachmentParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeAttachmentParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/VolumeAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeAttachments': {'additionalProperties': False, + 'properties': {'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachment'}, + 'type': 'array'}}, + 'required': ['volume-attachments'], + 'type': 'object'}, + 'VolumeInfo': {'additionalProperties': False, + 'properties': {'hardware-id': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'volume-id': {'type': 'string'}, + 'wwn': {'type': 'string'}}, + 'required': ['volume-id', 'size', 'persistent'], + 'type': 'object'}, + 'VolumeParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'size', + 'provider'], + 'type': 'object'}, + 'VolumeParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/VolumeParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/Volume'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Volumes': {'additionalProperties': False, + 'properties': {'volumes': {'items': {'$ref': '#/definitions/Volume'}, + 'type': 'array'}}, + 'required': ['volumes'], + 'type': 'object'}}, + 'properties': {'AttachmentLife': {'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FilesystemAttachmentParams': {'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/FilesystemAttachmentParamsResults'}}, + 'type': 'object'}, + 'FilesystemAttachments': {'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/FilesystemAttachmentResults'}}, + 'type': 'object'}, + 'FilesystemParams': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/FilesystemParamsResults'}}, + 'type': 'object'}, + 'Filesystems': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/FilesystemResults'}}, + 'type': 'object'}, + 'InstanceId': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'Remove': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveAttachment': {'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetFilesystemAttachmentInfo': {'properties': {'Params': {'$ref': '#/definitions/FilesystemAttachments'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetFilesystemInfo': {'properties': {'Params': {'$ref': '#/definitions/Filesystems'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetVolumeAttachmentInfo': {'properties': {'Params': {'$ref': '#/definitions/VolumeAttachments'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetVolumeInfo': {'properties': {'Params': {'$ref': '#/definitions/Volumes'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'VolumeAttachmentParams': {'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/VolumeAttachmentParamsResults'}}, + 'type': 'object'}, + 'VolumeAttachments': {'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/VolumeAttachmentResults'}}, + 'type': 'object'}, + 'VolumeBlockDevices': {'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/BlockDeviceResults'}}, + 'type': 'object'}, + 'VolumeParams': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/VolumeParamsResults'}}, + 'type': 'object'}, + 'Volumes': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/VolumeResults'}}, + 'type': 'object'}, + 'WatchBlockDevices': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchFilesystemAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResults'}}, + 'type': 'object'}, + 'WatchFilesystems': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchMachines': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchVolumeAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResults'}}, + 'type': 'object'}, + 'WatchVolumes': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(LifeResults) + async def AttachmentLife(self, ids=None): + ''' + 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=3, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemAttachmentParamsResults) + async def FilesystemAttachmentParams(self, ids=None): + ''' + 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=3, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemAttachmentResults) + async def FilesystemAttachments(self, ids=None): + ''' + 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=3, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemParamsResults) + async def FilesystemParams(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemResults) + async def Filesystems(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Remove(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveAttachment(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='RemoveAttachment', + version=3, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetFilesystemAttachmentInfo(self, filesystem_attachments=None): + ''' + 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=3, + params=_params) + _params['filesystem-attachments'] = filesystem_attachments + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetFilesystemInfo(self, filesystems=None): + ''' + 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=3, + params=_params) + _params['filesystems'] = filesystems + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetVolumeAttachmentInfo(self, volume_attachments=None): + ''' + 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=3, + params=_params) + _params['volume-attachments'] = volume_attachments + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='SetVolumeInfo', + version=3, + params=_params) + _params['volumes'] = volumes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateStatus(self, entities=None): + ''' + 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='UpdateStatus', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeAttachmentParamsResults) + async def VolumeAttachmentParams(self, ids=None): + ''' + 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=3, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeAttachmentResults) + async def VolumeAttachments(self, ids=None): + ''' + ids : typing.Sequence[~MachineStorageId] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='VolumeAttachments', + version=3, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BlockDeviceResults) + async def VolumeBlockDevices(self, ids=None): + ''' + ids : typing.Sequence[~MachineStorageId] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='VolumeBlockDevices', + version=3, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeParamsResults) + async def VolumeParams(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeResults) + async def Volumes(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchBlockDevices(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineStorageIdsWatchResults) + async def WatchFilesystemAttachments(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchFilesystems(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMachines(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineStorageIdsWatchResults) + async def WatchVolumeAttachments(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchVolumes(self, entities=None): + ''' + 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=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class SubnetsFacade(Type): + name = 'Subnets' + version = 3 + schema = {'definitions': {'AddSubnetParams': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'subnet-provider-id': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['space-tag'], + 'type': 'object'}, + 'AddSubnetsParams': {'additionalProperties': False, + 'properties': {'subnets': {'items': {'$ref': '#/definitions/AddSubnetParams'}, + 'type': 'array'}}, + 'required': ['subnets'], + 'type': 'object'}, + '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'}, + 'ListSubnetsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SpaceResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'SpaceResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SpaceResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'SubnetsFilters': {'additionalProperties': False, + 'properties': {'space-tag': {'type': 'string'}, + 'zone': {'type': 'string'}}, + 'type': 'object'}, + 'ZoneResult': {'additionalProperties': False, + 'properties': {'available': {'type': 'boolean'}, + 'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}}, + 'required': ['name', 'available'], + 'type': 'object'}, + 'ZoneResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ZoneResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AddSubnets': {'properties': {'Params': {'$ref': '#/definitions/AddSubnetsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AllSpaces': {'properties': {'Result': {'$ref': '#/definitions/SpaceResults'}}, + 'type': 'object'}, + 'AllZones': {'properties': {'Result': {'$ref': '#/definitions/ZoneResults'}}, + 'type': 'object'}, + 'ListSubnets': {'properties': {'Params': {'$ref': '#/definitions/SubnetsFilters'}, + 'Result': {'$ref': '#/definitions/ListSubnetsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def AddSubnets(self, subnets=None): + ''' + subnets : typing.Sequence[~AddSubnetParams] + Returns -> ErrorResults + ''' + if subnets is not None and not isinstance(subnets, (bytes, str, list)): + raise Exception("Expected subnets to be a Sequence, received: {}".format(type(subnets))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Subnets', + request='AddSubnets', + version=3, + params=_params) + _params['subnets'] = subnets + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SpaceResults) + async def AllSpaces(self): + ''' + + Returns -> SpaceResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Subnets', + request='AllSpaces', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ZoneResults) + async def AllZones(self): + ''' + + Returns -> ZoneResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Subnets', + request='AllZones', + version=3, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListSubnetsResults) + async def ListSubnets(self, space_tag=None, zone=None): + ''' + 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=3, + params=_params) + _params['space-tag'] = space_tag + _params['zone'] = zone + reply = await self.rpc(msg) + return reply + + + +class UpgradeSeriesFacade(Type): + name = 'UpgradeSeries' + version = 3 + schema = {'definitions': {'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesResult': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/EntitiesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PinApplicationResult': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['application-name'], + 'type': 'object'}, + 'PinApplicationsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/PinApplicationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PinnedLeadershipResult': {'additionalProperties': False, + 'properties': {'result': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpgradeSeriesStartUnitCompletionParam': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'message': {'type': 'string'}}, + 'required': ['entities', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'message': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['entity', + 'status', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'status': {'type': 'string'}, + 'target': {'type': 'string'}}, + 'type': 'object'}, + 'UpgradeSeriesStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusResult'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'CurrentSeries': {'description': 'CurrentSeries returns what ' + 'Juju thinks the current ' + 'series of the machine is.\n' + 'Note that a machine could ' + 'have been upgraded ' + 'out-of-band by running\n' + 'do-release-upgrade outside ' + 'of the upgrade-series ' + 'workflow,\n' + 'making this value incorrect.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'FinishUpgradeSeries': {'description': 'FinishUpgradeSeries is ' + 'the last action in the ' + 'upgrade workflow and ' + 'is\n' + 'called after all ' + 'machine and unit ' + 'statuses are ' + '"completed".\n' + 'It updates the machine ' + 'series to reflect the ' + 'completed upgrade, ' + 'then\n' + 'removes the ' + 'upgrade-series lock.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'MachineStatus': {'description': 'MachineStatus gets the ' + 'current upgrade-series ' + 'status of a machine.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'PinMachineApplications': {'description': 'PinMachineApplications ' + 'pins leadership for ' + 'applications ' + 'represented by ' + 'units\n' + 'running on the ' + "auth'd machine.", + 'properties': {'Result': {'$ref': '#/definitions/PinApplicationsResults'}}, + 'type': 'object'}, + 'PinnedLeadership': {'description': 'PinnedLeadership returns ' + 'all pinned applications ' + 'and the entities that\n' + 'require their pinned ' + 'behaviour, for leadership ' + 'in the current model.', + 'properties': {'Result': {'$ref': '#/definitions/PinnedLeadershipResult'}}, + 'type': 'object'}, + 'SetInstanceStatus': {'description': 'SetInstanceStatus sets ' + 'the status of the ' + 'machine.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetMachineStatus': {'description': 'SetMachineStatus sets the ' + 'current upgrade-series ' + 'status of a machine.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUpgradeSeriesUnitStatus': {'description': 'SetUpgradeSeriesUnitStatus ' + 'sets the ' + 'upgrade series ' + 'status of the ' + 'unit.\n' + 'If no upgrade ' + 'is in progress ' + 'an error is ' + 'returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StartUnitCompletion': {'description': 'StartUnitCompletion ' + 'starts the upgrade ' + 'series completion ' + 'phase for all ' + 'subordinate\n' + 'units of a given ' + 'machine.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStartUnitCompletionParam'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'TargetSeries': {'description': 'TargetSeries returns the ' + 'series that a machine has ' + 'been locked\n' + 'for upgrading to.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'UnitsCompleted': {'description': 'UnitsCompleted returns the ' + 'units running on this ' + 'machine that have ' + 'completed\n' + 'the upgrade-series workflow ' + 'and are in their normal ' + 'running state.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/EntitiesResults'}}, + 'type': 'object'}, + 'UnitsPrepared': {'description': 'UnitsPrepared returns the ' + 'units running on this ' + 'machine that have completed\n' + 'their upgrade-series ' + 'preparation, and are ready ' + 'to be stopped and have ' + 'their\n' + 'unit agent services ' + 'converted for the target ' + 'series.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/EntitiesResults'}}, + 'type': 'object'}, + 'UnpinMachineApplications': {'description': 'UnpinMachineApplications ' + 'unpins leadership ' + 'for applications ' + 'represented by\n' + 'units running on ' + "the auth'd " + 'machine.', + 'properties': {'Result': {'$ref': '#/definitions/PinApplicationsResults'}}, + 'type': 'object'}, + 'UpgradeSeriesUnitStatus': {'description': 'UpgradeSeriesUnitStatus ' + 'returns the ' + 'current ' + 'preparation status ' + 'of an\n' + 'upgrading unit.\n' + 'If no series ' + 'upgrade is in ' + 'progress an error ' + 'is returned ' + 'instead.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'description': 'WatchUpgradeSeriesNotifications ' + 'returns a ' + 'NotifyWatcher ' + 'for ' + 'observing ' + 'changes to ' + 'upgrade ' + 'series ' + 'locks.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringResults) + async def 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-series 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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-series lock. + + args : typing.Sequence[~UpdateSeriesArg] + 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def MachineStatus(self, entities=None): + ''' + MachineStatus gets the current upgrade-series 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(PinApplicationsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(PinnedLeadershipResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMachineStatus(self, params=None): + ''' + SetMachineStatus sets the current upgrade-series 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 = await self.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='UpgradeSeries', + request='SetUpgradeSeriesUnitStatus', + version=3, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def 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 = await self.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-series 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) + async def UnitsPrepared(self, entities=None): + ''' + UnitsPrepared returns the units running on this machine that have completed + their upgrade-series preparation, and are ready to be stopped and have their + unit agent services converted for the target series. + + 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='UnitsPrepared', + version=3, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PinApplicationsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client4.py b/juju/client/old_clients/_client4.py new file mode 100644 index 000000000..79422af3d --- /dev/null +++ b/juju/client/old_clients/_client4.py @@ -0,0 +1,10557 @@ +# 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.old_clients._definitions import * + + +class ApplicationFacade(Type): + name = 'Application' + version = 4 + schema = {'definitions': {'AddApplicationUnits': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'num-units': {'type': 'integer'}, + 'placement': {'items': {'$ref': '#/definitions/Placement'}, + 'type': 'array'}}, + 'required': ['application', + 'num-units', + 'placement'], + 'type': 'object'}, + 'AddApplicationUnitsResults': {'additionalProperties': False, + 'properties': {'units': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['units'], + 'type': 'object'}, + 'AddRelation': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['endpoints'], + 'type': 'object'}, + 'AddRelationResults': {'additionalProperties': False, + 'properties': {'endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}}, + 'required': ['endpoints'], + 'type': 'object'}, + 'ApplicationCharmRelations': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationCharmRelationsResults': {'additionalProperties': False, + 'properties': {'charm-relations': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['charm-relations'], + 'type': 'object'}, + 'ApplicationDeploy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-yaml': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'num-units': {'type': 'integer'}, + 'placement': {'items': {'$ref': '#/definitions/Placement'}, + 'type': 'array'}, + 'resources': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'series': {'type': 'string'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'series', + 'charm-url', + 'channel', + 'num-units', + 'config-yaml', + 'constraints'], + 'type': 'object'}, + 'ApplicationDestroy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationExpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGetResults': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'series': {'type': 'string'}}, + 'required': ['application', + 'charm', + 'config', + 'constraints', + 'series'], + 'type': 'object'}, + 'ApplicationMetricCredential': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'metrics-credentials': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['application', + 'metrics-credentials'], + 'type': 'object'}, + 'ApplicationMetricCredentials': {'additionalProperties': False, + 'properties': {'creds': {'items': {'$ref': '#/definitions/ApplicationMetricCredential'}, + 'type': 'array'}}, + 'required': ['creds'], + 'type': 'object'}, + 'ApplicationSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'options': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', 'options'], + 'type': 'object'}, + 'ApplicationSetCharm': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'config-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-settings-yaml': {'type': 'string'}, + 'force-series': {'type': 'boolean'}, + 'force-units': {'type': 'boolean'}, + 'resource-ids': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-constraints': {'patternProperties': {'.*': {'$ref': '#/definitions/StorageConstraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'charm-url', + 'channel', + 'force-units', + 'force-series'], + 'type': 'object'}, + 'ApplicationURLs': {'additionalProperties': False, + 'properties': {'application-urls': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ApplicationUnexpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationUnset': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'options': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', 'options'], + 'type': 'object'}, + 'ApplicationUpdate': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'force-charm-url': {'type': 'boolean'}, + 'force-series': {'type': 'boolean'}, + 'min-units': {'type': 'integer'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'settings-yaml': {'type': 'string'}}, + 'required': ['application', + 'charm-url', + 'force-charm-url', + 'force-series', + 'settings-yaml'], + 'type': 'object'}, + 'ApplicationsDeploy': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/ApplicationDeploy'}, + 'type': 'array'}}, + 'required': ['applications'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'ConsumeApplicationArg': {'additionalProperties': False, + 'properties': {'application-alias': {'type': 'string'}, + 'application-url': {'type': 'string'}}, + 'required': ['application-url'], + 'type': 'object'}, + 'ConsumeApplicationArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ConsumeApplicationArg'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ConsumeApplicationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'local-name': {'type': 'string'}}, + 'type': 'object'}, + 'ConsumeApplicationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConsumeApplicationResult'}, + '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'}, + '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'}, + 'DestroyApplicationUnits': {'additionalProperties': False, + 'properties': {'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + 'type': 'object'}, + 'DestroyRelation': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['endpoints'], + 'type': 'object'}, + 'DestroyUnitInfo': {'additionalProperties': False, + 'properties': {'destroyed-storage': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'detached-storage': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + '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'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetApplicationConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'GetConstraintsResults': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'RemoteApplicationInfo': {'additionalProperties': False, + 'properties': {'application-url': {'type': 'string'}, + 'description': {'type': 'string'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'icon-url-path': {'type': 'string'}, + 'model-tag': {'type': 'string'}, + 'name': {'type': 'string'}, + 'source-model-label': {'type': 'string'}}, + 'required': ['model-tag', + 'name', + 'description', + 'application-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'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit', + 'scope'], + 'type': 'object'}, + 'SetConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['application', 'constraints'], + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'spaces': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}}, + 'type': 'object'}}, + 'properties': {'AddRelation': {'properties': {'Params': {'$ref': '#/definitions/AddRelation'}, + 'Result': {'$ref': '#/definitions/AddRelationResults'}}, + 'type': 'object'}, + 'AddUnits': {'properties': {'Params': {'$ref': '#/definitions/AddApplicationUnits'}, + 'Result': {'$ref': '#/definitions/AddApplicationUnitsResults'}}, + 'type': 'object'}, + 'CharmRelations': {'properties': {'Params': {'$ref': '#/definitions/ApplicationCharmRelations'}, + 'Result': {'$ref': '#/definitions/ApplicationCharmRelationsResults'}}, + 'type': 'object'}, + 'Consume': {'properties': {'Params': {'$ref': '#/definitions/ConsumeApplicationArgs'}, + 'Result': {'$ref': '#/definitions/ConsumeApplicationResults'}}, + 'type': 'object'}, + 'Deploy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationsDeploy'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}}, + 'type': 'object'}, + 'DestroyApplication': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DestroyApplicationResults'}}, + 'type': 'object'}, + 'DestroyRelation': {'properties': {'Params': {'$ref': '#/definitions/DestroyRelation'}}, + 'type': 'object'}, + 'DestroyUnit': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DestroyUnitResults'}}, + 'type': 'object'}, + 'DestroyUnits': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, + 'type': 'object'}, + 'Expose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationExpose'}}, + 'type': 'object'}, + 'Get': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/ApplicationGetResults'}}, + 'type': 'object'}, + 'GetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'GetConstraints': {'properties': {'Params': {'$ref': '#/definitions/GetApplicationConstraints'}, + 'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, + 'type': 'object'}, + 'RemoteApplicationInfo': {'properties': {'Params': {'$ref': '#/definitions/ApplicationURLs'}, + 'Result': {'$ref': '#/definitions/RemoteApplicationInfoResults'}}, + 'type': 'object'}, + 'Set': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, + 'type': 'object'}, + 'SetCharm': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, + 'type': 'object'}, + 'SetConstraints': {'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetMetricCredentials': {'properties': {'Params': {'$ref': '#/definitions/ApplicationMetricCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Unexpose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnexpose'}}, + 'type': 'object'}, + 'Unset': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, + 'type': 'object'}, + 'Update': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUpdate'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddRelationResults) + async def AddRelation(self, endpoints=None): + ''' + endpoints : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddRelation', + version=4, + params=_params) + _params['endpoints'] = endpoints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddApplicationUnitsResults) + async def AddUnits(self, application=None, num_units=None, placement=None): + ''' + application : str + num_units : int + placement : typing.Sequence[~Placement] + 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 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddUnits', + version=4, + params=_params) + _params['application'] = application + _params['num-units'] = num_units + _params['placement'] = placement + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationCharmRelationsResults) + async def CharmRelations(self, application=None): + ''' + 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=4, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConsumeApplicationResults) + async def Consume(self, args=None): + ''' + args : typing.Sequence[~ConsumeApplicationArg] + Returns -> ConsumeApplicationResults + ''' + 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=4, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Deploy(self, applications=None): + ''' + 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=4, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Destroy(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Destroy', + version=4, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyApplicationResults) + async def DestroyApplication(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> DestroyApplicationResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='DestroyApplication', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyRelation(self, endpoints=None): + ''' + endpoints : typing.Sequence[str] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyRelation', + version=4, + params=_params) + _params['endpoints'] = endpoints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyUnitResults) + async def DestroyUnit(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> DestroyUnitResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='DestroyUnit', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyUnits(self, unit_names=None): + ''' + unit_names : typing.Sequence[str] + Returns -> None + ''' + if unit_names is not None and not isinstance(unit_names, (bytes, str, list)): + raise Exception("Expected unit_names to be a Sequence, received: {}".format(type(unit_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnits', + version=4, + params=_params) + _params['unit-names'] = unit_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Expose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=4, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetResults) + async def Get(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Get', + version=4, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def GetCharmURL(self, application=None): + ''' + application : str + Returns -> StringResult + ''' + 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='GetCharmURL', + version=4, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetConstraintsResults) + async def GetConstraints(self, application=None): + ''' + application : str + Returns -> GetConstraintsResults + ''' + 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='GetConstraints', + version=4, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoteApplicationInfoResults) + async def RemoteApplicationInfo(self, application_urls=None): + ''' + application_urls : typing.Sequence[str] + Returns -> RemoteApplicationInfoResults + ''' + if application_urls is not None and not isinstance(application_urls, (bytes, str, list)): + raise Exception("Expected application_urls to be a Sequence, received: {}".format(type(application_urls))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='RemoteApplicationInfo', + version=4, + params=_params) + _params['application-urls'] = application_urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Set(self, application=None, options=None): + ''' + application : str + options : typing.Mapping[str, 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 options is not None and not isinstance(options, dict): + raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Set', + version=4, + params=_params) + _params['application'] = application + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetCharm(self, application=None, channel=None, charm_url=None, config_settings=None, config_settings_yaml=None, force_series=None, force_units=None, resource_ids=None, storage_constraints=None): + ''' + application : str + channel : str + charm_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + force_series : bool + force_units : bool + resource_ids : typing.Mapping[str, str] + storage_constraints : typing.Mapping[str, ~StorageConstraints] + Returns -> None + ''' + 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_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 force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + 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 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=4, + params=_params) + _params['application'] = application + _params['channel'] = channel + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['force-series'] = force_series + _params['force-units'] = force_units + _params['resource-ids'] = resource_ids + _params['storage-constraints'] = storage_constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetConstraints(self, application=None, constraints=None): + ''' + 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=4, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMetricCredentials(self, creds=None): + ''' + 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=4, + params=_params) + _params['creds'] = creds + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unexpose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=4, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unset(self, application=None, options=None): + ''' + application : str + options : 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 options is not None and not isinstance(options, (bytes, str, list)): + raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unset', + version=4, + params=_params) + _params['application'] = application + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Update(self, application=None, charm_url=None, constraints=None, force_charm_url=None, force_series=None, min_units=None, settings=None, settings_yaml=None): + ''' + application : str + charm_url : str + constraints : Value + force_charm_url : bool + force_series : bool + min_units : int + settings : typing.Mapping[str, str] + settings_yaml : str + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + 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 constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + if force_charm_url is not None and not isinstance(force_charm_url, bool): + raise Exception("Expected force_charm_url to be a bool, received: {}".format(type(force_charm_url))) + + if force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + if min_units is not None and not isinstance(min_units, int): + raise Exception("Expected min_units to be a int, received: {}".format(type(min_units))) + + if settings is not None and not isinstance(settings, dict): + raise Exception("Expected settings to be a Mapping, received: {}".format(type(settings))) + + if settings_yaml is not None and not isinstance(settings_yaml, (bytes, str)): + raise Exception("Expected settings_yaml to be a str, received: {}".format(type(settings_yaml))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Update', + version=4, + params=_params) + _params['application'] = application + _params['charm-url'] = charm_url + _params['constraints'] = constraints + _params['force-charm-url'] = force_charm_url + _params['force-series'] = force_series + _params['min-units'] = min_units + _params['settings'] = settings + _params['settings-yaml'] = settings_yaml + reply = await self.rpc(msg) + return reply + + + +class ApplicationOffersFacade(Type): + name = 'ApplicationOffers' + version = 4 + 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'}, + 'ApplicationOfferAdminDetails': {'additionalProperties': False, + 'properties': {'ApplicationOfferDetails': {'$ref': '#/definitions/ApplicationOfferDetails'}, + 'application-description': {'type': 'string'}, + 'application-name': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + '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'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description', + 'ApplicationOfferDetails', + 'application-name', + 'charm-url'], + 'type': 'object'}, + 'ApplicationOfferDetails': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description'], + 'type': 'object'}, + 'ApplicationOfferResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ApplicationOfferAdminDetails'}}, + 'type': 'object'}, + 'ApplicationOffersResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationOfferResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ConsumeOfferDetails': {'additionalProperties': False, + 'properties': {'external-controller': {'$ref': '#/definitions/ExternalControllerInfo'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'offer': {'$ref': '#/definitions/ApplicationOfferDetails'}}, + 'type': 'object'}, + '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/ApplicationOfferDetails'}}, + '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'}, + 'QueryApplicationOffersResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationOfferAdminDetails'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteApplicationInfo': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'icon-url-path': {'type': 'string'}, + 'model-tag': {'type': 'string'}, + 'name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'source-model-label': {'type': 'string'}}, + 'required': ['model-tag', + 'name', + 'description', + 'offer-url', + 'endpoints', + 'icon-url-path'], + 'type': 'object'}, + 'RemoteApplicationInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoteApplicationInfo'}}, + 'type': 'object'}, + 'RemoteApplicationInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteApplicationInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}}, + 'properties': {'ApplicationOffers': {'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/QueryApplicationOffersResults'}}, + '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/QueryApplicationOffersResults'}}, + '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 GUI 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=4, + 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=4, + params=_params) + _params['force'] = force + _params['offer-urls'] = offer_urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(QueryApplicationOffersResults) + async def 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 = 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=4, + params=_params) + _params['offer-urls'] = offer_urls + _params['user-tag'] = user_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(QueryApplicationOffersResults) + 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 -> 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 = 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=4, + 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=4, + 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 GUI 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 = await self.rpc(msg) + return reply + + + +class BundleFacade(Type): + name = 'Bundle' + version = 4 + schema = {'definitions': {'BundleChange': {'additionalProperties': False, + 'properties': {'args': {'items': {'additionalProperties': True, + 'type': 'object'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesMapArgs': {'additionalProperties': False, + 'properties': {'args': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesMapArgsResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChangesMapArgs'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'BundleChangesParams': {'additionalProperties': False, + 'properties': {'bundleURL': {'type': 'string'}, + 'yaml': {'type': 'string'}}, + 'required': ['yaml', 'bundleURL'], + 'type': 'object'}, + 'BundleChangesResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'ExportBundle': {'description': 'ExportBundle exports the ' + 'current model configuration ' + 'as bundle.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'GetChanges': {'description': 'GetChanges returns the list of ' + 'changes required to deploy the ' + 'given bundle\n' + 'data. The changes are sorted by ' + 'requirements, so that they can ' + 'be applied in\n' + 'order.\n' + 'GetChanges has been superseded ' + 'in favour of GetChangesMapArgs. ' + "It's\n" + 'preferable to use that new ' + 'method to add new functionality ' + 'and move clients\n' + 'away from this one.', + 'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, + 'type': 'object'}, + 'GetChangesMapArgs': {'description': 'GetChangesMapArgs ' + 'returns the list of ' + 'changes required to ' + 'deploy the given\n' + 'bundle data. The changes ' + 'are sorted by ' + 'requirements, so that ' + 'they can be\n' + 'applied in order.\n' + 'V4 GetChangesMapArgs is ' + 'not supported on ' + 'anything less than v4', + 'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesMapArgsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringResult) + async def ExportBundle(self): + ''' + ExportBundle exports the current model configuration as bundle. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Bundle', + request='ExportBundle', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BundleChangesResults) + async def 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=4, + params=_params) + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BundleChangesMapArgsResults) + async def 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=4, + params=_params) + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml + reply = await self.rpc(msg) + return reply + + + +class CharmsFacade(Type): + name = 'Charms' + version = 4 + schema = {'definitions': {'AddCharmWithAuth': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'force': {'type': 'boolean'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'series': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'charm-origin', + 'macaroon', + 'force', + 'series'], + 'type': 'object'}, + 'AddCharmWithOrigin': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'charm-origin', + 'force', + 'series'], + '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'}, + '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'}}, + 'required': ['revision', 'url', 'config'], + 'type': 'object'}, + 'CharmActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'CharmActions': {'additionalProperties': False, + 'properties': {'specs': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmActionSpec'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'CharmBase': {'additionalProperties': False, + 'properties': {'architectures': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'type': 'object'}, + 'CharmContainer': {'additionalProperties': False, + 'properties': {'mounts': {'items': {'$ref': '#/definitions/CharmMount'}, + 'type': 'array'}, + 'resource': {'type': 'string'}}, + 'type': 'object'}, + 'CharmDeployment': {'additionalProperties': False, + 'properties': {'min-version': {'type': 'string'}, + 'mode': {'type': 'string'}, + 'service': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', + 'mode', + 'service', + 'min-version'], + 'type': 'object'}, + 'CharmDevice': {'additionalProperties': False, + 'properties': {'CountMax': {'type': 'integer'}, + 'CountMin': {'type': 'integer'}, + 'Description': {'type': 'string'}, + 'Name': {'type': 'string'}, + 'Type': {'type': 'string'}}, + 'required': ['Name', + 'Description', + 'Type', + 'CountMin', + 'CountMax'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CharmManifest': {'additionalProperties': False, + 'properties': {'bases': {'items': {'$ref': '#/definitions/CharmBase'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CharmMeta': {'additionalProperties': False, + 'properties': {'assumes-expr': {'$ref': '#/definitions/ExpressionTree'}, + 'categories': {'items': {'type': 'string'}, + 'type': 'array'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmContainer'}}, + 'type': 'object'}, + 'deployment': {'$ref': '#/definitions/CharmDeployment'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmDevice'}}, + 'type': 'object'}, + 'extra-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'min-juju-version': {'type': 'string'}, + 'name': {'type': 'string'}, + 'payload-classes': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmPayloadClass'}}, + 'type': 'object'}, + 'peers': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'provides': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'requires': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}, + 'resources': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmResourceMeta'}}, + 'type': 'object'}, + 'series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmStorage'}}, + 'type': 'object'}, + 'subordinate': {'type': 'boolean'}, + 'summary': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'terms': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['name', + 'summary', + 'description', + 'subordinate'], + 'type': 'object'}, + 'CharmMetric': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'description'], + 'type': 'object'}, + 'CharmMetrics': {'additionalProperties': False, + 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, + 'type': 'object'}, + 'plan': {'$ref': '#/definitions/CharmPlan'}}, + 'required': ['metrics', 'plan'], + 'type': 'object'}, + 'CharmMount': {'additionalProperties': False, + 'properties': {'location': {'type': 'string'}, + 'storage': {'type': 'string'}}, + 'type': 'object'}, + 'CharmOption': {'additionalProperties': False, + 'properties': {'default': {'additionalProperties': True, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CharmOrigin': {'additionalProperties': False, + 'properties': {'architecture': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'hash': {'type': 'string'}, + 'id': {'type': 'string'}, + 'instance-key': {'type': 'string'}, + 'os': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'risk': {'type': 'string'}, + 'series': {'type': 'string'}, + 'source': {'type': 'string'}, + 'track': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['source', 'type', 'id'], + 'type': 'object'}, + 'CharmOriginResult': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['charm-origin'], + 'type': 'object'}, + 'CharmPayloadClass': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', 'type'], + 'type': 'object'}, + 'CharmPlan': {'additionalProperties': False, + 'properties': {'required': {'type': 'boolean'}}, + 'required': ['required'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'CharmResource': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'fingerprint': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'name': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'origin', + 'revision', + 'fingerprint', + 'size'], + 'type': 'object'}, + 'CharmResourceMeta': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'path': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'type', + 'path', + 'description'], + 'type': 'object'}, + 'CharmResourceResult': {'additionalProperties': False, + 'properties': {'CharmResource': {'$ref': '#/definitions/CharmResource'}, + 'ErrorResult': {'$ref': '#/definitions/ErrorResult'}, + 'description': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'fingerprint': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'name': {'type': 'string'}, + 'origin': {'type': 'string'}, + 'path': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'size': {'type': 'integer'}, + 'type': {'type': 'string'}}, + 'required': ['ErrorResult', + 'name', + 'type', + 'path', + 'origin', + 'revision', + 'fingerprint', + 'size', + 'CharmResource'], + 'type': 'object'}, + 'CharmResourcesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'items': {'$ref': '#/definitions/CharmResourceResult'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'CharmStorage': {'additionalProperties': False, + 'properties': {'count-max': {'type': 'integer'}, + 'count-min': {'type': 'integer'}, + 'description': {'type': 'string'}, + 'location': {'type': 'string'}, + 'minimum-size': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'properties': {'items': {'type': 'string'}, + 'type': 'array'}, + 'read-only': {'type': 'boolean'}, + 'shared': {'type': 'boolean'}, + 'type': {'type': 'string'}}, + 'required': ['name', + 'description', + 'type', + 'shared', + 'read-only', + 'count-min', + 'count-max', + 'minimum-size'], + 'type': 'object'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'CharmURLAndOrigin': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'charm-url': {'type': 'string'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}}, + 'required': ['charm-url', + 'charm-origin'], + 'type': 'object'}, + 'CharmURLAndOrigins': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/CharmURLAndOrigin'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'CharmsList': {'additionalProperties': False, + 'properties': {'names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['names'], + 'type': 'object'}, + 'CharmsListResult': {'additionalProperties': False, + 'properties': {'charm-urls': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['charm-urls'], + 'type': 'object'}, + 'DownloadInfoResult': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'url': {'type': 'string'}}, + 'required': ['url', 'charm-origin'], + 'type': 'object'}, + 'DownloadInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/DownloadInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + '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'}, + 'ExpressionTree': {'additionalProperties': False, + 'properties': {'Expression': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['Expression'], + 'type': 'object'}, + 'IsMeteredResult': {'additionalProperties': False, + 'properties': {'metered': {'type': 'boolean'}}, + 'required': ['metered'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'ResolveCharmWithChannel': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'reference': {'type': 'string'}, + 'switch-charm': {'type': 'boolean'}}, + 'required': ['reference', + 'charm-origin'], + 'type': 'object'}, + 'ResolveCharmWithChannelResult': {'additionalProperties': False, + 'properties': {'charm-origin': {'$ref': '#/definitions/CharmOrigin'}, + 'error': {'$ref': '#/definitions/Error'}, + 'supported-series': {'items': {'type': 'string'}, + 'type': 'array'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'charm-origin', + 'supported-series'], + 'type': 'object'}, + 'ResolveCharmWithChannelResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/ResolveCharmWithChannelResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'ResolveCharmsWithChannel': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'resolve': {'items': {'$ref': '#/definitions/ResolveCharmWithChannel'}, + 'type': 'array'}}, + 'required': ['resolve'], + 'type': 'object'}}, + 'properties': {'AddCharm': {'description': 'AddCharm adds the given charm URL ' + '(which must include revision) to ' + 'the\n' + 'environment, if it does not exist ' + 'yet. Local charms are not ' + 'supported,\n' + 'only charm store and charm hub ' + 'URLs. See also AddLocalCharm().', + 'properties': {'Params': {'$ref': '#/definitions/AddCharmWithOrigin'}, + 'Result': {'$ref': '#/definitions/CharmOriginResult'}}, + 'type': 'object'}, + 'AddCharmWithAuthorization': {'description': 'AddCharmWithAuthorization ' + 'adds the given ' + 'charm URL (which ' + 'must include\n' + 'revision) to the ' + 'environment, if ' + 'it does not ' + 'exist yet. Local ' + 'charms are\n' + 'not supported, ' + 'only charm store ' + 'and charm hub ' + 'URLs. See also ' + 'AddLocalCharm().\n' + '\n' + 'The ' + 'authorization ' + 'macaroon, ' + 'args.CharmStoreMacaroon, ' + 'may be\n' + 'omitted, in ' + 'which case this ' + 'call is ' + 'equivalent to ' + 'AddCharm.', + 'properties': {'Params': {'$ref': '#/definitions/AddCharmWithAuth'}, + 'Result': {'$ref': '#/definitions/CharmOriginResult'}}, + 'type': 'object'}, + 'CharmInfo': {'description': 'CharmInfo returns information ' + 'about the requested charm.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, + 'Result': {'$ref': '#/definitions/Charm'}}, + 'type': 'object'}, + 'CheckCharmPlacement': {'description': 'CheckCharmPlacement ' + 'checks if a charm is ' + 'allowed to be placed ' + 'with in a\n' + 'given application.', + 'properties': {'Params': {'$ref': '#/definitions/ApplicationCharmPlacements'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'GetDownloadInfos': {'description': 'GetDownloadInfos attempts ' + 'to get the bundle ' + 'corresponding to the ' + 'charm url\n' + 'and origin.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURLAndOrigins'}, + 'Result': {'$ref': '#/definitions/DownloadInfoResults'}}, + 'type': 'object'}, + 'IsMetered': {'description': 'IsMetered returns whether or not ' + 'the charm is metered.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURL'}, + 'Result': {'$ref': '#/definitions/IsMeteredResult'}}, + 'type': 'object'}, + 'List': {'description': 'List returns a list of charm URLs ' + 'currently in the state.\n' + 'If supplied parameter contains any ' + 'names, the result will\n' + 'be filtered to return only the charms ' + 'with supplied names.', + 'properties': {'Params': {'$ref': '#/definitions/CharmsList'}, + 'Result': {'$ref': '#/definitions/CharmsListResult'}}, + 'type': 'object'}, + 'ListCharmResources': {'description': 'ListCharmResources ' + 'returns a series of ' + 'resources for a given ' + 'charm.', + 'properties': {'Params': {'$ref': '#/definitions/CharmURLAndOrigins'}, + 'Result': {'$ref': '#/definitions/CharmResourcesResults'}}, + 'type': 'object'}, + 'ResolveCharms': {'description': 'ResolveCharms resolves the ' + 'given charm URLs with an ' + 'optionally specified\n' + 'preferred channel. Channel ' + 'provided via CharmOrigin.', + 'properties': {'Params': {'$ref': '#/definitions/ResolveCharmsWithChannel'}, + 'Result': {'$ref': '#/definitions/ResolveCharmWithChannelResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(CharmOriginResult) + async def AddCharm(self, charm_origin=None, force=None, series=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 + series : str + 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 series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + 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=4, + params=_params) + _params['charm-origin'] = charm_origin + _params['force'] = force + _params['series'] = series + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CharmOriginResult) + async def AddCharmWithAuthorization(self, charm_origin=None, force=None, macaroon=None, series=None, url=None): + ''' + AddCharmWithAuthorization 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(). + + The authorization macaroon, args.CharmStoreMacaroon, may be + omitted, in which case this call is equivalent to AddCharm. + + charm_origin : CharmOrigin + force : bool + macaroon : Macaroon + series : str + 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 macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): + raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + 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='AddCharmWithAuthorization', + version=4, + params=_params) + _params['charm-origin'] = charm_origin + _params['force'] = force + _params['macaroon'] = macaroon + _params['series'] = series + _params['url'] = url + reply = await self.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)): + 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=4, + params=_params) + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=4, + params=_params) + _params['placements'] = placements + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DownloadInfoResults) + async def 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IsMeteredResult) + async def 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=4, + params=_params) + _params['url'] = url + reply = await self.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=4, + params=_params) + _params['names'] = names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CharmResourcesResults) + async def 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @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=4, + params=_params) + _params['macaroon'] = macaroon + _params['resolve'] = resolve + reply = await self.rpc(msg) + return reply + + + +class ClientFacade(Type): + name = 'Client' + version = 4 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'AddCharm': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'url': {'type': 'string'}}, + 'required': ['url', 'channel', 'force'], + 'type': 'object'}, + 'AddCharmWithAuthorization': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'channel', + 'macaroon', + 'force'], + 'type': 'object'}, + 'AddMachineParams': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'container-type': {'type': 'string'}, + 'disks': {'items': {'$ref': '#/definitions/Constraints'}, + 'type': 'array'}, + 'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'instance-id': {'type': 'string'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'parent-id': {'type': 'string'}, + 'placement': {'$ref': '#/definitions/Placement'}, + 'series': {'type': 'string'}}, + 'required': ['series', + 'constraints', + 'jobs', + 'parent-id', + 'container-type', + 'instance-id', + 'nonce', + 'hardware-characteristics', + 'addresses'], + 'type': 'object'}, + 'AddMachines': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'AddMachinesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'machine': {'type': 'string'}}, + 'required': ['machine'], + 'type': 'object'}, + 'AddMachinesResults': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'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'}, + 'AgentVersionResult': {'additionalProperties': False, + 'properties': {'version': {'$ref': '#/definitions/Number'}}, + 'required': ['version'], + 'type': 'object'}, + 'AllWatcherId': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'ApplicationOfferStatus': {'additionalProperties': False, + 'properties': {'active-connected-count': {'type': 'integer'}, + 'application-name': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteEndpoint'}}, + 'type': 'object'}, + 'err': {'$ref': '#/definitions/Error'}, + 'offer-name': {'type': 'string'}, + 'total-connected-count': {'type': 'integer'}}, + 'required': ['offer-name', + 'application-name', + 'charm', + 'endpoints', + 'active-connected-count', + 'total-connected-count'], + 'type': 'object'}, + 'ApplicationStatus': {'additionalProperties': False, + 'properties': {'can-upgrade-to': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'charm-channel': {'type': 'string'}, + 'charm-profile': {'type': 'string'}, + 'charm-version': {'type': 'string'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'err': {'$ref': '#/definitions/Error'}, + 'exposed': {'type': 'boolean'}, + 'exposed-endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/ExposedEndpoint'}}, + 'type': 'object'}, + 'int': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'meter-statuses': {'patternProperties': {'.*': {'$ref': '#/definitions/MeterStatus'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'public-address': {'type': 'string'}, + 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'series': {'type': 'string'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}, + 'subordinate-to': {'items': {'type': 'string'}, + 'type': 'array'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, + 'type': 'object'}, + 'workload-version': {'type': 'string'}}, + 'required': ['charm', + 'charm-version', + 'charm-profile', + 'series', + 'exposed', + 'life', + 'relations', + 'can-upgrade-to', + 'subordinate-to', + 'units', + 'meter-statuses', + 'status', + 'workload-version', + 'endpoint-bindings', + 'public-address'], + 'type': 'object'}, + 'Binary': {'additionalProperties': False, + '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'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build', + 'Number', + 'Release', + 'Arch'], + 'type': 'object'}, + 'BranchStatus': {'additionalProperties': False, + 'properties': {'assigned-units': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'created': {'type': 'integer'}, + 'created-by': {'type': 'string'}}, + 'required': ['assigned-units', + 'created', + 'created-by'], + 'type': 'object'}, + 'BundleChange': {'additionalProperties': False, + 'properties': {'args': {'items': {'additionalProperties': True, + 'type': 'object'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesParams': {'additionalProperties': False, + 'properties': {'bundleURL': {'type': 'string'}, + 'yaml': {'type': 'string'}}, + 'required': ['yaml', 'bundleURL'], + 'type': 'object'}, + 'BundleChangesResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'DestroyMachines': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'machine-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['machine-names', 'force'], + 'type': 'object'}, + 'DetailedStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'err': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}, + 'kind': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['status', + 'info', + 'data', + 'since', + 'kind', + 'version', + 'life'], + 'type': 'object'}, + 'EndpointStatus': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}, + 'subordinate': {'type': 'boolean'}}, + 'required': ['application', + 'name', + 'role', + 'subordinate'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'FindToolsParams': {'additionalProperties': False, + 'properties': {'agentstream': {'type': 'string'}, + 'arch': {'type': 'string'}, + 'major': {'type': 'integer'}, + 'minor': {'type': 'integer'}, + 'number': {'$ref': '#/definitions/Number'}, + 'os-type': {'type': 'string'}, + 'series': {'type': 'string'}}, + 'required': ['number', + 'major', + 'minor', + 'arch', + 'series', + 'os-type', + 'agentstream'], + 'type': 'object'}, + 'FindToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'list': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['list'], + 'type': 'object'}, + 'FullStatus': {'additionalProperties': False, + 'properties': {'applications': {'patternProperties': {'.*': {'$ref': '#/definitions/ApplicationStatus'}}, + 'type': 'object'}, + 'branches': {'patternProperties': {'.*': {'$ref': '#/definitions/BranchStatus'}}, + 'type': 'object'}, + 'controller-timestamp': {'format': 'date-time', + 'type': 'string'}, + 'machines': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}}, + 'type': 'object'}, + 'model': {'$ref': '#/definitions/ModelStatusInfo'}, + 'offers': {'patternProperties': {'.*': {'$ref': '#/definitions/ApplicationOfferStatus'}}, + 'type': 'object'}, + 'relations': {'items': {'$ref': '#/definitions/RelationStatus'}, + 'type': 'array'}, + 'remote-applications': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteApplicationStatus'}}, + 'type': 'object'}}, + 'required': ['model', + 'machines', + 'applications', + 'remote-applications', + 'offers', + 'relations', + 'controller-timestamp', + 'branches'], + 'type': 'object'}, + 'GetConstraintsResults': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'root-disk-source': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'History': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'statuses': {'items': {'$ref': '#/definitions/DetailedStatus'}, + 'type': 'array'}}, + 'required': ['statuses'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + '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'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'LXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachineHardware': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'MachineStatus': {'additionalProperties': False, + 'properties': {'agent-status': {'$ref': '#/definitions/DetailedStatus'}, + 'constraints': {'type': 'string'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}}, + 'type': 'object'}, + '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': {'items': {'type': 'string'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'lxd-profiles': {'patternProperties': {'.*': {'$ref': '#/definitions/LXDProfile'}}, + 'type': 'object'}, + 'modification-status': {'$ref': '#/definitions/DetailedStatus'}, + 'network-interfaces': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInterface'}}, + 'type': 'object'}, + 'primary-controller-machine': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'wants-vote': {'type': 'boolean'}}, + 'required': ['agent-status', + 'instance-status', + 'modification-status', + 'dns-name', + 'instance-id', + 'display-name', + 'series', + 'id', + 'containers', + 'constraints', + 'hardware', + 'jobs', + 'has-vote', + 'wants-vote'], + 'type': 'object'}, + 'MeterStatus': {'additionalProperties': False, + 'properties': {'color': {'type': 'string'}, + 'message': {'type': 'string'}}, + 'required': ['color', 'message'], + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'cloud-credential-tag': {'type': 'string'}, + 'cloud-credential-validity': {'type': 'boolean'}, + 'cloud-region': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'controller-uuid': {'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'}, + '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', + 'sla', + 'agent-version'], + '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'}, + 'ModelSLA': {'additionalProperties': False, + 'properties': {'ModelSLAInfo': {'$ref': '#/definitions/ModelSLAInfo'}, + 'creds': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', + 'owner', + 'ModelSLAInfo', + 'creds'], + 'type': 'object'}, + 'ModelSLAInfo': {'additionalProperties': False, + 'properties': {'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', 'owner'], + 'type': 'object'}, + 'ModelSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelStatusInfo': {'additionalProperties': False, + 'properties': {'available-version': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'meter-status': {'$ref': '#/definitions/MeterStatus'}, + 'model-status': {'$ref': '#/definitions/DetailedStatus'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'sla': {'type': 'string'}, + 'type': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['name', + 'type', + 'cloud-tag', + 'version', + 'available-version', + 'model-status', + 'meter-status', + 'sla'], + 'type': 'object'}, + 'ModelUnset': {'additionalProperties': False, + 'properties': {'keys': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['keys'], + 'type': 'object'}, + 'ModelUserInfo': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'display-name': {'type': 'string'}, + 'last-connection': {'format': 'date-time', + 'type': 'string'}, + 'user': {'type': 'string'}}, + 'required': ['user', + 'display-name', + 'last-connection', + 'access'], + 'type': 'object'}, + 'ModelUserInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ModelUserInfo'}}, + 'type': 'object'}, + 'ModelUserInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ModelUserInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NetworkInterface': {'additionalProperties': False, + 'properties': {'dns-nameservers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway': {'type': 'string'}, + 'ip-addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'is-up': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'space': {'type': 'string'}}, + 'required': ['ip-addresses', + 'mac-address', + 'is-up'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'PrivateAddress': {'additionalProperties': False, + 'properties': {'target': {'type': 'string'}}, + 'required': ['target'], + 'type': 'object'}, + 'PrivateAddressResults': {'additionalProperties': False, + 'properties': {'private-address': {'type': 'string'}}, + 'required': ['private-address'], + 'type': 'object'}, + 'ProvisioningScriptParams': {'additionalProperties': False, + 'properties': {'data-dir': {'type': 'string'}, + 'disable-package-commands': {'type': 'boolean'}, + 'machine-id': {'type': 'string'}, + 'nonce': {'type': 'string'}}, + 'required': ['machine-id', + 'nonce', + 'data-dir', + 'disable-package-commands'], + 'type': 'object'}, + 'ProvisioningScriptResult': {'additionalProperties': False, + 'properties': {'script': {'type': 'string'}}, + 'required': ['script'], + 'type': 'object'}, + 'PublicAddress': {'additionalProperties': False, + 'properties': {'target': {'type': 'string'}}, + 'required': ['target'], + 'type': 'object'}, + 'PublicAddressResults': {'additionalProperties': False, + 'properties': {'public-address': {'type': 'string'}}, + 'required': ['public-address'], + 'type': 'object'}, + 'RelationStatus': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'$ref': '#/definitions/EndpointStatus'}, + 'type': 'array'}, + 'id': {'type': 'integer'}, + 'interface': {'type': 'string'}, + 'key': {'type': 'string'}, + 'scope': {'type': 'string'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}}, + 'required': ['id', + 'key', + 'interface', + 'scope', + 'endpoints', + 'status'], + 'type': 'object'}, + 'RemoteApplicationStatus': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'err': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}}, + 'required': ['offer-url', + 'offer-name', + 'endpoints', + 'life', + 'relations', + 'status'], + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'ResolveCharmResult': {'additionalProperties': False, + 'properties': {'error': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'type': 'object'}, + 'ResolveCharmResults': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/ResolveCharmResult'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'ResolveCharms': {'additionalProperties': False, + 'properties': {'references': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['references'], + 'type': 'object'}, + 'Resolved': {'additionalProperties': False, + 'properties': {'retry': {'type': 'boolean'}, + 'unit-name': {'type': 'string'}}, + 'required': ['unit-name', 'retry'], + 'type': 'object'}, + 'SetConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['application', 'constraints'], + 'type': 'object'}, + 'SetModelAgentVersion': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'required': ['version'], + 'type': 'object'}, + 'StatusHistoryFilter': {'additionalProperties': False, + 'properties': {'date': {'format': 'date-time', + 'type': 'string'}, + 'delta': {'type': 'integer'}, + 'exclude': {'items': {'type': 'string'}, + 'type': 'array'}, + 'size': {'type': 'integer'}}, + 'required': ['size', + 'date', + 'delta', + 'exclude'], + 'type': 'object'}, + 'StatusHistoryRequest': {'additionalProperties': False, + 'properties': {'filter': {'$ref': '#/definitions/StatusHistoryFilter'}, + 'historyKind': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tag': {'type': 'string'}}, + 'required': ['historyKind', + 'size', + 'filter', + 'tag'], + 'type': 'object'}, + 'StatusHistoryRequests': {'additionalProperties': False, + 'properties': {'requests': {'items': {'$ref': '#/definitions/StatusHistoryRequest'}, + 'type': 'array'}}, + 'required': ['requests'], + 'type': 'object'}, + 'StatusHistoryResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'history': {'$ref': '#/definitions/History'}}, + 'required': ['history'], + 'type': 'object'}, + 'StatusHistoryResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusHistoryResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusParams': {'additionalProperties': False, + 'properties': {'patterns': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['patterns'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'SupportedFeature': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['name', 'description'], + 'type': 'object'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'UnitStatus': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'agent-status': {'$ref': '#/definitions/DetailedStatus'}, + 'charm': {'type': 'string'}, + 'leader': {'type': 'boolean'}, + 'machine': {'type': 'string'}, + 'opened-ports': {'items': {'type': 'string'}, + 'type': 'array'}, + 'provider-id': {'type': 'string'}, + 'public-address': {'type': 'string'}, + 'subordinates': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, + 'type': 'object'}, + 'workload-status': {'$ref': '#/definitions/DetailedStatus'}, + 'workload-version': {'type': 'string'}}, + 'required': ['agent-status', + 'workload-status', + 'workload-version', + 'machine', + 'opened-ports', + 'public-address', + 'charm', + 'subordinates'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'host/port addresses stored in ' + 'state.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'AbortCurrentUpgrade': {'description': 'AbortCurrentUpgrade ' + 'aborts and archives ' + 'the current upgrade\n' + 'synchronisation ' + 'record, if any.', + 'type': 'object'}, + 'AddCharm': {'description': 'NOTE: AddCharm is deprecated as ' + 'of juju 2.9 and charms facade ' + 'version 3.\n' + 'Please discontinue use and move ' + 'to the charms facade version.\n' + '\n' + 'TODO: remove in juju 3.0', + 'properties': {'Params': {'$ref': '#/definitions/AddCharm'}}, + 'type': 'object'}, + 'AddCharmWithAuthorization': {'description': 'AddCharmWithAuthorization ' + 'adds the given ' + 'charm URL (which ' + 'must include\n' + 'revision) to the ' + 'model, if it ' + 'does not exist ' + 'yet. Local ' + 'charms are not\n' + 'supported, only ' + 'charm store ' + 'URLs. See also ' + 'AddLocalCharm().\n' + '\n' + 'The ' + 'authorization ' + 'macaroon, ' + 'args.CharmStoreMacaroon, ' + 'may be omitted, ' + 'in\n' + 'which case this ' + 'call is ' + 'equivalent to ' + 'AddCharm.\n' + '\n' + 'NOTE: ' + 'AddCharmWithAuthorization ' + 'is deprecated as ' + 'of juju 2.9 and ' + 'charms\n' + 'facade version ' + '3. Please ' + 'discontinue use ' + 'and move to the ' + 'charms facade\n' + 'version.\n' + '\n' + 'TODO: remove in ' + 'juju 3.0', + 'properties': {'Params': {'$ref': '#/definitions/AddCharmWithAuthorization'}}, + 'type': 'object'}, + 'AddMachines': {'description': 'AddMachines adds new machines ' + 'with the supplied parameters.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'AddMachinesV2': {'description': 'AddMachinesV2 adds new ' + 'machines with the supplied ' + 'parameters.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'AgentVersion': {'description': 'AgentVersion returns the ' + 'current version that the API ' + 'server is running.', + 'properties': {'Result': {'$ref': '#/definitions/AgentVersionResult'}}, + 'type': 'object'}, + 'CACert': {'description': 'CACert returns the certificate used ' + 'to validate the state connection.', + 'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'DestroyMachines': {'description': 'DestroyMachines removes a ' + 'given set of machines.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyMachines'}}, + 'type': 'object'}, + 'FindTools': {'description': 'FindTools returns a List ' + 'containing all tools matching ' + 'the given parameters.', + 'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, + 'Result': {'$ref': '#/definitions/FindToolsResult'}}, + 'type': 'object'}, + 'FullStatus': {'description': 'FullStatus gives the ' + 'information needed for juju ' + 'status over the api', + 'properties': {'Params': {'$ref': '#/definitions/StatusParams'}, + 'Result': {'$ref': '#/definitions/FullStatus'}}, + 'type': 'object'}, + 'GetBundleChanges': {'description': 'GetBundleChanges returns ' + 'the list of changes ' + 'required to deploy the ' + 'given\n' + 'bundle data. The changes ' + 'are sorted by ' + 'requirements, so that ' + 'they can be\n' + 'applied in order.\n' + 'Deprecated: clients ' + 'should use the GetChanges ' + 'endpoint on the Bundle ' + 'facade.\n' + 'Note: any new feature in ' + 'the future like devices ' + 'will never be supported ' + 'here.', + 'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, + 'type': 'object'}, + 'GetModelConstraints': {'description': 'GetModelConstraints ' + 'returns the ' + 'constraints for the ' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, + 'type': 'object'}, + 'InjectMachines': {'description': 'InjectMachines injects a ' + 'machine into state with ' + 'provisioned status.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'ModelGet': {'description': 'ModelGet implements the ' + 'server-side part of the\n' + 'model-config CLI command.', + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelInfo': {'description': 'ModelInfo returns information ' + 'about the current model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelInfo'}}, + 'type': 'object'}, + 'ModelSet': {'description': 'ModelSet implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, + 'type': 'object'}, + 'ModelUnset': {'description': 'ModelUnset implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, + 'type': 'object'}, + 'ModelUserInfo': {'description': 'ModelUserInfo returns ' + 'information on all users in ' + 'the model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelUserInfoResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'description': 'PrivateAddress implements ' + 'the server side of ' + 'Client.PrivateAddress.', + 'properties': {'Params': {'$ref': '#/definitions/PrivateAddress'}, + 'Result': {'$ref': '#/definitions/PrivateAddressResults'}}, + 'type': 'object'}, + 'ProvisioningScript': {'description': 'ProvisioningScript ' + 'returns a shell script ' + 'that, when run,\n' + 'provisions a machine ' + 'agent on the machine ' + 'executing the script.', + 'properties': {'Params': {'$ref': '#/definitions/ProvisioningScriptParams'}, + 'Result': {'$ref': '#/definitions/ProvisioningScriptResult'}}, + 'type': 'object'}, + 'PublicAddress': {'description': 'PublicAddress implements the ' + 'server side of ' + 'Client.PublicAddress.', + 'properties': {'Params': {'$ref': '#/definitions/PublicAddress'}, + 'Result': {'$ref': '#/definitions/PublicAddressResults'}}, + 'type': 'object'}, + 'ResolveCharms': {'description': 'ResolveCharms resolves the ' + 'best available charm URLs ' + 'with series, for charm\n' + 'locations without a series ' + 'specified.\n' + '\n' + 'NOTE: ResolveCharms is ' + 'deprecated as of juju 2.9 ' + 'and charms facade version ' + '3.\n' + 'Please discontinue use and ' + 'move to the charms facade ' + 'version.\n' + '\n' + 'TODO: remove in juju 3.0', + 'properties': {'Params': {'$ref': '#/definitions/ResolveCharms'}, + 'Result': {'$ref': '#/definitions/ResolveCharmResults'}}, + 'type': 'object'}, + 'Resolved': {'description': 'Resolved implements the server ' + 'side of Client.Resolved.', + 'properties': {'Params': {'$ref': '#/definitions/Resolved'}}, + 'type': 'object'}, + 'RetryProvisioning': {'description': 'RetryProvisioning marks ' + 'a provisioning error as ' + 'transient on the ' + 'machines.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SLALevel': {'description': 'SLALevel returns the current sla ' + 'level for the model.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetModelAgentVersion': {'description': 'SetModelAgentVersion ' + 'sets the model agent ' + 'version.', + 'properties': {'Params': {'$ref': '#/definitions/SetModelAgentVersion'}}, + 'type': 'object'}, + 'SetModelConstraints': {'description': 'SetModelConstraints ' + 'sets the constraints ' + 'for the model.', + 'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetSLALevel': {'description': 'SetSLALevel sets the sla level ' + 'on the model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, + 'type': 'object'}, + 'StatusHistory': {'description': 'StatusHistory returns a ' + 'slice of past statuses for ' + 'several entities.', + 'properties': {'Params': {'$ref': '#/definitions/StatusHistoryRequests'}, + 'Result': {'$ref': '#/definitions/StatusHistoryResults'}}, + 'type': 'object'}, + 'WatchAll': {'description': 'WatchAll initiates a watcher for ' + 'entities in the connected model.', + 'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + APIHostPorts returns the API host/port addresses stored in state. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='APIHostPorts', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AbortCurrentUpgrade(self): + ''' + AbortCurrentUpgrade aborts and archives the current upgrade + synchronisation record, if any. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='AbortCurrentUpgrade', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AddCharm(self, channel=None, force=None, url=None): + ''' + NOTE: AddCharm is deprecated as of juju 2.9 and charms facade version 3. + Please discontinue use and move to the charms facade version. + + TODO: remove in juju 3.0 + + channel : str + force : bool + url : str + Returns -> None + ''' + 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 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='Client', + request='AddCharm', + version=4, + params=_params) + _params['channel'] = channel + _params['force'] = force + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AddCharmWithAuthorization(self, channel=None, force=None, macaroon=None, url=None): + ''' + AddCharmWithAuthorization adds the given charm URL (which must include + revision) to the model, if it does not exist yet. Local charms are not + supported, only charm store URLs. See also AddLocalCharm(). + + The authorization macaroon, args.CharmStoreMacaroon, may be omitted, in + which case this call is equivalent to AddCharm. + + NOTE: AddCharmWithAuthorization is deprecated as of juju 2.9 and charms + facade version 3. Please discontinue use and move to the charms facade + version. + + TODO: remove in juju 3.0 + + channel : str + force : bool + macaroon : Macaroon + url : str + Returns -> None + ''' + 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 macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): + raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) + + 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='Client', + request='AddCharmWithAuthorization', + version=4, + params=_params) + _params['channel'] = channel + _params['force'] = force + _params['macaroon'] = macaroon + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def AddMachines(self, params=None): + ''' + AddMachines adds new machines with the supplied parameters. + + 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='Client', + request='AddMachines', + version=4, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def AddMachinesV2(self, params=None): + ''' + AddMachinesV2 adds new machines with the supplied parameters. + + 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='Client', + request='AddMachinesV2', + version=4, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AgentVersionResult) + async def AgentVersion(self): + ''' + AgentVersion returns the current version that the API server is running. + + + Returns -> AgentVersionResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='AgentVersion', + version=4, + params=_params) + + 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='Client', + request='CACert', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyMachines(self, force=None, machine_names=None): + ''' + DestroyMachines removes a given set of machines. + + force : bool + machine_names : typing.Sequence[str] + Returns -> None + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if machine_names is not None and not isinstance(machine_names, (bytes, str, list)): + raise Exception("Expected machine_names to be a Sequence, received: {}".format(type(machine_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='DestroyMachines', + version=4, + params=_params) + _params['force'] = force + _params['machine-names'] = machine_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindToolsResult) + async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, number=None, os_type=None, series=None): + ''' + FindTools returns a List containing all tools matching the given parameters. + + agentstream : str + arch : str + major : int + minor : int + number : Number + os_type : str + series : 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 minor is not None and not isinstance(minor, int): + raise Exception("Expected minor to be a int, received: {}".format(type(minor))) + + 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))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='FindTools', + version=4, + params=_params) + _params['agentstream'] = agentstream + _params['arch'] = arch + _params['major'] = major + _params['minor'] = minor + _params['number'] = number + _params['os-type'] = os_type + _params['series'] = series + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FullStatus) + async def 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=4, + params=_params) + _params['patterns'] = patterns + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BundleChangesResults) + async def GetBundleChanges(self, bundleurl=None, yaml=None): + ''' + GetBundleChanges 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. + Deprecated: clients should use the GetChanges endpoint on the Bundle facade. + Note: any new feature in the future like devices will never be supported here. + + 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='Client', + request='GetBundleChanges', + version=4, + params=_params) + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetConstraintsResults) + async def GetModelConstraints(self): + ''' + GetModelConstraints returns the constraints for the model. + + + Returns -> GetConstraintsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='GetModelConstraints', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def InjectMachines(self, params=None): + ''' + InjectMachines injects a machine into state with provisioned status. + + 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='Client', + request='InjectMachines', + version=4, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResults) + async def 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='Client', + request='ModelGet', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelInfo) + async def ModelInfo(self): + ''' + ModelInfo returns information about the current model. + + + Returns -> ModelInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ModelInfo', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='ModelSet', + version=4, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='ModelUnset', + version=4, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelUserInfoResults) + async def ModelUserInfo(self): + ''' + ModelUserInfo returns information on all users in the model. + + + Returns -> ModelUserInfoResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ModelUserInfo', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PrivateAddressResults) + async def PrivateAddress(self, target=None): + ''' + PrivateAddress implements the server side of Client.PrivateAddress. + + target : str + Returns -> PrivateAddressResults + ''' + if target is not None and not isinstance(target, (bytes, str)): + raise Exception("Expected target to be a str, received: {}".format(type(target))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='PrivateAddress', + version=4, + params=_params) + _params['target'] = target + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProvisioningScriptResult) + async def 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='Client', + request='ProvisioningScript', + version=4, + params=_params) + _params['data-dir'] = data_dir + _params['disable-package-commands'] = disable_package_commands + _params['machine-id'] = machine_id + _params['nonce'] = nonce + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PublicAddressResults) + async def PublicAddress(self, target=None): + ''' + PublicAddress implements the server side of Client.PublicAddress. + + target : str + Returns -> PublicAddressResults + ''' + if target is not None and not isinstance(target, (bytes, str)): + raise Exception("Expected target to be a str, received: {}".format(type(target))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='PublicAddress', + version=4, + params=_params) + _params['target'] = target + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolveCharmResults) + async def ResolveCharms(self, references=None): + ''' + ResolveCharms resolves the best available charm URLs with series, for charm + locations without a series specified. + + NOTE: ResolveCharms is deprecated as of juju 2.9 and charms facade version 3. + Please discontinue use and move to the charms facade version. + + TODO: remove in juju 3.0 + + references : typing.Sequence[str] + Returns -> ResolveCharmResults + ''' + if references is not None and not isinstance(references, (bytes, str, list)): + raise Exception("Expected references to be a Sequence, received: {}".format(type(references))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ResolveCharms', + version=4, + params=_params) + _params['references'] = references + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Resolved(self, retry=None, unit_name=None): + ''' + Resolved implements the server side of Client.Resolved. + + retry : bool + unit_name : str + Returns -> None + ''' + if retry is not None and not isinstance(retry, bool): + raise Exception("Expected retry to be a bool, received: {}".format(type(retry))) + + if unit_name is not None and not isinstance(unit_name, (bytes, str)): + raise Exception("Expected unit_name to be a str, received: {}".format(type(unit_name))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='Resolved', + version=4, + params=_params) + _params['retry'] = retry + _params['unit-name'] = unit_name + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RetryProvisioning(self, entities=None): + ''' + RetryProvisioning marks a provisioning error as transient on the 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='Client', + request='RetryProvisioning', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + SLALevel returns the current sla level for the model. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='SLALevel', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetModelAgentVersion(self, force=None, version=None): + ''' + SetModelAgentVersion sets the model agent version. + + force : bool + version : Number + Returns -> None + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + 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='Client', + request='SetModelAgentVersion', + version=4, + params=_params) + _params['force'] = force + _params['version'] = version + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='SetModelConstraints', + version=4, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='SetSLALevel', + version=4, + params=_params) + _params['ModelSLAInfo'] = modelslainfo + _params['creds'] = creds + _params['level'] = level + _params['owner'] = owner + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusHistoryResults) + async def 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=4, + params=_params) + _params['requests'] = requests + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AllWatcherId) + async def 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=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class InstancePollerFacade(Type): + name = 'InstancePoller' + version = 4 + 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'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineAddresses': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'addresses'], + 'type': 'object'}, + 'MachineAddressesResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses'], + 'type': 'object'}, + 'MachineAddressesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineAddressesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'is-default-gateway': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + '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': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'shadow-addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'virtual-port-type': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}}, + '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'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'ProviderNetworkConfig': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'config'], + 'type': 'object'}, + 'SetMachinesAddresses': {'additionalProperties': False, + 'properties': {'machine-addresses': {'items': {'$ref': '#/definitions/MachineAddresses'}, + 'type': 'array'}}, + 'required': ['machine-addresses'], + 'type': 'object'}, + 'SetProviderNetworkConfig': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ProviderNetworkConfig'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SetProviderNetworkConfigResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'modified': {'type': 'boolean'}}, + 'required': ['addresses', + 'modified'], + 'type': 'object'}, + 'SetProviderNetworkConfigResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SetProviderNetworkConfigResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}}, + 'properties': {'AreManuallyProvisioned': {'description': 'AreManuallyProvisioned ' + 'returns whether ' + 'each given entity ' + 'is\n' + 'manually ' + 'provisioned or not. ' + 'Only machine tags ' + 'are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'InstanceId': {'description': 'InstanceId returns the provider ' + 'specific instance id for each ' + 'given\n' + 'machine or an ' + 'CodeNotProvisioned error, if ' + 'not set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'InstanceStatus': {'description': 'InstanceStatus returns the ' + 'instance status for each ' + 'given entity.\n' + 'Only machine tags are ' + 'accepted.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ProviderAddresses': {'description': 'ProviderAddresses ' + 'returns the list of all ' + 'known provider ' + 'addresses\n' + 'for each given entity. ' + 'Only machine tags are ' + 'accepted.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineAddressesResults'}}, + 'type': 'object'}, + 'SetInstanceStatus': {'description': 'SetInstanceStatus ' + 'updates the instance ' + 'status for each given ' + 'entity.\n' + 'Only machine tags are ' + 'accepted.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetProviderAddresses': {'description': 'SetProviderAddresses ' + 'updates the list of ' + 'known provider ' + 'addresses\n' + 'for each given ' + 'entity. Only machine ' + 'tags are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/SetMachinesAddresses'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetProviderNetworkConfig': {'description': 'SetProviderNetworkConfig ' + 'updates the ' + 'provider ' + 'addresses for one ' + 'or more\n' + 'machines.\n' + '\n' + "What's more, if " + 'the client ' + 'request includes ' + 'provider-specific ' + 'IDs (e.g.\n' + 'network, subnet ' + 'or address IDs), ' + 'this method will ' + 'also iterate any ' + 'present\n' + 'link layer ' + 'devices (and ' + 'their addresses) ' + 'and merge in any ' + 'missing\n' + 'provider-specific ' + 'information.', + 'properties': {'Params': {'$ref': '#/definitions/SetProviderNetworkConfig'}, + 'Result': {'$ref': '#/definitions/SetProviderNetworkConfigResults'}}, + 'type': 'object'}, + 'Status': {'description': 'Status returns the status of each ' + 'given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachineStartTimes': {'description': 'WatchModelMachineStartTimes ' + 'watches the ' + 'non-container ' + 'machines in ' + 'the model\n' + 'for changes to ' + 'the Life or ' + 'AgentStartTime ' + 'fields and ' + 'reports them ' + 'as a batch.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'description': 'WatchModelMachines ' + 'returns a ' + 'StringsWatcher that ' + 'notifies of\n' + 'changes to the life ' + 'cycles of the top level ' + 'machines in the ' + 'current\n' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(BoolResults) + async def 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='InstancePoller', + request='AreManuallyProvisioned', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.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) + async def 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 = await self.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='InstancePoller', + request='Life', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.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='InstancePoller', + request='ModelConfig', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineAddressesResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(SetProviderNetworkConfigResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def 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 = await self.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='InstancePoller', + request='WatchForModelConfigChanges', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @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) + 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 MachinerFacade(Type): + name = 'Machiner' + version = 4 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'JobsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['jobs'], + 'type': 'object'}, + 'JobsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/JobsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineAddresses': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'addresses'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'is-default-gateway': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + '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': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'shadow-addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'virtual-port-type': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}}, + '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'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetMachineNetworkConfig': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'config'], + 'type': 'object'}, + 'SetMachinesAddresses': {'additionalProperties': False, + 'properties': {'machine-addresses': {'items': {'$ref': '#/definitions/MachineAddresses'}, + 'type': 'array'}}, + 'required': ['machine-addresses'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'EnsureDead': {'description': 'EnsureDead calls EnsureDead on ' + 'each given entity from state. ' + 'It\n' + 'will fail if the entity is not ' + "present. If it's Alive, nothing " + 'will\n' + 'happen (see state/EnsureDead() ' + 'for units or machines).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Jobs': {'description': 'Jobs returns the jobs assigned to the ' + 'given entities.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/JobsResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' + 'that this machine resides in.\n' + 'It is implemented here directly ' + 'as a result of removing it from\n' + 'embedded APIAddresser *without* ' + 'bumping the facade version.\n' + 'It should be blanked when this ' + 'facade version is next ' + 'incremented.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'RecordAgentStartTime': {'description': 'RecordAgentStartTime ' + 'updates the agent ' + 'start time field in ' + 'the machine doc.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetMachineAddresses': {'properties': {'Params': {'$ref': '#/definitions/SetMachinesAddresses'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetObservedNetworkConfig': {'description': 'SetObservedNetworkConfig ' + 'reads the network ' + 'config for the ' + 'machine\n' + 'identified by the ' + 'input args.\n' + 'This config is ' + 'merged with the ' + 'new network ' + 'config supplied ' + 'in the\n' + 'same args and ' + 'updated if it has ' + 'changed.', + 'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the status of ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateStatus': {'description': 'UpdateStatus updates the ' + 'status data of each given ' + 'entity.\n' + 'TODO(fwereade): WTF. This ' + 'method exists *only* for the ' + 'convenience of the\n' + '*client* API -- and is itself ' + 'completely broken -- but we ' + 'still expose it\n' + 'in every facade with a ' + 'StatusSetter? FFS.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def 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=4, + params=_params) + + reply = await self.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='Machiner', + request='APIHostPorts', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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='Machiner', + request='EnsureDead', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @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=4, + params=_params) + _params['entities'] = entities + reply = await self.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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + ModelUUID returns the model UUID that this machine 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='Machiner', + request='ModelUUID', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=4, + params=_params) + _params['machine-addresses'] = machine_addresses + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=4, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateStatus(self, entities=None): + ''' + UpdateStatus updates the status data of each given entity. + TODO(fwereade): WTF. This method exists *only* for the convenience of the + *client* API -- and is itself completely broken -- but we still expose it + in every facade with a StatusSetter? FFS. + + 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='UpdateStatus', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.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='Machiner', + request='Watch', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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=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'}}, + 'required': ['branch'], + 'type': 'object'}, + 'BranchInfoArgs': {'additionalProperties': False, + 'properties': {'branches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'detailed': {'type': 'boolean'}}, + 'required': ['branches', 'detailed'], + 'type': 'object'}, + 'BranchResults': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'generations': {'items': {'$ref': '#/definitions/Generation'}, + 'type': 'array'}}, + 'required': ['generations'], + 'type': 'object'}, + 'BranchTrackArg': {'additionalProperties': False, + 'properties': {'branch': {'type': 'string'}, + 'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'num-units': {'type': 'integer'}}, + 'required': ['branch', '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'}, + 'Generation': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/GenerationApplication'}, + 'type': 'array'}, + 'branch': {'type': 'string'}, + 'completed': {'type': 'integer'}, + 'completed-by': {'type': 'string'}, + 'created': {'type': 'integer'}, + 'created-by': {'type': 'string'}, + 'generation-id': {'type': 'integer'}}, + 'required': ['branch', + 'created', + 'created-by', + 'applications'], + 'type': 'object'}, + 'GenerationApplication': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'pending': {'items': {'type': 'string'}, + 'type': 'array'}, + 'progress': {'type': 'string'}, + 'tracking': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', + 'progress', + 'config'], + 'type': 'object'}, + 'GenerationId': {'additionalProperties': False, + 'properties': {'generation-id': {'type': 'integer'}}, + 'required': ['generation-id'], + 'type': 'object'}, + 'GenerationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'generation': {'$ref': '#/definitions/Generation'}}, + 'required': ['generation'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'AbortBranch': {'description': 'AbortBranch aborts the input ' + 'branch, marking it complete. ' + 'However no\n' + 'changes are made applicable to ' + 'the whole model. No units may ' + 'be assigned\n' + 'to the branch when aborting.', + 'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'AddBranch': {'description': 'AddBranch adds a new branch with ' + 'the input name to the model.', + 'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'BranchInfo': {'description': 'BranchInfo will return details ' + 'of branch identified by the ' + 'input argument,\n' + 'including units on the branch ' + 'and the configuration disjoint ' + 'with the\n' + 'master generation.\n' + 'An error is returned if no ' + 'in-flight branch matching in ' + 'input is found.', + 'properties': {'Params': {'$ref': '#/definitions/BranchInfoArgs'}, + 'Result': {'$ref': '#/definitions/BranchResults'}}, + 'type': 'object'}, + 'CommitBranch': {'description': 'CommitBranch commits the ' + 'input branch, making its ' + 'changes applicable to\n' + 'the whole model and marking ' + 'it complete.', + 'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/IntResult'}}, + 'type': 'object'}, + 'HasActiveBranch': {'description': 'HasActiveBranch returns a ' + 'true result if the input ' + 'model has an "in-flight"\n' + 'branch matching the input ' + 'name.', + 'properties': {'Params': {'$ref': '#/definitions/BranchArg'}, + 'Result': {'$ref': '#/definitions/BoolResult'}}, + 'type': 'object'}, + 'ListCommits': {'description': 'ListCommits will return the ' + 'commits, hence only branches ' + 'with generation_id higher than ' + '0', + 'properties': {'Result': {'$ref': '#/definitions/BranchResults'}}, + 'type': 'object'}, + 'ShowCommit': {'description': 'ShowCommit will return details ' + 'a commit given by its ' + 'generationId\n' + 'An error is returned if either ' + 'no branch can be found ' + 'corresponding to the generation ' + 'id.\n' + 'Or the generation id given is ' + 'below 1.', + 'properties': {'Params': {'$ref': '#/definitions/GenerationId'}, + 'Result': {'$ref': '#/definitions/GenerationResult'}}, + 'type': 'object'}, + 'TrackBranch': {'description': 'TrackBranch marks the input ' + 'units and/or applications as ' + 'tracking the input\n' + 'branch, causing them to ' + 'realise changes made under ' + 'that branch.', + 'properties': {'Params': {'$ref': '#/definitions/BranchTrackArg'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(BranchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(BranchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(GenerationResult) + async def 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 = await self.rpc(msg) + return reply + + + + @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 StorageFacade(Type): + name = 'Storage' + version = 4 + schema = {'definitions': {'AddStorageDetails': {'additionalProperties': False, + 'properties': {'storage-tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['storage-tags'], + 'type': 'object'}, + 'AddStorageResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/AddStorageDetails'}}, + 'type': 'object'}, + 'AddStorageResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/AddStorageResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BulkImportStorageParams': {'additionalProperties': False, + 'properties': {'storage': {'items': {'$ref': '#/definitions/ImportStorageParams'}, + 'type': 'array'}}, + 'required': ['storage'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'FilesystemAttachmentDetails': {'additionalProperties': False, + 'properties': {'FilesystemAttachmentInfo': {'$ref': '#/definitions/FilesystemAttachmentInfo'}, + 'life': {'type': 'string'}}, + 'required': ['FilesystemAttachmentInfo'], + 'type': 'object'}, + 'FilesystemAttachmentInfo': {'additionalProperties': False, + 'properties': {'mount-point': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'FilesystemDetails': {'additionalProperties': False, + 'properties': {'filesystem-tag': {'type': 'string'}, + 'info': {'$ref': '#/definitions/FilesystemInfo'}, + 'life': {'type': 'string'}, + 'machine-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/FilesystemAttachmentDetails'}}, + 'type': 'object'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'storage': {'$ref': '#/definitions/StorageDetails'}, + 'unit-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/FilesystemAttachmentDetails'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['filesystem-tag', + 'info', + 'status'], + 'type': 'object'}, + 'FilesystemDetailsListResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'$ref': '#/definitions/FilesystemDetails'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemDetailsListResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemDetailsListResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemFilter': {'additionalProperties': False, + 'properties': {'machines': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemFilters': {'additionalProperties': False, + 'properties': {'filters': {'items': {'$ref': '#/definitions/FilesystemFilter'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemInfo': {'additionalProperties': False, + 'properties': {'filesystem-id': {'type': 'string'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'required': ['filesystem-id', + 'pool', + 'size'], + 'type': 'object'}, + 'ImportStorageDetails': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}}, + 'required': ['storage-tag'], + 'type': 'object'}, + 'ImportStorageParams': {'additionalProperties': False, + 'properties': {'kind': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'storage-name': {'type': 'string'}}, + 'required': ['kind', + 'pool', + 'provider-id', + 'storage-name'], + 'type': 'object'}, + 'ImportStorageResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ImportStorageDetails'}}, + 'type': 'object'}, + 'ImportStorageResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ImportStorageResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'RemoveStorage': {'additionalProperties': False, + 'properties': {'storage': {'items': {'$ref': '#/definitions/RemoveStorageInstance'}, + 'type': 'array'}}, + 'required': ['storage'], + 'type': 'object'}, + 'RemoveStorageInstance': {'additionalProperties': False, + 'properties': {'destroy-attachments': {'type': 'boolean'}, + 'destroy-storage': {'type': 'boolean'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'StorageAddParams': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'storage': {'$ref': '#/definitions/StorageConstraints'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'name', 'storage'], + 'type': 'object'}, + 'StorageAttachmentDetails': {'additionalProperties': False, + 'properties': {'life': {'type': 'string'}, + 'location': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag', + 'machine-tag'], + 'type': 'object'}, + 'StorageAttachmentId': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag'], + 'type': 'object'}, + 'StorageAttachmentIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/StorageAttachmentId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StorageDetails': {'additionalProperties': False, + 'properties': {'attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/StorageAttachmentDetails'}}, + 'type': 'object'}, + 'kind': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'storage-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'owner-tag', + 'kind', + 'status', + 'persistent'], + 'type': 'object'}, + 'StorageDetailsListResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'$ref': '#/definitions/StorageDetails'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageDetailsListResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageDetailsListResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageDetailsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageDetails'}}, + 'type': 'object'}, + 'StorageDetailsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageDetailsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageFilter': {'additionalProperties': False, + 'type': 'object'}, + 'StorageFilters': {'additionalProperties': False, + 'properties': {'filters': {'items': {'$ref': '#/definitions/StorageFilter'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragePool': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'name': {'type': 'string'}, + 'provider': {'type': 'string'}}, + 'required': ['name', 'provider', 'attrs'], + 'type': 'object'}, + 'StoragePoolFilter': {'additionalProperties': False, + 'properties': {'names': {'items': {'type': 'string'}, + 'type': 'array'}, + 'providers': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragePoolFilters': {'additionalProperties': False, + 'properties': {'filters': {'items': {'$ref': '#/definitions/StoragePoolFilter'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragePoolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'storage-pools': {'items': {'$ref': '#/definitions/StoragePool'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragePoolsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StoragePoolsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragesAddParams': {'additionalProperties': False, + 'properties': {'storages': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}}, + 'required': ['storages'], + 'type': 'object'}, + 'VolumeAttachmentDetails': {'additionalProperties': False, + 'properties': {'VolumeAttachmentInfo': {'$ref': '#/definitions/VolumeAttachmentInfo'}, + 'life': {'type': 'string'}}, + 'required': ['VolumeAttachmentInfo'], + 'type': 'object'}, + 'VolumeAttachmentInfo': {'additionalProperties': False, + 'properties': {'bus-address': {'type': 'string'}, + 'device-link': {'type': 'string'}, + 'device-name': {'type': 'string'}, + 'plan-info': {'$ref': '#/definitions/VolumeAttachmentPlanInfo'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'VolumeAttachmentPlanInfo': {'additionalProperties': False, + 'properties': {'device-attributes': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'device-type': {'type': 'string'}}, + 'type': 'object'}, + 'VolumeDetails': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeInfo'}, + 'life': {'type': 'string'}, + 'machine-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/VolumeAttachmentDetails'}}, + 'type': 'object'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'storage': {'$ref': '#/definitions/StorageDetails'}, + 'unit-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/VolumeAttachmentDetails'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', 'info', 'status'], + 'type': 'object'}, + 'VolumeDetailsListResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'$ref': '#/definitions/VolumeDetails'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeDetailsListResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeDetailsListResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeFilter': {'additionalProperties': False, + 'properties': {'machines': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeFilters': {'additionalProperties': False, + 'properties': {'filters': {'items': {'$ref': '#/definitions/VolumeFilter'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeInfo': {'additionalProperties': False, + 'properties': {'hardware-id': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'volume-id': {'type': 'string'}, + 'wwn': {'type': 'string'}}, + 'required': ['volume-id', 'size', 'persistent'], + 'type': 'object'}}, + 'properties': {'AddToUnit': {'properties': {'Params': {'$ref': '#/definitions/StoragesAddParams'}, + 'Result': {'$ref': '#/definitions/AddStorageResults'}}, + 'type': 'object'}, + 'Attach': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CreatePool': {'properties': {'Params': {'$ref': '#/definitions/StoragePool'}}, + 'type': 'object'}, + 'Detach': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Import': {'properties': {'Params': {'$ref': '#/definitions/BulkImportStorageParams'}, + 'Result': {'$ref': '#/definitions/ImportStorageResults'}}, + 'type': 'object'}, + 'ListFilesystems': {'properties': {'Params': {'$ref': '#/definitions/FilesystemFilters'}, + 'Result': {'$ref': '#/definitions/FilesystemDetailsListResults'}}, + 'type': 'object'}, + 'ListPools': {'properties': {'Params': {'$ref': '#/definitions/StoragePoolFilters'}, + 'Result': {'$ref': '#/definitions/StoragePoolsResults'}}, + 'type': 'object'}, + 'ListStorageDetails': {'properties': {'Params': {'$ref': '#/definitions/StorageFilters'}, + 'Result': {'$ref': '#/definitions/StorageDetailsListResults'}}, + 'type': 'object'}, + 'ListVolumes': {'properties': {'Params': {'$ref': '#/definitions/VolumeFilters'}, + 'Result': {'$ref': '#/definitions/VolumeDetailsListResults'}}, + 'type': 'object'}, + 'Remove': {'properties': {'Params': {'$ref': '#/definitions/RemoveStorage'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StorageDetails': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StorageDetailsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddStorageResults) + async def AddToUnit(self, storages=None): + ''' + 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=4, + params=_params) + _params['storages'] = storages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Attach(self, ids=None): + ''' + 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=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def CreatePool(self, attrs=None, name=None, provider=None): + ''' + attrs : typing.Mapping[str, typing.Any] + name : str + provider : str + Returns -> None + ''' + if attrs is not None and not isinstance(attrs, dict): + raise Exception("Expected attrs to be a Mapping, received: {}".format(type(attrs))) + + if name is not None and not isinstance(name, (bytes, str)): + raise Exception("Expected name to be a str, received: {}".format(type(name))) + + if provider is not None and not isinstance(provider, (bytes, str)): + raise Exception("Expected provider to be a str, received: {}".format(type(provider))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Storage', + request='CreatePool', + version=4, + params=_params) + _params['attrs'] = attrs + _params['name'] = name + _params['provider'] = provider + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Detach(self, ids=None): + ''' + 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='Detach', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ImportStorageResults) + async def Import(self, storage=None): + ''' + 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=4, + params=_params) + _params['storage'] = storage + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemDetailsListResults) + async def ListFilesystems(self, filters=None): + ''' + 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=4, + params=_params) + _params['filters'] = filters + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StoragePoolsResults) + async def ListPools(self, filters=None): + ''' + 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=4, + params=_params) + _params['filters'] = filters + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageDetailsListResults) + async def ListStorageDetails(self, filters=None): + ''' + 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=4, + params=_params) + _params['filters'] = filters + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeDetailsListResults) + async def ListVolumes(self, filters=None): + ''' + 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=4, + params=_params) + _params['filters'] = filters + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Remove(self, storage=None): + ''' + 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=4, + params=_params) + _params['storage'] = storage + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageDetailsResults) + async def StorageDetails(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class StorageProvisionerFacade(Type): + name = 'StorageProvisioner' + version = 4 + schema = {'definitions': {'BlockDevice': {'additionalProperties': False, + 'properties': {'BusAddress': {'type': 'string'}, + 'DeviceLinks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'DeviceName': {'type': 'string'}, + 'FilesystemType': {'type': 'string'}, + 'HardwareId': {'type': 'string'}, + 'InUse': {'type': 'boolean'}, + 'Label': {'type': 'string'}, + 'MountPoint': {'type': 'string'}, + 'SerialId': {'type': 'string'}, + 'Size': {'type': 'integer'}, + 'UUID': {'type': 'string'}, + 'WWN': {'type': 'string'}}, + 'required': ['DeviceName', + 'DeviceLinks', + 'Label', + 'UUID', + 'HardwareId', + 'WWN', + 'BusAddress', + 'Size', + 'FilesystemType', + 'InUse', + 'MountPoint', + 'SerialId'], + 'type': 'object'}, + 'BlockDeviceResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/BlockDevice'}}, + 'required': ['result'], + 'type': 'object'}, + 'BlockDeviceResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BlockDeviceResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'Filesystem': {'additionalProperties': False, + 'properties': {'filesystem-tag': {'type': 'string'}, + 'info': {'$ref': '#/definitions/FilesystemInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['filesystem-tag', 'info'], + 'type': 'object'}, + 'FilesystemAttachment': {'additionalProperties': False, + 'properties': {'filesystem-tag': {'type': 'string'}, + 'info': {'$ref': '#/definitions/FilesystemAttachmentInfo'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['filesystem-tag', + 'machine-tag', + 'info'], + 'type': 'object'}, + 'FilesystemAttachmentInfo': {'additionalProperties': False, + 'properties': {'mount-point': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'FilesystemAttachmentParams': {'additionalProperties': False, + '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'}}, + 'required': ['filesystem-tag', + 'machine-tag', + 'provider'], + 'type': 'object'}, + 'FilesystemAttachmentParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/FilesystemAttachmentParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'FilesystemAttachmentParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemAttachmentParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/FilesystemAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'FilesystemAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemAttachments': {'additionalProperties': False, + 'properties': {'filesystem-attachments': {'items': {'$ref': '#/definitions/FilesystemAttachment'}, + 'type': 'array'}}, + 'required': ['filesystem-attachments'], + 'type': 'object'}, + 'FilesystemInfo': {'additionalProperties': False, + 'properties': {'filesystem-id': {'type': 'string'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'required': ['filesystem-id', + 'pool', + 'size'], + 'type': 'object'}, + 'FilesystemParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/FilesystemAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'filesystem-tag': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['filesystem-tag', + 'size', + 'provider'], + 'type': 'object'}, + 'FilesystemParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/FilesystemParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'FilesystemParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/Filesystem'}}, + 'required': ['result'], + 'type': 'object'}, + 'FilesystemResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Filesystems': {'additionalProperties': False, + 'properties': {'filesystems': {'items': {'$ref': '#/definitions/Filesystem'}, + 'type': 'array'}}, + 'required': ['filesystems'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineStorageId': {'additionalProperties': False, + 'properties': {'attachment-tag': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'attachment-tag'], + 'type': 'object'}, + 'MachineStorageIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/MachineStorageId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'MachineStorageIdsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'MachineStorageIdsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoveFilesystemParams': {'additionalProperties': False, + 'properties': {'destroy': {'type': 'boolean'}, + 'filesystem-id': {'type': 'string'}, + 'provider': {'type': 'string'}}, + 'required': ['provider', + 'filesystem-id'], + 'type': 'object'}, + 'RemoveFilesystemParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoveFilesystemParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'RemoveFilesystemParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoveFilesystemParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'RemoveVolumeParams': {'additionalProperties': False, + 'properties': {'destroy': {'type': 'boolean'}, + 'provider': {'type': 'string'}, + 'volume-id': {'type': 'string'}}, + 'required': ['provider', 'volume-id'], + 'type': 'object'}, + 'RemoveVolumeParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/RemoveVolumeParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'RemoveVolumeParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoveVolumeParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Volume': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', 'info'], + 'type': 'object'}, + 'VolumeAttachment': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeAttachmentInfo'}, + 'machine-tag': {'type': 'string'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'info'], + 'type': 'object'}, + 'VolumeAttachmentInfo': {'additionalProperties': False, + 'properties': {'bus-address': {'type': 'string'}, + 'device-link': {'type': 'string'}, + 'device-name': {'type': 'string'}, + 'plan-info': {'$ref': '#/definitions/VolumeAttachmentPlanInfo'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'VolumeAttachmentParams': {'additionalProperties': False, + 'properties': {'instance-id': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}, + 'volume-id': {'type': 'string'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'provider'], + 'type': 'object'}, + 'VolumeAttachmentParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/VolumeAttachmentParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeAttachmentParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeAttachmentParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeAttachmentPlan': {'additionalProperties': False, + 'properties': {'block-device': {'$ref': '#/definitions/BlockDevice'}, + 'life': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'plan-info': {'$ref': '#/definitions/VolumeAttachmentPlanInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'plan-info'], + 'type': 'object'}, + 'VolumeAttachmentPlanInfo': {'additionalProperties': False, + 'properties': {'device-attributes': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'device-type': {'type': 'string'}}, + 'type': 'object'}, + 'VolumeAttachmentPlanResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/VolumeAttachmentPlan'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeAttachmentPlanResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeAttachmentPlanResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeAttachmentPlans': {'additionalProperties': False, + 'properties': {'volume-plans': {'items': {'$ref': '#/definitions/VolumeAttachmentPlan'}, + 'type': 'array'}}, + 'required': ['volume-plans'], + 'type': 'object'}, + 'VolumeAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/VolumeAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeAttachments': {'additionalProperties': False, + 'properties': {'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachment'}, + 'type': 'array'}}, + 'required': ['volume-attachments'], + 'type': 'object'}, + 'VolumeInfo': {'additionalProperties': False, + 'properties': {'hardware-id': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'volume-id': {'type': 'string'}, + 'wwn': {'type': 'string'}}, + 'required': ['volume-id', 'size', 'persistent'], + 'type': 'object'}, + 'VolumeParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'size', + 'provider'], + 'type': 'object'}, + 'VolumeParamsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/VolumeParams'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeParamsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeParamsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/Volume'}}, + 'required': ['result'], + 'type': 'object'}, + 'VolumeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Volumes': {'additionalProperties': False, + 'properties': {'volumes': {'items': {'$ref': '#/definitions/Volume'}, + 'type': 'array'}}, + 'required': ['volumes'], + 'type': 'object'}}, + 'properties': {'AttachmentLife': {'description': 'AttachmentLife returns the ' + 'lifecycle state of each ' + 'specified machine\n' + 'storage attachment.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'CreateVolumeAttachmentPlans': {'properties': {'Params': {'$ref': '#/definitions/VolumeAttachmentPlans'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnsureDead': {'description': 'EnsureDead calls EnsureDead on ' + 'each given entity from state. ' + 'It\n' + 'will fail if the entity is not ' + "present. If it's Alive, nothing " + 'will\n' + 'happen (see state/EnsureDead() ' + 'for units or machines).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FilesystemAttachmentParams': {'description': 'FilesystemAttachmentParams ' + 'returns the ' + 'parameters for ' + 'creating the ' + 'filesystem\n' + 'attachments ' + 'with the ' + 'specified IDs.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/FilesystemAttachmentParamsResults'}}, + 'type': 'object'}, + 'FilesystemAttachments': {'description': 'FilesystemAttachments ' + 'returns details of ' + 'filesystem ' + 'attachments with the ' + 'specified IDs.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/FilesystemAttachmentResults'}}, + 'type': 'object'}, + 'FilesystemParams': {'description': 'FilesystemParams returns ' + 'the parameters for ' + 'creating the filesystems\n' + 'with the specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/FilesystemParamsResults'}}, + 'type': 'object'}, + 'Filesystems': {'description': 'Filesystems returns details of ' + 'filesystems with the specified ' + 'tags.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/FilesystemResults'}}, + 'type': 'object'}, + 'InstanceId': {'description': 'InstanceId returns the provider ' + 'specific instance id for each ' + 'given\n' + 'machine or an ' + 'CodeNotProvisioned error, if ' + 'not set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'Remove': {'description': 'Remove removes volumes and ' + 'filesystems from state.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveAttachment': {'description': 'RemoveAttachment removes ' + 'the specified machine ' + 'storage attachments\n' + 'from state.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveFilesystemParams': {'description': 'RemoveFilesystemParams ' + 'returns the ' + 'parameters for ' + 'destroying or\n' + 'releasing the ' + 'filesystems with ' + 'the specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RemoveFilesystemParamsResults'}}, + 'type': 'object'}, + 'RemoveVolumeAttachmentPlan': {'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveVolumeParams': {'description': 'RemoveVolumeParams ' + 'returns the parameters ' + 'for destroying\n' + 'or releasing the ' + 'volumes with the ' + 'specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RemoveVolumeParamsResults'}}, + 'type': 'object'}, + 'SetFilesystemAttachmentInfo': {'description': 'SetFilesystemAttachmentInfo ' + 'records the ' + 'details of ' + 'newly ' + 'provisioned ' + 'filesystem\n' + 'attachments.', + 'properties': {'Params': {'$ref': '#/definitions/FilesystemAttachments'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetFilesystemInfo': {'description': 'SetFilesystemInfo ' + 'records the details of ' + 'newly provisioned ' + 'filesystems.', + 'properties': {'Params': {'$ref': '#/definitions/Filesystems'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the status of ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetVolumeAttachmentInfo': {'description': 'SetVolumeAttachmentInfo ' + 'records the ' + 'details of newly ' + 'provisioned ' + 'volume\n' + 'attachments.', + 'properties': {'Params': {'$ref': '#/definitions/VolumeAttachments'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetVolumeAttachmentPlanBlockInfo': {'properties': {'Params': {'$ref': '#/definitions/VolumeAttachmentPlans'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetVolumeInfo': {'description': 'SetVolumeInfo records the ' + 'details of newly provisioned ' + 'volumes.', + 'properties': {'Params': {'$ref': '#/definitions/Volumes'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'VolumeAttachmentParams': {'description': 'VolumeAttachmentParams ' + 'returns the ' + 'parameters for ' + 'creating the ' + 'volume\n' + 'attachments with ' + 'the specified IDs.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/VolumeAttachmentParamsResults'}}, + 'type': 'object'}, + 'VolumeAttachmentPlans': {'description': 'VolumeAttachmentPlans ' + 'returns details of ' + 'volume attachment ' + 'plans with the ' + 'specified IDs.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/VolumeAttachmentPlanResults'}}, + 'type': 'object'}, + 'VolumeAttachments': {'description': 'VolumeAttachments ' + 'returns details of ' + 'volume attachments with ' + 'the specified IDs.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/VolumeAttachmentResults'}}, + 'type': 'object'}, + 'VolumeBlockDevices': {'description': 'VolumeBlockDevices ' + 'returns details of the ' + 'block devices ' + 'corresponding to the\n' + 'volume attachments with ' + 'the specified IDs.', + 'properties': {'Params': {'$ref': '#/definitions/MachineStorageIds'}, + 'Result': {'$ref': '#/definitions/BlockDeviceResults'}}, + 'type': 'object'}, + 'VolumeParams': {'description': 'VolumeParams returns the ' + 'parameters for creating or ' + 'destroying\n' + 'the volumes with the ' + 'specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/VolumeParamsResults'}}, + 'type': 'object'}, + 'Volumes': {'description': 'Volumes returns details of volumes ' + 'with the specified tags.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/VolumeResults'}}, + 'type': 'object'}, + 'WatchApplications': {'description': 'WatchApplications starts ' + 'a StringsWatcher to ' + 'watch CAAS applications\n' + 'deployed to this model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchBlockDevices': {'description': 'WatchBlockDevices ' + 'watches for changes to ' + "the specified machines' " + 'block devices.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchFilesystemAttachments': {'description': 'WatchFilesystemAttachments ' + 'watches for ' + 'changes to ' + 'filesystem ' + 'attachments\n' + 'scoped to the ' + 'entity with the ' + 'tag passed to ' + 'NewState.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResults'}}, + 'type': 'object'}, + 'WatchFilesystems': {'description': 'WatchFilesystems watches ' + 'for changes to ' + 'filesystems scoped\n' + 'to the entity with the ' + 'tag passed to NewState.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchMachines': {'description': 'WatchMachines watches for ' + 'changes to the specified ' + 'machines.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchVolumeAttachmentPlans': {'description': 'WatchVolumeAttachmentPlans ' + 'watches for ' + 'changes to ' + 'volume ' + 'attachments for ' + 'a machine for ' + 'the purpose of ' + 'allowing\n' + 'that machine to ' + 'run any ' + 'initialization ' + 'needed, for ' + 'that volume to ' + 'actually appear ' + 'as a block ' + 'device (ie: ' + 'iSCSI)', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResults'}}, + 'type': 'object'}, + 'WatchVolumeAttachments': {'description': 'WatchVolumeAttachments ' + 'watches for changes ' + 'to volume ' + 'attachments scoped ' + 'to\n' + 'the entity with the ' + 'tag passed to ' + 'NewState.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResults'}}, + 'type': 'object'}, + 'WatchVolumes': {'description': 'WatchVolumes watches for ' + 'changes to volumes scoped to ' + 'the\n' + 'entity with the tag passed to ' + 'NewState.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(LifeResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemAttachmentParamsResults) + async def FilesystemAttachmentParams(self, ids=None): + ''' + 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) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemParamsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemResults) + async def 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 = await self.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='StorageProvisioner', + request='InstanceId', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.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='StorageProvisioner', + request='Life', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoveFilesystemParamsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoveVolumeParamsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.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) + 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='VolumeAttachmentPlans', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeAttachmentResults) + async def VolumeAttachments(self, ids=None): + ''' + VolumeAttachments returns details of volume attachments with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='VolumeAttachments', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BlockDeviceResults) + async def VolumeBlockDevices(self, ids=None): + ''' + VolumeBlockDevices returns details of the block devices corresponding to the + volume attachments with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='StorageProvisioner', + request='VolumeBlockDevices', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeParamsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineStorageIdsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineStorageIdsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineStorageIdsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class SubnetsFacade(Type): + name = 'Subnets' + version = 4 + schema = {'definitions': {'AddSubnetParams': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'subnet-provider-id': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['space-tag'], + 'type': 'object'}, + 'AddSubnetsParams': {'additionalProperties': False, + 'properties': {'subnets': {'items': {'$ref': '#/definitions/AddSubnetParams'}, + 'type': 'array'}}, + 'required': ['subnets'], + 'type': 'object'}, + 'CIDRParams': {'additionalProperties': False, + 'properties': {'cidrs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidrs'], + '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'}, + 'ListSubnetsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'SubnetV2': {'additionalProperties': False, + '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': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones', + 'Subnet'], + 'type': 'object'}, + 'SubnetsFilters': {'additionalProperties': False, + 'properties': {'space-tag': {'type': 'string'}, + 'zone': {'type': 'string'}}, + 'type': 'object'}, + 'SubnetsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'subnets': {'items': {'$ref': '#/definitions/SubnetV2'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SubnetsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SubnetsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ZoneResult': {'additionalProperties': False, + 'properties': {'available': {'type': 'boolean'}, + 'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}}, + 'required': ['name', 'available'], + 'type': 'object'}, + 'ZoneResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ZoneResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AddSubnets': {'description': 'AddSubnets adds existing ' + 'subnets to Juju.', + 'properties': {'Params': {'$ref': '#/definitions/AddSubnetsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AllZones': {'description': 'AllZones returns all availability ' + 'zones known to Juju. If a\n' + 'zone is unusable, unavailable, or ' + 'deprecated the Available\n' + 'field will be false.', + 'properties': {'Result': {'$ref': '#/definitions/ZoneResults'}}, + 'type': 'object'}, + 'ListSubnets': {'description': 'ListSubnets returns the ' + 'matching subnets after ' + 'applying\n' + 'optional filters.', + 'properties': {'Params': {'$ref': '#/definitions/SubnetsFilters'}, + 'Result': {'$ref': '#/definitions/ListSubnetsResults'}}, + 'type': 'object'}, + 'SubnetsByCIDR': {'description': 'SubnetsByCIDR returns the ' + 'collection of subnets ' + 'matching each CIDR in the ' + 'input.', + 'properties': {'Params': {'$ref': '#/definitions/CIDRParams'}, + 'Result': {'$ref': '#/definitions/SubnetsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def AddSubnets(self, subnets=None): + ''' + AddSubnets adds existing subnets to Juju. + + subnets : typing.Sequence[~AddSubnetParams] + Returns -> ErrorResults + ''' + if subnets is not None and not isinstance(subnets, (bytes, str, list)): + raise Exception("Expected subnets to be a Sequence, received: {}".format(type(subnets))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Subnets', + request='AddSubnets', + version=4, + params=_params) + _params['subnets'] = subnets + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ZoneResults) + async def 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=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListSubnetsResults) + async def 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=4, + params=_params) + _params['space-tag'] = space_tag + _params['zone'] = zone + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SubnetsResults) + async def 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=4, + params=_params) + _params['cidrs'] = cidrs + reply = await self.rpc(msg) + return reply + + + +class UniterFacade(Type): + name = 'Uniter' + version = 4 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionExecutionResult': {'additionalProperties': False, + 'properties': {'action-tag': {'type': 'string'}, + 'message': {'type': 'string'}, + 'results': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'status': {'type': 'string'}}, + 'required': ['action-tag', 'status'], + 'type': 'object'}, + 'ActionExecutionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionExecutionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'ApplicationStatusResult': {'additionalProperties': False, + 'properties': {'application': {'$ref': '#/definitions/StatusResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/StatusResult'}}, + 'type': 'object'}}, + 'required': ['application', + 'units'], + 'type': 'object'}, + 'ApplicationStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + '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'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'CharmURLs': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/CharmURL'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'ConfigSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'ConfigSettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConfigSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Endpoint': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'relation': {'$ref': '#/definitions/CharmRelation'}}, + 'required': ['application-name', 'relation'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesCharmURL': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityCharmURL'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesPortRanges': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityCharmURL': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'charm-url'], + 'type': 'object'}, + 'EntityPortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['tag', + 'protocol', + 'from-port', + 'to-port'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'EntityWorkloadVersion': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'workload-version': {'type': 'string'}}, + 'required': ['tag', + 'workload-version'], + 'type': 'object'}, + 'EntityWorkloadVersions': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityWorkloadVersion'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsBulkResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GetLeadershipSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}}, + 'required': ['Address', 'port'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachinePortRange': {'additionalProperties': False, + 'properties': {'port-range': {'$ref': '#/definitions/PortRange'}, + 'relation-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-tag', + 'port-range'], + 'type': 'object'}, + 'MachinePortsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ports': {'items': {'$ref': '#/definitions/MachinePortRange'}, + 'type': 'array'}}, + 'required': ['ports'], + 'type': 'object'}, + 'MachinePortsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachinePortsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MergeLeadershipSettingsBulkParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MergeLeadershipSettingsParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MergeLeadershipSettingsParam': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application-tag', + 'settings'], + 'type': 'object'}, + 'MeterStatusResult': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}}, + 'required': ['code', 'info'], + 'type': 'object'}, + 'MeterStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Metric': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['key', 'value', 'time'], + 'type': 'object'}, + 'MetricBatch': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'created': {'format': 'date-time', + 'type': 'string'}, + 'metrics': {'items': {'$ref': '#/definitions/Metric'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'charm-url', + 'created', + 'metrics'], + 'type': 'object'}, + 'MetricBatchParam': {'additionalProperties': False, + 'properties': {'batch': {'$ref': '#/definitions/MetricBatch'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'batch'], + 'type': 'object'}, + 'MetricBatchParams': {'additionalProperties': False, + 'properties': {'batches': {'items': {'$ref': '#/definitions/MetricBatchParam'}, + 'type': 'array'}}, + 'required': ['batches'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + 'parent-interface-name': {'type': 'string'}, + 'provider-address-id': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'provider-subnet-id': {'type': 'string'}, + 'provider-vlan-id': {'type': 'string'}, + 'routes': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'vlan-tag': {'type': 'integer'}}, + 'required': ['device-index', + 'mac-address', + 'cidr', + 'mtu', + 'provider-id', + 'provider-subnet-id', + 'provider-space-id', + 'provider-address-id', + 'provider-vlan-id', + 'vlan-tag', + 'interface-name', + 'parent-interface-name', + 'interface-type', + 'disabled'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'RelationIds': {'additionalProperties': False, + 'properties': {'relation-ids': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['relation-ids'], + 'type': 'object'}, + 'RelationResult': {'additionalProperties': False, + 'properties': {'endpoint': {'$ref': '#/definitions/Endpoint'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'integer'}, + 'key': {'type': 'string'}, + 'life': {'type': 'string'}}, + 'required': ['life', + 'id', + 'key', + 'endpoint'], + 'type': 'object'}, + 'RelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnit': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', 'unit'], + 'type': 'object'}, + 'RelationUnitPair': {'additionalProperties': False, + 'properties': {'local-unit': {'type': 'string'}, + 'relation': {'type': 'string'}, + 'remote-unit': {'type': 'string'}}, + 'required': ['relation', + 'local-unit', + 'remote-unit'], + 'type': 'object'}, + 'RelationUnitPairs': {'additionalProperties': False, + 'properties': {'relation-unit-pairs': {'items': {'$ref': '#/definitions/RelationUnitPair'}, + 'type': 'array'}}, + 'required': ['relation-unit-pairs'], + 'type': 'object'}, + 'RelationUnitSettings': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', + 'unit', + 'settings'], + 'type': 'object'}, + 'RelationUnits': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnit'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsSettings': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationUnitsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ResolvedModeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'mode': {'type': 'string'}}, + 'required': ['mode'], + 'type': 'object'}, + 'ResolvedModeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResolvedModeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'SettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StorageAddParams': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'storage': {'$ref': '#/definitions/StorageConstraints'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'name', 'storage'], + 'type': 'object'}, + 'StorageAttachment': {'additionalProperties': False, + 'properties': {'kind': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'location': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'owner-tag', + 'unit-tag', + 'kind', + 'location', + 'life'], + 'type': 'object'}, + 'StorageAttachmentId': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag'], + 'type': 'object'}, + 'StorageAttachmentIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/StorageAttachmentId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageAttachmentIdsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachmentIds'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentIdsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentIdsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StoragesAddParams': {'additionalProperties': False, + 'properties': {'storages': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}}, + 'required': ['storages'], + 'type': 'object'}, + 'StringBoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ok': {'type': 'boolean'}, + 'result': {'type': 'string'}}, + 'required': ['result', 'ok'], + 'type': 'object'}, + 'StringBoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringBoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'UnitNetworkConfig': {'additionalProperties': False, + 'properties': {'binding-name': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', 'binding-name'], + 'type': 'object'}, + 'UnitNetworkConfigResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}}, + 'required': ['info'], + 'type': 'object'}, + 'UnitNetworkConfigResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UnitNetworkConfigResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}, + 'UnitsNetworkConfig': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UnitNetworkConfig'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}}, + 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'Actions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'AddMetricBatches': {'properties': {'Params': {'$ref': '#/definitions/MetricBatchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AddUnitStorage': {'properties': {'Params': {'$ref': '#/definitions/StoragesAddParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AllMachinePorts': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachinePortsResults'}}, + 'type': 'object'}, + 'ApplicationStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationStatusResults'}}, + 'type': 'object'}, + 'AssignedMachine': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'AvailabilityZone': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'BeginActions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CACert': {'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'CharmArchiveSha256': {'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CharmModifiedVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'CharmURL': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'ClearResolved': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ClosePorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ConfigSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConfigSettingsResults'}}, + 'type': 'object'}, + 'CurrentModel': {'properties': {'Result': {'$ref': '#/definitions/ModelResult'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyAllSubordinates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyUnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnterScope': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FinishActions': {'properties': {'Params': {'$ref': '#/definitions/ActionExecutionResults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'GetMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, + 'type': 'object'}, + 'GetPrincipal': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'HasSubordinates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'JoinedRelations': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'LeaveScope': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'Merge': {'properties': {'Params': {'$ref': '#/definitions/MergeLeadershipSettingsBulkParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'NetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/UnitsNetworkConfig'}, + 'Result': {'$ref': '#/definitions/UnitNetworkConfigResults'}}, + 'type': 'object'}, + 'OpenPorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'ProviderType': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PublicAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Read': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GetLeadershipSettingsBulkResults'}}, + 'type': 'object'}, + 'ReadRemoteSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnitPairs'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'ReadSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'Relation': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationById': {'properties': {'Params': {'$ref': '#/definitions/RelationIds'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RemoveStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RequestReboot': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Resolved': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ResolvedModeResults'}}, + 'type': 'object'}, + 'SetAgentStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetApplicationStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/EntitiesCharmURL'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetWorkloadVersion': {'properties': {'Params': {'$ref': '#/definitions/EntityWorkloadVersions'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StorageAttachmentLife': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'StorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentResults'}}, + 'type': 'object'}, + 'UnitStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'UnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentIdsResults'}}, + 'type': 'object'}, + 'UpdateSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnitsSettings'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchActionNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchApplicationRelations': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchConfigSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchLeadershipSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchRelationUnits': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, + 'type': 'object'}, + 'WatchStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchUnitAddresses': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchUnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WorkloadVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIAddresses', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIHostPorts', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Actions(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddMetricBatches(self, batches=None): + ''' + 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=4, + params=_params) + _params['batches'] = batches + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddUnitStorage(self, storages=None): + ''' + storages : typing.Sequence[~StorageAddParams] + Returns -> ErrorResults + ''' + 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='Uniter', + request='AddUnitStorage', + version=4, + params=_params) + _params['storages'] = storages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachinePortsResults) + async def AllMachinePorts(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> MachinePortsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='AllMachinePorts', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationStatusResults) + async def ApplicationStatus(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ApplicationStatus', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AssignedMachine(self, entities=None): + ''' + 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='AssignedMachine', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + 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='AvailabilityZone', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def BeginActions(self, entities=None): + ''' + 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='BeginActions', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BytesResult) + async def CACert(self): + ''' + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CACert', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def CharmArchiveSha256(self, urls=None): + ''' + 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='CharmArchiveSha256', + version=4, + params=_params) + _params['urls'] = urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def CharmModifiedVersion(self, entities=None): + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CharmModifiedVersion', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def CharmURL(self, entities=None): + ''' + 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='CharmURL', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClearResolved(self, entities=None): + ''' + 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='ClearResolved', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClosePorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='ClosePorts', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConfigSettingsResults) + async def ConfigSettings(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ConfigSettings', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelResult) + async def CurrentModel(self): + ''' + + Returns -> ModelResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CurrentModel', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Destroy(self, entities=None): + ''' + 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='Destroy', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyAllSubordinates(self, entities=None): + ''' + 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='DestroyAllSubordinates', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyUnitStorageAttachments(self, entities=None): + ''' + 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='DestroyUnitStorageAttachments', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + 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='EnsureDead', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnterScope(self, relation_units=None): + ''' + 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='EnterScope', + version=4, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def FinishActions(self, results=None): + ''' + 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='FinishActions', + version=4, + params=_params) + _params['results'] = results + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): + ''' + 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='GetMeterStatus', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def GetPrincipal(self, entities=None): + ''' + 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='GetPrincipal', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def HasSubordinates(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def JoinedRelations(self, entities=None): + ''' + 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='Uniter', + request='JoinedRelations', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LeaveScope(self, relation_units=None): + ''' + 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=4, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Merge(self, params=None): + ''' + 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=4, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelConfig', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelUUID', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitNetworkConfigResults) + async def NetworkConfig(self, args=None): + ''' + args : typing.Sequence[~UnitNetworkConfig] + Returns -> UnitNetworkConfigResults + ''' + 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='NetworkConfig', + version=4, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def OpenPorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='OpenPorts', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PrivateAddress(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ProviderType(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ProviderType', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PublicAddress(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetLeadershipSettingsBulkResults) + async def Read(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadRemoteSettings(self, relation_unit_pairs=None): + ''' + 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=4, + params=_params) + _params['relation-unit-pairs'] = relation_unit_pairs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadSettings(self, relation_units=None): + ''' + 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=4, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def Relation(self, relation_units=None): + ''' + 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=4, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def RelationById(self, relation_ids=None): + ''' + 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=4, + params=_params) + _params['relation-ids'] = relation_ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveStorageAttachments(self, ids=None): + ''' + 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=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RequestReboot(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolvedModeResults) + async def Resolved(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetAgentStatus(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationStatus(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmURL(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUnitStatus(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetWorkloadVersion(self, entities=None): + ''' + 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='SetWorkloadVersion', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def StorageAttachmentLife(self, ids=None): + ''' + ids : typing.Sequence[~StorageAttachmentId] + 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='Uniter', + request='StorageAttachmentLife', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentResults) + async def StorageAttachments(self, ids=None): + ''' + 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='StorageAttachments', + version=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def UnitStatus(self, entities=None): + ''' + 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='Uniter', + request='UnitStatus', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentIdsResults) + async def UnitStorageAttachments(self, entities=None): + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='UnitStorageAttachments', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateSettings(self, relation_units=None): + ''' + relation_units : typing.Sequence[~RelationUnitSettings] + 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='UpdateSettings', + version=4, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + 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='Watch', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchAPIHostPorts', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(self, entities=None): + ''' + 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='WatchActionNotifications', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchApplicationRelations(self, entities=None): + ''' + 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='WatchApplicationRelations', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchConfigSettings(self, entities=None): + ''' + 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='WatchConfigSettings', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchForModelConfigChanges', + version=4, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchLeadershipSettings(self, entities=None): + ''' + 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='WatchLeadershipSettings', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMeterStatus(self, entities=None): + ''' + 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='WatchMeterStatus', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitsWatchResults) + async def WatchRelationUnits(self, relation_units=None): + ''' + 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=4, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchStorageAttachments(self, ids=None): + ''' + 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=4, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchUnitAddresses(self, entities=None): + ''' + 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='WatchUnitAddresses', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitStorageAttachments(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def WorkloadVersion(self, entities=None): + ''' + 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=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client5.py b/juju/client/old_clients/_client5.py new file mode 100644 index 000000000..511cb6ca7 --- /dev/null +++ b/juju/client/old_clients/_client5.py @@ -0,0 +1,10196 @@ +# 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.old_clients._definitions import * + + +class ActionFacade(Type): + name = 'Action' + version = 5 + schema = {'definitions': {'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionMessage': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}}, + 'required': ['timestamp', 'message'], + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'log': {'items': {'$ref': '#/definitions/ActionMessage'}, + 'type': 'array'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'Actions': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/Action'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionsByName': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}}, + 'type': 'object'}, + 'ActionsByNames': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByName'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionsByReceiver': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'receiver': {'type': 'string'}}, + 'type': 'object'}, + 'ActionsByReceivers': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByReceiver'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ApplicationCharmActionsResult': {'additionalProperties': False, + 'properties': {'actions': {'patternProperties': {'.*': {'$ref': '#/definitions/ActionSpec'}}, + 'type': 'object'}, + 'application-tag': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ApplicationsCharmActionsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationCharmActionsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'FindActionsByNames': {'additionalProperties': False, + 'properties': {'names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FindTags': {'additionalProperties': False, + 'properties': {'prefixes': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['prefixes'], + 'type': 'object'}, + 'FindTagsResults': {'additionalProperties': False, + 'properties': {'matches': {'patternProperties': {'.*': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'required': ['matches'], + 'type': 'object'}, + 'OperationQueryArgs': {'additionalProperties': False, + 'properties': {'applications': {'items': {'type': 'string'}, + 'type': 'array'}, + 'functions': {'items': {'type': 'string'}, + 'type': 'array'}, + 'status': {'items': {'type': 'string'}, + 'type': 'array'}, + 'units': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'RunParams': {'additionalProperties': False, + 'properties': {'applications': {'items': {'type': 'string'}, + 'type': 'array'}, + 'commands': {'type': 'string'}, + 'machines': {'items': {'type': 'string'}, + 'type': 'array'}, + 'timeout': {'type': 'integer'}, + 'units': {'items': {'type': 'string'}, + 'type': 'array'}, + 'workload-context': {'type': 'boolean'}}, + 'required': ['commands', 'timeout'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'Actions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'ApplicationsCharmsActions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationsCharmActionsResults'}}, + 'type': 'object'}, + 'Cancel': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'Enqueue': {'properties': {'Params': {'$ref': '#/definitions/Actions'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'FindActionTagsByPrefix': {'properties': {'Params': {'$ref': '#/definitions/FindTags'}, + 'Result': {'$ref': '#/definitions/FindTagsResults'}}, + 'type': 'object'}, + 'FindActionsByNames': {'properties': {'Params': {'$ref': '#/definitions/FindActionsByNames'}, + 'Result': {'$ref': '#/definitions/ActionsByNames'}}, + 'type': 'object'}, + 'ListAll': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'ListCompleted': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'ListPending': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'ListRunning': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'Operations': {'properties': {'Params': {'$ref': '#/definitions/OperationQueryArgs'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'Run': {'properties': {'Params': {'$ref': '#/definitions/RunParams'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'RunOnAllMachines': {'properties': {'Params': {'$ref': '#/definitions/RunParams'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'WatchActionsProgress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ActionResults) + async def Actions(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationsCharmActionsResults) + async def ApplicationsCharmsActions(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Cancel(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Enqueue(self, actions=None): + ''' + actions : typing.Sequence[~Action] + Returns -> ActionResults + ''' + 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='Enqueue', + version=5, + params=_params) + _params['actions'] = actions + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindTagsResults) + async def FindActionTagsByPrefix(self, prefixes=None): + ''' + prefixes : typing.Sequence[str] + Returns -> FindTagsResults + ''' + if prefixes is not None and not isinstance(prefixes, (bytes, str, list)): + raise Exception("Expected prefixes to be a Sequence, received: {}".format(type(prefixes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='FindActionTagsByPrefix', + version=5, + params=_params) + _params['prefixes'] = prefixes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByNames) + async def FindActionsByNames(self, names=None): + ''' + names : typing.Sequence[str] + Returns -> ActionsByNames + ''' + 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='Action', + request='FindActionsByNames', + version=5, + params=_params) + _params['names'] = names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListAll(self, entities=None): + ''' + 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='Action', + request='ListAll', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListCompleted(self, entities=None): + ''' + 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='Action', + request='ListCompleted', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListPending(self, entities=None): + ''' + 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='Action', + request='ListPending', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListRunning(self, entities=None): + ''' + 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='Action', + request='ListRunning', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Operations(self, applications=None, functions=None, status=None, units=None): + ''' + applications : typing.Sequence[str] + functions : typing.Sequence[str] + status : typing.Sequence[str] + units : typing.Sequence[str] + Returns -> ActionResults + ''' + 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 functions is not None and not isinstance(functions, (bytes, str, list)): + raise Exception("Expected functions to be a Sequence, received: {}".format(type(functions))) + + 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='Operations', + version=5, + params=_params) + _params['applications'] = applications + _params['functions'] = functions + _params['status'] = status + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Run(self, applications=None, commands=None, machines=None, timeout=None, units=None, workload_context=None): + ''' + applications : typing.Sequence[str] + commands : str + machines : typing.Sequence[str] + timeout : int + units : typing.Sequence[str] + workload_context : bool + Returns -> ActionResults + ''' + 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 machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + 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='Run', + version=5, + params=_params) + _params['applications'] = applications + _params['commands'] = commands + _params['machines'] = machines + _params['timeout'] = timeout + _params['units'] = units + _params['workload-context'] = workload_context + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def RunOnAllMachines(self, applications=None, commands=None, machines=None, timeout=None, units=None, workload_context=None): + ''' + applications : typing.Sequence[str] + commands : str + machines : typing.Sequence[str] + timeout : int + units : typing.Sequence[str] + workload_context : bool + Returns -> ActionResults + ''' + 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 machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + 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=5, + params=_params) + _params['applications'] = applications + _params['commands'] = commands + _params['machines'] = machines + _params['timeout'] = timeout + _params['units'] = units + _params['workload-context'] = workload_context + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchActionsProgress(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class ApplicationFacade(Type): + name = 'Application' + version = 5 + 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'}}, + 'required': ['application', + 'num-units', + 'placement'], + 'type': 'object'}, + 'AddApplicationUnitsResults': {'additionalProperties': False, + 'properties': {'units': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['units'], + 'type': 'object'}, + 'AddRelation': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['endpoints'], + 'type': 'object'}, + 'AddRelationResults': {'additionalProperties': False, + 'properties': {'endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmRelation'}}, + 'type': 'object'}}, + 'required': ['endpoints'], + 'type': 'object'}, + 'ApplicationCharmRelations': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationCharmRelationsResults': {'additionalProperties': False, + 'properties': {'charm-relations': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['charm-relations'], + 'type': 'object'}, + 'ApplicationDeploy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'attach-storage': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-yaml': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'num-units': {'type': 'integer'}, + 'placement': {'items': {'$ref': '#/definitions/Placement'}, + 'type': 'array'}, + 'resources': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'series': {'type': 'string'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'series', + 'charm-url', + 'channel', + 'num-units', + 'config-yaml', + 'constraints'], + 'type': 'object'}, + 'ApplicationDestroy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationExpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGetResults': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'series': {'type': 'string'}}, + 'required': ['application', + 'charm', + 'config', + 'constraints', + 'series'], + 'type': 'object'}, + 'ApplicationMetricCredential': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'metrics-credentials': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['application', + 'metrics-credentials'], + 'type': 'object'}, + 'ApplicationMetricCredentials': {'additionalProperties': False, + 'properties': {'creds': {'items': {'$ref': '#/definitions/ApplicationMetricCredential'}, + 'type': 'array'}}, + 'required': ['creds'], + 'type': 'object'}, + 'ApplicationOffer': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-url', + 'offer-name', + 'application-description', + 'endpoints', + 'spaces', + 'bindings', + 'access'], + 'type': 'object'}, + 'ApplicationSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'options': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', 'options'], + 'type': 'object'}, + 'ApplicationSetCharm': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'config-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-settings-yaml': {'type': 'string'}, + 'force-series': {'type': 'boolean'}, + 'force-units': {'type': 'boolean'}, + 'resource-ids': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-constraints': {'patternProperties': {'.*': {'$ref': '#/definitions/StorageConstraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'charm-url', + 'channel', + 'force-units', + 'force-series'], + 'type': 'object'}, + 'ApplicationUnexpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationUnset': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'options': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', 'options'], + 'type': 'object'}, + 'ApplicationUpdate': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'force-charm-url': {'type': 'boolean'}, + 'force-series': {'type': 'boolean'}, + 'min-units': {'type': 'integer'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'settings-yaml': {'type': 'string'}}, + 'required': ['application', + 'charm-url', + 'force-charm-url', + 'force-series', + 'settings-yaml'], + 'type': 'object'}, + 'ApplicationsDeploy': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/ApplicationDeploy'}, + 'type': 'array'}}, + 'required': ['applications'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'ConsumeApplicationArg': {'additionalProperties': False, + 'properties': {'ApplicationOffer': {'$ref': '#/definitions/ApplicationOffer'}, + 'application-alias': {'type': 'string'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}}, + 'required': ['ApplicationOffer'], + 'type': 'object'}, + 'ConsumeApplicationArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ConsumeApplicationArg'}, + 'type': 'array'}}, + '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'}, + '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'}, + 'DestroyApplicationUnits': {'additionalProperties': False, + 'properties': {'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + 'type': 'object'}, + 'DestroyRelation': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['endpoints'], + 'type': 'object'}, + 'DestroyUnitInfo': {'additionalProperties': False, + 'properties': {'destroyed-storage': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'detached-storage': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + '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'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetApplicationConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'GetConstraintsResults': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit', + 'scope'], + 'type': 'object'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + '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'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'spaces': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}}, + 'type': 'object'}}, + 'properties': {'AddRelation': {'properties': {'Params': {'$ref': '#/definitions/AddRelation'}, + 'Result': {'$ref': '#/definitions/AddRelationResults'}}, + 'type': 'object'}, + 'AddUnits': {'properties': {'Params': {'$ref': '#/definitions/AddApplicationUnits'}, + 'Result': {'$ref': '#/definitions/AddApplicationUnitsResults'}}, + 'type': 'object'}, + 'CharmRelations': {'properties': {'Params': {'$ref': '#/definitions/ApplicationCharmRelations'}, + 'Result': {'$ref': '#/definitions/ApplicationCharmRelationsResults'}}, + 'type': 'object'}, + 'Consume': {'properties': {'Params': {'$ref': '#/definitions/ConsumeApplicationArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Deploy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationsDeploy'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}}, + 'type': 'object'}, + 'DestroyApplication': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DestroyApplicationResults'}}, + 'type': 'object'}, + 'DestroyRelation': {'properties': {'Params': {'$ref': '#/definitions/DestroyRelation'}}, + 'type': 'object'}, + 'DestroyUnit': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DestroyUnitResults'}}, + 'type': 'object'}, + 'DestroyUnits': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, + 'type': 'object'}, + 'Expose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationExpose'}}, + 'type': 'object'}, + 'Get': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/ApplicationGetResults'}}, + 'type': 'object'}, + 'GetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'GetConstraints': {'properties': {'Params': {'$ref': '#/definitions/GetApplicationConstraints'}, + 'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, + 'type': 'object'}, + 'Set': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, + 'type': 'object'}, + 'SetCharm': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, + 'type': 'object'}, + 'SetConstraints': {'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetMetricCredentials': {'properties': {'Params': {'$ref': '#/definitions/ApplicationMetricCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Unexpose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnexpose'}}, + 'type': 'object'}, + 'Unset': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, + 'type': 'object'}, + 'Update': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUpdate'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddRelationResults) + async def AddRelation(self, endpoints=None): + ''' + endpoints : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddRelation', + version=5, + params=_params) + _params['endpoints'] = endpoints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddApplicationUnitsResults) + async def AddUnits(self, application=None, attach_storage=None, num_units=None, placement=None): + ''' + application : str + attach_storage : typing.Sequence[str] + num_units : int + placement : typing.Sequence[~Placement] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='AddUnits', + version=5, + params=_params) + _params['application'] = application + _params['attach-storage'] = attach_storage + _params['num-units'] = num_units + _params['placement'] = placement + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationCharmRelationsResults) + async def CharmRelations(self, application=None): + ''' + 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=5, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Consume(self, args=None): + ''' + 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=5, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Deploy(self, applications=None): + ''' + 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=5, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Destroy(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Destroy', + version=5, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyApplicationResults) + async def DestroyApplication(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> DestroyApplicationResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='DestroyApplication', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyRelation(self, endpoints=None): + ''' + endpoints : typing.Sequence[str] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyRelation', + version=5, + params=_params) + _params['endpoints'] = endpoints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyUnitResults) + async def DestroyUnit(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> DestroyUnitResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='DestroyUnit', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyUnits(self, unit_names=None): + ''' + unit_names : typing.Sequence[str] + Returns -> None + ''' + if unit_names is not None and not isinstance(unit_names, (bytes, str, list)): + raise Exception("Expected unit_names to be a Sequence, received: {}".format(type(unit_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnits', + version=5, + params=_params) + _params['unit-names'] = unit_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Expose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=5, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetResults) + async def Get(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Get', + version=5, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def GetCharmURL(self, application=None): + ''' + application : str + Returns -> StringResult + ''' + 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='GetCharmURL', + version=5, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetConstraintsResults) + async def GetConstraints(self, application=None): + ''' + application : str + Returns -> GetConstraintsResults + ''' + 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='GetConstraints', + version=5, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Set(self, application=None, options=None): + ''' + application : str + options : typing.Mapping[str, 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 options is not None and not isinstance(options, dict): + raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Set', + version=5, + params=_params) + _params['application'] = application + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetCharm(self, application=None, channel=None, charm_url=None, config_settings=None, config_settings_yaml=None, force_series=None, force_units=None, resource_ids=None, storage_constraints=None): + ''' + application : str + channel : str + charm_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + force_series : bool + force_units : bool + resource_ids : typing.Mapping[str, str] + storage_constraints : typing.Mapping[str, ~StorageConstraints] + Returns -> None + ''' + 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_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 force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + 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 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=5, + params=_params) + _params['application'] = application + _params['channel'] = channel + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['force-series'] = force_series + _params['force-units'] = force_units + _params['resource-ids'] = resource_ids + _params['storage-constraints'] = storage_constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetConstraints(self, application=None, constraints=None): + ''' + 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=5, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMetricCredentials(self, creds=None): + ''' + 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=5, + params=_params) + _params['creds'] = creds + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unexpose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=5, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unset(self, application=None, options=None): + ''' + application : str + options : 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 options is not None and not isinstance(options, (bytes, str, list)): + raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unset', + version=5, + params=_params) + _params['application'] = application + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Update(self, application=None, charm_url=None, constraints=None, force_charm_url=None, force_series=None, min_units=None, settings=None, settings_yaml=None): + ''' + application : str + charm_url : str + constraints : Value + force_charm_url : bool + force_series : bool + min_units : int + settings : typing.Mapping[str, str] + settings_yaml : str + Returns -> None + ''' + if application is not None and not isinstance(application, (bytes, str)): + raise Exception("Expected application to be a str, received: {}".format(type(application))) + + 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 constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + if force_charm_url is not None and not isinstance(force_charm_url, bool): + raise Exception("Expected force_charm_url to be a bool, received: {}".format(type(force_charm_url))) + + if force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + if min_units is not None and not isinstance(min_units, int): + raise Exception("Expected min_units to be a int, received: {}".format(type(min_units))) + + if settings is not None and not isinstance(settings, dict): + raise Exception("Expected settings to be a Mapping, received: {}".format(type(settings))) + + if settings_yaml is not None and not isinstance(settings_yaml, (bytes, str)): + raise Exception("Expected settings_yaml to be a str, received: {}".format(type(settings_yaml))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Update', + version=5, + params=_params) + _params['application'] = application + _params['charm-url'] = charm_url + _params['constraints'] = constraints + _params['force-charm-url'] = force_charm_url + _params['force-series'] = force_series + _params['min-units'] = min_units + _params['settings'] = settings + _params['settings-yaml'] = settings_yaml + reply = await self.rpc(msg) + return reply + + + +class BundleFacade(Type): + name = 'Bundle' + version = 5 + schema = {'definitions': {'BundleChange': {'additionalProperties': False, + 'properties': {'args': {'items': {'additionalProperties': True, + 'type': 'object'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesMapArgs': {'additionalProperties': False, + 'properties': {'args': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesMapArgsResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChangesMapArgs'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'BundleChangesParams': {'additionalProperties': False, + 'properties': {'bundleURL': {'type': 'string'}, + 'yaml': {'type': 'string'}}, + 'required': ['yaml', 'bundleURL'], + 'type': 'object'}, + 'BundleChangesResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ExportBundleParams': {'additionalProperties': False, + 'properties': {'include-charm-defaults': {'type': 'boolean'}}, + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'ExportBundle': {'description': 'ExportBundle exports the ' + 'current model configuration ' + 'as bundle.', + 'properties': {'Params': {'$ref': '#/definitions/ExportBundleParams'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'GetChanges': {'description': 'GetChanges returns the list of ' + 'changes required to deploy the ' + 'given bundle\n' + 'data. The changes are sorted by ' + 'requirements, so that they can ' + 'be applied in\n' + 'order.\n' + 'GetChanges has been superseded ' + 'in favour of GetChangesMapArgs. ' + "It's\n" + 'preferable to use that new ' + 'method to add new functionality ' + 'and move clients\n' + 'away from this one.', + 'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, + 'type': 'object'}, + 'GetChangesMapArgs': {'description': 'GetChangesMapArgs ' + 'returns the list of ' + 'changes required to ' + 'deploy the given\n' + 'bundle data. The changes ' + 'are sorted by ' + 'requirements, so that ' + 'they can be\n' + 'applied in order.\n' + 'V4 GetChangesMapArgs is ' + 'not supported on ' + 'anything less than v4', + 'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesMapArgsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringResult) + async def ExportBundle(self, include_charm_defaults=None): + ''' + ExportBundle exports the current model configuration as bundle. + + include_charm_defaults : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Bundle', + request='ExportBundle', + version=5, + params=_params) + _params['include-charm-defaults'] = include_charm_defaults + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BundleChangesResults) + async def 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=5, + params=_params) + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BundleChangesMapArgsResults) + async def 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=5, + params=_params) + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml + reply = await self.rpc(msg) + return reply + + + +class ClientFacade(Type): + name = 'Client' + version = 5 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'AddCharm': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'url': {'type': 'string'}}, + 'required': ['url', 'channel', 'force'], + 'type': 'object'}, + 'AddCharmWithAuthorization': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'url': {'type': 'string'}}, + 'required': ['url', + 'channel', + 'macaroon', + 'force'], + 'type': 'object'}, + 'AddMachineParams': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'container-type': {'type': 'string'}, + 'disks': {'items': {'$ref': '#/definitions/Constraints'}, + 'type': 'array'}, + 'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'instance-id': {'type': 'string'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'parent-id': {'type': 'string'}, + 'placement': {'$ref': '#/definitions/Placement'}, + 'series': {'type': 'string'}}, + 'required': ['series', + 'constraints', + 'jobs', + 'parent-id', + 'container-type', + 'instance-id', + 'nonce', + 'hardware-characteristics', + 'addresses'], + 'type': 'object'}, + 'AddMachines': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'AddMachinesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'machine': {'type': 'string'}}, + 'required': ['machine'], + 'type': 'object'}, + 'AddMachinesResults': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'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'}, + 'AgentVersionResult': {'additionalProperties': False, + 'properties': {'version': {'$ref': '#/definitions/Number'}}, + 'required': ['version'], + 'type': 'object'}, + 'AllWatcherId': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'ApplicationOfferStatus': {'additionalProperties': False, + 'properties': {'active-connected-count': {'type': 'integer'}, + 'application-name': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteEndpoint'}}, + 'type': 'object'}, + 'err': {'$ref': '#/definitions/Error'}, + 'offer-name': {'type': 'string'}, + 'total-connected-count': {'type': 'integer'}}, + 'required': ['offer-name', + 'application-name', + 'charm', + 'endpoints', + 'active-connected-count', + 'total-connected-count'], + 'type': 'object'}, + 'ApplicationStatus': {'additionalProperties': False, + 'properties': {'can-upgrade-to': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'charm-channel': {'type': 'string'}, + 'charm-profile': {'type': 'string'}, + 'charm-version': {'type': 'string'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'err': {'$ref': '#/definitions/Error'}, + 'exposed': {'type': 'boolean'}, + 'exposed-endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/ExposedEndpoint'}}, + 'type': 'object'}, + 'int': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'meter-statuses': {'patternProperties': {'.*': {'$ref': '#/definitions/MeterStatus'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'public-address': {'type': 'string'}, + 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'series': {'type': 'string'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}, + 'subordinate-to': {'items': {'type': 'string'}, + 'type': 'array'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, + 'type': 'object'}, + 'workload-version': {'type': 'string'}}, + 'required': ['charm', + 'charm-version', + 'charm-profile', + 'series', + 'exposed', + 'life', + 'relations', + 'can-upgrade-to', + 'subordinate-to', + 'units', + 'meter-statuses', + 'status', + 'workload-version', + 'endpoint-bindings', + 'public-address'], + 'type': 'object'}, + 'Binary': {'additionalProperties': False, + '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'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build', + 'Number', + 'Release', + 'Arch'], + 'type': 'object'}, + 'BranchStatus': {'additionalProperties': False, + 'properties': {'assigned-units': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'created': {'type': 'integer'}, + 'created-by': {'type': 'string'}}, + 'required': ['assigned-units', + 'created', + 'created-by'], + 'type': 'object'}, + 'BundleChange': {'additionalProperties': False, + 'properties': {'args': {'items': {'additionalProperties': True, + 'type': 'object'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesParams': {'additionalProperties': False, + 'properties': {'bundleURL': {'type': 'string'}, + 'yaml': {'type': 'string'}}, + 'required': ['yaml', 'bundleURL'], + 'type': 'object'}, + 'BundleChangesResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'DestroyMachines': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'machine-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['machine-names', 'force'], + 'type': 'object'}, + 'DetailedStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'err': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}, + 'kind': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['status', + 'info', + 'data', + 'since', + 'kind', + 'version', + 'life'], + 'type': 'object'}, + 'EndpointStatus': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}, + 'subordinate': {'type': 'boolean'}}, + 'required': ['application', + 'name', + 'role', + 'subordinate'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'FindToolsParams': {'additionalProperties': False, + 'properties': {'agentstream': {'type': 'string'}, + 'arch': {'type': 'string'}, + 'major': {'type': 'integer'}, + 'minor': {'type': 'integer'}, + 'number': {'$ref': '#/definitions/Number'}, + 'os-type': {'type': 'string'}, + 'series': {'type': 'string'}}, + 'required': ['number', + 'major', + 'minor', + 'arch', + 'series', + 'os-type', + 'agentstream'], + 'type': 'object'}, + 'FindToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'list': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['list'], + 'type': 'object'}, + 'FullStatus': {'additionalProperties': False, + 'properties': {'applications': {'patternProperties': {'.*': {'$ref': '#/definitions/ApplicationStatus'}}, + 'type': 'object'}, + 'branches': {'patternProperties': {'.*': {'$ref': '#/definitions/BranchStatus'}}, + 'type': 'object'}, + 'controller-timestamp': {'format': 'date-time', + 'type': 'string'}, + 'machines': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}}, + 'type': 'object'}, + 'model': {'$ref': '#/definitions/ModelStatusInfo'}, + 'offers': {'patternProperties': {'.*': {'$ref': '#/definitions/ApplicationOfferStatus'}}, + 'type': 'object'}, + 'relations': {'items': {'$ref': '#/definitions/RelationStatus'}, + 'type': 'array'}, + 'remote-applications': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteApplicationStatus'}}, + 'type': 'object'}}, + 'required': ['model', + 'machines', + 'applications', + 'remote-applications', + 'offers', + 'relations', + 'controller-timestamp', + 'branches'], + 'type': 'object'}, + 'GetConstraintsResults': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'root-disk-source': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'History': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'statuses': {'items': {'$ref': '#/definitions/DetailedStatus'}, + 'type': 'array'}}, + 'required': ['statuses'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + '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'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'LXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachineHardware': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'MachineStatus': {'additionalProperties': False, + 'properties': {'agent-status': {'$ref': '#/definitions/DetailedStatus'}, + 'constraints': {'type': 'string'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}}, + 'type': 'object'}, + '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': {'items': {'type': 'string'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'lxd-profiles': {'patternProperties': {'.*': {'$ref': '#/definitions/LXDProfile'}}, + 'type': 'object'}, + 'modification-status': {'$ref': '#/definitions/DetailedStatus'}, + 'network-interfaces': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInterface'}}, + 'type': 'object'}, + 'primary-controller-machine': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'wants-vote': {'type': 'boolean'}}, + 'required': ['agent-status', + 'instance-status', + 'modification-status', + 'dns-name', + 'instance-id', + 'display-name', + 'series', + 'id', + 'containers', + 'constraints', + 'hardware', + 'jobs', + 'has-vote', + 'wants-vote'], + 'type': 'object'}, + 'MeterStatus': {'additionalProperties': False, + 'properties': {'color': {'type': 'string'}, + 'message': {'type': 'string'}}, + 'required': ['color', 'message'], + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelInfo': {'additionalProperties': False, + 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, + 'cloud-credential-tag': {'type': 'string'}, + 'cloud-credential-validity': {'type': 'boolean'}, + 'cloud-region': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'controller-uuid': {'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'}, + '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', + 'sla', + 'agent-version'], + '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'}, + 'ModelSLA': {'additionalProperties': False, + 'properties': {'ModelSLAInfo': {'$ref': '#/definitions/ModelSLAInfo'}, + 'creds': {'items': {'type': 'integer'}, + 'type': 'array'}, + 'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', + 'owner', + 'ModelSLAInfo', + 'creds'], + 'type': 'object'}, + 'ModelSLAInfo': {'additionalProperties': False, + 'properties': {'level': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['level', 'owner'], + 'type': 'object'}, + 'ModelSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelStatusInfo': {'additionalProperties': False, + 'properties': {'available-version': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'meter-status': {'$ref': '#/definitions/MeterStatus'}, + 'model-status': {'$ref': '#/definitions/DetailedStatus'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'sla': {'type': 'string'}, + 'type': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['name', + 'type', + 'cloud-tag', + 'version', + 'available-version', + 'model-status', + 'meter-status', + 'sla'], + 'type': 'object'}, + 'ModelUnset': {'additionalProperties': False, + 'properties': {'keys': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['keys'], + 'type': 'object'}, + 'ModelUserInfo': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'display-name': {'type': 'string'}, + 'last-connection': {'format': 'date-time', + 'type': 'string'}, + 'user': {'type': 'string'}}, + 'required': ['user', + 'display-name', + 'last-connection', + 'access'], + 'type': 'object'}, + 'ModelUserInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ModelUserInfo'}}, + 'type': 'object'}, + 'ModelUserInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ModelUserInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'NetworkInterface': {'additionalProperties': False, + 'properties': {'dns-nameservers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway': {'type': 'string'}, + 'ip-addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'is-up': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'space': {'type': 'string'}}, + 'required': ['ip-addresses', + 'mac-address', + 'is-up'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'PrivateAddress': {'additionalProperties': False, + 'properties': {'target': {'type': 'string'}}, + 'required': ['target'], + 'type': 'object'}, + 'PrivateAddressResults': {'additionalProperties': False, + 'properties': {'private-address': {'type': 'string'}}, + 'required': ['private-address'], + 'type': 'object'}, + 'ProvisioningScriptParams': {'additionalProperties': False, + 'properties': {'data-dir': {'type': 'string'}, + 'disable-package-commands': {'type': 'boolean'}, + 'machine-id': {'type': 'string'}, + 'nonce': {'type': 'string'}}, + 'required': ['machine-id', + 'nonce', + 'data-dir', + 'disable-package-commands'], + 'type': 'object'}, + 'ProvisioningScriptResult': {'additionalProperties': False, + 'properties': {'script': {'type': 'string'}}, + 'required': ['script'], + 'type': 'object'}, + 'PublicAddress': {'additionalProperties': False, + 'properties': {'target': {'type': 'string'}}, + 'required': ['target'], + 'type': 'object'}, + 'PublicAddressResults': {'additionalProperties': False, + 'properties': {'public-address': {'type': 'string'}}, + 'required': ['public-address'], + 'type': 'object'}, + 'RelationStatus': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'$ref': '#/definitions/EndpointStatus'}, + 'type': 'array'}, + 'id': {'type': 'integer'}, + 'interface': {'type': 'string'}, + 'key': {'type': 'string'}, + 'scope': {'type': 'string'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}}, + 'required': ['id', + 'key', + 'interface', + 'scope', + 'endpoints', + 'status'], + 'type': 'object'}, + 'RemoteApplicationStatus': {'additionalProperties': False, + 'properties': {'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'err': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'relations': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'status': {'$ref': '#/definitions/DetailedStatus'}}, + 'required': ['offer-url', + 'offer-name', + 'endpoints', + 'life', + 'relations', + 'status'], + 'type': 'object'}, + 'RemoteEndpoint': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'limit'], + 'type': 'object'}, + 'ResolveCharmResult': {'additionalProperties': False, + 'properties': {'error': {'type': 'string'}, + 'url': {'type': 'string'}}, + 'type': 'object'}, + 'ResolveCharmResults': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/ResolveCharmResult'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'ResolveCharms': {'additionalProperties': False, + 'properties': {'references': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['references'], + 'type': 'object'}, + 'Resolved': {'additionalProperties': False, + 'properties': {'retry': {'type': 'boolean'}, + 'unit-name': {'type': 'string'}}, + 'required': ['unit-name', 'retry'], + 'type': 'object'}, + 'SetConstraints': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}}, + 'required': ['application', 'constraints'], + 'type': 'object'}, + 'SetModelAgentVersion': {'additionalProperties': False, + 'properties': {'agent-stream': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'version': {'$ref': '#/definitions/Number'}}, + 'required': ['version'], + 'type': 'object'}, + 'StatusHistoryFilter': {'additionalProperties': False, + 'properties': {'date': {'format': 'date-time', + 'type': 'string'}, + 'delta': {'type': 'integer'}, + 'exclude': {'items': {'type': 'string'}, + 'type': 'array'}, + 'size': {'type': 'integer'}}, + 'required': ['size', + 'date', + 'delta', + 'exclude'], + 'type': 'object'}, + 'StatusHistoryRequest': {'additionalProperties': False, + 'properties': {'filter': {'$ref': '#/definitions/StatusHistoryFilter'}, + 'historyKind': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tag': {'type': 'string'}}, + 'required': ['historyKind', + 'size', + 'filter', + 'tag'], + 'type': 'object'}, + 'StatusHistoryRequests': {'additionalProperties': False, + 'properties': {'requests': {'items': {'$ref': '#/definitions/StatusHistoryRequest'}, + 'type': 'array'}}, + 'required': ['requests'], + 'type': 'object'}, + 'StatusHistoryResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'history': {'$ref': '#/definitions/History'}}, + 'required': ['history'], + 'type': 'object'}, + 'StatusHistoryResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusHistoryResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusParams': {'additionalProperties': False, + 'properties': {'patterns': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['patterns'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'SupportedFeature': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['name', 'description'], + 'type': 'object'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'UnitStatus': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'agent-status': {'$ref': '#/definitions/DetailedStatus'}, + 'charm': {'type': 'string'}, + 'leader': {'type': 'boolean'}, + 'machine': {'type': 'string'}, + 'opened-ports': {'items': {'type': 'string'}, + 'type': 'array'}, + 'provider-id': {'type': 'string'}, + 'public-address': {'type': 'string'}, + 'subordinates': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitStatus'}}, + 'type': 'object'}, + 'workload-status': {'$ref': '#/definitions/DetailedStatus'}, + 'workload-version': {'type': 'string'}}, + 'required': ['agent-status', + 'workload-status', + 'workload-version', + 'machine', + 'opened-ports', + 'public-address', + 'charm', + 'subordinates'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'host/port addresses stored in ' + 'state.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'AbortCurrentUpgrade': {'description': 'AbortCurrentUpgrade ' + 'aborts and archives ' + 'the current upgrade\n' + 'synchronisation ' + 'record, if any.', + 'type': 'object'}, + 'AddCharm': {'description': 'NOTE: AddCharm is deprecated as ' + 'of juju 2.9 and charms facade ' + 'version 3.\n' + 'Please discontinue use and move ' + 'to the charms facade version.\n' + '\n' + 'TODO: remove in juju 3.0', + 'properties': {'Params': {'$ref': '#/definitions/AddCharm'}}, + 'type': 'object'}, + 'AddCharmWithAuthorization': {'description': 'AddCharmWithAuthorization ' + 'adds the given ' + 'charm URL (which ' + 'must include\n' + 'revision) to the ' + 'model, if it ' + 'does not exist ' + 'yet. Local ' + 'charms are not\n' + 'supported, only ' + 'charm store ' + 'URLs. See also ' + 'AddLocalCharm().\n' + '\n' + 'The ' + 'authorization ' + 'macaroon, ' + 'args.CharmStoreMacaroon, ' + 'may be omitted, ' + 'in\n' + 'which case this ' + 'call is ' + 'equivalent to ' + 'AddCharm.\n' + '\n' + 'NOTE: ' + 'AddCharmWithAuthorization ' + 'is deprecated as ' + 'of juju 2.9 and ' + 'charms\n' + 'facade version ' + '3. Please ' + 'discontinue use ' + 'and move to the ' + 'charms facade\n' + 'version.\n' + '\n' + 'TODO: remove in ' + 'juju 3.0', + 'properties': {'Params': {'$ref': '#/definitions/AddCharmWithAuthorization'}}, + 'type': 'object'}, + 'AddMachines': {'description': 'AddMachines adds new machines ' + 'with the supplied parameters.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'AddMachinesV2': {'description': 'AddMachinesV2 adds new ' + 'machines with the supplied ' + 'parameters.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'AgentVersion': {'description': 'AgentVersion returns the ' + 'current version that the API ' + 'server is running.', + 'properties': {'Result': {'$ref': '#/definitions/AgentVersionResult'}}, + 'type': 'object'}, + 'CACert': {'description': 'CACert returns the certificate used ' + 'to validate the state connection.', + 'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'DestroyMachines': {'description': 'DestroyMachines removes a ' + 'given set of machines.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyMachines'}}, + 'type': 'object'}, + 'FindTools': {'description': 'FindTools returns a List ' + 'containing all tools matching ' + 'the given parameters.', + 'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, + 'Result': {'$ref': '#/definitions/FindToolsResult'}}, + 'type': 'object'}, + 'FullStatus': {'description': 'FullStatus gives the ' + 'information needed for juju ' + 'status over the api', + 'properties': {'Params': {'$ref': '#/definitions/StatusParams'}, + 'Result': {'$ref': '#/definitions/FullStatus'}}, + 'type': 'object'}, + 'GetBundleChanges': {'description': 'GetBundleChanges returns ' + 'the list of changes ' + 'required to deploy the ' + 'given\n' + 'bundle data. The changes ' + 'are sorted by ' + 'requirements, so that ' + 'they can be\n' + 'applied in order.\n' + 'Deprecated: clients ' + 'should use the GetChanges ' + 'endpoint on the Bundle ' + 'facade.\n' + 'Note: any new feature in ' + 'the future like devices ' + 'will never be supported ' + 'here.', + 'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, + 'type': 'object'}, + 'GetModelConstraints': {'description': 'GetModelConstraints ' + 'returns the ' + 'constraints for the ' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/GetConstraintsResults'}}, + 'type': 'object'}, + 'InjectMachines': {'description': 'InjectMachines injects a ' + 'machine into state with ' + 'provisioned status.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'ModelGet': {'description': 'ModelGet implements the ' + 'server-side part of the\n' + 'model-config CLI command.', + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelInfo': {'description': 'ModelInfo returns information ' + 'about the current model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelInfo'}}, + 'type': 'object'}, + 'ModelSet': {'description': 'ModelSet implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSet'}}, + 'type': 'object'}, + 'ModelUnset': {'description': 'ModelUnset implements the ' + 'server-side part of the\n' + 'set-model-config CLI command.', + 'properties': {'Params': {'$ref': '#/definitions/ModelUnset'}}, + 'type': 'object'}, + 'ModelUserInfo': {'description': 'ModelUserInfo returns ' + 'information on all users in ' + 'the model.', + 'properties': {'Result': {'$ref': '#/definitions/ModelUserInfoResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'description': 'PrivateAddress implements ' + 'the server side of ' + 'Client.PrivateAddress.', + 'properties': {'Params': {'$ref': '#/definitions/PrivateAddress'}, + 'Result': {'$ref': '#/definitions/PrivateAddressResults'}}, + 'type': 'object'}, + 'ProvisioningScript': {'description': 'ProvisioningScript ' + 'returns a shell script ' + 'that, when run,\n' + 'provisions a machine ' + 'agent on the machine ' + 'executing the script.', + 'properties': {'Params': {'$ref': '#/definitions/ProvisioningScriptParams'}, + 'Result': {'$ref': '#/definitions/ProvisioningScriptResult'}}, + 'type': 'object'}, + 'PublicAddress': {'description': 'PublicAddress implements the ' + 'server side of ' + 'Client.PublicAddress.', + 'properties': {'Params': {'$ref': '#/definitions/PublicAddress'}, + 'Result': {'$ref': '#/definitions/PublicAddressResults'}}, + 'type': 'object'}, + 'ResolveCharms': {'description': 'ResolveCharms resolves the ' + 'best available charm URLs ' + 'with series, for charm\n' + 'locations without a series ' + 'specified.\n' + '\n' + 'NOTE: ResolveCharms is ' + 'deprecated as of juju 2.9 ' + 'and charms facade version ' + '3.\n' + 'Please discontinue use and ' + 'move to the charms facade ' + 'version.\n' + '\n' + 'TODO: remove in juju 3.0', + 'properties': {'Params': {'$ref': '#/definitions/ResolveCharms'}, + 'Result': {'$ref': '#/definitions/ResolveCharmResults'}}, + 'type': 'object'}, + 'Resolved': {'description': 'Resolved implements the server ' + 'side of Client.Resolved.', + 'properties': {'Params': {'$ref': '#/definitions/Resolved'}}, + 'type': 'object'}, + 'RetryProvisioning': {'description': 'RetryProvisioning marks ' + 'a provisioning error as ' + 'transient on the ' + 'machines.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SLALevel': {'description': 'SLALevel returns the current sla ' + 'level for the model.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetModelAgentVersion': {'description': 'SetModelAgentVersion ' + 'sets the model agent ' + 'version.', + 'properties': {'Params': {'$ref': '#/definitions/SetModelAgentVersion'}}, + 'type': 'object'}, + 'SetModelConstraints': {'description': 'SetModelConstraints ' + 'sets the constraints ' + 'for the model.', + 'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetSLALevel': {'description': 'SetSLALevel sets the sla level ' + 'on the model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSLA'}}, + 'type': 'object'}, + 'StatusHistory': {'description': 'StatusHistory returns a ' + 'slice of past statuses for ' + 'several entities.', + 'properties': {'Params': {'$ref': '#/definitions/StatusHistoryRequests'}, + 'Result': {'$ref': '#/definitions/StatusHistoryResults'}}, + 'type': 'object'}, + 'WatchAll': {'description': 'WatchAll initiates a watcher for ' + 'entities in the connected model.', + 'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + APIHostPorts returns the API host/port addresses stored in state. + + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='APIHostPorts', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AbortCurrentUpgrade(self): + ''' + AbortCurrentUpgrade aborts and archives the current upgrade + synchronisation record, if any. + + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='AbortCurrentUpgrade', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AddCharm(self, channel=None, force=None, url=None): + ''' + NOTE: AddCharm is deprecated as of juju 2.9 and charms facade version 3. + Please discontinue use and move to the charms facade version. + + TODO: remove in juju 3.0 + + channel : str + force : bool + url : str + Returns -> None + ''' + 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 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='Client', + request='AddCharm', + version=5, + params=_params) + _params['channel'] = channel + _params['force'] = force + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def AddCharmWithAuthorization(self, channel=None, force=None, macaroon=None, url=None): + ''' + AddCharmWithAuthorization adds the given charm URL (which must include + revision) to the model, if it does not exist yet. Local charms are not + supported, only charm store URLs. See also AddLocalCharm(). + + The authorization macaroon, args.CharmStoreMacaroon, may be omitted, in + which case this call is equivalent to AddCharm. + + NOTE: AddCharmWithAuthorization is deprecated as of juju 2.9 and charms + facade version 3. Please discontinue use and move to the charms facade + version. + + TODO: remove in juju 3.0 + + channel : str + force : bool + macaroon : Macaroon + url : str + Returns -> None + ''' + 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 macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): + raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) + + 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='Client', + request='AddCharmWithAuthorization', + version=5, + params=_params) + _params['channel'] = channel + _params['force'] = force + _params['macaroon'] = macaroon + _params['url'] = url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def AddMachines(self, params=None): + ''' + AddMachines adds new machines with the supplied parameters. + + 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='Client', + request='AddMachines', + version=5, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def AddMachinesV2(self, params=None): + ''' + AddMachinesV2 adds new machines with the supplied parameters. + + 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='Client', + request='AddMachinesV2', + version=5, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AgentVersionResult) + async def AgentVersion(self): + ''' + AgentVersion returns the current version that the API server is running. + + + Returns -> AgentVersionResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='AgentVersion', + version=5, + params=_params) + + 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='Client', + request='CACert', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyMachines(self, force=None, machine_names=None): + ''' + DestroyMachines removes a given set of machines. + + force : bool + machine_names : typing.Sequence[str] + Returns -> None + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if machine_names is not None and not isinstance(machine_names, (bytes, str, list)): + raise Exception("Expected machine_names to be a Sequence, received: {}".format(type(machine_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='DestroyMachines', + version=5, + params=_params) + _params['force'] = force + _params['machine-names'] = machine_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindToolsResult) + async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, number=None, os_type=None, series=None): + ''' + FindTools returns a List containing all tools matching the given parameters. + + agentstream : str + arch : str + major : int + minor : int + number : Number + os_type : str + series : 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 minor is not None and not isinstance(minor, int): + raise Exception("Expected minor to be a int, received: {}".format(type(minor))) + + 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))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='FindTools', + version=5, + params=_params) + _params['agentstream'] = agentstream + _params['arch'] = arch + _params['major'] = major + _params['minor'] = minor + _params['number'] = number + _params['os-type'] = os_type + _params['series'] = series + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FullStatus) + async def 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=5, + params=_params) + _params['patterns'] = patterns + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BundleChangesResults) + async def GetBundleChanges(self, bundleurl=None, yaml=None): + ''' + GetBundleChanges 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. + Deprecated: clients should use the GetChanges endpoint on the Bundle facade. + Note: any new feature in the future like devices will never be supported here. + + 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='Client', + request='GetBundleChanges', + version=5, + params=_params) + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetConstraintsResults) + async def GetModelConstraints(self): + ''' + GetModelConstraints returns the constraints for the model. + + + Returns -> GetConstraintsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='GetModelConstraints', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AddMachinesResults) + async def InjectMachines(self, params=None): + ''' + InjectMachines injects a machine into state with provisioned status. + + 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='Client', + request='InjectMachines', + version=5, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResults) + async def 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='Client', + request='ModelGet', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelInfo) + async def ModelInfo(self): + ''' + ModelInfo returns information about the current model. + + + Returns -> ModelInfo + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ModelInfo', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='ModelSet', + version=5, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='ModelUnset', + version=5, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelUserInfoResults) + async def ModelUserInfo(self): + ''' + ModelUserInfo returns information on all users in the model. + + + Returns -> ModelUserInfoResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ModelUserInfo', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PrivateAddressResults) + async def PrivateAddress(self, target=None): + ''' + PrivateAddress implements the server side of Client.PrivateAddress. + + target : str + Returns -> PrivateAddressResults + ''' + if target is not None and not isinstance(target, (bytes, str)): + raise Exception("Expected target to be a str, received: {}".format(type(target))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='PrivateAddress', + version=5, + params=_params) + _params['target'] = target + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProvisioningScriptResult) + async def 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='Client', + request='ProvisioningScript', + version=5, + params=_params) + _params['data-dir'] = data_dir + _params['disable-package-commands'] = disable_package_commands + _params['machine-id'] = machine_id + _params['nonce'] = nonce + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(PublicAddressResults) + async def PublicAddress(self, target=None): + ''' + PublicAddress implements the server side of Client.PublicAddress. + + target : str + Returns -> PublicAddressResults + ''' + if target is not None and not isinstance(target, (bytes, str)): + raise Exception("Expected target to be a str, received: {}".format(type(target))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='PublicAddress', + version=5, + params=_params) + _params['target'] = target + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolveCharmResults) + async def ResolveCharms(self, references=None): + ''' + ResolveCharms resolves the best available charm URLs with series, for charm + locations without a series specified. + + NOTE: ResolveCharms is deprecated as of juju 2.9 and charms facade version 3. + Please discontinue use and move to the charms facade version. + + TODO: remove in juju 3.0 + + references : typing.Sequence[str] + Returns -> ResolveCharmResults + ''' + if references is not None and not isinstance(references, (bytes, str, list)): + raise Exception("Expected references to be a Sequence, received: {}".format(type(references))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='ResolveCharms', + version=5, + params=_params) + _params['references'] = references + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Resolved(self, retry=None, unit_name=None): + ''' + Resolved implements the server side of Client.Resolved. + + retry : bool + unit_name : str + Returns -> None + ''' + if retry is not None and not isinstance(retry, bool): + raise Exception("Expected retry to be a bool, received: {}".format(type(retry))) + + if unit_name is not None and not isinstance(unit_name, (bytes, str)): + raise Exception("Expected unit_name to be a str, received: {}".format(type(unit_name))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='Resolved', + version=5, + params=_params) + _params['retry'] = retry + _params['unit-name'] = unit_name + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RetryProvisioning(self, entities=None): + ''' + RetryProvisioning marks a provisioning error as transient on the 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='Client', + request='RetryProvisioning', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + SLALevel returns the current sla level for the model. + + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Client', + request='SLALevel', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetModelAgentVersion(self, agent_stream=None, force=None, version=None): + ''' + SetModelAgentVersion sets the model agent version. + + agent_stream : str + force : bool + version : Number + Returns -> None + ''' + 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 force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + 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='Client', + request='SetModelAgentVersion', + version=5, + params=_params) + _params['agent-stream'] = agent_stream + _params['force'] = force + _params['version'] = version + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='SetModelConstraints', + version=5, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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='Client', + request='SetSLALevel', + version=5, + params=_params) + _params['ModelSLAInfo'] = modelslainfo + _params['creds'] = creds + _params['level'] = level + _params['owner'] = owner + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusHistoryResults) + async def 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=5, + params=_params) + _params['requests'] = requests + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AllWatcherId) + async def 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=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class CloudFacade(Type): + name = 'Cloud' + version = 5 + schema = {'definitions': {'AddCloudArgs': {'additionalProperties': False, + 'properties': {'cloud': {'$ref': '#/definitions/Cloud'}, + 'name': {'type': 'string'}}, + 'required': ['cloud', 'name'], + 'type': 'object'}, + 'Cloud': {'additionalProperties': False, + 'properties': {'auth-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'ca-certificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'endpoint': {'type': 'string'}, + 'host-cloud-region': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'region-config': {'patternProperties': {'.*': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'regions': {'items': {'$ref': '#/definitions/CloudRegion'}, + 'type': 'array'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudCredentialArg': {'additionalProperties': False, + 'properties': {'cloud-name': {'type': 'string'}, + 'credential-name': {'type': 'string'}}, + 'required': ['cloud-name', + 'credential-name'], + 'type': 'object'}, + 'CloudCredentialArgs': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/CloudCredentialArg'}, + 'type': 'array'}, + 'include-secrets': {'type': 'boolean'}}, + 'required': ['include-secrets'], + 'type': 'object'}, + 'CloudCredentialResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudCredential'}}, + 'type': 'object'}, + 'CloudCredentialResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudCredentialResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CloudDetails': {'additionalProperties': False, + 'properties': {'auth-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'regions': {'items': {'$ref': '#/definitions/CloudRegion'}, + 'type': 'array'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CloudInfo': {'additionalProperties': False, + 'properties': {'CloudDetails': {'$ref': '#/definitions/CloudDetails'}, + 'users': {'items': {'$ref': '#/definitions/CloudUserInfo'}, + 'type': 'array'}}, + 'required': ['CloudDetails', 'users'], + 'type': 'object'}, + 'CloudInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudInfo'}}, + 'type': 'object'}, + 'CloudInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'CloudInstanceTypesConstraint': {'additionalProperties': False, + 'properties': {'cloud-tag': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'region': {'type': 'string'}}, + 'required': ['cloud-tag', + 'region'], + 'type': 'object'}, + 'CloudInstanceTypesConstraints': {'additionalProperties': False, + 'properties': {'constraints': {'items': {'$ref': '#/definitions/CloudInstanceTypesConstraint'}, + 'type': 'array'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'CloudRegion': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}}, + 'required': ['name'], + 'type': 'object'}, + 'CloudResult': {'additionalProperties': False, + 'properties': {'cloud': {'$ref': '#/definitions/Cloud'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'CloudResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CloudUserInfo': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'display-name': {'type': 'string'}, + 'user': {'type': 'string'}}, + 'required': ['user', + 'display-name', + 'access'], + 'type': 'object'}, + 'CloudsResult': {'additionalProperties': False, + 'properties': {'clouds': {'patternProperties': {'.*': {'$ref': '#/definitions/Cloud'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'ControllerCredentialInfo': {'additionalProperties': False, + 'properties': {'content': {'$ref': '#/definitions/CredentialContent'}, + 'models': {'items': {'$ref': '#/definitions/ModelAccess'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CredentialContent': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'cloud': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'required': ['name', + 'cloud', + 'auth-type'], + 'type': 'object'}, + 'CredentialContentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ControllerCredentialInfo'}}, + 'type': 'object'}, + 'CredentialContentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CredentialContentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'InstanceType': {'additionalProperties': False, + 'properties': {'arches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cost': {'type': 'integer'}, + 'cpu-cores': {'type': 'integer'}, + 'deprecated': {'type': 'boolean'}, + 'memory': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'root-disk': {'type': 'integer'}, + 'virt-type': {'type': 'string'}}, + 'required': ['arches', 'cpu-cores', 'memory'], + 'type': 'object'}, + 'InstanceTypesResult': {'additionalProperties': False, + 'properties': {'cost-currency': {'type': 'string'}, + 'cost-divisor': {'type': 'integer'}, + 'cost-unit': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'instance-types': {'items': {'$ref': '#/definitions/InstanceType'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceTypesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InstanceTypesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListCloudInfo': {'additionalProperties': False, + 'properties': {'CloudDetails': {'$ref': '#/definitions/CloudDetails'}, + 'user-access': {'type': 'string'}}, + 'required': ['CloudDetails', 'user-access'], + 'type': 'object'}, + 'ListCloudInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ListCloudInfo'}}, + 'type': 'object'}, + 'ListCloudInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ListCloudInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListCloudsRequest': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag'], + 'type': 'object'}, + 'ModelAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'model': {'type': 'string'}}, + 'type': 'object'}, + 'ModifyCloudAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'action': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', + 'cloud-tag', + 'action', + 'access'], + 'type': 'object'}, + 'ModifyCloudAccessRequest': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyCloudAccess'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'RevokeCredentialArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'force'], + 'type': 'object'}, + 'RevokeCredentialArgs': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/RevokeCredentialArg'}, + 'type': 'array'}}, + 'required': ['credentials'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'TaggedCredential': {'additionalProperties': False, + 'properties': {'credential': {'$ref': '#/definitions/CloudCredential'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'credential'], + 'type': 'object'}, + 'TaggedCredentials': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/TaggedCredential'}, + 'type': 'array'}}, + 'type': 'object'}, + 'UpdateCloudArgs': {'additionalProperties': False, + 'properties': {'clouds': {'items': {'$ref': '#/definitions/AddCloudArgs'}, + 'type': 'array'}}, + 'required': ['clouds'], + 'type': 'object'}, + 'UpdateCredentialArgs': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/TaggedCredential'}, + 'type': 'array'}, + 'force': {'type': 'boolean'}}, + 'required': ['credentials', 'force'], + 'type': 'object'}, + 'UpdateCredentialModelResult': {'additionalProperties': False, + 'properties': {'errors': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}, + 'name': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', 'name'], + 'type': 'object'}, + 'UpdateCredentialResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'models': {'items': {'$ref': '#/definitions/UpdateCredentialModelResult'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'UpdateCredentialResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpdateCredentialResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'UserCloud': {'additionalProperties': False, + 'properties': {'cloud-tag': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', 'cloud-tag'], + 'type': 'object'}, + 'UserClouds': {'additionalProperties': False, + 'properties': {'user-clouds': {'items': {'$ref': '#/definitions/UserCloud'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + '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': {'AddCloud': {'properties': {'Params': {'$ref': '#/definitions/AddCloudArgs'}}, + 'type': 'object'}, + 'AddCredentials': {'properties': {'Params': {'$ref': '#/definitions/TaggedCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CheckCredentialsModels': {'properties': {'Params': {'$ref': '#/definitions/TaggedCredentials'}, + 'Result': {'$ref': '#/definitions/UpdateCredentialResults'}}, + 'type': 'object'}, + 'Cloud': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudResults'}}, + 'type': 'object'}, + 'CloudInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudInfoResults'}}, + 'type': 'object'}, + 'Clouds': {'properties': {'Result': {'$ref': '#/definitions/CloudsResult'}}, + 'type': 'object'}, + 'Credential': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudCredentialResults'}}, + 'type': 'object'}, + 'CredentialContents': {'properties': {'Params': {'$ref': '#/definitions/CloudCredentialArgs'}, + 'Result': {'$ref': '#/definitions/CredentialContentResults'}}, + 'type': 'object'}, + 'InstanceTypes': {'properties': {'Params': {'$ref': '#/definitions/CloudInstanceTypesConstraints'}, + 'Result': {'$ref': '#/definitions/InstanceTypesResults'}}, + 'type': 'object'}, + 'ListCloudInfo': {'properties': {'Params': {'$ref': '#/definitions/ListCloudsRequest'}, + 'Result': {'$ref': '#/definitions/ListCloudInfoResults'}}, + 'type': 'object'}, + 'ModifyCloudAccess': {'properties': {'Params': {'$ref': '#/definitions/ModifyCloudAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveClouds': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RevokeCredentialsCheckModels': {'properties': {'Params': {'$ref': '#/definitions/RevokeCredentialArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateCloud': {'properties': {'Params': {'$ref': '#/definitions/UpdateCloudArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateCredentialsCheckModels': {'properties': {'Params': {'$ref': '#/definitions/UpdateCredentialArgs'}, + 'Result': {'$ref': '#/definitions/UpdateCredentialResults'}}, + 'type': 'object'}, + 'UserCredentials': {'properties': {'Params': {'$ref': '#/definitions/UserClouds'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def AddCloud(self, cloud=None, name=None): + ''' + cloud : Cloud + 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 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=5, + params=_params) + _params['cloud'] = cloud + _params['name'] = name + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddCredentials(self, credentials=None): + ''' + credentials : typing.Sequence[~TaggedCredential] + 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='AddCredentials', + version=5, + params=_params) + _params['credentials'] = credentials + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpdateCredentialResults) + async def CheckCredentialsModels(self, credentials=None): + ''' + 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=5, + params=_params) + _params['credentials'] = credentials + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudResults) + async def Cloud(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudInfoResults) + async def CloudInfo(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudsResult) + async def Clouds(self): + ''' + + Returns -> CloudsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='Clouds', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudCredentialResults) + async def Credential(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CredentialContentResults) + async def CredentialContents(self, credentials=None, include_secrets=None): + ''' + 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=5, + params=_params) + _params['credentials'] = credentials + _params['include-secrets'] = include_secrets + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InstanceTypesResults) + async def InstanceTypes(self, constraints=None): + ''' + 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=5, + params=_params) + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListCloudInfoResults) + async def ListCloudInfo(self, all_=None, user_tag=None): + ''' + 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=5, + params=_params) + _params['all'] = all_ + _params['user-tag'] = user_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyCloudAccess(self, changes=None): + ''' + changes : typing.Sequence[~ModifyCloudAccess] + 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='Cloud', + request='ModifyCloudAccess', + version=5, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveClouds(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RevokeCredentialsCheckModels(self, credentials=None): + ''' + 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=5, + params=_params) + _params['credentials'] = credentials + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateCloud(self, clouds=None): + ''' + 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=5, + params=_params) + _params['clouds'] = clouds + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpdateCredentialResults) + async def UpdateCredentialsCheckModels(self, credentials=None, force=None): + ''' + 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=5, + params=_params) + _params['credentials'] = credentials + _params['force'] = force + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def UserCredentials(self, user_clouds=None): + ''' + 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=5, + params=_params) + _params['user-clouds'] = user_clouds + reply = await self.rpc(msg) + return reply + + + +class ControllerFacade(Type): + name = 'Controller' + version = 5 + schema = {'definitions': {'AllWatcherId': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ControllerConfigSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'DestroyControllerArgs': {'additionalProperties': False, + 'properties': {'destroy-models': {'type': 'boolean'}, + 'destroy-storage': {'type': 'boolean'}}, + 'required': ['destroy-models'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'HostedModelConfig': {'additionalProperties': False, + 'properties': {'cloud-spec': {'$ref': '#/definitions/CloudSpec'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['name', 'owner'], + 'type': 'object'}, + 'HostedModelConfigsResults': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/HostedModelConfig'}, + 'type': 'array'}}, + 'required': ['models'], + 'type': 'object'}, + 'InitiateMigrationArgs': {'additionalProperties': False, + 'properties': {'specs': {'items': {'$ref': '#/definitions/MigrationSpec'}, + 'type': 'array'}}, + 'required': ['specs'], + 'type': 'object'}, + 'InitiateMigrationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'migration-id': {'type': 'string'}, + 'model-tag': {'type': 'string'}}, + 'required': ['model-tag', + 'migration-id'], + 'type': 'object'}, + 'InitiateMigrationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InitiateMigrationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachineHardware': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'MigrationSpec': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'target-info': {'$ref': '#/definitions/MigrationTargetInfo'}}, + 'required': ['model-tag', 'target-info'], + 'type': 'object'}, + 'MigrationTargetInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'auth-tag': {'type': 'string'}, + 'ca-cert': {'type': 'string'}, + 'controller-tag': {'type': 'string'}, + 'macaroons': {'type': 'string'}, + 'password': {'type': 'string'}}, + 'required': ['controller-tag', + 'addrs', + 'ca-cert', + 'auth-tag'], + 'type': 'object'}, + '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'}, + 'ModelBlockInfo': {'additionalProperties': False, + 'properties': {'blocks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'model-uuid': {'type': 'string'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}}, + 'required': ['name', + 'model-uuid', + 'owner-tag', + 'blocks'], + 'type': 'object'}, + 'ModelBlockInfoList': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/ModelBlockInfo'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + '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'}, + 'ModelMachineInfo': {'additionalProperties': False, + 'properties': {'hardware': {'$ref': '#/definitions/MachineHardware'}, + 'has-vote': {'type': 'boolean'}, + 'id': {'type': 'string'}, + 'instance-id': {'type': 'string'}, + 'message': {'type': 'string'}, + 'status': {'type': 'string'}, + 'wants-vote': {'type': 'boolean'}}, + 'required': ['id'], + 'type': 'object'}, + 'ModelStatus': {'additionalProperties': False, + 'properties': {'application-count': {'type': 'integer'}, + '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'}, + 'volumes': {'items': {'$ref': '#/definitions/ModelVolumeInfo'}, + 'type': 'array'}}, + 'required': ['model-tag', + 'life', + 'hosted-machine-count', + 'application-count', + 'owner-tag'], + 'type': 'object'}, + 'ModelStatusResults': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/ModelStatus'}, + 'type': 'array'}}, + 'required': ['models'], + 'type': 'object'}, + 'ModelTag': {'additionalProperties': False, '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'}, + 'ModifyControllerAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'action': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', + 'action', + 'access'], + 'type': 'object'}, + 'ModifyControllerAccessRequest': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyControllerAccess'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'RemoveBlocksArgs': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}}, + 'required': ['all'], + 'type': 'object'}, + 'UserAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', 'access'], + 'type': 'object'}, + 'UserAccessResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/UserAccess'}}, + 'type': 'object'}, + 'UserAccessResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UserAccessResult'}, + 'type': 'array'}}, + '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': {'AllModels': {'properties': {'Result': {'$ref': '#/definitions/UserModelList'}}, + 'type': 'object'}, + 'CloudSpec': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ConfigSet': {'properties': {'Params': {'$ref': '#/definitions/ControllerConfigSet'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'DestroyController': {'properties': {'Params': {'$ref': '#/definitions/DestroyControllerArgs'}}, + 'type': 'object'}, + 'GetCloudSpec': {'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetControllerAccess': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UserAccessResults'}}, + 'type': 'object'}, + 'HostedModelConfigs': {'properties': {'Result': {'$ref': '#/definitions/HostedModelConfigsResults'}}, + 'type': 'object'}, + 'InitiateMigration': {'properties': {'Params': {'$ref': '#/definitions/InitiateMigrationArgs'}, + 'Result': {'$ref': '#/definitions/InitiateMigrationResults'}}, + 'type': 'object'}, + 'ListBlockedModels': {'properties': {'Result': {'$ref': '#/definitions/ModelBlockInfoList'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelStatusResults'}}, + 'type': 'object'}, + 'ModifyControllerAccess': {'properties': {'Params': {'$ref': '#/definitions/ModifyControllerAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveBlocks': {'properties': {'Params': {'$ref': '#/definitions/RemoveBlocksArgs'}}, + 'type': 'object'}, + 'WatchAllModels': {'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(UserModelList) + async def AllModels(self): + ''' + + Returns -> UserModelList + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='AllModels', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResults) + async def CloudSpec(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ConfigSet(self, config=None): + ''' + 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=5, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ControllerConfig', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyController(self, destroy_models=None, destroy_storage=None): + ''' + destroy_models : bool + destroy_storage : bool + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='DestroyController', + version=5, + params=_params) + _params['destroy-models'] = destroy_models + _params['destroy-storage'] = destroy_storage + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def GetCloudSpec(self): + ''' + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='GetCloudSpec', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UserAccessResults) + async def GetControllerAccess(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(HostedModelConfigsResults) + async def HostedModelConfigs(self): + ''' + + Returns -> HostedModelConfigsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='HostedModelConfigs', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InitiateMigrationResults) + async def InitiateMigration(self, specs=None): + ''' + 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=5, + params=_params) + _params['specs'] = specs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelBlockInfoList) + async def ListBlockedModels(self): + ''' + + Returns -> ModelBlockInfoList + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ListBlockedModels', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResults) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ModelConfig', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelStatusResults) + async def ModelStatus(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyControllerAccess(self, changes=None): + ''' + 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=5, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def RemoveBlocks(self, all_=None): + ''' + 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=5, + params=_params) + _params['all'] = all_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AllWatcherId) + async def WatchAllModels(self): + ''' + + Returns -> AllWatcherId + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='WatchAllModels', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class FirewallerFacade(Type): + name = 'Firewaller' + version = 5 + schema = {'definitions': {'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'FirewallRule': {'additionalProperties': False, + 'properties': {'known-service': {'type': 'string'}, + 'whitelist-cidrs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['known-service'], + 'type': 'object'}, + 'KnownServiceArgs': {'additionalProperties': False, + 'properties': {'known-services': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['known-services'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListFirewallRulesResults': {'additionalProperties': False, + 'properties': {'Rules': {'items': {'$ref': '#/definitions/FirewallRule'}, + 'type': 'array'}}, + 'required': ['Rules'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MacaroonResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/Macaroon'}}, + 'type': 'object'}, + 'MacaroonResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MacaroonResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachinePortRange': {'additionalProperties': False, + 'properties': {'port-range': {'$ref': '#/definitions/PortRange'}, + 'relation-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-tag', + 'port-range'], + 'type': 'object'}, + 'MachinePorts': {'additionalProperties': False, + 'properties': {'machine-tag': {'type': 'string'}, + 'subnet-tag': {'type': 'string'}}, + 'required': ['machine-tag', 'subnet-tag'], + 'type': 'object'}, + 'MachinePortsParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MachinePorts'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MachinePortsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ports': {'items': {'$ref': '#/definitions/MachinePortRange'}, + 'type': 'array'}}, + 'required': ['ports'], + 'type': 'object'}, + 'MachinePortsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachinePortsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelTag': {'additionalProperties': False, 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'AreManuallyProvisioned': {'description': 'AreManuallyProvisioned ' + 'returns whether ' + 'each given entity ' + 'is\n' + 'manually ' + 'provisioned or not. ' + 'Only machine tags ' + 'are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'CloudSpec': {'description': "CloudSpec returns the model's " + 'cloud spec.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'FirewallRules': {'description': 'FirewallRules returns the ' + 'firewall rules for the ' + 'specified well known service ' + 'types.', + 'properties': {'Params': {'$ref': '#/definitions/KnownServiceArgs'}, + 'Result': {'$ref': '#/definitions/ListFirewallRulesResults'}}, + 'type': 'object'}, + 'GetAssignedMachine': {'description': 'GetAssignedMachine ' + 'returns the assigned ' + 'machine tag (if any) ' + 'for\n' + 'each given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GetCloudSpec': {'description': 'GetCloudSpec constructs the ' + 'CloudSpec for a validated and ' + 'authorized model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetExposed': {'description': 'GetExposed returns the exposed ' + 'flag value for each given ' + 'application.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'GetMachineActiveSubnets': {'description': 'GetMachineActiveSubnets ' + 'returns the tags ' + 'of the all subnets ' + 'that each machine\n' + '(in args) has open ' + 'ports on.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'GetMachinePorts': {'description': 'GetMachinePorts returns ' + 'the port ranges opened on ' + 'a machine for the ' + 'specified\n' + 'subnet as a map mapping ' + 'port ranges to the tags of ' + 'the units that opened\n' + 'them.', + 'properties': {'Params': {'$ref': '#/definitions/MachinePortsParams'}, + 'Result': {'$ref': '#/definitions/MachinePortsResults'}}, + 'type': 'object'}, + 'InstanceId': {'description': 'InstanceId returns the provider ' + 'specific instance id for each ' + 'given\n' + 'machine or an ' + 'CodeNotProvisioned error, if ' + 'not set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'MacaroonForRelations': {'description': 'MacaroonForRelations ' + 'returns the macaroon ' + 'for the specified ' + 'relations.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MacaroonResults'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'SetRelationsStatus': {'description': 'SetRelationsStatus sets ' + 'the status for the ' + 'specified relations.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'description': 'WatchCloudSpecsChanges ' + 'returns a watcher ' + 'for cloud spec ' + 'changes.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + '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/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchIngressAddressesForRelations': {'description': 'WatchIngressAddressesForRelations ' + 'creates ' + 'a ' + 'watcher ' + 'that ' + 'returns ' + 'the ' + 'ingress ' + 'networks\n' + 'that ' + 'have ' + 'been ' + 'recorded ' + 'against ' + 'the ' + 'specified ' + 'relations.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchModelMachineStartTimes': {'description': 'WatchModelMachineStartTimes ' + 'watches the ' + 'non-container ' + 'machines in ' + 'the model\n' + 'for changes to ' + 'the Life or ' + 'AgentStartTime ' + 'fields and ' + 'reports them ' + 'as a batch.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'description': 'WatchModelMachines ' + 'returns a ' + 'StringsWatcher that ' + 'notifies of\n' + 'changes to the life ' + 'cycles of the top level ' + 'machines in the ' + 'current\n' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchOpenedPorts': {'description': 'WatchOpenedPorts returns ' + 'a new StringsWatcher for ' + 'each given\n' + 'model tag.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnits': {'description': 'WatchUnits starts a ' + 'StringsWatcher to watch all ' + 'units belonging to\n' + 'to any entity (machine or ' + 'service) passed in args.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(BoolResults) + async def 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResults) + async def 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='Firewaller', + request='CloudSpec', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def 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='Firewaller', + request='ControllerAPIInfoForModels', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.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='Firewaller', + request='ControllerConfig', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListFirewallRulesResults) + async def FirewallRules(self, known_services=None): + ''' + FirewallRules returns the firewall rules for the specified well known service types. + + known_services : typing.Sequence[str] + Returns -> ListFirewallRulesResults + ''' + if known_services is not None and not isinstance(known_services, (bytes, str, list)): + raise Exception("Expected known_services to be a Sequence, received: {}".format(type(known_services))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='FirewallRules', + version=5, + params=_params) + _params['known-services'] = known_services + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetAssignedMachine(self, entities=None): + ''' + GetAssignedMachine returns the assigned machine tag (if any) for + each given unit. + + 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='GetAssignedMachine', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.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=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def GetExposed(self, entities=None): + ''' + GetExposed returns the exposed flag value for each given application. + + 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='GetExposed', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def GetMachineActiveSubnets(self, entities=None): + ''' + GetMachineActiveSubnets returns the tags of the all subnets that each machine + (in args) has open ports on. + + 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='Firewaller', + request='GetMachineActiveSubnets', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachinePortsResults) + async def GetMachinePorts(self, params=None): + ''' + GetMachinePorts returns the port ranges opened on a machine for the specified + subnet as a map mapping port ranges to the tags of the units that opened + them. + + params : typing.Sequence[~MachinePorts] + Returns -> MachinePortsResults + ''' + 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='Firewaller', + request='GetMachinePorts', + version=5, + params=_params) + _params['params'] = params + reply = await self.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=5, + params=_params) + _params['entities'] = entities + reply = await self.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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MacaroonResults) + async def 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=5, + params=_params) + _params['entities'] = entities + reply = await self.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='Firewaller', + request='ModelConfig', + version=5, + params=_params) + + reply = await self.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=5, + params=_params) + _params['entities'] = entities + reply = await self.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='Firewaller', + request='Watch', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.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='Firewaller', + request='WatchCloudSpecsChanges', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchEgressAddressesForRelations(self, entities=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. + + 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='WatchEgressAddressesForRelations', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.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='Firewaller', + request='WatchForModelConfigChanges', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @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='Firewaller', + request='WatchModelMachineStartTimes', + version=5, + params=_params) + + reply = await self.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='Firewaller', + request='WatchModelMachines', + version=5, + params=_params) + + reply = await self.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 + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class MachineManagerFacade(Type): + name = 'MachineManager' + version = 5 + schema = {'definitions': {'AddMachineParams': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'container-type': {'type': 'string'}, + 'disks': {'items': {'$ref': '#/definitions/Constraints'}, + 'type': 'array'}, + 'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'instance-id': {'type': 'string'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'parent-id': {'type': 'string'}, + 'placement': {'$ref': '#/definitions/Placement'}, + 'series': {'type': 'string'}}, + 'required': ['series', + 'constraints', + 'jobs', + 'parent-id', + 'container-type', + 'instance-id', + 'nonce', + 'hardware-characteristics', + 'addresses'], + 'type': 'object'}, + 'AddMachines': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'AddMachinesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'machine': {'type': 'string'}}, + 'required': ['machine'], + 'type': 'object'}, + 'AddMachinesResults': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'DestroyMachineInfo': {'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'}, + 'DestroyMachineResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'$ref': '#/definitions/DestroyMachineInfo'}}, + 'type': 'object'}, + 'DestroyMachineResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/DestroyMachineResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'DestroyMachinesParams': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'keep': {'type': 'boolean'}, + 'machine-tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['machine-tags'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceType': {'additionalProperties': False, + 'properties': {'arches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cost': {'type': 'integer'}, + 'cpu-cores': {'type': 'integer'}, + 'deprecated': {'type': 'boolean'}, + 'memory': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'root-disk': {'type': 'integer'}, + 'virt-type': {'type': 'string'}}, + 'required': ['arches', 'cpu-cores', 'memory'], + 'type': 'object'}, + 'InstanceTypesResult': {'additionalProperties': False, + 'properties': {'cost-currency': {'type': 'string'}, + 'cost-divisor': {'type': 'integer'}, + 'cost-unit': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'instance-types': {'items': {'$ref': '#/definitions/InstanceType'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceTypesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InstanceTypesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'ModelInstanceTypesConstraint': {'additionalProperties': False, + 'properties': {'value': {'$ref': '#/definitions/Value'}}, + 'type': 'object'}, + 'ModelInstanceTypesConstraints': {'additionalProperties': False, + 'properties': {'constraints': {'items': {'$ref': '#/definitions/ModelInstanceTypesConstraint'}, + 'type': 'array'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpgradeSeriesNotificationParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['entity', + 'watcher-id'], + 'type': 'object'}, + 'UpgradeSeriesNotificationParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesNotificationParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesUnitsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + 'type': 'object'}, + 'UpgradeSeriesUnitsResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/UpgradeSeriesUnitsResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'spaces': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'AddMachines': {'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'DestroyMachine': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DestroyMachineResults'}}, + 'type': 'object'}, + 'DestroyMachineWithParams': {'properties': {'Params': {'$ref': '#/definitions/DestroyMachinesParams'}, + 'Result': {'$ref': '#/definitions/DestroyMachineResults'}}, + 'type': 'object'}, + 'ForceDestroyMachine': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DestroyMachineResults'}}, + 'type': 'object'}, + 'GetUpgradeSeriesMessages': {'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesNotificationParams'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'InstanceTypes': {'properties': {'Params': {'$ref': '#/definitions/ModelInstanceTypesConstraints'}, + 'Result': {'$ref': '#/definitions/InstanceTypesResults'}}, + 'type': 'object'}, + 'UpgradeSeriesComplete': {'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'UpgradeSeriesPrepare': {'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'UpgradeSeriesValidate': {'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesUnitsResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddMachinesResults) + async def AddMachines(self, params=None): + ''' + 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=5, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyMachineResults) + async def DestroyMachine(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> DestroyMachineResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='DestroyMachine', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyMachineResults) + async def DestroyMachineWithParams(self, force=None, keep=None, machine_tags=None): + ''' + force : bool + keep : bool + machine_tags : typing.Sequence[str] + Returns -> DestroyMachineResults + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='MachineManager', + request='DestroyMachineWithParams', + version=5, + params=_params) + _params['force'] = force + _params['keep'] = keep + _params['machine-tags'] = machine_tags + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyMachineResults) + async def ForceDestroyMachine(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> DestroyMachineResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='ForceDestroyMachine', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def GetUpgradeSeriesMessages(self, params=None): + ''' + 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=5, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InstanceTypesResults) + async def InstanceTypes(self, constraints=None): + ''' + 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=5, + params=_params) + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + async def UpgradeSeriesComplete(self, force=None, series=None, tag=None): + ''' + force : bool + series : str + tag : Entity + Returns -> ErrorResult + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + 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=5, + params=_params) + _params['force'] = force + _params['series'] = series + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + async def UpgradeSeriesPrepare(self, force=None, series=None, tag=None): + ''' + force : bool + series : str + tag : Entity + Returns -> ErrorResult + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + 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=5, + params=_params) + _params['force'] = force + _params['series'] = series + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesUnitsResults) + async def UpgradeSeriesValidate(self, args=None): + ''' + args : typing.Sequence[~UpdateSeriesArg] + 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=5, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchUpgradeSeriesNotifications(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class MachinerFacade(Type): + name = 'Machiner' + version = 5 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + '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'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'HostPort': {'additionalProperties': False, + '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'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'JobsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['jobs'], + 'type': 'object'}, + 'JobsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/JobsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineAddresses': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'addresses'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'is-default-gateway': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + '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': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'shadow-addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'virtual-port-type': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}}, + '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'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RecordAgentStartInformationArg': {'additionalProperties': False, + 'properties': {'hostname': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'RecordAgentStartInformationArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RecordAgentStartInformationArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SetMachineNetworkConfig': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'config'], + 'type': 'object'}, + 'SetMachinesAddresses': {'additionalProperties': False, + 'properties': {'machine-addresses': {'items': {'$ref': '#/definitions/MachineAddresses'}, + 'type': 'array'}}, + 'required': ['machine-addresses'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' + 'of addresses used to connect ' + 'to the API.', + 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'EnsureDead': {'description': 'EnsureDead calls EnsureDead on ' + 'each given entity from state. ' + 'It\n' + 'will fail if the entity is not ' + "present. If it's Alive, nothing " + 'will\n' + 'happen (see state/EnsureDead() ' + 'for units or machines).', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Jobs': {'description': 'Jobs returns the jobs assigned to the ' + 'given entities.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/JobsResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' + 'that this machine resides in.\n' + 'It is implemented here directly ' + 'as a result of removing it from\n' + 'embedded APIAddresser *without* ' + 'bumping the facade version.\n' + 'It should be blanked when this ' + 'facade version is next ' + 'incremented.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'RecordAgentStartInformation': {'description': 'RecordAgentStartInformation ' + 'syncs the ' + 'machine model ' + 'with ' + 'information\n' + 'reported by a ' + 'machine agent ' + 'when it ' + 'starts.', + 'properties': {'Params': {'$ref': '#/definitions/RecordAgentStartInformationArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RecordAgentStartTime': {'description': 'RecordAgentStartTime ' + 'updates the agent ' + 'start time field in ' + 'the machine doc.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetMachineAddresses': {'properties': {'Params': {'$ref': '#/definitions/SetMachinesAddresses'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetObservedNetworkConfig': {'description': 'SetObservedNetworkConfig ' + 'reads the network ' + 'config for the ' + 'machine\n' + 'identified by the ' + 'input args.\n' + 'This config is ' + 'merged with the ' + 'new network ' + 'config supplied ' + 'in the\n' + 'same args and ' + 'updated if it has ' + 'changed.', + 'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetStatus': {'description': 'SetStatus sets the status of ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' + 'watches the API server ' + 'addresses.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def 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 = await self.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='Machiner', + request='APIHostPorts', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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='Machiner', + request='EnsureDead', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @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) + 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(StringResult) + async def ModelUUID(self): + ''' + ModelUUID returns the model UUID that this machine 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='Machiner', + request='ModelUUID', + version=5, + params=_params) + + reply = await self.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. + + 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.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='Machiner', + request='Watch', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + +class ModelManagerFacade(Type): + name = 'ModelManager' + version = 5 + 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'}, + 'model-tag': {'type': 'string'}}, + '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': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachineHardware': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + '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'}, + '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'}}, + 'required': ['config'], + '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-region': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'controller-uuid': {'type': 'string'}, + 'default-series': {'type': 'string'}, + 'life': {'type': 'string'}, + 'machines': {'items': {'$ref': '#/definitions/ModelMachineInfo'}, + 'type': 'array'}, + 'migration': {'$ref': '#/definitions/ModelMigrationStatus'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'provider-type': {'type': 'string'}, + 'sla': {'$ref': '#/definitions/ModelSLAInfo'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'type': {'type': 'string'}, + 'users': {'items': {'$ref': '#/definitions/ModelUserInfo'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', + 'type', + 'uuid', + 'controller-uuid', + 'cloud-tag', + 'owner-tag', + 'life', + 'users', + 'machines', + 'sla', + 'agent-version'], + 'type': 'object'}, + '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': {'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'}, + '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'}, + 'volumes': {'items': {'$ref': '#/definitions/ModelVolumeInfo'}, + 'type': 'array'}}, + 'required': ['model-tag', + 'life', + 'hosted-machine-count', + 'application-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'}, + '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', + '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'}, + 'user': {'type': 'string'}}, + 'required': ['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'}, + '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'}, + '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': {'properties': {'Params': {'$ref': '#/definitions/ChangeModelCredentialsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CreateModel': {'properties': {'Params': {'$ref': '#/definitions/ModelCreateArgs'}, + 'Result': {'$ref': '#/definitions/ModelInfo'}}, + 'type': 'object'}, + 'DestroyModels': {'properties': {'Params': {'$ref': '#/definitions/DestroyModelsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DumpModels': {'properties': {'Params': {'$ref': '#/definitions/DumpModelRequest'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'DumpModelsDB': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MapResults'}}, + 'type': 'object'}, + 'ListModelSummaries': {'properties': {'Params': {'$ref': '#/definitions/ModelSummariesRequest'}, + 'Result': {'$ref': '#/definitions/ModelSummaryResults'}}, + 'type': 'object'}, + 'ListModels': {'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/UserModelList'}}, + 'type': 'object'}, + 'ModelDefaults': {'properties': {'Result': {'$ref': '#/definitions/ModelDefaultsResult'}}, + 'type': 'object'}, + 'ModelInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelInfoResults'}}, + 'type': 'object'}, + 'ModelStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelStatusResults'}}, + 'type': 'object'}, + 'ModifyModelAccess': {'properties': {'Params': {'$ref': '#/definitions/ModifyModelAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModelDefaults': {'properties': {'Params': {'$ref': '#/definitions/SetModelDefaults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UnsetModelDefaults': {'properties': {'Params': {'$ref': '#/definitions/UnsetModelDefaults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def ChangeModelCredential(self, model_credentials=None): + ''' + 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=5, + 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): + ''' + 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=5, + 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): + ''' + 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=5, + params=_params) + _params['models'] = models + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def DumpModels(self, entities=None, simplified=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + _params['simplified'] = simplified + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MapResults) + async def DumpModelsDB(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelSummaryResults) + async def ListModelSummaries(self, all_=None, user_tag=None): + ''' + 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=5, + 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): + ''' + 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=5, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelDefaultsResult) + async def ModelDefaults(self): + ''' + + Returns -> ModelDefaultsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ModelDefaults', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelInfoResults) + async def ModelInfo(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelStatusResults) + async def ModelStatus(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyModelAccess(self, changes=None): + ''' + 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=5, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModelDefaults(self, config=None): + ''' + 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=5, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UnsetModelDefaults(self, keys=None): + ''' + 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=5, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + + +class SpacesFacade(Type): + name = 'Spaces' + version = 5 + schema = {'definitions': {'CreateSpaceParams': {'additionalProperties': False, + 'properties': {'cidrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'provider-id': {'type': 'string'}, + 'public': {'type': 'boolean'}, + 'space-tag': {'type': 'string'}}, + 'required': ['cidrs', + 'space-tag', + 'public'], + 'type': 'object'}, + 'CreateSpacesParams': {'additionalProperties': False, + 'properties': {'spaces': {'items': {'$ref': '#/definitions/CreateSpaceParams'}, + 'type': 'array'}}, + 'required': ['spaces'], + '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'}, + 'ListSpacesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/Space'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Space': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'name': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['id', 'name', 'subnets'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}}, + 'properties': {'CreateSpaces': {'properties': {'Params': {'$ref': '#/definitions/CreateSpacesParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ListSpaces': {'properties': {'Result': {'$ref': '#/definitions/ListSpacesResults'}}, + 'type': 'object'}, + 'ReloadSpaces': {'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def CreateSpaces(self, spaces=None): + ''' + 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=5, + params=_params) + _params['spaces'] = spaces + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListSpacesResults) + async def ListSpaces(self): + ''' + + Returns -> ListSpacesResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Spaces', + request='ListSpaces', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ReloadSpaces(self): + ''' + + Returns -> None + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Spaces', + request='ReloadSpaces', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class UniterFacade(Type): + name = 'Uniter' + version = 5 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionExecutionResult': {'additionalProperties': False, + 'properties': {'action-tag': {'type': 'string'}, + 'message': {'type': 'string'}, + 'results': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'status': {'type': 'string'}}, + 'required': ['action-tag', 'status'], + 'type': 'object'}, + 'ActionExecutionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionExecutionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'ApplicationStatusResult': {'additionalProperties': False, + 'properties': {'application': {'$ref': '#/definitions/StatusResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/StatusResult'}}, + 'type': 'object'}}, + 'required': ['application', + 'units'], + 'type': 'object'}, + 'ApplicationStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + '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'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'CharmURLs': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/CharmURL'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'ConfigSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'ConfigSettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConfigSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Endpoint': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'relation': {'$ref': '#/definitions/CharmRelation'}}, + 'required': ['application-name', 'relation'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesCharmURL': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityCharmURL'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesPortRanges': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityCharmURL': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'charm-url'], + 'type': 'object'}, + 'EntityPortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['tag', + 'protocol', + 'from-port', + 'to-port'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'EntityWorkloadVersion': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'workload-version': {'type': 'string'}}, + 'required': ['tag', + 'workload-version'], + 'type': 'object'}, + 'EntityWorkloadVersions': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityWorkloadVersion'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsBulkResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GetLeadershipSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}}, + 'required': ['Address', 'port'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'InterfaceAddress': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'cidr'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachinePortRange': {'additionalProperties': False, + 'properties': {'port-range': {'$ref': '#/definitions/PortRange'}, + 'relation-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-tag', + 'port-range'], + 'type': 'object'}, + 'MachinePortsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ports': {'items': {'$ref': '#/definitions/MachinePortRange'}, + 'type': 'array'}}, + 'required': ['ports'], + 'type': 'object'}, + 'MachinePortsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachinePortsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MergeLeadershipSettingsBulkParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MergeLeadershipSettingsParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MergeLeadershipSettingsParam': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application-tag', + 'settings'], + 'type': 'object'}, + 'MeterStatusResult': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}}, + 'required': ['code', 'info'], + 'type': 'object'}, + 'MeterStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Metric': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['key', 'value', 'time'], + 'type': 'object'}, + 'MetricBatch': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'created': {'format': 'date-time', + 'type': 'string'}, + 'metrics': {'items': {'$ref': '#/definitions/Metric'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'charm-url', + 'created', + 'metrics'], + 'type': 'object'}, + 'MetricBatchParam': {'additionalProperties': False, + 'properties': {'batch': {'$ref': '#/definitions/MetricBatch'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'batch'], + 'type': 'object'}, + 'MetricBatchParams': {'additionalProperties': False, + 'properties': {'batches': {'items': {'$ref': '#/definitions/MetricBatchParam'}, + 'type': 'array'}}, + 'required': ['batches'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid'], + 'type': 'object'}, + 'NetworkInfo': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/InterfaceAddress'}, + 'type': 'array'}, + 'interface-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['mac-address', + 'interface-name', + 'addresses'], + 'type': 'object'}, + 'NetworkInfoParams': {'additionalProperties': False, + 'properties': {'bindings': {'items': {'type': 'string'}, + 'type': 'array'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'bindings'], + 'type': 'object'}, + 'NetworkInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'network-info': {'items': {'$ref': '#/definitions/NetworkInfo'}, + 'type': 'array'}}, + 'required': ['network-info'], + 'type': 'object'}, + 'NetworkInfoResults': {'additionalProperties': False, + 'properties': {'results': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInfoResult'}}, + 'type': 'object'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'RelationIds': {'additionalProperties': False, + 'properties': {'relation-ids': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['relation-ids'], + 'type': 'object'}, + 'RelationResult': {'additionalProperties': False, + 'properties': {'endpoint': {'$ref': '#/definitions/Endpoint'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'integer'}, + 'key': {'type': 'string'}, + 'life': {'type': 'string'}}, + 'required': ['life', + 'id', + 'key', + 'endpoint'], + 'type': 'object'}, + 'RelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnit': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', 'unit'], + 'type': 'object'}, + 'RelationUnitPair': {'additionalProperties': False, + 'properties': {'local-unit': {'type': 'string'}, + 'relation': {'type': 'string'}, + 'remote-unit': {'type': 'string'}}, + 'required': ['relation', + 'local-unit', + 'remote-unit'], + 'type': 'object'}, + 'RelationUnitPairs': {'additionalProperties': False, + 'properties': {'relation-unit-pairs': {'items': {'$ref': '#/definitions/RelationUnitPair'}, + 'type': 'array'}}, + 'required': ['relation-unit-pairs'], + 'type': 'object'}, + 'RelationUnitSettings': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', + 'unit', + 'settings'], + 'type': 'object'}, + 'RelationUnits': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnit'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsSettings': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationUnitsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ResolvedModeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'mode': {'type': 'string'}}, + 'required': ['mode'], + 'type': 'object'}, + 'ResolvedModeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResolvedModeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'SettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StorageAddParams': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'storage': {'$ref': '#/definitions/StorageConstraints'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'name', 'storage'], + 'type': 'object'}, + 'StorageAttachment': {'additionalProperties': False, + 'properties': {'kind': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'location': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'owner-tag', + 'unit-tag', + 'kind', + 'location', + 'life'], + 'type': 'object'}, + 'StorageAttachmentId': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag'], + 'type': 'object'}, + 'StorageAttachmentIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/StorageAttachmentId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageAttachmentIdsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachmentIds'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentIdsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentIdsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StoragesAddParams': {'additionalProperties': False, + 'properties': {'storages': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}}, + 'required': ['storages'], + 'type': 'object'}, + 'StringBoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ok': {'type': 'boolean'}, + 'result': {'type': 'string'}}, + 'required': ['result', 'ok'], + 'type': 'object'}, + 'StringBoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringBoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}}, + 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'Actions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'AddMetricBatches': {'properties': {'Params': {'$ref': '#/definitions/MetricBatchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AddUnitStorage': {'properties': {'Params': {'$ref': '#/definitions/StoragesAddParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AllMachinePorts': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachinePortsResults'}}, + 'type': 'object'}, + 'ApplicationStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationStatusResults'}}, + 'type': 'object'}, + 'AssignedMachine': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'AvailabilityZone': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'BeginActions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CACert': {'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'CharmArchiveSha256': {'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CharmModifiedVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'CharmURL': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'ClearResolved': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ClosePorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ConfigSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConfigSettingsResults'}}, + 'type': 'object'}, + 'CurrentModel': {'properties': {'Result': {'$ref': '#/definitions/ModelResult'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyAllSubordinates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyUnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnterScope': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FinishActions': {'properties': {'Params': {'$ref': '#/definitions/ActionExecutionResults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'GetMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, + 'type': 'object'}, + 'GetPrincipal': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'HasSubordinates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'JoinedRelations': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'LeaveScope': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'Merge': {'properties': {'Params': {'$ref': '#/definitions/MergeLeadershipSettingsBulkParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'NetworkInfo': {'properties': {'Params': {'$ref': '#/definitions/NetworkInfoParams'}, + 'Result': {'$ref': '#/definitions/NetworkInfoResults'}}, + 'type': 'object'}, + 'OpenPorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'ProviderType': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PublicAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Read': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GetLeadershipSettingsBulkResults'}}, + 'type': 'object'}, + 'ReadRemoteSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnitPairs'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'ReadSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'Relation': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationById': {'properties': {'Params': {'$ref': '#/definitions/RelationIds'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RemoveStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RequestReboot': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Resolved': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ResolvedModeResults'}}, + 'type': 'object'}, + 'SLALevel': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetAgentStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetApplicationStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/EntitiesCharmURL'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetWorkloadVersion': {'properties': {'Params': {'$ref': '#/definitions/EntityWorkloadVersions'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StorageAttachmentLife': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'StorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentResults'}}, + 'type': 'object'}, + 'UnitStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'UnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentIdsResults'}}, + 'type': 'object'}, + 'UpdateSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnitsSettings'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchActionNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchConfigSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchLeadershipSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchRelationUnits': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, + 'type': 'object'}, + 'WatchStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchUnitAddresses': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchUnitRelations': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WorkloadVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIAddresses', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIHostPorts', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Actions(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddMetricBatches(self, batches=None): + ''' + 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=5, + params=_params) + _params['batches'] = batches + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddUnitStorage(self, storages=None): + ''' + storages : typing.Sequence[~StorageAddParams] + Returns -> ErrorResults + ''' + 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='Uniter', + request='AddUnitStorage', + version=5, + params=_params) + _params['storages'] = storages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachinePortsResults) + async def AllMachinePorts(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> MachinePortsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='AllMachinePorts', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationStatusResults) + async def ApplicationStatus(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ApplicationStatus', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AssignedMachine(self, entities=None): + ''' + 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='AssignedMachine', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + 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='AvailabilityZone', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def BeginActions(self, entities=None): + ''' + 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='BeginActions', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BytesResult) + async def CACert(self): + ''' + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CACert', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def CharmArchiveSha256(self, urls=None): + ''' + 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='CharmArchiveSha256', + version=5, + params=_params) + _params['urls'] = urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def CharmModifiedVersion(self, entities=None): + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CharmModifiedVersion', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def CharmURL(self, entities=None): + ''' + 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='CharmURL', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClearResolved(self, entities=None): + ''' + 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='ClearResolved', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClosePorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='ClosePorts', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConfigSettingsResults) + async def ConfigSettings(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ConfigSettings', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelResult) + async def CurrentModel(self): + ''' + + Returns -> ModelResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CurrentModel', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Destroy(self, entities=None): + ''' + 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='Destroy', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyAllSubordinates(self, entities=None): + ''' + 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='DestroyAllSubordinates', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyUnitStorageAttachments(self, entities=None): + ''' + 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='DestroyUnitStorageAttachments', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + 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='EnsureDead', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnterScope(self, relation_units=None): + ''' + 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='EnterScope', + version=5, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def FinishActions(self, results=None): + ''' + 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='FinishActions', + version=5, + params=_params) + _params['results'] = results + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): + ''' + 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='GetMeterStatus', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def GetPrincipal(self, entities=None): + ''' + 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='GetPrincipal', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def HasSubordinates(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def JoinedRelations(self, entities=None): + ''' + 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='Uniter', + request='JoinedRelations', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LeaveScope(self, relation_units=None): + ''' + 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=5, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Merge(self, params=None): + ''' + 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=5, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelConfig', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelUUID', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NetworkInfoResults) + async def NetworkInfo(self, bindings=None, unit=None): + ''' + bindings : typing.Sequence[str] + 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 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=5, + params=_params) + _params['bindings'] = bindings + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def OpenPorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='OpenPorts', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PrivateAddress(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ProviderType(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ProviderType', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PublicAddress(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetLeadershipSettingsBulkResults) + async def Read(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadRemoteSettings(self, relation_unit_pairs=None): + ''' + 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=5, + params=_params) + _params['relation-unit-pairs'] = relation_unit_pairs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadSettings(self, relation_units=None): + ''' + 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=5, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def Relation(self, relation_units=None): + ''' + 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=5, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def RelationById(self, relation_ids=None): + ''' + 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=5, + params=_params) + _params['relation-ids'] = relation_ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveStorageAttachments(self, ids=None): + ''' + 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=5, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RequestReboot(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolvedModeResults) + async def Resolved(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SLALevel', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetAgentStatus(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationStatus(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmURL(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUnitStatus(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetWorkloadVersion(self, entities=None): + ''' + 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='SetWorkloadVersion', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def StorageAttachmentLife(self, ids=None): + ''' + ids : typing.Sequence[~StorageAttachmentId] + 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='Uniter', + request='StorageAttachmentLife', + version=5, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentResults) + async def StorageAttachments(self, ids=None): + ''' + 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='StorageAttachments', + version=5, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def UnitStatus(self, entities=None): + ''' + 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='Uniter', + request='UnitStatus', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentIdsResults) + async def UnitStorageAttachments(self, entities=None): + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='UnitStorageAttachments', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateSettings(self, relation_units=None): + ''' + relation_units : typing.Sequence[~RelationUnitSettings] + 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='UpdateSettings', + version=5, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + 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='Watch', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchAPIHostPorts', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(self, entities=None): + ''' + 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='WatchActionNotifications', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchConfigSettings(self, entities=None): + ''' + 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='WatchConfigSettings', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchForModelConfigChanges', + version=5, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchLeadershipSettings(self, entities=None): + ''' + 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='WatchLeadershipSettings', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMeterStatus(self, entities=None): + ''' + 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='WatchMeterStatus', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitsWatchResults) + async def WatchRelationUnits(self, relation_units=None): + ''' + 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=5, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchStorageAttachments(self, ids=None): + ''' + 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=5, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchUnitAddresses(self, entities=None): + ''' + 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='WatchUnitAddresses', + version=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitRelations(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitStorageAttachments(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def WorkloadVersion(self, entities=None): + ''' + 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=5, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client6.py b/juju/client/old_clients/_client6.py new file mode 100644 index 000000000..5ea03abbc --- /dev/null +++ b/juju/client/old_clients/_client6.py @@ -0,0 +1,4600 @@ +# 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.old_clients._definitions import * + + +class ActionFacade(Type): + name = 'Action' + version = 6 + schema = {'definitions': {'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionMessage': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'timestamp': {'format': 'date-time', + 'type': 'string'}}, + 'required': ['timestamp', 'message'], + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'log': {'items': {'$ref': '#/definitions/ActionMessage'}, + 'type': 'array'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], + 'type': 'object'}, + 'Actions': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/Action'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionsByName': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}}, + 'type': 'object'}, + 'ActionsByNames': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByName'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionsByReceiver': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'receiver': {'type': 'string'}}, + 'type': 'object'}, + 'ActionsByReceivers': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionsByReceiver'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ApplicationCharmActionsResult': {'additionalProperties': False, + 'properties': {'actions': {'patternProperties': {'.*': {'$ref': '#/definitions/ActionSpec'}}, + 'type': 'object'}, + 'application-tag': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ApplicationsCharmActionsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationCharmActionsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'EnqueuedActions': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}, + 'operation': {'type': 'string'}}, + 'required': ['operation'], + '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'}, + 'FindActionsByNames': {'additionalProperties': False, + 'properties': {'names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FindTags': {'additionalProperties': False, + 'properties': {'prefixes': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['prefixes'], + 'type': 'object'}, + 'FindTagsResults': {'additionalProperties': False, + 'properties': {'matches': {'patternProperties': {'.*': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'required': ['matches'], + 'type': 'object'}, + 'OperationQueryArgs': {'additionalProperties': False, + 'properties': {'actions': {'items': {'type': 'string'}, + 'type': 'array'}, + 'applications': {'items': {'type': 'string'}, + 'type': 'array'}, + 'limit': {'type': 'integer'}, + 'machines': {'items': {'type': 'string'}, + 'type': 'array'}, + 'offset': {'type': 'integer'}, + 'status': {'items': {'type': 'string'}, + 'type': 'array'}, + 'units': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'OperationResult': {'additionalProperties': False, + 'properties': {'actions': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'fail': {'type': 'string'}, + 'operation': {'type': 'string'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}, + 'summary': {'type': 'string'}}, + 'required': ['operation', 'summary'], + 'type': 'object'}, + 'OperationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/OperationResult'}, + 'type': 'array'}, + 'truncated': {'type': 'boolean'}}, + 'type': 'object'}, + 'RunParams': {'additionalProperties': False, + 'properties': {'applications': {'items': {'type': 'string'}, + 'type': 'array'}, + 'commands': {'type': 'string'}, + 'machines': {'items': {'type': 'string'}, + 'type': 'array'}, + 'timeout': {'type': 'integer'}, + 'units': {'items': {'type': 'string'}, + 'type': 'array'}, + 'workload-context': {'type': 'boolean'}}, + 'required': ['commands', 'timeout'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}}, + 'properties': {'Actions': {'description': 'Actions takes a list of ' + 'ActionTags, and returns the full ' + 'Action for\n' + 'each ID.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'ApplicationsCharmsActions': {'description': 'ApplicationsCharmsActions ' + 'returns a slice ' + 'of charm Actions ' + 'for a slice of\n' + 'services.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationsCharmActionsResults'}}, + 'type': 'object'}, + 'Cancel': {'description': 'Cancel attempts to cancel enqueued ' + 'Actions from running.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'Enqueue': {'description': 'Enqueue takes a list of Actions ' + 'and queues them up to be executed ' + 'by\n' + 'the designated ActionReceiver, ' + 'returning the params.Action for ' + 'each\n' + 'enqueued Action, or an error if ' + 'there was a problem enqueueing ' + 'the\n' + 'Action.', + 'properties': {'Params': {'$ref': '#/definitions/Actions'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'EnqueueOperation': {'description': 'EnqueueOperation takes a ' + 'list of Actions and ' + 'queues them up to be ' + 'executed as\n' + 'an operation, each action ' + 'running as a task on the ' + 'the designated ' + 'ActionReceiver.\n' + 'We return the ID of the ' + 'overall operation and ' + 'each individual task.', + 'properties': {'Params': {'$ref': '#/definitions/Actions'}, + 'Result': {'$ref': '#/definitions/EnqueuedActions'}}, + 'type': 'object'}, + 'FindActionTagsByPrefix': {'description': 'FindActionTagsByPrefix ' + 'takes a list of ' + 'string prefixes and ' + 'finds\n' + 'corresponding ' + 'ActionTags that ' + 'match that prefix.\n' + 'TODO(juju3) - ' + 'rename API method ' + 'since we only need ' + 'prefix matching for ' + 'UUIDs', + 'properties': {'Params': {'$ref': '#/definitions/FindTags'}, + 'Result': {'$ref': '#/definitions/FindTagsResults'}}, + 'type': 'object'}, + 'FindActionsByNames': {'properties': {'Params': {'$ref': '#/definitions/FindActionsByNames'}, + 'Result': {'$ref': '#/definitions/ActionsByNames'}}, + 'type': 'object'}, + 'ListAll': {'description': 'ListAll takes a list of Entities ' + 'representing ActionReceivers and\n' + 'returns all of the Actions that ' + 'have been enqueued or run by each ' + 'of\n' + 'those Entities.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'ListCompleted': {'description': 'ListCompleted takes a list ' + 'of Entities representing ' + 'ActionReceivers\n' + 'and returns all of the ' + 'Actions that have been run ' + 'on each of those\n' + 'Entities.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'ListOperations': {'description': 'ListOperations fetches the ' + 'called actions for ' + 'specified apps/units.', + 'properties': {'Params': {'$ref': '#/definitions/OperationQueryArgs'}, + 'Result': {'$ref': '#/definitions/OperationResults'}}, + 'type': 'object'}, + 'ListPending': {'description': 'ListPending takes a list of ' + 'Entities representing ' + 'ActionReceivers\n' + 'and returns all of the Actions ' + 'that are enqueued for each of ' + 'those\n' + 'Entities.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'ListRunning': {'description': 'ListRunning takes a list of ' + 'Entities representing ' + 'ActionReceivers and\n' + 'returns all of the Actions ' + 'that have are running on each ' + 'of those\n' + 'Entities.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'type': 'object'}, + 'Operations': {'description': 'Operations fetches the ' + 'specified operation ids.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/OperationResults'}}, + 'type': 'object'}, + 'Run': {'description': 'Run the commands specified on the ' + 'machines identified through the\n' + 'list of machines, units and services.', + 'properties': {'Params': {'$ref': '#/definitions/RunParams'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'RunOnAllMachines': {'description': 'RunOnAllMachines attempts ' + 'to run the specified ' + 'command on all the ' + 'machines.', + 'properties': {'Params': {'$ref': '#/definitions/RunParams'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'WatchActionsProgress': {'description': 'WatchActionsProgress ' + 'creates a watcher ' + 'that reports on ' + 'action log messages.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ActionResults) + async def 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationsCharmActionsResults) + async def 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Enqueue(self, actions=None): + ''' + Enqueue takes a list of Actions and queues them up to be executed by + the designated ActionReceiver, returning the params.Action for each + enqueued Action, or an error if there was a problem enqueueing the + Action. + + actions : typing.Sequence[~Action] + Returns -> ActionResults + ''' + 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='Enqueue', + version=6, + params=_params) + _params['actions'] = actions + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(EnqueuedActions) + async def 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 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=6, + params=_params) + _params['actions'] = actions + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindTagsResults) + async def FindActionTagsByPrefix(self, prefixes=None): + ''' + FindActionTagsByPrefix takes a list of string prefixes and finds + corresponding ActionTags that match that prefix. + TODO(juju3) - rename API method since we only need prefix matching for UUIDs + + prefixes : typing.Sequence[str] + Returns -> FindTagsResults + ''' + if prefixes is not None and not isinstance(prefixes, (bytes, str, list)): + raise Exception("Expected prefixes to be a Sequence, received: {}".format(type(prefixes))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Action', + request='FindActionTagsByPrefix', + version=6, + params=_params) + _params['prefixes'] = prefixes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByNames) + async def FindActionsByNames(self, names=None): + ''' + names : typing.Sequence[str] + Returns -> ActionsByNames + ''' + 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='Action', + request='FindActionsByNames', + version=6, + params=_params) + _params['names'] = names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListAll(self, entities=None): + ''' + ListAll takes a list of Entities representing ActionReceivers and + returns all of the Actions that have been enqueued or run by each of + those Entities. + + 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='Action', + request='ListAll', + version=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListCompleted(self, entities=None): + ''' + ListCompleted takes a list of Entities representing ActionReceivers + and returns all of the Actions that have been run on each of those + Entities. + + 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='Action', + request='ListCompleted', + version=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OperationResults) + async def 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=6, + params=_params) + _params['actions'] = actions + _params['applications'] = applications + _params['limit'] = limit + _params['machines'] = machines + _params['offset'] = offset + _params['status'] = status + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListPending(self, entities=None): + ''' + ListPending takes a list of Entities representing ActionReceivers + and returns all of the Actions that are enqueued for each of those + Entities. + + 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='Action', + request='ListPending', + version=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionsByReceivers) + async def ListRunning(self, entities=None): + ''' + ListRunning takes a list of Entities representing ActionReceivers and + returns all of the Actions that have are running on each of those + Entities. + + 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='Action', + request='ListRunning', + version=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(OperationResults) + async def 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Run(self, applications=None, commands=None, machines=None, timeout=None, units=None, workload_context=None): + ''' + Run the commands specified on the machines identified through the + list of machines, units and services. + + applications : typing.Sequence[str] + commands : str + machines : typing.Sequence[str] + timeout : int + units : typing.Sequence[str] + workload_context : bool + Returns -> ActionResults + ''' + 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 machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + 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='Run', + version=6, + params=_params) + _params['applications'] = applications + _params['commands'] = commands + _params['machines'] = machines + _params['timeout'] = timeout + _params['units'] = units + _params['workload-context'] = workload_context + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def RunOnAllMachines(self, applications=None, commands=None, machines=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 + machines : typing.Sequence[str] + timeout : int + units : typing.Sequence[str] + workload_context : bool + Returns -> ActionResults + ''' + 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 machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) + + 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=6, + params=_params) + _params['applications'] = applications + _params['commands'] = commands + _params['machines'] = machines + _params['timeout'] = timeout + _params['units'] = units + _params['workload-context'] = workload_context + reply = await self.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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class BundleFacade(Type): + name = 'Bundle' + version = 6 + schema = {'definitions': {'BundleChange': {'additionalProperties': False, + 'properties': {'args': {'items': {'additionalProperties': True, + 'type': 'object'}, + 'type': 'array'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesMapArgs': {'additionalProperties': False, + 'properties': {'args': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'id': {'type': 'string'}, + 'method': {'type': 'string'}, + 'requires': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['id', + 'method', + 'args', + 'requires'], + 'type': 'object'}, + 'BundleChangesMapArgsResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChangesMapArgs'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'BundleChangesParams': {'additionalProperties': False, + 'properties': {'bundleURL': {'type': 'string'}, + 'yaml': {'type': 'string'}}, + 'required': ['yaml', 'bundleURL'], + 'type': 'object'}, + 'BundleChangesResults': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/BundleChange'}, + 'type': 'array'}, + 'errors': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ExportBundleParams': {'additionalProperties': False, + 'properties': {'include-charm-defaults': {'type': 'boolean'}}, + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}}, + 'properties': {'ExportBundle': {'description': 'ExportBundle exports the ' + 'current model configuration ' + 'as bundle.', + 'properties': {'Params': {'$ref': '#/definitions/ExportBundleParams'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'GetChanges': {'description': 'GetChanges returns the list of ' + 'changes required to deploy the ' + 'given bundle\n' + 'data. The changes are sorted by ' + 'requirements, so that they can ' + 'be applied in\n' + 'order.\n' + 'GetChanges has been superseded ' + 'in favour of GetChangesMapArgs. ' + "It's\n" + 'preferable to use that new ' + 'method to add new functionality ' + 'and move clients\n' + 'away from this one.', + 'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesResults'}}, + 'type': 'object'}, + 'GetChangesMapArgs': {'description': 'GetChangesMapArgs ' + 'returns the list of ' + 'changes required to ' + 'deploy the given\n' + 'bundle data. The changes ' + 'are sorted by ' + 'requirements, so that ' + 'they can be\n' + 'applied in order.\n' + 'V4 GetChangesMapArgs is ' + 'not supported on ' + 'anything less than v4', + 'properties': {'Params': {'$ref': '#/definitions/BundleChangesParams'}, + 'Result': {'$ref': '#/definitions/BundleChangesMapArgsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringResult) + async def ExportBundle(self, include_charm_defaults=None): + ''' + ExportBundle exports the current model configuration as bundle. + + include_charm_defaults : 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))) + + # 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 + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BundleChangesResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(BundleChangesMapArgsResults) + async def 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 = await self.rpc(msg) + return reply + + + +class CloudFacade(Type): + name = 'Cloud' + version = 6 + schema = {'definitions': {'AddCloudArgs': {'additionalProperties': False, + 'properties': {'cloud': {'$ref': '#/definitions/Cloud'}, + 'force': {'type': 'boolean'}, + 'name': {'type': 'string'}}, + 'required': ['cloud', 'name'], + 'type': 'object'}, + 'Cloud': {'additionalProperties': False, + 'properties': {'auth-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'ca-certificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'endpoint': {'type': 'string'}, + 'host-cloud-region': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'region-config': {'patternProperties': {'.*': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'regions': {'items': {'$ref': '#/definitions/CloudRegion'}, + 'type': 'array'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudCredentialArg': {'additionalProperties': False, + 'properties': {'cloud-name': {'type': 'string'}, + 'credential-name': {'type': 'string'}}, + 'required': ['cloud-name', + 'credential-name'], + 'type': 'object'}, + 'CloudCredentialArgs': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/CloudCredentialArg'}, + 'type': 'array'}, + 'include-secrets': {'type': 'boolean'}}, + 'required': ['include-secrets'], + 'type': 'object'}, + 'CloudCredentialResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudCredential'}}, + 'type': 'object'}, + 'CloudCredentialResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudCredentialResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CloudDetails': {'additionalProperties': False, + 'properties': {'auth-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'regions': {'items': {'$ref': '#/definitions/CloudRegion'}, + 'type': 'array'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CloudInfo': {'additionalProperties': False, + 'properties': {'CloudDetails': {'$ref': '#/definitions/CloudDetails'}, + 'users': {'items': {'$ref': '#/definitions/CloudUserInfo'}, + 'type': 'array'}}, + 'required': ['CloudDetails', 'users'], + 'type': 'object'}, + 'CloudInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudInfo'}}, + 'type': 'object'}, + 'CloudInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'CloudInstanceTypesConstraint': {'additionalProperties': False, + 'properties': {'cloud-tag': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'region': {'type': 'string'}}, + 'required': ['cloud-tag', + 'region'], + 'type': 'object'}, + 'CloudInstanceTypesConstraints': {'additionalProperties': False, + 'properties': {'constraints': {'items': {'$ref': '#/definitions/CloudInstanceTypesConstraint'}, + 'type': 'array'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'CloudRegion': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}}, + 'required': ['name'], + 'type': 'object'}, + 'CloudResult': {'additionalProperties': False, + 'properties': {'cloud': {'$ref': '#/definitions/Cloud'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'CloudResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CloudUserInfo': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'display-name': {'type': 'string'}, + 'user': {'type': 'string'}}, + 'required': ['user', + 'display-name', + 'access'], + 'type': 'object'}, + 'CloudsResult': {'additionalProperties': False, + 'properties': {'clouds': {'patternProperties': {'.*': {'$ref': '#/definitions/Cloud'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'ControllerCredentialInfo': {'additionalProperties': False, + 'properties': {'content': {'$ref': '#/definitions/CredentialContent'}, + 'models': {'items': {'$ref': '#/definitions/ModelAccess'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CredentialContent': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'cloud': {'type': 'string'}, + 'name': {'type': 'string'}, + 'valid': {'type': 'boolean'}}, + 'required': ['name', + 'cloud', + 'auth-type'], + 'type': 'object'}, + 'CredentialContentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ControllerCredentialInfo'}}, + 'type': 'object'}, + 'CredentialContentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CredentialContentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'InstanceType': {'additionalProperties': False, + 'properties': {'arches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cost': {'type': 'integer'}, + 'cpu-cores': {'type': 'integer'}, + 'deprecated': {'type': 'boolean'}, + 'memory': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'root-disk': {'type': 'integer'}, + 'virt-type': {'type': 'string'}}, + 'required': ['arches', 'cpu-cores', 'memory'], + 'type': 'object'}, + 'InstanceTypesResult': {'additionalProperties': False, + 'properties': {'cost-currency': {'type': 'string'}, + 'cost-divisor': {'type': 'integer'}, + 'cost-unit': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'instance-types': {'items': {'$ref': '#/definitions/InstanceType'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceTypesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InstanceTypesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListCloudInfo': {'additionalProperties': False, + 'properties': {'CloudDetails': {'$ref': '#/definitions/CloudDetails'}, + 'user-access': {'type': 'string'}}, + 'required': ['CloudDetails', 'user-access'], + 'type': 'object'}, + 'ListCloudInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ListCloudInfo'}}, + 'type': 'object'}, + 'ListCloudInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ListCloudInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListCloudsRequest': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag'], + 'type': 'object'}, + 'ModelAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'model': {'type': 'string'}}, + 'type': 'object'}, + 'ModifyCloudAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'action': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', + 'cloud-tag', + 'action', + 'access'], + 'type': 'object'}, + 'ModifyCloudAccessRequest': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyCloudAccess'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'RevokeCredentialArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'force'], + 'type': 'object'}, + 'RevokeCredentialArgs': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/RevokeCredentialArg'}, + 'type': 'array'}}, + 'required': ['credentials'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'TaggedCredential': {'additionalProperties': False, + 'properties': {'credential': {'$ref': '#/definitions/CloudCredential'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'credential'], + 'type': 'object'}, + 'TaggedCredentials': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/TaggedCredential'}, + 'type': 'array'}}, + 'type': 'object'}, + 'UpdateCloudArgs': {'additionalProperties': False, + 'properties': {'clouds': {'items': {'$ref': '#/definitions/AddCloudArgs'}, + 'type': 'array'}}, + 'required': ['clouds'], + 'type': 'object'}, + 'UpdateCredentialArgs': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/TaggedCredential'}, + 'type': 'array'}, + 'force': {'type': 'boolean'}}, + 'required': ['credentials', 'force'], + 'type': 'object'}, + 'UpdateCredentialModelResult': {'additionalProperties': False, + 'properties': {'errors': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}, + 'name': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', 'name'], + 'type': 'object'}, + 'UpdateCredentialResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'models': {'items': {'$ref': '#/definitions/UpdateCredentialModelResult'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'UpdateCredentialResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpdateCredentialResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'UserCloud': {'additionalProperties': False, + 'properties': {'cloud-tag': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', 'cloud-tag'], + 'type': 'object'}, + 'UserClouds': {'additionalProperties': False, + 'properties': {'user-clouds': {'items': {'$ref': '#/definitions/UserCloud'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + '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': {'AddCloud': {'properties': {'Params': {'$ref': '#/definitions/AddCloudArgs'}}, + 'type': 'object'}, + 'AddCredentials': {'properties': {'Params': {'$ref': '#/definitions/TaggedCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CheckCredentialsModels': {'properties': {'Params': {'$ref': '#/definitions/TaggedCredentials'}, + 'Result': {'$ref': '#/definitions/UpdateCredentialResults'}}, + 'type': 'object'}, + 'Cloud': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudResults'}}, + 'type': 'object'}, + 'CloudInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudInfoResults'}}, + 'type': 'object'}, + 'Clouds': {'properties': {'Result': {'$ref': '#/definitions/CloudsResult'}}, + 'type': 'object'}, + 'Credential': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudCredentialResults'}}, + 'type': 'object'}, + 'CredentialContents': {'properties': {'Params': {'$ref': '#/definitions/CloudCredentialArgs'}, + 'Result': {'$ref': '#/definitions/CredentialContentResults'}}, + 'type': 'object'}, + 'InstanceTypes': {'properties': {'Params': {'$ref': '#/definitions/CloudInstanceTypesConstraints'}, + 'Result': {'$ref': '#/definitions/InstanceTypesResults'}}, + 'type': 'object'}, + 'ListCloudInfo': {'properties': {'Params': {'$ref': '#/definitions/ListCloudsRequest'}, + 'Result': {'$ref': '#/definitions/ListCloudInfoResults'}}, + 'type': 'object'}, + 'ModifyCloudAccess': {'properties': {'Params': {'$ref': '#/definitions/ModifyCloudAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveClouds': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RevokeCredentialsCheckModels': {'properties': {'Params': {'$ref': '#/definitions/RevokeCredentialArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateCloud': {'properties': {'Params': {'$ref': '#/definitions/UpdateCloudArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateCredentialsCheckModels': {'properties': {'Params': {'$ref': '#/definitions/UpdateCredentialArgs'}, + 'Result': {'$ref': '#/definitions/UpdateCredentialResults'}}, + 'type': 'object'}, + 'UserCredentials': {'properties': {'Params': {'$ref': '#/definitions/UserClouds'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def AddCloud(self, cloud=None, force=None, name=None): + ''' + 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=6, + params=_params) + _params['cloud'] = cloud + _params['force'] = force + _params['name'] = name + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddCredentials(self, credentials=None): + ''' + credentials : typing.Sequence[~TaggedCredential] + 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='AddCredentials', + version=6, + params=_params) + _params['credentials'] = credentials + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpdateCredentialResults) + async def CheckCredentialsModels(self, credentials=None): + ''' + 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=6, + params=_params) + _params['credentials'] = credentials + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudResults) + async def Cloud(self, entities=None): + ''' + 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudInfoResults) + async def CloudInfo(self, entities=None): + ''' + 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudsResult) + async def Clouds(self): + ''' + + Returns -> CloudsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Cloud', + request='Clouds', + version=6, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudCredentialResults) + async def Credential(self, entities=None): + ''' + 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CredentialContentResults) + async def CredentialContents(self, credentials=None, include_secrets=None): + ''' + 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=6, + params=_params) + _params['credentials'] = credentials + _params['include-secrets'] = include_secrets + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InstanceTypesResults) + async def InstanceTypes(self, constraints=None): + ''' + 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=6, + params=_params) + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListCloudInfoResults) + async def ListCloudInfo(self, all_=None, user_tag=None): + ''' + 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=6, + params=_params) + _params['all'] = all_ + _params['user-tag'] = user_tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyCloudAccess(self, changes=None): + ''' + changes : typing.Sequence[~ModifyCloudAccess] + 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='Cloud', + request='ModifyCloudAccess', + version=6, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveClouds(self, entities=None): + ''' + 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RevokeCredentialsCheckModels(self, credentials=None): + ''' + 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=6, + params=_params) + _params['credentials'] = credentials + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateCloud(self, clouds=None): + ''' + 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=6, + params=_params) + _params['clouds'] = clouds + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpdateCredentialResults) + async def UpdateCredentialsCheckModels(self, credentials=None, force=None): + ''' + 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=6, + params=_params) + _params['credentials'] = credentials + _params['force'] = force + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def UserCredentials(self, user_clouds=None): + ''' + 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=6, + params=_params) + _params['user-clouds'] = user_clouds + reply = await self.rpc(msg) + return reply + + + +class FirewallerFacade(Type): + name = 'Firewaller' + version = 6 + schema = {'definitions': {'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'ExposeInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'exposed': {'type': 'boolean'}, + 'exposed-endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/ExposedEndpoint'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'ExposeInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ExposeInfoResult'}, + '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'}, + 'FanConfigEntry': {'additionalProperties': False, + 'properties': {'overlay': {'type': 'string'}, + 'underlay': {'type': 'string'}}, + 'required': ['underlay', 'overlay'], + 'type': 'object'}, + 'FirewallRule': {'additionalProperties': False, + 'properties': {'known-service': {'type': 'string'}, + 'whitelist-cidrs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['known-service'], + 'type': 'object'}, + 'KnownServiceArgs': {'additionalProperties': False, + 'properties': {'known-services': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['known-services'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListFirewallRulesResults': {'additionalProperties': False, + 'properties': {'Rules': {'items': {'$ref': '#/definitions/FirewallRule'}, + 'type': 'array'}}, + 'required': ['Rules'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MacaroonResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/Macaroon'}}, + 'type': 'object'}, + 'MacaroonResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MacaroonResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelTag': {'additionalProperties': False, 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'OpenMachinePortRangesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'unit-port-ranges': {'patternProperties': {'.*': {'items': {'$ref': '#/definitions/OpenUnitPortRanges'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'required': ['unit-port-ranges'], + 'type': 'object'}, + 'OpenMachinePortRangesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/OpenMachinePortRangesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'OpenUnitPortRanges': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'port-ranges': {'items': {'$ref': '#/definitions/PortRange'}, + 'type': 'array'}, + 'subnet-cidrs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['endpoint', + 'port-ranges', + 'subnet-cidrs'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SpaceInfo': {'additionalProperties': False, + 'properties': {'id': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/SubnetV3'}, + 'type': 'array'}}, + 'required': ['id', 'name'], + 'type': 'object'}, + 'SpaceInfos': {'additionalProperties': False, + 'properties': {'space-infos': {'items': {'$ref': '#/definitions/SpaceInfo'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SpaceInfosParams': {'additionalProperties': False, + 'properties': {'space-ids': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'SubnetV2': {'additionalProperties': False, + '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': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones', + 'Subnet'], + 'type': 'object'}, + 'SubnetV3': {'additionalProperties': False, + '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': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones', + 'Subnet', + 'SubnetV2', + 'space-id'], + 'type': 'object'}}, + 'properties': {'AreManuallyProvisioned': {'description': 'AreManuallyProvisioned ' + 'returns whether ' + 'each given entity ' + 'is\n' + 'manually ' + 'provisioned or not. ' + 'Only machine tags ' + 'are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'CloudSpec': {'description': "CloudSpec returns the model's " + 'cloud spec.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'FirewallRules': {'description': 'FirewallRules returns the ' + 'firewall rules for the ' + 'specified well known service ' + 'types.', + 'properties': {'Params': {'$ref': '#/definitions/KnownServiceArgs'}, + 'Result': {'$ref': '#/definitions/ListFirewallRulesResults'}}, + 'type': 'object'}, + 'GetAssignedMachine': {'description': 'GetAssignedMachine ' + 'returns the assigned ' + 'machine tag (if any) ' + 'for\n' + 'each given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GetCloudSpec': {'description': 'GetCloudSpec constructs the ' + 'CloudSpec for a validated and ' + 'authorized model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetExposeInfo': {'description': 'GetExposeInfo returns the ' + 'expose flag and per-endpoint ' + 'expose settings\n' + 'for the specified ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ExposeInfoResults'}}, + 'type': 'object'}, + 'InstanceId': {'description': 'InstanceId returns the provider ' + 'specific instance id for each ' + 'given\n' + 'machine or an ' + 'CodeNotProvisioned error, if ' + 'not set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'MacaroonForRelations': {'description': 'MacaroonForRelations ' + 'returns the macaroon ' + 'for the specified ' + 'relations.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MacaroonResults'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'OpenedMachinePortRanges': {'description': 'OpenedMachinePortRanges ' + 'returns a list of ' + 'the opened port ' + 'ranges for the\n' + 'specified machines ' + 'where each result ' + 'is broken down by ' + 'unit. The list of\n' + 'opened ports for ' + 'each unit is ' + 'further grouped by ' + 'endpoint name and ' + 'includes\n' + 'the subnet CIDRs ' + 'that belong to the ' + 'space that each ' + 'endpoint is bound ' + 'to.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/OpenMachinePortRangesResults'}}, + 'type': 'object'}, + 'SetRelationsStatus': {'description': 'SetRelationsStatus sets ' + 'the status for the ' + 'specified relations.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SpaceInfos': {'description': 'SpaceInfos returns a ' + 'comprehensive representation of ' + 'either all spaces or\n' + 'a filtered subset of the known ' + 'spaces and their associated ' + 'subnet details.', + 'properties': {'Params': {'$ref': '#/definitions/SpaceInfosParams'}, + 'Result': {'$ref': '#/definitions/SpaceInfos'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'description': 'WatchCloudSpecsChanges ' + 'returns a watcher ' + 'for cloud spec ' + 'changes.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + '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/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchIngressAddressesForRelations': {'description': 'WatchIngressAddressesForRelations ' + 'creates ' + 'a ' + 'watcher ' + 'that ' + 'returns ' + 'the ' + 'ingress ' + 'networks\n' + 'that ' + 'have ' + 'been ' + 'recorded ' + 'against ' + 'the ' + 'specified ' + 'relations.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchModelMachineStartTimes': {'description': 'WatchModelMachineStartTimes ' + 'watches the ' + 'non-container ' + 'machines in ' + 'the model\n' + 'for changes to ' + 'the Life or ' + 'AgentStartTime ' + 'fields and ' + 'reports them ' + 'as a batch.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'description': 'WatchModelMachines ' + 'returns a ' + 'StringsWatcher that ' + 'notifies of\n' + 'changes to the life ' + 'cycles of the top level ' + 'machines in the ' + 'current\n' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchOpenedPorts': {'description': 'WatchOpenedPorts returns ' + 'a new StringsWatcher for ' + 'each given\n' + 'model tag.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchSubnets': {'description': 'WatchSubnets returns a new ' + 'StringsWatcher that watches ' + 'the specified\n' + 'subnet tags or all tags if no ' + 'entities are specified.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchUnits': {'description': 'WatchUnits starts a ' + 'StringsWatcher to watch all ' + 'units belonging to\n' + 'to any entity (machine or ' + 'service) passed in args.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(BoolResults) + async def 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResults) + async def 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='Firewaller', + request='CloudSpec', + version=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def 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='Firewaller', + request='ControllerAPIInfoForModels', + version=6, + params=_params) + _params['entities'] = entities + reply = await self.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='Firewaller', + request='ControllerConfig', + version=6, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListFirewallRulesResults) + async def FirewallRules(self, known_services=None): + ''' + FirewallRules returns the firewall rules for the specified well known service types. + + known_services : typing.Sequence[str] + Returns -> ListFirewallRulesResults + ''' + if known_services is not None and not isinstance(known_services, (bytes, str, list)): + raise Exception("Expected known_services to be a Sequence, received: {}".format(type(known_services))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='FirewallRules', + version=6, + params=_params) + _params['known-services'] = known_services + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetAssignedMachine(self, entities=None): + ''' + GetAssignedMachine returns the assigned machine tag (if any) for + each given unit. + + 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='GetAssignedMachine', + version=6, + params=_params) + _params['entities'] = entities + reply = await self.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=6, + params=_params) + + reply = await self.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=6, + params=_params) + _params['entities'] = entities + reply = await self.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=6, + params=_params) + _params['entities'] = entities + reply = await self.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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MacaroonResults) + async def 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=6, + params=_params) + _params['entities'] = entities + reply = await self.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='Firewaller', + request='ModelConfig', + version=6, + params=_params) + + reply = await self.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=6, + params=_params) + _params['entities'] = entities + reply = await self.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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SpaceInfos) + async def 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=6, + params=_params) + _params['space-ids'] = space_ids + reply = await self.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='Firewaller', + request='Watch', + version=6, + params=_params) + _params['entities'] = entities + reply = await self.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='Firewaller', + request='WatchCloudSpecsChanges', + version=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchEgressAddressesForRelations(self, entities=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. + + 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='WatchEgressAddressesForRelations', + version=6, + params=_params) + _params['entities'] = entities + reply = await self.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='Firewaller', + request='WatchForModelConfigChanges', + version=6, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @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='Firewaller', + request='WatchModelMachineStartTimes', + version=6, + params=_params) + + reply = await self.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='Firewaller', + request='WatchModelMachines', + version=6, + params=_params) + + reply = await self.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 + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class MachineManagerFacade(Type): + name = 'MachineManager' + version = 6 + schema = {'definitions': {'AddMachineParams': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/Address'}, + 'type': 'array'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'container-type': {'type': 'string'}, + 'disks': {'items': {'$ref': '#/definitions/Constraints'}, + 'type': 'array'}, + 'hardware-characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'instance-id': {'type': 'string'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'parent-id': {'type': 'string'}, + 'placement': {'$ref': '#/definitions/Placement'}, + 'series': {'type': 'string'}}, + 'required': ['series', + 'constraints', + 'jobs', + 'parent-id', + 'container-type', + 'instance-id', + 'nonce', + 'hardware-characteristics', + 'addresses'], + 'type': 'object'}, + 'AddMachines': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/AddMachineParams'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'AddMachinesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'machine': {'type': 'string'}}, + 'required': ['machine'], + 'type': 'object'}, + 'AddMachinesResults': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/AddMachinesResult'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'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'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'DestroyMachineInfo': {'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'}, + 'DestroyMachineResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'$ref': '#/definitions/DestroyMachineInfo'}}, + 'type': 'object'}, + 'DestroyMachineResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/DestroyMachineResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'DestroyMachinesParams': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'keep': {'type': 'boolean'}, + 'machine-tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'max-wait': {'type': 'integer'}}, + 'required': ['machine-tags'], + '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'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'root-disk-source': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceType': {'additionalProperties': False, + 'properties': {'arches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cost': {'type': 'integer'}, + 'cpu-cores': {'type': 'integer'}, + 'deprecated': {'type': 'boolean'}, + 'memory': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'root-disk': {'type': 'integer'}, + 'virt-type': {'type': 'string'}}, + 'required': ['arches', 'cpu-cores', 'memory'], + 'type': 'object'}, + 'InstanceTypesResult': {'additionalProperties': False, + 'properties': {'cost-currency': {'type': 'string'}, + 'cost-divisor': {'type': 'integer'}, + 'cost-unit': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'instance-types': {'items': {'$ref': '#/definitions/InstanceType'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceTypesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InstanceTypesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelInstanceTypesConstraint': {'additionalProperties': False, + 'properties': {'value': {'$ref': '#/definitions/Value'}}, + 'type': 'object'}, + 'ModelInstanceTypesConstraints': {'additionalProperties': False, + 'properties': {'constraints': {'items': {'$ref': '#/definitions/ModelInstanceTypesConstraint'}, + 'type': 'array'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpgradeSeriesNotificationParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['entity', + 'watcher-id'], + 'type': 'object'}, + 'UpgradeSeriesNotificationParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesNotificationParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesUnitsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + 'type': 'object'}, + 'UpgradeSeriesUnitsResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/UpgradeSeriesUnitsResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'AddMachines': {'description': 'AddMachines adds new machines ' + 'with the supplied parameters.', + 'properties': {'Params': {'$ref': '#/definitions/AddMachines'}, + 'Result': {'$ref': '#/definitions/AddMachinesResults'}}, + 'type': 'object'}, + 'DestroyMachine': {'description': 'DestroyMachine removes a ' + 'set of machines from the ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DestroyMachineResults'}}, + 'type': 'object'}, + 'DestroyMachineWithParams': {'description': 'DestroyMachineWithParams ' + 'removes a set of ' + 'machines from the ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyMachinesParams'}, + 'Result': {'$ref': '#/definitions/DestroyMachineResults'}}, + 'type': 'object'}, + 'ForceDestroyMachine': {'description': 'ForceDestroyMachine ' + 'forcibly removes a set ' + 'of machines from the ' + 'model.\n' + 'TODO (anastasiamac ' + '2019-4-24) From Juju ' + '3.0 this call will be ' + 'removed in favour of ' + 'DestroyMachinesWithParams.\n' + 'Also from ModelManger ' + 'v6 this call is less ' + 'useful as it does not ' + 'support MaxWait ' + 'customisation.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DestroyMachineResults'}}, + 'type': 'object'}, + 'GetUpgradeSeriesMessages': {'description': 'GetUpgradeSeriesMessages ' + 'returns all new ' + 'messages ' + 'associated with ' + 'upgrade\n' + 'series events. ' + 'Messages that ' + 'have already been ' + 'retrieved once ' + 'are not\n' + 'returned by this ' + 'method.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesNotificationParams'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'InstanceTypes': {'description': 'InstanceTypes returns ' + 'instance type information ' + 'for the cloud and region\n' + 'in which the current model ' + 'is deployed.', + 'properties': {'Params': {'$ref': '#/definitions/ModelInstanceTypesConstraints'}, + 'Result': {'$ref': '#/definitions/InstanceTypesResults'}}, + 'type': 'object'}, + 'UpgradeSeriesComplete': {'description': 'UpgradeSeriesComplete ' + 'marks a machine as ' + 'having completed a ' + 'managed series\n' + 'upgrade.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'UpgradeSeriesPrepare': {'description': 'UpgradeSeriesPrepare ' + 'prepares a machine ' + 'for a OS series ' + 'upgrade.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'Result': {'$ref': '#/definitions/ErrorResult'}}, + 'type': 'object'}, + 'UpgradeSeriesValidate': {'description': 'UpgradeSeriesValidate ' + 'validates that the ' + 'incoming arguments ' + 'correspond to a\n' + 'valid series upgrade ' + 'for the target ' + 'machine.\n' + 'If they do, a list ' + "of the machine's " + 'current units is ' + 'returned for use in\n' + 'soliciting user ' + 'confirmation of the ' + 'command.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesUnitsResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'description': 'WatchUpgradeSeriesNotifications ' + 'returns a ' + 'watcher ' + 'that fires ' + 'on ' + 'upgrade\n' + 'series ' + 'events.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddMachinesResults) + async def AddMachines(self, params=None): + ''' + AddMachines adds new machines with the supplied parameters. + + 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=6, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyMachineResults) + async def DestroyMachine(self, entities=None): + ''' + DestroyMachine removes a set of machines from the model. + + entities : typing.Sequence[~Entity] + Returns -> DestroyMachineResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='DestroyMachine', + version=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyMachineResults) + async def DestroyMachineWithParams(self, force=None, keep=None, machine_tags=None, max_wait=None): + ''' + DestroyMachineWithParams removes a set of machines from the model. + + force : bool + keep : bool + machine_tags : typing.Sequence[str] + max_wait : int + Returns -> DestroyMachineResults + ''' + 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=6, + params=_params) + _params['force'] = force + _params['keep'] = keep + _params['machine-tags'] = machine_tags + _params['max-wait'] = max_wait + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyMachineResults) + async def ForceDestroyMachine(self, entities=None): + ''' + ForceDestroyMachine forcibly removes a set of machines from the model. + TODO (anastasiamac 2019-4-24) From Juju 3.0 this call will be removed in favour of DestroyMachinesWithParams. + Also from ModelManger v6 this call is less useful as it does not support MaxWait customisation. + + entities : typing.Sequence[~Entity] + Returns -> DestroyMachineResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='ForceDestroyMachine', + version=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def 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=6, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InstanceTypesResults) + async def 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=6, + params=_params) + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + async def UpgradeSeriesComplete(self, force=None, series=None, tag=None): + ''' + UpgradeSeriesComplete marks a machine as having completed a managed series + upgrade. + + force : bool + series : str + tag : Entity + Returns -> ErrorResult + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + 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=6, + params=_params) + _params['force'] = force + _params['series'] = series + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResult) + async def UpgradeSeriesPrepare(self, force=None, series=None, tag=None): + ''' + UpgradeSeriesPrepare prepares a machine for a OS series upgrade. + + force : bool + series : str + tag : Entity + Returns -> ErrorResult + ''' + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + 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=6, + params=_params) + _params['force'] = force + _params['series'] = series + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesUnitsResults) + async def 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[~UpdateSeriesArg] + 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=6, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def 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=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class SpacesFacade(Type): + name = 'Spaces' + version = 6 + schema = {'definitions': {'CreateSpaceParams': {'additionalProperties': False, + 'properties': {'cidrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'provider-id': {'type': 'string'}, + 'public': {'type': 'boolean'}, + 'space-tag': {'type': 'string'}}, + 'required': ['cidrs', + 'space-tag', + 'public'], + 'type': 'object'}, + 'CreateSpacesParams': {'additionalProperties': False, + 'properties': {'spaces': {'items': {'$ref': '#/definitions/CreateSpaceParams'}, + 'type': 'array'}}, + 'required': ['spaces'], + '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'}, + 'ListSpacesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/Space'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MoveSubnetsParam': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'space-tag': {'type': 'string'}, + 'subnets': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['subnets', + 'space-tag', + 'force'], + 'type': 'object'}, + 'MoveSubnetsParams': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/MoveSubnetsParam'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'MoveSubnetsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'moved-subnets': {'items': {'$ref': '#/definitions/MovedSubnet'}, + 'type': 'array'}, + 'new-space': {'type': 'string'}}, + 'required': ['new-space'], + 'type': 'object'}, + 'MoveSubnetsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MoveSubnetsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MovedSubnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'old-space': {'type': 'string'}, + 'subnet': {'type': 'string'}}, + 'required': ['subnet', 'old-space', 'cidr'], + 'type': 'object'}, + 'RemoveSpaceParam': {'additionalProperties': False, + 'properties': {'dry-run': {'type': 'boolean'}, + 'force': {'type': 'boolean'}, + 'space': {'$ref': '#/definitions/Entity'}}, + 'required': ['space'], + 'type': 'object'}, + 'RemoveSpaceParams': {'additionalProperties': False, + 'properties': {'space-param': {'items': {'$ref': '#/definitions/RemoveSpaceParam'}, + 'type': 'array'}}, + 'required': ['space-param'], + 'type': 'object'}, + 'RemoveSpaceResult': {'additionalProperties': False, + 'properties': {'bindings': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'constraints': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'controller-settings': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'RemoveSpaceResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoveSpaceResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RenameSpaceParams': {'additionalProperties': False, + 'properties': {'from-space-tag': {'type': 'string'}, + 'to-space-tag': {'type': 'string'}}, + 'required': ['from-space-tag', + 'to-space-tag'], + 'type': 'object'}, + 'RenameSpacesParams': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RenameSpaceParams'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'ShowSpaceResult': {'additionalProperties': False, + 'properties': {'applications': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'machine-count': {'type': 'integer'}, + 'space': {'$ref': '#/definitions/Space'}}, + 'required': ['space', + 'applications', + 'machine-count'], + 'type': 'object'}, + 'ShowSpaceResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ShowSpaceResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Space': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'name': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['id', 'name', 'subnets'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}}, + 'properties': {'CreateSpaces': {'description': 'CreateSpaces creates a new ' + 'Juju network space, ' + 'associating the\n' + 'specified subnets with it ' + '(optional; can be empty).', + 'properties': {'Params': {'$ref': '#/definitions/CreateSpacesParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ListSpaces': {'description': 'ListSpaces lists all the ' + 'available spaces and their ' + 'associated subnets.', + 'properties': {'Result': {'$ref': '#/definitions/ListSpacesResults'}}, + 'type': 'object'}, + 'MoveSubnets': {'description': 'MoveSubnets ensures that the ' + 'input subnets are in the input ' + 'space.', + 'properties': {'Params': {'$ref': '#/definitions/MoveSubnetsParams'}, + 'Result': {'$ref': '#/definitions/MoveSubnetsResults'}}, + 'type': 'object'}, + 'ReloadSpaces': {'description': 'ReloadSpaces refreshes spaces ' + 'from substrate', + 'type': 'object'}, + 'RemoveSpace': {'description': 'RemoveSpace removes a space.\n' + 'Returns SpaceResults if ' + 'entities/settings are found ' + 'which makes the deletion not ' + 'possible.', + 'properties': {'Params': {'$ref': '#/definitions/RemoveSpaceParams'}, + 'Result': {'$ref': '#/definitions/RemoveSpaceResults'}}, + 'type': 'object'}, + 'RenameSpace': {'description': 'RenameSpace renames a space.', + 'properties': {'Params': {'$ref': '#/definitions/RenameSpacesParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ShowSpace': {'description': 'ShowSpace shows the spaces for a ' + 'set of given entities.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ShowSpaceResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListSpacesResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(MoveSubnetsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(RemoveSpaceResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RenameSpace(self, changes=None): + ''' + RenameSpace renames a space. + + changes : typing.Sequence[~RenameSpaceParams] + 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='Spaces', + request='RenameSpace', + version=6, + params=_params) + _params['changes'] = changes + reply = await self.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() + msg = dict(type='Spaces', + request='ShowSpace', + version=6, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class StorageFacade(Type): + name = 'Storage' + version = 6 + schema = {'definitions': {'AddStorageDetails': {'additionalProperties': False, + 'properties': {'storage-tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['storage-tags'], + 'type': 'object'}, + 'AddStorageResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/AddStorageDetails'}}, + 'type': 'object'}, + 'AddStorageResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/AddStorageResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BulkImportStorageParams': {'additionalProperties': False, + 'properties': {'storage': {'items': {'$ref': '#/definitions/ImportStorageParams'}, + 'type': 'array'}}, + 'required': ['storage'], + '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'}, + 'FilesystemAttachmentDetails': {'additionalProperties': False, + 'properties': {'FilesystemAttachmentInfo': {'$ref': '#/definitions/FilesystemAttachmentInfo'}, + 'life': {'type': 'string'}, + 'mount-point': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'required': ['FilesystemAttachmentInfo'], + 'type': 'object'}, + 'FilesystemAttachmentInfo': {'additionalProperties': False, + 'properties': {'mount-point': {'type': 'string'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'FilesystemDetails': {'additionalProperties': False, + 'properties': {'filesystem-tag': {'type': 'string'}, + 'info': {'$ref': '#/definitions/FilesystemInfo'}, + 'life': {'type': 'string'}, + 'machine-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/FilesystemAttachmentDetails'}}, + 'type': 'object'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'storage': {'$ref': '#/definitions/StorageDetails'}, + 'unit-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/FilesystemAttachmentDetails'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['filesystem-tag', + 'info', + 'status'], + 'type': 'object'}, + 'FilesystemDetailsListResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'$ref': '#/definitions/FilesystemDetails'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemDetailsListResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/FilesystemDetailsListResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemFilter': {'additionalProperties': False, + 'properties': {'machines': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemFilters': {'additionalProperties': False, + 'properties': {'filters': {'items': {'$ref': '#/definitions/FilesystemFilter'}, + 'type': 'array'}}, + 'type': 'object'}, + 'FilesystemInfo': {'additionalProperties': False, + 'properties': {'filesystem-id': {'type': 'string'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'required': ['filesystem-id', + 'pool', + 'size'], + 'type': 'object'}, + 'ImportStorageDetails': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}}, + 'required': ['storage-tag'], + 'type': 'object'}, + 'ImportStorageParams': {'additionalProperties': False, + 'properties': {'kind': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'storage-name': {'type': 'string'}}, + 'required': ['kind', + 'pool', + 'provider-id', + 'storage-name'], + 'type': 'object'}, + 'ImportStorageResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ImportStorageDetails'}}, + 'type': 'object'}, + 'ImportStorageResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ImportStorageResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoveStorage': {'additionalProperties': False, + 'properties': {'storage': {'items': {'$ref': '#/definitions/RemoveStorageInstance'}, + 'type': 'array'}}, + 'required': ['storage'], + 'type': 'object'}, + 'RemoveStorageInstance': {'additionalProperties': False, + 'properties': {'destroy-attachments': {'type': 'boolean'}, + 'destroy-storage': {'type': 'boolean'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'StorageAddParams': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'storage': {'$ref': '#/definitions/StorageConstraints'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'name', 'storage'], + 'type': 'object'}, + 'StorageAttachmentDetails': {'additionalProperties': False, + 'properties': {'life': {'type': 'string'}, + 'location': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag', + 'machine-tag'], + 'type': 'object'}, + 'StorageAttachmentId': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag'], + 'type': 'object'}, + 'StorageAttachmentIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/StorageAttachmentId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StorageDetachmentParams': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'ids': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'max-wait': {'type': 'integer'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageDetails': {'additionalProperties': False, + 'properties': {'attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/StorageAttachmentDetails'}}, + 'type': 'object'}, + 'kind': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'storage-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'owner-tag', + 'kind', + 'status', + 'persistent'], + 'type': 'object'}, + 'StorageDetailsListResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'$ref': '#/definitions/StorageDetails'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageDetailsListResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageDetailsListResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageDetailsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageDetails'}}, + 'type': 'object'}, + 'StorageDetailsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageDetailsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageFilter': {'additionalProperties': False, + 'type': 'object'}, + 'StorageFilters': {'additionalProperties': False, + 'properties': {'filters': {'items': {'$ref': '#/definitions/StorageFilter'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragePool': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'name': {'type': 'string'}, + 'provider': {'type': 'string'}}, + 'required': ['name', 'provider', 'attrs'], + 'type': 'object'}, + 'StoragePoolArgs': {'additionalProperties': False, + 'properties': {'pools': {'items': {'$ref': '#/definitions/StoragePool'}, + 'type': 'array'}}, + 'required': ['pools'], + 'type': 'object'}, + 'StoragePoolDeleteArg': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}}, + 'required': ['name'], + 'type': 'object'}, + 'StoragePoolDeleteArgs': {'additionalProperties': False, + 'properties': {'pools': {'items': {'$ref': '#/definitions/StoragePoolDeleteArg'}, + 'type': 'array'}}, + 'required': ['pools'], + 'type': 'object'}, + 'StoragePoolFilter': {'additionalProperties': False, + 'properties': {'names': {'items': {'type': 'string'}, + 'type': 'array'}, + 'providers': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragePoolFilters': {'additionalProperties': False, + 'properties': {'filters': {'items': {'$ref': '#/definitions/StoragePoolFilter'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragePoolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'storage-pools': {'items': {'$ref': '#/definitions/StoragePool'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragePoolsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StoragePoolsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StoragesAddParams': {'additionalProperties': False, + 'properties': {'storages': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}}, + 'required': ['storages'], + 'type': 'object'}, + 'VolumeAttachmentDetails': {'additionalProperties': False, + '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'}}, + 'required': ['VolumeAttachmentInfo'], + 'type': 'object'}, + 'VolumeAttachmentInfo': {'additionalProperties': False, + 'properties': {'bus-address': {'type': 'string'}, + 'device-link': {'type': 'string'}, + 'device-name': {'type': 'string'}, + 'plan-info': {'$ref': '#/definitions/VolumeAttachmentPlanInfo'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'VolumeAttachmentPlanInfo': {'additionalProperties': False, + 'properties': {'device-attributes': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'device-type': {'type': 'string'}}, + 'type': 'object'}, + 'VolumeDetails': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeInfo'}, + 'life': {'type': 'string'}, + 'machine-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/VolumeAttachmentDetails'}}, + 'type': 'object'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'storage': {'$ref': '#/definitions/StorageDetails'}, + 'unit-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/VolumeAttachmentDetails'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', 'info', 'status'], + 'type': 'object'}, + 'VolumeDetailsListResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'$ref': '#/definitions/VolumeDetails'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeDetailsListResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/VolumeDetailsListResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeFilter': {'additionalProperties': False, + 'properties': {'machines': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeFilters': {'additionalProperties': False, + 'properties': {'filters': {'items': {'$ref': '#/definitions/VolumeFilter'}, + 'type': 'array'}}, + 'type': 'object'}, + 'VolumeInfo': {'additionalProperties': False, + 'properties': {'hardware-id': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'volume-id': {'type': 'string'}, + 'wwn': {'type': 'string'}}, + 'required': ['volume-id', 'size', 'persistent'], + 'type': 'object'}}, + 'properties': {'AddToUnit': {'description': 'AddToUnit validates and creates ' + 'additional storage instances for ' + 'units.\n' + 'A "CHANGE" block can block this ' + 'operation.', + 'properties': {'Params': {'$ref': '#/definitions/StoragesAddParams'}, + 'Result': {'$ref': '#/definitions/AddStorageResults'}}, + 'type': 'object'}, + 'Attach': {'description': 'Attach attaches existing storage ' + 'instances to units.\n' + 'A "CHANGE" block can block this ' + 'operation.', + 'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CreatePool': {'description': 'CreatePool creates a new pool ' + 'with specified parameters.', + 'properties': {'Params': {'$ref': '#/definitions/StoragePoolArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DetachStorage': {'description': 'DetachStorage sets the ' + 'specified storage ' + 'attachments to Dying, unless ' + 'they are\n' + 'already Dying or Dead. Any ' + 'associated, persistent ' + 'storage will remain\n' + 'alive. This call can be ' + 'forced.', + 'properties': {'Params': {'$ref': '#/definitions/StorageDetachmentParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Import': {'description': 'Import imports existing storage ' + 'into the model.\n' + 'A "CHANGE" block can block this ' + 'operation.', + 'properties': {'Params': {'$ref': '#/definitions/BulkImportStorageParams'}, + 'Result': {'$ref': '#/definitions/ImportStorageResults'}}, + 'type': 'object'}, + 'ListFilesystems': {'description': 'ListFilesystems returns a ' + 'list of filesystems in the ' + 'environment matching\n' + 'the provided filter. Each ' + 'result describes a ' + 'filesystem in detail, ' + 'including\n' + "the filesystem's " + 'attachments.', + 'properties': {'Params': {'$ref': '#/definitions/FilesystemFilters'}, + 'Result': {'$ref': '#/definitions/FilesystemDetailsListResults'}}, + 'type': 'object'}, + 'ListPools': {'description': 'ListPools returns a list of ' + 'pools.\n' + 'If filter is provided, returned ' + 'list only contains pools that ' + 'match\n' + 'the filter.\n' + 'Pools can be filtered on names ' + 'and provider types.\n' + 'If both names and types are ' + 'provided as filter,\n' + 'pools that match either are ' + 'returned.\n' + 'This method lists union of pools ' + 'and environment provider types.\n' + 'If no filter is provided, all ' + 'pools are returned.', + 'properties': {'Params': {'$ref': '#/definitions/StoragePoolFilters'}, + 'Result': {'$ref': '#/definitions/StoragePoolsResults'}}, + 'type': 'object'}, + 'ListStorageDetails': {'description': 'ListStorageDetails ' + 'returns storage ' + 'matching a filter.', + 'properties': {'Params': {'$ref': '#/definitions/StorageFilters'}, + 'Result': {'$ref': '#/definitions/StorageDetailsListResults'}}, + 'type': 'object'}, + 'ListVolumes': {'description': 'ListVolumes lists volumes with ' + 'the given filters. Each filter ' + 'produces\n' + 'an independent list of ' + 'volumes, or an error if the ' + 'filter is invalid\n' + 'or the volumes could not be ' + 'listed.', + 'properties': {'Params': {'$ref': '#/definitions/VolumeFilters'}, + 'Result': {'$ref': '#/definitions/VolumeDetailsListResults'}}, + 'type': 'object'}, + 'Remove': {'description': 'Remove sets the specified storage ' + 'entities to Dying, unless they are\n' + 'already Dying or Dead, such that ' + 'the storage will eventually be ' + 'removed\n' + 'from the model. If the arguments ' + 'specify that the storage should be\n' + 'destroyed, then the associated ' + 'cloud storage will be destroyed ' + 'first;\n' + 'otherwise it will only be released ' + "from Juju's control.", + 'properties': {'Params': {'$ref': '#/definitions/RemoveStorage'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemovePool': {'description': 'RemovePool deletes the named ' + 'pool', + 'properties': {'Params': {'$ref': '#/definitions/StoragePoolDeleteArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StorageDetails': {'description': 'StorageDetails retrieves ' + 'and returns detailed ' + 'information about desired\n' + 'storage identified by ' + 'supplied tags. If specified ' + 'storage cannot be\n' + 'retrieved, individual error ' + 'is returned instead of ' + 'storage information.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StorageDetailsResults'}}, + 'type': 'object'}, + 'UpdatePool': {'description': 'UpdatePool deletes the named ' + 'pool', + 'properties': {'Params': {'$ref': '#/definitions/StoragePoolArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddStorageResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ImportStorageResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(FilesystemDetailsListResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StoragePoolsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageDetailsListResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(VolumeDetailsListResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageDetailsResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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 = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client7.py b/juju/client/old_clients/_client7.py new file mode 100644 index 000000000..cca067377 --- /dev/null +++ b/juju/client/old_clients/_client7.py @@ -0,0 +1,5478 @@ +# 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.old_clients._definitions import * + + +class CloudFacade(Type): + name = 'Cloud' + version = 7 + schema = {'definitions': {'AddCloudArgs': {'additionalProperties': False, + 'properties': {'cloud': {'$ref': '#/definitions/Cloud'}, + 'force': {'type': 'boolean'}, + 'name': {'type': 'string'}}, + 'required': ['cloud', 'name'], + 'type': 'object'}, + 'Cloud': {'additionalProperties': False, + 'properties': {'auth-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'ca-certificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'endpoint': {'type': 'string'}, + 'host-cloud-region': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'is-controller-cloud': {'type': 'boolean'}, + 'region-config': {'patternProperties': {'.*': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'regions': {'items': {'$ref': '#/definitions/CloudRegion'}, + 'type': 'array'}, + 'skip-tls-verify': {'type': 'boolean'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudCredentialArg': {'additionalProperties': False, + 'properties': {'cloud-name': {'type': 'string'}, + 'credential-name': {'type': 'string'}}, + 'required': ['cloud-name', + 'credential-name'], + 'type': 'object'}, + 'CloudCredentialArgs': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/CloudCredentialArg'}, + 'type': 'array'}, + 'include-secrets': {'type': 'boolean'}}, + 'required': ['include-secrets'], + 'type': 'object'}, + 'CloudCredentialResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudCredential'}}, + 'type': 'object'}, + 'CloudCredentialResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudCredentialResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CloudDetails': {'additionalProperties': False, + 'properties': {'auth-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'regions': {'items': {'$ref': '#/definitions/CloudRegion'}, + 'type': 'array'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'CloudInfo': {'additionalProperties': False, + 'properties': {'CloudDetails': {'$ref': '#/definitions/CloudDetails'}, + 'users': {'items': {'$ref': '#/definitions/CloudUserInfo'}, + 'type': 'array'}}, + 'required': ['CloudDetails', 'users'], + 'type': 'object'}, + 'CloudInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudInfo'}}, + 'type': 'object'}, + 'CloudInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'CloudInstanceTypesConstraint': {'additionalProperties': False, + 'properties': {'cloud-tag': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'region': {'type': 'string'}}, + 'required': ['cloud-tag', + 'region'], + 'type': 'object'}, + 'CloudInstanceTypesConstraints': {'additionalProperties': False, + 'properties': {'constraints': {'items': {'$ref': '#/definitions/CloudInstanceTypesConstraint'}, + 'type': 'array'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'CloudRegion': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}}, + 'required': ['name'], + 'type': 'object'}, + 'CloudResult': {'additionalProperties': False, + 'properties': {'cloud': {'$ref': '#/definitions/Cloud'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'CloudResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CloudUserInfo': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'display-name': {'type': 'string'}, + 'user': {'type': 'string'}}, + 'required': ['user', + 'display-name', + 'access'], + 'type': 'object'}, + 'CloudsResult': {'additionalProperties': False, + 'properties': {'clouds': {'patternProperties': {'.*': {'$ref': '#/definitions/Cloud'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'ControllerCredentialInfo': {'additionalProperties': False, + 'properties': {'content': {'$ref': '#/definitions/CredentialContent'}, + 'models': {'items': {'$ref': '#/definitions/ModelAccess'}, + 'type': 'array'}}, + 'type': 'object'}, + 'CredentialContent': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'cloud': {'type': 'string'}, + 'name': {'type': 'string'}, + 'valid': {'type': 'boolean'}}, + 'required': ['name', + 'cloud', + 'auth-type'], + 'type': 'object'}, + 'CredentialContentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ControllerCredentialInfo'}}, + 'type': 'object'}, + 'CredentialContentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CredentialContentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'InstanceType': {'additionalProperties': False, + 'properties': {'arches': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cost': {'type': 'integer'}, + 'cpu-cores': {'type': 'integer'}, + 'deprecated': {'type': 'boolean'}, + 'memory': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'root-disk': {'type': 'integer'}, + 'virt-type': {'type': 'string'}}, + 'required': ['arches', 'cpu-cores', 'memory'], + 'type': 'object'}, + 'InstanceTypesResult': {'additionalProperties': False, + 'properties': {'cost-currency': {'type': 'string'}, + 'cost-divisor': {'type': 'integer'}, + 'cost-unit': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'instance-types': {'items': {'$ref': '#/definitions/InstanceType'}, + 'type': 'array'}}, + 'type': 'object'}, + 'InstanceTypesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InstanceTypesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListCloudInfo': {'additionalProperties': False, + 'properties': {'CloudDetails': {'$ref': '#/definitions/CloudDetails'}, + 'user-access': {'type': 'string'}}, + 'required': ['CloudDetails', 'user-access'], + 'type': 'object'}, + 'ListCloudInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ListCloudInfo'}}, + 'type': 'object'}, + 'ListCloudInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ListCloudInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListCloudsRequest': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag'], + 'type': 'object'}, + 'ModelAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'model': {'type': 'string'}}, + 'type': 'object'}, + 'ModifyCloudAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'action': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', + 'cloud-tag', + 'action', + 'access'], + 'type': 'object'}, + 'ModifyCloudAccessRequest': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyCloudAccess'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'RevokeCredentialArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'force'], + 'type': 'object'}, + 'RevokeCredentialArgs': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/RevokeCredentialArg'}, + 'type': 'array'}}, + 'required': ['credentials'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'TaggedCredential': {'additionalProperties': False, + 'properties': {'credential': {'$ref': '#/definitions/CloudCredential'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'credential'], + 'type': 'object'}, + 'TaggedCredentials': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/TaggedCredential'}, + 'type': 'array'}}, + 'type': 'object'}, + 'UpdateCloudArgs': {'additionalProperties': False, + 'properties': {'clouds': {'items': {'$ref': '#/definitions/AddCloudArgs'}, + 'type': 'array'}}, + 'required': ['clouds'], + 'type': 'object'}, + 'UpdateCredentialArgs': {'additionalProperties': False, + 'properties': {'credentials': {'items': {'$ref': '#/definitions/TaggedCredential'}, + 'type': 'array'}, + 'force': {'type': 'boolean'}}, + 'required': ['credentials', 'force'], + 'type': 'object'}, + 'UpdateCredentialModelResult': {'additionalProperties': False, + 'properties': {'errors': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}, + 'name': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', 'name'], + 'type': 'object'}, + 'UpdateCredentialResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'models': {'items': {'$ref': '#/definitions/UpdateCredentialModelResult'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'UpdateCredentialResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpdateCredentialResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'UserCloud': {'additionalProperties': False, + 'properties': {'cloud-tag': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', 'cloud-tag'], + 'type': 'object'}, + 'UserClouds': {'additionalProperties': False, + 'properties': {'user-clouds': {'items': {'$ref': '#/definitions/UserCloud'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'allocate-public-ip': {'type': 'boolean'}, + 'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + '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': {'AddCloud': {'description': 'AddCloud adds a new cloud, ' + 'different from the one managed by ' + 'the controller.', + 'properties': {'Params': {'$ref': '#/definitions/AddCloudArgs'}}, + 'type': 'object'}, + 'AddCredentials': {'description': 'AddCredentials adds new ' + 'credentials.\n' + 'In contrast to ' + 'UpdateCredentials() below, ' + 'the new credentials can be\n' + 'for a cloud that the ' + 'controller does not manage ' + '(this is required\n' + 'for CAAS models)', + 'properties': {'Params': {'$ref': '#/definitions/TaggedCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CheckCredentialsModels': {'description': 'CheckCredentialsModels ' + 'validates supplied ' + "cloud credentials' " + 'content against\n' + 'models that ' + 'currently use these ' + 'credentials.\n' + 'If there are any ' + 'models that are ' + 'using a credential ' + 'and these models or ' + 'their\n' + 'cloud instances are ' + 'not going to be ' + 'accessible with ' + 'corresponding ' + 'credential,\n' + 'there will be ' + 'detailed validation ' + 'errors per model.\n' + "There's no Juju API " + 'client which uses ' + 'this, but JAAS ' + 'does,', + 'properties': {'Params': {'$ref': '#/definitions/TaggedCredentials'}, + 'Result': {'$ref': '#/definitions/UpdateCredentialResults'}}, + 'type': 'object'}, + 'Cloud': {'description': 'Cloud returns the cloud definitions ' + 'for the specified clouds.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudResults'}}, + 'type': 'object'}, + 'CloudInfo': {'description': 'CloudInfo returns information ' + 'about the specified clouds.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudInfoResults'}}, + 'type': 'object'}, + 'Clouds': {'description': 'Clouds returns the definitions of ' + 'all clouds supported by the ' + 'controller\n' + 'that the logged in user can see.', + 'properties': {'Result': {'$ref': '#/definitions/CloudsResult'}}, + 'type': 'object'}, + 'Credential': {'description': 'Credential returns the ' + 'specified cloud credential for ' + 'each tag, minus secrets.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudCredentialResults'}}, + 'type': 'object'}, + 'CredentialContents': {'description': 'CredentialContents ' + 'returns the specified ' + 'cloud credentials,\n' + 'including the secrets ' + 'if requested.\n' + 'If no specific ' + 'credential name/cloud ' + 'was passed in, all ' + 'credentials for this ' + 'user\n' + 'are returned.\n' + 'Only credential owner ' + 'can see its contents as ' + 'well as what models use ' + 'it.\n' + 'Controller admin has no ' + 'special superpowers ' + 'here and is treated the ' + 'same as all other ' + 'users.', + 'properties': {'Params': {'$ref': '#/definitions/CloudCredentialArgs'}, + 'Result': {'$ref': '#/definitions/CredentialContentResults'}}, + 'type': 'object'}, + 'InstanceTypes': {'description': 'InstanceTypes returns ' + 'instance type information ' + 'for the cloud and region\n' + 'in which the current model ' + 'is deployed.', + 'properties': {'Params': {'$ref': '#/definitions/CloudInstanceTypesConstraints'}, + 'Result': {'$ref': '#/definitions/InstanceTypesResults'}}, + 'type': 'object'}, + 'ListCloudInfo': {'description': 'ListCloudInfo returns clouds ' + 'that the specified user has ' + 'access to.\n' + 'Controller admins ' + '(superuser) can list clouds ' + 'for any user.\n' + 'Other users can only ask ' + 'about their own clouds.', + 'properties': {'Params': {'$ref': '#/definitions/ListCloudsRequest'}, + 'Result': {'$ref': '#/definitions/ListCloudInfoResults'}}, + 'type': 'object'}, + 'ModifyCloudAccess': {'description': 'ModifyCloudAccess ' + 'changes the model access ' + 'granted to users.', + 'properties': {'Params': {'$ref': '#/definitions/ModifyCloudAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveClouds': {'description': 'RemoveClouds removes the ' + 'specified clouds from the ' + 'controller.\n' + 'If a cloud is in use (has ' + 'models deployed to it), the ' + 'removal will fail.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RevokeCredentialsCheckModels': {'description': 'RevokeCredentialsCheckModels ' + 'revokes a set ' + 'of cloud ' + 'credentials.\n' + 'If the ' + 'credentials ' + 'are used by ' + 'any of the ' + 'models, the ' + 'credential ' + 'deletion will ' + 'be aborted.\n' + 'If ' + 'credential-in-use ' + 'needs to be ' + 'revoked ' + 'nonetheless, ' + 'this method ' + 'allows the ' + 'use of force.', + 'properties': {'Params': {'$ref': '#/definitions/RevokeCredentialArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateCloud': {'description': 'UpdateCloud updates an ' + 'existing cloud that the ' + 'controller knows about.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateCloudArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpdateCredentialsCheckModels': {'description': 'UpdateCredentialsCheckModels ' + 'updates a set ' + 'of cloud ' + "credentials' " + 'content.\n' + 'If there are ' + 'any models ' + 'that are ' + 'using a ' + 'credential ' + 'and these ' + 'models\n' + 'are not going ' + 'to be visible ' + 'with updated ' + 'credential ' + 'content,\n' + 'there will be ' + 'detailed ' + 'validation ' + 'errors per ' + 'model. Such ' + 'model errors ' + 'are returned\n' + 'separately ' + 'and do not ' + 'contribute to ' + 'the overall ' + 'method error ' + 'status.\n' + 'Controller ' + 'admins can ' + "'force' an " + 'update of the ' + 'credential\n' + 'regardless of ' + 'whether it is ' + 'deemed valid ' + 'or not.', + 'properties': {'Params': {'$ref': '#/definitions/UpdateCredentialArgs'}, + 'Result': {'$ref': '#/definitions/UpdateCredentialResults'}}, + 'type': 'object'}, + 'UserCredentials': {'description': 'UserCredentials returns ' + 'the cloud credentials for ' + 'a set of users.', + 'properties': {'Params': {'$ref': '#/definitions/UserClouds'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(None) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddCredentials(self, credentials=None): + ''' + 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 -> 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='AddCredentials', + version=7, + params=_params) + _params['credentials'] = credentials + reply = await self.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) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudInfoResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudsResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudCredentialResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(CredentialContentResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(InstanceTypesResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListCloudInfoResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyCloudAccess(self, changes=None): + ''' + ModifyCloudAccess changes the model access granted to users. + + changes : typing.Sequence[~ModifyCloudAccess] + 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='Cloud', + request='ModifyCloudAccess', + version=7, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveClouds(self, entities=None): + ''' + 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) + 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) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpdateCredentialResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def 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 = await self.rpc(msg) + return reply + + + +class ControllerFacade(Type): + name = 'Controller' + version = 7 + schema = {'definitions': {'AllWatcherId': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ControllerConfigSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'DestroyControllerArgs': {'additionalProperties': False, + 'properties': {'destroy-models': {'type': 'boolean'}, + 'destroy-storage': {'type': 'boolean'}}, + 'required': ['destroy-models'], + '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'}, + 'HostedModelConfig': {'additionalProperties': False, + 'properties': {'cloud-spec': {'$ref': '#/definitions/CloudSpec'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['name', 'owner'], + 'type': 'object'}, + 'HostedModelConfigsResults': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/HostedModelConfig'}, + 'type': 'array'}}, + 'required': ['models'], + 'type': 'object'}, + 'InitiateMigrationArgs': {'additionalProperties': False, + 'properties': {'specs': {'items': {'$ref': '#/definitions/MigrationSpec'}, + 'type': 'array'}}, + 'required': ['specs'], + 'type': 'object'}, + 'InitiateMigrationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'migration-id': {'type': 'string'}, + 'model-tag': {'type': 'string'}}, + 'required': ['model-tag', + 'migration-id'], + 'type': 'object'}, + 'InitiateMigrationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InitiateMigrationResult'}, + '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'}}, + 'type': 'object'}, + 'MigrationSpec': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'target-info': {'$ref': '#/definitions/MigrationTargetInfo'}}, + 'required': ['model-tag', 'target-info'], + 'type': 'object'}, + 'MigrationTargetInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'auth-tag': {'type': 'string'}, + 'ca-cert': {'type': 'string'}, + 'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}, + 'macaroons': {'type': 'string'}, + 'password': {'type': 'string'}}, + 'required': ['controller-tag', + 'addrs', + 'ca-cert', + 'auth-tag'], + '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'}, + 'ModelBlockInfo': {'additionalProperties': False, + 'properties': {'blocks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'model-uuid': {'type': 'string'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}}, + 'required': ['name', + 'model-uuid', + 'owner-tag', + 'blocks'], + 'type': 'object'}, + 'ModelBlockInfoList': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/ModelBlockInfo'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + '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'}, + 'ModelMachineInfo': {'additionalProperties': False, + 'properties': {'display-name': {'type': 'string'}, + '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'}, + 'ModelStatus': {'additionalProperties': False, + 'properties': {'application-count': {'type': 'integer'}, + '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'}, + 'ModelTag': {'additionalProperties': False, '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'}, + 'ModifyControllerAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'action': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', + 'action', + 'access'], + 'type': 'object'}, + 'ModifyControllerAccessRequest': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyControllerAccess'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoveBlocksArgs': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}}, + 'required': ['all'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'UserAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', 'access'], + 'type': 'object'}, + 'UserAccessResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/UserAccess'}}, + 'type': 'object'}, + 'UserAccessResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UserAccessResult'}, + 'type': 'array'}}, + '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': {'AllModels': {'properties': {'Result': {'$ref': '#/definitions/UserModelList'}}, + 'type': 'object'}, + 'CloudSpec': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ConfigSet': {'properties': {'Params': {'$ref': '#/definitions/ControllerConfigSet'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'DestroyController': {'properties': {'Params': {'$ref': '#/definitions/DestroyControllerArgs'}}, + 'type': 'object'}, + 'GetCloudSpec': {'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetControllerAccess': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UserAccessResults'}}, + 'type': 'object'}, + 'HostedModelConfigs': {'properties': {'Result': {'$ref': '#/definitions/HostedModelConfigsResults'}}, + 'type': 'object'}, + 'IdentityProviderURL': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'InitiateMigration': {'properties': {'Params': {'$ref': '#/definitions/InitiateMigrationArgs'}, + 'Result': {'$ref': '#/definitions/InitiateMigrationResults'}}, + 'type': 'object'}, + 'ListBlockedModels': {'properties': {'Result': {'$ref': '#/definitions/ModelBlockInfoList'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelStatusResults'}}, + 'type': 'object'}, + 'ModifyControllerAccess': {'properties': {'Params': {'$ref': '#/definitions/ModifyControllerAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'MongoVersion': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'RemoveBlocks': {'properties': {'Params': {'$ref': '#/definitions/RemoveBlocksArgs'}}, + 'type': 'object'}, + 'WatchAllModels': {'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(UserModelList) + async def AllModels(self): + ''' + + Returns -> UserModelList + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='AllModels', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResults) + async def CloudSpec(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ConfigSet(self, config=None): + ''' + 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=7, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ControllerConfig', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyController(self, destroy_models=None, destroy_storage=None): + ''' + destroy_models : bool + destroy_storage : bool + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='DestroyController', + version=7, + params=_params) + _params['destroy-models'] = destroy_models + _params['destroy-storage'] = destroy_storage + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def GetCloudSpec(self): + ''' + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='GetCloudSpec', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UserAccessResults) + async def GetControllerAccess(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(HostedModelConfigsResults) + async def HostedModelConfigs(self): + ''' + + Returns -> HostedModelConfigsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='HostedModelConfigs', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def IdentityProviderURL(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='IdentityProviderURL', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InitiateMigrationResults) + async def InitiateMigration(self, specs=None): + ''' + 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=7, + params=_params) + _params['specs'] = specs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelBlockInfoList) + async def ListBlockedModels(self): + ''' + + Returns -> ModelBlockInfoList + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ListBlockedModels', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResults) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ModelConfig', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelStatusResults) + async def ModelStatus(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyControllerAccess(self, changes=None): + ''' + 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=7, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def MongoVersion(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='MongoVersion', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def RemoveBlocks(self, all_=None): + ''' + 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=7, + params=_params) + _params['all'] = all_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AllWatcherId) + async def WatchAllModels(self): + ''' + + Returns -> AllWatcherId + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='WatchAllModels', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchCloudSpecsChanges(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class FirewallerFacade(Type): + name = 'Firewaller' + version = 7 + schema = {'definitions': {'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'ExposeInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'exposed': {'type': 'boolean'}, + 'exposed-endpoints': {'patternProperties': {'.*': {'$ref': '#/definitions/ExposedEndpoint'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'ExposeInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ExposeInfoResult'}, + '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'}, + 'FanConfigEntry': {'additionalProperties': False, + 'properties': {'overlay': {'type': 'string'}, + 'underlay': {'type': 'string'}}, + 'required': ['underlay', 'overlay'], + 'type': 'object'}, + 'FirewallRule': {'additionalProperties': False, + 'properties': {'known-service': {'type': 'string'}, + 'whitelist-cidrs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['known-service'], + 'type': 'object'}, + 'KnownServiceArgs': {'additionalProperties': False, + 'properties': {'known-services': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['known-services'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ListFirewallRulesResults': {'additionalProperties': False, + 'properties': {'Rules': {'items': {'$ref': '#/definitions/FirewallRule'}, + 'type': 'array'}}, + 'required': ['Rules'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MacaroonResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/Macaroon'}}, + 'type': 'object'}, + 'MacaroonResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MacaroonResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelTag': {'additionalProperties': False, 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'OpenMachinePortRangesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'unit-port-ranges': {'patternProperties': {'.*': {'items': {'$ref': '#/definitions/OpenUnitPortRanges'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'required': ['unit-port-ranges'], + 'type': 'object'}, + 'OpenMachinePortRangesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/OpenMachinePortRangesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'OpenUnitPortRanges': {'additionalProperties': False, + 'properties': {'endpoint': {'type': 'string'}, + 'port-ranges': {'items': {'$ref': '#/definitions/PortRange'}, + 'type': 'array'}, + 'subnet-cidrs': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['endpoint', + 'port-ranges', + 'subnet-cidrs'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SpaceInfo': {'additionalProperties': False, + 'properties': {'id': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/SubnetV3'}, + 'type': 'array'}}, + 'required': ['id', 'name'], + 'type': 'object'}, + 'SpaceInfos': {'additionalProperties': False, + 'properties': {'space-infos': {'items': {'$ref': '#/definitions/SpaceInfo'}, + 'type': 'array'}}, + 'type': 'object'}, + 'SpaceInfosParams': {'additionalProperties': False, + 'properties': {'space-ids': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'SubnetV2': {'additionalProperties': False, + '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': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones', + 'Subnet'], + 'type': 'object'}, + 'SubnetV3': {'additionalProperties': False, + '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': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones', + 'Subnet', + 'SubnetV2', + 'space-id'], + 'type': 'object'}}, + 'properties': {'AreManuallyProvisioned': {'description': 'AreManuallyProvisioned ' + 'returns whether ' + 'each given entity ' + 'is\n' + 'manually ' + 'provisioned or not. ' + 'Only machine tags ' + 'are accepted.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'CloudSpec': {'description': "CloudSpec returns the model's " + 'cloud spec.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'FirewallRules': {'description': 'FirewallRules returns the ' + 'firewall rules for the ' + 'specified well known service ' + 'types.', + 'properties': {'Params': {'$ref': '#/definitions/KnownServiceArgs'}, + 'Result': {'$ref': '#/definitions/ListFirewallRulesResults'}}, + 'type': 'object'}, + 'GetAssignedMachine': {'description': 'GetAssignedMachine ' + 'returns the assigned ' + 'machine tag (if any) ' + 'for\n' + 'each given unit.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'GetCloudSpec': {'description': 'GetCloudSpec constructs the ' + 'CloudSpec for a validated and ' + 'authorized model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetExposeInfo': {'description': 'GetExposeInfo returns the ' + 'expose flag and per-endpoint ' + 'expose settings\n' + 'for the specified ' + 'applications.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ExposeInfoResults'}}, + 'type': 'object'}, + 'InstanceId': {'description': 'InstanceId returns the provider ' + 'specific instance id for each ' + 'given\n' + 'machine or an ' + 'CodeNotProvisioned error, if ' + 'not set.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Life': {'description': 'Life returns the life status of every ' + 'supplied entity, where available.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'MacaroonForRelations': {'description': 'MacaroonForRelations ' + 'returns the macaroon ' + 'for the specified ' + 'relations.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MacaroonResults'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the ' + "current model's configuration.", + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'OpenedMachinePortRanges': {'description': 'OpenedMachinePortRanges ' + 'returns a list of ' + 'the opened port ' + 'ranges for the\n' + 'specified machines ' + 'where each result ' + 'is broken down by ' + 'unit. The list of\n' + 'opened ports for ' + 'each unit is ' + 'further grouped by ' + 'endpoint name and ' + 'includes\n' + 'the subnet CIDRs ' + 'that belong to the ' + 'space that each ' + 'endpoint is bound ' + 'to.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/OpenMachinePortRangesResults'}}, + 'type': 'object'}, + 'SetRelationsStatus': {'description': 'SetRelationsStatus sets ' + 'the status for the ' + 'specified relations.', + 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SpaceInfos': {'description': 'SpaceInfos returns a ' + 'comprehensive representation of ' + 'either all spaces or\n' + 'a filtered subset of the known ' + 'spaces and their associated ' + 'subnet details.', + 'properties': {'Params': {'$ref': '#/definitions/SpaceInfosParams'}, + 'Result': {'$ref': '#/definitions/SpaceInfos'}}, + 'type': 'object'}, + 'Watch': {'description': 'Watch starts an NotifyWatcher for ' + 'each given entity.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'description': 'WatchCloudSpecsChanges ' + 'returns a watcher ' + 'for cloud spec ' + 'changes.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + '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/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' + 'returns a ' + 'NotifyWatcher ' + 'that observes\n' + 'changes to the ' + 'model ' + 'configuration.\n' + 'Note that ' + 'although the ' + 'NotifyWatchResult ' + 'contains an ' + 'Error field,\n' + "it's not used " + 'because we are ' + 'only returning ' + 'a single ' + 'watcher,\n' + 'so we use the ' + 'regular error ' + 'return.', + 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchIngressAddressesForRelations': {'description': 'WatchIngressAddressesForRelations ' + 'creates ' + 'a ' + 'watcher ' + 'that ' + 'returns ' + 'the ' + 'ingress ' + 'networks\n' + 'that ' + 'have ' + 'been ' + 'recorded ' + 'against ' + 'the ' + 'specified ' + 'relations.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchModelMachineStartTimes': {'description': 'WatchModelMachineStartTimes ' + 'watches the ' + 'non-container ' + 'machines in ' + 'the model\n' + 'for changes to ' + 'the Life or ' + 'AgentStartTime ' + 'fields and ' + 'reports them ' + 'as a batch.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'description': 'WatchModelMachines ' + 'returns a ' + 'StringsWatcher that ' + 'notifies of\n' + 'changes to the life ' + 'cycles of the top level ' + 'machines in the ' + 'current\n' + 'model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchOpenedPorts': {'description': 'WatchOpenedPorts returns ' + 'a new StringsWatcher for ' + 'each given\n' + 'model tag.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchSubnets': {'description': 'WatchSubnets returns a new ' + 'StringsWatcher that watches ' + 'the specified\n' + 'subnet tags or all tags if no ' + 'entities are specified.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchUnits': {'description': 'WatchUnits starts a ' + 'StringsWatcher to watch all ' + 'units belonging to\n' + 'to any entity (machine or ' + 'service) passed in args.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(BoolResults) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResults) + async def 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='Firewaller', + request='CloudSpec', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def 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='Firewaller', + request='ControllerAPIInfoForModels', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.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='Firewaller', + request='ControllerConfig', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ListFirewallRulesResults) + async def FirewallRules(self, known_services=None): + ''' + FirewallRules returns the firewall rules for the specified well known service types. + + known_services : typing.Sequence[str] + Returns -> ListFirewallRulesResults + ''' + if known_services is not None and not isinstance(known_services, (bytes, str, list)): + raise Exception("Expected known_services to be a Sequence, received: {}".format(type(known_services))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Firewaller', + request='FirewallRules', + version=7, + params=_params) + _params['known-services'] = known_services + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def GetAssignedMachine(self, entities=None): + ''' + GetAssignedMachine returns the assigned machine tag (if any) for + each given unit. + + 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='GetAssignedMachine', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.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) + 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) + 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) + 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) + async def 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 = await self.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='Firewaller', + request='ModelConfig', + version=7, + params=_params) + + reply = await self.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) + 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) + async def 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 = await self.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='Firewaller', + request='Watch', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.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='Firewaller', + request='WatchCloudSpecsChanges', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchEgressAddressesForRelations(self, entities=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. + + 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='WatchEgressAddressesForRelations', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.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='Firewaller', + request='WatchForModelConfigChanges', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + + @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='Firewaller', + request='WatchModelMachineStartTimes', + version=7, + params=_params) + + reply = await self.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='Firewaller', + request='WatchModelMachines', + version=7, + params=_params) + + reply = await self.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 + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def 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 = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def 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 = await self.rpc(msg) + return reply + + + +class ModelManagerFacade(Type): + name = 'ModelManager' + version = 7 + 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'}}, + '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'}}, + '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'}, + '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-region': {'type': 'string'}, + 'cloud-tag': {'type': 'string'}, + 'controller-uuid': {'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'}, + 'sla': {'$ref': '#/definitions/ModelSLAInfo'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'type': {'type': 'string'}, + 'users': {'items': {'$ref': '#/definitions/ModelUserInfo'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', + 'type', + 'uuid', + 'controller-uuid', + 'is-controller', + 'cloud-tag', + 'owner-tag', + 'life', + 'users', + 'machines', + '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'}, + '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'}, + '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'}, + 'user': {'type': 'string'}}, + 'required': ['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'}, + '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'}, + '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': {'properties': {'Params': {'$ref': '#/definitions/ChangeModelCredentialsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CreateModel': {'properties': {'Params': {'$ref': '#/definitions/ModelCreateArgs'}, + 'Result': {'$ref': '#/definitions/ModelInfo'}}, + 'type': 'object'}, + 'DestroyModels': {'properties': {'Params': {'$ref': '#/definitions/DestroyModelsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DumpModels': {'properties': {'Params': {'$ref': '#/definitions/DumpModelRequest'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'DumpModelsDB': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MapResults'}}, + 'type': 'object'}, + 'ListModelSummaries': {'properties': {'Params': {'$ref': '#/definitions/ModelSummariesRequest'}, + 'Result': {'$ref': '#/definitions/ModelSummaryResults'}}, + 'type': 'object'}, + 'ListModels': {'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/UserModelList'}}, + 'type': 'object'}, + 'ModelDefaultsForClouds': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelDefaultsResults'}}, + 'type': 'object'}, + 'ModelInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelInfoResults'}}, + 'type': 'object'}, + 'ModelStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelStatusResults'}}, + 'type': 'object'}, + 'ModifyModelAccess': {'properties': {'Params': {'$ref': '#/definitions/ModifyModelAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModelDefaults': {'properties': {'Params': {'$ref': '#/definitions/SetModelDefaults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UnsetModelDefaults': {'properties': {'Params': {'$ref': '#/definitions/UnsetModelDefaults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(ErrorResults) + async def ChangeModelCredential(self, model_credentials=None): + ''' + 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=7, + 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): + ''' + 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=7, + 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): + ''' + 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=7, + params=_params) + _params['models'] = models + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def DumpModels(self, entities=None, simplified=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + _params['simplified'] = simplified + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MapResults) + async def DumpModelsDB(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelSummaryResults) + async def ListModelSummaries(self, all_=None, user_tag=None): + ''' + 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=7, + 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): + ''' + 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=7, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelDefaultsResults) + async def ModelDefaultsForClouds(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelInfoResults) + async def ModelInfo(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelStatusResults) + async def ModelStatus(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyModelAccess(self, changes=None): + ''' + 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=7, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModelDefaults(self, config=None): + ''' + 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=7, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UnsetModelDefaults(self, keys=None): + ''' + 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=7, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + + +class ProvisionerFacade(Type): + name = 'Provisioner' + version = 7 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'Binary': {'additionalProperties': False, + 'properties': {'Arch': {'type': 'string'}, + 'Number': {'$ref': '#/definitions/Number'}, + 'Series': {'type': 'string'}}, + 'required': ['Number', 'Series', 'Arch'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CloudImageMetadata': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'image-id': {'type': 'string'}, + 'priority': {'type': 'integer'}, + 'region': {'type': 'string'}, + 'root-storage-size': {'type': 'integer'}, + 'root-storage-type': {'type': 'string'}, + 'series': {'type': 'string'}, + 'source': {'type': 'string'}, + 'stream': {'type': 'string'}, + 'version': {'type': 'string'}, + 'virt-type': {'type': 'string'}}, + 'required': ['image-id', + 'region', + 'version', + 'series', + 'arch', + 'source', + 'priority'], + 'type': 'object'}, + 'ConstraintsResult': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'ConstraintsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConstraintsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ContainerConfig': {'additionalProperties': False, + 'properties': {'UpdateBehavior': {'$ref': '#/definitions/UpdateBehavior'}, + 'apt-mirror': {'type': 'string'}, + 'apt-proxy': {'$ref': '#/definitions/Settings'}, + 'authorized-keys': {'type': 'string'}, + 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'container-inherit-properties': {'type': 'string'}, + 'juju-proxy': {'$ref': '#/definitions/Settings'}, + 'legacy-proxy': {'$ref': '#/definitions/Settings'}, + 'provider-type': {'type': 'string'}, + 'snap-proxy': {'$ref': '#/definitions/Settings'}, + 'ssl-hostname-verification': {'type': 'boolean'}}, + 'required': ['provider-type', + 'authorized-keys', + 'ssl-hostname-verification', + 'legacy-proxy', + 'juju-proxy', + 'apt-proxy', + 'snap-proxy', + 'apt-mirror', + 'UpdateBehavior'], + 'type': 'object'}, + 'ContainerLXDProfile': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'profile': {'$ref': '#/definitions/CharmLXDProfile'}}, + 'required': ['profile', 'name'], + 'type': 'object'}, + 'ContainerManagerConfig': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ContainerManagerConfigParams': {'additionalProperties': False, + 'properties': {'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'ContainerProfileResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'lxd-profiles': {'items': {'$ref': '#/definitions/ContainerLXDProfile'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ContainerProfileResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ContainerProfileResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'DeviceBridgeInfo': {'additionalProperties': False, + 'properties': {'bridge-name': {'type': 'string'}, + 'host-device-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['host-device-name', + 'bridge-name', + 'mac-address'], + 'type': 'object'}, + 'DistributionGroupResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'DistributionGroupResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/DistributionGroupResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'FindToolsParams': {'additionalProperties': False, + 'properties': {'agentstream': {'type': 'string'}, + 'arch': {'type': 'string'}, + 'major': {'type': 'integer'}, + 'minor': {'type': 'integer'}, + 'number': {'$ref': '#/definitions/Number'}, + 'series': {'type': 'string'}}, + 'required': ['number', + 'major', + 'minor', + 'arch', + 'series', + 'agentstream'], + 'type': 'object'}, + 'FindToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'list': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['list'], + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'HostNetworkChange': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'new-bridges': {'items': {'$ref': '#/definitions/DeviceBridgeInfo'}, + 'type': 'array'}, + 'reconfigure-delay': {'type': 'integer'}}, + 'required': ['new-bridges', + 'reconfigure-delay'], + 'type': 'object'}, + 'HostNetworkChangeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/HostNetworkChange'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}}, + 'required': ['Address', 'port'], + 'type': 'object'}, + 'InstanceInfo': {'additionalProperties': False, + 'properties': {'characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'charm-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'instance-id': {'type': 'string'}, + 'network-config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'volume-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/VolumeAttachmentInfo'}}, + 'type': 'object'}, + 'volumes': {'items': {'$ref': '#/definitions/Volume'}, + 'type': 'array'}}, + 'required': ['tag', + 'instance-id', + 'nonce', + 'characteristics', + 'volumes', + 'volume-attachments', + 'network-config', + 'charm-profiles'], + 'type': 'object'}, + 'InstancesInfo': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/InstanceInfo'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachineContainers': {'additionalProperties': False, + 'properties': {'container-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'container-types'], + 'type': 'object'}, + 'MachineContainersParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MachineContainers'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MachineNetworkConfigResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}}, + 'required': ['info'], + 'type': 'object'}, + 'MachineNetworkConfigResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineNetworkConfigResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'is-default-gateway': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + 'parent-interface-name': {'type': 'string'}, + 'provider-address-id': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'provider-subnet-id': {'type': 'string'}, + 'provider-vlan-id': {'type': 'string'}, + 'routes': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'vlan-tag': {'type': 'integer'}}, + 'required': ['device-index', + 'mac-address', + 'cidr', + 'mtu', + 'provider-id', + 'provider-subnet-id', + 'provider-space-id', + 'provider-address-id', + 'provider-vlan-id', + 'vlan-tag', + 'interface-name', + 'parent-interface-name', + 'interface-type', + 'disabled'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + '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'}, + 'ProfileChangeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'new-profile-name': {'type': 'string'}, + 'old-profile-name': {'type': 'string'}, + 'profile': {'$ref': '#/definitions/CharmLXDProfile'}, + 'subordinate': {'type': 'boolean'}}, + 'type': 'object'}, + 'ProfileChangeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProfileChangeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ProvisioningInfo': {'additionalProperties': False, + 'properties': {'charm-lxd-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'controller-config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'image-metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'placement': {'type': 'string'}, + 'series': {'type': 'string'}, + 'subnets-to-zones': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'type': 'array'}, + 'volumes': {'items': {'$ref': '#/definitions/VolumeParams'}, + 'type': 'array'}}, + 'required': ['constraints', + 'series', + 'placement', + 'jobs'], + 'type': 'object'}, + 'ProvisioningInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ProvisioningInfo'}}, + 'required': ['result'], + 'type': 'object'}, + 'ProvisioningInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProvisioningInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetMachineNetworkConfig': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'config'], + 'type': 'object'}, + 'SetProfileArg': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'profiles': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['entity', 'profiles'], + 'type': 'object'}, + 'SetProfileArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetProfileArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SetProfileUpgradeCompleteArg': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'message': {'type': 'string'}}, + 'required': ['entity', + 'message'], + 'type': 'object'}, + 'SetProfileUpgradeCompleteArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetProfileUpgradeCompleteArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Settings': {'additionalProperties': False, + 'properties': {'AutoNoProxy': {'type': 'string'}, + 'Ftp': {'type': 'string'}, + 'Http': {'type': 'string'}, + 'Https': {'type': 'string'}, + 'NoProxy': {'type': 'string'}}, + 'required': ['Http', + 'Https', + 'Ftp', + 'NoProxy', + 'AutoNoProxy'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'ToolsResult': {'additionalProperties': False, + 'properties': {'disable-ssl-hostname-verification': {'type': 'boolean'}, + 'error': {'$ref': '#/definitions/Error'}, + 'tools': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['tools', + 'disable-ssl-hostname-verification'], + 'type': 'object'}, + 'ToolsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ToolsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateBehavior': {'additionalProperties': False, + 'properties': {'enable-os-refresh-update': {'type': 'boolean'}, + 'enable-os-upgrade': {'type': 'boolean'}}, + 'required': ['enable-os-refresh-update', + 'enable-os-upgrade'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'spaces': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Volume': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', 'info'], + 'type': 'object'}, + 'VolumeAttachmentInfo': {'additionalProperties': False, + 'properties': {'bus-address': {'type': 'string'}, + 'device-link': {'type': 'string'}, + 'device-name': {'type': 'string'}, + 'plan-info': {'$ref': '#/definitions/VolumeAttachmentPlanInfo'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'VolumeAttachmentParams': {'additionalProperties': False, + 'properties': {'instance-id': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}, + 'volume-id': {'type': 'string'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'provider'], + 'type': 'object'}, + 'VolumeAttachmentPlanInfo': {'additionalProperties': False, + 'properties': {'device-attributes': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'device-type': {'type': 'string'}}, + 'type': 'object'}, + 'VolumeInfo': {'additionalProperties': False, + 'properties': {'hardware-id': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'volume-id': {'type': 'string'}, + 'wwn': {'type': 'string'}}, + 'required': ['volume-id', 'size', 'persistent'], + 'type': 'object'}, + 'VolumeParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'size', + 'provider'], + 'type': 'object'}, + 'WatchContainer': {'additionalProperties': False, + 'properties': {'container-type': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'container-type'], + 'type': 'object'}, + 'WatchContainers': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/WatchContainer'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}}, + 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'AvailabilityZone': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CACert': {'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'CharmProfileChangeInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ProfileChangeResults'}}, + 'type': 'object'}, + 'Constraints': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConstraintsResults'}}, + 'type': 'object'}, + 'ContainerConfig': {'properties': {'Result': {'$ref': '#/definitions/ContainerConfig'}}, + 'type': 'object'}, + 'ContainerManagerConfig': {'properties': {'Params': {'$ref': '#/definitions/ContainerManagerConfigParams'}, + 'Result': {'$ref': '#/definitions/ContainerManagerConfig'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'DistributionGroup': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DistributionGroupResults'}}, + 'type': 'object'}, + 'DistributionGroupByMachineId': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FindTools': {'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, + 'Result': {'$ref': '#/definitions/FindToolsResult'}}, + 'type': 'object'}, + 'GetContainerInterfaceInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineNetworkConfigResults'}}, + 'type': 'object'}, + 'GetContainerProfileInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ContainerProfileResults'}}, + 'type': 'object'}, + 'HostChangesForContainers': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/HostNetworkChangeResults'}}, + 'type': 'object'}, + 'InstanceId': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'InstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'KeepInstance': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'MachinesWithTransientErrors': {'properties': {'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'MarkMachinesForRemoval': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PrepareContainerInterfaceInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineNetworkConfigResults'}}, + 'type': 'object'}, + 'ProvisioningInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ProvisioningInfoResults'}}, + 'type': 'object'}, + 'ReleaseContainerAddresses': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Remove': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RemoveUpgradeCharmProfileData': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Series': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'SetCharmProfiles': {'properties': {'Params': {'$ref': '#/definitions/SetProfileArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetHostMachineNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetInstanceInfo': {'properties': {'Params': {'$ref': '#/definitions/InstancesInfo'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetInstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetObservedNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetPasswords': {'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetProviderNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetSupportedContainers': {'properties': {'Params': {'$ref': '#/definitions/MachineContainersParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUpgradeCharmProfileComplete': {'properties': {'Params': {'$ref': '#/definitions/SetProfileUpgradeCompleteArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StateAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'Status': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'Tools': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ToolsResults'}}, + 'type': 'object'}, + 'UpdateStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchAllContainers': {'properties': {'Params': {'$ref': '#/definitions/WatchContainers'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchContainers': {'properties': {'Params': {'$ref': '#/definitions/WatchContainers'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchContainersCharmProfiles': {'properties': {'Params': {'$ref': '#/definitions/WatchContainers'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchMachineErrorRetry': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachinesCharmProfiles': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='APIAddresses', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='APIHostPorts', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BytesResult) + async def CACert(self): + ''' + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='CACert', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProfileChangeResults) + async def CharmProfileChangeInfo(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> ProfileChangeResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='CharmProfileChangeInfo', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConstraintsResults) + async def Constraints(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerConfig) + async def ContainerConfig(self): + ''' + + Returns -> ContainerConfig + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ContainerConfig', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerManagerConfig) + async def ContainerManagerConfig(self, type_=None): + ''' + 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=7, + params=_params) + _params['type'] = type_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ControllerConfig', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DistributionGroupResults) + async def DistributionGroup(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def DistributionGroupByMachineId(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindToolsResult) + async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, number=None, series=None): + ''' + agentstream : str + arch : str + major : int + minor : int + number : Number + series : 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 minor is not None and not isinstance(minor, int): + raise Exception("Expected minor to be a int, received: {}".format(type(minor))) + + if number is not None and not isinstance(number, (dict, Number)): + raise Exception("Expected number to be a Number, received: {}".format(type(number))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='FindTools', + version=7, + params=_params) + _params['agentstream'] = agentstream + _params['arch'] = arch + _params['major'] = major + _params['minor'] = minor + _params['number'] = number + _params['series'] = series + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) + async def GetContainerInterfaceInfo(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerProfileResults) + async def GetContainerProfileInfo(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(HostNetworkChangeResults) + async def HostChangesForContainers(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def InstanceStatus(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def KeepInstance(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def MachinesWithTransientErrors(self): + ''' + + Returns -> StatusResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='MachinesWithTransientErrors', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def MarkMachinesForRemoval(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelConfig', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelUUID', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) + async def PrepareContainerInterfaceInfo(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProvisioningInfoResults) + async def ProvisioningInfo(self, entities=None): + ''' + 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='ProvisioningInfo', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ReleaseContainerAddresses(self, entities=None): + ''' + 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='ReleaseContainerAddresses', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Remove(self, entities=None): + ''' + 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='Remove', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveUpgradeCharmProfileData(self, entities=None): + ''' + 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='RemoveUpgradeCharmProfileData', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def Series(self, entities=None): + ''' + 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='Series', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmProfiles(self, args=None): + ''' + 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=7, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=7, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceInfo(self, machines=None): + ''' + 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=7, + params=_params) + _params['machines'] = machines + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceStatus(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetObservedNetworkConfig(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='SetObservedNetworkConfig', + version=7, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): + ''' + 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=7, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetProviderNetworkConfig(self, entities=None): + ''' + 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='SetProviderNetworkConfig', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetSupportedContainers(self, params=None): + ''' + 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=7, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUpgradeCharmProfileComplete(self, args=None): + ''' + args : typing.Sequence[~SetProfileUpgradeCompleteArg] + 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='SetUpgradeCharmProfileComplete', + version=7, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResult) + async def StateAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='StateAddresses', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def Status(self, entities=None): + ''' + 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=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ToolsResults) + async def 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='Provisioner', + request='Tools', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateStatus(self, entities=None): + ''' + 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='UpdateStatus', + version=7, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchAPIHostPorts', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchAllContainers(self, params=None): + ''' + 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=7, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchContainers(self, params=None): + ''' + 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=7, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchContainersCharmProfiles(self, params=None): + ''' + 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='WatchContainersCharmProfiles', + version=7, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchForModelConfigChanges', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchMachineErrorRetry(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchMachineErrorRetry', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachines(self): + ''' + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchModelMachines', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachinesCharmProfiles(self): + ''' + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchModelMachinesCharmProfiles', + version=7, + params=_params) + + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client8.py b/juju/client/old_clients/_client8.py new file mode 100644 index 000000000..b4d225712 --- /dev/null +++ b/juju/client/old_clients/_client8.py @@ -0,0 +1,3088 @@ +# 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.old_clients._definitions import * + + +class ApplicationFacade(Type): + name = 'Application' + version = 8 + 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'}, + 'ApplicationConfigSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', 'config'], + 'type': 'object'}, + 'ApplicationConfigSetArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/ApplicationConfigSet'}, + 'type': 'array'}}, + 'required': ['Args'], + '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': {'application': {'type': 'string'}, + 'attach-storage': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + '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'}, + 'series': {'type': 'string'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'series', + 'charm-url', + 'channel', + 'num-units', + 'config-yaml', + 'constraints'], + 'type': 'object'}, + 'ApplicationDestroy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationExpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + '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'}, + 'charm': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'series': {'type': 'string'}}, + 'required': ['application', + 'charm', + 'config', + 'constraints', + 'series'], + 'type': 'object'}, + 'ApplicationMetricCredential': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'metrics-credentials': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['application', + 'metrics-credentials'], + 'type': 'object'}, + 'ApplicationMetricCredentials': {'additionalProperties': False, + 'properties': {'creds': {'items': {'$ref': '#/definitions/ApplicationMetricCredential'}, + 'type': 'array'}}, + 'required': ['creds'], + 'type': 'object'}, + 'ApplicationOfferDetails': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description'], + 'type': 'object'}, + 'ApplicationSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'options': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', 'options'], + 'type': 'object'}, + 'ApplicationSetCharm': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'config-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-settings-yaml': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'force-series': {'type': 'boolean'}, + 'force-units': {'type': 'boolean'}, + 'resource-ids': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'storage-constraints': {'patternProperties': {'.*': {'$ref': '#/definitions/StorageConstraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'charm-url', + 'channel', + 'force', + 'force-units', + 'force-series'], + 'type': 'object'}, + 'ApplicationSetCharmProfile': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm-url': {'type': 'string'}}, + 'required': ['application', + 'charm-url'], + 'type': 'object'}, + 'ApplicationUnexpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationUnset': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'options': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', 'options'], + 'type': 'object'}, + 'ApplicationUpdate': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'force': {'type': 'boolean'}, + 'force-charm-url': {'type': 'boolean'}, + 'force-series': {'type': 'boolean'}, + 'min-units': {'type': 'integer'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'settings-yaml': {'type': 'string'}}, + 'required': ['application', + 'charm-url', + 'force-charm-url', + 'force-series', + 'force', + 'settings-yaml'], + 'type': 'object'}, + 'ApplicationsDeploy': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/ApplicationDeploy'}, + 'type': 'array'}}, + 'required': ['applications'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'ConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['config'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'ConsumeApplicationArg': {'additionalProperties': False, + 'properties': {'ApplicationOfferDetails': {'$ref': '#/definitions/ApplicationOfferDetails'}, + 'application-alias': {'type': 'string'}, + 'external-controller': {'$ref': '#/definitions/ExternalControllerInfo'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}}, + 'required': ['ApplicationOfferDetails'], + 'type': 'object'}, + 'ConsumeApplicationArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ConsumeApplicationArg'}, + 'type': 'array'}}, + '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'}}, + 'required': ['application-tag'], + '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'}, + 'DestroyApplicationUnits': {'additionalProperties': False, + 'properties': {'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + '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'}}, + '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'}, + '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'}, + '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'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ExternalControllerInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'ca-cert': {'type': 'string'}, + 'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}}, + 'required': ['controller-tag', + 'controller-alias', + 'addrs', + 'ca-cert'], + 'type': 'object'}, + 'LXDProfileUpgradeMessages': {'additionalProperties': False, + 'properties': {'application': {'$ref': '#/definitions/Entity'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['application', + 'watcher-id'], + 'type': 'object'}, + 'LXDProfileUpgradeMessagesResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'message': {'type': 'string'}, + 'unit-name': {'type': 'string'}}, + 'required': ['unit-name', + 'message'], + 'type': 'object'}, + 'LXDProfileUpgradeMessagesResults': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/LXDProfileUpgradeMessagesResult'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'OfferUserDetails': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'display-name': {'type': 'string'}, + 'user': {'type': 'string'}}, + 'required': ['user', + 'display-name', + 'access'], + 'type': 'object'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + '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'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + 'ScaleApplicationInfo': {'additionalProperties': False, + 'properties': {'num-units': {'type': 'integer'}}, + 'required': ['num-units'], + 'type': 'object'}, + 'ScaleApplicationParams': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'scale': {'type': 'integer'}, + 'scale-change': {'type': 'integer'}}, + 'required': ['application-tag', + 'scale'], + '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'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'UnitsResolved': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}, + 'retry': {'type': 'boolean'}, + 'tags': {'$ref': '#/definitions/Entities'}}, + 'type': 'object'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'spaces': {'items': {'type': 'string'}, + 'type': 'array'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}, + 'virt-type': {'type': 'string'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'AddRelation': {'properties': {'Params': {'$ref': '#/definitions/AddRelation'}, + 'Result': {'$ref': '#/definitions/AddRelationResults'}}, + 'type': 'object'}, + 'AddUnits': {'properties': {'Params': {'$ref': '#/definitions/AddApplicationUnits'}, + 'Result': {'$ref': '#/definitions/AddApplicationUnitsResults'}}, + 'type': 'object'}, + 'CharmConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'CharmRelations': {'properties': {'Params': {'$ref': '#/definitions/ApplicationCharmRelations'}, + 'Result': {'$ref': '#/definitions/ApplicationCharmRelationsResults'}}, + 'type': 'object'}, + 'Consume': {'properties': {'Params': {'$ref': '#/definitions/ConsumeApplicationArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Deploy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationsDeploy'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}}, + 'type': 'object'}, + 'DestroyApplication': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationsParams'}, + 'Result': {'$ref': '#/definitions/DestroyApplicationResults'}}, + 'type': 'object'}, + 'DestroyConsumedApplications': {'properties': {'Params': {'$ref': '#/definitions/DestroyConsumedApplicationsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyRelation': {'properties': {'Params': {'$ref': '#/definitions/DestroyRelation'}}, + 'type': 'object'}, + 'DestroyUnit': {'properties': {'Params': {'$ref': '#/definitions/DestroyUnitsParams'}, + 'Result': {'$ref': '#/definitions/DestroyUnitResults'}}, + 'type': 'object'}, + 'DestroyUnits': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, + 'type': 'object'}, + 'Expose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationExpose'}}, + 'type': 'object'}, + 'Get': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/ApplicationGetResults'}}, + 'type': 'object'}, + 'GetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'GetConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'GetConstraints': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConstraintsResults'}}, + 'type': 'object'}, + 'GetLXDProfileUpgradeMessages': {'properties': {'Params': {'$ref': '#/definitions/LXDProfileUpgradeMessages'}, + 'Result': {'$ref': '#/definitions/LXDProfileUpgradeMessagesResults'}}, + 'type': 'object'}, + 'ResolveUnitErrors': {'properties': {'Params': {'$ref': '#/definitions/UnitsResolved'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ScaleApplications': {'properties': {'Params': {'$ref': '#/definitions/ScaleApplicationsParams'}, + 'Result': {'$ref': '#/definitions/ScaleApplicationResults'}}, + 'type': 'object'}, + 'Set': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, + 'type': 'object'}, + 'SetApplicationsConfig': {'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigSetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharm': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, + 'type': 'object'}, + 'SetCharmProfile': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharmProfile'}}, + 'type': 'object'}, + 'SetConstraints': {'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetMetricCredentials': {'properties': {'Params': {'$ref': '#/definitions/ApplicationMetricCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRelationsSuspended': {'properties': {'Params': {'$ref': '#/definitions/RelationSuspendedArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Unexpose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnexpose'}}, + 'type': 'object'}, + 'Unset': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, + 'type': 'object'}, + 'UnsetApplicationsConfig': {'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigUnsetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Update': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUpdate'}}, + 'type': 'object'}, + 'UpdateApplicationSeries': {'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchLXDProfileUpgradeNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddRelationResults) + async def AddRelation(self, endpoints=None, via_cidrs=None): + ''' + 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=8, + 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): + ''' + 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=8, + 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(ApplicationGetConfigResults) + async def CharmConfig(self, entities=None): + ''' + 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='CharmConfig', + version=8, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationCharmRelationsResults) + async def CharmRelations(self, application=None): + ''' + 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=8, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Consume(self, args=None): + ''' + 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=8, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Deploy(self, applications=None): + ''' + 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=8, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Destroy(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Destroy', + version=8, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyApplicationResults) + async def DestroyApplication(self, applications=None): + ''' + 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=8, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyConsumedApplications(self, applications=None): + ''' + 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=8, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyRelation(self, endpoints=None, relation_id=None): + ''' + endpoints : typing.Sequence[str] + 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 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=8, + params=_params) + _params['endpoints'] = endpoints + _params['relation-id'] = relation_id + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyUnitResults) + async def DestroyUnit(self, units=None): + ''' + 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=8, + params=_params) + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyUnits(self, unit_names=None): + ''' + unit_names : typing.Sequence[str] + Returns -> None + ''' + if unit_names is not None and not isinstance(unit_names, (bytes, str, list)): + raise Exception("Expected unit_names to be a Sequence, received: {}".format(type(unit_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnits', + version=8, + params=_params) + _params['unit-names'] = unit_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Expose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=8, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetResults) + async def Get(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Get', + version=8, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def GetCharmURL(self, application=None): + ''' + application : str + Returns -> StringResult + ''' + 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='GetCharmURL', + version=8, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def GetConfig(self, entities=None): + ''' + 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=8, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConstraintsResults) + async def GetConstraints(self, entities=None): + ''' + 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=8, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LXDProfileUpgradeMessagesResults) + async def GetLXDProfileUpgradeMessages(self, application=None, watcher_id=None): + ''' + application : Entity + watcher_id : str + Returns -> LXDProfileUpgradeMessagesResults + ''' + if application is not None and not isinstance(application, (dict, Entity)): + raise Exception("Expected application to be a Entity, received: {}".format(type(application))) + + if watcher_id is not None and not isinstance(watcher_id, (bytes, str)): + raise Exception("Expected watcher_id to be a str, received: {}".format(type(watcher_id))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='GetLXDProfileUpgradeMessages', + version=8, + params=_params) + _params['application'] = application + _params['watcher-id'] = watcher_id + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): + ''' + 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=8, + 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): + ''' + 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=8, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Set(self, application=None, options=None): + ''' + application : str + options : typing.Mapping[str, 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 options is not None and not isinstance(options, dict): + raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Set', + version=8, + params=_params) + _params['application'] = application + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationsConfig(self, args=None): + ''' + args : typing.Sequence[~ApplicationConfigSet] + 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='SetApplicationsConfig', + version=8, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetCharm(self, application=None, channel=None, charm_url=None, config_settings=None, config_settings_yaml=None, force=None, force_series=None, force_units=None, resource_ids=None, storage_constraints=None): + ''' + application : str + channel : str + charm_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + force : bool + force_series : bool + force_units : bool + 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_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 force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + 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 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=8, + params=_params) + _params['application'] = application + _params['channel'] = channel + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['force'] = force + _params['force-series'] = force_series + _params['force-units'] = force_units + _params['resource-ids'] = resource_ids + _params['storage-constraints'] = storage_constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetCharmProfile(self, application=None, charm_url=None): + ''' + application : str + charm_url : 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 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='SetCharmProfile', + version=8, + params=_params) + _params['application'] = application + _params['charm-url'] = charm_url + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetConstraints(self, application=None, constraints=None): + ''' + 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=8, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMetricCredentials(self, creds=None): + ''' + 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=8, + params=_params) + _params['creds'] = creds + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationsSuspended(self, args=None): + ''' + 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=8, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unexpose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=8, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unset(self, application=None, options=None): + ''' + application : str + options : 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 options is not None and not isinstance(options, (bytes, str, list)): + raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unset', + version=8, + params=_params) + _params['application'] = application + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UnsetApplicationsConfig(self, args=None): + ''' + 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=8, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Update(self, application=None, charm_url=None, constraints=None, force=None, force_charm_url=None, force_series=None, min_units=None, settings=None, settings_yaml=None): + ''' + application : str + charm_url : str + constraints : Value + force : bool + force_charm_url : bool + force_series : bool + min_units : int + settings : typing.Mapping[str, str] + settings_yaml : 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 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 constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if force_charm_url is not None and not isinstance(force_charm_url, bool): + raise Exception("Expected force_charm_url to be a bool, received: {}".format(type(force_charm_url))) + + if force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + if min_units is not None and not isinstance(min_units, int): + raise Exception("Expected min_units to be a int, received: {}".format(type(min_units))) + + if settings is not None and not isinstance(settings, dict): + raise Exception("Expected settings to be a Mapping, received: {}".format(type(settings))) + + if settings_yaml is not None and not isinstance(settings_yaml, (bytes, str)): + raise Exception("Expected settings_yaml to be a str, received: {}".format(type(settings_yaml))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Update', + version=8, + params=_params) + _params['application'] = application + _params['charm-url'] = charm_url + _params['constraints'] = constraints + _params['force'] = force + _params['force-charm-url'] = force_charm_url + _params['force-series'] = force_series + _params['min-units'] = min_units + _params['settings'] = settings + _params['settings-yaml'] = settings_yaml + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateApplicationSeries(self, args=None): + ''' + args : typing.Sequence[~UpdateSeriesArg] + 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='UpdateApplicationSeries', + version=8, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchLXDProfileUpgradeNotifications(self, tag=None): + ''' + 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='Application', + request='WatchLXDProfileUpgradeNotifications', + version=8, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + +class ControllerFacade(Type): + name = 'Controller' + version = 8 + schema = {'definitions': {'AllWatcherId': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ControllerConfigSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ControllerVersionResults': {'additionalProperties': False, + 'properties': {'git-commit': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['version', + 'git-commit'], + 'type': 'object'}, + 'DestroyControllerArgs': {'additionalProperties': False, + 'properties': {'destroy-models': {'type': 'boolean'}, + 'destroy-storage': {'type': 'boolean'}}, + 'required': ['destroy-models'], + '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'}, + 'HostedModelConfig': {'additionalProperties': False, + 'properties': {'cloud-spec': {'$ref': '#/definitions/CloudSpec'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['name', 'owner'], + 'type': 'object'}, + 'HostedModelConfigsResults': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/HostedModelConfig'}, + 'type': 'array'}}, + 'required': ['models'], + 'type': 'object'}, + 'InitiateMigrationArgs': {'additionalProperties': False, + 'properties': {'specs': {'items': {'$ref': '#/definitions/MigrationSpec'}, + 'type': 'array'}}, + 'required': ['specs'], + 'type': 'object'}, + 'InitiateMigrationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'migration-id': {'type': 'string'}, + 'model-tag': {'type': 'string'}}, + 'required': ['model-tag', + 'migration-id'], + 'type': 'object'}, + 'InitiateMigrationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InitiateMigrationResult'}, + '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'}}, + 'type': 'object'}, + 'MigrationSpec': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'target-info': {'$ref': '#/definitions/MigrationTargetInfo'}}, + 'required': ['model-tag', 'target-info'], + 'type': 'object'}, + 'MigrationTargetInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'auth-tag': {'type': 'string'}, + 'ca-cert': {'type': 'string'}, + 'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}, + 'macaroons': {'type': 'string'}, + 'password': {'type': 'string'}}, + 'required': ['controller-tag', + 'addrs', + 'ca-cert', + 'auth-tag'], + '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'}, + 'ModelBlockInfo': {'additionalProperties': False, + 'properties': {'blocks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'model-uuid': {'type': 'string'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}}, + 'required': ['name', + 'model-uuid', + 'owner-tag', + 'blocks'], + 'type': 'object'}, + 'ModelBlockInfoList': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/ModelBlockInfo'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + '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'}, + 'ModelMachineInfo': {'additionalProperties': False, + 'properties': {'display-name': {'type': 'string'}, + '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'}, + 'ModelStatus': {'additionalProperties': False, + 'properties': {'application-count': {'type': 'integer'}, + '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'}, + 'ModelTag': {'additionalProperties': False, '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'}, + 'ModifyControllerAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'action': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', + 'action', + 'access'], + 'type': 'object'}, + 'ModifyControllerAccessRequest': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyControllerAccess'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoveBlocksArgs': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}}, + 'required': ['all'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'UserAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', 'access'], + 'type': 'object'}, + 'UserAccessResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/UserAccess'}}, + 'type': 'object'}, + 'UserAccessResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UserAccessResult'}, + 'type': 'array'}}, + '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': {'AllModels': {'properties': {'Result': {'$ref': '#/definitions/UserModelList'}}, + 'type': 'object'}, + 'CloudSpec': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ConfigSet': {'properties': {'Params': {'$ref': '#/definitions/ControllerConfigSet'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'ControllerVersion': {'properties': {'Result': {'$ref': '#/definitions/ControllerVersionResults'}}, + 'type': 'object'}, + 'DestroyController': {'properties': {'Params': {'$ref': '#/definitions/DestroyControllerArgs'}}, + 'type': 'object'}, + 'GetCloudSpec': {'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetControllerAccess': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UserAccessResults'}}, + 'type': 'object'}, + 'HostedModelConfigs': {'properties': {'Result': {'$ref': '#/definitions/HostedModelConfigsResults'}}, + 'type': 'object'}, + 'IdentityProviderURL': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'InitiateMigration': {'properties': {'Params': {'$ref': '#/definitions/InitiateMigrationArgs'}, + 'Result': {'$ref': '#/definitions/InitiateMigrationResults'}}, + 'type': 'object'}, + 'ListBlockedModels': {'properties': {'Result': {'$ref': '#/definitions/ModelBlockInfoList'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelStatusResults'}}, + 'type': 'object'}, + 'ModifyControllerAccess': {'properties': {'Params': {'$ref': '#/definitions/ModifyControllerAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'MongoVersion': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'RemoveBlocks': {'properties': {'Params': {'$ref': '#/definitions/RemoveBlocksArgs'}}, + 'type': 'object'}, + 'WatchAllModels': {'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(UserModelList) + async def AllModels(self): + ''' + + Returns -> UserModelList + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='AllModels', + version=8, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResults) + async def CloudSpec(self, entities=None): + ''' + 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=8, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def ConfigSet(self, config=None): + ''' + 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=8, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): + ''' + 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=8, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ControllerConfig', + version=8, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerVersionResults) + async def ControllerVersion(self): + ''' + + Returns -> ControllerVersionResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ControllerVersion', + version=8, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyController(self, destroy_models=None, destroy_storage=None): + ''' + destroy_models : bool + destroy_storage : bool + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='DestroyController', + version=8, + params=_params) + _params['destroy-models'] = destroy_models + _params['destroy-storage'] = destroy_storage + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def GetCloudSpec(self): + ''' + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='GetCloudSpec', + version=8, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UserAccessResults) + async def GetControllerAccess(self, entities=None): + ''' + 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=8, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(HostedModelConfigsResults) + async def HostedModelConfigs(self): + ''' + + Returns -> HostedModelConfigsResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='HostedModelConfigs', + version=8, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def IdentityProviderURL(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='IdentityProviderURL', + version=8, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InitiateMigrationResults) + async def InitiateMigration(self, specs=None): + ''' + 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=8, + params=_params) + _params['specs'] = specs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelBlockInfoList) + async def ListBlockedModels(self): + ''' + + Returns -> ModelBlockInfoList + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ListBlockedModels', + version=8, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResults) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='ModelConfig', + version=8, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelStatusResults) + async def ModelStatus(self, entities=None): + ''' + 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=8, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ModifyControllerAccess(self, changes=None): + ''' + 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=8, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def MongoVersion(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='MongoVersion', + version=8, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def RemoveBlocks(self, all_=None): + ''' + 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=8, + params=_params) + _params['all'] = all_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AllWatcherId) + async def WatchAllModels(self): + ''' + + Returns -> AllWatcherId + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='WatchAllModels', + version=8, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchCloudSpecsChanges(self, entities=None): + ''' + 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=8, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + +class ModelManagerFacade(Type): + name = 'ModelManager' + version = 8 + 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'}}, + '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'}}, + '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'}, + '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-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'}, + 'sla': {'$ref': '#/definitions/ModelSLAInfo'}, + 'status': {'$ref': '#/definitions/EntityStatus'}, + 'type': {'type': 'string'}, + 'users': {'items': {'$ref': '#/definitions/ModelUserInfo'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', + 'type', + 'uuid', + 'controller-uuid', + 'is-controller', + 'cloud-tag', + 'owner-tag', + 'life', + 'users', + 'machines', + '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'}, + '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'}, + 'user': {'type': 'string'}}, + 'required': ['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'}, + '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'}, + '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': 'ChangeModelCredentials ' + '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': 'ModelDefaults ' + 'returns the default ' + 'config values for ' + 'the specified ' + '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): + ''' + ChangeModelCredentials 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=8, + 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=8, + 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=8, + 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=8, + 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=8, + 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=8, + 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=8, + params=_params) + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelDefaultsResults) + async def ModelDefaultsForClouds(self, entities=None): + ''' + ModelDefaults 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=8, + 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=8, + 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=8, + 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=8, + 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=8, + 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=8, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_client9.py b/juju/client/old_clients/_client9.py new file mode 100644 index 000000000..08b56a9e0 --- /dev/null +++ b/juju/client/old_clients/_client9.py @@ -0,0 +1,7943 @@ +# 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.old_clients._definitions import * + + +class ApplicationFacade(Type): + name = 'Application' + version = 9 + 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'}, + 'ApplicationConfigSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'generation': {'type': 'string'}}, + 'required': ['application', + 'generation', + 'config'], + 'type': 'object'}, + 'ApplicationConfigSetArgs': {'additionalProperties': False, + 'properties': {'Args': {'items': {'$ref': '#/definitions/ApplicationConfigSet'}, + 'type': 'array'}}, + 'required': ['Args'], + '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': {'application': {'type': 'string'}, + 'attach-storage': {'items': {'type': 'string'}, + 'type': 'array'}, + 'channel': {'type': 'string'}, + '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'}, + 'series': {'type': 'string'}, + 'storage': {'patternProperties': {'.*': {'$ref': '#/definitions/Constraints'}}, + 'type': 'object'}}, + 'required': ['application', + 'series', + 'charm-url', + 'channel', + 'num-units', + 'config-yaml', + 'constraints'], + 'type': 'object'}, + 'ApplicationDestroy': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationExpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationGet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + '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'}, + 'channel': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'series': {'type': 'string'}}, + 'required': ['application', + 'charm', + 'config', + 'constraints', + 'series', + 'channel'], + 'type': 'object'}, + 'ApplicationInfo': {'additionalProperties': False, + 'properties': {'channel': {'type': 'string'}, + 'charm': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'exposed': {'type': 'boolean'}, + 'principal': {'type': 'boolean'}, + 'remote': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'principal', + 'exposed', + 'remote'], + 'type': 'object'}, + 'ApplicationInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ApplicationInfo'}}, + 'type': 'object'}, + 'ApplicationInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + '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'}, + 'ApplicationOfferDetails': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'endpoints': {'items': {'$ref': '#/definitions/RemoteEndpoint'}, + 'type': 'array'}, + 'offer-name': {'type': 'string'}, + 'offer-url': {'type': 'string'}, + 'offer-uuid': {'type': 'string'}, + 'source-model-tag': {'type': 'string'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description'], + 'type': 'object'}, + 'ApplicationSet': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'options': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['application', + 'branch', + 'options'], + 'type': 'object'}, + 'ApplicationSetCharm': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'channel': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'config-settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'config-settings-yaml': {'type': 'string'}, + 'force': {'type': 'boolean'}, + 'force-series': {'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-series'], + 'type': 'object'}, + 'ApplicationUnexpose': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}}, + 'required': ['application'], + 'type': 'object'}, + 'ApplicationUnset': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'branch': {'type': 'string'}, + 'options': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['application', + 'branch', + 'options'], + 'type': 'object'}, + 'ApplicationUpdate': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'charm-url': {'type': 'string'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'force': {'type': 'boolean'}, + 'force-charm-url': {'type': 'boolean'}, + 'force-series': {'type': 'boolean'}, + 'generation': {'type': 'string'}, + 'min-units': {'type': 'integer'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'settings-yaml': {'type': 'string'}}, + 'required': ['application', + 'charm-url', + 'force-charm-url', + 'force-series', + 'force', + 'settings-yaml', + 'generation'], + 'type': 'object'}, + 'ApplicationsDeploy': {'additionalProperties': False, + 'properties': {'applications': {'items': {'$ref': '#/definitions/ApplicationDeploy'}, + 'type': 'array'}}, + 'required': ['applications'], + 'type': 'object'}, + 'CharmRelation': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'limit': {'type': 'integer'}, + 'name': {'type': 'string'}, + 'optional': {'type': 'boolean'}, + 'role': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['name', + 'role', + 'interface', + 'optional', + 'limit', + 'scope'], + 'type': 'object'}, + 'ConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['config'], + 'type': 'object'}, + 'Constraints': {'additionalProperties': False, + 'properties': {'Count': {'type': 'integer'}, + 'Pool': {'type': 'string'}, + 'Size': {'type': 'integer'}}, + 'required': ['Pool', 'Size', 'Count'], + 'type': 'object'}, + 'ConsumeApplicationArg': {'additionalProperties': False, + 'properties': {'ApplicationOfferDetails': {'$ref': '#/definitions/ApplicationOfferDetails'}, + 'application-alias': {'type': 'string'}, + 'application-description': {'type': 'string'}, + 'bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + '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'}, + 'spaces': {'items': {'$ref': '#/definitions/RemoteSpace'}, + 'type': 'array'}, + 'users': {'items': {'$ref': '#/definitions/OfferUserDetails'}, + 'type': 'array'}}, + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description', + 'ApplicationOfferDetails'], + 'type': 'object'}, + 'ConsumeApplicationArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/ConsumeApplicationArg'}, + 'type': 'array'}}, + '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'}, + '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'}, + 'DestroyApplicationUnits': {'additionalProperties': False, + 'properties': {'unit-names': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['unit-names'], + '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'}}, + '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'}, + 'force': {'type': 'boolean'}, + 'max-wait': {'type': 'integer'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', 'force'], + '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'}, + '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'}, + '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'}, + 'Placement': {'additionalProperties': False, + 'properties': {'directive': {'type': 'string'}, + 'scope': {'type': 'string'}}, + 'required': ['scope', 'directive'], + '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'}, + 'RemoteSpace': {'additionalProperties': False, + 'properties': {'cloud-type': {'type': 'string'}, + 'name': {'type': 'string'}, + 'provider-attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider-id': {'type': 'string'}, + 'subnets': {'items': {'$ref': '#/definitions/Subnet'}, + 'type': 'array'}}, + 'required': ['cloud-type', + 'name', + 'provider-id', + 'provider-attributes', + 'subnets'], + 'type': 'object'}, + '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'}, + 'Subnet': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'life': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'space-tag': {'type': 'string'}, + 'status': {'type': 'string'}, + 'vlan-tag': {'type': 'integer'}, + 'zones': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['cidr', + 'vlan-tag', + 'life', + 'space-tag', + 'zones'], + 'type': 'object'}, + 'UnitsResolved': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}, + 'retry': {'type': 'boolean'}, + 'tags': {'$ref': '#/definitions/Entities'}}, + 'type': 'object'}, + 'UpdateSeriesArg': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'series': {'type': 'string'}, + 'tag': {'$ref': '#/definitions/Entity'}}, + 'required': ['tag', 'force', 'series'], + 'type': 'object'}, + 'UpdateSeriesArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + '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': {'properties': {'Params': {'$ref': '#/definitions/AddRelation'}, + 'Result': {'$ref': '#/definitions/AddRelationResults'}}, + 'type': 'object'}, + 'AddUnits': {'properties': {'Params': {'$ref': '#/definitions/AddApplicationUnits'}, + 'Result': {'$ref': '#/definitions/AddApplicationUnitsResults'}}, + 'type': 'object'}, + 'ApplicationsInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationInfoResults'}}, + 'type': 'object'}, + 'CharmConfig': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGetArgs'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'CharmRelations': {'properties': {'Params': {'$ref': '#/definitions/ApplicationCharmRelations'}, + 'Result': {'$ref': '#/definitions/ApplicationCharmRelationsResults'}}, + 'type': 'object'}, + 'Consume': {'properties': {'Params': {'$ref': '#/definitions/ConsumeApplicationArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Deploy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationsDeploy'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/ApplicationDestroy'}}, + 'type': 'object'}, + 'DestroyApplication': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationsParams'}, + 'Result': {'$ref': '#/definitions/DestroyApplicationResults'}}, + 'type': 'object'}, + 'DestroyConsumedApplications': {'properties': {'Params': {'$ref': '#/definitions/DestroyConsumedApplicationsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyRelation': {'properties': {'Params': {'$ref': '#/definitions/DestroyRelation'}}, + 'type': 'object'}, + 'DestroyUnit': {'properties': {'Params': {'$ref': '#/definitions/DestroyUnitsParams'}, + 'Result': {'$ref': '#/definitions/DestroyUnitResults'}}, + 'type': 'object'}, + 'DestroyUnits': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, + 'type': 'object'}, + 'Expose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationExpose'}}, + 'type': 'object'}, + 'Get': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/ApplicationGetResults'}}, + 'type': 'object'}, + 'GetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/ApplicationGet'}, + 'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'GetConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConfigResults'}}, + 'type': 'object'}, + 'GetConstraints': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationGetConstraintsResults'}}, + 'type': 'object'}, + 'ResolveUnitErrors': {'properties': {'Params': {'$ref': '#/definitions/UnitsResolved'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ScaleApplications': {'properties': {'Params': {'$ref': '#/definitions/ScaleApplicationsParams'}, + 'Result': {'$ref': '#/definitions/ScaleApplicationResults'}}, + 'type': 'object'}, + 'Set': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSet'}}, + 'type': 'object'}, + 'SetApplicationsConfig': {'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigSetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharm': {'properties': {'Params': {'$ref': '#/definitions/ApplicationSetCharm'}}, + 'type': 'object'}, + 'SetConstraints': {'properties': {'Params': {'$ref': '#/definitions/SetConstraints'}}, + 'type': 'object'}, + 'SetMetricCredentials': {'properties': {'Params': {'$ref': '#/definitions/ApplicationMetricCredentials'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRelationsSuspended': {'properties': {'Params': {'$ref': '#/definitions/RelationSuspendedArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Unexpose': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnexpose'}}, + 'type': 'object'}, + 'Unset': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUnset'}}, + 'type': 'object'}, + 'UnsetApplicationsConfig': {'properties': {'Params': {'$ref': '#/definitions/ApplicationConfigUnsetArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Update': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUpdate'}}, + 'type': 'object'}, + 'UpdateApplicationSeries': {'properties': {'Params': {'$ref': '#/definitions/UpdateSeriesArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(AddRelationResults) + async def AddRelation(self, endpoints=None, via_cidrs=None): + ''' + 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=9, + 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): + ''' + 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=9, + 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): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def CharmConfig(self, args=None): + ''' + 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=9, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationCharmRelationsResults) + async def CharmRelations(self, application=None): + ''' + 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=9, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Consume(self, args=None): + ''' + 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=9, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Deploy(self, applications=None): + ''' + 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=9, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Destroy(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Destroy', + version=9, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DestroyApplicationResults) + async def DestroyApplication(self, applications=None): + ''' + 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=9, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyConsumedApplications(self, applications=None): + ''' + 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=9, + 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): + ''' + 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=9, + 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): + ''' + 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=9, + params=_params) + _params['units'] = units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyUnits(self, unit_names=None): + ''' + unit_names : typing.Sequence[str] + Returns -> None + ''' + if unit_names is not None and not isinstance(unit_names, (bytes, str, list)): + raise Exception("Expected unit_names to be a Sequence, received: {}".format(type(unit_names))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='DestroyUnits', + version=9, + params=_params) + _params['unit-names'] = unit_names + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Expose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Expose', + version=9, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetResults) + async def Get(self, application=None, branch=None): + ''' + 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=9, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def GetCharmURL(self, application=None, branch=None): + ''' + application : str + branch : str + Returns -> StringResult + ''' + 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='GetCharmURL', + version=9, + params=_params) + _params['application'] = application + _params['branch'] = branch + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConfigResults) + async def GetConfig(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationGetConstraintsResults) + async def GetConstraints(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ResolveUnitErrors(self, all_=None, retry=None, tags=None): + ''' + 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=9, + 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): + ''' + 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=9, + params=_params) + _params['applications'] = applications + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Set(self, application=None, branch=None, options=None): + ''' + application : str + branch : str + options : typing.Mapping[str, 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, dict): + raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Set', + version=9, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationsConfig(self, args=None): + ''' + args : typing.Sequence[~ApplicationConfigSet] + 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='SetApplicationsConfig', + version=9, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetCharm(self, application=None, channel=None, charm_url=None, config_settings=None, config_settings_yaml=None, force=None, force_series=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None): + ''' + application : str + channel : str + charm_url : str + config_settings : typing.Mapping[str, str] + config_settings_yaml : str + force : bool + force_series : 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_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 force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + 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=9, + params=_params) + _params['application'] = application + _params['channel'] = channel + _params['charm-url'] = charm_url + _params['config-settings'] = config_settings + _params['config-settings-yaml'] = config_settings_yaml + _params['force'] = force + _params['force-series'] = force_series + _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(None) + async def SetConstraints(self, application=None, constraints=None): + ''' + 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=9, + params=_params) + _params['application'] = application + _params['constraints'] = constraints + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetMetricCredentials(self, creds=None): + ''' + 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=9, + params=_params) + _params['creds'] = creds + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationsSuspended(self, args=None): + ''' + 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=9, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unexpose(self, application=None): + ''' + application : 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unexpose', + version=9, + params=_params) + _params['application'] = application + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Unset(self, application=None, branch=None, options=None): + ''' + application : str + branch : str + options : 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + + if options is not None and not isinstance(options, (bytes, str, list)): + raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Unset', + version=9, + params=_params) + _params['application'] = application + _params['branch'] = branch + _params['options'] = options + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UnsetApplicationsConfig(self, args=None): + ''' + 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=9, + params=_params) + _params['Args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def Update(self, application=None, charm_url=None, constraints=None, force=None, force_charm_url=None, force_series=None, generation=None, min_units=None, settings=None, settings_yaml=None): + ''' + application : str + charm_url : str + constraints : Value + force : bool + force_charm_url : bool + force_series : bool + generation : str + min_units : int + settings : typing.Mapping[str, str] + settings_yaml : 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 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 constraints is not None and not isinstance(constraints, (dict, Value)): + raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + + if force is not None and not isinstance(force, bool): + raise Exception("Expected force to be a bool, received: {}".format(type(force))) + + if force_charm_url is not None and not isinstance(force_charm_url, bool): + raise Exception("Expected force_charm_url to be a bool, received: {}".format(type(force_charm_url))) + + if force_series is not None and not isinstance(force_series, bool): + raise Exception("Expected force_series to be a bool, received: {}".format(type(force_series))) + + if generation is not None and not isinstance(generation, (bytes, str)): + raise Exception("Expected generation to be a str, received: {}".format(type(generation))) + + if min_units is not None and not isinstance(min_units, int): + raise Exception("Expected min_units to be a int, received: {}".format(type(min_units))) + + if settings is not None and not isinstance(settings, dict): + raise Exception("Expected settings to be a Mapping, received: {}".format(type(settings))) + + if settings_yaml is not None and not isinstance(settings_yaml, (bytes, str)): + raise Exception("Expected settings_yaml to be a str, received: {}".format(type(settings_yaml))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Application', + request='Update', + version=9, + params=_params) + _params['application'] = application + _params['charm-url'] = charm_url + _params['constraints'] = constraints + _params['force'] = force + _params['force-charm-url'] = force_charm_url + _params['force-series'] = force_series + _params['generation'] = generation + _params['min-units'] = min_units + _params['settings'] = settings + _params['settings-yaml'] = settings_yaml + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateApplicationSeries(self, args=None): + ''' + args : typing.Sequence[~UpdateSeriesArg] + 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='UpdateApplicationSeries', + version=9, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + +class ControllerFacade(Type): + name = 'Controller' + version = 9 + schema = {'definitions': {'AllWatcherId': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + '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'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'CloudSpecResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/CloudSpecResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ConfigValue': {'additionalProperties': False, + 'properties': {'source': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['value', 'source'], + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ControllerConfigSet': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ControllerVersionResults': {'additionalProperties': False, + 'properties': {'git-commit': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['version', + 'git-commit'], + 'type': 'object'}, + 'DestroyControllerArgs': {'additionalProperties': False, + 'properties': {'destroy-models': {'type': 'boolean'}, + 'destroy-storage': {'type': 'boolean'}}, + 'required': ['destroy-models'], + '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'}, + 'HostedModelConfig': {'additionalProperties': False, + 'properties': {'cloud-spec': {'$ref': '#/definitions/CloudSpec'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'owner': {'type': 'string'}}, + 'required': ['name', 'owner'], + 'type': 'object'}, + 'HostedModelConfigsResults': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/HostedModelConfig'}, + 'type': 'array'}}, + 'required': ['models'], + 'type': 'object'}, + 'InitiateMigrationArgs': {'additionalProperties': False, + 'properties': {'specs': {'items': {'$ref': '#/definitions/MigrationSpec'}, + 'type': 'array'}}, + 'required': ['specs'], + 'type': 'object'}, + 'InitiateMigrationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'migration-id': {'type': 'string'}, + 'model-tag': {'type': 'string'}}, + 'required': ['model-tag', + 'migration-id'], + 'type': 'object'}, + 'InitiateMigrationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/InitiateMigrationResult'}, + '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'}}, + 'type': 'object'}, + 'MigrationSpec': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}, + 'target-info': {'$ref': '#/definitions/MigrationTargetInfo'}}, + 'required': ['model-tag', 'target-info'], + 'type': 'object'}, + 'MigrationTargetInfo': {'additionalProperties': False, + 'properties': {'addrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'auth-tag': {'type': 'string'}, + 'ca-cert': {'type': 'string'}, + 'controller-alias': {'type': 'string'}, + 'controller-tag': {'type': 'string'}, + 'macaroons': {'type': 'string'}, + 'password': {'type': 'string'}}, + 'required': ['controller-tag', + 'addrs', + 'ca-cert', + 'auth-tag'], + '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'}, + 'ModelBlockInfo': {'additionalProperties': False, + 'properties': {'blocks': {'items': {'type': 'string'}, + 'type': 'array'}, + 'model-uuid': {'type': 'string'}, + 'name': {'type': 'string'}, + 'owner-tag': {'type': 'string'}}, + 'required': ['name', + 'model-uuid', + 'owner-tag', + 'blocks'], + 'type': 'object'}, + 'ModelBlockInfoList': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/ModelBlockInfo'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ModelConfigResults': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'$ref': '#/definitions/ConfigValue'}}, + 'type': 'object'}}, + 'required': ['config'], + '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'}, + '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'}, + 'ModelStatus': {'additionalProperties': False, + 'properties': {'application-count': {'type': 'integer'}, + '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'}, + 'ModelTag': {'additionalProperties': False, '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'}, + 'ModifyControllerAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'action': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', + 'action', + 'access'], + 'type': 'object'}, + 'ModifyControllerAccessRequest': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyControllerAccess'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoveBlocksArgs': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}}, + 'required': ['all'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'SummaryWatcherID': {'additionalProperties': False, + 'properties': {'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'UserAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', 'access'], + 'type': 'object'}, + 'UserAccessResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/UserAccess'}}, + 'type': 'object'}, + 'UserAccessResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UserAccessResult'}, + 'type': 'array'}}, + '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': {'AllModels': {'description': 'AllModels allows controller ' + 'administrators to get the list ' + 'of all the\n' + 'models in the controller.', + 'properties': {'Result': {'$ref': '#/definitions/UserModelList'}}, + 'type': 'object'}, + 'CloudSpec': {'description': "CloudSpec returns the model's " + 'cloud spec.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, + 'type': 'object'}, + 'ConfigSet': {'description': 'ConfigSet changes the value of ' + 'specified controller ' + 'configuration\n' + 'settings. Only some settings can ' + 'be changed after bootstrap.\n' + "Settings that aren't specified " + 'in the params are left ' + 'unchanged.', + 'properties': {'Params': {'$ref': '#/definitions/ControllerConfigSet'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' + 'returns the ' + 'controller api ' + 'connection ' + 'details for the ' + 'specified ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'ControllerVersion': {'description': 'ControllerVersion ' + 'returns the version ' + 'information associated ' + 'with this\n' + 'controller binary.\n' + '\n' + 'NOTE: the implementation ' + 'intentionally does not ' + 'check for ' + 'SuperuserAccess\n' + 'as the Version is known ' + 'even to users with login ' + 'access.', + 'properties': {'Result': {'$ref': '#/definitions/ControllerVersionResults'}}, + 'type': 'object'}, + 'DestroyController': {'description': 'DestroyController ' + 'destroys the ' + 'controller.\n' + '\n' + 'If the args specify the ' + 'destruction of the ' + 'models, this method ' + 'will\n' + 'attempt to do so. ' + 'Otherwise, if the ' + 'controller has any ' + 'non-empty,\n' + 'non-Dead hosted models, ' + 'then an error with the ' + 'code\n' + 'params.CodeHasHostedModels ' + 'will be transmitted.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyControllerArgs'}}, + 'type': 'object'}, + 'GetCloudSpec': {'description': 'GetCloudSpec constructs the ' + 'CloudSpec for a validated and ' + 'authorized model.', + 'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, + 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'GetControllerAccess': {'description': 'GetControllerAccess ' + 'returns the level of ' + 'access the specified ' + 'users\n' + 'have on the ' + 'controller.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UserAccessResults'}}, + 'type': 'object'}, + 'HostedModelConfigs': {'description': 'HostedModelConfigs ' + 'returns all the ' + 'information that the ' + 'client needs in\n' + 'order to connect ' + 'directly with the host ' + "model's provider and " + 'destroy it\n' + 'directly.', + 'properties': {'Result': {'$ref': '#/definitions/HostedModelConfigsResults'}}, + 'type': 'object'}, + 'IdentityProviderURL': {'description': 'IdentityProviderURL ' + 'returns the URL of the ' + 'configured external ' + 'identity\n' + 'provider for this ' + 'controller or an empty ' + 'string if no external ' + 'identity\n' + 'provider has been ' + 'configured when the ' + 'controller was ' + 'bootstrapped.\n' + '\n' + 'NOTE: the ' + 'implementation ' + 'intentionally does not ' + 'check for ' + 'SuperuserAccess\n' + 'as the URL is known ' + 'even to users with ' + 'login access.', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'InitiateMigration': {'description': 'InitiateMigration ' + 'attempts to begin the ' + 'migration of one or\n' + 'more models to other ' + 'controllers.', + 'properties': {'Params': {'$ref': '#/definitions/InitiateMigrationArgs'}, + 'Result': {'$ref': '#/definitions/InitiateMigrationResults'}}, + 'type': 'object'}, + 'ListBlockedModels': {'description': 'ListBlockedModels ' + 'returns a list of all ' + 'models on the ' + 'controller\n' + 'which have a block in ' + 'place. The resulting ' + 'slice is sorted by ' + 'model\n' + 'name, then owner. ' + 'Callers must be ' + 'controller ' + 'administrators to ' + 'retrieve the\n' + 'list.', + 'properties': {'Result': {'$ref': '#/definitions/ModelBlockInfoList'}}, + 'type': 'object'}, + 'ModelConfig': {'description': 'ModelConfig returns the model ' + 'config for the controller\n' + 'model. For information on the ' + 'current model, use\n' + 'client.ModelGet', + 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResults'}}, + 'type': 'object'}, + 'ModelStatus': {'description': 'ModelStatus returns a summary ' + 'of the model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelStatusResults'}}, + 'type': 'object'}, + 'ModifyControllerAccess': {'description': 'ModifyControllerAccess ' + 'changes the model ' + 'access granted to ' + 'users.', + 'properties': {'Params': {'$ref': '#/definitions/ModifyControllerAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'MongoVersion': {'description': 'MongoVersion allows the ' + 'introspection of the mongo ' + 'version per controller', + 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'RemoveBlocks': {'description': 'RemoveBlocks removes all the ' + 'blocks in the controller.', + 'properties': {'Params': {'$ref': '#/definitions/RemoveBlocksArgs'}}, + 'type': 'object'}, + 'WatchAllModelSummaries': {'description': 'WatchAllModelSummaries ' + 'starts watching the ' + 'summary updates ' + 'from the cache.\n' + 'This method is ' + 'superuser access ' + 'only, and watches ' + 'all models in the\n' + 'controller.', + 'properties': {'Result': {'$ref': '#/definitions/SummaryWatcherID'}}, + 'type': 'object'}, + 'WatchAllModels': {'description': 'WatchAllModels starts ' + 'watching events for all ' + 'models in the\n' + 'controller. The returned ' + 'AllWatcherId should be used ' + 'with Next on the\n' + 'AllModelWatcher endpoint to ' + 'receive deltas.', + 'properties': {'Result': {'$ref': '#/definitions/AllWatcherId'}}, + 'type': 'object'}, + 'WatchCloudSpecsChanges': {'description': 'WatchCloudSpecsChanges ' + 'returns a watcher ' + 'for cloud spec ' + 'changes.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchModelSummaries': {'description': 'WatchModelSummaries ' + 'starts watching the ' + 'summary updates from ' + 'the cache.\n' + 'Only models that the ' + 'user has access to are ' + 'returned.', + 'properties': {'Result': {'$ref': '#/definitions/SummaryWatcherID'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(UserModelList) + async def 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=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResults) + async def 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=9, + params=_params) + _params['config'] = config + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def 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=9, + params=_params) + _params['entities'] = entities + reply = await self.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='Controller', + request='ControllerConfig', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerVersionResults) + async def 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=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def DestroyController(self, destroy_models=None, destroy_storage=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 + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Controller', + request='DestroyController', + version=9, + params=_params) + _params['destroy-models'] = destroy_models + _params['destroy-storage'] = destroy_storage + reply = await self.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='Controller', + request='GetCloudSpec', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UserAccessResults) + async def 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(HostedModelConfigsResults) + async def 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=9, + params=_params) + + reply = await self.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 + 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=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(InitiateMigrationResults) + async def 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=9, + params=_params) + _params['specs'] = specs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelBlockInfoList) + async def 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=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResults) + async def 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=9, + params=_params) + + 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='Controller', + request='ModelStatus', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def 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=9, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def 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=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=9, + params=_params) + _params['all'] = all_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SummaryWatcherID) + async def 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=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(AllWatcherId) + async def 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=9, + params=_params) + + reply = await self.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='Controller', + request='WatchCloudSpecsChanges', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SummaryWatcherID) + async def 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=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class ModelManagerFacade(Type): + name = 'ModelManager' + version = 9 + 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'}}, + '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'}, + '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-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'}, + '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', + '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'}, + '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'}, + 'user': {'type': 'string'}}, + 'required': ['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'}, + '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'}, + 'ValidateModelUpgradeParam': {'additionalProperties': False, + 'properties': {'model-tag': {'type': 'string'}}, + 'required': ['model-tag'], + 'type': 'object'}, + 'ValidateModelUpgradeParams': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'model': {'items': {'$ref': '#/definitions/ValidateModelUpgradeParam'}, + 'type': 'array'}}, + 'required': ['model', 'force'], + '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'}, + 'ValidateModelUpgrades': {'description': 'ValidateModelUpgrades ' + 'validates if a model ' + 'is allowed to ' + 'perform an upgrade.\n' + 'Examples of why you ' + 'would want to block ' + 'a model upgrade, ' + 'would be situations\n' + 'like upgrade-series. ' + 'If performing an ' + 'upgrade-series we ' + "don't know the\n" + 'current status of ' + 'the machine, so ' + 'performing an ' + 'upgrade-model can ' + 'lead to\n' + 'bad unintended ' + 'errors down the ' + 'line.', + 'properties': {'Params': {'$ref': '#/definitions/ValidateModelUpgradeParams'}, + '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=9, + 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=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 = 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=9, + 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=9, + 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=9, + 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=9, + 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=9, + 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=9, + 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=9, + 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=9, + 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=9, + 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=9, + 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=9, + params=_params) + _params['keys'] = keys + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ValidateModelUpgrades(self, force=None, model=None): + ''' + ValidateModelUpgrades validates if a model is allowed to perform an upgrade. + Examples of why you would want to block a model upgrade, would be situations + like upgrade-series. If performing an upgrade-series we don't know the + current status of the machine, so performing an upgrade-model can lead to + bad unintended errors down the line. + + force : bool + model : typing.Sequence[~ValidateModelUpgradeParam] + 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 model is not None and not isinstance(model, (bytes, str, list)): + raise Exception("Expected model to be a Sequence, received: {}".format(type(model))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='ModelManager', + request='ValidateModelUpgrades', + version=9, + params=_params) + _params['force'] = force + _params['model'] = model + reply = await self.rpc(msg) + return reply + + + +class ProvisionerFacade(Type): + name = 'Provisioner' + version = 9 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'Binary': {'additionalProperties': False, + 'properties': {'Arch': {'type': 'string'}, + 'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Number': {'$ref': '#/definitions/Number'}, + 'Patch': {'type': 'integer'}, + 'Series': {'type': 'string'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build', + 'Number', + 'Series', + 'Arch'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BytesResult': {'additionalProperties': False, + 'properties': {'result': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'CharmLXDProfile': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'devices': {'patternProperties': {'.*': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config', + 'description', + 'devices'], + 'type': 'object'}, + 'CloudImageMetadata': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'image-id': {'type': 'string'}, + 'priority': {'type': 'integer'}, + 'region': {'type': 'string'}, + 'root-storage-size': {'type': 'integer'}, + 'root-storage-type': {'type': 'string'}, + 'series': {'type': 'string'}, + 'source': {'type': 'string'}, + 'stream': {'type': 'string'}, + 'version': {'type': 'string'}, + 'virt-type': {'type': 'string'}}, + 'required': ['image-id', + 'region', + 'version', + 'series', + 'arch', + 'source', + 'priority'], + 'type': 'object'}, + 'ConstraintsResult': {'additionalProperties': False, + 'properties': {'constraints': {'$ref': '#/definitions/Value'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['constraints'], + 'type': 'object'}, + 'ConstraintsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConstraintsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ContainerConfig': {'additionalProperties': False, + 'properties': {'UpdateBehavior': {'$ref': '#/definitions/UpdateBehavior'}, + 'apt-mirror': {'type': 'string'}, + 'apt-proxy': {'$ref': '#/definitions/Settings'}, + 'authorized-keys': {'type': 'string'}, + 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + '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'}}, + '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', + 'apt-mirror', + 'UpdateBehavior'], + 'type': 'object'}, + 'ContainerLXDProfile': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'profile': {'$ref': '#/definitions/CharmLXDProfile'}}, + 'required': ['profile', 'name'], + 'type': 'object'}, + 'ContainerManagerConfig': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ContainerManagerConfigParams': {'additionalProperties': False, + 'properties': {'type': {'type': 'string'}}, + 'required': ['type'], + 'type': 'object'}, + 'ContainerProfileResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'lxd-profiles': {'items': {'$ref': '#/definitions/ContainerLXDProfile'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ContainerProfileResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ContainerProfileResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerAPIInfoResult': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cacert': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['addresses', + 'cacert'], + 'type': 'object'}, + 'ControllerAPIInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ControllerConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'DeviceBridgeInfo': {'additionalProperties': False, + 'properties': {'bridge-name': {'type': 'string'}, + 'host-device-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['host-device-name', + 'bridge-name', + 'mac-address'], + 'type': 'object'}, + 'DistributionGroupResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['result'], + 'type': 'object'}, + 'DistributionGroupResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/DistributionGroupResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityPassword': {'additionalProperties': False, + 'properties': {'password': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'password'], + 'type': 'object'}, + 'EntityPasswords': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'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'}, + 'FindToolsParams': {'additionalProperties': False, + 'properties': {'agentstream': {'type': 'string'}, + 'arch': {'type': 'string'}, + 'major': {'type': 'integer'}, + 'minor': {'type': 'integer'}, + 'number': {'$ref': '#/definitions/Number'}, + 'series': {'type': 'string'}}, + 'required': ['number', + 'major', + 'minor', + 'arch', + 'series', + 'agentstream'], + 'type': 'object'}, + 'FindToolsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'list': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['list'], + 'type': 'object'}, + 'HardwareCharacteristics': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'availability-zone': {'type': 'string'}, + 'cpu-cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + 'root-disk-source': {'type': 'string'}, + 'tags': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'HostNetworkChange': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'new-bridges': {'items': {'$ref': '#/definitions/DeviceBridgeInfo'}, + 'type': 'array'}, + 'reconfigure-delay': {'type': 'integer'}}, + 'required': ['new-bridges', + 'reconfigure-delay'], + 'type': 'object'}, + 'HostNetworkChangeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/HostNetworkChange'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}, + 'scope': {'type': 'string'}, + 'space-id': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', + 'type', + 'scope', + 'Address', + 'port'], + 'type': 'object'}, + 'InstanceInfo': {'additionalProperties': False, + 'properties': {'characteristics': {'$ref': '#/definitions/HardwareCharacteristics'}, + 'charm-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'display-name': {'type': 'string'}, + 'instance-id': {'type': 'string'}, + 'network-config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'nonce': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'volume-attachments': {'patternProperties': {'.*': {'$ref': '#/definitions/VolumeAttachmentInfo'}}, + 'type': 'object'}, + 'volumes': {'items': {'$ref': '#/definitions/Volume'}, + 'type': 'array'}}, + 'required': ['tag', + 'instance-id', + 'display-name', + 'nonce', + 'characteristics', + 'volumes', + 'volume-attachments', + 'network-config', + 'charm-profiles'], + 'type': 'object'}, + 'InstancesInfo': {'additionalProperties': False, + 'properties': {'machines': {'items': {'$ref': '#/definitions/InstanceInfo'}, + 'type': 'array'}}, + 'required': ['machines'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineContainerResult': {'additionalProperties': False, + 'properties': {'container-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'determined': {'type': 'boolean'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['container-types', + 'determined'], + 'type': 'object'}, + 'MachineContainerResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineContainerResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MachineContainers': {'additionalProperties': False, + 'properties': {'container-types': {'items': {'type': 'string'}, + 'type': 'array'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'container-types'], + 'type': 'object'}, + 'MachineContainersParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MachineContainers'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MachineNetworkConfigResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'info': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}}, + 'required': ['info'], + 'type': 'object'}, + 'MachineNetworkConfigResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachineNetworkConfigResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'NetworkConfig': {'additionalProperties': False, + 'properties': {'address': {'type': 'string'}, + 'cidr': {'type': 'string'}, + 'config-type': {'type': 'string'}, + 'device-index': {'type': 'integer'}, + 'disabled': {'type': 'boolean'}, + 'dns-search-domains': {'items': {'type': 'string'}, + 'type': 'array'}, + 'dns-servers': {'items': {'type': 'string'}, + 'type': 'array'}, + 'gateway-address': {'type': 'string'}, + 'interface-name': {'type': 'string'}, + 'interface-type': {'type': 'string'}, + 'is-default-gateway': {'type': 'boolean'}, + 'mac-address': {'type': 'string'}, + 'mtu': {'type': 'integer'}, + 'no-auto-start': {'type': 'boolean'}, + 'parent-interface-name': {'type': 'string'}, + 'provider-address-id': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'provider-network-id': {'type': 'string'}, + 'provider-space-id': {'type': 'string'}, + 'provider-subnet-id': {'type': 'string'}, + 'provider-vlan-id': {'type': 'string'}, + 'routes': {'items': {'$ref': '#/definitions/NetworkRoute'}, + 'type': 'array'}, + 'vlan-tag': {'type': 'integer'}}, + 'required': ['device-index', + 'mac-address', + 'cidr', + 'mtu', + 'provider-id', + 'provider-network-id', + 'provider-subnet-id', + 'provider-space-id', + 'provider-address-id', + 'provider-vlan-id', + 'vlan-tag', + 'interface-name', + 'parent-interface-name', + 'interface-type', + 'disabled'], + 'type': 'object'}, + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + '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'}, + 'ProvisioningInfo': {'additionalProperties': False, + 'properties': {'charm-lxd-profiles': {'items': {'type': 'string'}, + 'type': 'array'}, + 'cloudinit-userdata': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'constraints': {'$ref': '#/definitions/Value'}, + 'controller-config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'endpoint-bindings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'image-metadata': {'items': {'$ref': '#/definitions/CloudImageMetadata'}, + 'type': 'array'}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'placement': {'type': 'string'}, + 'series': {'type': 'string'}, + 'subnets-to-zones': {'patternProperties': {'.*': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-attachments': {'items': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'type': 'array'}, + 'volumes': {'items': {'$ref': '#/definitions/VolumeParams'}, + 'type': 'array'}}, + 'required': ['constraints', + 'series', + 'placement', + 'jobs'], + 'type': 'object'}, + 'ProvisioningInfoResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/ProvisioningInfo'}}, + 'required': ['result'], + 'type': 'object'}, + 'ProvisioningInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ProvisioningInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetMachineNetworkConfig': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/NetworkConfig'}, + 'type': 'array'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'config'], + 'type': 'object'}, + 'SetProfileArg': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'profiles': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['entity', 'profiles'], + 'type': 'object'}, + 'SetProfileArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/SetProfileArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Settings': {'additionalProperties': False, + 'properties': {'AutoNoProxy': {'type': 'string'}, + 'Ftp': {'type': 'string'}, + 'Http': {'type': 'string'}, + 'Https': {'type': 'string'}, + 'NoProxy': {'type': 'string'}}, + 'required': ['Http', + 'Https', + 'Ftp', + 'NoProxy', + 'AutoNoProxy'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], + 'type': 'object'}, + 'ToolsResult': {'additionalProperties': False, + 'properties': {'disable-ssl-hostname-verification': {'type': 'boolean'}, + 'error': {'$ref': '#/definitions/Error'}, + 'tools': {'items': {'$ref': '#/definitions/Tools'}, + 'type': 'array'}}, + 'required': ['tools', + 'disable-ssl-hostname-verification'], + 'type': 'object'}, + 'ToolsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ToolsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UpdateBehavior': {'additionalProperties': False, + 'properties': {'enable-os-refresh-update': {'type': 'boolean'}, + 'enable-os-upgrade': {'type': 'boolean'}}, + 'required': ['enable-os-refresh-update', + 'enable-os-upgrade'], + 'type': 'object'}, + 'Value': {'additionalProperties': False, + 'properties': {'arch': {'type': 'string'}, + 'container': {'type': 'string'}, + 'cores': {'type': 'integer'}, + 'cpu-power': {'type': 'integer'}, + 'instance-type': {'type': 'string'}, + 'mem': {'type': 'integer'}, + 'root-disk': {'type': 'integer'}, + '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'}, + 'Volume': {'additionalProperties': False, + 'properties': {'info': {'$ref': '#/definitions/VolumeInfo'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', 'info'], + 'type': 'object'}, + 'VolumeAttachmentInfo': {'additionalProperties': False, + 'properties': {'bus-address': {'type': 'string'}, + 'device-link': {'type': 'string'}, + 'device-name': {'type': 'string'}, + 'plan-info': {'$ref': '#/definitions/VolumeAttachmentPlanInfo'}, + 'read-only': {'type': 'boolean'}}, + 'type': 'object'}, + 'VolumeAttachmentParams': {'additionalProperties': False, + 'properties': {'instance-id': {'type': 'string'}, + 'machine-tag': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'read-only': {'type': 'boolean'}, + 'volume-id': {'type': 'string'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'machine-tag', + 'provider'], + 'type': 'object'}, + 'VolumeAttachmentPlanInfo': {'additionalProperties': False, + 'properties': {'device-attributes': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'device-type': {'type': 'string'}}, + 'type': 'object'}, + 'VolumeInfo': {'additionalProperties': False, + 'properties': {'hardware-id': {'type': 'string'}, + 'persistent': {'type': 'boolean'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'volume-id': {'type': 'string'}, + 'wwn': {'type': 'string'}}, + 'required': ['volume-id', 'size', 'persistent'], + 'type': 'object'}, + 'VolumeParams': {'additionalProperties': False, + 'properties': {'attachment': {'$ref': '#/definitions/VolumeAttachmentParams'}, + 'attributes': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'provider': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'tags': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'volume-tag': {'type': 'string'}}, + 'required': ['volume-tag', + 'size', + 'provider'], + 'type': 'object'}, + 'WatchContainer': {'additionalProperties': False, + 'properties': {'container-type': {'type': 'string'}, + 'machine-tag': {'type': 'string'}}, + 'required': ['machine-tag', + 'container-type'], + 'type': 'object'}, + 'WatchContainers': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/WatchContainer'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}}, + 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'AvailabilityZone': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CACert': {'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, + 'type': 'object'}, + 'Constraints': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConstraintsResults'}}, + 'type': 'object'}, + 'ContainerConfig': {'properties': {'Result': {'$ref': '#/definitions/ContainerConfig'}}, + 'type': 'object'}, + 'ContainerManagerConfig': {'properties': {'Params': {'$ref': '#/definitions/ContainerManagerConfigParams'}, + 'Result': {'$ref': '#/definitions/ContainerManagerConfig'}}, + 'type': 'object'}, + 'ControllerAPIInfoForModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, + 'type': 'object'}, + 'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'type': 'object'}, + 'DistributionGroup': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/DistributionGroupResults'}}, + 'type': 'object'}, + 'DistributionGroupByMachineId': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsResults'}}, + 'type': 'object'}, + 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FindTools': {'properties': {'Params': {'$ref': '#/definitions/FindToolsParams'}, + 'Result': {'$ref': '#/definitions/FindToolsResult'}}, + 'type': 'object'}, + 'GetContainerInterfaceInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineNetworkConfigResults'}}, + 'type': 'object'}, + 'GetContainerProfileInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ContainerProfileResults'}}, + 'type': 'object'}, + 'HostChangesForContainers': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/HostNetworkChangeResults'}}, + 'type': 'object'}, + 'InstanceId': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'InstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'KeepInstance': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'MachinesWithTransientErrors': {'properties': {'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'MarkMachinesForRemoval': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PrepareContainerInterfaceInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineNetworkConfigResults'}}, + 'type': 'object'}, + 'ProvisioningInfo': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ProvisioningInfoResults'}}, + 'type': 'object'}, + 'ReleaseContainerAddresses': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Remove': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Series': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'SetCharmProfiles': {'properties': {'Params': {'$ref': '#/definitions/SetProfileArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetHostMachineNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetInstanceInfo': {'properties': {'Params': {'$ref': '#/definitions/InstancesInfo'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetInstanceStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModificationStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetObservedNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/SetMachineNetworkConfig'}}, + 'type': 'object'}, + 'SetPasswords': {'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetProviderNetworkConfig': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetSupportedContainers': {'properties': {'Params': {'$ref': '#/definitions/MachineContainersParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StateAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'Status': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'SupportedContainers': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachineContainerResults'}}, + 'type': 'object'}, + 'Tools': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ToolsResults'}}, + 'type': 'object'}, + 'UpdateStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchAllContainers': {'properties': {'Params': {'$ref': '#/definitions/WatchContainers'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchContainers': {'properties': {'Params': {'$ref': '#/definitions/WatchContainers'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchMachineErrorRetry': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchModelMachines': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='APIAddresses', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='APIHostPorts', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BytesResult) + async def CACert(self): + ''' + + Returns -> BytesResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='CACert', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConstraintsResults) + async def Constraints(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerConfig) + async def ContainerConfig(self): + ''' + + Returns -> ContainerConfig + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ContainerConfig', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerManagerConfig) + async def ContainerManagerConfig(self, type_=None): + ''' + 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=9, + params=_params) + _params['type'] = type_ + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): + ''' + + Returns -> ControllerConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ControllerConfig', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(DistributionGroupResults) + async def DistributionGroup(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResults) + async def DistributionGroupByMachineId(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(FindToolsResult) + async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, number=None, series=None): + ''' + agentstream : str + arch : str + major : int + minor : int + number : Number + series : 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 minor is not None and not isinstance(minor, int): + raise Exception("Expected minor to be a int, received: {}".format(type(minor))) + + if number is not None and not isinstance(number, (dict, Number)): + raise Exception("Expected number to be a Number, received: {}".format(type(number))) + + if series is not None and not isinstance(series, (bytes, str)): + raise Exception("Expected series to be a str, received: {}".format(type(series))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='FindTools', + version=9, + params=_params) + _params['agentstream'] = agentstream + _params['arch'] = arch + _params['major'] = major + _params['minor'] = minor + _params['number'] = number + _params['series'] = series + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) + async def GetContainerInterfaceInfo(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ContainerProfileResults) + async def GetContainerProfileInfo(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(HostNetworkChangeResults) + async def HostChangesForContainers(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def InstanceId(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def InstanceStatus(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def KeepInstance(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def MachinesWithTransientErrors(self): + ''' + + Returns -> StatusResults + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='MachinesWithTransientErrors', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def MarkMachinesForRemoval(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelConfig', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='ModelUUID', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineNetworkConfigResults) + async def PrepareContainerInterfaceInfo(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ProvisioningInfoResults) + async def ProvisioningInfo(self, entities=None): + ''' + 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='ProvisioningInfo', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ReleaseContainerAddresses(self, entities=None): + ''' + 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='ReleaseContainerAddresses', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Remove(self, entities=None): + ''' + 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='Remove', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def Series(self, entities=None): + ''' + 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='Series', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmProfiles(self, args=None): + ''' + 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=9, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def 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=9, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceInfo(self, machines=None): + ''' + 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=9, + params=_params) + _params['machines'] = machines + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetInstanceStatus(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetModificationStatus(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(None) + async def SetObservedNetworkConfig(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='SetObservedNetworkConfig', + version=9, + params=_params) + _params['config'] = config + _params['tag'] = tag + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): + ''' + 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=9, + params=_params) + _params['changes'] = changes + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetProviderNetworkConfig(self, entities=None): + ''' + 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='SetProviderNetworkConfig', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetSupportedContainers(self, params=None): + ''' + 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=9, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsResult) + async def StateAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='StateAddresses', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def Status(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachineContainerResults) + async def SupportedContainers(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ToolsResults) + async def 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='Provisioner', + request='Tools', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateStatus(self, entities=None): + ''' + 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='UpdateStatus', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchAPIHostPorts', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchAllContainers(self, params=None): + ''' + 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=9, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchContainers(self, params=None): + ''' + 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=9, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchForModelConfigChanges', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchMachineErrorRetry(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchMachineErrorRetry', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResult) + async def WatchModelMachines(self): + ''' + + Returns -> StringsWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Provisioner', + request='WatchModelMachines', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + +class UniterFacade(Type): + name = 'Uniter' + version = 9 + schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, + 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, + 'type': 'array'}, + 'type': 'array'}}, + 'required': ['servers'], + 'type': 'object'}, + 'Action': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'parameters': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'receiver': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'receiver', 'name'], + 'type': 'object'}, + 'ActionExecutionResult': {'additionalProperties': False, + 'properties': {'action-tag': {'type': 'string'}, + 'message': {'type': 'string'}, + 'results': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'status': {'type': 'string'}}, + 'required': ['action-tag', 'status'], + 'type': 'object'}, + 'ActionExecutionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionExecutionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'ActionResult': {'additionalProperties': False, + 'properties': {'action': {'$ref': '#/definitions/Action'}, + 'completed': {'format': 'date-time', + 'type': 'string'}, + 'enqueued': {'format': 'date-time', + 'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'message': {'type': 'string'}, + 'output': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'started': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'ActionResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ActionResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'Address': {'additionalProperties': False, + 'properties': {'scope': {'type': 'string'}, + 'space-name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['value', 'type', 'scope'], + 'type': 'object'}, + 'ApplicationStatusResult': {'additionalProperties': False, + 'properties': {'application': {'$ref': '#/definitions/StatusResult'}, + 'error': {'$ref': '#/definitions/Error'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/StatusResult'}}, + 'type': 'object'}}, + 'required': ['application', + 'units'], + 'type': 'object'}, + 'ApplicationStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'BoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'boolean'}}, + 'required': ['result'], + 'type': 'object'}, + 'BoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/BoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + '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'}, + 'CharmURL': {'additionalProperties': False, + 'properties': {'url': {'type': 'string'}}, + 'required': ['url'], + 'type': 'object'}, + 'CharmURLs': {'additionalProperties': False, + 'properties': {'urls': {'items': {'$ref': '#/definitions/CharmURL'}, + 'type': 'array'}}, + 'required': ['urls'], + 'type': 'object'}, + 'CloudCredential': {'additionalProperties': False, + 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'auth-type': {'type': 'string'}, + 'redacted': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['auth-type'], + 'type': 'object'}, + 'CloudSpec': {'additionalProperties': False, + 'properties': {'cacertificates': {'items': {'type': 'string'}, + 'type': 'array'}, + 'credential': {'$ref': '#/definitions/CloudCredential'}, + 'endpoint': {'type': 'string'}, + 'identity-endpoint': {'type': 'string'}, + 'name': {'type': 'string'}, + 'region': {'type': 'string'}, + 'storage-endpoint': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type', 'name'], + 'type': 'object'}, + 'CloudSpecResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/CloudSpec'}}, + 'type': 'object'}, + 'ConfigSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'ConfigSettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConfigSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Endpoint': {'additionalProperties': False, + 'properties': {'application-name': {'type': 'string'}, + 'relation': {'$ref': '#/definitions/CharmRelation'}}, + 'required': ['application-name', 'relation'], + 'type': 'object'}, + 'Entities': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesCharmURL': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityCharmURL'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesPortRanges': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityPortRange'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Entity': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}}, + 'required': ['tag'], + 'type': 'object'}, + 'EntityCharmURL': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'charm-url'], + 'type': 'object'}, + 'EntityPortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'tag': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['tag', + 'protocol', + 'from-port', + 'to-port'], + 'type': 'object'}, + 'EntityStatusArgs': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'status', + 'info', + 'data'], + 'type': 'object'}, + 'EntityString': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['tag', 'value'], + 'type': 'object'}, + 'EntityWorkloadVersion': {'additionalProperties': False, + 'properties': {'tag': {'type': 'string'}, + 'workload-version': {'type': 'string'}}, + 'required': ['tag', + 'workload-version'], + 'type': 'object'}, + 'EntityWorkloadVersions': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityWorkloadVersion'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], + 'type': 'object'}, + 'ErrorInfo': {'additionalProperties': False, + 'properties': {'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'macaroon-path': {'type': 'string'}}, + 'type': 'object'}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, + 'type': 'object'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsBulkResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GetLeadershipSettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GetLeadershipSettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'GoalState': {'additionalProperties': False, + 'properties': {'relations': {'patternProperties': {'.*': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'type': 'object'}, + 'units': {'patternProperties': {'.*': {'$ref': '#/definitions/GoalStateStatus'}}, + 'type': 'object'}}, + 'required': ['units', 'relations'], + 'type': 'object'}, + 'GoalStateResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/GoalState'}}, + 'required': ['result', 'error'], + 'type': 'object'}, + 'GoalStateResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/GoalStateResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'GoalStateStatus': {'additionalProperties': False, + 'properties': {'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'since'], + 'type': 'object'}, + 'HostPort': {'additionalProperties': False, + 'properties': {'Address': {'$ref': '#/definitions/Address'}, + 'port': {'type': 'integer'}}, + 'required': ['Address', 'port'], + 'type': 'object'}, + 'IntResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'integer'}}, + 'required': ['result'], + 'type': 'object'}, + 'IntResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/IntResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'InterfaceAddress': {'additionalProperties': False, + 'properties': {'cidr': {'type': 'string'}, + 'hostname': {'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['hostname', 'value', 'cidr'], + 'type': 'object'}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], + 'type': 'object'}, + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Macaroon': {'additionalProperties': False, 'type': 'object'}, + 'MachinePortRange': {'additionalProperties': False, + 'properties': {'port-range': {'$ref': '#/definitions/PortRange'}, + 'relation-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-tag', + 'port-range'], + 'type': 'object'}, + 'MachinePortsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ports': {'items': {'$ref': '#/definitions/MachinePortRange'}, + 'type': 'array'}}, + 'required': ['ports'], + 'type': 'object'}, + 'MachinePortsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MachinePortsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'MergeLeadershipSettingsBulkParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/MergeLeadershipSettingsParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'MergeLeadershipSettingsParam': {'additionalProperties': False, + 'properties': {'application-tag': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['settings'], + 'type': 'object'}, + 'MeterStatusResult': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}}, + 'required': ['code', 'info'], + 'type': 'object'}, + 'MeterStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/MeterStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'Metric': {'additionalProperties': False, + 'properties': {'key': {'type': 'string'}, + 'labels': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'time': {'format': 'date-time', + 'type': 'string'}, + 'value': {'type': 'string'}}, + 'required': ['key', 'value', 'time'], + 'type': 'object'}, + 'MetricBatch': {'additionalProperties': False, + 'properties': {'charm-url': {'type': 'string'}, + 'created': {'format': 'date-time', + 'type': 'string'}, + 'metrics': {'items': {'$ref': '#/definitions/Metric'}, + 'type': 'array'}, + 'uuid': {'type': 'string'}}, + 'required': ['uuid', + 'charm-url', + 'created', + 'metrics'], + 'type': 'object'}, + 'MetricBatchParam': {'additionalProperties': False, + 'properties': {'batch': {'$ref': '#/definitions/MetricBatch'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', 'batch'], + 'type': 'object'}, + 'MetricBatchParams': {'additionalProperties': False, + 'properties': {'batches': {'items': {'$ref': '#/definitions/MetricBatchParam'}, + 'type': 'array'}}, + 'required': ['batches'], + 'type': 'object'}, + 'ModelConfigResult': {'additionalProperties': False, + 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['config'], + 'type': 'object'}, + 'ModelResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'name': {'type': 'string'}, + 'type': {'type': 'string'}, + 'uuid': {'type': 'string'}}, + 'required': ['name', 'uuid', 'type'], + 'type': 'object'}, + 'NetworkInfo': {'additionalProperties': False, + 'properties': {'addresses': {'items': {'$ref': '#/definitions/InterfaceAddress'}, + 'type': 'array'}, + 'interface-name': {'type': 'string'}, + 'mac-address': {'type': 'string'}}, + 'required': ['mac-address', + 'interface-name', + 'addresses'], + 'type': 'object'}, + 'NetworkInfoParams': {'additionalProperties': False, + 'properties': {'bindings': {'items': {'type': 'string'}, + 'type': 'array'}, + 'relation-id': {'type': 'integer'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'bindings'], + 'type': 'object'}, + 'NetworkInfoResult': {'additionalProperties': False, + 'properties': {'bind-addresses': {'items': {'$ref': '#/definitions/NetworkInfo'}, + 'type': 'array'}, + 'egress-subnets': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'ingress-addresses': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'NetworkInfoResults': {'additionalProperties': False, + 'properties': {'results': {'patternProperties': {'.*': {'$ref': '#/definitions/NetworkInfoResult'}}, + 'type': 'object'}}, + 'required': ['results'], + 'type': 'object'}, + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], + 'type': 'object'}, + 'NotifyWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'PortRange': {'additionalProperties': False, + 'properties': {'from-port': {'type': 'integer'}, + 'protocol': {'type': 'string'}, + 'to-port': {'type': 'integer'}}, + 'required': ['from-port', 'to-port', 'protocol'], + 'type': 'object'}, + 'RelationIds': {'additionalProperties': False, + 'properties': {'relation-ids': {'items': {'type': 'integer'}, + 'type': 'array'}}, + 'required': ['relation-ids'], + 'type': 'object'}, + 'RelationResult': {'additionalProperties': False, + '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'}}, + 'required': ['life', + 'id', + 'key', + 'endpoint'], + 'type': 'object'}, + 'RelationResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationStatusArg': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}, + 'relation-id': {'type': 'integer'}, + 'status': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['unit-tag', + 'relation-id', + 'status', + 'message'], + 'type': 'object'}, + 'RelationStatusArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/RelationStatusArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'RelationUnit': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', 'unit'], + 'type': 'object'}, + 'RelationUnitPair': {'additionalProperties': False, + 'properties': {'local-unit': {'type': 'string'}, + 'relation': {'type': 'string'}, + 'remote-unit': {'type': 'string'}}, + 'required': ['relation', + 'local-unit', + 'remote-unit'], + 'type': 'object'}, + 'RelationUnitPairs': {'additionalProperties': False, + 'properties': {'relation-unit-pairs': {'items': {'$ref': '#/definitions/RelationUnitPair'}, + 'type': 'array'}}, + 'required': ['relation-unit-pairs'], + 'type': 'object'}, + 'RelationUnitSettings': {'additionalProperties': False, + 'properties': {'relation': {'type': 'string'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'unit': {'type': 'string'}}, + 'required': ['relation', + 'unit', + 'settings'], + 'type': 'object'}, + 'RelationUnitStatus': {'additionalProperties': False, + 'properties': {'in-scope': {'type': 'boolean'}, + 'relation-tag': {'type': 'string'}, + 'suspended': {'type': 'boolean'}}, + 'required': ['relation-tag', + 'in-scope', + 'suspended'], + 'type': 'object'}, + 'RelationUnitStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'results': {'items': {'$ref': '#/definitions/RelationUnitStatus'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnitStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitStatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RelationUnits': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnit'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsChange': {'additionalProperties': False, + 'properties': {'changed': {'patternProperties': {'.*': {'$ref': '#/definitions/UnitSettings'}}, + 'type': 'object'}, + 'departed': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['changed'], + 'type': 'object'}, + 'RelationUnitsSettings': {'additionalProperties': False, + 'properties': {'relation-units': {'items': {'$ref': '#/definitions/RelationUnitSettings'}, + 'type': 'array'}}, + 'required': ['relation-units'], + 'type': 'object'}, + 'RelationUnitsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RelationUnitsChange'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RelationUnitsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RelationUnitsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'ResolvedModeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'mode': {'type': 'string'}}, + 'required': ['mode'], + 'type': 'object'}, + 'ResolvedModeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResolvedModeResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SetPodSpecParams': {'additionalProperties': False, + 'properties': {'specs': {'items': {'$ref': '#/definitions/EntityString'}, + 'type': 'array'}}, + 'required': ['specs'], + 'type': 'object'}, + 'SetStatus': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, + 'type': 'array'}}, + 'required': ['entities'], + 'type': 'object'}, + 'SettingsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'settings': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}}, + 'required': ['settings'], + 'type': 'object'}, + 'SettingsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/SettingsResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StatusResult': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'error': {'$ref': '#/definitions/Error'}, + 'id': {'type': 'string'}, + 'info': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id', + 'life', + 'status', + 'info', + 'data', + 'since'], + 'type': 'object'}, + 'StatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StatusResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StorageAddParams': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'storage': {'$ref': '#/definitions/StorageConstraints'}, + 'unit': {'type': 'string'}}, + 'required': ['unit', 'name', 'storage'], + 'type': 'object'}, + 'StorageAttachment': {'additionalProperties': False, + 'properties': {'kind': {'type': 'integer'}, + 'life': {'type': 'string'}, + 'location': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'owner-tag', + 'unit-tag', + 'kind', + 'location', + 'life'], + 'type': 'object'}, + 'StorageAttachmentId': {'additionalProperties': False, + 'properties': {'storage-tag': {'type': 'string'}, + 'unit-tag': {'type': 'string'}}, + 'required': ['storage-tag', + 'unit-tag'], + 'type': 'object'}, + 'StorageAttachmentIds': {'additionalProperties': False, + 'properties': {'ids': {'items': {'$ref': '#/definitions/StorageAttachmentId'}, + 'type': 'array'}}, + 'required': ['ids'], + 'type': 'object'}, + 'StorageAttachmentIdsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachmentIds'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentIdsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentIdsResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageAttachmentResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'$ref': '#/definitions/StorageAttachment'}}, + 'required': ['result'], + 'type': 'object'}, + 'StorageAttachmentResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StorageAttachmentResult'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StorageConstraints': {'additionalProperties': False, + 'properties': {'count': {'type': 'integer'}, + 'pool': {'type': 'string'}, + 'size': {'type': 'integer'}}, + 'type': 'object'}, + 'StoragesAddParams': {'additionalProperties': False, + 'properties': {'storages': {'items': {'$ref': '#/definitions/StorageAddParams'}, + 'type': 'array'}}, + 'required': ['storages'], + 'type': 'object'}, + 'StringBoolResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'ok': {'type': 'boolean'}, + 'result': {'type': 'string'}}, + 'required': ['result', 'ok'], + 'type': 'object'}, + 'StringBoolResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringBoolResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'StringsResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'type': 'object'}, + 'StringsWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'items': {'type': 'string'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id'], + 'type': 'object'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'UnitRefreshResult': {'additionalProperties': False, + 'properties': {'Error': {'$ref': '#/definitions/Error'}, + 'Life': {'type': 'string'}, + 'Resolved': {'type': 'string'}}, + 'required': ['Life', + 'Resolved', + 'Error'], + 'type': 'object'}, + 'UnitRefreshResults': {'additionalProperties': False, + 'properties': {'Results': {'items': {'$ref': '#/definitions/UnitRefreshResult'}, + 'type': 'array'}}, + 'required': ['Results'], + 'type': 'object'}, + 'UnitSettings': {'additionalProperties': False, + 'properties': {'version': {'type': 'integer'}}, + 'required': ['version'], + 'type': 'object'}, + 'UpgradeSeriesStatusParam': {'additionalProperties': False, + 'properties': {'entity': {'$ref': '#/definitions/Entity'}, + 'message': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['entity', + 'status', + 'message'], + 'type': 'object'}, + 'UpgradeSeriesStatusParams': {'additionalProperties': False, + 'properties': {'params': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusParam'}, + 'type': 'array'}}, + 'required': ['params'], + 'type': 'object'}, + 'UpgradeSeriesStatusResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'status': {'type': 'string'}}, + 'type': 'object'}, + 'UpgradeSeriesStatusResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/UpgradeSeriesStatusResult'}, + 'type': 'array'}}, + 'type': 'object'}}, + 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + 'type': 'object'}, + 'APIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'type': 'object'}, + 'Actions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ActionResults'}}, + 'type': 'object'}, + 'AddMetricBatches': {'properties': {'Params': {'$ref': '#/definitions/MetricBatchParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AddUnitStorage': {'properties': {'Params': {'$ref': '#/definitions/StoragesAddParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'AllMachinePorts': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MachinePortsResults'}}, + 'type': 'object'}, + 'ApplicationStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ApplicationStatusResults'}}, + 'type': 'object'}, + 'AssignedMachine': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'AvailabilityZone': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'BeginActions': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CharmArchiveSha256': {'properties': {'Params': {'$ref': '#/definitions/CharmURLs'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'CharmModifiedVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, + 'type': 'object'}, + 'CharmURL': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'ClearResolved': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ClosePorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CloudSpec': {'properties': {'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + 'type': 'object'}, + 'ConfigSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ConfigSettingsResults'}}, + 'type': 'object'}, + 'CurrentModel': {'properties': {'Result': {'$ref': '#/definitions/ModelResult'}}, + 'type': 'object'}, + 'Destroy': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyAllSubordinates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DestroyUnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnsureDead': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'EnterScope': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'FinishActions': {'properties': {'Params': {'$ref': '#/definitions/ActionExecutionResults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'GetMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MeterStatusResults'}}, + 'type': 'object'}, + 'GetPrincipal': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringBoolResults'}}, + 'type': 'object'}, + 'GoalStates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GoalStateResults'}}, + 'type': 'object'}, + 'HasSubordinates': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/BoolResults'}}, + 'type': 'object'}, + 'LeaveScope': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Life': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'Merge': {'properties': {'Params': {'$ref': '#/definitions/MergeLeadershipSettingsBulkParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'ModelConfig': {'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + 'type': 'object'}, + 'ModelUUID': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'NetworkInfo': {'properties': {'Params': {'$ref': '#/definitions/NetworkInfoParams'}, + 'Result': {'$ref': '#/definitions/NetworkInfoResults'}}, + 'type': 'object'}, + 'OpenPorts': {'properties': {'Params': {'$ref': '#/definitions/EntitiesPortRanges'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'PrivateAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'ProviderType': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'PublicAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'Read': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/GetLeadershipSettingsBulkResults'}}, + 'type': 'object'}, + 'ReadRemoteSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnitPairs'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'ReadSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/SettingsResults'}}, + 'type': 'object'}, + 'Refresh': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UnitRefreshResults'}}, + 'type': 'object'}, + 'Relation': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationById': {'properties': {'Params': {'$ref': '#/definitions/RelationIds'}, + 'Result': {'$ref': '#/definitions/RelationResults'}}, + 'type': 'object'}, + 'RelationsStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/RelationUnitStatusResults'}}, + 'type': 'object'}, + 'RemoveStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'RequestReboot': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'Resolved': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ResolvedModeResults'}}, + 'type': 'object'}, + 'SLALevel': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + 'type': 'object'}, + 'SetAgentStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetApplicationStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetCharmURL': {'properties': {'Params': {'$ref': '#/definitions/EntitiesCharmURL'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetPodSpec': {'properties': {'Params': {'$ref': '#/definitions/SetPodSpecParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetRelationStatus': {'properties': {'Params': {'$ref': '#/definitions/RelationStatusArgs'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetUpgradeSeriesUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/UpgradeSeriesStatusParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetWorkloadVersion': {'properties': {'Params': {'$ref': '#/definitions/EntityWorkloadVersions'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'StorageAttachmentLife': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/LifeResults'}}, + 'type': 'object'}, + 'StorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentResults'}}, + 'type': 'object'}, + 'UnitStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StatusResults'}}, + 'type': 'object'}, + 'UnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StorageAttachmentIdsResults'}}, + 'type': 'object'}, + 'UpdateSettings': {'properties': {'Params': {'$ref': '#/definitions/RelationUnitsSettings'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UpgradeSeriesUnitStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/UpgradeSeriesStatusResults'}}, + 'type': 'object'}, + 'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchActionNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchConfigSettingsHash': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchForModelConfigChanges': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + 'type': 'object'}, + 'WatchLeadershipSettings': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchMeterStatus': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchRelationUnits': {'properties': {'Params': {'$ref': '#/definitions/RelationUnits'}, + 'Result': {'$ref': '#/definitions/RelationUnitsWatchResults'}}, + 'type': 'object'}, + 'WatchStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/StorageAttachmentIds'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WatchTrustConfigSettingsHash': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitAddressesHash': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitRelations': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUnitStorageAttachments': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, + 'type': 'object'}, + 'WatchUpgradeSeriesNotifications': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, + 'type': 'object'}, + 'WorkloadVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}}, + 'type': 'object'} + + + @ReturnMapping(StringsResult) + async def APIAddresses(self): + ''' + + Returns -> StringsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIAddresses', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): + ''' + + Returns -> APIHostPortsResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='APIHostPorts', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ActionResults) + async def Actions(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddMetricBatches(self, batches=None): + ''' + 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=9, + params=_params) + _params['batches'] = batches + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def AddUnitStorage(self, storages=None): + ''' + storages : typing.Sequence[~StorageAddParams] + Returns -> ErrorResults + ''' + 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='Uniter', + request='AddUnitStorage', + version=9, + params=_params) + _params['storages'] = storages + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MachinePortsResults) + async def AllMachinePorts(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + Returns -> MachinePortsResults + ''' + if entities is not None and not isinstance(entities, (bytes, str, 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='AllMachinePorts', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ApplicationStatusResults) + async def ApplicationStatus(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ApplicationStatus', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AssignedMachine(self, entities=None): + ''' + 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='AssignedMachine', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def AvailabilityZone(self, entities=None): + ''' + 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='AvailabilityZone', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def BeginActions(self, entities=None): + ''' + 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='BeginActions', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def CharmArchiveSha256(self, urls=None): + ''' + 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='CharmArchiveSha256', + version=9, + params=_params) + _params['urls'] = urls + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(IntResults) + async def CharmModifiedVersion(self, entities=None): + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CharmModifiedVersion', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def CharmURL(self, entities=None): + ''' + 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='CharmURL', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClearResolved(self, entities=None): + ''' + 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='ClearResolved', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def ClosePorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='ClosePorts', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(CloudSpecResult) + async def CloudSpec(self): + ''' + + Returns -> CloudSpecResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CloudSpec', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ConfigSettingsResults) + async def ConfigSettings(self, entities=None): + ''' + entities : typing.Sequence[~Entity] + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ConfigSettings', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelResult) + async def CurrentModel(self): + ''' + + Returns -> ModelResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='CurrentModel', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Destroy(self, entities=None): + ''' + 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='Destroy', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyAllSubordinates(self, entities=None): + ''' + 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='DestroyAllSubordinates', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def DestroyUnitStorageAttachments(self, entities=None): + ''' + 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='DestroyUnitStorageAttachments', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnsureDead(self, entities=None): + ''' + 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='EnsureDead', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def EnterScope(self, relation_units=None): + ''' + 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='EnterScope', + version=9, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def FinishActions(self, results=None): + ''' + 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='FinishActions', + version=9, + params=_params) + _params['results'] = results + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(MeterStatusResults) + async def GetMeterStatus(self, entities=None): + ''' + 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='GetMeterStatus', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringBoolResults) + async def GetPrincipal(self, entities=None): + ''' + 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='GetPrincipal', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GoalStateResults) + async def GoalStates(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(BoolResults) + async def HasSubordinates(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def LeaveScope(self, relation_units=None): + ''' + 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=9, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def Life(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def Merge(self, params=None): + ''' + 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=9, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): + ''' + + Returns -> ModelConfigResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelConfig', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ModelUUID(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ModelUUID', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NetworkInfoResults) + async def NetworkInfo(self, bindings=None, relation_id=None, unit=None): + ''' + 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=9, + params=_params) + _params['bindings'] = bindings + _params['relation-id'] = relation_id + _params['unit'] = unit + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def OpenPorts(self, entities=None): + ''' + entities : typing.Sequence[~EntityPortRange] + 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='OpenPorts', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PrivateAddress(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def ProviderType(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='ProviderType', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def PublicAddress(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(GetLeadershipSettingsBulkResults) + async def Read(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadRemoteSettings(self, relation_unit_pairs=None): + ''' + 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=9, + params=_params) + _params['relation-unit-pairs'] = relation_unit_pairs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(SettingsResults) + async def ReadSettings(self, relation_units=None): + ''' + 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=9, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UnitRefreshResults) + async def Refresh(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def Relation(self, relation_units=None): + ''' + 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=9, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationResults) + async def RelationById(self, relation_ids=None): + ''' + 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=9, + params=_params) + _params['relation-ids'] = relation_ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitStatusResults) + async def RelationsStatus(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RemoveStorageAttachments(self, ids=None): + ''' + 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=9, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def RequestReboot(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ResolvedModeResults) + async def Resolved(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResult) + async def SLALevel(self): + ''' + + Returns -> StringResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='SLALevel', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetAgentStatus(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetApplicationStatus(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetCharmURL(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetPodSpec(self, specs=None): + ''' + 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='Uniter', + request='SetPodSpec', + version=9, + params=_params) + _params['specs'] = specs + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetRelationStatus(self, args=None): + ''' + 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=9, + params=_params) + _params['args'] = args + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUnitStatus(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetUpgradeSeriesUnitStatus(self, params=None): + ''' + 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=9, + params=_params) + _params['params'] = params + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def SetWorkloadVersion(self, entities=None): + ''' + 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='SetWorkloadVersion', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(LifeResults) + async def StorageAttachmentLife(self, ids=None): + ''' + ids : typing.Sequence[~StorageAttachmentId] + 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='Uniter', + request='StorageAttachmentLife', + version=9, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentResults) + async def StorageAttachments(self, ids=None): + ''' + 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='StorageAttachments', + version=9, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StatusResults) + async def UnitStatus(self, entities=None): + ''' + 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='Uniter', + request='UnitStatus', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StorageAttachmentIdsResults) + async def UnitStorageAttachments(self, entities=None): + ''' + 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))) + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='UnitStorageAttachments', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(ErrorResults) + async def UpdateSettings(self, relation_units=None): + ''' + relation_units : typing.Sequence[~RelationUnitSettings] + 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='UpdateSettings', + version=9, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(UpgradeSeriesStatusResults) + async def UpgradeSeriesUnitStatus(self, entities=None): + ''' + 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='Uniter', + request='UpgradeSeriesUnitStatus', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + 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='Watch', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchAPIHostPorts', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(self, entities=None): + ''' + 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='WatchActionNotifications', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchConfigSettingsHash(self, entities=None): + ''' + 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='WatchConfigSettingsHash', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): + ''' + + Returns -> NotifyWatchResult + ''' + + # map input types to rpc msg + _params = dict() + msg = dict(type='Uniter', + request='WatchForModelConfigChanges', + version=9, + params=_params) + + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchLeadershipSettings(self, entities=None): + ''' + 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='WatchLeadershipSettings', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchMeterStatus(self, entities=None): + ''' + 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='WatchMeterStatus', + version=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(RelationUnitsWatchResults) + async def WatchRelationUnits(self, relation_units=None): + ''' + 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=9, + params=_params) + _params['relation-units'] = relation_units + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchStorageAttachments(self, ids=None): + ''' + 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=9, + params=_params) + _params['ids'] = ids + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchTrustConfigSettingsHash(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitAddressesHash(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitRelations(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringsWatchResults) + async def WatchUnitStorageAttachments(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(NotifyWatchResults) + async def WatchUpgradeSeriesNotifications(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + + + @ReturnMapping(StringResults) + async def WorkloadVersion(self, entities=None): + ''' + 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=9, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply + + diff --git a/juju/client/old_clients/_definitions.py b/juju/client/old_clients/_definitions.py new file mode 100644 index 000000000..89d15c567 --- /dev/null +++ b/juju/client/old_clients/_definitions.py @@ -0,0 +1,29008 @@ +# 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 + + +class APIHostPortsResult(Type): + _toSchema = {'servers': 'servers'} + _toPy = {'servers': 'servers'} + def __init__(self, servers=None, **unknown_fields): + ''' + servers : typing.Sequence[~HostPort] + ''' + servers_ = [HostPort.from_json(o) for o in servers or []] + + # Validate arguments against known Juju API types. + if servers_ is not None and not isinstance(servers_, (bytes, str, list)): + raise Exception("Expected servers_ to be a Sequence, received: {}".format(type(servers_))) + + self.servers = servers_ + self.unknown_fields = unknown_fields + + + +class Action(Type): + _toSchema = {'name': 'name', 'parameters': 'parameters', 'receiver': 'receiver', 'tag': 'tag'} + _toPy = {'name': 'name', 'parameters': 'parameters', 'receiver': 'receiver', 'tag': 'tag'} + def __init__(self, name=None, parameters=None, receiver=None, tag=None, **unknown_fields): + ''' + name : str + parameters : typing.Mapping[str, typing.Any] + receiver : str + tag : str + ''' + name_ = name + parameters_ = parameters + receiver_ = receiver + tag_ = tag + + # Validate arguments against known Juju API types. + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if parameters_ is not None and not isinstance(parameters_, dict): + raise Exception("Expected parameters_ to be a Mapping, received: {}".format(type(parameters_))) + + if receiver_ is not None and not isinstance(receiver_, (bytes, str)): + raise Exception("Expected receiver_ to be a str, received: {}".format(type(receiver_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.name = name_ + self.parameters = parameters_ + self.receiver = receiver_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +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 + message : str + results : typing.Mapping[str, typing.Any] + status : str + ''' + action_tag_ = action_tag + message_ = message + results_ = results + status_ = status + + # Validate arguments against known Juju API types. + if action_tag_ is not None and not isinstance(action_tag_, (bytes, str)): + raise Exception("Expected action_tag_ to be a str, received: {}".format(type(action_tag_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if results_ is not None and not isinstance(results_, dict): + raise Exception("Expected results_ to be a Mapping, received: {}".format(type(results_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.action_tag = action_tag_ + self.message = message_ + self.results = results_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class ActionExecutionResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ActionExecutionResult] + ''' + results_ = [ActionExecutionResult.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 ActionMessage(Type): + _toSchema = {'message': 'message', 'timestamp': 'timestamp'} + _toPy = {'message': 'message', 'timestamp': 'timestamp'} + def __init__(self, message=None, timestamp=None, **unknown_fields): + ''' + message : str + timestamp : str + ''' + message_ = message + timestamp_ = timestamp + + # Validate arguments against known Juju API types. + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if timestamp_ is not None and not isinstance(timestamp_, (bytes, str)): + raise Exception("Expected timestamp_ to be a str, received: {}".format(type(timestamp_))) + + self.message = message_ + self.timestamp = timestamp_ + self.unknown_fields = unknown_fields + + + +class ActionMessageParams(Type): + _toSchema = {'messages': 'messages'} + _toPy = {'messages': 'messages'} + def __init__(self, messages=None, **unknown_fields): + ''' + messages : typing.Sequence[~EntityString] + ''' + messages_ = [EntityString.from_json(o) for o in messages or []] + + # Validate arguments against known Juju API types. + if messages_ is not None and not isinstance(messages_, (bytes, str, list)): + raise Exception("Expected messages_ to be a Sequence, received: {}".format(type(messages_))) + + self.messages = messages_ + self.unknown_fields = 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 + max_history_time : int + ''' + max_history_mb_ = max_history_mb + max_history_time_ = max_history_time + + # Validate arguments against known Juju API types. + 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_))) + + self.max_history_mb = max_history_mb_ + self.max_history_time = max_history_time_ + self.unknown_fields = 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 + completed : str + enqueued : str + error : Error + log : typing.Sequence[~ActionMessage] + message : str + output : typing.Mapping[str, typing.Any] + started : str + status : str + ''' + action_ = Action.from_json(action) if action else None + completed_ = completed + enqueued_ = enqueued + error_ = Error.from_json(error) if error else None + log_ = [ActionMessage.from_json(o) for o in log or []] + message_ = message + output_ = output + started_ = started + status_ = status + + # Validate arguments against known Juju API types. + if action_ is not None and not isinstance(action_, (dict, Action)): + raise Exception("Expected action_ to be a Action, received: {}".format(type(action_))) + + if completed_ is not None and not isinstance(completed_, (bytes, str)): + raise Exception("Expected completed_ to be a str, received: {}".format(type(completed_))) + + if enqueued_ is not None and not isinstance(enqueued_, (bytes, str)): + raise Exception("Expected enqueued_ to be a str, received: {}".format(type(enqueued_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if log_ is not None and not isinstance(log_, (bytes, str, list)): + raise Exception("Expected log_ to be a Sequence, received: {}".format(type(log_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if output_ is not None and not isinstance(output_, dict): + raise Exception("Expected output_ to be a Mapping, received: {}".format(type(output_))) + + if started_ is not None and not isinstance(started_, (bytes, str)): + raise Exception("Expected started_ to be a str, received: {}".format(type(started_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.action = action_ + self.completed = completed_ + self.enqueued = enqueued_ + self.error = error_ + self.log = log_ + self.message = message_ + self.output = output_ + self.started = started_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class ActionResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ActionResult] + ''' + results_ = [ActionResult.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 ActionSpec(Type): + _toSchema = {'description': 'description', 'params': 'params'} + _toPy = {'description': 'description', 'params': 'params'} + def __init__(self, description=None, params=None, **unknown_fields): + ''' + description : str + params : typing.Mapping[str, typing.Any] + ''' + description_ = description + params_ = params + + # Validate arguments against known Juju API types. + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if params_ is not None and not isinstance(params_, dict): + raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) + + self.description = description_ + self.params = params_ + self.unknown_fields = unknown_fields + + + +class Actions(Type): + _toSchema = {'actions': 'actions'} + _toPy = {'actions': 'actions'} + def __init__(self, actions=None, **unknown_fields): + ''' + actions : typing.Sequence[~Action] + ''' + actions_ = [Action.from_json(o) for o in actions or []] + + # Validate arguments against known Juju API types. + if actions_ is not None and not isinstance(actions_, (bytes, str, list)): + raise Exception("Expected actions_ to be a Sequence, received: {}".format(type(actions_))) + + self.actions = actions_ + self.unknown_fields = unknown_fields + + + +class ActionsByName(Type): + _toSchema = {'actions': 'actions', 'error': 'error', 'name': 'name'} + _toPy = {'actions': 'actions', 'error': 'error', 'name': 'name'} + def __init__(self, actions=None, error=None, name=None, **unknown_fields): + ''' + actions : typing.Sequence[~ActionResult] + error : Error + name : str + ''' + actions_ = [ActionResult.from_json(o) for o in actions or []] + error_ = Error.from_json(error) if error else None + name_ = name + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + self.actions = actions_ + self.error = error_ + self.name = name_ + self.unknown_fields = unknown_fields + + + +class ActionsByNames(Type): + _toSchema = {'actions': 'actions'} + _toPy = {'actions': 'actions'} + def __init__(self, actions=None, **unknown_fields): + ''' + actions : typing.Sequence[~ActionsByName] + ''' + actions_ = [ActionsByName.from_json(o) for o in actions or []] + + # Validate arguments against known Juju API types. + if actions_ is not None and not isinstance(actions_, (bytes, str, list)): + raise Exception("Expected actions_ to be a Sequence, received: {}".format(type(actions_))) + + self.actions = actions_ + self.unknown_fields = 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] + error : Error + receiver : str + ''' + actions_ = [ActionResult.from_json(o) for o in actions or []] + error_ = Error.from_json(error) if error else None + receiver_ = receiver + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if receiver_ is not None and not isinstance(receiver_, (bytes, str)): + raise Exception("Expected receiver_ to be a str, received: {}".format(type(receiver_))) + + self.actions = actions_ + self.error = error_ + self.receiver = receiver_ + self.unknown_fields = unknown_fields + + + +class ActionsByReceivers(Type): + _toSchema = {'actions': 'actions'} + _toPy = {'actions': 'actions'} + def __init__(self, actions=None, **unknown_fields): + ''' + actions : typing.Sequence[~ActionsByReceiver] + ''' + actions_ = [ActionsByReceiver.from_json(o) for o in actions or []] + + # Validate arguments against known Juju API types. + if actions_ is not None and not isinstance(actions_, (bytes, str, list)): + raise Exception("Expected actions_ to be a Sequence, received: {}".format(type(actions_))) + + self.actions = actions_ + self.unknown_fields = unknown_fields + + + +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 + application_name : str + endpoints : typing.Mapping[str, str] + model_tag : str + offer_name : str + owner_tag : str + ''' + application_description_ = application_description + application_name_ = application_name + endpoints_ = endpoints + model_tag_ = model_tag + offer_name_ = offer_name + owner_tag_ = owner_tag + + # 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 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 endpoints_ is not None and not isinstance(endpoints_, dict): + raise Exception("Expected endpoints_ to be a Mapping, received: {}".format(type(endpoints_))) + + 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 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 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_))) + + self.application_description = application_description_ + self.application_name = application_name_ + self.endpoints = endpoints_ + self.model_tag = model_tag_ + self.offer_name = offer_name_ + self.owner_tag = owner_tag_ + self.unknown_fields = unknown_fields + + + +class AddApplicationOffers(Type): + _toSchema = {'offers': 'Offers'} + _toPy = {'Offers': 'offers'} + def __init__(self, offers=None, **unknown_fields): + ''' + offers : typing.Sequence[~AddApplicationOffer] + ''' + offers_ = [AddApplicationOffer.from_json(o) for o in offers or []] + + # Validate arguments against known Juju API types. + if offers_ is not None and not isinstance(offers_, (bytes, str, list)): + raise Exception("Expected offers_ to be a Sequence, received: {}".format(type(offers_))) + + self.offers = offers_ + self.unknown_fields = 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 + attach_storage : typing.Sequence[str] + num_units : int + placement : typing.Sequence[~Placement] + policy : str + ''' + application_ = application + attach_storage_ = attach_storage + num_units_ = num_units + placement_ = [Placement.from_json(o) for o in placement or []] + policy_ = policy + + # Validate arguments against known Juju API types. + 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_))) + + self.application = application_ + self.attach_storage = attach_storage_ + self.num_units = num_units_ + self.placement = placement_ + self.policy = policy_ + self.unknown_fields = unknown_fields + + + +class AddApplicationUnitsResults(Type): + _toSchema = {'units': 'units'} + _toPy = {'units': 'units'} + def __init__(self, units=None, **unknown_fields): + ''' + units : typing.Sequence[str] + ''' + units_ = units + + # Validate arguments against known Juju API types. + if units_ is not None and not isinstance(units_, (bytes, str, list)): + raise Exception("Expected units_ to be a Sequence, received: {}".format(type(units_))) + + self.units = units_ + self.unknown_fields = unknown_fields + + + +class AddCharm(Type): + _toSchema = {'channel': 'channel', 'force': 'force', 'url': 'url'} + _toPy = {'channel': 'channel', 'force': 'force', 'url': 'url'} + def __init__(self, channel=None, force=None, url=None, **unknown_fields): + ''' + channel : str + force : bool + url : str + ''' + channel_ = channel + force_ = force + url_ = url + + # Validate arguments against known Juju API types. + 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 url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.channel = channel_ + self.force = force_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class AddCharmWithAuth(Type): + _toSchema = {'charm_origin': 'charm-origin', 'force': 'force', 'macaroon': 'macaroon', 'series': 'series', 'url': 'url'} + _toPy = {'charm-origin': 'charm_origin', 'force': 'force', 'macaroon': 'macaroon', 'series': 'series', 'url': 'url'} + def __init__(self, charm_origin=None, force=None, macaroon=None, series=None, url=None, **unknown_fields): + ''' + charm_origin : CharmOrigin + force : bool + macaroon : Macaroon + series : str + url : str + ''' + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + force_ = force + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + series_ = series + url_ = url + + # Validate arguments against known Juju API types. + 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 macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.charm_origin = charm_origin_ + self.force = force_ + self.macaroon = macaroon_ + self.series = series_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class AddCharmWithAuthorization(Type): + _toSchema = {'channel': 'channel', 'force': 'force', 'macaroon': 'macaroon', 'url': 'url'} + _toPy = {'channel': 'channel', 'force': 'force', 'macaroon': 'macaroon', 'url': 'url'} + def __init__(self, channel=None, force=None, macaroon=None, url=None, **unknown_fields): + ''' + channel : str + force : bool + macaroon : Macaroon + url : str + ''' + channel_ = channel + force_ = force + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + url_ = url + + # Validate arguments against known Juju API types. + 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 macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.channel = channel_ + self.force = force_ + self.macaroon = macaroon_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class AddCharmWithOrigin(Type): + _toSchema = {'charm_origin': 'charm-origin', 'force': 'force', 'series': 'series', 'url': 'url'} + _toPy = {'charm-origin': 'charm_origin', 'force': 'force', 'series': 'series', 'url': 'url'} + def __init__(self, charm_origin=None, force=None, series=None, url=None, **unknown_fields): + ''' + charm_origin : CharmOrigin + force : bool + series : str + url : str + ''' + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + force_ = force + series_ = series + url_ = url + + # Validate arguments against known Juju API types. + 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 series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.charm_origin = charm_origin_ + self.force = force_ + self.series = series_ + self.url = url_ + self.unknown_fields = 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 + force : bool + name : str + ''' + cloud_ = Cloud.from_json(cloud) if cloud else None + force_ = force + name_ = name + + # Validate arguments against known Juju API types. + 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_))) + + self.cloud = cloud_ + self.force = force_ + self.name = name_ + self.unknown_fields = unknown_fields + + + +class AddMachineParams(Type): + _toSchema = {'addresses': 'addresses', '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', 'series': 'series'} + _toPy = {'addresses': 'addresses', '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', 'series': 'series'} + def __init__(self, addresses=None, constraints=None, container_type=None, disks=None, hardware_characteristics=None, instance_id=None, jobs=None, nonce=None, parent_id=None, placement=None, series=None, **unknown_fields): + ''' + addresses : typing.Sequence[~Address] + constraints : Value + container_type : str + disks : typing.Sequence[~Constraints] + hardware_characteristics : HardwareCharacteristics + instance_id : str + jobs : typing.Sequence[str] + nonce : str + parent_id : str + placement : Placement + series : str + ''' + addresses_ = [Address.from_json(o) for o in addresses or []] + constraints_ = Value.from_json(constraints) if constraints else None + container_type_ = container_type + disks_ = [Constraints.from_json(o) for o in disks or []] + hardware_characteristics_ = HardwareCharacteristics.from_json(hardware_characteristics) if hardware_characteristics else None + instance_id_ = instance_id + jobs_ = jobs + nonce_ = nonce + parent_id_ = parent_id + placement_ = Placement.from_json(placement) if placement else None + series_ = series + + # Validate arguments against known Juju API types. + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if container_type_ is not None and not isinstance(container_type_, (bytes, str)): + raise Exception("Expected container_type_ to be a str, received: {}".format(type(container_type_))) + + if disks_ is not None and not isinstance(disks_, (bytes, str, list)): + raise Exception("Expected disks_ to be a Sequence, received: {}".format(type(disks_))) + + if hardware_characteristics_ is not None and not isinstance(hardware_characteristics_, (dict, HardwareCharacteristics)): + raise Exception("Expected hardware_characteristics_ to be a HardwareCharacteristics, received: {}".format(type(hardware_characteristics_))) + + if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): + raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) + + if jobs_ is not None and not isinstance(jobs_, (bytes, str, list)): + raise Exception("Expected jobs_ to be a Sequence, received: {}".format(type(jobs_))) + + if nonce_ is not None and not isinstance(nonce_, (bytes, str)): + raise Exception("Expected nonce_ to be a str, received: {}".format(type(nonce_))) + + if parent_id_ is not None and not isinstance(parent_id_, (bytes, str)): + raise Exception("Expected parent_id_ to be a str, received: {}".format(type(parent_id_))) + + if placement_ is not None and not isinstance(placement_, (dict, Placement)): + raise Exception("Expected placement_ to be a Placement, received: {}".format(type(placement_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + self.addresses = addresses_ + self.constraints = constraints_ + self.container_type = container_type_ + self.disks = disks_ + self.hardware_characteristics = hardware_characteristics_ + self.instance_id = instance_id_ + self.jobs = jobs_ + self.nonce = nonce_ + self.parent_id = parent_id_ + self.placement = placement_ + self.series = series_ + self.unknown_fields = unknown_fields + + + +class AddMachines(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~AddMachineParams] + ''' + params_ = [AddMachineParams.from_json(o) for o in params or []] + + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + + self.params = params_ + self.unknown_fields = 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 + machine : str + ''' + error_ = Error.from_json(error) if error else None + machine_ = machine + + # 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 machine_ is not None and not isinstance(machine_, (bytes, str)): + raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) + + self.error = error_ + self.machine = machine_ + self.unknown_fields = unknown_fields + + + +class AddMachinesResults(Type): + _toSchema = {'machines': 'machines'} + _toPy = {'machines': 'machines'} + def __init__(self, machines=None, **unknown_fields): + ''' + machines : typing.Sequence[~AddMachinesResult] + ''' + machines_ = [AddMachinesResult.from_json(o) for o in machines or []] + + # Validate arguments against known Juju API types. + if machines_ is not None and not isinstance(machines_, (bytes, str, list)): + raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + + self.machines = machines_ + self.unknown_fields = unknown_fields + + + +class AddPendingResourcesArgs(Type): + _toSchema = {'addcharmwithauthorization': 'AddCharmWithAuthorization', 'channel': 'channel', 'entity': 'Entity', 'force': 'force', 'macaroon': 'macaroon', 'resources': 'resources', 'tag': 'tag', 'url': 'url'} + _toPy = {'AddCharmWithAuthorization': 'addcharmwithauthorization', 'Entity': 'entity', 'channel': 'channel', 'force': 'force', 'macaroon': 'macaroon', 'resources': 'resources', 'tag': 'tag', 'url': 'url'} + def __init__(self, addcharmwithauthorization=None, entity=None, channel=None, force=None, macaroon=None, resources=None, tag=None, url=None, **unknown_fields): + ''' + addcharmwithauthorization : AddCharmWithAuthorization + entity : Entity + channel : str + force : bool + macaroon : Macaroon + resources : typing.Sequence[~CharmResource] + tag : str + url : str + ''' + addcharmwithauthorization_ = AddCharmWithAuthorization.from_json(addcharmwithauthorization) if addcharmwithauthorization else None + entity_ = Entity.from_json(entity) if entity else None + channel_ = channel + force_ = force + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + resources_ = [CharmResource.from_json(o) for o in resources or []] + tag_ = tag + url_ = url + + # Validate arguments against known Juju API types. + if addcharmwithauthorization_ is not None and not isinstance(addcharmwithauthorization_, (dict, AddCharmWithAuthorization)): + raise Exception("Expected addcharmwithauthorization_ to be a AddCharmWithAuthorization, received: {}".format(type(addcharmwithauthorization_))) + + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) + + 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 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_))) + + self.addcharmwithauthorization = addcharmwithauthorization_ + self.entity = entity_ + self.channel = channel_ + self.force = force_ + self.macaroon = macaroon_ + self.resources = resources_ + self.tag = tag_ + self.url = url_ + self.unknown_fields = 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 + charm_origin : CharmOrigin + macaroon : Macaroon + resources : typing.Sequence[~CharmResource] + tag : str + url : str + ''' + entity_ = Entity.from_json(entity) if entity else None + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + resources_ = [CharmResource.from_json(o) for o in resources or []] + tag_ = tag + url_ = url + + # Validate arguments against known Juju API types. + 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_))) + + self.entity = entity_ + self.charm_origin = charm_origin_ + self.macaroon = macaroon_ + self.resources = resources_ + self.tag = tag_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +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 + error : Error + pending_ids : typing.Sequence[str] + ''' + errorresult_ = ErrorResult.from_json(errorresult) if errorresult else None + error_ = Error.from_json(error) if error else None + pending_ids_ = pending_ids + + # Validate arguments against known Juju API types. + if errorresult_ is not None and not isinstance(errorresult_, (dict, ErrorResult)): + raise Exception("Expected errorresult_ to be a ErrorResult, received: {}".format(type(errorresult_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if pending_ids_ is not None and not isinstance(pending_ids_, (bytes, str, list)): + raise Exception("Expected pending_ids_ to be a Sequence, received: {}".format(type(pending_ids_))) + + self.errorresult = errorresult_ + self.error = error_ + self.pending_ids = pending_ids_ + self.unknown_fields = unknown_fields + + + +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] + via_cidrs : typing.Sequence[str] + ''' + endpoints_ = endpoints + via_cidrs_ = via_cidrs + + # Validate arguments against known Juju API types. + 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_))) + + self.endpoints = endpoints_ + self.via_cidrs = via_cidrs_ + self.unknown_fields = unknown_fields + + + +class AddRelationResults(Type): + _toSchema = {'endpoints': 'endpoints'} + _toPy = {'endpoints': 'endpoints'} + def __init__(self, endpoints=None, **unknown_fields): + ''' + endpoints : typing.Mapping[str, ~CharmRelation] + ''' + endpoints_ = {k: CharmRelation.from_json(v) for k, v in (endpoints or dict()).items()} + + # Validate arguments against known Juju API types. + if endpoints_ is not None and not isinstance(endpoints_, dict): + raise Exception("Expected endpoints_ to be a Mapping, received: {}".format(type(endpoints_))) + + self.endpoints = endpoints_ + self.unknown_fields = 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] + ''' + storage_tags_ = storage_tags + + # Validate arguments against known Juju API types. + if storage_tags_ is not None and not isinstance(storage_tags_, (bytes, str, list)): + raise Exception("Expected storage_tags_ to be a Sequence, received: {}".format(type(storage_tags_))) + + self.storage_tags = storage_tags_ + self.unknown_fields = 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 + result : AddStorageDetails + ''' + error_ = Error.from_json(error) if error else None + result_ = AddStorageDetails.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, AddStorageDetails)): + raise Exception("Expected result_ to be a AddStorageDetails, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class AddStorageResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~AddStorageResult] + ''' + results_ = [AddStorageResult.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 AddSubnetParams(Type): + _toSchema = {'cidr': 'cidr', 'provider_network_id': 'provider-network-id', 'space_tag': 'space-tag', 'subnet_provider_id': 'subnet-provider-id', 'vlan_tag': 'vlan-tag', 'zones': 'zones'} + _toPy = {'cidr': 'cidr', 'provider-network-id': 'provider_network_id', 'space-tag': 'space_tag', 'subnet-provider-id': 'subnet_provider_id', 'vlan-tag': 'vlan_tag', 'zones': 'zones'} + def __init__(self, cidr=None, provider_network_id=None, space_tag=None, subnet_provider_id=None, vlan_tag=None, zones=None, **unknown_fields): + ''' + cidr : str + provider_network_id : str + space_tag : str + subnet_provider_id : str + vlan_tag : int + zones : typing.Sequence[str] + ''' + cidr_ = cidr + provider_network_id_ = provider_network_id + space_tag_ = space_tag + subnet_provider_id_ = subnet_provider_id + vlan_tag_ = vlan_tag + zones_ = zones + + # Validate arguments against known Juju API types. + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + + if provider_network_id_ is not None and not isinstance(provider_network_id_, (bytes, str)): + raise Exception("Expected provider_network_id_ to be a str, received: {}".format(type(provider_network_id_))) + + 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 subnet_provider_id_ is not None and not isinstance(subnet_provider_id_, (bytes, str)): + raise Exception("Expected subnet_provider_id_ to be a str, received: {}".format(type(subnet_provider_id_))) + + if vlan_tag_ is not None and not isinstance(vlan_tag_, int): + raise Exception("Expected vlan_tag_ to be a int, received: {}".format(type(vlan_tag_))) + + if zones_ is not None and not isinstance(zones_, (bytes, str, list)): + raise Exception("Expected zones_ to be a Sequence, received: {}".format(type(zones_))) + + self.cidr = cidr_ + self.provider_network_id = provider_network_id_ + self.space_tag = space_tag_ + self.subnet_provider_id = subnet_provider_id_ + self.vlan_tag = vlan_tag_ + self.zones = zones_ + self.unknown_fields = unknown_fields + + + +class AddSubnetsParams(Type): + _toSchema = {'subnets': 'subnets'} + _toPy = {'subnets': 'subnets'} + def __init__(self, subnets=None, **unknown_fields): + ''' + subnets : typing.Sequence[~AddSubnetParams] + ''' + subnets_ = [AddSubnetParams.from_json(o) for o in subnets or []] + + # Validate arguments against known Juju API types. + if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): + raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) + + self.subnets = subnets_ + self.unknown_fields = 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 + password : str + username : str + ''' + display_name_ = display_name + password_ = password + username_ = username + + # Validate arguments against known Juju API types. + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if password_ is not None and not isinstance(password_, (bytes, str)): + raise Exception("Expected password_ to be a str, received: {}".format(type(password_))) + + if username_ is not None and not isinstance(username_, (bytes, str)): + raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) + + self.display_name = display_name_ + self.password = password_ + self.username = username_ + self.unknown_fields = unknown_fields + + + +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 + secret_key : typing.Sequence[int] + tag : str + ''' + error_ = Error.from_json(error) if error else None + secret_key_ = secret_key + tag_ = tag + + # 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 secret_key_ is not None and not isinstance(secret_key_, (bytes, str, list)): + raise Exception("Expected secret_key_ to be a Sequence, received: {}".format(type(secret_key_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.error = error_ + self.secret_key = secret_key_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class AddUserResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~AddUserResult] + ''' + results_ = [AddUserResult.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 AddUsers(Type): + _toSchema = {'users': 'users'} + _toPy = {'users': 'users'} + def __init__(self, users=None, **unknown_fields): + ''' + users : typing.Sequence[~AddUser] + ''' + users_ = [AddUser.from_json(o) for o in users or []] + + # Validate arguments against known Juju API types. + 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.users = users_ + self.unknown_fields = 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 + config_type : str + is_secondary : bool + scope : str + space_id : str + space_name : str + type_ : str + value : str + ''' + cidr_ = cidr + config_type_ = config_type + is_secondary_ = is_secondary + scope_ = scope + space_id_ = space_id + space_name_ = space_name + type__ = type_ + value_ = value + + # Validate arguments against known Juju API types. + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + + if config_type_ is not None and not isinstance(config_type_, (bytes, str)): + raise Exception("Expected config_type_ to be a str, received: {}".format(type(config_type_))) + + if is_secondary_ is not None and not isinstance(is_secondary_, bool): + raise Exception("Expected is_secondary_ to be a bool, received: {}".format(type(is_secondary_))) + + if scope_ is not None and not isinstance(scope_, (bytes, str)): + raise Exception("Expected scope_ to be a str, received: {}".format(type(scope_))) + + if space_id_ is not None and not isinstance(space_id_, (bytes, str)): + raise Exception("Expected space_id_ to be a str, received: {}".format(type(space_id_))) + + if space_name_ is not None and not isinstance(space_name_, (bytes, str)): + raise Exception("Expected space_name_ to be a str, received: {}".format(type(space_name_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if value_ is not None and not isinstance(value_, (bytes, str)): + raise Exception("Expected value_ to be a str, received: {}".format(type(value_))) + + self.cidr = cidr_ + self.config_type = config_type_ + self.is_secondary = is_secondary_ + self.scope = scope_ + self.space_id = space_id_ + self.space_name = space_name_ + self.type_ = type__ + self.value = value_ + self.unknown_fields = unknown_fields + + + +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 + source_controller_version : Number + ''' + model_tag_ = model_tag + source_controller_version_ = Number.from_json(source_controller_version) if source_controller_version else None + + # Validate arguments against known Juju API types. + 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_))) + + self.model_tag = model_tag_ + self.source_controller_version = source_controller_version_ + self.unknown_fields = unknown_fields + + + +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 + error : Error + jobs : typing.Sequence[str] + life : str + ''' + container_type_ = container_type + error_ = Error.from_json(error) if error else None + jobs_ = jobs + life_ = life + + # Validate arguments against known Juju API types. + if container_type_ is not None and not isinstance(container_type_, (bytes, str)): + raise Exception("Expected container_type_ to be a str, received: {}".format(type(container_type_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if jobs_ is not None and not isinstance(jobs_, (bytes, str, list)): + raise Exception("Expected jobs_ to be a Sequence, received: {}".format(type(jobs_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + self.container_type = container_type_ + self.error = error_ + self.jobs = jobs_ + self.life = life_ + self.unknown_fields = unknown_fields + + + +class AgentGetEntitiesResults(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): + ''' + entities : typing.Sequence[~AgentGetEntitiesResult] + ''' + entities_ = [AgentGetEntitiesResult.from_json(o) for o in entities or []] + + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + + self.entities = entities_ + self.unknown_fields = unknown_fields + + + +class AgentVersionResult(Type): + _toSchema = {'version': 'version'} + _toPy = {'version': 'version'} + def __init__(self, version=None, **unknown_fields): + ''' + version : Number + ''' + version_ = Number.from_json(version) if version else None + + # Validate arguments against known Juju API types. + if version_ is not None and not isinstance(version_, (dict, Number)): + raise Exception("Expected version_ to be a Number, received: {}".format(type(version_))) + + self.version = version_ + self.unknown_fields = 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 + ''' + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class AllWatcherNextResults(Type): + _toSchema = {'deltas': 'deltas'} + _toPy = {'deltas': 'deltas'} + def __init__(self, deltas=None, **unknown_fields): + ''' + deltas : typing.Sequence[~Delta] + ''' + deltas_ = [Delta.from_json(o) for o in deltas or []] + + # Validate arguments against known Juju API types. + if deltas_ is not None and not isinstance(deltas_, (bytes, str, list)): + raise Exception("Expected deltas_ to be a Sequence, received: {}".format(type(deltas_))) + + self.deltas = deltas_ + self.unknown_fields = 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] + entity : str + error : ErrorResult + ''' + annotations_ = annotations + entity_ = entity + error_ = ErrorResult.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if annotations_ is not None and not isinstance(annotations_, dict): + raise Exception("Expected annotations_ to be a Mapping, received: {}".format(type(annotations_))) + + if entity_ is not None and not isinstance(entity_, (bytes, str)): + raise Exception("Expected entity_ to be a str, received: {}".format(type(entity_))) + + if error_ is not None and not isinstance(error_, (dict, ErrorResult)): + raise Exception("Expected error_ to be a ErrorResult, received: {}".format(type(error_))) + + self.annotations = annotations_ + self.entity = entity_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class AnnotationsGetResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~AnnotationsGetResult] + ''' + results_ = [AnnotationsGetResult.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 AnnotationsSet(Type): + _toSchema = {'annotations': 'annotations'} + _toPy = {'annotations': 'annotations'} + def __init__(self, annotations=None, **unknown_fields): + ''' + annotations : typing.Sequence[~EntityAnnotations] + ''' + annotations_ = [EntityAnnotations.from_json(o) for o in annotations or []] + + # Validate arguments against known Juju API types. + if annotations_ is not None and not isinstance(annotations_, (bytes, str, list)): + raise Exception("Expected annotations_ to be a Sequence, received: {}".format(type(annotations_))) + + self.annotations = annotations_ + self.unknown_fields = 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 + deployment_mode : str + force_upgrade : bool + sha256 : str + url : str + ''' + charm_modified_version_ = charm_modified_version + deployment_mode_ = deployment_mode + force_upgrade_ = force_upgrade + sha256_ = sha256 + url_ = url + + # Validate arguments against known Juju API types. + if charm_modified_version_ is not None and not isinstance(charm_modified_version_, int): + raise Exception("Expected charm_modified_version_ to be a int, received: {}".format(type(charm_modified_version_))) + + if deployment_mode_ is not None and not isinstance(deployment_mode_, (bytes, str)): + raise Exception("Expected deployment_mode_ to be a str, received: {}".format(type(deployment_mode_))) + + if force_upgrade_ is not None and not isinstance(force_upgrade_, bool): + raise Exception("Expected force_upgrade_ to be a bool, received: {}".format(type(force_upgrade_))) + + if sha256_ is not None and not isinstance(sha256_, (bytes, str)): + raise Exception("Expected sha256_ to be a str, received: {}".format(type(sha256_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.charm_modified_version = charm_modified_version_ + self.deployment_mode = deployment_mode_ + self.force_upgrade = force_upgrade_ + self.sha256 = sha256_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +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] + application_tag : str + error : Error + ''' + actions_ = {k: ActionSpec.from_json(v) for k, v in (actions or dict()).items()} + application_tag_ = application_tag + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if actions_ is not None and not isinstance(actions_, dict): + raise Exception("Expected actions_ to be a Mapping, received: {}".format(type(actions_))) + + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.actions = actions_ + self.application_tag = application_tag_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +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 + charm_url : str + ''' + application_ = application + charm_url_ = charm_url + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + 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_))) + + self.application = application_ + self.charm_url = charm_url_ + self.unknown_fields = unknown_fields + + + +class ApplicationCharmPlacements(Type): + _toSchema = {'placements': 'placements'} + _toPy = {'placements': 'placements'} + def __init__(self, placements=None, **unknown_fields): + ''' + placements : typing.Sequence[~ApplicationCharmPlacement] + ''' + placements_ = [ApplicationCharmPlacement.from_json(o) for o in placements or []] + + # Validate arguments against known Juju API types. + if placements_ is not None and not isinstance(placements_, (bytes, str, list)): + raise Exception("Expected placements_ to be a Sequence, received: {}".format(type(placements_))) + + self.placements = placements_ + self.unknown_fields = unknown_fields + + + +class ApplicationCharmRelations(Type): + _toSchema = {'application': 'application'} + _toPy = {'application': 'application'} + def __init__(self, application=None, **unknown_fields): + ''' + application : str + ''' + application_ = application + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + self.application = application_ + self.unknown_fields = 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] + ''' + charm_relations_ = charm_relations + + # Validate arguments against known Juju API types. + if charm_relations_ is not None and not isinstance(charm_relations_, (bytes, str, list)): + raise Exception("Expected charm_relations_ to be a Sequence, received: {}".format(type(charm_relations_))) + + self.charm_relations = charm_relations_ + self.unknown_fields = 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 + result : ApplicationCharm + ''' + error_ = Error.from_json(error) if error else None + result_ = ApplicationCharm.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, ApplicationCharm)): + raise Exception("Expected result_ to be a ApplicationCharm, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ApplicationCharmResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ApplicationCharmResult] + ''' + results_ = [ApplicationCharmResult.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 ApplicationConfigSet(Type): + _toSchema = {'application': 'application', 'config': 'config', 'generation': 'generation'} + _toPy = {'application': 'application', 'config': 'config', 'generation': 'generation'} + def __init__(self, application=None, config=None, generation=None, **unknown_fields): + ''' + application : str + config : typing.Mapping[str, str] + generation : str + ''' + application_ = application + config_ = config + generation_ = generation + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if generation_ is not None and not isinstance(generation_, (bytes, str)): + raise Exception("Expected generation_ to be a str, received: {}".format(type(generation_))) + + self.application = application_ + self.config = config_ + self.generation = generation_ + self.unknown_fields = unknown_fields + + + +class ApplicationConfigSetArgs(Type): + _toSchema = {'args': 'Args'} + _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~ApplicationConfigSet] + ''' + args_ = [ApplicationConfigSet.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 ApplicationConfigUnsetArgs(Type): + _toSchema = {'args': 'Args'} + _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~ApplicationUnset] + ''' + args_ = [ApplicationUnset.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 ApplicationConstraint(Type): + _toSchema = {'constraints': 'constraints', 'error': 'error'} + _toPy = {'constraints': 'constraints', 'error': 'error'} + def __init__(self, constraints=None, error=None, **unknown_fields): + ''' + constraints : Value + error : Error + ''' + constraints_ = Value.from_json(constraints) if constraints else None + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.constraints = constraints_ + self.error = error_ + self.unknown_fields = 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', 'series': 'series', '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', 'series': 'series', '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, series=None, storage=None, **unknown_fields): + ''' + force : bool + application : str + attach_storage : typing.Sequence[str] + channel : str + charm_origin : CharmOrigin + charm_url : str + config : typing.Mapping[str, str] + config_yaml : str + constraints : Value + devices : typing.Mapping[str, ~Constraints] + endpoint_bindings : typing.Mapping[str, str] + num_units : int + placement : typing.Sequence[~Placement] + policy : str + resources : typing.Mapping[str, str] + series : str + storage : typing.Mapping[str, ~Constraints] + ''' + force_ = force + application_ = application + attach_storage_ = attach_storage + channel_ = channel + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + charm_url_ = charm_url + config_ = config + config_yaml_ = config_yaml + constraints_ = Value.from_json(constraints) if constraints else None + devices_ = {k: Constraints.from_json(v) for k, v in (devices or dict()).items()} + endpoint_bindings_ = endpoint_bindings + num_units_ = num_units + placement_ = [Placement.from_json(o) for o in placement or []] + policy_ = policy + resources_ = resources + series_ = series + storage_ = {k: Constraints.from_json(v) for k, v in (storage or dict()).items()} + + # Validate arguments against known Juju API types. + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + 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 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_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if config_yaml_ is not None and not isinstance(config_yaml_, (bytes, str)): + raise Exception("Expected config_yaml_ to be a str, received: {}".format(type(config_yaml_))) + + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if devices_ is not None and not isinstance(devices_, dict): + raise Exception("Expected devices_ to be a Mapping, received: {}".format(type(devices_))) + + 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 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_))) + + if resources_ is not None and not isinstance(resources_, dict): + raise Exception("Expected resources_ to be a Mapping, received: {}".format(type(resources_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if storage_ is not None and not isinstance(storage_, dict): + raise Exception("Expected storage_ to be a Mapping, received: {}".format(type(storage_))) + + self.force = force_ + self.application = application_ + self.attach_storage = attach_storage_ + self.channel = channel_ + self.charm_origin = charm_origin_ + self.charm_url = charm_url_ + self.config = config_ + self.config_yaml = config_yaml_ + self.constraints = constraints_ + self.devices = devices_ + self.endpoint_bindings = endpoint_bindings_ + self.num_units = num_units_ + self.placement = placement_ + self.policy = policy_ + self.resources = resources_ + self.series = series_ + self.storage = storage_ + self.unknown_fields = unknown_fields + + + +class ApplicationDestroy(Type): + _toSchema = {'application': 'application'} + _toPy = {'application': 'application'} + def __init__(self, application=None, **unknown_fields): + ''' + application : str + ''' + application_ = application + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + self.application = application_ + self.unknown_fields = unknown_fields + + + +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 + exposed_endpoints : typing.Mapping[str, ~ExposedEndpoint] + ''' + application_ = application + exposed_endpoints_ = {k: ExposedEndpoint.from_json(v) for k, v in (exposed_endpoints or dict()).items()} + + # Validate arguments against known Juju API types. + 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_))) + + self.application = application_ + self.exposed_endpoints = exposed_endpoints_ + self.unknown_fields = 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 + branch : str + ''' + application_ = application + branch_ = branch + + # Validate arguments against known Juju API types. + 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_))) + + self.application = application_ + self.branch = branch_ + self.unknown_fields = unknown_fields + + + +class ApplicationGetArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~ApplicationGet] + ''' + args_ = [ApplicationGet.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 ApplicationGetConfigResults(Type): + _toSchema = {'results': 'Results'} + _toPy = {'Results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ConfigResult] + ''' + results_ = [ConfigResult.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 ApplicationGetConstraintsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ApplicationConstraint] + ''' + results_ = [ApplicationConstraint.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 ApplicationGetResults(Type): + _toSchema = {'application': 'application', 'application_config': 'application-config', 'channel': 'channel', 'charm': 'charm', 'config': 'config', 'constraints': 'constraints', 'endpoint_bindings': 'endpoint-bindings', 'series': 'series'} + _toPy = {'application': 'application', 'application-config': 'application_config', 'channel': 'channel', 'charm': 'charm', 'config': 'config', 'constraints': 'constraints', 'endpoint-bindings': 'endpoint_bindings', 'series': 'series'} + def __init__(self, application=None, application_config=None, channel=None, charm=None, config=None, constraints=None, endpoint_bindings=None, series=None, **unknown_fields): + ''' + application : str + application_config : typing.Mapping[str, typing.Any] + channel : str + charm : str + config : typing.Mapping[str, typing.Any] + constraints : Value + endpoint_bindings : typing.Mapping[str, str] + series : str + ''' + application_ = application + application_config_ = application_config + channel_ = channel + charm_ = charm + config_ = config + constraints_ = Value.from_json(constraints) if constraints else None + endpoint_bindings_ = endpoint_bindings + series_ = series + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + if application_config_ is not None and not isinstance(application_config_, dict): + raise Exception("Expected application_config_ to be a Mapping, received: {}".format(type(application_config_))) + + 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_ is not None and not isinstance(charm_, (bytes, str)): + raise Exception("Expected charm_ to be a str, received: {}".format(type(charm_))) + + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + 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 series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + self.application = application_ + self.application_config = application_config_ + self.channel = channel_ + self.charm = charm_ + self.config = config_ + self.constraints = constraints_ + self.endpoint_bindings = endpoint_bindings_ + self.series = series_ + self.unknown_fields = unknown_fields + + + +class ApplicationInfo(Type): + _toSchema = {'channel': 'channel', 'charm': 'charm', 'constraints': 'constraints', 'endpoint_bindings': 'endpoint-bindings', 'exposed': 'exposed', 'principal': 'principal', 'remote': 'remote', 'series': 'series', 'tag': 'tag'} + _toPy = {'channel': 'channel', 'charm': 'charm', 'constraints': 'constraints', 'endpoint-bindings': 'endpoint_bindings', 'exposed': 'exposed', 'principal': 'principal', 'remote': 'remote', 'series': 'series', 'tag': 'tag'} + def __init__(self, channel=None, charm=None, constraints=None, endpoint_bindings=None, exposed=None, principal=None, remote=None, series=None, tag=None, **unknown_fields): + ''' + channel : str + charm : str + constraints : Value + endpoint_bindings : typing.Mapping[str, str] + exposed : bool + principal : bool + remote : bool + series : str + tag : str + ''' + channel_ = channel + charm_ = charm + constraints_ = Value.from_json(constraints) if constraints else None + endpoint_bindings_ = endpoint_bindings + exposed_ = exposed + principal_ = principal + remote_ = remote + series_ = series + tag_ = tag + + # Validate arguments against known Juju API types. + 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_ is not None and not isinstance(charm_, (bytes, str)): + raise Exception("Expected charm_ to be a str, received: {}".format(type(charm_))) + + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + 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 exposed_ is not None and not isinstance(exposed_, bool): + raise Exception("Expected exposed_ to be a bool, received: {}".format(type(exposed_))) + + if principal_ is not None and not isinstance(principal_, bool): + raise Exception("Expected principal_ to be a bool, received: {}".format(type(principal_))) + + if remote_ is not None and not isinstance(remote_, bool): + raise Exception("Expected remote_ to be a bool, received: {}".format(type(remote_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.channel = channel_ + self.charm = charm_ + self.constraints = constraints_ + self.endpoint_bindings = endpoint_bindings_ + self.exposed = exposed_ + self.principal = principal_ + self.remote = remote_ + self.series = series_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class ApplicationInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ApplicationResult + ''' + error_ = Error.from_json(error) if error else None + result_ = ApplicationResult.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, ApplicationResult)): + raise Exception("Expected result_ to be a ApplicationResult, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ApplicationInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ApplicationInfoResult] + ''' + results_ = [ApplicationInfoResult.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 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 + bindings : typing.Mapping[str, str] + force : bool + ''' + application_tag_ = application_tag + bindings_ = bindings + force_ = force + + # Validate arguments against known Juju API types. + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) + + if bindings_ is not None and not isinstance(bindings_, dict): + raise Exception("Expected bindings_ to be a Mapping, received: {}".format(type(bindings_))) + + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + self.application_tag = application_tag_ + self.bindings = bindings_ + self.force = force_ + self.unknown_fields = unknown_fields + + + +class ApplicationMergeBindingsArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~ApplicationMergeBindings] + ''' + args_ = [ApplicationMergeBindings.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 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 + metrics_credentials : typing.Sequence[int] + ''' + application_ = application + metrics_credentials_ = metrics_credentials + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + if metrics_credentials_ is not None and not isinstance(metrics_credentials_, (bytes, str, list)): + raise Exception("Expected metrics_credentials_ to be a Sequence, received: {}".format(type(metrics_credentials_))) + + self.application = application_ + self.metrics_credentials = metrics_credentials_ + self.unknown_fields = unknown_fields + + + +class ApplicationMetricCredentials(Type): + _toSchema = {'creds': 'creds'} + _toPy = {'creds': 'creds'} + def __init__(self, creds=None, **unknown_fields): + ''' + creds : typing.Sequence[~ApplicationMetricCredential] + ''' + creds_ = [ApplicationMetricCredential.from_json(o) for o in creds or []] + + # Validate arguments against known Juju API types. + if creds_ is not None and not isinstance(creds_, (bytes, str, list)): + raise Exception("Expected creds_ to be a Sequence, received: {}".format(type(creds_))) + + self.creds = creds_ + self.unknown_fields = unknown_fields + + + +class ApplicationOffer(Type): + _toSchema = {'access': 'access', 'application_description': 'application-description', 'bindings': 'bindings', 'endpoints': 'endpoints', 'offer_name': 'offer-name', 'offer_url': 'offer-url', 'source_model_tag': 'source-model-tag', 'spaces': 'spaces'} + _toPy = {'access': 'access', 'application-description': 'application_description', 'bindings': 'bindings', 'endpoints': 'endpoints', 'offer-name': 'offer_name', 'offer-url': 'offer_url', 'source-model-tag': 'source_model_tag', 'spaces': 'spaces'} + def __init__(self, access=None, application_description=None, bindings=None, endpoints=None, offer_name=None, offer_url=None, source_model_tag=None, spaces=None, **unknown_fields): + ''' + access : str + application_description : str + bindings : typing.Mapping[str, str] + endpoints : typing.Sequence[~RemoteEndpoint] + offer_name : str + offer_url : str + source_model_tag : str + spaces : typing.Sequence[~RemoteSpace] + ''' + access_ = access + application_description_ = application_description + bindings_ = bindings + endpoints_ = [RemoteEndpoint.from_json(o) for o in endpoints or []] + offer_name_ = offer_name + offer_url_ = offer_url + source_model_tag_ = source_model_tag + spaces_ = [RemoteSpace.from_json(o) for o in spaces or []] + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + 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 bindings_ is not None and not isinstance(bindings_, dict): + raise Exception("Expected bindings_ to be a Mapping, received: {}".format(type(bindings_))) + + 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 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 spaces_ is not None and not isinstance(spaces_, (bytes, str, list)): + raise Exception("Expected spaces_ to be a Sequence, received: {}".format(type(spaces_))) + + self.access = access_ + self.application_description = application_description_ + self.bindings = bindings_ + self.endpoints = endpoints_ + self.offer_name = offer_name_ + self.offer_url = offer_url_ + self.source_model_tag = source_model_tag_ + self.spaces = spaces_ + self.unknown_fields = 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 + application_description : str + application_name : str + bindings : typing.Mapping[str, 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 + spaces : typing.Sequence[~RemoteSpace] + users : typing.Sequence[~OfferUserDetails] + ''' + applicationofferdetails_ = ApplicationOfferDetails.from_json(applicationofferdetails) if applicationofferdetails else None + application_description_ = application_description + application_name_ = application_name + bindings_ = bindings + 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 + spaces_ = [RemoteSpace.from_json(o) for o in spaces or []] + users_ = [OfferUserDetails.from_json(o) for o in users or []] + + # Validate arguments against known Juju API types. + if applicationofferdetails_ is not None and not isinstance(applicationofferdetails_, (dict, ApplicationOfferDetails)): + raise Exception("Expected applicationofferdetails_ to be a ApplicationOfferDetails, received: {}".format(type(applicationofferdetails_))) + + 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 bindings_ is not None and not isinstance(bindings_, dict): + raise Exception("Expected bindings_ to be a Mapping, received: {}".format(type(bindings_))) + + 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 spaces_ is not None and not isinstance(spaces_, (bytes, str, list)): + raise Exception("Expected spaces_ to be a Sequence, received: {}".format(type(spaces_))) + + 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.applicationofferdetails = applicationofferdetails_ + self.application_description = application_description_ + self.application_name = application_name_ + self.bindings = bindings_ + 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.spaces = spaces_ + 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'} + 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 + bindings : typing.Mapping[str, str] + endpoints : typing.Sequence[~RemoteEndpoint] + offer_name : str + offer_url : str + offer_uuid : str + source_model_tag : str + spaces : typing.Sequence[~RemoteSpace] + users : typing.Sequence[~OfferUserDetails] + ''' + application_description_ = application_description + bindings_ = bindings + 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 + spaces_ = [RemoteSpace.from_json(o) for o in spaces or []] + 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 bindings_ is not None and not isinstance(bindings_, dict): + raise Exception("Expected bindings_ to be a Mapping, received: {}".format(type(bindings_))) + + 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 spaces_ is not None and not isinstance(spaces_, (bytes, str, list)): + raise Exception("Expected spaces_ to be a Sequence, received: {}".format(type(spaces_))) + + 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.bindings = bindings_ + 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.spaces = spaces_ + 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 + ''' + error_ = Error.from_json(error) if error else None + result_ = ApplicationOfferAdminDetails.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_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = 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 + application_name : str + charm : str + endpoints : typing.Mapping[str, ~RemoteEndpoint] + err : Error + offer_name : str + total_connected_count : int + ''' + active_connected_count_ = active_connected_count + application_name_ = application_name + charm_ = charm + endpoints_ = {k: RemoteEndpoint.from_json(v) for k, v in (endpoints or dict()).items()} + err_ = Error.from_json(err) if err else None + offer_name_ = offer_name + total_connected_count_ = total_connected_count + + # Validate arguments against known Juju API types. + if active_connected_count_ is not None and not isinstance(active_connected_count_, int): + raise Exception("Expected active_connected_count_ to be a int, received: {}".format(type(active_connected_count_))) + + 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_ is not None and not isinstance(charm_, (bytes, str)): + raise Exception("Expected charm_ to be a str, received: {}".format(type(charm_))) + + if endpoints_ is not None and not isinstance(endpoints_, dict): + raise Exception("Expected endpoints_ to be a Mapping, received: {}".format(type(endpoints_))) + + if err_ is not None and not isinstance(err_, (dict, Error)): + raise Exception("Expected err_ to be a Error, received: {}".format(type(err_))) + + 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 total_connected_count_ is not None and not isinstance(total_connected_count_, int): + raise Exception("Expected total_connected_count_ to be a int, received: {}".format(type(total_connected_count_))) + + self.active_connected_count = active_connected_count_ + self.application_name = application_name_ + self.charm = charm_ + self.endpoints = endpoints_ + self.err = err_ + self.offer_name = offer_name_ + self.total_connected_count = total_connected_count_ + self.unknown_fields = unknown_fields + + + +class ApplicationOffersResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ApplicationOfferResult] + ''' + results_ = [ApplicationOfferResult.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 ApplicationRelationsChange(Type): + _toSchema = {'changed': 'changed', 'removed': 'removed'} + _toPy = {'changed': 'changed', 'removed': 'removed'} + def __init__(self, changed=None, removed=None, **unknown_fields): + ''' + changed : typing.Sequence[~RelationChange] + removed : typing.Sequence[int] + ''' + changed_ = [RelationChange.from_json(o) for o in changed or []] + removed_ = removed + + # Validate arguments against known Juju API types. + if changed_ is not None and not isinstance(changed_, (bytes, str, list)): + raise Exception("Expected changed_ to be a Sequence, received: {}".format(type(changed_))) + + if removed_ is not None and not isinstance(removed_, (bytes, str, list)): + raise Exception("Expected removed_ to be a Sequence, received: {}".format(type(removed_))) + + self.changed = changed_ + self.removed = removed_ + self.unknown_fields = unknown_fields + + + +class ApplicationRelationsWatchResult(Type): + _toSchema = {'applicationrelationswatcherid': 'ApplicationRelationsWatcherId', 'changes': 'changes', 'error': 'error'} + _toPy = {'ApplicationRelationsWatcherId': 'applicationrelationswatcherid', 'changes': 'changes', 'error': 'error'} + def __init__(self, applicationrelationswatcherid=None, changes=None, error=None, **unknown_fields): + ''' + applicationrelationswatcherid : str + changes : ApplicationRelationsChange + error : Error + ''' + applicationrelationswatcherid_ = applicationrelationswatcherid + changes_ = ApplicationRelationsChange.from_json(changes) if changes else None + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if applicationrelationswatcherid_ is not None and not isinstance(applicationrelationswatcherid_, (bytes, str)): + raise Exception("Expected applicationrelationswatcherid_ to be a str, received: {}".format(type(applicationrelationswatcherid_))) + + if changes_ is not None and not isinstance(changes_, (dict, ApplicationRelationsChange)): + raise Exception("Expected changes_ to be a ApplicationRelationsChange, received: {}".format(type(changes_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.applicationrelationswatcherid = applicationrelationswatcherid_ + self.changes = changes_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class ApplicationResult(Type): + _toSchema = {'channel': 'channel', 'charm': 'charm', 'constraints': 'constraints', 'endpoint_bindings': 'endpoint-bindings', 'exposed': 'exposed', 'exposed_endpoints': 'exposed-endpoints', 'principal': 'principal', 'remote': 'remote', 'series': 'series', 'tag': 'tag'} + _toPy = {'channel': 'channel', 'charm': 'charm', 'constraints': 'constraints', 'endpoint-bindings': 'endpoint_bindings', 'exposed': 'exposed', 'exposed-endpoints': 'exposed_endpoints', 'principal': 'principal', 'remote': 'remote', 'series': 'series', 'tag': 'tag'} + def __init__(self, channel=None, charm=None, constraints=None, endpoint_bindings=None, exposed=None, exposed_endpoints=None, principal=None, remote=None, series=None, tag=None, **unknown_fields): + ''' + channel : str + charm : str + constraints : Value + endpoint_bindings : typing.Mapping[str, str] + exposed : bool + exposed_endpoints : typing.Mapping[str, ~ExposedEndpoint] + principal : bool + remote : bool + series : str + tag : str + ''' + channel_ = channel + charm_ = charm + constraints_ = Value.from_json(constraints) if constraints else None + endpoint_bindings_ = endpoint_bindings + exposed_ = exposed + exposed_endpoints_ = {k: ExposedEndpoint.from_json(v) for k, v in (exposed_endpoints or dict()).items()} + principal_ = principal + remote_ = remote + series_ = series + tag_ = tag + + # Validate arguments against known Juju API types. + 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_ is not None and not isinstance(charm_, (bytes, str)): + raise Exception("Expected charm_ to be a str, received: {}".format(type(charm_))) + + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + 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 exposed_ is not None and not isinstance(exposed_, bool): + raise Exception("Expected exposed_ to be a bool, received: {}".format(type(exposed_))) + + 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_))) + + if principal_ is not None and not isinstance(principal_, bool): + raise Exception("Expected principal_ to be a bool, received: {}".format(type(principal_))) + + if remote_ is not None and not isinstance(remote_, bool): + raise Exception("Expected remote_ to be a bool, received: {}".format(type(remote_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.channel = channel_ + self.charm = charm_ + self.constraints = constraints_ + self.endpoint_bindings = endpoint_bindings_ + self.exposed = exposed_ + self.exposed_endpoints = exposed_endpoints_ + self.principal = principal_ + self.remote = remote_ + self.series = series_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class ApplicationSet(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 + branch : str + options : typing.Mapping[str, str] + ''' + application_ = application + branch_ = branch + options_ = options + + # Validate arguments against known Juju API types. + 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_))) + + if options_ is not None and not isinstance(options_, dict): + raise Exception("Expected options_ to be a Mapping, received: {}".format(type(options_))) + + self.application = application_ + self.branch = branch_ + self.options = options_ + self.unknown_fields = unknown_fields + + + +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_series': 'force-series', '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-series': 'force_series', '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_series=None, force_units=None, generation=None, resource_ids=None, storage_constraints=None, **unknown_fields): + ''' + 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_series : bool + force_units : bool + generation : str + resource_ids : typing.Mapping[str, str] + storage_constraints : typing.Mapping[str, ~StorageConstraints] + ''' + application_ = application + channel_ = channel + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + charm_url_ = charm_url + config_settings_ = config_settings + config_settings_yaml_ = config_settings_yaml + endpoint_bindings_ = endpoint_bindings + force_ = force + force_series_ = force_series + force_units_ = force_units + generation_ = generation + resource_ids_ = resource_ids + storage_constraints_ = {k: StorageConstraints.from_json(v) for k, v in (storage_constraints or dict()).items()} + + # Validate arguments against known Juju API types. + 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_series_ is not None and not isinstance(force_series_, bool): + raise Exception("Expected force_series_ to be a bool, received: {}".format(type(force_series_))) + + 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_))) + + self.application = application_ + self.channel = channel_ + self.charm_origin = charm_origin_ + self.charm_url = charm_url_ + self.config_settings = config_settings_ + self.config_settings_yaml = config_settings_yaml_ + self.endpoint_bindings = endpoint_bindings_ + self.force = force_ + self.force_series = force_series_ + self.force_units = force_units_ + self.generation = generation_ + self.resource_ids = resource_ids_ + self.storage_constraints = storage_constraints_ + self.unknown_fields = unknown_fields + + + +class ApplicationSetCharmProfile(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 + charm_url : str + ''' + application_ = application + charm_url_ = charm_url + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + 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_))) + + self.application = application_ + self.charm_url = charm_url_ + self.unknown_fields = unknown_fields + + + +class ApplicationStatus(Type): + _toSchema = {'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', 'series': 'series', 'status': 'status', 'subordinate_to': 'subordinate-to', 'units': 'units', 'workload_version': 'workload-version'} + _toPy = {'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', 'series': 'series', 'status': 'status', 'subordinate-to': 'subordinate_to', 'units': 'units', 'workload-version': 'workload_version'} + def __init__(self, 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, series=None, status=None, subordinate_to=None, units=None, workload_version=None, **unknown_fields): + ''' + can_upgrade_to : str + charm : str + charm_channel : str + charm_profile : str + charm_version : str + endpoint_bindings : typing.Mapping[str, str] + err : Error + exposed : bool + exposed_endpoints : typing.Mapping[str, ~ExposedEndpoint] + int_ : int + life : str + meter_statuses : typing.Mapping[str, ~MeterStatus] + provider_id : str + public_address : str + relations : typing.Mapping[str, typing.Sequence[str]] + series : str + status : DetailedStatus + subordinate_to : typing.Sequence[str] + units : typing.Mapping[str, ~UnitStatus] + workload_version : str + ''' + 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_ = Error.from_json(err) if err else None + exposed_ = exposed + exposed_endpoints_ = {k: ExposedEndpoint.from_json(v) for k, v in (exposed_endpoints or dict()).items()} + int__ = int_ + life_ = life + meter_statuses_ = {k: MeterStatus.from_json(v) for k, v in (meter_statuses or dict()).items()} + provider_id_ = provider_id + public_address_ = public_address + relations_ = relations + series_ = series + status_ = DetailedStatus.from_json(status) if status else None + subordinate_to_ = subordinate_to + units_ = {k: UnitStatus.from_json(v) for k, v in (units or dict()).items()} + workload_version_ = workload_version + + # Validate arguments against known Juju API types. + if can_upgrade_to_ is not None and not isinstance(can_upgrade_to_, (bytes, str)): + raise Exception("Expected can_upgrade_to_ to be a str, received: {}".format(type(can_upgrade_to_))) + + if charm_ is not None and not isinstance(charm_, (bytes, str)): + raise Exception("Expected charm_ to be a str, received: {}".format(type(charm_))) + + if charm_channel_ is not None and not isinstance(charm_channel_, (bytes, str)): + raise Exception("Expected charm_channel_ to be a str, received: {}".format(type(charm_channel_))) + + if charm_profile_ is not None and not isinstance(charm_profile_, (bytes, str)): + raise Exception("Expected charm_profile_ to be a str, received: {}".format(type(charm_profile_))) + + if charm_version_ is not None and not isinstance(charm_version_, (bytes, str)): + raise Exception("Expected charm_version_ to be a str, received: {}".format(type(charm_version_))) + + 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 err_ is not None and not isinstance(err_, (dict, Error)): + raise Exception("Expected err_ to be a Error, received: {}".format(type(err_))) + + if exposed_ is not None and not isinstance(exposed_, bool): + raise Exception("Expected exposed_ to be a bool, received: {}".format(type(exposed_))) + + 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_))) + + if int__ is not None and not isinstance(int__, int): + raise Exception("Expected int__ to be a int, received: {}".format(type(int__))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if meter_statuses_ is not None and not isinstance(meter_statuses_, dict): + raise Exception("Expected meter_statuses_ to be a Mapping, received: {}".format(type(meter_statuses_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if public_address_ is not None and not isinstance(public_address_, (bytes, str)): + raise Exception("Expected public_address_ to be a str, received: {}".format(type(public_address_))) + + if relations_ is not None and not isinstance(relations_, dict): + raise Exception("Expected relations_ to be a Mapping, received: {}".format(type(relations_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if status_ is not None and not isinstance(status_, (dict, DetailedStatus)): + raise Exception("Expected status_ to be a DetailedStatus, received: {}".format(type(status_))) + + if subordinate_to_ is not None and not isinstance(subordinate_to_, (bytes, str, list)): + raise Exception("Expected subordinate_to_ to be a Sequence, received: {}".format(type(subordinate_to_))) + + if units_ is not None and not isinstance(units_, dict): + raise Exception("Expected units_ to be a Mapping, received: {}".format(type(units_))) + + if workload_version_ is not None and not isinstance(workload_version_, (bytes, str)): + raise Exception("Expected workload_version_ to be a str, received: {}".format(type(workload_version_))) + + self.can_upgrade_to = can_upgrade_to_ + self.charm = charm_ + self.charm_channel = charm_channel_ + self.charm_profile = charm_profile_ + self.charm_version = charm_version_ + self.endpoint_bindings = endpoint_bindings_ + self.err = err_ + self.exposed = exposed_ + self.exposed_endpoints = exposed_endpoints_ + self.int_ = int__ + self.life = life_ + self.meter_statuses = meter_statuses_ + self.provider_id = provider_id_ + self.public_address = public_address_ + self.relations = relations_ + self.series = series_ + self.status = status_ + self.subordinate_to = subordinate_to_ + self.units = units_ + self.workload_version = workload_version_ + self.unknown_fields = unknown_fields + + + +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 + error : Error + units : typing.Mapping[str, ~StatusResult] + ''' + application_ = StatusResult.from_json(application) if application else None + error_ = Error.from_json(error) if error else None + units_ = {k: StatusResult.from_json(v) for k, v in (units or dict()).items()} + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (dict, StatusResult)): + raise Exception("Expected application_ to be a StatusResult, received: {}".format(type(application_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if units_ is not None and not isinstance(units_, dict): + raise Exception("Expected units_ to be a Mapping, received: {}".format(type(units_))) + + self.application = application_ + self.error = error_ + self.units = units_ + self.unknown_fields = unknown_fields + + + +class ApplicationStatusResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ApplicationStatusResult] + ''' + results_ = [ApplicationStatusResult.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 ApplicationTag(Type): + _toSchema = {'name': 'Name'} + _toPy = {'Name': 'name'} + def __init__(self, name=None, **unknown_fields): + ''' + name : str + ''' + name_ = name + + # Validate arguments against known Juju API types. + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + self.name = name_ + self.unknown_fields = unknown_fields + + + +class ApplicationURLs(Type): + _toSchema = {'application_urls': 'application-urls'} + _toPy = {'application-urls': 'application_urls'} + def __init__(self, application_urls=None, **unknown_fields): + ''' + application_urls : typing.Sequence[str] + ''' + application_urls_ = application_urls + + # Validate arguments against known Juju API types. + if application_urls_ is not None and not isinstance(application_urls_, (bytes, str, list)): + raise Exception("Expected application_urls_ to be a Sequence, received: {}".format(type(application_urls_))) + + self.application_urls = application_urls_ + self.unknown_fields = 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 + exposed_endpoints : typing.Sequence[str] + ''' + application_ = application + exposed_endpoints_ = exposed_endpoints + + # Validate arguments against known Juju API types. + 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_))) + + self.application = application_ + self.exposed_endpoints = exposed_endpoints_ + self.unknown_fields = 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 + unit_tag : str + ''' + provider_id_ = provider_id + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.provider_id = provider_id_ + self.unit_tag = unit_tag_ + self.unknown_fields = 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 + data : typing.Mapping[str, typing.Any] + filesystem_info : typing.Sequence[~KubernetesFilesystemInfo] + info : str + ports : typing.Sequence[str] + provider_id : str + stateful : bool + status : str + unit_tag : str + ''' + address_ = address + data_ = data + filesystem_info_ = [KubernetesFilesystemInfo.from_json(o) for o in filesystem_info or []] + info_ = info + ports_ = ports + provider_id_ = provider_id + stateful_ = stateful + status_ = status + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if address_ is not None and not isinstance(address_, (bytes, str)): + raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) + + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + + if filesystem_info_ is not None and not isinstance(filesystem_info_, (bytes, str, list)): + raise Exception("Expected filesystem_info_ to be a Sequence, received: {}".format(type(filesystem_info_))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if ports_ is not None and not isinstance(ports_, (bytes, str, list)): + raise Exception("Expected ports_ to be a Sequence, received: {}".format(type(ports_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if stateful_ is not None and not isinstance(stateful_, bool): + raise Exception("Expected stateful_ to be a bool, received: {}".format(type(stateful_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.address = address_ + self.data = data_ + self.filesystem_info = filesystem_info_ + self.info = info_ + self.ports = ports_ + self.provider_id = provider_id_ + self.stateful = stateful_ + self.status = status_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +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 + branch : str + options : typing.Sequence[str] + ''' + application_ = application + branch_ = branch + options_ = options + + # Validate arguments against known Juju API types. + 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_))) + + if options_ is not None and not isinstance(options_, (bytes, str, list)): + raise Exception("Expected options_ to be a Sequence, received: {}".format(type(options_))) + + self.application = application_ + self.branch = branch_ + self.options = options_ + self.unknown_fields = unknown_fields + + + +class ApplicationUpdate(Type): + _toSchema = {'application': 'application', 'charm_url': 'charm-url', 'constraints': 'constraints', 'force': 'force', 'force_charm_url': 'force-charm-url', 'force_series': 'force-series', 'generation': 'generation', 'min_units': 'min-units', 'settings': 'settings', 'settings_yaml': 'settings-yaml'} + _toPy = {'application': 'application', 'charm-url': 'charm_url', 'constraints': 'constraints', 'force': 'force', 'force-charm-url': 'force_charm_url', 'force-series': 'force_series', 'generation': 'generation', 'min-units': 'min_units', 'settings': 'settings', 'settings-yaml': 'settings_yaml'} + def __init__(self, application=None, charm_url=None, constraints=None, force=None, force_charm_url=None, force_series=None, generation=None, min_units=None, settings=None, settings_yaml=None, **unknown_fields): + ''' + application : str + charm_url : str + constraints : Value + force : bool + force_charm_url : bool + force_series : bool + generation : str + min_units : int + settings : typing.Mapping[str, str] + settings_yaml : str + ''' + application_ = application + charm_url_ = charm_url + constraints_ = Value.from_json(constraints) if constraints else None + force_ = force + force_charm_url_ = force_charm_url + force_series_ = force_series + generation_ = generation + min_units_ = min_units + settings_ = settings + settings_yaml_ = settings_yaml + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + 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 constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if force_charm_url_ is not None and not isinstance(force_charm_url_, bool): + raise Exception("Expected force_charm_url_ to be a bool, received: {}".format(type(force_charm_url_))) + + if force_series_ is not None and not isinstance(force_series_, bool): + raise Exception("Expected force_series_ to be a bool, received: {}".format(type(force_series_))) + + if generation_ is not None and not isinstance(generation_, (bytes, str)): + raise Exception("Expected generation_ to be a str, received: {}".format(type(generation_))) + + if min_units_ is not None and not isinstance(min_units_, int): + raise Exception("Expected min_units_ to be a int, received: {}".format(type(min_units_))) + + if settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) + + if settings_yaml_ is not None and not isinstance(settings_yaml_, (bytes, str)): + raise Exception("Expected settings_yaml_ to be a str, received: {}".format(type(settings_yaml_))) + + self.application = application_ + self.charm_url = charm_url_ + self.constraints = constraints_ + self.force = force_ + self.force_charm_url = force_charm_url_ + self.force_series = force_series_ + self.generation = generation_ + self.min_units = min_units_ + self.settings = settings_ + self.settings_yaml = settings_yaml_ + self.unknown_fields = unknown_fields + + + +class ApplicationsCharmActionsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ApplicationCharmActionsResult] + ''' + results_ = [ApplicationCharmActionsResult.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 ApplicationsDeploy(Type): + _toSchema = {'applications': 'applications'} + _toPy = {'applications': 'applications'} + def __init__(self, applications=None, **unknown_fields): + ''' + applications : typing.Sequence[~ApplicationDeploy] + ''' + applications_ = [ApplicationDeploy.from_json(o) for o in applications or []] + + # Validate arguments against known Juju API types. + if applications_ is not None and not isinstance(applications_, (bytes, str, list)): + raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + + self.applications = applications_ + self.unknown_fields = 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 + credentials : str + display_name : str + identity : str + last_connection : str + model_access : str + ''' + controller_access_ = controller_access + credentials_ = credentials + display_name_ = display_name + identity_ = identity + last_connection_ = last_connection + model_access_ = model_access + + # Validate arguments against known Juju API types. + if controller_access_ is not None and not isinstance(controller_access_, (bytes, str)): + raise Exception("Expected controller_access_ to be a str, received: {}".format(type(controller_access_))) + + if credentials_ is not None and not isinstance(credentials_, (bytes, str)): + raise Exception("Expected credentials_ to be a str, received: {}".format(type(credentials_))) + + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if identity_ is not None and not isinstance(identity_, (bytes, str)): + raise Exception("Expected identity_ to be a str, received: {}".format(type(identity_))) + + if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): + raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) + + if model_access_ is not None and not isinstance(model_access_, (bytes, str)): + raise Exception("Expected model_access_ to be a str, received: {}".format(type(model_access_))) + + self.controller_access = controller_access_ + self.credentials = credentials_ + self.display_name = display_name_ + self.identity = identity_ + self.last_connection = last_connection_ + self.model_access = model_access_ + self.unknown_fields = unknown_fields + + + +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 + notes : str + ''' + no_download_ = no_download + notes_ = notes + + # Validate arguments against known Juju API types. + 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_))) + + self.no_download = no_download_ + self.notes = notes_ + self.unknown_fields = unknown_fields + + + +class BackupsInfoArgs(Type): + _toSchema = {'id_': 'id'} + _toPy = {'id': 'id_'} + def __init__(self, id_=None, **unknown_fields): + ''' + id_ : str + ''' + id__ = id_ + + # Validate arguments against known Juju API types. + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + self.id_ = id__ + self.unknown_fields = unknown_fields + + + +class BackupsListArgs(Type): + _toSchema = {} + _toPy = {} + def __init__(self, **unknown_fields): + ''' + + ''' + self.unknown_fields = unknown_fields + + + +class BackupsListResult(Type): + _toSchema = {'list_': 'list'} + _toPy = {'list': 'list_'} + def __init__(self, list_=None, **unknown_fields): + ''' + list_ : typing.Sequence[~BackupsMetadataResult] + ''' + list__ = [BackupsMetadataResult.from_json(o) for o in list_ or []] + + # Validate arguments against known Juju API types. + if list__ is not None and not isinstance(list__, (bytes, str, list)): + raise Exception("Expected list__ to be a Sequence, received: {}".format(type(list__))) + + self.list_ = list__ + self.unknown_fields = unknown_fields + + + +class BackupsMetadataResult(Type): + _toSchema = {'ca_cert': 'ca-cert', 'ca_private_key': 'ca-private-key', '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', 'series': 'series', 'size': 'size', 'started': 'started', 'stored': 'stored', 'version': 'version'} + _toPy = {'ca-cert': 'ca_cert', 'ca-private-key': 'ca_private_key', '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', 'series': 'series', 'size': 'size', 'started': 'started', 'stored': 'stored', 'version': 'version'} + def __init__(self, ca_cert=None, ca_private_key=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, series=None, size=None, started=None, stored=None, version=None, **unknown_fields): + ''' + ca_cert : str + ca_private_key : str + checksum : str + checksum_format : str + controller_machine_id : str + controller_machine_inst_id : str + controller_uuid : str + filename : str + finished : str + format_version : int + ha_nodes : int + hostname : str + id_ : str + machine : str + model : str + notes : str + series : str + size : int + started : str + stored : str + version : Number + ''' + ca_cert_ = ca_cert + ca_private_key_ = ca_private_key + 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 + series_ = series + size_ = size + started_ = started + stored_ = stored + version_ = Number.from_json(version) if version else None + + # Validate arguments against known Juju API types. + if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): + raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) + + if ca_private_key_ is not None and not isinstance(ca_private_key_, (bytes, str)): + raise Exception("Expected ca_private_key_ to be a str, received: {}".format(type(ca_private_key_))) + + if checksum_ is not None and not isinstance(checksum_, (bytes, str)): + raise Exception("Expected checksum_ to be a str, received: {}".format(type(checksum_))) + + if checksum_format_ is not None and not isinstance(checksum_format_, (bytes, str)): + raise Exception("Expected checksum_format_ to be a str, received: {}".format(type(checksum_format_))) + + if controller_machine_id_ is not None and not isinstance(controller_machine_id_, (bytes, str)): + raise Exception("Expected controller_machine_id_ to be a str, received: {}".format(type(controller_machine_id_))) + + if controller_machine_inst_id_ is not None and not isinstance(controller_machine_inst_id_, (bytes, str)): + raise Exception("Expected controller_machine_inst_id_ to be a str, received: {}".format(type(controller_machine_inst_id_))) + + if controller_uuid_ is not None and not isinstance(controller_uuid_, (bytes, str)): + raise Exception("Expected controller_uuid_ to be a str, received: {}".format(type(controller_uuid_))) + + if filename_ is not None and not isinstance(filename_, (bytes, str)): + raise Exception("Expected filename_ to be a str, received: {}".format(type(filename_))) + + if finished_ is not None and not isinstance(finished_, (bytes, str)): + raise Exception("Expected finished_ to be a str, received: {}".format(type(finished_))) + + if format_version_ is not None and not isinstance(format_version_, int): + raise Exception("Expected format_version_ to be a int, received: {}".format(type(format_version_))) + + if ha_nodes_ is not None and not isinstance(ha_nodes_, int): + raise Exception("Expected ha_nodes_ to be a int, received: {}".format(type(ha_nodes_))) + + if hostname_ is not None and not isinstance(hostname_, (bytes, str)): + raise Exception("Expected hostname_ to be a str, received: {}".format(type(hostname_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if machine_ is not None and not isinstance(machine_, (bytes, str)): + raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) + + if model_ is not None and not isinstance(model_, (bytes, str)): + raise Exception("Expected model_ to be a str, received: {}".format(type(model_))) + + if notes_ is not None and not isinstance(notes_, (bytes, str)): + raise Exception("Expected notes_ to be a str, received: {}".format(type(notes_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if started_ is not None and not isinstance(started_, (bytes, str)): + raise Exception("Expected started_ to be a str, received: {}".format(type(started_))) + + if stored_ is not None and not isinstance(stored_, (bytes, str)): + raise Exception("Expected stored_ to be a str, received: {}".format(type(stored_))) + + if version_ is not None and not isinstance(version_, (dict, Number)): + raise Exception("Expected version_ to be a Number, received: {}".format(type(version_))) + + self.ca_cert = ca_cert_ + self.ca_private_key = ca_private_key_ + self.checksum = checksum_ + self.checksum_format = checksum_format_ + self.controller_machine_id = controller_machine_id_ + self.controller_machine_inst_id = controller_machine_inst_id_ + self.controller_uuid = controller_uuid_ + self.filename = filename_ + self.finished = finished_ + self.format_version = format_version_ + self.ha_nodes = ha_nodes_ + self.hostname = hostname_ + self.id_ = id__ + self.machine = machine_ + self.model = model_ + self.notes = notes_ + self.series = series_ + self.size = size_ + self.started = started_ + self.stored = stored_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class BackupsRemoveArgs(Type): + _toSchema = {'ids': 'ids'} + _toPy = {'ids': 'ids'} + def __init__(self, ids=None, **unknown_fields): + ''' + ids : typing.Sequence[str] + ''' + ids_ = ids + + # Validate arguments against known Juju API types. + if ids_ is not None and not isinstance(ids_, (bytes, str, list)): + raise Exception("Expected ids_ to be a Sequence, received: {}".format(type(ids_))) + + self.ids = ids_ + self.unknown_fields = 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 + build : int + major : int + minor : int + number : Number + patch : int + release : str + tag : str + ''' + arch_ = arch + build_ = build + major_ = major + minor_ = minor + number_ = Number.from_json(number) if number else None + patch_ = patch + release_ = release + tag_ = tag + + # Validate arguments against known Juju API types. + if arch_ is not None and not isinstance(arch_, (bytes, str)): + raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) + + if build_ is not None and not isinstance(build_, int): + raise Exception("Expected build_ to be a int, received: {}".format(type(build_))) + + if major_ is not None and not isinstance(major_, int): + raise Exception("Expected major_ to be a int, received: {}".format(type(major_))) + + if minor_ is not None and not isinstance(minor_, int): + raise Exception("Expected minor_ to be a int, received: {}".format(type(minor_))) + + if number_ is not None and not isinstance(number_, (dict, Number)): + raise Exception("Expected number_ to be a Number, received: {}".format(type(number_))) + + if patch_ is not None and not isinstance(patch_, int): + raise Exception("Expected patch_ to be a int, received: {}".format(type(patch_))) + + if release_ is not None and not isinstance(release_, (bytes, str)): + raise Exception("Expected release_ to be a str, received: {}".format(type(release_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.arch = arch_ + self.build = build_ + self.major = major_ + self.minor = minor_ + self.number = number_ + self.patch = patch_ + self.release = release_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +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 + message : str + tag : str + type_ : str + ''' + id__ = id_ + message_ = message + tag_ = tag + type__ = type_ + + # Validate arguments against known Juju API types. + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.id_ = id__ + self.message = message_ + self.tag = tag_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +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 + devicelinks : typing.Sequence[str] + devicename : str + filesystemtype : str + hardwareid : str + inuse : bool + label : str + mountpoint : str + serialid : str + size : int + uuid : str + wwn : str + ''' + busaddress_ = busaddress + devicelinks_ = devicelinks + devicename_ = devicename + filesystemtype_ = filesystemtype + hardwareid_ = hardwareid + inuse_ = inuse + label_ = label + mountpoint_ = mountpoint + serialid_ = serialid + size_ = size + uuid_ = uuid + wwn_ = wwn + + # Validate arguments against known Juju API types. + if busaddress_ is not None and not isinstance(busaddress_, (bytes, str)): + raise Exception("Expected busaddress_ to be a str, received: {}".format(type(busaddress_))) + + if devicelinks_ is not None and not isinstance(devicelinks_, (bytes, str, list)): + raise Exception("Expected devicelinks_ to be a Sequence, received: {}".format(type(devicelinks_))) + + if devicename_ is not None and not isinstance(devicename_, (bytes, str)): + raise Exception("Expected devicename_ to be a str, received: {}".format(type(devicename_))) + + if filesystemtype_ is not None and not isinstance(filesystemtype_, (bytes, str)): + raise Exception("Expected filesystemtype_ to be a str, received: {}".format(type(filesystemtype_))) + + if hardwareid_ is not None and not isinstance(hardwareid_, (bytes, str)): + raise Exception("Expected hardwareid_ to be a str, received: {}".format(type(hardwareid_))) + + if inuse_ is not None and not isinstance(inuse_, bool): + raise Exception("Expected inuse_ to be a bool, received: {}".format(type(inuse_))) + + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) + + if mountpoint_ is not None and not isinstance(mountpoint_, (bytes, str)): + raise Exception("Expected mountpoint_ to be a str, received: {}".format(type(mountpoint_))) + + if serialid_ is not None and not isinstance(serialid_, (bytes, str)): + raise Exception("Expected serialid_ to be a str, received: {}".format(type(serialid_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + if wwn_ is not None and not isinstance(wwn_, (bytes, str)): + raise Exception("Expected wwn_ to be a str, received: {}".format(type(wwn_))) + + self.busaddress = busaddress_ + self.devicelinks = devicelinks_ + self.devicename = devicename_ + self.filesystemtype = filesystemtype_ + self.hardwareid = hardwareid_ + self.inuse = inuse_ + self.label = label_ + self.mountpoint = mountpoint_ + self.serialid = serialid_ + self.size = size_ + self.uuid = uuid_ + self.wwn = wwn_ + self.unknown_fields = unknown_fields + + + +class BlockDeviceResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : BlockDevice + ''' + error_ = Error.from_json(error) if error else None + result_ = BlockDevice.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, BlockDevice)): + raise Exception("Expected result_ to be a BlockDevice, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class BlockDeviceResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~BlockDeviceResult] + ''' + results_ = [BlockDeviceResult.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 BlockResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : Block + ''' + error_ = Error.from_json(error) if error else None + result_ = Block.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, Block)): + raise Exception("Expected result_ to be a Block, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class BlockResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~BlockResult] + ''' + results_ = [BlockResult.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 BlockSwitchParams(Type): + _toSchema = {'message': 'message', 'type_': 'type'} + _toPy = {'message': 'message', 'type': 'type_'} + def __init__(self, message=None, type_=None, **unknown_fields): + ''' + message : str + type_ : str + ''' + message_ = message + type__ = type_ + + # Validate arguments against known Juju API types. + 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__))) + + self.message = message_ + self.type_ = type__ + self.unknown_fields = 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 + result : bool + ''' + error_ = Error.from_json(error) if error else None + result_ = result + + # 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_, bool): + raise Exception("Expected result_ to be a bool, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class BoolResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~BoolResult] + ''' + results_ = [BoolResult.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 BranchArg(Type): + _toSchema = {'branch': 'branch'} + _toPy = {'branch': 'branch'} + def __init__(self, branch=None, **unknown_fields): + ''' + branch : str + ''' + branch_ = branch + + # Validate arguments against known Juju API types. + if branch_ is not None and not isinstance(branch_, (bytes, str)): + raise Exception("Expected branch_ to be a str, received: {}".format(type(branch_))) + + self.branch = branch_ + self.unknown_fields = 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] + detailed : bool + ''' + branches_ = branches + detailed_ = detailed + + # Validate arguments against known Juju API types. + 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_))) + + self.branches = branches_ + self.detailed = detailed_ + self.unknown_fields = 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 + generations : typing.Sequence[~Generation] + ''' + error_ = Error.from_json(error) if error else None + generations_ = [Generation.from_json(o) for o in generations or []] + + # 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 generations_ is not None and not isinstance(generations_, (bytes, str, list)): + raise Exception("Expected generations_ to be a Sequence, received: {}".format(type(generations_))) + + self.error = error_ + self.generations = generations_ + self.unknown_fields = 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]] + created : int + created_by : str + ''' + assigned_units_ = assigned_units + created_ = created + created_by_ = created_by + + # Validate arguments against known Juju API types. + if assigned_units_ is not None and not isinstance(assigned_units_, dict): + raise Exception("Expected assigned_units_ to be a Mapping, received: {}".format(type(assigned_units_))) + + if created_ is not None and not isinstance(created_, int): + raise Exception("Expected created_ to be a int, received: {}".format(type(created_))) + + if created_by_ is not None and not isinstance(created_by_, (bytes, str)): + raise Exception("Expected created_by_ to be a str, received: {}".format(type(created_by_))) + + self.assigned_units = assigned_units_ + self.created = created_ + self.created_by = created_by_ + self.unknown_fields = unknown_fields + + + +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 + entities : typing.Sequence[~Entity] + num_units : int + ''' + branch_ = branch + entities_ = [Entity.from_json(o) for o in entities or []] + num_units_ = num_units + + # Validate arguments against known Juju API types. + 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_))) + + self.branch = branch_ + self.entities = entities_ + self.num_units = num_units_ + self.unknown_fields = unknown_fields + + + +class BulkImportStorageParams(Type): + _toSchema = {'storage': 'storage'} + _toPy = {'storage': 'storage'} + def __init__(self, storage=None, **unknown_fields): + ''' + storage : typing.Sequence[~ImportStorageParams] + ''' + storage_ = [ImportStorageParams.from_json(o) for o in storage or []] + + # Validate arguments against known Juju API types. + if storage_ is not None and not isinstance(storage_, (bytes, str, list)): + raise Exception("Expected storage_ to be a Sequence, received: {}".format(type(storage_))) + + self.storage = storage_ + self.unknown_fields = 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] + id_ : str + method : str + requires : typing.Sequence[str] + ''' + args_ = args + id__ = id_ + method_ = method + requires_ = requires + + # 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_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if method_ is not None and not isinstance(method_, (bytes, str)): + raise Exception("Expected method_ to be a str, received: {}".format(type(method_))) + + if requires_ is not None and not isinstance(requires_, (bytes, str, list)): + raise Exception("Expected requires_ to be a Sequence, received: {}".format(type(requires_))) + + self.args = args_ + self.id_ = id__ + self.method = method_ + self.requires = requires_ + self.unknown_fields = unknown_fields + + + +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] + id_ : str + method : str + requires : typing.Sequence[str] + ''' + args_ = args + id__ = id_ + method_ = method + requires_ = requires + + # Validate arguments against known Juju API types. + if args_ is not None and not isinstance(args_, dict): + raise Exception("Expected args_ to be a Mapping, received: {}".format(type(args_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if method_ is not None and not isinstance(method_, (bytes, str)): + raise Exception("Expected method_ to be a str, received: {}".format(type(method_))) + + if requires_ is not None and not isinstance(requires_, (bytes, str, list)): + raise Exception("Expected requires_ to be a Sequence, received: {}".format(type(requires_))) + + self.args = args_ + self.id_ = id__ + self.method = method_ + self.requires = requires_ + self.unknown_fields = unknown_fields + + + +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] + errors : typing.Sequence[str] + ''' + changes_ = [BundleChangesMapArgs.from_json(o) for o in changes or []] + errors_ = errors + + # Validate arguments against known Juju API types. + 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 errors_ is not None and not isinstance(errors_, (bytes, str, list)): + raise Exception("Expected errors_ to be a Sequence, received: {}".format(type(errors_))) + + self.changes = changes_ + self.errors = errors_ + self.unknown_fields = 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 + yaml : str + ''' + bundleurl_ = bundleurl + yaml_ = yaml + + # Validate arguments against known Juju API types. + 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_))) + + self.bundleurl = bundleurl_ + self.yaml = yaml_ + self.unknown_fields = 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] + errors : typing.Sequence[str] + ''' + changes_ = [BundleChange.from_json(o) for o in changes or []] + errors_ = errors + + # Validate arguments against known Juju API types. + 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 errors_ is not None and not isinstance(errors_, (bytes, str, list)): + raise Exception("Expected errors_ to be a Sequence, received: {}".format(type(errors_))) + + self.changes = changes_ + self.errors = errors_ + self.unknown_fields = unknown_fields + + + +class BundleCharm(Type): + _toSchema = {'name': 'name', 'package_id': 'package-id'} + _toPy = {'name': 'name', 'package-id': 'package_id'} + def __init__(self, name=None, package_id=None, **unknown_fields): + ''' + name : str + package_id : str + ''' + name_ = name + package_id_ = package_id + + # Validate arguments against known Juju API types. + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if package_id_ is not None and not isinstance(package_id_, (bytes, str)): + raise Exception("Expected package_id_ to be a str, received: {}".format(type(package_id_))) + + self.name = name_ + self.package_id = package_id_ + self.unknown_fields = unknown_fields + + + +class BytesResult(Type): + _toSchema = {'result': 'result'} + _toPy = {'result': 'result'} + def __init__(self, result=None, **unknown_fields): + ''' + result : typing.Sequence[int] + ''' + result_ = result + + # Validate arguments against known Juju API types. + if result_ is not None and not isinstance(result_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + + self.result = result_ + self.unknown_fields = 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] + application : Entity + desired_replicas : int + force : bool + observed_units : Entities + ''' + active_pod_names_ = active_pod_names + application_ = Entity.from_json(application) if application else None + desired_replicas_ = desired_replicas + force_ = force + observed_units_ = Entities.from_json(observed_units) if observed_units else None + + # Validate arguments against known Juju API types. + if active_pod_names_ is not None and not isinstance(active_pod_names_, (bytes, str, list)): + raise Exception("Expected active_pod_names_ to be a Sequence, received: {}".format(type(active_pod_names_))) + + if application_ is not None and not isinstance(application_, (dict, Entity)): + raise Exception("Expected application_ to be a Entity, received: {}".format(type(application_))) + + if desired_replicas_ is not None and not isinstance(desired_replicas_, int): + raise Exception("Expected desired_replicas_ to be a int, received: {}".format(type(desired_replicas_))) + + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if observed_units_ is not None and not isinstance(observed_units_, (dict, Entities)): + raise Exception("Expected observed_units_ to be a Entities, received: {}".format(type(observed_units_))) + + self.active_pod_names = active_pod_names_ + self.application = application_ + self.desired_replicas = desired_replicas_ + self.force = force_ + self.observed_units = observed_units_ + self.unknown_fields = unknown_fields + + + +class CAASApplicationGarbageCollectArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~CAASApplicationGarbageCollectArg] + ''' + args_ = [CAASApplicationGarbageCollectArg.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 CAASApplicationOCIResourceResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : CAASApplicationOCIResources + ''' + error_ = Error.from_json(error) if error else None + result_ = CAASApplicationOCIResources.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, CAASApplicationOCIResources)): + raise Exception("Expected result_ to be a CAASApplicationOCIResources, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class CAASApplicationOCIResourceResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~CAASApplicationOCIResourceResult] + ''' + results_ = [CAASApplicationOCIResourceResult.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 CAASApplicationOCIResources(Type): + _toSchema = {'images': 'images'} + _toPy = {'images': 'images'} + def __init__(self, images=None, **unknown_fields): + ''' + images : typing.Mapping[str, ~DockerImageInfo] + ''' + images_ = {k: DockerImageInfo.from_json(v) for k, v in (images or dict()).items()} + + # Validate arguments against known Juju API types. + if images_ is not None and not isinstance(images_, dict): + raise Exception("Expected images_ to be a Mapping, received: {}".format(type(images_))) + + self.images = images_ + self.unknown_fields = unknown_fields + + + +class CAASApplicationProvisioningInfo(Type): + _toSchema = {'api_addresses': 'api-addresses', 'ca_cert': 'ca-cert', 'charm_modified_version': 'charm-modified-version', 'charm_url': 'charm-url', 'constraints': 'constraints', 'devices': 'devices', 'error': 'error', 'filesystems': 'filesystems', 'image_path': 'image-path', 'image_repo': 'image-repo', 'scale': 'scale', 'series': 'series', 'tags': 'tags', 'trust': 'trust', 'version': 'version', 'volumes': 'volumes'} + _toPy = {'api-addresses': 'api_addresses', 'ca-cert': 'ca_cert', 'charm-modified-version': 'charm_modified_version', 'charm-url': 'charm_url', 'constraints': 'constraints', 'devices': 'devices', 'error': 'error', 'filesystems': 'filesystems', 'image-path': 'image_path', 'image-repo': 'image_repo', 'scale': 'scale', 'series': 'series', 'tags': 'tags', 'trust': 'trust', 'version': 'version', 'volumes': 'volumes'} + def __init__(self, api_addresses=None, ca_cert=None, charm_modified_version=None, charm_url=None, constraints=None, devices=None, error=None, filesystems=None, image_path=None, image_repo=None, scale=None, series=None, tags=None, trust=None, version=None, volumes=None, **unknown_fields): + ''' + api_addresses : typing.Sequence[str] + ca_cert : str + charm_modified_version : int + charm_url : str + constraints : Value + devices : typing.Sequence[~KubernetesDeviceParams] + error : Error + filesystems : typing.Sequence[~KubernetesFilesystemParams] + image_path : str + image_repo : DockerImageInfo + scale : int + series : str + tags : typing.Mapping[str, str] + trust : bool + version : Number + volumes : typing.Sequence[~KubernetesVolumeParams] + ''' + api_addresses_ = api_addresses + ca_cert_ = ca_cert + charm_modified_version_ = charm_modified_version + charm_url_ = charm_url + constraints_ = Value.from_json(constraints) if constraints else None + devices_ = [KubernetesDeviceParams.from_json(o) for o in devices or []] + error_ = Error.from_json(error) if error else None + filesystems_ = [KubernetesFilesystemParams.from_json(o) for o in filesystems or []] + image_path_ = image_path + image_repo_ = DockerImageInfo.from_json(image_repo) if image_repo else None + scale_ = scale + series_ = series + tags_ = tags + trust_ = trust + version_ = Number.from_json(version) if version else None + volumes_ = [KubernetesVolumeParams.from_json(o) for o in volumes or []] + + # Validate arguments against known Juju API types. + if api_addresses_ is not None and not isinstance(api_addresses_, (bytes, str, list)): + raise Exception("Expected api_addresses_ to be a Sequence, received: {}".format(type(api_addresses_))) + + if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): + raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) + + if charm_modified_version_ is not None and not isinstance(charm_modified_version_, int): + raise Exception("Expected charm_modified_version_ to be a int, received: {}".format(type(charm_modified_version_))) + + 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 constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if devices_ is not None and not isinstance(devices_, (bytes, str, list)): + raise Exception("Expected devices_ to be a Sequence, received: {}".format(type(devices_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if filesystems_ is not None and not isinstance(filesystems_, (bytes, str, list)): + raise Exception("Expected filesystems_ to be a Sequence, received: {}".format(type(filesystems_))) + + if image_path_ is not None and not isinstance(image_path_, (bytes, str)): + raise Exception("Expected image_path_ to be a str, received: {}".format(type(image_path_))) + + if image_repo_ is not None and not isinstance(image_repo_, (dict, DockerImageInfo)): + raise Exception("Expected image_repo_ to be a DockerImageInfo, received: {}".format(type(image_repo_))) + + if scale_ is not None and not isinstance(scale_, int): + raise Exception("Expected scale_ to be a int, received: {}".format(type(scale_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if trust_ is not None and not isinstance(trust_, bool): + raise Exception("Expected trust_ to be a bool, received: {}".format(type(trust_))) + + if version_ is not None and not isinstance(version_, (dict, Number)): + raise Exception("Expected version_ to be a Number, received: {}".format(type(version_))) + + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.api_addresses = api_addresses_ + self.ca_cert = ca_cert_ + self.charm_modified_version = charm_modified_version_ + self.charm_url = charm_url_ + self.constraints = constraints_ + self.devices = devices_ + self.error = error_ + self.filesystems = filesystems_ + self.image_path = image_path_ + self.image_repo = image_repo_ + self.scale = scale_ + self.series = series_ + self.tags = tags_ + self.trust = trust_ + self.version = version_ + self.volumes = volumes_ + self.unknown_fields = unknown_fields + + + +class CAASApplicationProvisioningInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~CAASApplicationProvisioningInfo] + ''' + results_ = [CAASApplicationProvisioningInfo.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 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 + unit_status : UnitStatus + ''' + tag_ = tag + unit_status_ = UnitStatus.from_json(unit_status) if unit_status else None + + # Validate arguments against known Juju API types. + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if unit_status_ is not None and not isinstance(unit_status_, (dict, UnitStatus)): + raise Exception("Expected unit_status_ to be a UnitStatus, received: {}".format(type(unit_status_))) + + self.tag = tag_ + self.unit_status = unit_status_ + self.unknown_fields = 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] + unit_name : str + ''' + agent_conf_ = agent_conf + unit_name_ = unit_name + + # Validate arguments against known Juju API types. + if agent_conf_ is not None and not isinstance(agent_conf_, (bytes, str, list)): + raise Exception("Expected agent_conf_ to be a Sequence, received: {}".format(type(agent_conf_))) + + if unit_name_ is not None and not isinstance(unit_name_, (bytes, str)): + raise Exception("Expected unit_name_ to be a str, received: {}".format(type(unit_name_))) + + self.agent_conf = agent_conf_ + self.unit_name = unit_name_ + self.unknown_fields = 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 + pod_uuid : str + ''' + pod_name_ = pod_name + pod_uuid_ = pod_uuid + + # Validate arguments against known Juju API types. + 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_))) + + self.pod_name = pod_name_ + self.pod_uuid = pod_uuid_ + self.unknown_fields = 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 + result : CAASUnitIntroduction + ''' + error_ = Error.from_json(error) if error else None + result_ = CAASUnitIntroduction.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, CAASUnitIntroduction)): + raise Exception("Expected result_ to be a CAASUnitIntroduction, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = 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 + willrestart : bool + ''' + error_ = Error.from_json(error) if error else None + willrestart_ = willrestart + + # 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 willrestart_ is not None and not isinstance(willrestart_, bool): + raise Exception("Expected willrestart_ to be a bool, received: {}".format(type(willrestart_))) + + self.error = error_ + self.willrestart = willrestart_ + self.unknown_fields = 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 + units : typing.Sequence[~CAASUnitInfo] + ''' + error_ = Error.from_json(error) if error else None + units_ = [CAASUnitInfo.from_json(o) for o in units or []] + + # 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 units_ is not None and not isinstance(units_, (bytes, str, list)): + raise Exception("Expected units_ to be a Sequence, received: {}".format(type(units_))) + + self.error = error_ + self.units = units_ + self.unknown_fields = unknown_fields + + + +class CAASUnitsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~CAASUnitsResult] + ''' + results_ = [CAASUnitsResult.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 CIDRParams(Type): + _toSchema = {'cidrs': 'cidrs'} + _toPy = {'cidrs': 'cidrs'} + def __init__(self, cidrs=None, **unknown_fields): + ''' + cidrs : typing.Sequence[str] + ''' + cidrs_ = cidrs + + # Validate arguments against known Juju API types. + if cidrs_ is not None and not isinstance(cidrs_, (bytes, str, list)): + raise Exception("Expected cidrs_ to be a Sequence, received: {}".format(type(cidrs_))) + + self.cidrs = cidrs_ + self.unknown_fields = 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 + model_tag : str + ''' + credential_tag_ = credential_tag + model_tag_ = model_tag + + # Validate arguments against known Juju API types. + if credential_tag_ is not None and not isinstance(credential_tag_, (bytes, str)): + raise Exception("Expected credential_tag_ to be a str, received: {}".format(type(credential_tag_))) + + 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_))) + + self.credential_tag = credential_tag_ + self.model_tag = model_tag_ + self.unknown_fields = 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] + ''' + model_credentials_ = [ChangeModelCredentialParams.from_json(o) for o in model_credentials or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.model_credentials = model_credentials_ + self.unknown_fields = unknown_fields + + + +class Channel(Type): + _toSchema = {'platforms': 'platforms', 'released_at': 'released-at', 'revision': 'revision', 'risk': 'risk', 'size': 'size', 'track': 'track', 'version': 'version'} + _toPy = {'platforms': 'platforms', 'released-at': 'released_at', 'revision': 'revision', 'risk': 'risk', 'size': 'size', 'track': 'track', 'version': 'version'} + def __init__(self, platforms=None, released_at=None, revision=None, risk=None, size=None, track=None, version=None, **unknown_fields): + ''' + platforms : typing.Sequence[~Platform] + released_at : str + revision : int + risk : str + size : int + track : str + version : str + ''' + platforms_ = [Platform.from_json(o) for o in platforms or []] + released_at_ = released_at + revision_ = revision + risk_ = risk + size_ = size + track_ = track + version_ = version + + # Validate arguments against known Juju API types. + if platforms_ is not None and not isinstance(platforms_, (bytes, str, list)): + raise Exception("Expected platforms_ to be a Sequence, received: {}".format(type(platforms_))) + + if released_at_ is not None and not isinstance(released_at_, (bytes, str)): + raise Exception("Expected released_at_ to be a str, received: {}".format(type(released_at_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if risk_ is not None and not isinstance(risk_, (bytes, str)): + raise Exception("Expected risk_ to be a str, received: {}".format(type(risk_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if track_ is not None and not isinstance(track_, (bytes, str)): + raise Exception("Expected track_ to be a str, received: {}".format(type(track_))) + + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + + self.platforms = platforms_ + self.released_at = released_at_ + self.revision = revision_ + self.risk = risk_ + self.size = size_ + self.track = track_ + self.version = version_ + self.unknown_fields = 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 + config : typing.Mapping[str, ~CharmOption] + lxd_profile : CharmLXDProfile + manifest : CharmManifest + meta : CharmMeta + metrics : CharmMetrics + revision : int + url : str + ''' + actions_ = CharmActions.from_json(actions) if actions else None + config_ = {k: CharmOption.from_json(v) for k, v in (config or dict()).items()} + lxd_profile_ = CharmLXDProfile.from_json(lxd_profile) if lxd_profile else None + manifest_ = CharmManifest.from_json(manifest) if manifest else None + meta_ = CharmMeta.from_json(meta) if meta else None + metrics_ = CharmMetrics.from_json(metrics) if metrics else None + revision_ = revision + url_ = url + + # Validate arguments against known Juju API types. + if actions_ is not None and not isinstance(actions_, (dict, CharmActions)): + raise Exception("Expected actions_ to be a CharmActions, received: {}".format(type(actions_))) + + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if lxd_profile_ is not None and not isinstance(lxd_profile_, (dict, CharmLXDProfile)): + raise Exception("Expected lxd_profile_ to be a CharmLXDProfile, received: {}".format(type(lxd_profile_))) + + if manifest_ is not None and not isinstance(manifest_, (dict, CharmManifest)): + raise Exception("Expected manifest_ to be a CharmManifest, received: {}".format(type(manifest_))) + + if meta_ is not None and not isinstance(meta_, (dict, CharmMeta)): + raise Exception("Expected meta_ to be a CharmMeta, received: {}".format(type(meta_))) + + if metrics_ is not None and not isinstance(metrics_, (dict, CharmMetrics)): + raise Exception("Expected metrics_ to be a CharmMetrics, received: {}".format(type(metrics_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.actions = actions_ + self.config = config_ + self.lxd_profile = lxd_profile_ + self.manifest = manifest_ + self.meta = meta_ + self.metrics = metrics_ + self.revision = revision_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class CharmActionSpec(Type): + _toSchema = {'description': 'description', 'params': 'params'} + _toPy = {'description': 'description', 'params': 'params'} + def __init__(self, description=None, params=None, **unknown_fields): + ''' + description : str + params : typing.Mapping[str, typing.Any] + ''' + description_ = description + params_ = params + + # Validate arguments against known Juju API types. + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if params_ is not None and not isinstance(params_, dict): + raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) + + self.description = description_ + self.params = params_ + self.unknown_fields = unknown_fields + + + +class CharmActions(Type): + _toSchema = {'specs': 'specs'} + _toPy = {'specs': 'specs'} + def __init__(self, specs=None, **unknown_fields): + ''' + specs : typing.Mapping[str, ~CharmActionSpec] + ''' + specs_ = {k: CharmActionSpec.from_json(v) for k, v in (specs or dict()).items()} + + # Validate arguments against known Juju API types. + if specs_ is not None and not isinstance(specs_, dict): + raise Exception("Expected specs_ to be a Mapping, received: {}".format(type(specs_))) + + self.specs = specs_ + self.unknown_fields = 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] + channel : str + name : str + ''' + architectures_ = architectures + channel_ = channel + name_ = name + + # Validate arguments against known Juju API types. + if architectures_ is not None and not isinstance(architectures_, (bytes, str, list)): + raise Exception("Expected architectures_ to be a Sequence, received: {}".format(type(architectures_))) + + if channel_ is not None and not isinstance(channel_, (bytes, str)): + raise Exception("Expected channel_ to be a str, received: {}".format(type(channel_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + self.architectures = architectures_ + self.channel = channel_ + self.name = name_ + self.unknown_fields = unknown_fields + + + +class CharmContainer(Type): + _toSchema = {'mounts': 'mounts', 'resource': 'resource'} + _toPy = {'mounts': 'mounts', 'resource': 'resource'} + def __init__(self, mounts=None, resource=None, **unknown_fields): + ''' + mounts : typing.Sequence[~CharmMount] + resource : str + ''' + mounts_ = [CharmMount.from_json(o) for o in mounts or []] + resource_ = resource + + # Validate arguments against known Juju API types. + 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_))) + + self.mounts = mounts_ + self.resource = resource_ + self.unknown_fields = unknown_fields + + + +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 + mode : str + service : str + type_ : str + ''' + min_version_ = min_version + mode_ = mode + service_ = service + type__ = type_ + + # Validate arguments against known Juju API types. + if min_version_ is not None and not isinstance(min_version_, (bytes, str)): + raise Exception("Expected min_version_ to be a str, received: {}".format(type(min_version_))) + + if mode_ is not None and not isinstance(mode_, (bytes, str)): + raise Exception("Expected mode_ to be a str, received: {}".format(type(mode_))) + + if service_ is not None and not isinstance(service_, (bytes, str)): + raise Exception("Expected service_ to be a str, received: {}".format(type(service_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.min_version = min_version_ + self.mode = mode_ + self.service = service_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +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 + countmin : int + description : str + name : str + type_ : str + ''' + countmax_ = countmax + countmin_ = countmin + description_ = description + name_ = name + type__ = type_ + + # Validate arguments against known Juju API types. + if countmax_ is not None and not isinstance(countmax_, int): + raise Exception("Expected countmax_ to be a int, received: {}".format(type(countmax_))) + + if countmin_ is not None and not isinstance(countmin_, int): + raise Exception("Expected countmin_ to be a int, received: {}".format(type(countmin_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.countmax = countmax_ + self.countmin = countmin_ + self.description = description_ + self.name = name_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class CharmHubBundle(Type): + _toSchema = {'charms': 'charms'} + _toPy = {'charms': 'charms'} + def __init__(self, charms=None, **unknown_fields): + ''' + charms : typing.Sequence[~BundleCharm] + ''' + charms_ = [BundleCharm.from_json(o) for o in charms or []] + + # Validate arguments against known Juju API types. + if charms_ is not None and not isinstance(charms_, (bytes, str, list)): + raise Exception("Expected charms_ to be a Sequence, received: {}".format(type(charms_))) + + self.charms = charms_ + self.unknown_fields = unknown_fields + + + +class CharmHubCharm(Type): + _toSchema = {'config': 'config', 'relations': 'relations', 'subordinate': 'subordinate', 'used_by': 'used-by'} + _toPy = {'config': 'config', 'relations': 'relations', 'subordinate': 'subordinate', 'used-by': 'used_by'} + def __init__(self, config=None, relations=None, subordinate=None, used_by=None, **unknown_fields): + ''' + config : typing.Mapping[str, ~CharmOption] + relations : typing.Mapping[str, typing.Any] + subordinate : bool + used_by : typing.Sequence[str] + ''' + config_ = {k: CharmOption.from_json(v) for k, v in (config or dict()).items()} + relations_ = relations + subordinate_ = subordinate + used_by_ = used_by + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if relations_ is not None and not isinstance(relations_, dict): + raise Exception("Expected relations_ to be a Mapping, received: {}".format(type(relations_))) + + if subordinate_ is not None and not isinstance(subordinate_, bool): + raise Exception("Expected subordinate_ to be a bool, received: {}".format(type(subordinate_))) + + if used_by_ is not None and not isinstance(used_by_, (bytes, str, list)): + raise Exception("Expected used_by_ to be a Sequence, received: {}".format(type(used_by_))) + + self.config = config_ + self.relations = relations_ + self.subordinate = subordinate_ + self.used_by = used_by_ + self.unknown_fields = unknown_fields + + + +class CharmHubEntityFindResult(Type): + _toSchema = {'errors': 'errors', 'result': 'result'} + _toPy = {'errors': 'errors', 'result': 'result'} + def __init__(self, errors=None, result=None, **unknown_fields): + ''' + errors : ErrorResponse + result : typing.Sequence[~FindResponse] + ''' + errors_ = ErrorResponse.from_json(errors) if errors else None + result_ = [FindResponse.from_json(o) for o in result or []] + + # Validate arguments against known Juju API types. + if errors_ is not None and not isinstance(errors_, (dict, ErrorResponse)): + raise Exception("Expected errors_ to be a ErrorResponse, received: {}".format(type(errors_))) + + if result_ is not None and not isinstance(result_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + + self.errors = errors_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class CharmHubEntityInfoResult(Type): + _toSchema = {'errors': 'errors', 'result': 'result'} + _toPy = {'errors': 'errors', 'result': 'result'} + def __init__(self, errors=None, result=None, **unknown_fields): + ''' + errors : ErrorResponse + result : InfoResponse + ''' + errors_ = ErrorResponse.from_json(errors) if errors else None + result_ = InfoResponse.from_json(result) if result else None + + # Validate arguments against known Juju API types. + if errors_ is not None and not isinstance(errors_, (dict, ErrorResponse)): + raise Exception("Expected errors_ to be a ErrorResponse, received: {}".format(type(errors_))) + + if result_ is not None and not isinstance(result_, (dict, InfoResponse)): + raise Exception("Expected result_ to be a InfoResponse, received: {}".format(type(result_))) + + self.errors = errors_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class CharmHubError(Type): + _toSchema = {'code': 'code', 'message': 'message'} + _toPy = {'code': 'code', 'message': 'message'} + def __init__(self, code=None, message=None, **unknown_fields): + ''' + code : str + message : str + ''' + code_ = code + message_ = message + + # Validate arguments against known Juju API types. + if code_ is not None and not isinstance(code_, (bytes, str)): + raise Exception("Expected code_ to be a str, received: {}".format(type(code_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + self.code = code_ + self.message = message_ + self.unknown_fields = unknown_fields + + + +class CharmHubInfoResource(Type): + _toSchema = {'name': 'name', 'revision': 'revision', 'size': 'size', 'type_': 'type', 'url': 'url'} + _toPy = {'name': 'name', 'revision': 'revision', 'size': 'size', 'type': 'type_', 'url': 'url'} + def __init__(self, name=None, revision=None, size=None, type_=None, url=None, **unknown_fields): + ''' + name : str + revision : int + size : int + type_ : str + url : str + ''' + name_ = name + revision_ = revision + size_ = size + type__ = type_ + url_ = url + + # Validate arguments against known Juju API types. + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.name = name_ + self.revision = revision_ + self.size = size_ + self.type_ = type__ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class CharmInfo(Type): + _toSchema = {'actions': 'actions', 'config': 'config', 'lxd_profile': 'lxd-profile', 'meta': 'meta', 'metrics': 'metrics', 'revision': 'revision', 'url': 'url'} + _toPy = {'actions': 'actions', 'config': 'config', 'lxd-profile': 'lxd_profile', 'meta': 'meta', 'metrics': 'metrics', 'revision': 'revision', 'url': 'url'} + def __init__(self, actions=None, config=None, lxd_profile=None, meta=None, metrics=None, revision=None, url=None, **unknown_fields): + ''' + actions : CharmActions + config : typing.Mapping[str, ~CharmOption] + lxd_profile : CharmLXDProfile + meta : CharmMeta + metrics : CharmMetrics + revision : int + url : str + ''' + actions_ = CharmActions.from_json(actions) if actions else None + config_ = {k: CharmOption.from_json(v) for k, v in (config or dict()).items()} + lxd_profile_ = CharmLXDProfile.from_json(lxd_profile) if lxd_profile else None + meta_ = CharmMeta.from_json(meta) if meta else None + metrics_ = CharmMetrics.from_json(metrics) if metrics else None + revision_ = revision + url_ = url + + # Validate arguments against known Juju API types. + if actions_ is not None and not isinstance(actions_, (dict, CharmActions)): + raise Exception("Expected actions_ to be a CharmActions, received: {}".format(type(actions_))) + + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if lxd_profile_ is not None and not isinstance(lxd_profile_, (dict, CharmLXDProfile)): + raise Exception("Expected lxd_profile_ to be a CharmLXDProfile, received: {}".format(type(lxd_profile_))) + + if meta_ is not None and not isinstance(meta_, (dict, CharmMeta)): + raise Exception("Expected meta_ to be a CharmMeta, received: {}".format(type(meta_))) + + if metrics_ is not None and not isinstance(metrics_, (dict, CharmMetrics)): + raise Exception("Expected metrics_ to be a CharmMetrics, received: {}".format(type(metrics_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.actions = actions_ + self.config = config_ + self.lxd_profile = lxd_profile_ + self.meta = meta_ + self.metrics = metrics_ + self.revision = revision_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +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] + description : str + devices : typing.Mapping[str, typing.Any] + ''' + config_ = config + description_ = description + devices_ = devices + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if devices_ is not None and not isinstance(devices_, dict): + raise Exception("Expected devices_ to be a Mapping, received: {}".format(type(devices_))) + + self.config = config_ + self.description = description_ + self.devices = devices_ + self.unknown_fields = unknown_fields + + + +class CharmManifest(Type): + _toSchema = {'bases': 'bases'} + _toPy = {'bases': 'bases'} + def __init__(self, bases=None, **unknown_fields): + ''' + bases : typing.Sequence[~CharmBase] + ''' + bases_ = [CharmBase.from_json(o) for o in bases or []] + + # Validate arguments against known Juju API types. + if bases_ is not None and not isinstance(bases_, (bytes, str, list)): + raise Exception("Expected bases_ to be a Sequence, received: {}".format(type(bases_))) + + self.bases = bases_ + self.unknown_fields = 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): + ''' + assumes_expr : ExpressionTree + categories : typing.Sequence[str] + containers : typing.Mapping[str, ~CharmContainer] + deployment : CharmDeployment + description : str + devices : typing.Mapping[str, ~CharmDevice] + extra_bindings : typing.Mapping[str, str] + min_juju_version : str + name : str + payload_classes : typing.Mapping[str, ~CharmPayloadClass] + peers : typing.Mapping[str, ~CharmRelation] + provides : typing.Mapping[str, ~CharmRelation] + requires : typing.Mapping[str, ~CharmRelation] + resources : typing.Mapping[str, ~CharmResourceMeta] + series : typing.Sequence[str] + storage : typing.Mapping[str, ~CharmStorage] + subordinate : bool + summary : str + tags : typing.Sequence[str] + terms : typing.Sequence[str] + ''' + assumes_expr_ = ExpressionTree.from_json(assumes_expr) if assumes_expr else None + categories_ = categories + 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 + devices_ = {k: CharmDevice.from_json(v) for k, v in (devices or dict()).items()} + extra_bindings_ = extra_bindings + min_juju_version_ = min_juju_version + name_ = name + payload_classes_ = {k: CharmPayloadClass.from_json(v) for k, v in (payload_classes or dict()).items()} + peers_ = {k: CharmRelation.from_json(v) for k, v in (peers or dict()).items()} + provides_ = {k: CharmRelation.from_json(v) for k, v in (provides or dict()).items()} + requires_ = {k: CharmRelation.from_json(v) for k, v in (requires or dict()).items()} + resources_ = {k: CharmResourceMeta.from_json(v) for k, v in (resources or dict()).items()} + series_ = series + storage_ = {k: CharmStorage.from_json(v) for k, v in (storage or dict()).items()} + subordinate_ = subordinate + summary_ = summary + tags_ = tags + terms_ = terms + + # Validate arguments against known Juju API types. + if assumes_expr_ is not None and not isinstance(assumes_expr_, (dict, ExpressionTree)): + raise Exception("Expected assumes_expr_ to be a ExpressionTree, received: {}".format(type(assumes_expr_))) + + 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 containers_ is not None and not isinstance(containers_, dict): + raise Exception("Expected containers_ to be a Mapping, received: {}".format(type(containers_))) + + if deployment_ is not None and not isinstance(deployment_, (dict, CharmDeployment)): + raise Exception("Expected deployment_ to be a CharmDeployment, received: {}".format(type(deployment_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if devices_ is not None and not isinstance(devices_, dict): + raise Exception("Expected devices_ to be a Mapping, received: {}".format(type(devices_))) + + if extra_bindings_ is not None and not isinstance(extra_bindings_, dict): + raise Exception("Expected extra_bindings_ to be a Mapping, received: {}".format(type(extra_bindings_))) + + if min_juju_version_ is not None and not isinstance(min_juju_version_, (bytes, str)): + raise Exception("Expected min_juju_version_ to be a str, received: {}".format(type(min_juju_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 payload_classes_ is not None and not isinstance(payload_classes_, dict): + raise Exception("Expected payload_classes_ to be a Mapping, received: {}".format(type(payload_classes_))) + + if peers_ is not None and not isinstance(peers_, dict): + raise Exception("Expected peers_ to be a Mapping, received: {}".format(type(peers_))) + + if provides_ is not None and not isinstance(provides_, dict): + raise Exception("Expected provides_ to be a Mapping, received: {}".format(type(provides_))) + + if requires_ is not None and not isinstance(requires_, dict): + raise Exception("Expected requires_ to be a Mapping, received: {}".format(type(requires_))) + + if resources_ is not None and not isinstance(resources_, dict): + raise Exception("Expected resources_ to be a Mapping, received: {}".format(type(resources_))) + + if series_ is not None and not isinstance(series_, (bytes, str, list)): + raise Exception("Expected series_ to be a Sequence, received: {}".format(type(series_))) + + if storage_ is not None and not isinstance(storage_, dict): + raise Exception("Expected storage_ to be a Mapping, received: {}".format(type(storage_))) + + if subordinate_ is not None and not isinstance(subordinate_, bool): + raise Exception("Expected subordinate_ to be a bool, received: {}".format(type(subordinate_))) + + if summary_ is not None and not isinstance(summary_, (bytes, str)): + raise Exception("Expected summary_ to be a str, received: {}".format(type(summary_))) + + if tags_ is not None and not isinstance(tags_, (bytes, str, list)): + raise Exception("Expected tags_ to be a Sequence, received: {}".format(type(tags_))) + + if terms_ is not None and not isinstance(terms_, (bytes, str, list)): + raise Exception("Expected terms_ to be a Sequence, received: {}".format(type(terms_))) + + self.assumes_expr = assumes_expr_ + self.categories = categories_ + self.containers = containers_ + self.deployment = deployment_ + self.description = description_ + self.devices = devices_ + self.extra_bindings = extra_bindings_ + self.min_juju_version = min_juju_version_ + self.name = name_ + self.payload_classes = payload_classes_ + self.peers = peers_ + self.provides = provides_ + self.requires = requires_ + self.resources = resources_ + self.series = series_ + self.storage = storage_ + self.subordinate = subordinate_ + self.summary = summary_ + self.tags = tags_ + self.terms = terms_ + self.unknown_fields = unknown_fields + + + +class CharmMetric(Type): + _toSchema = {'description': 'description', 'type_': 'type'} + _toPy = {'description': 'description', 'type': 'type_'} + def __init__(self, description=None, type_=None, **unknown_fields): + ''' + description : str + type_ : str + ''' + description_ = description + type__ = type_ + + # Validate arguments against known Juju API types. + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.description = description_ + self.type_ = type__ + self.unknown_fields = 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] + plan : CharmPlan + ''' + metrics_ = {k: CharmMetric.from_json(v) for k, v in (metrics or dict()).items()} + plan_ = CharmPlan.from_json(plan) if plan else None + + # Validate arguments against known Juju API types. + if metrics_ is not None and not isinstance(metrics_, dict): + raise Exception("Expected metrics_ to be a Mapping, received: {}".format(type(metrics_))) + + if plan_ is not None and not isinstance(plan_, (dict, CharmPlan)): + raise Exception("Expected plan_ to be a CharmPlan, received: {}".format(type(plan_))) + + self.metrics = metrics_ + self.plan = plan_ + self.unknown_fields = 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 + storage : str + ''' + location_ = location + storage_ = storage + + # Validate arguments against known Juju API types. + if location_ is not None and not isinstance(location_, (bytes, str)): + raise Exception("Expected location_ to be a str, received: {}".format(type(location_))) + + if storage_ is not None and not isinstance(storage_, (bytes, str)): + raise Exception("Expected storage_ to be a str, received: {}".format(type(storage_))) + + self.location = location_ + self.storage = storage_ + self.unknown_fields = 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 + description : str + type_ : str + ''' + default_ = default + description_ = description + type__ = type_ + + # Validate arguments against known Juju API types. + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.default = default_ + self.description = description_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class CharmOrigin(Type): + _toSchema = {'architecture': 'architecture', 'branch': 'branch', 'hash_': 'hash', 'id_': 'id', 'instance_key': 'instance-key', 'os': 'os', 'revision': 'revision', 'risk': 'risk', 'series': 'series', 'source': 'source', 'track': 'track', 'type_': 'type'} + _toPy = {'architecture': 'architecture', 'branch': 'branch', 'hash': 'hash_', 'id': 'id_', 'instance-key': 'instance_key', 'os': 'os', 'revision': 'revision', 'risk': 'risk', 'series': 'series', 'source': 'source', 'track': 'track', 'type': 'type_'} + def __init__(self, architecture=None, branch=None, hash_=None, id_=None, instance_key=None, os=None, revision=None, risk=None, series=None, source=None, track=None, type_=None, **unknown_fields): + ''' + architecture : str + branch : str + hash_ : str + id_ : str + instance_key : str + os : str + revision : int + risk : str + series : str + source : str + track : str + type_ : str + ''' + architecture_ = architecture + branch_ = branch + hash__ = hash_ + id__ = id_ + instance_key_ = instance_key + os_ = os + revision_ = revision + risk_ = risk + series_ = series + source_ = source + track_ = track + type__ = type_ + + # Validate arguments against known Juju API types. + if architecture_ is not None and not isinstance(architecture_, (bytes, str)): + raise Exception("Expected architecture_ to be a str, received: {}".format(type(architecture_))) + + if branch_ is not None and not isinstance(branch_, (bytes, str)): + raise Exception("Expected branch_ to be a str, received: {}".format(type(branch_))) + + if hash__ is not None and not isinstance(hash__, (bytes, str)): + raise Exception("Expected hash__ to be a str, received: {}".format(type(hash__))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if instance_key_ is not None and not isinstance(instance_key_, (bytes, str)): + raise Exception("Expected instance_key_ to be a str, received: {}".format(type(instance_key_))) + + if os_ is not None and not isinstance(os_, (bytes, str)): + raise Exception("Expected os_ to be a str, received: {}".format(type(os_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if risk_ is not None and not isinstance(risk_, (bytes, str)): + raise Exception("Expected risk_ to be a str, received: {}".format(type(risk_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if source_ is not None and not isinstance(source_, (bytes, str)): + raise Exception("Expected source_ to be a str, received: {}".format(type(source_))) + + if track_ is not None and not isinstance(track_, (bytes, str)): + raise Exception("Expected track_ to be a str, received: {}".format(type(track_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.architecture = architecture_ + self.branch = branch_ + self.hash_ = hash__ + self.id_ = id__ + self.instance_key = instance_key_ + self.os = os_ + self.revision = revision_ + self.risk = risk_ + self.series = series_ + self.source = source_ + self.track = track_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +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 + error : Error + ''' + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.charm_origin = charm_origin_ + self.error = error_ + self.unknown_fields = 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 + type_ : str + ''' + name_ = name + type__ = type_ + + # Validate arguments against known Juju API types. + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.name = name_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class CharmPlan(Type): + _toSchema = {'required': 'required'} + _toPy = {'required': 'required'} + def __init__(self, required=None, **unknown_fields): + ''' + required : bool + ''' + required_ = required + + # Validate arguments against known Juju API types. + if required_ is not None and not isinstance(required_, bool): + raise Exception("Expected required_ to be a bool, received: {}".format(type(required_))) + + self.required = required_ + self.unknown_fields = 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] + error : Error + instance_id : str + model_name : str + profile_changes : typing.Sequence[~ProfileInfoResult] + ''' + current_profiles_ = current_profiles + error_ = Error.from_json(error) if error else None + instance_id_ = instance_id + model_name_ = model_name + profile_changes_ = [ProfileInfoResult.from_json(o) for o in profile_changes or []] + + # Validate arguments against known Juju API types. + if current_profiles_ is not None and not isinstance(current_profiles_, (bytes, str, list)): + raise Exception("Expected current_profiles_ to be a Sequence, received: {}".format(type(current_profiles_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): + raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) + + if model_name_ is not None and not isinstance(model_name_, (bytes, str)): + raise Exception("Expected model_name_ to be a str, received: {}".format(type(model_name_))) + + if profile_changes_ is not None and not isinstance(profile_changes_, (bytes, str, list)): + raise Exception("Expected profile_changes_ to be a Sequence, received: {}".format(type(profile_changes_))) + + self.current_profiles = current_profiles_ + self.error = error_ + self.instance_id = instance_id_ + self.model_name = model_name_ + self.profile_changes = profile_changes_ + self.unknown_fields = unknown_fields + + + +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 + limit : int + name : str + optional : bool + role : str + scope : str + ''' + interface_ = interface + limit_ = limit + name_ = name + optional_ = optional + role_ = role + scope_ = scope + + # Validate arguments against known Juju API types. + if interface_ is not None and not isinstance(interface_, (bytes, str)): + raise Exception("Expected interface_ to be a str, received: {}".format(type(interface_))) + + if limit_ is not None and not isinstance(limit_, int): + raise Exception("Expected limit_ to be a int, received: {}".format(type(limit_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if optional_ is not None and not isinstance(optional_, bool): + raise Exception("Expected optional_ to be a bool, received: {}".format(type(optional_))) + + 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_ is not None and not isinstance(scope_, (bytes, str)): + raise Exception("Expected scope_ to be a str, received: {}".format(type(scope_))) + + self.interface = interface_ + self.limit = limit_ + self.name = name_ + self.optional = optional_ + self.role = role_ + self.scope = scope_ + self.unknown_fields = unknown_fields + + + +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 + fingerprint : typing.Sequence[int] + name : str + origin : str + path : str + revision : int + size : int + type_ : str + ''' + description_ = description + fingerprint_ = fingerprint + name_ = name + origin_ = origin + path_ = path + revision_ = revision + size_ = size + type__ = type_ + + # Validate arguments against known Juju API types. + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if fingerprint_ is not None and not isinstance(fingerprint_, (bytes, str, list)): + raise Exception("Expected fingerprint_ to be a Sequence, received: {}".format(type(fingerprint_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if origin_ is not None and not isinstance(origin_, (bytes, str)): + raise Exception("Expected origin_ to be a str, received: {}".format(type(origin_))) + + if path_ is not None and not isinstance(path_, (bytes, str)): + raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.description = description_ + self.fingerprint = fingerprint_ + self.name = name_ + self.origin = origin_ + self.path = path_ + self.revision = revision_ + self.size = size_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +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 + name : str + path : str + type_ : str + ''' + description_ = description + name_ = name + path_ = path + type__ = type_ + + # Validate arguments against known Juju API types. + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if path_ is not None and not isinstance(path_, (bytes, str)): + raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.description = description_ + self.name = name_ + self.path = path_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +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 + errorresult : ErrorResult + description : str + error : Error + fingerprint : typing.Sequence[int] + name : str + origin : str + path : str + revision : int + size : int + type_ : str + ''' + charmresource_ = CharmResource.from_json(charmresource) if charmresource else None + errorresult_ = ErrorResult.from_json(errorresult) if errorresult else None + description_ = description + error_ = Error.from_json(error) if error else None + fingerprint_ = fingerprint + name_ = name + origin_ = origin + path_ = path + revision_ = revision + size_ = size + type__ = type_ + + # Validate arguments against known Juju API types. + if charmresource_ is not None and not isinstance(charmresource_, (dict, CharmResource)): + raise Exception("Expected charmresource_ to be a CharmResource, received: {}".format(type(charmresource_))) + + if errorresult_ is not None and not isinstance(errorresult_, (dict, ErrorResult)): + raise Exception("Expected errorresult_ to be a ErrorResult, received: {}".format(type(errorresult_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if fingerprint_ is not None and not isinstance(fingerprint_, (bytes, str, list)): + raise Exception("Expected fingerprint_ to be a Sequence, received: {}".format(type(fingerprint_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if origin_ is not None and not isinstance(origin_, (bytes, str)): + raise Exception("Expected origin_ to be a str, received: {}".format(type(origin_))) + + if path_ is not None and not isinstance(path_, (bytes, str)): + raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.charmresource = charmresource_ + self.errorresult = errorresult_ + self.description = description_ + self.error = error_ + self.fingerprint = fingerprint_ + self.name = name_ + self.origin = origin_ + self.path = path_ + self.revision = revision_ + self.size = size_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class CharmResourcesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~CharmResourceResult] + ''' + results_ = [CharmResourceResult.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 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 + count_min : int + description : str + location : str + minimum_size : int + name : str + properties : typing.Sequence[str] + read_only : bool + shared : bool + type_ : str + ''' + 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_ + + # Validate arguments against known Juju API types. + if count_max_ is not None and not isinstance(count_max_, int): + raise Exception("Expected count_max_ to be a int, received: {}".format(type(count_max_))) + + if count_min_ is not None and not isinstance(count_min_, int): + raise Exception("Expected count_min_ to be a int, received: {}".format(type(count_min_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if location_ is not None and not isinstance(location_, (bytes, str)): + raise Exception("Expected location_ to be a str, received: {}".format(type(location_))) + + if minimum_size_ is not None and not isinstance(minimum_size_, int): + raise Exception("Expected minimum_size_ to be a int, received: {}".format(type(minimum_size_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if properties_ is not None and not isinstance(properties_, (bytes, str, list)): + raise Exception("Expected properties_ to be a Sequence, received: {}".format(type(properties_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + if shared_ is not None and not isinstance(shared_, bool): + raise Exception("Expected shared_ to be a bool, received: {}".format(type(shared_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.count_max = count_max_ + self.count_min = count_min_ + self.description = description_ + self.location = location_ + self.minimum_size = minimum_size_ + self.name = name_ + self.properties = properties_ + self.read_only = read_only_ + self.shared = shared_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class CharmSystem(Type): + _toSchema = {'channel': 'channel', 'os': 'os', 'resource': 'resource'} + _toPy = {'channel': 'channel', 'os': 'os', 'resource': 'resource'} + def __init__(self, channel=None, os=None, resource=None, **unknown_fields): + ''' + channel : str + os : str + resource : str + ''' + channel_ = channel + os_ = os + resource_ = resource + + # Validate arguments against known Juju API types. + if channel_ is not None and not isinstance(channel_, (bytes, str)): + raise Exception("Expected channel_ to be a str, received: {}".format(type(channel_))) + + if os_ is not None and not isinstance(os_, (bytes, str)): + raise Exception("Expected os_ to be a str, received: {}".format(type(os_))) + + if resource_ is not None and not isinstance(resource_, (bytes, str)): + raise Exception("Expected resource_ to be a str, received: {}".format(type(resource_))) + + self.channel = channel_ + self.os = os_ + self.resource = resource_ + self.unknown_fields = unknown_fields + + + +class CharmURL(Type): + _toSchema = {'url': 'url'} + _toPy = {'url': 'url'} + def __init__(self, url=None, **unknown_fields): + ''' + url : str + ''' + url_ = url + + # Validate arguments against known Juju API types. + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.url = url_ + self.unknown_fields = 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 + charm_url : str + macaroon : Macaroon + ''' + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + charm_url_ = charm_url + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + + # Validate arguments against known Juju API types. + 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 macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + + self.charm_origin = charm_origin_ + self.charm_url = charm_url_ + self.macaroon = macaroon_ + self.unknown_fields = unknown_fields + + + +class CharmURLAndOrigins(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): + ''' + entities : typing.Sequence[~CharmURLAndOrigin] + ''' + entities_ = [CharmURLAndOrigin.from_json(o) for o in entities or []] + + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + + self.entities = entities_ + self.unknown_fields = 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 + error : Error + url : str + ''' + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + error_ = Error.from_json(error) if error else None + url_ = url + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.charm_origin = charm_origin_ + self.error = error_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class CharmURLs(Type): + _toSchema = {'urls': 'urls'} + _toPy = {'urls': 'urls'} + def __init__(self, urls=None, **unknown_fields): + ''' + urls : typing.Sequence[~CharmURL] + ''' + urls_ = [CharmURL.from_json(o) for o in urls or []] + + # Validate arguments against known Juju API types. + if urls_ is not None and not isinstance(urls_, (bytes, str, list)): + raise Exception("Expected urls_ to be a Sequence, received: {}".format(type(urls_))) + + self.urls = urls_ + self.unknown_fields = unknown_fields + + + +class CharmsList(Type): + _toSchema = {'names': 'names'} + _toPy = {'names': 'names'} + def __init__(self, names=None, **unknown_fields): + ''' + names : typing.Sequence[str] + ''' + names_ = names + + # Validate arguments against known Juju API types. + if names_ is not None and not isinstance(names_, (bytes, str, list)): + raise Exception("Expected names_ to be a Sequence, received: {}".format(type(names_))) + + self.names = names_ + self.unknown_fields = 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] + ''' + charm_urls_ = charm_urls + + # Validate arguments against known Juju API types. + if charm_urls_ is not None and not isinstance(charm_urls_, (bytes, str, list)): + raise Exception("Expected charm_urls_ to be a Sequence, received: {}".format(type(charm_urls_))) + + self.charm_urls = charm_urls_ + self.unknown_fields = unknown_fields + + + +class ClaimLeadershipBulkParams(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~ClaimLeadershipParams] + ''' + params_ = [ClaimLeadershipParams.from_json(o) for o in params or []] + + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + + self.params = params_ + self.unknown_fields = unknown_fields + + + +class ClaimLeadershipBulkResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ErrorResult] + ''' + results_ = [ErrorResult.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 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 + duration : float + unit_tag : str + ''' + application_tag_ = application_tag + duration_ = duration + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) + + if duration_ is not None and not isinstance(duration_, float): + raise Exception("Expected duration_ to be a float, received: {}".format(type(duration_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.application_tag = application_tag_ + self.duration = duration_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +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] + ca_certificates : typing.Sequence[str] + config : typing.Mapping[str, typing.Any] + endpoint : str + host_cloud_region : str + identity_endpoint : str + is_controller_cloud : bool + region_config : typing.Mapping[str, typing.Any] + regions : typing.Sequence[~CloudRegion] + skip_tls_verify : bool + storage_endpoint : str + type_ : str + ''' + 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_ = [CloudRegion.from_json(o) for o in regions or []] + skip_tls_verify_ = skip_tls_verify + storage_endpoint_ = storage_endpoint + type__ = type_ + + # Validate arguments against known Juju API types. + if auth_types_ is not None and not isinstance(auth_types_, (bytes, str, list)): + raise Exception("Expected auth_types_ to be a Sequence, received: {}".format(type(auth_types_))) + + if ca_certificates_ is not None and not isinstance(ca_certificates_, (bytes, str, list)): + raise Exception("Expected ca_certificates_ to be a Sequence, received: {}".format(type(ca_certificates_))) + + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if host_cloud_region_ is not None and not isinstance(host_cloud_region_, (bytes, str)): + raise Exception("Expected host_cloud_region_ to be a str, received: {}".format(type(host_cloud_region_))) + + if identity_endpoint_ is not None and not isinstance(identity_endpoint_, (bytes, str)): + raise Exception("Expected identity_endpoint_ to be a str, received: {}".format(type(identity_endpoint_))) + + if is_controller_cloud_ is not None and not isinstance(is_controller_cloud_, bool): + raise Exception("Expected is_controller_cloud_ to be a bool, received: {}".format(type(is_controller_cloud_))) + + if region_config_ is not None and not isinstance(region_config_, dict): + raise Exception("Expected region_config_ to be a Mapping, received: {}".format(type(region_config_))) + + if regions_ is not None and not isinstance(regions_, (bytes, str, list)): + raise Exception("Expected regions_ to be a Sequence, received: {}".format(type(regions_))) + + if skip_tls_verify_ is not None and not isinstance(skip_tls_verify_, bool): + raise Exception("Expected skip_tls_verify_ to be a bool, received: {}".format(type(skip_tls_verify_))) + + if storage_endpoint_ is not None and not isinstance(storage_endpoint_, (bytes, str)): + raise Exception("Expected storage_endpoint_ to be a str, received: {}".format(type(storage_endpoint_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.auth_types = auth_types_ + self.ca_certificates = ca_certificates_ + self.config = config_ + self.endpoint = endpoint_ + self.host_cloud_region = host_cloud_region_ + self.identity_endpoint = identity_endpoint_ + self.is_controller_cloud = is_controller_cloud_ + self.region_config = region_config_ + self.regions = regions_ + self.skip_tls_verify = skip_tls_verify_ + self.storage_endpoint = storage_endpoint_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +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] + auth_type : str + redacted : typing.Sequence[str] + ''' + attrs_ = attrs + auth_type_ = auth_type + redacted_ = redacted + + # Validate arguments against known Juju API types. + if attrs_ is not None and not isinstance(attrs_, dict): + raise Exception("Expected attrs_ to be a Mapping, received: {}".format(type(attrs_))) + + if auth_type_ is not None and not isinstance(auth_type_, (bytes, str)): + raise Exception("Expected auth_type_ to be a str, received: {}".format(type(auth_type_))) + + if redacted_ is not None and not isinstance(redacted_, (bytes, str, list)): + raise Exception("Expected redacted_ to be a Sequence, received: {}".format(type(redacted_))) + + self.attrs = attrs_ + self.auth_type = auth_type_ + self.redacted = redacted_ + self.unknown_fields = 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 + credential_name : str + ''' + cloud_name_ = cloud_name + credential_name_ = credential_name + + # Validate arguments against known Juju API types. + if cloud_name_ is not None and not isinstance(cloud_name_, (bytes, str)): + raise Exception("Expected cloud_name_ to be a str, received: {}".format(type(cloud_name_))) + + if credential_name_ is not None and not isinstance(credential_name_, (bytes, str)): + raise Exception("Expected credential_name_ to be a str, received: {}".format(type(credential_name_))) + + self.cloud_name = cloud_name_ + self.credential_name = credential_name_ + self.unknown_fields = 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] + include_secrets : bool + ''' + credentials_ = [CloudCredentialArg.from_json(o) for o in credentials or []] + include_secrets_ = include_secrets + + # Validate arguments against known Juju API types. + 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_))) + + self.credentials = credentials_ + self.include_secrets = include_secrets_ + self.unknown_fields = 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 + result : CloudCredential + ''' + error_ = Error.from_json(error) if error else None + result_ = CloudCredential.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, CloudCredential)): + raise Exception("Expected result_ to be a CloudCredential, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class CloudCredentialResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~CloudCredentialResult] + ''' + results_ = [CloudCredentialResult.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 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] + endpoint : str + identity_endpoint : str + regions : typing.Sequence[~CloudRegion] + storage_endpoint : str + type_ : str + ''' + auth_types_ = auth_types + endpoint_ = endpoint + identity_endpoint_ = identity_endpoint + regions_ = [CloudRegion.from_json(o) for o in regions or []] + storage_endpoint_ = storage_endpoint + type__ = type_ + + # Validate arguments against known Juju API types. + if auth_types_ is not None and not isinstance(auth_types_, (bytes, str, list)): + raise Exception("Expected auth_types_ to be a Sequence, received: {}".format(type(auth_types_))) + + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if identity_endpoint_ is not None and not isinstance(identity_endpoint_, (bytes, str)): + raise Exception("Expected identity_endpoint_ to be a str, received: {}".format(type(identity_endpoint_))) + + if regions_ is not None and not isinstance(regions_, (bytes, str, list)): + raise Exception("Expected regions_ to be a Sequence, received: {}".format(type(regions_))) + + if storage_endpoint_ is not None and not isinstance(storage_endpoint_, (bytes, str)): + raise Exception("Expected storage_endpoint_ to be a str, received: {}".format(type(storage_endpoint_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.auth_types = auth_types_ + self.endpoint = endpoint_ + self.identity_endpoint = identity_endpoint_ + self.regions = regions_ + self.storage_endpoint = storage_endpoint_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +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', 'series': 'series', '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', 'series': 'series', '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, series=None, source=None, stream=None, version=None, virt_type=None, **unknown_fields): + ''' + arch : str + image_id : str + priority : int + region : str + root_storage_size : int + root_storage_type : str + series : str + source : str + stream : str + version : str + virt_type : str + ''' + arch_ = arch + image_id_ = image_id + priority_ = priority + region_ = region + root_storage_size_ = root_storage_size + root_storage_type_ = root_storage_type + series_ = series + source_ = source + stream_ = stream + version_ = version + virt_type_ = virt_type + + # Validate arguments against known Juju API types. + if arch_ is not None and not isinstance(arch_, (bytes, str)): + raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) + + if image_id_ is not None and not isinstance(image_id_, (bytes, str)): + raise Exception("Expected image_id_ to be a str, received: {}".format(type(image_id_))) + + if priority_ is not None and not isinstance(priority_, int): + raise Exception("Expected priority_ to be a int, received: {}".format(type(priority_))) + + 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_size_ is not None and not isinstance(root_storage_size_, int): + raise Exception("Expected root_storage_size_ to be a int, received: {}".format(type(root_storage_size_))) + + 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 series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if source_ is not None and not isinstance(source_, (bytes, str)): + raise Exception("Expected source_ to be a str, received: {}".format(type(source_))) + + if stream_ is not None and not isinstance(stream_, (bytes, str)): + raise Exception("Expected stream_ to be a str, received: {}".format(type(stream_))) + + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + + 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_))) + + self.arch = arch_ + self.image_id = image_id_ + self.priority = priority_ + self.region = region_ + self.root_storage_size = root_storage_size_ + self.root_storage_type = root_storage_type_ + self.series = series_ + self.source = source_ + self.stream = stream_ + self.version = version_ + self.virt_type = virt_type_ + self.unknown_fields = unknown_fields + + + +class CloudImageMetadataList(Type): + _toSchema = {'metadata': 'metadata'} + _toPy = {'metadata': 'metadata'} + def __init__(self, metadata=None, **unknown_fields): + ''' + metadata : typing.Sequence[~CloudImageMetadata] + ''' + metadata_ = [CloudImageMetadata.from_json(o) for o in metadata or []] + + # Validate arguments against known Juju API types. + if metadata_ is not None and not isinstance(metadata_, (bytes, str, list)): + raise Exception("Expected metadata_ to be a Sequence, received: {}".format(type(metadata_))) + + self.metadata = metadata_ + self.unknown_fields = 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 + users : typing.Sequence[~CloudUserInfo] + ''' + clouddetails_ = CloudDetails.from_json(clouddetails) if clouddetails else None + users_ = [CloudUserInfo.from_json(o) for o in users or []] + + # Validate arguments against known Juju API types. + if clouddetails_ is not None and not isinstance(clouddetails_, (dict, CloudDetails)): + raise Exception("Expected clouddetails_ to be a CloudDetails, received: {}".format(type(clouddetails_))) + + 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.clouddetails = clouddetails_ + self.users = users_ + self.unknown_fields = 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 + result : CloudInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = CloudInfo.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, CloudInfo)): + raise Exception("Expected result_ to be a CloudInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class CloudInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~CloudInfoResult] + ''' + results_ = [CloudInfoResult.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 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 + constraints : Value + region : str + ''' + cloud_tag_ = cloud_tag + constraints_ = Value.from_json(constraints) if constraints else None + region_ = region + + # Validate arguments against known Juju API types. + 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 constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if region_ is not None and not isinstance(region_, (bytes, str)): + raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + + self.cloud_tag = cloud_tag_ + self.constraints = constraints_ + self.region = region_ + self.unknown_fields = unknown_fields + + + +class CloudInstanceTypesConstraints(Type): + _toSchema = {'constraints': 'constraints'} + _toPy = {'constraints': 'constraints'} + def __init__(self, constraints=None, **unknown_fields): + ''' + constraints : typing.Sequence[~CloudInstanceTypesConstraint] + ''' + constraints_ = [CloudInstanceTypesConstraint.from_json(o) for o in constraints or []] + + # Validate arguments against known Juju API types. + if constraints_ is not None and not isinstance(constraints_, (bytes, str, list)): + raise Exception("Expected constraints_ to be a Sequence, received: {}".format(type(constraints_))) + + self.constraints = constraints_ + self.unknown_fields = 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 + identity_endpoint : str + name : str + storage_endpoint : str + ''' + endpoint_ = endpoint + identity_endpoint_ = identity_endpoint + name_ = name + storage_endpoint_ = storage_endpoint + + # Validate arguments against known Juju API types. + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if identity_endpoint_ is not None and not isinstance(identity_endpoint_, (bytes, str)): + raise Exception("Expected identity_endpoint_ to be a str, received: {}".format(type(identity_endpoint_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if storage_endpoint_ is not None and not isinstance(storage_endpoint_, (bytes, str)): + raise Exception("Expected storage_endpoint_ to be a str, received: {}".format(type(storage_endpoint_))) + + self.endpoint = endpoint_ + self.identity_endpoint = identity_endpoint_ + self.name = name_ + self.storage_endpoint = storage_endpoint_ + self.unknown_fields = unknown_fields + + + +class CloudResult(Type): + _toSchema = {'cloud': 'cloud', 'error': 'error'} + _toPy = {'cloud': 'cloud', 'error': 'error'} + def __init__(self, cloud=None, error=None, **unknown_fields): + ''' + cloud : Cloud + error : Error + ''' + cloud_ = Cloud.from_json(cloud) if cloud else None + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if cloud_ is not None and not isinstance(cloud_, (dict, Cloud)): + raise Exception("Expected cloud_ to be a Cloud, received: {}".format(type(cloud_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.cloud = cloud_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class CloudResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~CloudResult] + ''' + results_ = [CloudResult.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 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] + credential : CloudCredential + endpoint : str + identity_endpoint : str + is_controller_cloud : bool + name : str + region : str + skip_tls_verify : bool + storage_endpoint : str + type_ : str + ''' + cacertificates_ = cacertificates + credential_ = CloudCredential.from_json(credential) if credential else None + 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_ + + # Validate arguments against known Juju API types. + if cacertificates_ is not None and not isinstance(cacertificates_, (bytes, str, list)): + raise Exception("Expected cacertificates_ to be a Sequence, received: {}".format(type(cacertificates_))) + + if credential_ is not None and not isinstance(credential_, (dict, CloudCredential)): + raise Exception("Expected credential_ to be a CloudCredential, received: {}".format(type(credential_))) + + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if identity_endpoint_ is not None and not isinstance(identity_endpoint_, (bytes, str)): + raise Exception("Expected identity_endpoint_ to be a str, received: {}".format(type(identity_endpoint_))) + + if is_controller_cloud_ is not None and not isinstance(is_controller_cloud_, bool): + raise Exception("Expected is_controller_cloud_ to be a bool, received: {}".format(type(is_controller_cloud_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if region_ is not None and not isinstance(region_, (bytes, str)): + raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + + if skip_tls_verify_ is not None and not isinstance(skip_tls_verify_, bool): + raise Exception("Expected skip_tls_verify_ to be a bool, received: {}".format(type(skip_tls_verify_))) + + if storage_endpoint_ is not None and not isinstance(storage_endpoint_, (bytes, str)): + raise Exception("Expected storage_endpoint_ to be a str, received: {}".format(type(storage_endpoint_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.cacertificates = cacertificates_ + self.credential = credential_ + self.endpoint = endpoint_ + self.identity_endpoint = identity_endpoint_ + self.is_controller_cloud = is_controller_cloud_ + self.name = name_ + self.region = region_ + self.skip_tls_verify = skip_tls_verify_ + self.storage_endpoint = storage_endpoint_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class CloudSpecResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : CloudSpec + ''' + error_ = Error.from_json(error) if error else None + result_ = CloudSpec.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, CloudSpec)): + raise Exception("Expected result_ to be a CloudSpec, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class CloudSpecResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~CloudSpecResult] + ''' + results_ = [CloudSpecResult.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 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 + display_name : str + user : str + ''' + access_ = access + display_name_ = display_name + user_ = user + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if user_ is not None and not isinstance(user_, (bytes, str)): + raise Exception("Expected user_ to be a str, received: {}".format(type(user_))) + + self.access = access_ + self.display_name = display_name_ + self.user = user_ + self.unknown_fields = unknown_fields + + + +class CloudsResult(Type): + _toSchema = {'clouds': 'clouds'} + _toPy = {'clouds': 'clouds'} + def __init__(self, clouds=None, **unknown_fields): + ''' + clouds : typing.Mapping[str, ~Cloud] + ''' + clouds_ = {k: Cloud.from_json(v) for k, v in (clouds or dict()).items()} + + # Validate arguments against known Juju API types. + if clouds_ is not None and not isinstance(clouds_, dict): + raise Exception("Expected clouds_ to be a Mapping, received: {}".format(type(clouds_))) + + self.clouds = clouds_ + self.unknown_fields = 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', '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', '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, 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] + open_ports : typing.Sequence[~EntityPortRange] + pod_spec : PodSpec + relation_unit_settings : typing.Sequence[~RelationUnitSettings] + set_raw_k8s_spec : PodSpec + tag : str + unit_state : SetUnitStateArg + update_network_info : bool + ''' + add_storage_ = [StorageAddParams.from_json(o) for o in add_storage or []] + close_ports_ = [EntityPortRange.from_json(o) for o in close_ports or []] + open_ports_ = [EntityPortRange.from_json(o) for o in open_ports or []] + pod_spec_ = PodSpec.from_json(pod_spec) if pod_spec else None + relation_unit_settings_ = [RelationUnitSettings.from_json(o) for o in relation_unit_settings or []] + set_raw_k8s_spec_ = PodSpec.from_json(set_raw_k8s_spec) if set_raw_k8s_spec else None + tag_ = tag + unit_state_ = SetUnitStateArg.from_json(unit_state) if unit_state else None + update_network_info_ = update_network_info + + # Validate arguments against known Juju API types. + if add_storage_ is not None and not isinstance(add_storage_, (bytes, str, list)): + raise Exception("Expected add_storage_ to be a Sequence, received: {}".format(type(add_storage_))) + + if close_ports_ is not None and not isinstance(close_ports_, (bytes, str, list)): + raise Exception("Expected close_ports_ to be a Sequence, received: {}".format(type(close_ports_))) + + if open_ports_ is not None and not isinstance(open_ports_, (bytes, str, list)): + raise Exception("Expected open_ports_ to be a Sequence, received: {}".format(type(open_ports_))) + + if pod_spec_ is not None and not isinstance(pod_spec_, (dict, PodSpec)): + raise Exception("Expected pod_spec_ to be a PodSpec, received: {}".format(type(pod_spec_))) + + if relation_unit_settings_ is not None and not isinstance(relation_unit_settings_, (bytes, str, list)): + raise Exception("Expected relation_unit_settings_ to be a Sequence, received: {}".format(type(relation_unit_settings_))) + + if set_raw_k8s_spec_ is not None and not isinstance(set_raw_k8s_spec_, (dict, PodSpec)): + raise Exception("Expected set_raw_k8s_spec_ to be a PodSpec, received: {}".format(type(set_raw_k8s_spec_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if unit_state_ is not None and not isinstance(unit_state_, (dict, SetUnitStateArg)): + raise Exception("Expected unit_state_ to be a SetUnitStateArg, received: {}".format(type(unit_state_))) + + if update_network_info_ is not None and not isinstance(update_network_info_, bool): + raise Exception("Expected update_network_info_ to be a bool, received: {}".format(type(update_network_info_))) + + self.add_storage = add_storage_ + self.close_ports = close_ports_ + self.open_ports = open_ports_ + self.pod_spec = pod_spec_ + self.relation_unit_settings = relation_unit_settings_ + self.set_raw_k8s_spec = set_raw_k8s_spec_ + self.tag = tag_ + self.unit_state = unit_state_ + self.update_network_info = update_network_info_ + self.unknown_fields = unknown_fields + + + +class CommitHookChangesArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~CommitHookChangesArg] + ''' + args_ = [CommitHookChangesArg.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 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] + error : Error + ''' + config_ = config + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.config = config_ + self.error = error_ + self.unknown_fields = 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 + config : typing.Mapping[str, str] + config_yaml : str + generation : str + ''' + application_ = application + config_ = config + config_yaml_ = config_yaml + generation_ = generation + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if config_yaml_ is not None and not isinstance(config_yaml_, (bytes, str)): + raise Exception("Expected config_yaml_ to be a str, received: {}".format(type(config_yaml_))) + + if generation_ is not None and not isinstance(generation_, (bytes, str)): + raise Exception("Expected generation_ to be a str, received: {}".format(type(generation_))) + + self.application = application_ + self.config = config_ + self.config_yaml = config_yaml_ + self.generation = generation_ + self.unknown_fields = unknown_fields + + + +class ConfigSetArgs(Type): + _toSchema = {'args': 'Args'} + _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~ConfigSet] + ''' + args_ = [ConfigSet.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 ConfigSettingsResult(Type): + _toSchema = {'error': 'error', 'settings': 'settings'} + _toPy = {'error': 'error', 'settings': 'settings'} + def __init__(self, error=None, settings=None, **unknown_fields): + ''' + error : Error + settings : typing.Mapping[str, typing.Any] + ''' + error_ = Error.from_json(error) if error else None + settings_ = settings + + # 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 settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) + + self.error = error_ + self.settings = settings_ + self.unknown_fields = unknown_fields + + + +class ConfigSettingsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ConfigSettingsResult] + ''' + results_ = [ConfigSettingsResult.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 ConfigValue(Type): + _toSchema = {'source': 'source', 'value': 'value'} + _toPy = {'source': 'source', 'value': 'value'} + def __init__(self, source=None, value=None, **unknown_fields): + ''' + source : str + value : Any + ''' + source_ = source + value_ = value + + # Validate arguments against known Juju API types. + if source_ is not None and not isinstance(source_, (bytes, str)): + raise Exception("Expected source_ to be a str, received: {}".format(type(source_))) + + self.source = source_ + self.value = value_ + self.unknown_fields = 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 + pool : str + size : int + ''' + count_ = count + pool_ = pool + size_ = size + + # Validate arguments against known Juju API types. + if count_ is not None and not isinstance(count_, int): + raise Exception("Expected count_ to be a int, received: {}".format(type(count_))) + + if pool_ is not None and not isinstance(pool_, (bytes, str)): + raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + self.count = count_ + self.pool = pool_ + self.size = size_ + self.unknown_fields = 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 + error : Error + ''' + constraints_ = Value.from_json(constraints) if constraints else None + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.constraints = constraints_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class ConstraintsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ConstraintsResult] + ''' + results_ = [ConstraintsResult.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 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 + application_alias : str + application_description : str + bindings : typing.Mapping[str, str] + endpoints : typing.Sequence[~RemoteEndpoint] + external_controller : ExternalControllerInfo + macaroon : Macaroon + offer_name : str + offer_url : str + offer_uuid : str + source_model_tag : str + spaces : typing.Sequence[~RemoteSpace] + users : typing.Sequence[~OfferUserDetails] + ''' + applicationofferdetails_ = ApplicationOfferDetails.from_json(applicationofferdetails) if applicationofferdetails else None + application_alias_ = application_alias + application_description_ = application_description + bindings_ = bindings + 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 + spaces_ = [RemoteSpace.from_json(o) for o in spaces or []] + users_ = [OfferUserDetails.from_json(o) for o in users or []] + + # Validate arguments against known Juju API types. + if applicationofferdetails_ is not None and not isinstance(applicationofferdetails_, (dict, ApplicationOfferDetails)): + raise Exception("Expected applicationofferdetails_ to be a ApplicationOfferDetails, received: {}".format(type(applicationofferdetails_))) + + 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 bindings_ is not None and not isinstance(bindings_, dict): + raise Exception("Expected bindings_ to be a Mapping, received: {}".format(type(bindings_))) + + 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 spaces_ is not None and not isinstance(spaces_, (bytes, str, list)): + raise Exception("Expected spaces_ to be a Sequence, received: {}".format(type(spaces_))) + + 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.applicationofferdetails = applicationofferdetails_ + self.application_alias = application_alias_ + self.application_description = application_description_ + self.bindings = bindings_ + 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.spaces = spaces_ + self.users = users_ + self.unknown_fields = unknown_fields + + + +class ConsumeApplicationArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~ConsumeApplicationArg] + ''' + args_ = [ConsumeApplicationArg.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 ConsumeApplicationResult(Type): + _toSchema = {'error': 'error', 'local_name': 'local-name'} + _toPy = {'error': 'error', 'local-name': 'local_name'} + def __init__(self, error=None, local_name=None, **unknown_fields): + ''' + error : Error + local_name : str + ''' + error_ = Error.from_json(error) if error else None + local_name_ = local_name + + # 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 local_name_ is not None and not isinstance(local_name_, (bytes, str)): + raise Exception("Expected local_name_ to be a str, received: {}".format(type(local_name_))) + + self.error = error_ + self.local_name = local_name_ + self.unknown_fields = unknown_fields + + + +class ConsumeApplicationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ConsumeApplicationResult] + ''' + results_ = [ConsumeApplicationResult.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 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 + macaroon : Macaroon + offer : ApplicationOfferDetails + ''' + 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 + + # Validate arguments against known Juju API types. + 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_ is not None and not isinstance(offer_, (dict, ApplicationOfferDetails)): + raise Exception("Expected offer_ to be a ApplicationOfferDetails, received: {}".format(type(offer_))) + + self.external_controller = external_controller_ + self.macaroon = macaroon_ + self.offer = offer_ + self.unknown_fields = unknown_fields + + + +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 + user_tag : str + ''' + offer_urls_ = OfferURLs.from_json(offer_urls) if offer_urls else None + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + 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_))) + + self.offer_urls = offer_urls_ + self.user_tag = user_tag_ + self.unknown_fields = 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 + error : Error + external_controller : ExternalControllerInfo + macaroon : Macaroon + offer : ApplicationOfferDetails + ''' + 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 + + # Validate arguments against known Juju API types. + if consumeofferdetails_ is not None and not isinstance(consumeofferdetails_, (dict, ConsumeOfferDetails)): + raise Exception("Expected consumeofferdetails_ to be a ConsumeOfferDetails, received: {}".format(type(consumeofferdetails_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + 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_ is not None and not isinstance(offer_, (dict, ApplicationOfferDetails)): + raise Exception("Expected offer_ to be a ApplicationOfferDetails, received: {}".format(type(offer_))) + + self.consumeofferdetails = consumeofferdetails_ + self.error = error_ + self.external_controller = external_controller_ + self.macaroon = macaroon_ + self.offer = offer_ + self.unknown_fields = unknown_fields + + + +class ConsumeOfferDetailsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ConsumeOfferDetailsResult] + ''' + results_ = [ConsumeOfferDetailsResult.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 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 + apt_mirror : str + apt_proxy : Settings + authorized_keys : str + cloudinit_userdata : typing.Mapping[str, typing.Any] + container_inherit_properties : str + juju_proxy : Settings + legacy_proxy : Settings + provider_type : str + snap_proxy : Settings + snap_store_assertions : str + snap_store_proxy_id : str + snap_store_proxy_url : str + ssl_hostname_verification : bool + ''' + updatebehavior_ = UpdateBehavior.from_json(updatebehavior) if updatebehavior else None + apt_mirror_ = apt_mirror + apt_proxy_ = Settings.from_json(apt_proxy) if apt_proxy else None + authorized_keys_ = authorized_keys + cloudinit_userdata_ = cloudinit_userdata + container_inherit_properties_ = container_inherit_properties + juju_proxy_ = Settings.from_json(juju_proxy) if juju_proxy else None + legacy_proxy_ = Settings.from_json(legacy_proxy) if legacy_proxy else None + provider_type_ = provider_type + snap_proxy_ = Settings.from_json(snap_proxy) if snap_proxy else None + 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 + + # Validate arguments against known Juju API types. + if updatebehavior_ is not None and not isinstance(updatebehavior_, (dict, UpdateBehavior)): + raise Exception("Expected updatebehavior_ to be a UpdateBehavior, received: {}".format(type(updatebehavior_))) + + if apt_mirror_ is not None and not isinstance(apt_mirror_, (bytes, str)): + raise Exception("Expected apt_mirror_ to be a str, received: {}".format(type(apt_mirror_))) + + if apt_proxy_ is not None and not isinstance(apt_proxy_, (dict, Settings)): + raise Exception("Expected apt_proxy_ to be a Settings, received: {}".format(type(apt_proxy_))) + + if authorized_keys_ is not None and not isinstance(authorized_keys_, (bytes, str)): + raise Exception("Expected authorized_keys_ to be a str, received: {}".format(type(authorized_keys_))) + + if cloudinit_userdata_ is not None and not isinstance(cloudinit_userdata_, dict): + raise Exception("Expected cloudinit_userdata_ to be a Mapping, received: {}".format(type(cloudinit_userdata_))) + + if container_inherit_properties_ is not None and not isinstance(container_inherit_properties_, (bytes, str)): + raise Exception("Expected container_inherit_properties_ to be a str, received: {}".format(type(container_inherit_properties_))) + + if juju_proxy_ is not None and not isinstance(juju_proxy_, (dict, Settings)): + raise Exception("Expected juju_proxy_ to be a Settings, received: {}".format(type(juju_proxy_))) + + if legacy_proxy_ is not None and not isinstance(legacy_proxy_, (dict, Settings)): + raise Exception("Expected legacy_proxy_ to be a Settings, received: {}".format(type(legacy_proxy_))) + + if provider_type_ is not None and not isinstance(provider_type_, (bytes, str)): + raise Exception("Expected provider_type_ to be a str, received: {}".format(type(provider_type_))) + + if snap_proxy_ is not None and not isinstance(snap_proxy_, (dict, Settings)): + raise Exception("Expected snap_proxy_ to be a Settings, received: {}".format(type(snap_proxy_))) + + if snap_store_assertions_ is not None and not isinstance(snap_store_assertions_, (bytes, str)): + raise Exception("Expected snap_store_assertions_ to be a str, received: {}".format(type(snap_store_assertions_))) + + if snap_store_proxy_id_ is not None and not isinstance(snap_store_proxy_id_, (bytes, str)): + raise Exception("Expected snap_store_proxy_id_ to be a str, received: {}".format(type(snap_store_proxy_id_))) + + if snap_store_proxy_url_ is not None and not isinstance(snap_store_proxy_url_, (bytes, str)): + raise Exception("Expected snap_store_proxy_url_ to be a str, received: {}".format(type(snap_store_proxy_url_))) + + if ssl_hostname_verification_ is not None and not isinstance(ssl_hostname_verification_, bool): + raise Exception("Expected ssl_hostname_verification_ to be a bool, received: {}".format(type(ssl_hostname_verification_))) + + self.updatebehavior = updatebehavior_ + self.apt_mirror = apt_mirror_ + self.apt_proxy = apt_proxy_ + self.authorized_keys = authorized_keys_ + self.cloudinit_userdata = cloudinit_userdata_ + self.container_inherit_properties = container_inherit_properties_ + self.juju_proxy = juju_proxy_ + self.legacy_proxy = legacy_proxy_ + self.provider_type = provider_type_ + self.snap_proxy = snap_proxy_ + self.snap_store_assertions = snap_store_assertions_ + self.snap_store_proxy_id = snap_store_proxy_id_ + self.snap_store_proxy_url = snap_store_proxy_url_ + self.ssl_hostname_verification = ssl_hostname_verification_ + self.unknown_fields = unknown_fields + + + +class ContainerLXDProfile(Type): + _toSchema = {'name': 'name', 'profile': 'profile'} + _toPy = {'name': 'name', 'profile': 'profile'} + def __init__(self, name=None, profile=None, **unknown_fields): + ''' + name : str + profile : CharmLXDProfile + ''' + name_ = name + profile_ = CharmLXDProfile.from_json(profile) if profile else None + + # Validate arguments against known Juju API types. + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if profile_ is not None and not isinstance(profile_, (dict, CharmLXDProfile)): + raise Exception("Expected profile_ to be a CharmLXDProfile, received: {}".format(type(profile_))) + + self.name = name_ + self.profile = profile_ + self.unknown_fields = unknown_fields + + + +class ContainerManagerConfig(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): + ''' + config : typing.Mapping[str, str] + ''' + config_ = config + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + self.config = config_ + self.unknown_fields = unknown_fields + + + +class ContainerManagerConfigParams(Type): + _toSchema = {'type_': 'type'} + _toPy = {'type': 'type_'} + def __init__(self, type_=None, **unknown_fields): + ''' + type_ : str + ''' + type__ = type_ + + # Validate arguments against known Juju API types. + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.type_ = type__ + self.unknown_fields = 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 + lxd_profiles : typing.Sequence[~ContainerLXDProfile] + ''' + error_ = Error.from_json(error) if error else None + lxd_profiles_ = [ContainerLXDProfile.from_json(o) for o in lxd_profiles or []] + + # 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 lxd_profiles_ is not None and not isinstance(lxd_profiles_, (bytes, str, list)): + raise Exception("Expected lxd_profiles_ to be a Sequence, received: {}".format(type(lxd_profiles_))) + + self.error = error_ + self.lxd_profiles = lxd_profiles_ + self.unknown_fields = unknown_fields + + + +class ContainerProfileResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ContainerProfileResult] + ''' + results_ = [ContainerProfileResult.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 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 + error : Error + ''' + container_type_ = container_type + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if container_type_ is not None and not isinstance(container_type_, (bytes, str)): + raise Exception("Expected container_type_ to be a str, received: {}".format(type(container_type_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.container_type = container_type_ + self.error = error_ + self.unknown_fields = 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] + cacert : str + error : Error + ''' + addresses_ = addresses + cacert_ = cacert + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if cacert_ is not None and not isinstance(cacert_, (bytes, str)): + raise Exception("Expected cacert_ to be a str, received: {}".format(type(cacert_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.addresses = addresses_ + self.cacert = cacert_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class ControllerAPIInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ControllerAPIInfoResult] + ''' + results_ = [ControllerAPIInfoResult.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 ControllerConfigResult(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): + ''' + config : typing.Mapping[str, typing.Any] + ''' + config_ = config + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + self.config = config_ + self.unknown_fields = unknown_fields + + + +class ControllerConfigSet(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): + ''' + config : typing.Mapping[str, typing.Any] + ''' + config_ = config + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + self.config = config_ + self.unknown_fields = 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 + models : typing.Sequence[~ModelAccess] + ''' + content_ = CredentialContent.from_json(content) if content else None + models_ = [ModelAccess.from_json(o) for o in models or []] + + # Validate arguments against known Juju API types. + if content_ is not None and not isinstance(content_, (dict, CredentialContent)): + raise Exception("Expected content_ to be a CredentialContent, received: {}".format(type(content_))) + + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + self.content = content_ + self.models = models_ + self.unknown_fields = 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 + version : str + ''' + git_commit_ = git_commit + version_ = version + + # Validate arguments against known Juju API types. + if git_commit_ is not None and not isinstance(git_commit_, (bytes, str)): + raise Exception("Expected git_commit_ to be a str, received: {}".format(type(git_commit_))) + + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + + self.git_commit = git_commit_ + self.version = version_ + self.unknown_fields = 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 + result : ControllersChanges + ''' + error_ = Error.from_json(error) if error else None + result_ = ControllersChanges.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, ControllersChanges)): + raise Exception("Expected result_ to be a ControllersChanges, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ControllersChangeResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ControllersChangeResult] + ''' + results_ = [ControllersChangeResult.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 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] + converted : typing.Sequence[str] + maintained : typing.Sequence[str] + removed : typing.Sequence[str] + ''' + added_ = added + converted_ = converted + maintained_ = maintained + removed_ = removed + + # Validate arguments against known Juju API types. + if added_ is not None and not isinstance(added_, (bytes, str, list)): + raise Exception("Expected added_ to be a Sequence, received: {}".format(type(added_))) + + if converted_ is not None and not isinstance(converted_, (bytes, str, list)): + raise Exception("Expected converted_ to be a Sequence, received: {}".format(type(converted_))) + + if maintained_ is not None and not isinstance(maintained_, (bytes, str, list)): + raise Exception("Expected maintained_ to be a Sequence, received: {}".format(type(maintained_))) + + if removed_ is not None and not isinstance(removed_, (bytes, str, list)): + raise Exception("Expected removed_ to be a Sequence, received: {}".format(type(removed_))) + + self.added = added_ + self.converted = converted_ + self.maintained = maintained_ + self.removed = removed_ + self.unknown_fields = unknown_fields + + + +class ControllersSpec(Type): + _toSchema = {'constraints': 'constraints', 'num_controllers': 'num-controllers', 'placement': 'placement', 'series': 'series'} + _toPy = {'constraints': 'constraints', 'num-controllers': 'num_controllers', 'placement': 'placement', 'series': 'series'} + def __init__(self, constraints=None, num_controllers=None, placement=None, series=None, **unknown_fields): + ''' + constraints : Value + num_controllers : int + placement : typing.Sequence[str] + series : str + ''' + constraints_ = Value.from_json(constraints) if constraints else None + num_controllers_ = num_controllers + placement_ = placement + series_ = series + + # Validate arguments against known Juju API types. + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if num_controllers_ is not None and not isinstance(num_controllers_, int): + raise Exception("Expected num_controllers_ to be a int, received: {}".format(type(num_controllers_))) + + 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 series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + self.constraints = constraints_ + self.num_controllers = num_controllers_ + self.placement = placement_ + self.series = series_ + self.unknown_fields = unknown_fields + + + +class ControllersSpecs(Type): + _toSchema = {'specs': 'specs'} + _toPy = {'specs': 'specs'} + def __init__(self, specs=None, **unknown_fields): + ''' + specs : typing.Sequence[~ControllersSpec] + ''' + specs_ = [ControllersSpec.from_json(o) for o in specs or []] + + # Validate arguments against known Juju API types. + if specs_ is not None and not isinstance(specs_, (bytes, str, list)): + raise Exception("Expected specs_ to be a Sequence, received: {}".format(type(specs_))) + + self.specs = specs_ + self.unknown_fields = unknown_fields + + + +class CreateSecretArg(Type): + _toSchema = {'data': 'data', 'description': 'description', 'params': 'params', 'path': 'path', 'rotate_interval': 'rotate-interval', 'status': 'status', 'tags': 'tags', 'type_': 'type'} + _toPy = {'data': 'data', 'description': 'description', 'params': 'params', 'path': 'path', 'rotate-interval': 'rotate_interval', 'status': 'status', 'tags': 'tags', 'type': 'type_'} + def __init__(self, data=None, description=None, params=None, path=None, rotate_interval=None, status=None, tags=None, type_=None, **unknown_fields): + ''' + data : typing.Mapping[str, str] + description : str + params : typing.Mapping[str, typing.Any] + path : str + rotate_interval : int + status : str + tags : typing.Mapping[str, str] + type_ : str + ''' + data_ = data + description_ = description + params_ = params + path_ = path + rotate_interval_ = rotate_interval + status_ = status + tags_ = tags + type__ = type_ + + # Validate arguments against known Juju API types. + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if params_ is not None and not isinstance(params_, dict): + raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) + + if path_ is not None and not isinstance(path_, (bytes, str)): + raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + + if rotate_interval_ is not None and not isinstance(rotate_interval_, int): + raise Exception("Expected rotate_interval_ to be a int, received: {}".format(type(rotate_interval_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.data = data_ + self.description = description_ + self.params = params_ + self.path = path_ + self.rotate_interval = rotate_interval_ + self.status = status_ + self.tags = tags_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class CreateSecretArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~CreateSecretArg] + ''' + args_ = [CreateSecretArg.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 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] + provider_id : str + public : bool + space_tag : str + ''' + cidrs_ = cidrs + provider_id_ = provider_id + public_ = public + space_tag_ = space_tag + + # Validate arguments against known Juju API types. + if cidrs_ is not None and not isinstance(cidrs_, (bytes, str, list)): + raise Exception("Expected cidrs_ to be a Sequence, received: {}".format(type(cidrs_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if public_ is not None and not isinstance(public_, bool): + raise Exception("Expected public_ to be a bool, received: {}".format(type(public_))) + + 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_))) + + self.cidrs = cidrs_ + self.provider_id = provider_id_ + self.public = public_ + self.space_tag = space_tag_ + self.unknown_fields = unknown_fields + + + +class CreateSpacesParams(Type): + _toSchema = {'spaces': 'spaces'} + _toPy = {'spaces': 'spaces'} + def __init__(self, spaces=None, **unknown_fields): + ''' + spaces : typing.Sequence[~CreateSpaceParams] + ''' + spaces_ = [CreateSpaceParams.from_json(o) for o in spaces or []] + + # Validate arguments against known Juju API types. + if spaces_ is not None and not isinstance(spaces_, (bytes, str, list)): + raise Exception("Expected spaces_ to be a Sequence, received: {}".format(type(spaces_))) + + self.spaces = spaces_ + self.unknown_fields = 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] + auth_type : str + cloud : str + name : str + valid : bool + ''' + attrs_ = attrs + auth_type_ = auth_type + cloud_ = cloud + name_ = name + valid_ = valid + + # Validate arguments against known Juju API types. + if attrs_ is not None and not isinstance(attrs_, dict): + raise Exception("Expected attrs_ to be a Mapping, received: {}".format(type(attrs_))) + + if auth_type_ is not None and not isinstance(auth_type_, (bytes, str)): + raise Exception("Expected auth_type_ to be a str, received: {}".format(type(auth_type_))) + + if cloud_ is not None and not isinstance(cloud_, (bytes, str)): + raise Exception("Expected cloud_ to be a str, received: {}".format(type(cloud_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if valid_ is not None and not isinstance(valid_, bool): + raise Exception("Expected valid_ to be a bool, received: {}".format(type(valid_))) + + self.attrs = attrs_ + self.auth_type = auth_type_ + self.cloud = cloud_ + self.name = name_ + self.valid = valid_ + self.unknown_fields = unknown_fields + + + +class CredentialContentResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ControllerCredentialInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = ControllerCredentialInfo.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, ControllerCredentialInfo)): + raise Exception("Expected result_ to be a ControllerCredentialInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class CredentialContentResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~CredentialContentResult] + ''' + results_ = [CredentialContentResult.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 Delta(Type): + _toSchema = {'entity': 'entity', 'removed': 'removed'} + _toPy = {'entity': 'entity', 'removed': 'removed'} + def __init__(self, entity=None, removed=None, **unknown_fields): + ''' + entity : Any + removed : bool + ''' + entity_ = entity + removed_ = removed + + # Validate arguments against known Juju API types. + if removed_ is not None and not isinstance(removed_, bool): + raise Exception("Expected removed_ to be a bool, received: {}".format(type(removed_))) + + self.entity = entity_ + self.removed = removed_ + self.unknown_fields = 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] + ''' + api_addresses_ = api_addresses + + # Validate arguments against known Juju API types. + if api_addresses_ is not None and not isinstance(api_addresses_, (bytes, str, list)): + raise Exception("Expected api_addresses_ to be a Sequence, received: {}".format(type(api_addresses_))) + + self.api_addresses = api_addresses_ + self.unknown_fields = 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] + destroyed_units : typing.Sequence[~Entity] + detached_storage : typing.Sequence[~Entity] + ''' + destroyed_storage_ = [Entity.from_json(o) for o in destroyed_storage or []] + destroyed_units_ = [Entity.from_json(o) for o in destroyed_units or []] + detached_storage_ = [Entity.from_json(o) for o in detached_storage or []] + + # Validate arguments against known Juju API types. + if destroyed_storage_ is not None and not isinstance(destroyed_storage_, (bytes, str, list)): + raise Exception("Expected destroyed_storage_ to be a Sequence, received: {}".format(type(destroyed_storage_))) + + if destroyed_units_ is not None and not isinstance(destroyed_units_, (bytes, str, list)): + raise Exception("Expected destroyed_units_ to be a Sequence, received: {}".format(type(destroyed_units_))) + + if detached_storage_ is not None and not isinstance(detached_storage_, (bytes, str, list)): + raise Exception("Expected detached_storage_ to be a Sequence, received: {}".format(type(detached_storage_))) + + self.destroyed_storage = destroyed_storage_ + self.destroyed_units = destroyed_units_ + self.detached_storage = detached_storage_ + self.unknown_fields = unknown_fields + + + +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 + offer_urls : typing.Sequence[str] + ''' + force_ = force + offer_urls_ = offer_urls + + # Validate arguments against known Juju API types. + 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_))) + + self.force = force_ + self.offer_urls = offer_urls_ + self.unknown_fields = unknown_fields + + + +class DestroyApplicationParams(Type): + _toSchema = {'application_tag': 'application-tag', 'destroy_storage': 'destroy-storage', 'force': 'force', 'max_wait': 'max-wait'} + _toPy = {'application-tag': 'application_tag', 'destroy-storage': 'destroy_storage', 'force': 'force', 'max-wait': 'max_wait'} + def __init__(self, application_tag=None, destroy_storage=None, force=None, max_wait=None, **unknown_fields): + ''' + application_tag : str + destroy_storage : bool + force : bool + max_wait : int + ''' + application_tag_ = application_tag + destroy_storage_ = destroy_storage + force_ = force + max_wait_ = max_wait + + # Validate arguments against known Juju API types. + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) + + 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_))) + + self.application_tag = application_tag_ + self.destroy_storage = destroy_storage_ + self.force = force_ + self.max_wait = max_wait_ + self.unknown_fields = unknown_fields + + + +class DestroyApplicationResult(Type): + _toSchema = {'error': 'error', 'info': 'info'} + _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): + ''' + error : Error + info : DestroyApplicationInfo + ''' + error_ = Error.from_json(error) if error else None + info_ = DestroyApplicationInfo.from_json(info) if info 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 info_ is not None and not isinstance(info_, (dict, DestroyApplicationInfo)): + raise Exception("Expected info_ to be a DestroyApplicationInfo, received: {}".format(type(info_))) + + self.error = error_ + self.info = info_ + self.unknown_fields = unknown_fields + + + +class DestroyApplicationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~DestroyApplicationResult] + ''' + results_ = [DestroyApplicationResult.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 DestroyApplicationUnits(Type): + _toSchema = {'unit_names': 'unit-names'} + _toPy = {'unit-names': 'unit_names'} + def __init__(self, unit_names=None, **unknown_fields): + ''' + unit_names : typing.Sequence[str] + ''' + unit_names_ = unit_names + + # Validate arguments against known Juju API types. + if unit_names_ is not None and not isinstance(unit_names_, (bytes, str, list)): + raise Exception("Expected unit_names_ to be a Sequence, received: {}".format(type(unit_names_))) + + self.unit_names = unit_names_ + self.unknown_fields = unknown_fields + + + +class DestroyApplicationsParams(Type): + _toSchema = {'applications': 'applications'} + _toPy = {'applications': 'applications'} + def __init__(self, applications=None, **unknown_fields): + ''' + applications : typing.Sequence[~DestroyApplicationParams] + ''' + applications_ = [DestroyApplicationParams.from_json(o) for o in applications or []] + + # Validate arguments against known Juju API types. + if applications_ is not None and not isinstance(applications_, (bytes, str, list)): + raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + + self.applications = applications_ + self.unknown_fields = 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 + force : bool + max_wait : int + ''' + application_tag_ = application_tag + force_ = force + max_wait_ = max_wait + + # Validate arguments against known Juju API types. + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) + + 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_))) + + self.application_tag = application_tag_ + self.force = force_ + self.max_wait = max_wait_ + self.unknown_fields = unknown_fields + + + +class DestroyConsumedApplicationsParams(Type): + _toSchema = {'applications': 'applications'} + _toPy = {'applications': 'applications'} + def __init__(self, applications=None, **unknown_fields): + ''' + applications : typing.Sequence[~DestroyConsumedApplicationParams] + ''' + applications_ = [DestroyConsumedApplicationParams.from_json(o) for o in applications or []] + + # Validate arguments against known Juju API types. + if applications_ is not None and not isinstance(applications_, (bytes, str, list)): + raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + + self.applications = applications_ + self.unknown_fields = 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 + destroy_storage : bool + force : bool + max_wait : int + model_timeout : int + ''' + destroy_models_ = destroy_models + destroy_storage_ = destroy_storage + force_ = force + max_wait_ = max_wait + model_timeout_ = model_timeout + + # Validate arguments against known Juju API types. + 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_))) + + self.destroy_models = destroy_models_ + self.destroy_storage = destroy_storage_ + self.force = force_ + self.max_wait = max_wait_ + self.model_timeout = model_timeout_ + self.unknown_fields = unknown_fields + + + +class DestroyMachineInfo(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] + destroyed_units : typing.Sequence[~Entity] + detached_storage : typing.Sequence[~Entity] + ''' + destroyed_storage_ = [Entity.from_json(o) for o in destroyed_storage or []] + destroyed_units_ = [Entity.from_json(o) for o in destroyed_units or []] + detached_storage_ = [Entity.from_json(o) for o in detached_storage or []] + + # Validate arguments against known Juju API types. + if destroyed_storage_ is not None and not isinstance(destroyed_storage_, (bytes, str, list)): + raise Exception("Expected destroyed_storage_ to be a Sequence, received: {}".format(type(destroyed_storage_))) + + if destroyed_units_ is not None and not isinstance(destroyed_units_, (bytes, str, list)): + raise Exception("Expected destroyed_units_ to be a Sequence, received: {}".format(type(destroyed_units_))) + + if detached_storage_ is not None and not isinstance(detached_storage_, (bytes, str, list)): + raise Exception("Expected detached_storage_ to be a Sequence, received: {}".format(type(detached_storage_))) + + self.destroyed_storage = destroyed_storage_ + self.destroyed_units = destroyed_units_ + self.detached_storage = detached_storage_ + self.unknown_fields = unknown_fields + + + +class DestroyMachineResult(Type): + _toSchema = {'error': 'error', 'info': 'info'} + _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): + ''' + error : Error + info : DestroyMachineInfo + ''' + error_ = Error.from_json(error) if error else None + info_ = DestroyMachineInfo.from_json(info) if info 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 info_ is not None and not isinstance(info_, (dict, DestroyMachineInfo)): + raise Exception("Expected info_ to be a DestroyMachineInfo, received: {}".format(type(info_))) + + self.error = error_ + self.info = info_ + self.unknown_fields = unknown_fields + + + +class DestroyMachineResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~DestroyMachineResult] + ''' + results_ = [DestroyMachineResult.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 DestroyMachines(Type): + _toSchema = {'force': 'force', 'machine_names': 'machine-names'} + _toPy = {'force': 'force', 'machine-names': 'machine_names'} + def __init__(self, force=None, machine_names=None, **unknown_fields): + ''' + force : bool + machine_names : typing.Sequence[str] + ''' + force_ = force + machine_names_ = machine_names + + # Validate arguments against known Juju API types. + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if machine_names_ is not None and not isinstance(machine_names_, (bytes, str, list)): + raise Exception("Expected machine_names_ to be a Sequence, received: {}".format(type(machine_names_))) + + self.force = force_ + self.machine_names = machine_names_ + self.unknown_fields = unknown_fields + + + +class DestroyMachinesParams(Type): + _toSchema = {'force': 'force', 'keep': 'keep', 'machine_tags': 'machine-tags', 'max_wait': 'max-wait'} + _toPy = {'force': 'force', 'keep': 'keep', 'machine-tags': 'machine_tags', 'max-wait': 'max_wait'} + def __init__(self, force=None, keep=None, machine_tags=None, max_wait=None, **unknown_fields): + ''' + force : bool + keep : bool + machine_tags : typing.Sequence[str] + max_wait : int + ''' + force_ = force + keep_ = keep + machine_tags_ = machine_tags + max_wait_ = max_wait + + # Validate arguments against known Juju API types. + 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_))) + + self.force = force_ + self.keep = keep_ + self.machine_tags = machine_tags_ + self.max_wait = max_wait_ + self.unknown_fields = unknown_fields + + + +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 + force : bool + max_wait : int + model_tag : str + timeout : int + ''' + destroy_storage_ = destroy_storage + force_ = force + max_wait_ = max_wait + model_tag_ = model_tag + timeout_ = timeout + + # Validate arguments against known Juju API types. + 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_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 timeout_ is not None and not isinstance(timeout_, int): + raise Exception("Expected timeout_ to be a int, received: {}".format(type(timeout_))) + + self.destroy_storage = destroy_storage_ + self.force = force_ + self.max_wait = max_wait_ + self.model_tag = model_tag_ + self.timeout = timeout_ + self.unknown_fields = unknown_fields + + + +class DestroyModelsParams(Type): + _toSchema = {'models': 'models'} + _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): + ''' + models : typing.Sequence[~DestroyModelParams] + ''' + models_ = [DestroyModelParams.from_json(o) for o in models or []] + + # Validate arguments against known Juju API types. + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + self.models = models_ + self.unknown_fields = 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] + force : bool + max_wait : int + relation_id : int + ''' + endpoints_ = endpoints + force_ = force + max_wait_ = max_wait + relation_id_ = relation_id + + # Validate arguments against known Juju API types. + 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_))) + + self.endpoints = endpoints_ + self.force = force_ + self.max_wait = max_wait_ + self.relation_id = relation_id_ + self.unknown_fields = unknown_fields + + + +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] + detached_storage : typing.Sequence[~Entity] + ''' + destroyed_storage_ = [Entity.from_json(o) for o in destroyed_storage or []] + detached_storage_ = [Entity.from_json(o) for o in detached_storage or []] + + # Validate arguments against known Juju API types. + if destroyed_storage_ is not None and not isinstance(destroyed_storage_, (bytes, str, list)): + raise Exception("Expected destroyed_storage_ to be a Sequence, received: {}".format(type(destroyed_storage_))) + + if detached_storage_ is not None and not isinstance(detached_storage_, (bytes, str, list)): + raise Exception("Expected detached_storage_ to be a Sequence, received: {}".format(type(detached_storage_))) + + self.destroyed_storage = destroyed_storage_ + self.detached_storage = detached_storage_ + self.unknown_fields = unknown_fields + + + +class DestroyUnitParams(Type): + _toSchema = {'destroy_storage': 'destroy-storage', 'force': 'force', 'max_wait': 'max-wait', 'unit_tag': 'unit-tag'} + _toPy = {'destroy-storage': 'destroy_storage', 'force': 'force', 'max-wait': 'max_wait', 'unit-tag': 'unit_tag'} + def __init__(self, destroy_storage=None, force=None, max_wait=None, unit_tag=None, **unknown_fields): + ''' + destroy_storage : bool + force : bool + max_wait : int + unit_tag : str + ''' + destroy_storage_ = destroy_storage + force_ = force + max_wait_ = max_wait + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + 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 unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.destroy_storage = destroy_storage_ + self.force = force_ + self.max_wait = max_wait_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +class DestroyUnitResult(Type): + _toSchema = {'error': 'error', 'info': 'info'} + _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): + ''' + error : Error + info : DestroyUnitInfo + ''' + error_ = Error.from_json(error) if error else None + info_ = DestroyUnitInfo.from_json(info) if info 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 info_ is not None and not isinstance(info_, (dict, DestroyUnitInfo)): + raise Exception("Expected info_ to be a DestroyUnitInfo, received: {}".format(type(info_))) + + self.error = error_ + self.info = info_ + self.unknown_fields = unknown_fields + + + +class DestroyUnitResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~DestroyUnitResult] + ''' + results_ = [DestroyUnitResult.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 DestroyUnitsParams(Type): + _toSchema = {'units': 'units'} + _toPy = {'units': 'units'} + def __init__(self, units=None, **unknown_fields): + ''' + units : typing.Sequence[~DestroyUnitParams] + ''' + units_ = [DestroyUnitParams.from_json(o) for o in units or []] + + # Validate arguments against known Juju API types. + if units_ is not None and not isinstance(units_, (bytes, str, list)): + raise Exception("Expected units_ to be a Sequence, received: {}".format(type(units_))) + + self.units = units_ + self.unknown_fields = 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] + err : Error + info : str + kind : str + life : str + since : str + status : str + version : str + ''' + data_ = data + err_ = Error.from_json(err) if err else None + info_ = info + kind_ = kind + life_ = life + since_ = since + status_ = status + version_ = version + + # Validate arguments against known Juju API types. + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + + if err_ is not None and not isinstance(err_, (dict, Error)): + raise Exception("Expected err_ to be a Error, received: {}".format(type(err_))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if kind_ is not None and not isinstance(kind_, (bytes, str)): + raise Exception("Expected kind_ to be a str, received: {}".format(type(kind_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if since_ is not None and not isinstance(since_, (bytes, str)): + raise Exception("Expected since_ to be a str, received: {}".format(type(since_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + + self.data = data_ + self.err = err_ + self.info = info_ + self.kind = kind_ + self.life = life_ + self.since = since_ + self.status = status_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +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 + host_device_name : str + mac_address : str + ''' + bridge_name_ = bridge_name + host_device_name_ = host_device_name + mac_address_ = mac_address + + # Validate arguments against known Juju API types. + if bridge_name_ is not None and not isinstance(bridge_name_, (bytes, str)): + raise Exception("Expected bridge_name_ to be a str, received: {}".format(type(bridge_name_))) + + if host_device_name_ is not None and not isinstance(host_device_name_, (bytes, str)): + raise Exception("Expected host_device_name_ to be a str, received: {}".format(type(host_device_name_))) + + if mac_address_ is not None and not isinstance(mac_address_, (bytes, str)): + raise Exception("Expected mac_address_ to be a str, received: {}".format(type(mac_address_))) + + self.bridge_name = bridge_name_ + self.host_device_name = host_device_name_ + self.mac_address = mac_address_ + self.unknown_fields = unknown_fields + + + +class DiscoverSpacesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ProviderSpace] + ''' + results_ = [ProviderSpace.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 DistributionGroupResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : typing.Sequence[str] + ''' + error_ = Error.from_json(error) if error else None + result_ = result + + # 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_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class DistributionGroupResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~DistributionGroupResult] + ''' + results_ = [DistributionGroupResult.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 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 + email : str + identitytoken : str + image_name : str + password : str + registrytoken : str + repository : str + serveraddress : str + username : str + ''' + auth_ = auth + email_ = email + identitytoken_ = identitytoken + image_name_ = image_name + password_ = password + registrytoken_ = registrytoken + repository_ = repository + serveraddress_ = serveraddress + username_ = username + + # Validate arguments against known Juju API types. + if auth_ is not None and not isinstance(auth_, (bytes, str)): + raise Exception("Expected auth_ to be a str, received: {}".format(type(auth_))) + + if email_ is not None and not isinstance(email_, (bytes, str)): + raise Exception("Expected email_ to be a str, received: {}".format(type(email_))) + + if identitytoken_ is not None and not isinstance(identitytoken_, (bytes, str)): + raise Exception("Expected identitytoken_ to be a str, received: {}".format(type(identitytoken_))) + + if image_name_ is not None and not isinstance(image_name_, (bytes, str)): + raise Exception("Expected image_name_ to be a str, received: {}".format(type(image_name_))) + + if password_ is not None and not isinstance(password_, (bytes, str)): + raise Exception("Expected password_ to be a str, received: {}".format(type(password_))) + + if registrytoken_ is not None and not isinstance(registrytoken_, (bytes, str)): + raise Exception("Expected registrytoken_ to be a str, received: {}".format(type(registrytoken_))) + + if repository_ is not None and not isinstance(repository_, (bytes, str)): + raise Exception("Expected repository_ to be a str, received: {}".format(type(repository_))) + + if serveraddress_ is not None and not isinstance(serveraddress_, (bytes, str)): + raise Exception("Expected serveraddress_ to be a str, received: {}".format(type(serveraddress_))) + + if username_ is not None and not isinstance(username_, (bytes, str)): + raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) + + self.auth = auth_ + self.email = email_ + self.identitytoken = identitytoken_ + self.image_name = image_name_ + self.password = password_ + self.registrytoken = registrytoken_ + self.repository = repository_ + self.serveraddress = serveraddress_ + self.username = username_ + self.unknown_fields = unknown_fields + + + +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 + url : str + ''' + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + url_ = url + + # Validate arguments against known Juju API types. + 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 url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.charm_origin = charm_origin_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class DownloadInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~DownloadInfoResult] + ''' + results_ = [DownloadInfoResult.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 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] + simplified : bool + ''' + entities_ = [Entity.from_json(o) for o in entities or []] + simplified_ = simplified + + # Validate arguments against known Juju API types. + 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_))) + + self.entities = entities_ + self.simplified = simplified_ + self.unknown_fields = 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 + relation : CharmRelation + ''' + application_name_ = application_name + relation_ = CharmRelation.from_json(relation) if relation else None + + # Validate arguments against known Juju API types. + 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 relation_ is not None and not isinstance(relation_, (dict, CharmRelation)): + raise Exception("Expected relation_ to be a CharmRelation, received: {}".format(type(relation_))) + + self.application_name = application_name_ + self.relation = relation_ + self.unknown_fields = 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 + name : str + role : str + ''' + interface_ = interface + name_ = name + role_ = role + + # Validate arguments against known Juju API types. + if interface_ is not None and not isinstance(interface_, (bytes, str)): + raise Exception("Expected interface_ to be a str, received: {}".format(type(interface_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if role_ is not None and not isinstance(role_, (bytes, str)): + raise Exception("Expected role_ to be a str, received: {}".format(type(role_))) + + self.interface = interface_ + self.name = name_ + self.role = role_ + self.unknown_fields = unknown_fields + + + +class EndpointRelationData(Type): + _toSchema = {'applicationdata': 'ApplicationData', 'cross_model': 'cross-model', 'endpoint': 'endpoint', 'related_endpoint': 'related-endpoint', 'unit_relation_data': 'unit-relation-data'} + _toPy = {'ApplicationData': 'applicationdata', 'cross-model': 'cross_model', 'endpoint': 'endpoint', 'related-endpoint': 'related_endpoint', 'unit-relation-data': 'unit_relation_data'} + def __init__(self, applicationdata=None, cross_model=None, endpoint=None, related_endpoint=None, unit_relation_data=None, **unknown_fields): + ''' + applicationdata : typing.Mapping[str, typing.Any] + cross_model : bool + endpoint : str + related_endpoint : str + unit_relation_data : typing.Mapping[str, ~RelationData] + ''' + applicationdata_ = applicationdata + cross_model_ = cross_model + endpoint_ = endpoint + related_endpoint_ = related_endpoint + unit_relation_data_ = {k: RelationData.from_json(v) for k, v in (unit_relation_data or dict()).items()} + + # Validate arguments against known Juju API types. + if applicationdata_ is not None and not isinstance(applicationdata_, dict): + raise Exception("Expected applicationdata_ to be a Mapping, received: {}".format(type(applicationdata_))) + + if cross_model_ is not None and not isinstance(cross_model_, bool): + raise Exception("Expected cross_model_ to be a bool, received: {}".format(type(cross_model_))) + + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if related_endpoint_ is not None and not isinstance(related_endpoint_, (bytes, str)): + raise Exception("Expected related_endpoint_ to be a str, received: {}".format(type(related_endpoint_))) + + if unit_relation_data_ is not None and not isinstance(unit_relation_data_, dict): + raise Exception("Expected unit_relation_data_ to be a Mapping, received: {}".format(type(unit_relation_data_))) + + self.applicationdata = applicationdata_ + self.cross_model = cross_model_ + self.endpoint = endpoint_ + self.related_endpoint = related_endpoint_ + self.unit_relation_data = unit_relation_data_ + self.unknown_fields = unknown_fields + + + +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 + name : str + role : str + subordinate : bool + ''' + application_ = application + name_ = name + role_ = role + subordinate_ = subordinate + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if role_ is not None and not isinstance(role_, (bytes, str)): + raise Exception("Expected role_ to be a str, received: {}".format(type(role_))) + + if subordinate_ is not None and not isinstance(subordinate_, bool): + raise Exception("Expected subordinate_ to be a bool, received: {}".format(type(subordinate_))) + + self.application = application_ + self.name = name_ + self.role = role_ + self.subordinate = subordinate_ + self.unknown_fields = unknown_fields + + + +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[~StringResult] + operation : str + ''' + actions_ = [StringResult.from_json(o) for o in actions or []] + operation_ = operation + + # Validate arguments against known Juju API types. + 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 operation_ is not None and not isinstance(operation_, (bytes, str)): + raise Exception("Expected operation_ to be a str, received: {}".format(type(operation_))) + + self.actions = actions_ + self.operation = operation_ + self.unknown_fields = unknown_fields + + + +class Entities(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): + ''' + entities : typing.Sequence[~Entity] + ''' + entities_ = [Entity.from_json(o) for o in entities or []] + + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + + self.entities = entities_ + self.unknown_fields = unknown_fields + + + +class EntitiesCharmURL(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): + ''' + entities : typing.Sequence[~EntityCharmURL] + ''' + entities_ = [EntityCharmURL.from_json(o) for o in entities or []] + + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + + self.entities = entities_ + self.unknown_fields = unknown_fields + + + +class EntitiesPortRanges(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): + ''' + entities : typing.Sequence[~EntityPortRange] + ''' + entities_ = [EntityPortRange.from_json(o) for o in entities or []] + + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + + self.entities = entities_ + self.unknown_fields = 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] + error : Error + ''' + entities_ = [Entity.from_json(o) for o in entities or []] + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.entities = entities_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class EntitiesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~EntitiesResult] + ''' + results_ = [EntitiesResult.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 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] + ''' + agent_tools_ = [EntityVersion.from_json(o) for o in agent_tools or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.agent_tools = agent_tools_ + self.unknown_fields = 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] + error : Error + watcher_id : str + ''' + changes_ = changes + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class Entity(Type): + _toSchema = {'tag': 'tag'} + _toPy = {'tag': 'tag'} + def __init__(self, tag=None, **unknown_fields): + ''' + tag : str + ''' + tag_ = tag + + # Validate arguments against known Juju API types. + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.tag = tag_ + self.unknown_fields = 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] + entity : str + ''' + annotations_ = annotations + entity_ = entity + + # Validate arguments against known Juju API types. + if annotations_ is not None and not isinstance(annotations_, dict): + raise Exception("Expected annotations_ to be a Mapping, received: {}".format(type(annotations_))) + + if entity_ is not None and not isinstance(entity_, (bytes, str)): + raise Exception("Expected entity_ to be a str, received: {}".format(type(entity_))) + + self.annotations = annotations_ + self.entity = entity_ + self.unknown_fields = 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 + tag : str + ''' + charm_url_ = charm_url + tag_ = tag + + # Validate arguments against known Juju API types. + 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 tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.charm_url = charm_url_ + self.tag = tag_ + self.unknown_fields = 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 + tag : str + ''' + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + tag_ = tag + + # Validate arguments against known Juju API types. + if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.macaroon = macaroon_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class EntityMacaroonArgs(Type): + _toSchema = {'args': 'Args'} + _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~EntityMacaroonArg] + ''' + args_ = [EntityMacaroonArg.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 EntityMetrics(Type): + _toSchema = {'error': 'error', 'metrics': 'metrics'} + _toPy = {'error': 'error', 'metrics': 'metrics'} + def __init__(self, error=None, metrics=None, **unknown_fields): + ''' + error : Error + metrics : typing.Sequence[~MetricResult] + ''' + error_ = Error.from_json(error) if error else None + metrics_ = [MetricResult.from_json(o) for o in metrics or []] + + # 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 metrics_ is not None and not isinstance(metrics_, (bytes, str, list)): + raise Exception("Expected metrics_ to be a Sequence, received: {}".format(type(metrics_))) + + self.error = error_ + self.metrics = metrics_ + self.unknown_fields = 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 + tag : str + ''' + password_ = password + tag_ = tag + + # Validate arguments against known Juju API types. + if password_ is not None and not isinstance(password_, (bytes, str)): + raise Exception("Expected password_ to be a str, received: {}".format(type(password_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.password = password_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class EntityPasswords(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~EntityPassword] + ''' + changes_ = [EntityPassword.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = 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 + from_port : int + protocol : str + tag : str + to_port : int + ''' + endpoint_ = endpoint + from_port_ = from_port + protocol_ = protocol + tag_ = tag + to_port_ = to_port + + # Validate arguments against known Juju API types. + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if from_port_ is not None and not isinstance(from_port_, int): + raise Exception("Expected from_port_ to be a int, received: {}".format(type(from_port_))) + + if protocol_ is not None and not isinstance(protocol_, (bytes, str)): + raise Exception("Expected protocol_ to be a str, received: {}".format(type(protocol_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if to_port_ is not None and not isinstance(to_port_, int): + raise Exception("Expected to_port_ to be a int, received: {}".format(type(to_port_))) + + self.endpoint = endpoint_ + self.from_port = from_port_ + self.protocol = protocol_ + self.tag = tag_ + self.to_port = to_port_ + self.unknown_fields = unknown_fields + + + +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] + info : str + since : str + status : str + ''' + data_ = data + info_ = info + since_ = since + status_ = status + + # Validate arguments against known Juju API types. + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if since_ is not None and not isinstance(since_, (bytes, str)): + raise Exception("Expected since_ to be a str, received: {}".format(type(since_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.data = data_ + self.info = info_ + self.since = since_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +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] + info : str + status : str + tag : str + ''' + data_ = data + info_ = info + status_ = status + tag_ = tag + + # Validate arguments against known Juju API types. + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.data = data_ + self.info = info_ + self.status = status_ + self.tag = tag_ + self.unknown_fields = 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 + value : str + ''' + tag_ = tag + value_ = value + + # Validate arguments against known Juju API types. + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if value_ is not None and not isinstance(value_, (bytes, str)): + raise Exception("Expected value_ to be a str, received: {}".format(type(value_))) + + self.tag = tag_ + self.value = value_ + self.unknown_fields = 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 + tools : Version + ''' + tag_ = tag + tools_ = Version.from_json(tools) if tools else None + + # Validate arguments against known Juju API types. + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if tools_ is not None and not isinstance(tools_, (dict, Version)): + raise Exception("Expected tools_ to be a Version, received: {}".format(type(tools_))) + + self.tag = tag_ + self.tools = tools_ + self.unknown_fields = 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 + workload_version : str + ''' + tag_ = tag + workload_version_ = workload_version + + # Validate arguments against known Juju API types. + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if workload_version_ is not None and not isinstance(workload_version_, (bytes, str)): + raise Exception("Expected workload_version_ to be a str, received: {}".format(type(workload_version_))) + + self.tag = tag_ + self.workload_version = workload_version_ + self.unknown_fields = unknown_fields + + + +class EntityWorkloadVersions(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): + ''' + entities : typing.Sequence[~EntityWorkloadVersion] + ''' + entities_ = [EntityWorkloadVersion.from_json(o) for o in entities or []] + + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + + self.entities = entities_ + self.unknown_fields = unknown_fields + + + +class EnvListArgs(Type): + _toSchema = {'patterns': 'patterns'} + _toPy = {'patterns': 'patterns'} + def __init__(self, patterns=None, **unknown_fields): + ''' + patterns : typing.Sequence[str] + ''' + patterns_ = patterns + + # Validate arguments against known Juju API types. + if patterns_ is not None and not isinstance(patterns_, (bytes, str, list)): + raise Exception("Expected patterns_ to be a Sequence, received: {}".format(type(patterns_))) + + self.patterns = patterns_ + self.unknown_fields = unknown_fields + + + +class EnvListResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~Payload] + ''' + results_ = [Payload.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 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 + info : typing.Mapping[str, typing.Any] + message : str + ''' + code_ = code + info_ = info + message_ = message + + # Validate arguments against known Juju API types. + if code_ is not None and not isinstance(code_, (bytes, str)): + raise Exception("Expected code_ to be a str, received: {}".format(type(code_))) + + if info_ is not None and not isinstance(info_, dict): + raise Exception("Expected info_ to be a Mapping, received: {}".format(type(info_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + self.code = code_ + self.info = info_ + self.message = message_ + self.unknown_fields = unknown_fields + + + +class ErrorInfo(Type): + _toSchema = {'macaroon': 'macaroon', 'macaroon_path': 'macaroon-path'} + _toPy = {'macaroon': 'macaroon', 'macaroon-path': 'macaroon_path'} + def __init__(self, macaroon=None, macaroon_path=None, **unknown_fields): + ''' + macaroon : Macaroon + macaroon_path : str + ''' + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + macaroon_path_ = macaroon_path + + # Validate arguments against known Juju API types. + if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + + if macaroon_path_ is not None and not isinstance(macaroon_path_, (bytes, str)): + raise Exception("Expected macaroon_path_ to be a str, received: {}".format(type(macaroon_path_))) + + self.macaroon = macaroon_ + self.macaroon_path = macaroon_path_ + self.unknown_fields = unknown_fields + + + +class ErrorResponse(Type): + _toSchema = {'error_list': 'error-list'} + _toPy = {'error-list': 'error_list'} + def __init__(self, error_list=None, **unknown_fields): + ''' + error_list : CharmHubError + ''' + error_list_ = CharmHubError.from_json(error_list) if error_list else None + + # Validate arguments against known Juju API types. + if error_list_ is not None and not isinstance(error_list_, (dict, CharmHubError)): + raise Exception("Expected error_list_ to be a CharmHubError, received: {}".format(type(error_list_))) + + self.error_list = error_list_ + self.unknown_fields = unknown_fields + + + +class ErrorResult(Type): + _toSchema = {'error': 'error'} + _toPy = {'error': 'error'} + def __init__(self, error=None, **unknown_fields): + ''' + error : Error + ''' + error_ = Error.from_json(error) if error 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_))) + + self.error = error_ + self.unknown_fields = unknown_fields + + + +class ErrorResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ErrorResult] + ''' + results_ = [ErrorResult.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 ExportBundleParams(Type): + _toSchema = {'include_charm_defaults': 'include-charm-defaults'} + _toPy = {'include-charm-defaults': 'include_charm_defaults'} + def __init__(self, include_charm_defaults=None, **unknown_fields): + ''' + include_charm_defaults : bool + ''' + include_charm_defaults_ = include_charm_defaults + + # Validate arguments against known Juju API types. + 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_))) + + self.include_charm_defaults = include_charm_defaults_ + self.unknown_fields = unknown_fields + + + +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 + exposed : bool + exposed_endpoints : typing.Mapping[str, ~ExposedEndpoint] + ''' + error_ = Error.from_json(error) if error else None + exposed_ = exposed + exposed_endpoints_ = {k: ExposedEndpoint.from_json(v) for k, v in (exposed_endpoints or dict()).items()} + + # 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 exposed_ is not None and not isinstance(exposed_, bool): + raise Exception("Expected exposed_ to be a bool, received: {}".format(type(exposed_))) + + 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_))) + + self.error = error_ + self.exposed = exposed_ + self.exposed_endpoints = exposed_endpoints_ + self.unknown_fields = unknown_fields + + + +class ExposeInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ExposeInfoResult] + ''' + results_ = [ExposeInfoResult.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 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] + expose_to_spaces : typing.Sequence[str] + ''' + expose_to_cidrs_ = expose_to_cidrs + expose_to_spaces_ = expose_to_spaces + + # Validate arguments against known Juju API types. + if expose_to_cidrs_ is not None and not isinstance(expose_to_cidrs_, (bytes, str, list)): + raise Exception("Expected expose_to_cidrs_ to be a Sequence, received: {}".format(type(expose_to_cidrs_))) + + if expose_to_spaces_ is not None and not isinstance(expose_to_spaces_, (bytes, str, list)): + raise Exception("Expected expose_to_spaces_ to be a Sequence, received: {}".format(type(expose_to_spaces_))) + + self.expose_to_cidrs = expose_to_cidrs_ + self.expose_to_spaces = expose_to_spaces_ + self.unknown_fields = unknown_fields + + + +class ExpressionTree(Type): + _toSchema = {'expression': 'Expression'} + _toPy = {'Expression': 'expression'} + def __init__(self, expression=None, **unknown_fields): + ''' + expression : Any + ''' + expression_ = expression + + # Validate arguments against known Juju API types. + self.expression = expression_ + self.unknown_fields = 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] + ca_cert : str + controller_alias : str + controller_tag : str + ''' + addrs_ = addrs + ca_cert_ = ca_cert + controller_alias_ = controller_alias + controller_tag_ = controller_tag + + # Validate arguments against known Juju API types. + if addrs_ is not None and not isinstance(addrs_, (bytes, str, list)): + raise Exception("Expected addrs_ to be a Sequence, received: {}".format(type(addrs_))) + + if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): + raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) + + 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_))) + + self.addrs = addrs_ + self.ca_cert = ca_cert_ + self.controller_alias = controller_alias_ + self.controller_tag = controller_tag_ + self.unknown_fields = unknown_fields + + + +class ExternalControllerInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ExternalControllerInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = ExternalControllerInfo.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, ExternalControllerInfo)): + raise Exception("Expected result_ to be a ExternalControllerInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ExternalControllerInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ExternalControllerInfoResult] + ''' + results_ = [ExternalControllerInfoResult.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 FanConfigEntry(Type): + _toSchema = {'overlay': 'overlay', 'underlay': 'underlay'} + _toPy = {'overlay': 'overlay', 'underlay': 'underlay'} + def __init__(self, overlay=None, underlay=None, **unknown_fields): + ''' + overlay : str + underlay : str + ''' + overlay_ = overlay + underlay_ = underlay + + # Validate arguments against known Juju API types. + if overlay_ is not None and not isinstance(overlay_, (bytes, str)): + raise Exception("Expected overlay_ to be a str, received: {}".format(type(overlay_))) + + if underlay_ is not None and not isinstance(underlay_, (bytes, str)): + raise Exception("Expected underlay_ to be a str, received: {}".format(type(underlay_))) + + self.overlay = overlay_ + self.underlay = underlay_ + self.unknown_fields = unknown_fields + + + +class FanConfigResult(Type): + _toSchema = {'fans': 'fans'} + _toPy = {'fans': 'fans'} + def __init__(self, fans=None, **unknown_fields): + ''' + fans : typing.Sequence[~FanConfigEntry] + ''' + fans_ = [FanConfigEntry.from_json(o) for o in fans or []] + + # Validate arguments against known Juju API types. + if fans_ is not None and not isinstance(fans_, (bytes, str, list)): + raise Exception("Expected fans_ to be a Sequence, received: {}".format(type(fans_))) + + self.fans = fans_ + self.unknown_fields = 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 + info : FilesystemInfo + volume_tag : str + ''' + filesystem_tag_ = filesystem_tag + info_ = FilesystemInfo.from_json(info) if info else None + volume_tag_ = volume_tag + + # Validate arguments against known Juju API types. + if filesystem_tag_ is not None and not isinstance(filesystem_tag_, (bytes, str)): + raise Exception("Expected filesystem_tag_ to be a str, received: {}".format(type(filesystem_tag_))) + + if info_ is not None and not isinstance(info_, (dict, FilesystemInfo)): + raise Exception("Expected info_ to be a FilesystemInfo, received: {}".format(type(info_))) + + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + + self.filesystem_tag = filesystem_tag_ + self.info = info_ + self.volume_tag = volume_tag_ + self.unknown_fields = unknown_fields + + + +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 + info : FilesystemAttachmentInfo + machine_tag : str + ''' + filesystem_tag_ = filesystem_tag + info_ = FilesystemAttachmentInfo.from_json(info) if info else None + machine_tag_ = machine_tag + + # Validate arguments against known Juju API types. + if filesystem_tag_ is not None and not isinstance(filesystem_tag_, (bytes, str)): + raise Exception("Expected filesystem_tag_ to be a str, received: {}".format(type(filesystem_tag_))) + + if info_ is not None and not isinstance(info_, (dict, FilesystemAttachmentInfo)): + raise Exception("Expected info_ to be a FilesystemAttachmentInfo, received: {}".format(type(info_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + self.filesystem_tag = filesystem_tag_ + self.info = info_ + self.machine_tag = machine_tag_ + self.unknown_fields = unknown_fields + + + +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 + life : str + mount_point : str + read_only : bool + ''' + filesystemattachmentinfo_ = FilesystemAttachmentInfo.from_json(filesystemattachmentinfo) if filesystemattachmentinfo else None + life_ = life + mount_point_ = mount_point + read_only_ = read_only + + # Validate arguments against known Juju API types. + if filesystemattachmentinfo_ is not None and not isinstance(filesystemattachmentinfo_, (dict, FilesystemAttachmentInfo)): + raise Exception("Expected filesystemattachmentinfo_ to be a FilesystemAttachmentInfo, received: {}".format(type(filesystemattachmentinfo_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if mount_point_ is not None and not isinstance(mount_point_, (bytes, str)): + raise Exception("Expected mount_point_ to be a str, received: {}".format(type(mount_point_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + self.filesystemattachmentinfo = filesystemattachmentinfo_ + self.life = life_ + self.mount_point = mount_point_ + self.read_only = read_only_ + self.unknown_fields = unknown_fields + + + +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 + read_only : bool + ''' + mount_point_ = mount_point + read_only_ = read_only + + # Validate arguments against known Juju API types. + if mount_point_ is not None and not isinstance(mount_point_, (bytes, str)): + raise Exception("Expected mount_point_ to be a str, received: {}".format(type(mount_point_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + self.mount_point = mount_point_ + self.read_only = read_only_ + self.unknown_fields = 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 + filesystem_tag : str + instance_id : str + machine_tag : str + mount_point : str + provider : str + read_only : bool + ''' + 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 + + # Validate arguments against known Juju API types. + if filesystem_id_ is not None and not isinstance(filesystem_id_, (bytes, str)): + raise Exception("Expected filesystem_id_ to be a str, received: {}".format(type(filesystem_id_))) + + if filesystem_tag_ is not None and not isinstance(filesystem_tag_, (bytes, str)): + raise Exception("Expected filesystem_tag_ to be a str, received: {}".format(type(filesystem_tag_))) + + if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): + raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + if mount_point_ is not None and not isinstance(mount_point_, (bytes, str)): + raise Exception("Expected mount_point_ to be a str, received: {}".format(type(mount_point_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + self.filesystem_id = filesystem_id_ + self.filesystem_tag = filesystem_tag_ + self.instance_id = instance_id_ + self.machine_tag = machine_tag_ + self.mount_point = mount_point_ + self.provider = provider_ + self.read_only = read_only_ + self.unknown_fields = unknown_fields + + + +class FilesystemAttachmentParamsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : FilesystemAttachmentParams + ''' + error_ = Error.from_json(error) if error else None + result_ = FilesystemAttachmentParams.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, FilesystemAttachmentParams)): + raise Exception("Expected result_ to be a FilesystemAttachmentParams, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class FilesystemAttachmentParamsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~FilesystemAttachmentParamsResult] + ''' + results_ = [FilesystemAttachmentParamsResult.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 FilesystemAttachmentResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : FilesystemAttachment + ''' + error_ = Error.from_json(error) if error else None + result_ = FilesystemAttachment.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, FilesystemAttachment)): + raise Exception("Expected result_ to be a FilesystemAttachment, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class FilesystemAttachmentResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~FilesystemAttachmentResult] + ''' + results_ = [FilesystemAttachmentResult.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 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] + ''' + filesystem_attachments_ = [FilesystemAttachment.from_json(o) for o in filesystem_attachments or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.filesystem_attachments = filesystem_attachments_ + self.unknown_fields = 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 + info : FilesystemInfo + life : str + machine_attachments : typing.Mapping[str, ~FilesystemAttachmentDetails] + status : EntityStatus + storage : StorageDetails + unit_attachments : typing.Mapping[str, ~FilesystemAttachmentDetails] + volume_tag : str + ''' + filesystem_tag_ = filesystem_tag + info_ = FilesystemInfo.from_json(info) if info else None + life_ = life + machine_attachments_ = {k: FilesystemAttachmentDetails.from_json(v) for k, v in (machine_attachments or dict()).items()} + status_ = EntityStatus.from_json(status) if status else None + storage_ = StorageDetails.from_json(storage) if storage else None + unit_attachments_ = {k: FilesystemAttachmentDetails.from_json(v) for k, v in (unit_attachments or dict()).items()} + volume_tag_ = volume_tag + + # Validate arguments against known Juju API types. + if filesystem_tag_ is not None and not isinstance(filesystem_tag_, (bytes, str)): + raise Exception("Expected filesystem_tag_ to be a str, received: {}".format(type(filesystem_tag_))) + + if info_ is not None and not isinstance(info_, (dict, FilesystemInfo)): + raise Exception("Expected info_ to be a FilesystemInfo, received: {}".format(type(info_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if machine_attachments_ is not None and not isinstance(machine_attachments_, dict): + raise Exception("Expected machine_attachments_ to be a Mapping, received: {}".format(type(machine_attachments_))) + + if status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + if storage_ is not None and not isinstance(storage_, (dict, StorageDetails)): + raise Exception("Expected storage_ to be a StorageDetails, received: {}".format(type(storage_))) + + if unit_attachments_ is not None and not isinstance(unit_attachments_, dict): + raise Exception("Expected unit_attachments_ to be a Mapping, received: {}".format(type(unit_attachments_))) + + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + + self.filesystem_tag = filesystem_tag_ + self.info = info_ + self.life = life_ + self.machine_attachments = machine_attachments_ + self.status = status_ + self.storage = storage_ + self.unit_attachments = unit_attachments_ + self.volume_tag = volume_tag_ + self.unknown_fields = unknown_fields + + + +class FilesystemDetailsListResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : typing.Sequence[~FilesystemDetails] + ''' + error_ = Error.from_json(error) if error else None + result_ = [FilesystemDetails.from_json(o) for o in result or []] + + # 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_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class FilesystemDetailsListResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~FilesystemDetailsListResult] + ''' + results_ = [FilesystemDetailsListResult.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 FilesystemFilter(Type): + _toSchema = {'machines': 'machines'} + _toPy = {'machines': 'machines'} + def __init__(self, machines=None, **unknown_fields): + ''' + machines : typing.Sequence[str] + ''' + machines_ = machines + + # Validate arguments against known Juju API types. + if machines_ is not None and not isinstance(machines_, (bytes, str, list)): + raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + + self.machines = machines_ + self.unknown_fields = unknown_fields + + + +class FilesystemFilters(Type): + _toSchema = {'filters': 'filters'} + _toPy = {'filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): + ''' + filters : typing.Sequence[~FilesystemFilter] + ''' + filters_ = [FilesystemFilter.from_json(o) for o in filters or []] + + # Validate arguments against known Juju API types. + if filters_ is not None and not isinstance(filters_, (bytes, str, list)): + raise Exception("Expected filters_ to be a Sequence, received: {}".format(type(filters_))) + + self.filters = filters_ + self.unknown_fields = 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 + pool : str + size : int + ''' + filesystem_id_ = filesystem_id + pool_ = pool + size_ = size + + # Validate arguments against known Juju API types. + if filesystem_id_ is not None and not isinstance(filesystem_id_, (bytes, str)): + raise Exception("Expected filesystem_id_ to be a str, received: {}".format(type(filesystem_id_))) + + if pool_ is not None and not isinstance(pool_, (bytes, str)): + raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + self.filesystem_id = filesystem_id_ + self.pool = pool_ + self.size = size_ + self.unknown_fields = 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 + attributes : typing.Mapping[str, typing.Any] + filesystem_tag : str + provider : str + size : int + tags : typing.Mapping[str, str] + volume_tag : str + ''' + attachment_ = FilesystemAttachmentParams.from_json(attachment) if attachment else None + attributes_ = attributes + filesystem_tag_ = filesystem_tag + provider_ = provider + size_ = size + tags_ = tags + volume_tag_ = volume_tag + + # Validate arguments against known Juju API types. + if attachment_ is not None and not isinstance(attachment_, (dict, FilesystemAttachmentParams)): + raise Exception("Expected attachment_ to be a FilesystemAttachmentParams, received: {}".format(type(attachment_))) + + if attributes_ is not None and not isinstance(attributes_, dict): + raise Exception("Expected attributes_ to be a Mapping, received: {}".format(type(attributes_))) + + if filesystem_tag_ is not None and not isinstance(filesystem_tag_, (bytes, str)): + raise Exception("Expected filesystem_tag_ to be a str, received: {}".format(type(filesystem_tag_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + + self.attachment = attachment_ + self.attributes = attributes_ + self.filesystem_tag = filesystem_tag_ + self.provider = provider_ + self.size = size_ + self.tags = tags_ + self.volume_tag = volume_tag_ + self.unknown_fields = unknown_fields + + + +class FilesystemParamsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : FilesystemParams + ''' + error_ = Error.from_json(error) if error else None + result_ = FilesystemParams.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, FilesystemParams)): + raise Exception("Expected result_ to be a FilesystemParams, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class FilesystemParamsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~FilesystemParamsResult] + ''' + results_ = [FilesystemParamsResult.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 FilesystemResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : Filesystem + ''' + error_ = Error.from_json(error) if error else None + result_ = Filesystem.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, Filesystem)): + raise Exception("Expected result_ to be a Filesystem, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class FilesystemResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~FilesystemResult] + ''' + results_ = [FilesystemResult.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 Filesystems(Type): + _toSchema = {'filesystems': 'filesystems'} + _toPy = {'filesystems': 'filesystems'} + def __init__(self, filesystems=None, **unknown_fields): + ''' + filesystems : typing.Sequence[~Filesystem] + ''' + filesystems_ = [Filesystem.from_json(o) for o in filesystems or []] + + # Validate arguments against known Juju API types. + if filesystems_ is not None and not isinstance(filesystems_, (bytes, str, list)): + raise Exception("Expected filesystems_ to be a Sequence, received: {}".format(type(filesystems_))) + + self.filesystems = filesystems_ + self.unknown_fields = unknown_fields + + + +class FindActionsByNames(Type): + _toSchema = {'names': 'names'} + _toPy = {'names': 'names'} + def __init__(self, names=None, **unknown_fields): + ''' + names : typing.Sequence[str] + ''' + names_ = names + + # Validate arguments against known Juju API types. + if names_ is not None and not isinstance(names_, (bytes, str, list)): + raise Exception("Expected names_ to be a Sequence, received: {}".format(type(names_))) + + self.names = names_ + self.unknown_fields = unknown_fields + + + +class FindResponse(Type): + _toSchema = {'architectures': 'architectures', 'id_': 'id', 'name': 'name', 'os': 'os', 'publisher': 'publisher', 'series': 'series', 'store_url': 'store-url', 'summary': 'summary', 'type_': 'type', 'version': 'version'} + _toPy = {'architectures': 'architectures', 'id': 'id_', 'name': 'name', 'os': 'os', 'publisher': 'publisher', 'series': 'series', 'store-url': 'store_url', 'summary': 'summary', 'type': 'type_', 'version': 'version'} + def __init__(self, architectures=None, id_=None, name=None, os=None, publisher=None, series=None, store_url=None, summary=None, type_=None, version=None, **unknown_fields): + ''' + architectures : typing.Sequence[str] + id_ : str + name : str + os : typing.Sequence[str] + publisher : str + series : typing.Sequence[str] + store_url : str + summary : str + type_ : str + version : str + ''' + architectures_ = architectures + id__ = id_ + name_ = name + os_ = os + publisher_ = publisher + series_ = series + store_url_ = store_url + summary_ = summary + type__ = type_ + version_ = version + + # Validate arguments against known Juju API types. + if architectures_ is not None and not isinstance(architectures_, (bytes, str, list)): + raise Exception("Expected architectures_ to be a Sequence, received: {}".format(type(architectures_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if os_ is not None and not isinstance(os_, (bytes, str, list)): + raise Exception("Expected os_ to be a Sequence, received: {}".format(type(os_))) + + if publisher_ is not None and not isinstance(publisher_, (bytes, str)): + raise Exception("Expected publisher_ to be a str, received: {}".format(type(publisher_))) + + if series_ is not None and not isinstance(series_, (bytes, str, list)): + raise Exception("Expected series_ to be a Sequence, received: {}".format(type(series_))) + + if store_url_ is not None and not isinstance(store_url_, (bytes, str)): + raise Exception("Expected store_url_ to be a str, received: {}".format(type(store_url_))) + + if summary_ is not None and not isinstance(summary_, (bytes, str)): + raise Exception("Expected summary_ to be a str, received: {}".format(type(summary_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + + self.architectures = architectures_ + self.id_ = id__ + self.name = name_ + self.os = os_ + self.publisher = publisher_ + self.series = series_ + self.store_url = store_url_ + self.summary = summary_ + self.type_ = type__ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class FindTags(Type): + _toSchema = {'prefixes': 'prefixes'} + _toPy = {'prefixes': 'prefixes'} + def __init__(self, prefixes=None, **unknown_fields): + ''' + prefixes : typing.Sequence[str] + ''' + prefixes_ = prefixes + + # Validate arguments against known Juju API types. + if prefixes_ is not None and not isinstance(prefixes_, (bytes, str, list)): + raise Exception("Expected prefixes_ to be a Sequence, received: {}".format(type(prefixes_))) + + self.prefixes = prefixes_ + self.unknown_fields = unknown_fields + + + +class FindTagsResults(Type): + _toSchema = {'matches': 'matches'} + _toPy = {'matches': 'matches'} + def __init__(self, matches=None, **unknown_fields): + ''' + matches : typing.Mapping[str, typing.Sequence[~Entity]] + ''' + matches_ = {k: Entity.from_json(v) for k, v in (matches or dict()).items()} + + # Validate arguments against known Juju API types. + if matches_ is not None and not isinstance(matches_, dict): + raise Exception("Expected matches_ to be a Mapping, received: {}".format(type(matches_))) + + self.matches = matches_ + self.unknown_fields = unknown_fields + + + +class FindToolsParams(Type): + _toSchema = {'agentstream': 'agentstream', 'arch': 'arch', 'major': 'major', 'minor': 'minor', 'number': 'number', 'os_type': 'os-type', 'series': 'series'} + _toPy = {'agentstream': 'agentstream', 'arch': 'arch', 'major': 'major', 'minor': 'minor', 'number': 'number', 'os-type': 'os_type', 'series': 'series'} + def __init__(self, agentstream=None, arch=None, major=None, minor=None, number=None, os_type=None, series=None, **unknown_fields): + ''' + agentstream : str + arch : str + major : int + minor : int + number : Number + os_type : str + series : str + ''' + agentstream_ = agentstream + arch_ = arch + major_ = major + minor_ = minor + number_ = Number.from_json(number) if number else None + os_type_ = os_type + series_ = series + + # Validate arguments against known Juju API types. + 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 minor_ is not None and not isinstance(minor_, int): + raise Exception("Expected minor_ to be a int, received: {}".format(type(minor_))) + + 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_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + self.agentstream = agentstream_ + self.arch = arch_ + self.major = major_ + self.minor = minor_ + self.number = number_ + self.os_type = os_type_ + self.series = series_ + self.unknown_fields = unknown_fields + + + +class FindToolsResult(Type): + _toSchema = {'error': 'error', 'list_': 'list'} + _toPy = {'error': 'error', 'list': 'list_'} + def __init__(self, error=None, list_=None, **unknown_fields): + ''' + error : Error + list_ : typing.Sequence[~Tools] + ''' + error_ = Error.from_json(error) if error else None + list__ = [Tools.from_json(o) for o in list_ or []] + + # 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 list__ is not None and not isinstance(list__, (bytes, str, list)): + raise Exception("Expected list__ to be a Sequence, received: {}".format(type(list__))) + + self.error = error_ + self.list_ = list__ + self.unknown_fields = 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 + whitelist_cidrs : typing.Sequence[str] + ''' + known_service_ = known_service + whitelist_cidrs_ = whitelist_cidrs + + # Validate arguments against known Juju API types. + if known_service_ is not None and not isinstance(known_service_, (bytes, str)): + raise Exception("Expected known_service_ to be a str, received: {}".format(type(known_service_))) + + if whitelist_cidrs_ is not None and not isinstance(whitelist_cidrs_, (bytes, str, list)): + raise Exception("Expected whitelist_cidrs_ to be a Sequence, received: {}".format(type(whitelist_cidrs_))) + + self.known_service = known_service_ + self.whitelist_cidrs = whitelist_cidrs_ + self.unknown_fields = unknown_fields + + + +class FirewallRuleArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~FirewallRule] + ''' + args_ = [FirewallRule.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 FullStatus(Type): + _toSchema = {'applications': 'applications', 'branches': 'branches', 'controller_timestamp': 'controller-timestamp', 'machines': 'machines', 'model': 'model', 'offers': 'offers', 'relations': 'relations', 'remote_applications': 'remote-applications'} + _toPy = {'applications': 'applications', 'branches': 'branches', 'controller-timestamp': 'controller_timestamp', 'machines': 'machines', 'model': 'model', 'offers': 'offers', 'relations': 'relations', 'remote-applications': 'remote_applications'} + def __init__(self, applications=None, branches=None, controller_timestamp=None, machines=None, model=None, offers=None, relations=None, remote_applications=None, **unknown_fields): + ''' + applications : typing.Mapping[str, ~ApplicationStatus] + branches : typing.Mapping[str, ~BranchStatus] + controller_timestamp : str + machines : typing.Mapping[str, ~MachineStatus] + model : ModelStatusInfo + offers : typing.Mapping[str, ~ApplicationOfferStatus] + relations : typing.Sequence[~RelationStatus] + remote_applications : typing.Mapping[str, ~RemoteApplicationStatus] + ''' + applications_ = {k: ApplicationStatus.from_json(v) for k, v in (applications or dict()).items()} + branches_ = {k: BranchStatus.from_json(v) for k, v in (branches or dict()).items()} + controller_timestamp_ = controller_timestamp + machines_ = {k: MachineStatus.from_json(v) for k, v in (machines or dict()).items()} + model_ = ModelStatusInfo.from_json(model) if model else None + offers_ = {k: ApplicationOfferStatus.from_json(v) for k, v in (offers or dict()).items()} + relations_ = [RelationStatus.from_json(o) for o in relations or []] + remote_applications_ = {k: RemoteApplicationStatus.from_json(v) for k, v in (remote_applications or dict()).items()} + + # Validate arguments against known Juju API types. + if applications_ is not None and not isinstance(applications_, dict): + raise Exception("Expected applications_ to be a Mapping, received: {}".format(type(applications_))) + + if branches_ is not None and not isinstance(branches_, dict): + raise Exception("Expected branches_ to be a Mapping, received: {}".format(type(branches_))) + + if controller_timestamp_ is not None and not isinstance(controller_timestamp_, (bytes, str)): + raise Exception("Expected controller_timestamp_ to be a str, received: {}".format(type(controller_timestamp_))) + + if machines_ is not None and not isinstance(machines_, dict): + raise Exception("Expected machines_ to be a Mapping, received: {}".format(type(machines_))) + + if model_ is not None and not isinstance(model_, (dict, ModelStatusInfo)): + raise Exception("Expected model_ to be a ModelStatusInfo, received: {}".format(type(model_))) + + if offers_ is not None and not isinstance(offers_, dict): + raise Exception("Expected offers_ to be a Mapping, received: {}".format(type(offers_))) + + if relations_ is not None and not isinstance(relations_, (bytes, str, list)): + raise Exception("Expected relations_ to be a Sequence, received: {}".format(type(relations_))) + + if remote_applications_ is not None and not isinstance(remote_applications_, dict): + raise Exception("Expected remote_applications_ to be a Mapping, received: {}".format(type(remote_applications_))) + + self.applications = applications_ + self.branches = branches_ + self.controller_timestamp = controller_timestamp_ + self.machines = machines_ + self.model = model_ + self.offers = offers_ + self.relations = relations_ + self.remote_applications = remote_applications_ + self.unknown_fields = unknown_fields + + + +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] + branch : str + completed : int + completed_by : str + created : int + created_by : str + generation_id : int + ''' + applications_ = [GenerationApplication.from_json(o) for o in applications or []] + branch_ = branch + completed_ = completed + completed_by_ = completed_by + created_ = created + created_by_ = created_by + generation_id_ = generation_id + + # Validate arguments against known Juju API types. + 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 branch_ is not None and not isinstance(branch_, (bytes, str)): + raise Exception("Expected branch_ to be a str, received: {}".format(type(branch_))) + + if completed_ is not None and not isinstance(completed_, int): + raise Exception("Expected completed_ to be a int, received: {}".format(type(completed_))) + + if completed_by_ is not None and not isinstance(completed_by_, (bytes, str)): + raise Exception("Expected completed_by_ to be a str, received: {}".format(type(completed_by_))) + + if created_ is not None and not isinstance(created_, int): + raise Exception("Expected created_ to be a int, received: {}".format(type(created_))) + + if created_by_ is not None and not isinstance(created_by_, (bytes, str)): + raise Exception("Expected created_by_ to be a str, received: {}".format(type(created_by_))) + + 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_))) + + self.applications = applications_ + self.branch = branch_ + self.completed = completed_ + self.completed_by = completed_by_ + self.created = created_ + self.created_by = created_by_ + self.generation_id = generation_id_ + self.unknown_fields = unknown_fields + + + +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 + config : typing.Mapping[str, typing.Any] + pending : typing.Sequence[str] + progress : str + tracking : typing.Sequence[str] + ''' + application_ = application + config_ = config + pending_ = pending + progress_ = progress + tracking_ = tracking + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if pending_ is not None and not isinstance(pending_, (bytes, str, list)): + raise Exception("Expected pending_ to be a Sequence, received: {}".format(type(pending_))) + + if progress_ is not None and not isinstance(progress_, (bytes, str)): + raise Exception("Expected progress_ to be a str, received: {}".format(type(progress_))) + + if tracking_ is not None and not isinstance(tracking_, (bytes, str, list)): + raise Exception("Expected tracking_ to be a Sequence, received: {}".format(type(tracking_))) + + self.application = application_ + self.config = config_ + self.pending = pending_ + self.progress = progress_ + self.tracking = tracking_ + self.unknown_fields = unknown_fields + + + +class GenerationId(Type): + _toSchema = {'generation_id': 'generation-id'} + _toPy = {'generation-id': 'generation_id'} + def __init__(self, generation_id=None, **unknown_fields): + ''' + generation_id : int + ''' + generation_id_ = generation_id + + # Validate arguments against known Juju API types. + 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_))) + + self.generation_id = generation_id_ + self.unknown_fields = 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 + generation : Generation + ''' + error_ = Error.from_json(error) if error else None + generation_ = Generation.from_json(generation) if generation 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 generation_ is not None and not isinstance(generation_, (dict, Generation)): + raise Exception("Expected generation_ to be a Generation, received: {}".format(type(generation_))) + + self.error = error_ + self.generation = generation_ + self.unknown_fields = unknown_fields + + + +class GenerationResults(Type): + _toSchema = {'error': 'error', 'generations': 'generations'} + _toPy = {'error': 'error', 'generations': 'generations'} + def __init__(self, error=None, generations=None, **unknown_fields): + ''' + error : Error + generations : typing.Sequence[~Generation] + ''' + error_ = Error.from_json(error) if error else None + generations_ = [Generation.from_json(o) for o in generations or []] + + # 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 generations_ is not None and not isinstance(generations_, (bytes, str, list)): + raise Exception("Expected generations_ to be a Sequence, received: {}".format(type(generations_))) + + self.error = error_ + self.generations = generations_ + self.unknown_fields = unknown_fields + + + +class GetApplicationConstraints(Type): + _toSchema = {'application': 'application'} + _toPy = {'application': 'application'} + def __init__(self, application=None, **unknown_fields): + ''' + application : str + ''' + application_ = application + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + self.application = application_ + self.unknown_fields = unknown_fields + + + +class GetConstraintsResults(Type): + _toSchema = {'constraints': 'constraints'} + _toPy = {'constraints': 'constraints'} + def __init__(self, constraints=None, **unknown_fields): + ''' + constraints : Value + ''' + constraints_ = Value.from_json(constraints) if constraints else None + + # Validate arguments against known Juju API types. + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + self.constraints = constraints_ + self.unknown_fields = unknown_fields + + + +class GetLeadershipSettingsBulkResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~GetLeadershipSettingsResult] + ''' + results_ = [GetLeadershipSettingsResult.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 GetLeadershipSettingsResult(Type): + _toSchema = {'error': 'error', 'settings': 'settings'} + _toPy = {'error': 'error', 'settings': 'settings'} + def __init__(self, error=None, settings=None, **unknown_fields): + ''' + error : Error + settings : typing.Mapping[str, str] + ''' + error_ = Error.from_json(error) if error else None + settings_ = settings + + # 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 settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) + + self.error = error_ + self.settings = settings_ + self.unknown_fields = unknown_fields + + + +class GetSecretArg(Type): + _toSchema = {'id_': 'id', 'url': 'url'} + _toPy = {'id': 'id_', 'url': 'url'} + def __init__(self, id_=None, url=None, **unknown_fields): + ''' + id_ : str + url : str + ''' + id__ = id_ + url_ = url + + # Validate arguments against known Juju API types. + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.id_ = id__ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class GetSecretArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~GetSecretArg] + ''' + args_ = [GetSecretArg.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 GetTokenArg(Type): + _toSchema = {'tag': 'tag'} + _toPy = {'tag': 'tag'} + def __init__(self, tag=None, **unknown_fields): + ''' + tag : str + ''' + tag_ = tag + + # Validate arguments against known Juju API types. + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class GetTokenArgs(Type): + _toSchema = {'args': 'Args'} + _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~GetTokenArg] + ''' + args_ = [GetTokenArg.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 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] + units : typing.Mapping[str, ~GoalStateStatus] + ''' + relations_ = relations + units_ = {k: GoalStateStatus.from_json(v) for k, v in (units or dict()).items()} + + # Validate arguments against known Juju API types. + if relations_ is not None and not isinstance(relations_, dict): + raise Exception("Expected relations_ to be a Mapping, received: {}".format(type(relations_))) + + if units_ is not None and not isinstance(units_, dict): + raise Exception("Expected units_ to be a Mapping, received: {}".format(type(units_))) + + self.relations = relations_ + self.units = units_ + self.unknown_fields = 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 + result : GoalState + ''' + error_ = Error.from_json(error) if error else None + result_ = GoalState.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, GoalState)): + raise Exception("Expected result_ to be a GoalState, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class GoalStateResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~GoalStateResult] + ''' + results_ = [GoalStateResult.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 GoalStateStatus(Type): + _toSchema = {'since': 'since', 'status': 'status'} + _toPy = {'since': 'since', 'status': 'status'} + def __init__(self, since=None, status=None, **unknown_fields): + ''' + since : str + status : str + ''' + since_ = since + status_ = status + + # Validate arguments against known Juju API types. + if since_ is not None and not isinstance(since_, (bytes, str)): + raise Exception("Expected since_ to be a str, received: {}".format(type(since_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.since = since_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class HAMember(Type): + _toSchema = {'public_address': 'public-address', 'series': 'series', 'tag': 'tag'} + _toPy = {'public-address': 'public_address', 'series': 'series', 'tag': 'tag'} + def __init__(self, public_address=None, series=None, tag=None, **unknown_fields): + ''' + public_address : Address + series : str + tag : str + ''' + public_address_ = Address.from_json(public_address) if public_address else None + series_ = series + tag_ = tag + + # Validate arguments against known Juju API types. + if public_address_ is not None and not isinstance(public_address_, (dict, Address)): + raise Exception("Expected public_address_ to be a Address, received: {}".format(type(public_address_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.public_address = public_address_ + self.series = series_ + self.tag = tag_ + self.unknown_fields = 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'} + _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'} + 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, **unknown_fields): + ''' + arch : str + availability_zone : str + cpu_cores : int + cpu_power : int + mem : int + root_disk : int + root_disk_source : str + tags : typing.Sequence[str] + ''' + 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 + + # Validate arguments against known Juju API types. + if arch_ is not None and not isinstance(arch_, (bytes, str)): + raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) + + if availability_zone_ is not None and not isinstance(availability_zone_, (bytes, str)): + raise Exception("Expected availability_zone_ to be a str, received: {}".format(type(availability_zone_))) + + if cpu_cores_ is not None and not isinstance(cpu_cores_, int): + raise Exception("Expected cpu_cores_ to be a int, received: {}".format(type(cpu_cores_))) + + if cpu_power_ is not None and not isinstance(cpu_power_, int): + raise Exception("Expected cpu_power_ to be a int, received: {}".format(type(cpu_power_))) + + if mem_ is not None and not isinstance(mem_, int): + raise Exception("Expected mem_ to be a int, received: {}".format(type(mem_))) + + if root_disk_ is not None and not isinstance(root_disk_, int): + raise Exception("Expected root_disk_ to be a int, received: {}".format(type(root_disk_))) + + if root_disk_source_ is not None and not isinstance(root_disk_source_, (bytes, str)): + raise Exception("Expected root_disk_source_ to be a str, received: {}".format(type(root_disk_source_))) + + if tags_ is not None and not isinstance(tags_, (bytes, str, list)): + raise Exception("Expected tags_ to be a Sequence, received: {}".format(type(tags_))) + + self.arch = arch_ + self.availability_zone = availability_zone_ + self.cpu_cores = cpu_cores_ + self.cpu_power = cpu_power_ + self.mem = mem_ + self.root_disk = root_disk_ + self.root_disk_source = root_disk_source_ + self.tags = tags_ + self.unknown_fields = unknown_fields + + + +class History(Type): + _toSchema = {'error': 'error', 'statuses': 'statuses'} + _toPy = {'error': 'error', 'statuses': 'statuses'} + def __init__(self, error=None, statuses=None, **unknown_fields): + ''' + error : Error + statuses : typing.Sequence[~DetailedStatus] + ''' + error_ = Error.from_json(error) if error else None + statuses_ = [DetailedStatus.from_json(o) for o in statuses or []] + + # 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 statuses_ is not None and not isinstance(statuses_, (bytes, str, list)): + raise Exception("Expected statuses_ to be a Sequence, received: {}".format(type(statuses_))) + + self.error = error_ + self.statuses = statuses_ + self.unknown_fields = 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 + new_bridges : typing.Sequence[~DeviceBridgeInfo] + reconfigure_delay : int + ''' + error_ = Error.from_json(error) if error else None + new_bridges_ = [DeviceBridgeInfo.from_json(o) for o in new_bridges or []] + reconfigure_delay_ = reconfigure_delay + + # 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 new_bridges_ is not None and not isinstance(new_bridges_, (bytes, str, list)): + raise Exception("Expected new_bridges_ to be a Sequence, received: {}".format(type(new_bridges_))) + + if reconfigure_delay_ is not None and not isinstance(reconfigure_delay_, int): + raise Exception("Expected reconfigure_delay_ to be a int, received: {}".format(type(reconfigure_delay_))) + + self.error = error_ + self.new_bridges = new_bridges_ + self.reconfigure_delay = reconfigure_delay_ + self.unknown_fields = unknown_fields + + + +class HostNetworkChangeResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~HostNetworkChange] + ''' + results_ = [HostNetworkChange.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 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 + cidr : str + config_type : str + is_secondary : bool + port : int + scope : str + space_id : str + space_name : str + type_ : str + value : str + ''' + address_ = Address.from_json(address) if address else None + 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 + + # Validate arguments against known Juju API types. + if address_ is not None and not isinstance(address_, (dict, Address)): + raise Exception("Expected address_ to be a Address, received: {}".format(type(address_))) + + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + + if config_type_ is not None and not isinstance(config_type_, (bytes, str)): + raise Exception("Expected config_type_ to be a str, received: {}".format(type(config_type_))) + + if is_secondary_ is not None and not isinstance(is_secondary_, bool): + raise Exception("Expected is_secondary_ to be a bool, received: {}".format(type(is_secondary_))) + + if port_ is not None and not isinstance(port_, int): + raise Exception("Expected port_ to be a int, received: {}".format(type(port_))) + + if scope_ is not None and not isinstance(scope_, (bytes, str)): + raise Exception("Expected scope_ to be a str, received: {}".format(type(scope_))) + + if space_id_ is not None and not isinstance(space_id_, (bytes, str)): + raise Exception("Expected space_id_ to be a str, received: {}".format(type(space_id_))) + + if space_name_ is not None and not isinstance(space_name_, (bytes, str)): + raise Exception("Expected space_name_ to be a str, received: {}".format(type(space_name_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if value_ is not None and not isinstance(value_, (bytes, str)): + raise Exception("Expected value_ to be a str, received: {}".format(type(value_))) + + self.address = address_ + self.cidr = cidr_ + self.config_type = config_type_ + self.is_secondary = is_secondary_ + self.port = port_ + self.scope = scope_ + self.space_id = space_id_ + self.space_name = space_name_ + self.type_ = type__ + self.value = value_ + self.unknown_fields = unknown_fields + + + +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 + config : typing.Mapping[str, typing.Any] + error : Error + name : str + owner : str + ''' + cloud_spec_ = CloudSpec.from_json(cloud_spec) if cloud_spec else None + config_ = config + error_ = Error.from_json(error) if error else None + name_ = name + owner_ = owner + + # Validate arguments against known Juju API types. + if cloud_spec_ is not None and not isinstance(cloud_spec_, (dict, CloudSpec)): + raise Exception("Expected cloud_spec_ to be a CloudSpec, received: {}".format(type(cloud_spec_))) + + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + 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_ is not None and not isinstance(owner_, (bytes, str)): + raise Exception("Expected owner_ to be a str, received: {}".format(type(owner_))) + + self.cloud_spec = cloud_spec_ + self.config = config_ + self.error = error_ + self.name = name_ + self.owner = owner_ + self.unknown_fields = unknown_fields + + + +class HostedModelConfigsResults(Type): + _toSchema = {'models': 'models'} + _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): + ''' + models : typing.Sequence[~HostedModelConfig] + ''' + models_ = [HostedModelConfig.from_json(o) for o in models or []] + + # Validate arguments against known Juju API types. + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + self.models = models_ + self.unknown_fields = unknown_fields + + + +class ImageFilterParams(Type): + _toSchema = {'images': 'images'} + _toPy = {'images': 'images'} + def __init__(self, images=None, **unknown_fields): + ''' + images : typing.Sequence[~ImageSpec] + ''' + images_ = [ImageSpec.from_json(o) for o in images or []] + + # Validate arguments against known Juju API types. + if images_ is not None and not isinstance(images_, (bytes, str, list)): + raise Exception("Expected images_ to be a Sequence, received: {}".format(type(images_))) + + self.images = images_ + self.unknown_fields = unknown_fields + + + +class ImageMetadata(Type): + _toSchema = {'arch': 'arch', 'created': 'created', 'kind': 'kind', 'series': 'series', 'url': 'url'} + _toPy = {'arch': 'arch', 'created': 'created', 'kind': 'kind', 'series': 'series', 'url': 'url'} + def __init__(self, arch=None, created=None, kind=None, series=None, url=None, **unknown_fields): + ''' + arch : str + created : str + kind : str + series : str + url : str + ''' + arch_ = arch + created_ = created + kind_ = kind + series_ = series + url_ = url + + # Validate arguments against known Juju API types. + if arch_ is not None and not isinstance(arch_, (bytes, str)): + raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) + + if created_ is not None and not isinstance(created_, (bytes, str)): + raise Exception("Expected created_ to be a str, received: {}".format(type(created_))) + + if kind_ is not None and not isinstance(kind_, (bytes, str)): + raise Exception("Expected kind_ to be a str, received: {}".format(type(kind_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.arch = arch_ + self.created = created_ + self.kind = kind_ + self.series = series_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class ImageMetadataFilter(Type): + _toSchema = {'arches': 'arches', 'region': 'region', 'root_storage_type': 'root-storage-type', 'series': 'series', 'stream': 'stream', 'virt_type': 'virt-type'} + _toPy = {'arches': 'arches', 'region': 'region', 'root-storage-type': 'root_storage_type', 'series': 'series', 'stream': 'stream', 'virt-type': 'virt_type'} + def __init__(self, arches=None, region=None, root_storage_type=None, series=None, stream=None, virt_type=None, **unknown_fields): + ''' + arches : typing.Sequence[str] + region : str + root_storage_type : str + series : typing.Sequence[str] + stream : str + virt_type : str + ''' + arches_ = arches + region_ = region + root_storage_type_ = root_storage_type + series_ = series + stream_ = stream + virt_type_ = virt_type + + # Validate arguments against known Juju API types. + 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 series_ is not None and not isinstance(series_, (bytes, str, list)): + raise Exception("Expected series_ to be a Sequence, received: {}".format(type(series_))) + + if stream_ is not None and not isinstance(stream_, (bytes, str)): + raise Exception("Expected stream_ to be a str, received: {}".format(type(stream_))) + + 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_))) + + self.arches = arches_ + self.region = region_ + self.root_storage_type = root_storage_type_ + self.series = series_ + self.stream = stream_ + self.virt_type = virt_type_ + self.unknown_fields = unknown_fields + + + +class ImageSpec(Type): + _toSchema = {'arch': 'arch', 'kind': 'kind', 'series': 'series'} + _toPy = {'arch': 'arch', 'kind': 'kind', 'series': 'series'} + def __init__(self, arch=None, kind=None, series=None, **unknown_fields): + ''' + arch : str + kind : str + series : str + ''' + arch_ = arch + kind_ = kind + series_ = series + + # Validate arguments against known Juju API types. + if arch_ is not None and not isinstance(arch_, (bytes, str)): + raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) + + if kind_ is not None and not isinstance(kind_, (bytes, str)): + raise Exception("Expected kind_ to be a str, received: {}".format(type(kind_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + self.arch = arch_ + self.kind = kind_ + self.series = series_ + self.unknown_fields = unknown_fields + + + +class ImportStorageDetails(Type): + _toSchema = {'storage_tag': 'storage-tag'} + _toPy = {'storage-tag': 'storage_tag'} + def __init__(self, storage_tag=None, **unknown_fields): + ''' + storage_tag : str + ''' + storage_tag_ = storage_tag + + # Validate arguments against known Juju API types. + if storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): + raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) + + self.storage_tag = storage_tag_ + self.unknown_fields = 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 + pool : str + provider_id : str + storage_name : str + ''' + kind_ = kind + pool_ = pool + provider_id_ = provider_id + storage_name_ = storage_name + + # Validate arguments against known Juju API types. + if kind_ is not None and not isinstance(kind_, int): + raise Exception("Expected kind_ to be a int, received: {}".format(type(kind_))) + + if pool_ is not None and not isinstance(pool_, (bytes, str)): + raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if storage_name_ is not None and not isinstance(storage_name_, (bytes, str)): + raise Exception("Expected storage_name_ to be a str, received: {}".format(type(storage_name_))) + + self.kind = kind_ + self.pool = pool_ + self.provider_id = provider_id_ + self.storage_name = storage_name_ + self.unknown_fields = unknown_fields + + + +class ImportStorageResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ImportStorageDetails + ''' + error_ = Error.from_json(error) if error else None + result_ = ImportStorageDetails.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, ImportStorageDetails)): + raise Exception("Expected result_ to be a ImportStorageDetails, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ImportStorageResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ImportStorageResult] + ''' + results_ = [ImportStorageResult.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 Info(Type): + _toSchema = {'channel': 'channel', 'tag': 'tag'} + _toPy = {'channel': 'channel', 'tag': 'tag'} + def __init__(self, channel=None, tag=None, **unknown_fields): + ''' + channel : str + tag : str + ''' + channel_ = channel + tag_ = tag + + # Validate arguments against known Juju API types. + if channel_ is not None and not isinstance(channel_, (bytes, str)): + raise Exception("Expected channel_ to be a str, received: {}".format(type(channel_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.channel = channel_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class InfoResponse(Type): + _toSchema = {'bundle': 'bundle', 'channel_map': 'channel-map', 'charm': 'charm', 'description': 'description', 'id_': 'id', 'name': 'name', 'publisher': 'publisher', 'series': 'series', 'store_url': 'store-url', 'summary': 'summary', 'tags': 'tags', 'tracks': 'tracks', 'type_': 'type'} + _toPy = {'bundle': 'bundle', 'channel-map': 'channel_map', 'charm': 'charm', 'description': 'description', 'id': 'id_', 'name': 'name', 'publisher': 'publisher', 'series': 'series', 'store-url': 'store_url', 'summary': 'summary', 'tags': 'tags', 'tracks': 'tracks', 'type': 'type_'} + def __init__(self, bundle=None, channel_map=None, charm=None, description=None, id_=None, name=None, publisher=None, series=None, store_url=None, summary=None, tags=None, tracks=None, type_=None, **unknown_fields): + ''' + bundle : CharmHubBundle + channel_map : typing.Mapping[str, ~Channel] + charm : CharmHubCharm + description : str + id_ : str + name : str + publisher : str + series : typing.Sequence[str] + store_url : str + summary : str + tags : typing.Sequence[str] + tracks : typing.Sequence[str] + type_ : str + ''' + bundle_ = CharmHubBundle.from_json(bundle) if bundle else None + channel_map_ = {k: Channel.from_json(v) for k, v in (channel_map or dict()).items()} + charm_ = CharmHubCharm.from_json(charm) if charm else None + description_ = description + id__ = id_ + name_ = name + publisher_ = publisher + series_ = series + store_url_ = store_url + summary_ = summary + tags_ = tags + tracks_ = tracks + type__ = type_ + + # Validate arguments against known Juju API types. + if bundle_ is not None and not isinstance(bundle_, (dict, CharmHubBundle)): + raise Exception("Expected bundle_ to be a CharmHubBundle, received: {}".format(type(bundle_))) + + if channel_map_ is not None and not isinstance(channel_map_, dict): + raise Exception("Expected channel_map_ to be a Mapping, received: {}".format(type(channel_map_))) + + if charm_ is not None and not isinstance(charm_, (dict, CharmHubCharm)): + raise Exception("Expected charm_ to be a CharmHubCharm, received: {}".format(type(charm_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if publisher_ is not None and not isinstance(publisher_, (bytes, str)): + raise Exception("Expected publisher_ to be a str, received: {}".format(type(publisher_))) + + if series_ is not None and not isinstance(series_, (bytes, str, list)): + raise Exception("Expected series_ to be a Sequence, received: {}".format(type(series_))) + + if store_url_ is not None and not isinstance(store_url_, (bytes, str)): + raise Exception("Expected store_url_ to be a str, received: {}".format(type(store_url_))) + + if summary_ is not None and not isinstance(summary_, (bytes, str)): + raise Exception("Expected summary_ to be a str, received: {}".format(type(summary_))) + + if tags_ is not None and not isinstance(tags_, (bytes, str, list)): + raise Exception("Expected tags_ to be a Sequence, received: {}".format(type(tags_))) + + if tracks_ is not None and not isinstance(tracks_, (bytes, str, list)): + raise Exception("Expected tracks_ to be a Sequence, received: {}".format(type(tracks_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.bundle = bundle_ + self.channel_map = channel_map_ + self.charm = charm_ + self.description = description_ + self.id_ = id__ + self.name = name_ + self.publisher = publisher_ + self.series = series_ + self.store_url = store_url_ + self.summary = summary_ + self.tags = tags_ + self.tracks = tracks_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class IngressNetworksChangeEvent(Type): + _toSchema = {'application_token': 'application-token', 'bakery_version': 'bakery-version', 'ingress_required': 'ingress-required', 'macaroons': 'macaroons', 'networks': 'networks', 'relation_token': 'relation-token'} + _toPy = {'application-token': 'application_token', 'bakery-version': 'bakery_version', 'ingress-required': 'ingress_required', 'macaroons': 'macaroons', 'networks': 'networks', 'relation-token': 'relation_token'} + def __init__(self, application_token=None, bakery_version=None, ingress_required=None, macaroons=None, networks=None, relation_token=None, **unknown_fields): + ''' + application_token : str + bakery_version : int + ingress_required : bool + macaroons : typing.Sequence[~Macaroon] + networks : typing.Sequence[str] + relation_token : str + ''' + application_token_ = application_token + bakery_version_ = bakery_version + ingress_required_ = ingress_required + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + networks_ = networks + relation_token_ = relation_token + + # Validate arguments against known Juju API types. + if application_token_ is not None and not isinstance(application_token_, (bytes, str)): + raise Exception("Expected application_token_ to be a str, received: {}".format(type(application_token_))) + + 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 ingress_required_ is not None and not isinstance(ingress_required_, bool): + raise Exception("Expected ingress_required_ to be a bool, received: {}".format(type(ingress_required_))) + + 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 networks_ is not None and not isinstance(networks_, (bytes, str, list)): + raise Exception("Expected networks_ to be a Sequence, received: {}".format(type(networks_))) + + if relation_token_ is not None and not isinstance(relation_token_, (bytes, str)): + raise Exception("Expected relation_token_ to be a str, received: {}".format(type(relation_token_))) + + self.application_token = application_token_ + self.bakery_version = bakery_version_ + self.ingress_required = ingress_required_ + self.macaroons = macaroons_ + self.networks = networks_ + self.relation_token = relation_token_ + self.unknown_fields = unknown_fields + + + +class IngressNetworksChanges(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~IngressNetworksChangeEvent] + ''' + changes_ = [IngressNetworksChangeEvent.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = unknown_fields + + + +class InitiateMigrationArgs(Type): + _toSchema = {'specs': 'specs'} + _toPy = {'specs': 'specs'} + def __init__(self, specs=None, **unknown_fields): + ''' + specs : typing.Sequence[~MigrationSpec] + ''' + specs_ = [MigrationSpec.from_json(o) for o in specs or []] + + # Validate arguments against known Juju API types. + if specs_ is not None and not isinstance(specs_, (bytes, str, list)): + raise Exception("Expected specs_ to be a Sequence, received: {}".format(type(specs_))) + + self.specs = specs_ + self.unknown_fields = 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 + migration_id : str + model_tag : str + ''' + error_ = Error.from_json(error) if error else None + migration_id_ = migration_id + model_tag_ = model_tag + + # 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 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 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_))) + + self.error = error_ + self.migration_id = migration_id_ + self.model_tag = model_tag_ + self.unknown_fields = unknown_fields + + + +class InitiateMigrationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~InitiateMigrationResult] + ''' + results_ = [InitiateMigrationResult.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 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 + charm_profiles : typing.Sequence[str] + display_name : str + instance_id : str + network_config : typing.Sequence[~NetworkConfig] + nonce : str + tag : str + volume_attachments : typing.Mapping[str, ~VolumeAttachmentInfo] + volumes : typing.Sequence[~Volume] + ''' + characteristics_ = HardwareCharacteristics.from_json(characteristics) if characteristics else None + charm_profiles_ = charm_profiles + display_name_ = display_name + instance_id_ = instance_id + network_config_ = [NetworkConfig.from_json(o) for o in network_config or []] + nonce_ = nonce + tag_ = tag + volume_attachments_ = {k: VolumeAttachmentInfo.from_json(v) for k, v in (volume_attachments or dict()).items()} + volumes_ = [Volume.from_json(o) for o in volumes or []] + + # Validate arguments against known Juju API types. + if characteristics_ is not None and not isinstance(characteristics_, (dict, HardwareCharacteristics)): + raise Exception("Expected characteristics_ to be a HardwareCharacteristics, received: {}".format(type(characteristics_))) + + if charm_profiles_ is not None and not isinstance(charm_profiles_, (bytes, str, list)): + raise Exception("Expected charm_profiles_ to be a Sequence, received: {}".format(type(charm_profiles_))) + + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): + raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) + + if network_config_ is not None and not isinstance(network_config_, (bytes, str, list)): + raise Exception("Expected network_config_ to be a Sequence, received: {}".format(type(network_config_))) + + if nonce_ is not None and not isinstance(nonce_, (bytes, str)): + raise Exception("Expected nonce_ to be a str, received: {}".format(type(nonce_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if volume_attachments_ is not None and not isinstance(volume_attachments_, dict): + raise Exception("Expected volume_attachments_ to be a Mapping, received: {}".format(type(volume_attachments_))) + + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.characteristics = characteristics_ + self.charm_profiles = charm_profiles_ + self.display_name = display_name_ + self.instance_id = instance_id_ + self.network_config = network_config_ + self.nonce = nonce_ + self.tag = tag_ + self.volume_attachments = volume_attachments_ + self.volumes = volumes_ + self.unknown_fields = unknown_fields + + + +class InstanceType(Type): + _toSchema = {'arches': 'arches', 'cost': 'cost', 'cpu_cores': 'cpu-cores', 'deprecated': 'deprecated', 'memory': 'memory', 'name': 'name', 'root_disk': 'root-disk', 'virt_type': 'virt-type'} + _toPy = {'arches': 'arches', 'cost': 'cost', 'cpu-cores': 'cpu_cores', 'deprecated': 'deprecated', 'memory': 'memory', 'name': 'name', 'root-disk': 'root_disk', 'virt-type': 'virt_type'} + def __init__(self, arches=None, cost=None, cpu_cores=None, deprecated=None, memory=None, name=None, root_disk=None, virt_type=None, **unknown_fields): + ''' + arches : typing.Sequence[str] + cost : int + cpu_cores : int + deprecated : bool + memory : int + name : str + root_disk : int + virt_type : str + ''' + arches_ = arches + cost_ = cost + cpu_cores_ = cpu_cores + deprecated_ = deprecated + memory_ = memory + name_ = name + root_disk_ = root_disk + virt_type_ = virt_type + + # Validate arguments against known Juju API types. + 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 cost_ is not None and not isinstance(cost_, int): + raise Exception("Expected cost_ to be a int, received: {}".format(type(cost_))) + + if cpu_cores_ is not None and not isinstance(cpu_cores_, int): + raise Exception("Expected cpu_cores_ to be a int, received: {}".format(type(cpu_cores_))) + + if deprecated_ is not None and not isinstance(deprecated_, bool): + raise Exception("Expected deprecated_ to be a bool, received: {}".format(type(deprecated_))) + + if memory_ is not None and not isinstance(memory_, int): + raise Exception("Expected memory_ to be a int, received: {}".format(type(memory_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if root_disk_ is not None and not isinstance(root_disk_, int): + raise Exception("Expected root_disk_ to be a int, received: {}".format(type(root_disk_))) + + 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_))) + + self.arches = arches_ + self.cost = cost_ + self.cpu_cores = cpu_cores_ + self.deprecated = deprecated_ + self.memory = memory_ + self.name = name_ + self.root_disk = root_disk_ + self.virt_type = virt_type_ + self.unknown_fields = unknown_fields + + + +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 + cost_divisor : int + cost_unit : str + error : Error + instance_types : typing.Sequence[~InstanceType] + ''' + cost_currency_ = cost_currency + cost_divisor_ = cost_divisor + cost_unit_ = cost_unit + error_ = Error.from_json(error) if error else None + instance_types_ = [InstanceType.from_json(o) for o in instance_types or []] + + # Validate arguments against known Juju API types. + if cost_currency_ is not None and not isinstance(cost_currency_, (bytes, str)): + raise Exception("Expected cost_currency_ to be a str, received: {}".format(type(cost_currency_))) + + if cost_divisor_ is not None and not isinstance(cost_divisor_, int): + raise Exception("Expected cost_divisor_ to be a int, received: {}".format(type(cost_divisor_))) + + if cost_unit_ is not None and not isinstance(cost_unit_, (bytes, str)): + raise Exception("Expected cost_unit_ to be a str, received: {}".format(type(cost_unit_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if instance_types_ is not None and not isinstance(instance_types_, (bytes, str, list)): + raise Exception("Expected instance_types_ to be a Sequence, received: {}".format(type(instance_types_))) + + self.cost_currency = cost_currency_ + self.cost_divisor = cost_divisor_ + self.cost_unit = cost_unit_ + self.error = error_ + self.instance_types = instance_types_ + self.unknown_fields = unknown_fields + + + +class InstanceTypesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~InstanceTypesResult] + ''' + results_ = [InstanceTypesResult.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 InstancesInfo(Type): + _toSchema = {'machines': 'machines'} + _toPy = {'machines': 'machines'} + def __init__(self, machines=None, **unknown_fields): + ''' + machines : typing.Sequence[~InstanceInfo] + ''' + machines_ = [InstanceInfo.from_json(o) for o in machines or []] + + # Validate arguments against known Juju API types. + if machines_ is not None and not isinstance(machines_, (bytes, str, list)): + raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + + self.machines = machines_ + self.unknown_fields = 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 + result : int + ''' + error_ = Error.from_json(error) if error else None + result_ = result + + # 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_, int): + raise Exception("Expected result_ to be a int, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class IntResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~IntResult] + ''' + results_ = [IntResult.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 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 + hostname : str + value : str + ''' + cidr_ = cidr + hostname_ = hostname + value_ = value + + # Validate arguments against known Juju API types. + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + + if hostname_ is not None and not isinstance(hostname_, (bytes, str)): + raise Exception("Expected hostname_ to be a str, received: {}".format(type(hostname_))) + + if value_ is not None and not isinstance(value_, (bytes, str)): + raise Exception("Expected value_ to be a str, received: {}".format(type(value_))) + + self.cidr = cidr_ + self.hostname = hostname_ + self.value = value_ + self.unknown_fields = unknown_fields + + + +class InvalidateCredentialArg(Type): + _toSchema = {'reason': 'reason'} + _toPy = {'reason': 'reason'} + def __init__(self, reason=None, **unknown_fields): + ''' + reason : str + ''' + reason_ = reason + + # Validate arguments against known Juju API types. + if reason_ is not None and not isinstance(reason_, (bytes, str)): + raise Exception("Expected reason_ to be a str, received: {}".format(type(reason_))) + + self.reason = reason_ + self.unknown_fields = unknown_fields + + + +class IsMasterResult(Type): + _toSchema = {'master': 'master'} + _toPy = {'master': 'master'} + def __init__(self, master=None, **unknown_fields): + ''' + master : bool + ''' + master_ = master + + # Validate arguments against known Juju API types. + if master_ is not None and not isinstance(master_, bool): + raise Exception("Expected master_ to be a bool, received: {}".format(type(master_))) + + self.master = master_ + self.unknown_fields = unknown_fields + + + +class IsMeteredResult(Type): + _toSchema = {'metered': 'metered'} + _toPy = {'metered': 'metered'} + def __init__(self, metered=None, **unknown_fields): + ''' + metered : bool + ''' + metered_ = metered + + # Validate arguments against known Juju API types. + if metered_ is not None and not isinstance(metered_, bool): + raise Exception("Expected metered_ to be a bool, received: {}".format(type(metered_))) + + self.metered = metered_ + self.unknown_fields = 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 + cert : str + error : Error + private_key : str + ''' + ca_cert_ = ca_cert + cert_ = cert + error_ = Error.from_json(error) if error else None + private_key_ = private_key + + # Validate arguments against known Juju API types. + if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): + raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) + + if cert_ is not None and not isinstance(cert_, (bytes, str)): + raise Exception("Expected cert_ to be a str, received: {}".format(type(cert_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if private_key_ is not None and not isinstance(private_key_, (bytes, str)): + raise Exception("Expected private_key_ to be a str, received: {}".format(type(private_key_))) + + self.ca_cert = ca_cert_ + self.cert = cert_ + self.error = error_ + self.private_key = private_key_ + self.unknown_fields = unknown_fields + + + +class IssueOperatorCertificateResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~IssueOperatorCertificateResult] + ''' + results_ = [IssueOperatorCertificateResult.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 JobsResult(Type): + _toSchema = {'error': 'error', 'jobs': 'jobs'} + _toPy = {'error': 'error', 'jobs': 'jobs'} + def __init__(self, error=None, jobs=None, **unknown_fields): + ''' + error : Error + jobs : typing.Sequence[str] + ''' + error_ = Error.from_json(error) if error else None + jobs_ = jobs + + # 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 jobs_ is not None and not isinstance(jobs_, (bytes, str, list)): + raise Exception("Expected jobs_ to be a Sequence, received: {}".format(type(jobs_))) + + self.error = error_ + self.jobs = jobs_ + self.unknown_fields = unknown_fields + + + +class JobsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~JobsResult] + ''' + results_ = [JobsResult.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 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] + ''' + known_services_ = known_services + + # Validate arguments against known Juju API types. + if known_services_ is not None and not isinstance(known_services_, (bytes, str, list)): + raise Exception("Expected known_services_ to be a Sequence, received: {}".format(type(known_services_))) + + self.known_services = known_services_ + self.unknown_fields = 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 + service_type : str + ''' + deployment_type_ = deployment_type + service_type_ = service_type + + # Validate arguments against known Juju API types. + if deployment_type_ is not None and not isinstance(deployment_type_, (bytes, str)): + raise Exception("Expected deployment_type_ to be a str, received: {}".format(type(deployment_type_))) + + if service_type_ is not None and not isinstance(service_type_, (bytes, str)): + raise Exception("Expected service_type_ to be a str, received: {}".format(type(service_type_))) + + self.deployment_type = deployment_type_ + self.service_type = service_type_ + self.unknown_fields = 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] + count : int + type_ : str + ''' + attributes_ = attributes + count_ = count + type__ = type_ + + # Validate arguments against known Juju API types. + if attributes_ is not None and not isinstance(attributes_, dict): + raise Exception("Expected attributes_ to be a Mapping, received: {}".format(type(attributes_))) + + if count_ is not None and not isinstance(count_, int): + raise Exception("Expected count_ to be a int, received: {}".format(type(count_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.attributes = attributes_ + self.count = count_ + self.type_ = type__ + self.unknown_fields = 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 + provider : str + read_only : bool + ''' + mount_point_ = mount_point + provider_ = provider + read_only_ = read_only + + # Validate arguments against known Juju API types. + if mount_point_ is not None and not isinstance(mount_point_, (bytes, str)): + raise Exception("Expected mount_point_ to be a str, received: {}".format(type(mount_point_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + self.mount_point = mount_point_ + self.provider = provider_ + self.read_only = read_only_ + self.unknown_fields = unknown_fields + + + +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] + filesystem_id : str + info : str + mount_point : str + pool : str + read_only : bool + size : int + status : str + storagename : str + volume : KubernetesVolumeInfo + ''' + 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_ = KubernetesVolumeInfo.from_json(volume) if volume else None + + # Validate arguments against known Juju API types. + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + + if filesystem_id_ is not None and not isinstance(filesystem_id_, (bytes, str)): + raise Exception("Expected filesystem_id_ to be a str, received: {}".format(type(filesystem_id_))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if mount_point_ is not None and not isinstance(mount_point_, (bytes, str)): + raise Exception("Expected mount_point_ to be a str, received: {}".format(type(mount_point_))) + + if pool_ is not None and not isinstance(pool_, (bytes, str)): + raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if storagename_ is not None and not isinstance(storagename_, (bytes, str)): + raise Exception("Expected storagename_ to be a str, received: {}".format(type(storagename_))) + + if volume_ is not None and not isinstance(volume_, (dict, KubernetesVolumeInfo)): + raise Exception("Expected volume_ to be a KubernetesVolumeInfo, received: {}".format(type(volume_))) + + self.data = data_ + self.filesystem_id = filesystem_id_ + self.info = info_ + self.mount_point = mount_point_ + self.pool = pool_ + self.read_only = read_only_ + self.size = size_ + self.status = status_ + self.storagename = storagename_ + self.volume = volume_ + self.unknown_fields = unknown_fields + + + +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 + attributes : typing.Mapping[str, typing.Any] + provider : str + size : int + storagename : str + tags : typing.Mapping[str, str] + ''' + attachment_ = KubernetesFilesystemAttachmentParams.from_json(attachment) if attachment else None + attributes_ = attributes + provider_ = provider + size_ = size + storagename_ = storagename + tags_ = tags + + # Validate arguments against known Juju API types. + if attachment_ is not None and not isinstance(attachment_, (dict, KubernetesFilesystemAttachmentParams)): + raise Exception("Expected attachment_ to be a KubernetesFilesystemAttachmentParams, received: {}".format(type(attachment_))) + + if attributes_ is not None and not isinstance(attributes_, dict): + raise Exception("Expected attributes_ to be a Mapping, received: {}".format(type(attributes_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if storagename_ is not None and not isinstance(storagename_, (bytes, str)): + raise Exception("Expected storagename_ to be a str, received: {}".format(type(storagename_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + self.attachment = attachment_ + self.attributes = attributes_ + self.provider = provider_ + self.size = size_ + self.storagename = storagename_ + self.tags = tags_ + self.unknown_fields = unknown_fields + + + +class KubernetesProvisioningInfo(Type): + _toSchema = {'charm_modified_version': 'charm-modified-version', 'constraints': 'constraints', 'deployment_info': 'deployment-info', 'devices': 'devices', 'filesystems': 'filesystems', 'operator_image_path': 'operator-image-path', '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', 'operator-image-path': 'operator_image_path', '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, operator_image_path=None, pod_spec=None, raw_k8s_spec=None, tags=None, volumes=None, **unknown_fields): + ''' + charm_modified_version : int + constraints : Value + deployment_info : KubernetesDeploymentInfo + devices : typing.Sequence[~KubernetesDeviceParams] + filesystems : typing.Sequence[~KubernetesFilesystemParams] + operator_image_path : str + pod_spec : str + raw_k8s_spec : str + tags : typing.Mapping[str, str] + volumes : typing.Sequence[~KubernetesVolumeParams] + ''' + charm_modified_version_ = charm_modified_version + constraints_ = Value.from_json(constraints) if constraints else None + deployment_info_ = KubernetesDeploymentInfo.from_json(deployment_info) if deployment_info else None + devices_ = [KubernetesDeviceParams.from_json(o) for o in devices or []] + filesystems_ = [KubernetesFilesystemParams.from_json(o) for o in filesystems or []] + operator_image_path_ = operator_image_path + pod_spec_ = pod_spec + raw_k8s_spec_ = raw_k8s_spec + tags_ = tags + volumes_ = [KubernetesVolumeParams.from_json(o) for o in volumes or []] + + # Validate arguments against known Juju API types. + if charm_modified_version_ is not None and not isinstance(charm_modified_version_, int): + raise Exception("Expected charm_modified_version_ to be a int, received: {}".format(type(charm_modified_version_))) + + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if deployment_info_ is not None and not isinstance(deployment_info_, (dict, KubernetesDeploymentInfo)): + raise Exception("Expected deployment_info_ to be a KubernetesDeploymentInfo, received: {}".format(type(deployment_info_))) + + if devices_ is not None and not isinstance(devices_, (bytes, str, list)): + raise Exception("Expected devices_ to be a Sequence, received: {}".format(type(devices_))) + + if filesystems_ is not None and not isinstance(filesystems_, (bytes, str, list)): + raise Exception("Expected filesystems_ to be a Sequence, received: {}".format(type(filesystems_))) + + if operator_image_path_ is not None and not isinstance(operator_image_path_, (bytes, str)): + raise Exception("Expected operator_image_path_ to be a str, received: {}".format(type(operator_image_path_))) + + if pod_spec_ is not None and not isinstance(pod_spec_, (bytes, str)): + raise Exception("Expected pod_spec_ to be a str, received: {}".format(type(pod_spec_))) + + if raw_k8s_spec_ is not None and not isinstance(raw_k8s_spec_, (bytes, str)): + raise Exception("Expected raw_k8s_spec_ to be a str, received: {}".format(type(raw_k8s_spec_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.charm_modified_version = charm_modified_version_ + self.constraints = constraints_ + self.deployment_info = deployment_info_ + self.devices = devices_ + self.filesystems = filesystems_ + self.operator_image_path = operator_image_path_ + self.pod_spec = pod_spec_ + self.raw_k8s_spec = raw_k8s_spec_ + self.tags = tags_ + self.volumes = volumes_ + self.unknown_fields = unknown_fields + + + +class KubernetesProvisioningInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : KubernetesProvisioningInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = KubernetesProvisioningInfo.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, KubernetesProvisioningInfo)): + raise Exception("Expected result_ to be a KubernetesProvisioningInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class KubernetesProvisioningInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~KubernetesProvisioningInfoResult] + ''' + results_ = [KubernetesProvisioningInfoResult.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 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 + version : Number + ''' + agent_tag_ = agent_tag + version_ = Number.from_json(version) if version else None + + # Validate arguments against known Juju API types. + 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_))) + + self.agent_tag = agent_tag_ + self.version = version_ + self.unknown_fields = 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 + read_only : bool + ''' + provider_ = provider + read_only_ = read_only + + # Validate arguments against known Juju API types. + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + self.provider = provider_ + self.read_only = read_only_ + self.unknown_fields = 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] + info : str + persistent : bool + pool : str + size : int + status : str + volume_id : str + ''' + data_ = data + info_ = info + persistent_ = persistent + pool_ = pool + size_ = size + status_ = status + volume_id_ = volume_id + + # Validate arguments against known Juju API types. + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if persistent_ is not None and not isinstance(persistent_, bool): + raise Exception("Expected persistent_ to be a bool, received: {}".format(type(persistent_))) + + if pool_ is not None and not isinstance(pool_, (bytes, str)): + raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if volume_id_ is not None and not isinstance(volume_id_, (bytes, str)): + raise Exception("Expected volume_id_ to be a str, received: {}".format(type(volume_id_))) + + self.data = data_ + self.info = info_ + self.persistent = persistent_ + self.pool = pool_ + self.size = size_ + self.status = status_ + self.volume_id = volume_id_ + self.unknown_fields = unknown_fields + + + +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 + attributes : typing.Mapping[str, typing.Any] + provider : str + size : int + storagename : str + tags : typing.Mapping[str, str] + ''' + attachment_ = KubernetesVolumeAttachmentParams.from_json(attachment) if attachment else None + attributes_ = attributes + provider_ = provider + size_ = size + storagename_ = storagename + tags_ = tags + + # Validate arguments against known Juju API types. + if attachment_ is not None and not isinstance(attachment_, (dict, KubernetesVolumeAttachmentParams)): + raise Exception("Expected attachment_ to be a KubernetesVolumeAttachmentParams, received: {}".format(type(attachment_))) + + if attributes_ is not None and not isinstance(attributes_, dict): + raise Exception("Expected attributes_ to be a Mapping, received: {}".format(type(attributes_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if storagename_ is not None and not isinstance(storagename_, (bytes, str)): + raise Exception("Expected storagename_ to be a str, received: {}".format(type(storagename_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + self.attachment = attachment_ + self.attributes = attributes_ + self.provider = provider_ + self.size = size_ + self.storagename = storagename_ + self.tags = tags_ + self.unknown_fields = unknown_fields + + + +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] + description : str + devices : typing.Mapping[str, typing.Any] + ''' + config_ = config + description_ = description + devices_ = devices + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if devices_ is not None and not isinstance(devices_, dict): + raise Exception("Expected devices_ to be a Mapping, received: {}".format(type(devices_))) + + self.config = config_ + self.description = description_ + self.devices = devices_ + self.unknown_fields = unknown_fields + + + +class LXDProfileUpgradeMessages(Type): + _toSchema = {'application': 'application', 'watcher_id': 'watcher-id'} + _toPy = {'application': 'application', 'watcher-id': 'watcher_id'} + def __init__(self, application=None, watcher_id=None, **unknown_fields): + ''' + application : Entity + watcher_id : str + ''' + application_ = Entity.from_json(application) if application else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (dict, Entity)): + raise Exception("Expected application_ to be a Entity, received: {}".format(type(application_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.application = application_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class LXDProfileUpgradeMessagesResult(Type): + _toSchema = {'error': 'error', 'message': 'message', 'unit_name': 'unit-name'} + _toPy = {'error': 'error', 'message': 'message', 'unit-name': 'unit_name'} + def __init__(self, error=None, message=None, unit_name=None, **unknown_fields): + ''' + error : Error + message : str + unit_name : str + ''' + error_ = Error.from_json(error) if error else None + message_ = message + unit_name_ = unit_name + + # 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 message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if unit_name_ is not None and not isinstance(unit_name_, (bytes, str)): + raise Exception("Expected unit_name_ to be a str, received: {}".format(type(unit_name_))) + + self.error = error_ + self.message = message_ + self.unit_name = unit_name_ + self.unknown_fields = unknown_fields + + + +class LXDProfileUpgradeMessagesResults(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~LXDProfileUpgradeMessagesResult] + ''' + args_ = [LXDProfileUpgradeMessagesResult.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 LeaseOperation(Type): + _toSchema = {'command': 'command'} + _toPy = {'command': 'command'} + def __init__(self, command=None, **unknown_fields): + ''' + command : str + ''' + command_ = command + + # Validate arguments against known Juju API types. + if command_ is not None and not isinstance(command_, (bytes, str)): + raise Exception("Expected command_ to be a str, received: {}".format(type(command_))) + + self.command = command_ + self.unknown_fields = 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 + holder : str + lease : str + model_uuid : str + namespace : str + new_time : str + old_time : str + operation : str + pin_entity : str + version : int + ''' + 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 + + # Validate arguments against known Juju API types. + if duration_ is not None and not isinstance(duration_, int): + raise Exception("Expected duration_ to be a int, received: {}".format(type(duration_))) + + if holder_ is not None and not isinstance(holder_, (bytes, str)): + raise Exception("Expected holder_ to be a str, received: {}".format(type(holder_))) + + if lease_ is not None and not isinstance(lease_, (bytes, str)): + raise Exception("Expected lease_ to be a str, received: {}".format(type(lease_))) + + if model_uuid_ is not None and not isinstance(model_uuid_, (bytes, str)): + raise Exception("Expected model_uuid_ to be a str, received: {}".format(type(model_uuid_))) + + if namespace_ is not None and not isinstance(namespace_, (bytes, str)): + raise Exception("Expected namespace_ to be a str, received: {}".format(type(namespace_))) + + if new_time_ is not None and not isinstance(new_time_, (bytes, str)): + raise Exception("Expected new_time_ to be a str, received: {}".format(type(new_time_))) + + if old_time_ is not None and not isinstance(old_time_, (bytes, str)): + raise Exception("Expected old_time_ to be a str, received: {}".format(type(old_time_))) + + if operation_ is not None and not isinstance(operation_, (bytes, str)): + raise Exception("Expected operation_ to be a str, received: {}".format(type(operation_))) + + if pin_entity_ is not None and not isinstance(pin_entity_, (bytes, str)): + raise Exception("Expected pin_entity_ to be a str, received: {}".format(type(pin_entity_))) + + if version_ is not None and not isinstance(version_, int): + raise Exception("Expected version_ to be a int, received: {}".format(type(version_))) + + self.duration = duration_ + self.holder = holder_ + self.lease = lease_ + self.model_uuid = model_uuid_ + self.namespace = namespace_ + self.new_time = new_time_ + self.old_time = old_time_ + self.operation = operation_ + self.pin_entity = pin_entity_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class LeaseOperations(Type): + _toSchema = {'commands': 'commands'} + _toPy = {'commands': 'commands'} + def __init__(self, commands=None, **unknown_fields): + ''' + commands : typing.Sequence[~LeaseOperation] + ''' + commands_ = [LeaseOperation.from_json(o) for o in commands or []] + + # Validate arguments against known Juju API types. + if commands_ is not None and not isinstance(commands_, (bytes, str, list)): + raise Exception("Expected commands_ to be a Sequence, received: {}".format(type(commands_))) + + self.commands = commands_ + self.unknown_fields = unknown_fields + + + +class LeaseOperationsV2(Type): + _toSchema = {'commands': 'commands'} + _toPy = {'commands': 'commands'} + def __init__(self, commands=None, **unknown_fields): + ''' + commands : typing.Sequence[~LeaseOperationCommand] + ''' + commands_ = [LeaseOperationCommand.from_json(o) for o in commands or []] + + # Validate arguments against known Juju API types. + if commands_ is not None and not isinstance(commands_, (bytes, str, list)): + raise Exception("Expected commands_ to be a Sequence, received: {}".format(type(commands_))) + + self.commands = commands_ + self.unknown_fields = 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 + life : str + ''' + error_ = Error.from_json(error) if error else None + life_ = life + + # 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 life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + self.error = error_ + self.life = life_ + self.unknown_fields = unknown_fields + + + +class LifeResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~LifeResult] + ''' + results_ = [LifeResult.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 ListCloudImageMetadataResult(Type): + _toSchema = {'result': 'result'} + _toPy = {'result': 'result'} + def __init__(self, result=None, **unknown_fields): + ''' + result : typing.Sequence[~CloudImageMetadata] + ''' + result_ = [CloudImageMetadata.from_json(o) for o in result or []] + + # Validate arguments against known Juju API types. + if result_ is not None and not isinstance(result_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + + self.result = result_ + self.unknown_fields = 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 + user_access : str + ''' + clouddetails_ = CloudDetails.from_json(clouddetails) if clouddetails else None + user_access_ = user_access + + # Validate arguments against known Juju API types. + if clouddetails_ is not None and not isinstance(clouddetails_, (dict, CloudDetails)): + raise Exception("Expected clouddetails_ to be a CloudDetails, received: {}".format(type(clouddetails_))) + + if user_access_ is not None and not isinstance(user_access_, (bytes, str)): + raise Exception("Expected user_access_ to be a str, received: {}".format(type(user_access_))) + + self.clouddetails = clouddetails_ + self.user_access = user_access_ + self.unknown_fields = 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 + result : ListCloudInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = ListCloudInfo.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, ListCloudInfo)): + raise Exception("Expected result_ to be a ListCloudInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ListCloudInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ListCloudInfoResult] + ''' + results_ = [ListCloudInfoResult.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 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 + user_tag : str + ''' + all__ = all_ + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + 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_))) + + self.all_ = all__ + self.user_tag = user_tag_ + self.unknown_fields = unknown_fields + + + +class ListFirewallRulesResults(Type): + _toSchema = {'rules': 'Rules'} + _toPy = {'Rules': 'rules'} + def __init__(self, rules=None, **unknown_fields): + ''' + rules : typing.Sequence[~FirewallRule] + ''' + rules_ = [FirewallRule.from_json(o) for o in rules or []] + + # Validate arguments against known Juju API types. + if rules_ is not None and not isinstance(rules_, (bytes, str, list)): + raise Exception("Expected rules_ to be a Sequence, received: {}".format(type(rules_))) + + self.rules = rules_ + self.unknown_fields = unknown_fields + + + +class ListImageResult(Type): + _toSchema = {'result': 'result'} + _toPy = {'result': 'result'} + def __init__(self, result=None, **unknown_fields): + ''' + result : typing.Sequence[~ImageMetadata] + ''' + result_ = [ImageMetadata.from_json(o) for o in result or []] + + # Validate arguments against known Juju API types. + if result_ is not None and not isinstance(result_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ListResourcesArgs(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): + ''' + entities : typing.Sequence[~Entity] + ''' + entities_ = [Entity.from_json(o) for o in entities or []] + + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + + self.entities = entities_ + self.unknown_fields = 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 + mode : bool + ''' + entities_ = Entities.from_json(entities) if entities else None + mode_ = mode + + # Validate arguments against known Juju API types. + 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_))) + + self.entities = entities_ + self.mode = mode_ + self.unknown_fields = unknown_fields + + + +class ListSecretResult(Type): + _toSchema = {'create_time': 'create-time', 'description': 'description', 'int_': 'int', 'path': 'path', 'provider': 'provider', 'provider_id': 'provider-id', 'revision': 'revision', 'rotate_interval': 'rotate-interval', 'status': 'status', 'tags': 'tags', 'update_time': 'update-time', 'url': 'url', 'value': 'value', 'version': 'version'} + _toPy = {'create-time': 'create_time', 'description': 'description', 'int': 'int_', 'path': 'path', 'provider': 'provider', 'provider-id': 'provider_id', 'revision': 'revision', 'rotate-interval': 'rotate_interval', 'status': 'status', 'tags': 'tags', 'update-time': 'update_time', 'url': 'url', 'value': 'value', 'version': 'version'} + def __init__(self, create_time=None, description=None, int_=None, path=None, provider=None, provider_id=None, revision=None, rotate_interval=None, status=None, tags=None, update_time=None, url=None, value=None, version=None, **unknown_fields): + ''' + create_time : str + description : str + int_ : int + path : str + provider : str + provider_id : str + revision : int + rotate_interval : int + status : str + tags : typing.Mapping[str, str] + update_time : str + url : str + value : SecretValueResult + version : int + ''' + create_time_ = create_time + description_ = description + int__ = int_ + path_ = path + provider_ = provider + provider_id_ = provider_id + revision_ = revision + rotate_interval_ = rotate_interval + status_ = status + tags_ = tags + update_time_ = update_time + url_ = url + value_ = SecretValueResult.from_json(value) if value else None + version_ = version + + # Validate arguments against known Juju API types. + 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_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if int__ is not None and not isinstance(int__, int): + raise Exception("Expected int__ to be a int, received: {}".format(type(int__))) + + if path_ is not None and not isinstance(path_, (bytes, str)): + raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if rotate_interval_ is not None and not isinstance(rotate_interval_, int): + raise Exception("Expected rotate_interval_ to be a int, received: {}".format(type(rotate_interval_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if update_time_ is not None and not isinstance(update_time_, (bytes, str)): + raise Exception("Expected update_time_ to be a str, received: {}".format(type(update_time_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + if value_ is not None and not isinstance(value_, (dict, SecretValueResult)): + raise Exception("Expected value_ to be a SecretValueResult, received: {}".format(type(value_))) + + if version_ is not None and not isinstance(version_, int): + raise Exception("Expected version_ to be a int, received: {}".format(type(version_))) + + self.create_time = create_time_ + self.description = description_ + self.int_ = int__ + self.path = path_ + self.provider = provider_ + self.provider_id = provider_id_ + self.revision = revision_ + self.rotate_interval = rotate_interval_ + self.status = status_ + self.tags = tags_ + self.update_time = update_time_ + self.url = url_ + self.value = value_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class ListSecretResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ListSecretResult] + ''' + results_ = [ListSecretResult.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 ListSecretsArgs(Type): + _toSchema = {'show_secrets': 'show-secrets'} + _toPy = {'show-secrets': 'show_secrets'} + def __init__(self, show_secrets=None, **unknown_fields): + ''' + show_secrets : bool + ''' + show_secrets_ = show_secrets + + # Validate arguments against known Juju API types. + 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_))) + + self.show_secrets = show_secrets_ + self.unknown_fields = unknown_fields + + + +class ListSpacesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~Space] + ''' + results_ = [Space.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 ListSubnetsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~Subnet] + ''' + results_ = [Subnet.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 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] + ''' + resource_names_ = resource_names + + # Validate arguments against known Juju API types. + 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_))) + + self.resource_names = resource_names_ + self.unknown_fields = unknown_fields + + + +class LogForwardingGetLastSentParams(Type): + _toSchema = {'ids': 'ids'} + _toPy = {'ids': 'ids'} + def __init__(self, ids=None, **unknown_fields): + ''' + ids : typing.Sequence[~LogForwardingID] + ''' + ids_ = [LogForwardingID.from_json(o) for o in ids or []] + + # Validate arguments against known Juju API types. + if ids_ is not None and not isinstance(ids_, (bytes, str, list)): + raise Exception("Expected ids_ to be a Sequence, received: {}".format(type(ids_))) + + self.ids = ids_ + self.unknown_fields = 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 + record_id : int + record_timestamp : int + ''' + err_ = Error.from_json(err) if err else None + record_id_ = record_id + record_timestamp_ = record_timestamp + + # Validate arguments against known Juju API types. + if err_ is not None and not isinstance(err_, (dict, Error)): + raise Exception("Expected err_ to be a Error, received: {}".format(type(err_))) + + if record_id_ is not None and not isinstance(record_id_, int): + raise Exception("Expected record_id_ to be a int, received: {}".format(type(record_id_))) + + if record_timestamp_ is not None and not isinstance(record_timestamp_, int): + raise Exception("Expected record_timestamp_ to be a int, received: {}".format(type(record_timestamp_))) + + self.err = err_ + self.record_id = record_id_ + self.record_timestamp = record_timestamp_ + self.unknown_fields = unknown_fields + + + +class LogForwardingGetLastSentResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~LogForwardingGetLastSentResult] + ''' + results_ = [LogForwardingGetLastSentResult.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 LogForwardingID(Type): + _toSchema = {'model': 'model', 'sink': 'sink'} + _toPy = {'model': 'model', 'sink': 'sink'} + def __init__(self, model=None, sink=None, **unknown_fields): + ''' + model : str + sink : str + ''' + model_ = model + sink_ = sink + + # Validate arguments against known Juju API types. + if model_ is not None and not isinstance(model_, (bytes, str)): + raise Exception("Expected model_ to be a str, received: {}".format(type(model_))) + + if sink_ is not None and not isinstance(sink_, (bytes, str)): + raise Exception("Expected sink_ to be a str, received: {}".format(type(sink_))) + + self.model = model_ + self.sink = sink_ + self.unknown_fields = 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 + model : str + record_id : int + record_timestamp : int + sink : str + ''' + logforwardingid_ = LogForwardingID.from_json(logforwardingid) if logforwardingid else None + model_ = model + record_id_ = record_id + record_timestamp_ = record_timestamp + sink_ = sink + + # Validate arguments against known Juju API types. + if logforwardingid_ is not None and not isinstance(logforwardingid_, (dict, LogForwardingID)): + raise Exception("Expected logforwardingid_ to be a LogForwardingID, received: {}".format(type(logforwardingid_))) + + if model_ is not None and not isinstance(model_, (bytes, str)): + raise Exception("Expected model_ to be a str, received: {}".format(type(model_))) + + if record_id_ is not None and not isinstance(record_id_, int): + raise Exception("Expected record_id_ to be a int, received: {}".format(type(record_id_))) + + if record_timestamp_ is not None and not isinstance(record_timestamp_, int): + raise Exception("Expected record_timestamp_ to be a int, received: {}".format(type(record_timestamp_))) + + if sink_ is not None and not isinstance(sink_, (bytes, str)): + raise Exception("Expected sink_ to be a str, received: {}".format(type(sink_))) + + self.logforwardingid = logforwardingid_ + self.model = model_ + self.record_id = record_id_ + self.record_timestamp = record_timestamp_ + self.sink = sink_ + self.unknown_fields = unknown_fields + + + +class LogForwardingSetLastSentParams(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~LogForwardingSetLastSentParam] + ''' + params_ = [LogForwardingSetLastSentParam.from_json(o) for o in params or []] + + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + + self.params = params_ + self.unknown_fields = 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', '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', '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, user_data=None, **unknown_fields): + ''' + auth_tag : str + bakery_version : int + cli_args : str + client_version : str + credentials : str + macaroons : typing.Sequence[~Macaroon] + nonce : str + user_data : str + ''' + auth_tag_ = auth_tag + bakery_version_ = bakery_version + cli_args_ = cli_args + client_version_ = client_version + credentials_ = credentials + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + nonce_ = nonce + user_data_ = user_data + + # Validate arguments against known Juju API types. + 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 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_))) + + self.auth_tag = auth_tag_ + self.bakery_version = bakery_version_ + self.cli_args = cli_args_ + self.client_version = client_version_ + self.credentials = credentials_ + self.macaroons = macaroons_ + self.nonce = nonce_ + self.user_data = user_data_ + self.unknown_fields = unknown_fields + + + +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 + controller_tag : str + discharge_required : Macaroon + discharge_required_error : str + facades : typing.Sequence[~FacadeVersions] + model_tag : str + public_dns_name : str + server_version : str + servers : typing.Sequence[~HostPort] + user_info : AuthUserInfo + ''' + bakery_discharge_required_ = Macaroon.from_json(bakery_discharge_required) if bakery_discharge_required else None + controller_tag_ = controller_tag + discharge_required_ = Macaroon.from_json(discharge_required) if discharge_required else None + discharge_required_error_ = discharge_required_error + facades_ = [FacadeVersions.from_json(o) for o in facades or []] + model_tag_ = model_tag + public_dns_name_ = public_dns_name + server_version_ = server_version + servers_ = [HostPort.from_json(o) for o in servers or []] + user_info_ = AuthUserInfo.from_json(user_info) if user_info else None + + # Validate arguments against known Juju API types. + if bakery_discharge_required_ is not None and not isinstance(bakery_discharge_required_, (dict, Macaroon)): + raise Exception("Expected bakery_discharge_required_ to be a Macaroon, received: {}".format(type(bakery_discharge_required_))) + + 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 discharge_required_ is not None and not isinstance(discharge_required_, (dict, Macaroon)): + raise Exception("Expected discharge_required_ to be a Macaroon, received: {}".format(type(discharge_required_))) + + if discharge_required_error_ is not None and not isinstance(discharge_required_error_, (bytes, str)): + raise Exception("Expected discharge_required_error_ to be a str, received: {}".format(type(discharge_required_error_))) + + if facades_ is not None and not isinstance(facades_, (bytes, str, list)): + raise Exception("Expected facades_ to be a Sequence, received: {}".format(type(facades_))) + + 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 public_dns_name_ is not None and not isinstance(public_dns_name_, (bytes, str)): + raise Exception("Expected public_dns_name_ to be a str, received: {}".format(type(public_dns_name_))) + + if server_version_ is not None and not isinstance(server_version_, (bytes, str)): + raise Exception("Expected server_version_ to be a str, received: {}".format(type(server_version_))) + + if servers_ is not None and not isinstance(servers_, (bytes, str, list)): + raise Exception("Expected servers_ to be a Sequence, received: {}".format(type(servers_))) + + if user_info_ is not None and not isinstance(user_info_, (dict, AuthUserInfo)): + raise Exception("Expected user_info_ to be a AuthUserInfo, received: {}".format(type(user_info_))) + + self.bakery_discharge_required = bakery_discharge_required_ + self.controller_tag = controller_tag_ + self.discharge_required = discharge_required_ + self.discharge_required_error = discharge_required_error_ + self.facades = facades_ + self.model_tag = model_tag_ + self.public_dns_name = public_dns_name_ + self.server_version = server_version_ + self.servers = servers_ + self.user_info = user_info_ + self.unknown_fields = unknown_fields + + + +class LookUpArg(Type): + _toSchema = {'id_': 'id', 'name': 'name'} + _toPy = {'id': 'id_', 'name': 'name'} + def __init__(self, id_=None, name=None, **unknown_fields): + ''' + id_ : str + name : str + ''' + id__ = id_ + name_ = name + + # Validate arguments against known Juju API types. + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + self.id_ = id__ + self.name = name_ + self.unknown_fields = unknown_fields + + + +class LookUpArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~LookUpArg] + ''' + args_ = [LookUpArg.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 LookUpPayloadArg(Type): + _toSchema = {'id_': 'id', 'name': 'name'} + _toPy = {'id': 'id_', 'name': 'name'} + def __init__(self, id_=None, name=None, **unknown_fields): + ''' + id_ : str + name : str + ''' + id__ = id_ + name_ = name + + # Validate arguments against known Juju API types. + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + self.id_ = id__ + self.name = name_ + self.unknown_fields = unknown_fields + + + +class LookUpPayloadArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~LookUpPayloadArg] + ''' + args_ = [LookUpPayloadArg.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 Macaroon(Type): + _toSchema = {} + _toPy = {} + def __init__(self, **unknown_fields): + ''' + + ''' + self.unknown_fields = 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 + result : Macaroon + ''' + error_ = Error.from_json(error) if error else None + result_ = Macaroon.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, Macaroon)): + raise Exception("Expected result_ to be a Macaroon, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class MacaroonResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MacaroonResult] + ''' + results_ = [MacaroonResult.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 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] + tag : str + ''' + addresses_ = [Address.from_json(o) for o in addresses or []] + tag_ = tag + + # Validate arguments against known Juju API types. + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.addresses = addresses_ + self.tag = tag_ + self.unknown_fields = 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] + error : Error + ''' + addresses_ = [Address.from_json(o) for o in addresses or []] + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.addresses = addresses_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class MachineAddressesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MachineAddressesResult] + ''' + results_ = [MachineAddressesResult.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 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] + machine : str + ''' + block_devices_ = [BlockDevice.from_json(o) for o in block_devices or []] + machine_ = machine + + # Validate arguments against known Juju API types. + if block_devices_ is not None and not isinstance(block_devices_, (bytes, str, list)): + raise Exception("Expected block_devices_ to be a Sequence, received: {}".format(type(block_devices_))) + + if machine_ is not None and not isinstance(machine_, (bytes, str)): + raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) + + self.block_devices = block_devices_ + self.machine = machine_ + self.unknown_fields = 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] + determined : bool + error : Error + ''' + container_types_ = container_types + determined_ = determined + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if container_types_ is not None and not isinstance(container_types_, (bytes, str, list)): + raise Exception("Expected container_types_ to be a Sequence, received: {}".format(type(container_types_))) + + if determined_ is not None and not isinstance(determined_, bool): + raise Exception("Expected determined_ to be a bool, received: {}".format(type(determined_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.container_types = container_types_ + self.determined = determined_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class MachineContainerResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MachineContainerResult] + ''' + results_ = [MachineContainerResult.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 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] + machine_tag : str + ''' + container_types_ = container_types + machine_tag_ = machine_tag + + # Validate arguments against known Juju API types. + if container_types_ is not None and not isinstance(container_types_, (bytes, str, list)): + raise Exception("Expected container_types_ to be a Sequence, received: {}".format(type(container_types_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + self.container_types = container_types_ + self.machine_tag = machine_tag_ + self.unknown_fields = unknown_fields + + + +class MachineContainersParams(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~MachineContainers] + ''' + params_ = [MachineContainers.from_json(o) for o in params or []] + + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + + self.params = params_ + self.unknown_fields = 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'} + _toPy = {'arch': 'arch', 'availability-zone': 'availability_zone', 'cores': 'cores', 'cpu-power': 'cpu_power', 'mem': 'mem', 'root-disk': 'root_disk', 'tags': 'tags'} + def __init__(self, arch=None, availability_zone=None, cores=None, cpu_power=None, mem=None, root_disk=None, tags=None, **unknown_fields): + ''' + arch : str + availability_zone : str + cores : int + cpu_power : int + mem : int + root_disk : int + tags : typing.Sequence[str] + ''' + arch_ = arch + availability_zone_ = availability_zone + cores_ = cores + cpu_power_ = cpu_power + mem_ = mem + root_disk_ = root_disk + tags_ = tags + + # Validate arguments against known Juju API types. + if arch_ is not None and not isinstance(arch_, (bytes, str)): + raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) + + if availability_zone_ is not None and not isinstance(availability_zone_, (bytes, str)): + raise Exception("Expected availability_zone_ to be a str, received: {}".format(type(availability_zone_))) + + if cores_ is not None and not isinstance(cores_, int): + raise Exception("Expected cores_ to be a int, received: {}".format(type(cores_))) + + if cpu_power_ is not None and not isinstance(cpu_power_, int): + raise Exception("Expected cpu_power_ to be a int, received: {}".format(type(cpu_power_))) + + if mem_ is not None and not isinstance(mem_, int): + raise Exception("Expected mem_ to be a int, received: {}".format(type(mem_))) + + if root_disk_ is not None and not isinstance(root_disk_, int): + raise Exception("Expected root_disk_ to be a int, received: {}".format(type(root_disk_))) + + if tags_ is not None and not isinstance(tags_, (bytes, str, list)): + raise Exception("Expected tags_ to be a Sequence, received: {}".format(type(tags_))) + + self.arch = arch_ + self.availability_zone = availability_zone_ + self.cores = cores_ + self.cpu_power = cpu_power_ + self.mem = mem_ + self.root_disk = root_disk_ + self.tags = tags_ + self.unknown_fields = unknown_fields + + + +class MachineNetworkConfigResult(Type): + _toSchema = {'error': 'error', 'info': 'info'} + _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): + ''' + error : Error + info : typing.Sequence[~NetworkConfig] + ''' + error_ = Error.from_json(error) if error else None + info_ = [NetworkConfig.from_json(o) for o in info or []] + + # 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 info_ is not None and not isinstance(info_, (bytes, str, list)): + raise Exception("Expected info_ to be a Sequence, received: {}".format(type(info_))) + + self.error = error_ + self.info = info_ + self.unknown_fields = unknown_fields + + + +class MachineNetworkConfigResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MachineNetworkConfigResult] + ''' + results_ = [MachineNetworkConfigResult.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 MachinePortRange(Type): + _toSchema = {'port_range': 'port-range', 'relation_tag': 'relation-tag', 'unit_tag': 'unit-tag'} + _toPy = {'port-range': 'port_range', 'relation-tag': 'relation_tag', 'unit-tag': 'unit_tag'} + def __init__(self, port_range=None, relation_tag=None, unit_tag=None, **unknown_fields): + ''' + port_range : PortRange + relation_tag : str + unit_tag : str + ''' + port_range_ = PortRange.from_json(port_range) if port_range else None + relation_tag_ = relation_tag + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if port_range_ is not None and not isinstance(port_range_, (dict, PortRange)): + raise Exception("Expected port_range_ to be a PortRange, received: {}".format(type(port_range_))) + + if relation_tag_ is not None and not isinstance(relation_tag_, (bytes, str)): + raise Exception("Expected relation_tag_ to be a str, received: {}".format(type(relation_tag_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.port_range = port_range_ + self.relation_tag = relation_tag_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +class MachinePorts(Type): + _toSchema = {'machine_tag': 'machine-tag', 'subnet_tag': 'subnet-tag'} + _toPy = {'machine-tag': 'machine_tag', 'subnet-tag': 'subnet_tag'} + def __init__(self, machine_tag=None, subnet_tag=None, **unknown_fields): + ''' + machine_tag : str + subnet_tag : str + ''' + machine_tag_ = machine_tag + subnet_tag_ = subnet_tag + + # Validate arguments against known Juju API types. + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + if subnet_tag_ is not None and not isinstance(subnet_tag_, (bytes, str)): + raise Exception("Expected subnet_tag_ to be a str, received: {}".format(type(subnet_tag_))) + + self.machine_tag = machine_tag_ + self.subnet_tag = subnet_tag_ + self.unknown_fields = unknown_fields + + + +class MachinePortsParams(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~MachinePorts] + ''' + params_ = [MachinePorts.from_json(o) for o in params or []] + + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + + self.params = params_ + self.unknown_fields = unknown_fields + + + +class MachinePortsResult(Type): + _toSchema = {'error': 'error', 'ports': 'ports'} + _toPy = {'error': 'error', 'ports': 'ports'} + def __init__(self, error=None, ports=None, **unknown_fields): + ''' + error : Error + ports : typing.Sequence[~MachinePortRange] + ''' + error_ = Error.from_json(error) if error else None + ports_ = [MachinePortRange.from_json(o) for o in ports or []] + + # 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 ports_ is not None and not isinstance(ports_, (bytes, str, list)): + raise Exception("Expected ports_ to be a Sequence, received: {}".format(type(ports_))) + + self.error = error_ + self.ports = ports_ + self.unknown_fields = unknown_fields + + + +class MachinePortsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MachinePortsResult] + ''' + results_ = [MachinePortsResult.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 MachineStatus(Type): + _toSchema = {'agent_status': 'agent-status', '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', 'series': 'series', 'wants_vote': 'wants-vote'} + _toPy = {'agent-status': 'agent_status', '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', 'series': 'series', 'wants-vote': 'wants_vote'} + def __init__(self, agent_status=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, series=None, wants_vote=None, **unknown_fields): + ''' + agent_status : DetailedStatus + constraints : str + containers : typing.Mapping[str, ~MachineStatus] + display_name : str + dns_name : str + hardware : str + has_vote : bool + hostname : str + id_ : str + instance_id : str + instance_status : DetailedStatus + ip_addresses : typing.Sequence[str] + jobs : typing.Sequence[str] + lxd_profiles : typing.Mapping[str, ~LXDProfile] + modification_status : DetailedStatus + network_interfaces : typing.Mapping[str, ~NetworkInterface] + primary_controller_machine : bool + series : str + wants_vote : bool + ''' + agent_status_ = DetailedStatus.from_json(agent_status) if agent_status else None + constraints_ = constraints + containers_ = {k: MachineStatus.from_json(v) for k, v in (containers or dict()).items()} + display_name_ = display_name + dns_name_ = dns_name + hardware_ = hardware + has_vote_ = has_vote + hostname_ = hostname + id__ = id_ + instance_id_ = instance_id + instance_status_ = DetailedStatus.from_json(instance_status) if instance_status else None + ip_addresses_ = ip_addresses + jobs_ = jobs + lxd_profiles_ = {k: LXDProfile.from_json(v) for k, v in (lxd_profiles or dict()).items()} + modification_status_ = DetailedStatus.from_json(modification_status) if modification_status else None + network_interfaces_ = {k: NetworkInterface.from_json(v) for k, v in (network_interfaces or dict()).items()} + primary_controller_machine_ = primary_controller_machine + series_ = series + wants_vote_ = wants_vote + + # Validate arguments against known Juju API types. + if agent_status_ is not None and not isinstance(agent_status_, (dict, DetailedStatus)): + raise Exception("Expected agent_status_ to be a DetailedStatus, received: {}".format(type(agent_status_))) + + if constraints_ is not None and not isinstance(constraints_, (bytes, str)): + raise Exception("Expected constraints_ to be a str, received: {}".format(type(constraints_))) + + if containers_ is not None and not isinstance(containers_, dict): + raise Exception("Expected containers_ to be a Mapping, received: {}".format(type(containers_))) + + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if dns_name_ is not None and not isinstance(dns_name_, (bytes, str)): + raise Exception("Expected dns_name_ to be a str, received: {}".format(type(dns_name_))) + + if hardware_ is not None and not isinstance(hardware_, (bytes, str)): + raise Exception("Expected hardware_ to be a str, received: {}".format(type(hardware_))) + + if has_vote_ is not None and not isinstance(has_vote_, bool): + raise Exception("Expected has_vote_ to be a bool, received: {}".format(type(has_vote_))) + + if hostname_ is not None and not isinstance(hostname_, (bytes, str)): + raise Exception("Expected hostname_ to be a str, received: {}".format(type(hostname_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): + raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) + + if instance_status_ is not None and not isinstance(instance_status_, (dict, DetailedStatus)): + raise Exception("Expected instance_status_ to be a DetailedStatus, received: {}".format(type(instance_status_))) + + if ip_addresses_ is not None and not isinstance(ip_addresses_, (bytes, str, list)): + raise Exception("Expected ip_addresses_ to be a Sequence, received: {}".format(type(ip_addresses_))) + + if jobs_ is not None and not isinstance(jobs_, (bytes, str, list)): + raise Exception("Expected jobs_ to be a Sequence, received: {}".format(type(jobs_))) + + if lxd_profiles_ is not None and not isinstance(lxd_profiles_, dict): + raise Exception("Expected lxd_profiles_ to be a Mapping, received: {}".format(type(lxd_profiles_))) + + if modification_status_ is not None and not isinstance(modification_status_, (dict, DetailedStatus)): + raise Exception("Expected modification_status_ to be a DetailedStatus, received: {}".format(type(modification_status_))) + + if network_interfaces_ is not None and not isinstance(network_interfaces_, dict): + raise Exception("Expected network_interfaces_ to be a Mapping, received: {}".format(type(network_interfaces_))) + + if primary_controller_machine_ is not None and not isinstance(primary_controller_machine_, bool): + raise Exception("Expected primary_controller_machine_ to be a bool, received: {}".format(type(primary_controller_machine_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if wants_vote_ is not None and not isinstance(wants_vote_, bool): + raise Exception("Expected wants_vote_ to be a bool, received: {}".format(type(wants_vote_))) + + self.agent_status = agent_status_ + self.constraints = constraints_ + self.containers = containers_ + self.display_name = display_name_ + self.dns_name = dns_name_ + self.hardware = hardware_ + self.has_vote = has_vote_ + self.hostname = hostname_ + self.id_ = id__ + self.instance_id = instance_id_ + self.instance_status = instance_status_ + self.ip_addresses = ip_addresses_ + self.jobs = jobs_ + self.lxd_profiles = lxd_profiles_ + self.modification_status = modification_status_ + self.network_interfaces = network_interfaces_ + self.primary_controller_machine = primary_controller_machine_ + self.series = series_ + self.wants_vote = wants_vote_ + self.unknown_fields = unknown_fields + + + +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 + machine_tag : str + ''' + attachment_tag_ = attachment_tag + machine_tag_ = machine_tag + + # Validate arguments against known Juju API types. + if attachment_tag_ is not None and not isinstance(attachment_tag_, (bytes, str)): + raise Exception("Expected attachment_tag_ to be a str, received: {}".format(type(attachment_tag_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + self.attachment_tag = attachment_tag_ + self.machine_tag = machine_tag_ + self.unknown_fields = unknown_fields + + + +class MachineStorageIds(Type): + _toSchema = {'ids': 'ids'} + _toPy = {'ids': 'ids'} + def __init__(self, ids=None, **unknown_fields): + ''' + ids : typing.Sequence[~MachineStorageId] + ''' + ids_ = [MachineStorageId.from_json(o) for o in ids or []] + + # Validate arguments against known Juju API types. + if ids_ is not None and not isinstance(ids_, (bytes, str, list)): + raise Exception("Expected ids_ to be a Sequence, received: {}".format(type(ids_))) + + self.ids = ids_ + self.unknown_fields = 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] + error : Error + watcher_id : str + ''' + changes_ = [MachineStorageId.from_json(o) for o in changes or []] + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class MachineStorageIdsWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MachineStorageIdsWatchResult] + ''' + results_ = [MachineStorageIdsWatchResult.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 MapResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : typing.Mapping[str, typing.Any] + ''' + error_ = Error.from_json(error) if error else None + result_ = result + + # 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): + raise Exception("Expected result_ to be a Mapping, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class MapResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MapResult] + ''' + results_ = [MapResult.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 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 + phase : str + phase_changed_time : str + spec : MigrationSpec + ''' + migration_id_ = migration_id + phase_ = phase + phase_changed_time_ = phase_changed_time + spec_ = MigrationSpec.from_json(spec) if spec else None + + # Validate arguments against known Juju API types. + 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 phase_changed_time_ is not None and not isinstance(phase_changed_time_, (bytes, str)): + raise Exception("Expected phase_changed_time_ to be a str, received: {}".format(type(phase_changed_time_))) + + if spec_ is not None and not isinstance(spec_, (dict, MigrationSpec)): + raise Exception("Expected spec_ to be a MigrationSpec, received: {}".format(type(spec_))) + + self.migration_id = migration_id_ + self.phase = phase_ + self.phase_changed_time = phase_changed_time_ + self.spec = spec_ + self.unknown_fields = unknown_fields + + + +class Member(Type): + _toSchema = {'address': 'Address', 'arbiter': 'Arbiter', 'buildindexes': 'BuildIndexes', 'hidden': 'Hidden', 'id_': 'Id', 'priority': 'Priority', 'slavedelay': 'SlaveDelay', 'tags': 'Tags', 'votes': 'Votes'} + _toPy = {'Address': 'address', 'Arbiter': 'arbiter', 'BuildIndexes': 'buildindexes', 'Hidden': 'hidden', 'Id': 'id_', 'Priority': 'priority', 'SlaveDelay': 'slavedelay', 'Tags': 'tags', 'Votes': 'votes'} + def __init__(self, address=None, arbiter=None, buildindexes=None, hidden=None, id_=None, priority=None, slavedelay=None, tags=None, votes=None, **unknown_fields): + ''' + address : str + arbiter : bool + buildindexes : bool + hidden : bool + id_ : int + priority : float + slavedelay : int + tags : typing.Mapping[str, str] + votes : int + ''' + address_ = address + arbiter_ = arbiter + buildindexes_ = buildindexes + hidden_ = hidden + id__ = id_ + priority_ = priority + slavedelay_ = slavedelay + tags_ = tags + votes_ = votes + + # Validate arguments against known Juju API types. + if address_ is not None and not isinstance(address_, (bytes, str)): + raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) + + if arbiter_ is not None and not isinstance(arbiter_, bool): + raise Exception("Expected arbiter_ to be a bool, received: {}".format(type(arbiter_))) + + if buildindexes_ is not None and not isinstance(buildindexes_, bool): + raise Exception("Expected buildindexes_ to be a bool, received: {}".format(type(buildindexes_))) + + if hidden_ is not None and not isinstance(hidden_, bool): + raise Exception("Expected hidden_ to be a bool, received: {}".format(type(hidden_))) + + if id__ is not None and not isinstance(id__, int): + raise Exception("Expected id__ to be a int, received: {}".format(type(id__))) + + if priority_ is not None and not isinstance(priority_, float): + raise Exception("Expected priority_ to be a float, received: {}".format(type(priority_))) + + if slavedelay_ is not None and not isinstance(slavedelay_, int): + raise Exception("Expected slavedelay_ to be a int, received: {}".format(type(slavedelay_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if votes_ is not None and not isinstance(votes_, int): + raise Exception("Expected votes_ to be a int, received: {}".format(type(votes_))) + + self.address = address_ + self.arbiter = arbiter_ + self.buildindexes = buildindexes_ + self.hidden = hidden_ + self.id_ = id__ + self.priority = priority_ + self.slavedelay = slavedelay_ + self.tags = tags_ + self.votes = votes_ + self.unknown_fields = unknown_fields + + + +class MergeLeadershipSettingsBulkParams(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~MergeLeadershipSettingsParam] + ''' + params_ = [MergeLeadershipSettingsParam.from_json(o) for o in params or []] + + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + + self.params = params_ + self.unknown_fields = 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 + settings : typing.Mapping[str, str] + unit_tag : str + ''' + application_tag_ = application_tag + settings_ = settings + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) + + if settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.application_tag = application_tag_ + self.settings = settings_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +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] + ''' + image_ids_ = image_ids + + # Validate arguments against known Juju API types. + 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_))) + + self.image_ids = image_ids_ + self.unknown_fields = unknown_fields + + + +class MetadataSaveParams(Type): + _toSchema = {'metadata': 'metadata'} + _toPy = {'metadata': 'metadata'} + def __init__(self, metadata=None, **unknown_fields): + ''' + metadata : typing.Sequence[~CloudImageMetadataList] + ''' + metadata_ = [CloudImageMetadataList.from_json(o) for o in metadata or []] + + # Validate arguments against known Juju API types. + if metadata_ is not None and not isinstance(metadata_, (bytes, str, list)): + raise Exception("Expected metadata_ to be a Sequence, received: {}".format(type(metadata_))) + + self.metadata = metadata_ + self.unknown_fields = 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 + message : str + ''' + color_ = color + message_ = message + + # Validate arguments against known Juju API types. + if color_ is not None and not isinstance(color_, (bytes, str)): + raise Exception("Expected color_ to be a str, received: {}".format(type(color_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + self.color = color_ + self.message = message_ + self.unknown_fields = 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 + info : str + tag : str + ''' + code_ = code + info_ = info + tag_ = tag + + # Validate arguments against known Juju API types. + if code_ is not None and not isinstance(code_, (bytes, str)): + raise Exception("Expected code_ to be a str, received: {}".format(type(code_))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.code = code_ + self.info = info_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class MeterStatusParams(Type): + _toSchema = {'statues': 'statues'} + _toPy = {'statues': 'statues'} + def __init__(self, statues=None, **unknown_fields): + ''' + statues : typing.Sequence[~MeterStatusParam] + ''' + statues_ = [MeterStatusParam.from_json(o) for o in statues or []] + + # Validate arguments against known Juju API types. + if statues_ is not None and not isinstance(statues_, (bytes, str, list)): + raise Exception("Expected statues_ to be a Sequence, received: {}".format(type(statues_))) + + self.statues = statues_ + self.unknown_fields = 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 + error : Error + info : str + ''' + code_ = code + error_ = Error.from_json(error) if error else None + info_ = info + + # Validate arguments against known Juju API types. + if code_ is not None and not isinstance(code_, (bytes, str)): + raise Exception("Expected code_ to be a str, received: {}".format(type(code_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + self.code = code_ + self.error = error_ + self.info = info_ + self.unknown_fields = unknown_fields + + + +class MeterStatusResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MeterStatusResult] + ''' + results_ = [MeterStatusResult.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 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 + labels : typing.Mapping[str, str] + time : str + value : str + ''' + key_ = key + labels_ = labels + time_ = time + value_ = value + + # Validate arguments against known Juju API types. + if key_ is not None and not isinstance(key_, (bytes, str)): + raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) + + if labels_ is not None and not isinstance(labels_, dict): + raise Exception("Expected labels_ to be a Mapping, received: {}".format(type(labels_))) + + if time_ is not None and not isinstance(time_, (bytes, str)): + raise Exception("Expected time_ to be a str, received: {}".format(type(time_))) + + if value_ is not None and not isinstance(value_, (bytes, str)): + raise Exception("Expected value_ to be a str, received: {}".format(type(value_))) + + self.key = key_ + self.labels = labels_ + self.time = time_ + self.value = value_ + self.unknown_fields = unknown_fields + + + +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 + created : str + metrics : typing.Sequence[~Metric] + uuid : str + ''' + charm_url_ = charm_url + created_ = created + metrics_ = [Metric.from_json(o) for o in metrics or []] + uuid_ = uuid + + # Validate arguments against known Juju API types. + 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 created_ is not None and not isinstance(created_, (bytes, str)): + raise Exception("Expected created_ to be a str, received: {}".format(type(created_))) + + if metrics_ is not None and not isinstance(metrics_, (bytes, str, list)): + raise Exception("Expected metrics_ to be a Sequence, received: {}".format(type(metrics_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.charm_url = charm_url_ + self.created = created_ + self.metrics = metrics_ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +class MetricBatchParam(Type): + _toSchema = {'batch': 'batch', 'tag': 'tag'} + _toPy = {'batch': 'batch', 'tag': 'tag'} + def __init__(self, batch=None, tag=None, **unknown_fields): + ''' + batch : MetricBatch + tag : str + ''' + batch_ = MetricBatch.from_json(batch) if batch else None + tag_ = tag + + # Validate arguments against known Juju API types. + if batch_ is not None and not isinstance(batch_, (dict, MetricBatch)): + raise Exception("Expected batch_ to be a MetricBatch, received: {}".format(type(batch_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.batch = batch_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class MetricBatchParams(Type): + _toSchema = {'batches': 'batches'} + _toPy = {'batches': 'batches'} + def __init__(self, batches=None, **unknown_fields): + ''' + batches : typing.Sequence[~MetricBatchParam] + ''' + batches_ = [MetricBatchParam.from_json(o) for o in batches or []] + + # Validate arguments against known Juju API types. + if batches_ is not None and not isinstance(batches_, (bytes, str, list)): + raise Exception("Expected batches_ to be a Sequence, received: {}".format(type(batches_))) + + self.batches = batches_ + self.unknown_fields = 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 + labels : typing.Mapping[str, str] + time : str + unit : str + value : str + ''' + key_ = key + labels_ = labels + time_ = time + unit_ = unit + value_ = value + + # Validate arguments against known Juju API types. + if key_ is not None and not isinstance(key_, (bytes, str)): + raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) + + if labels_ is not None and not isinstance(labels_, dict): + raise Exception("Expected labels_ to be a Mapping, received: {}".format(type(labels_))) + + if time_ is not None and not isinstance(time_, (bytes, str)): + raise Exception("Expected time_ to be a str, received: {}".format(type(time_))) + + if unit_ is not None and not isinstance(unit_, (bytes, str)): + raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + + if value_ is not None and not isinstance(value_, (bytes, str)): + raise Exception("Expected value_ to be a str, received: {}".format(type(value_))) + + self.key = key_ + self.labels = labels_ + self.time = time_ + self.unit = unit_ + self.value = value_ + self.unknown_fields = unknown_fields + + + +class MetricResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~EntityMetrics] + ''' + results_ = [EntityMetrics.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 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): + ''' + agent_version : Number + controller_agent_version : Number + 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 + name_ = name + owner_tag_ = owner_tag + uuid_ = uuid + + # Validate arguments against known Juju API types. + 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_))) + + self.agent_version = agent_version_ + self.controller_agent_version = controller_agent_version_ + self.name = name_ + self.owner_tag = owner_tag_ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +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 + target_info : MigrationTargetInfo + ''' + model_tag_ = model_tag + target_info_ = MigrationTargetInfo.from_json(target_info) if target_info else None + + # Validate arguments against known Juju API types. + 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_info_ is not None and not isinstance(target_info_, (dict, MigrationTargetInfo)): + raise Exception("Expected target_info_ to be a MigrationTargetInfo, received: {}".format(type(target_info_))) + + self.model_tag = model_tag_ + self.target_info = target_info_ + self.unknown_fields = 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 + migration_id : str + phase : str + source_api_addrs : typing.Sequence[str] + source_ca_cert : str + target_api_addrs : typing.Sequence[str] + target_ca_cert : str + ''' + 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 + + # Validate arguments against known Juju API types. + if attempt_ is not None and not isinstance(attempt_, int): + raise Exception("Expected attempt_ to be a int, received: {}".format(type(attempt_))) + + 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 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_))) + + if target_api_addrs_ is not None and not isinstance(target_api_addrs_, (bytes, str, list)): + raise Exception("Expected target_api_addrs_ to be a Sequence, received: {}".format(type(target_api_addrs_))) + + if target_ca_cert_ is not None and not isinstance(target_ca_cert_, (bytes, str)): + raise Exception("Expected target_ca_cert_ to be a str, received: {}".format(type(target_ca_cert_))) + + self.attempt = attempt_ + self.migration_id = migration_id_ + self.phase = phase_ + self.source_api_addrs = source_api_addrs_ + self.source_ca_cert = source_ca_cert_ + self.target_api_addrs = target_api_addrs_ + self.target_ca_cert = target_ca_cert_ + self.unknown_fields = unknown_fields + + + +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] + auth_tag : str + ca_cert : str + controller_alias : str + controller_tag : str + macaroons : str + password : str + ''' + addrs_ = addrs + auth_tag_ = auth_tag + ca_cert_ = ca_cert + controller_alias_ = controller_alias + controller_tag_ = controller_tag + macaroons_ = macaroons + password_ = password + + # Validate arguments against known Juju API types. + if addrs_ is not None and not isinstance(addrs_, (bytes, str, list)): + raise Exception("Expected addrs_ to be a Sequence, received: {}".format(type(addrs_))) + + 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 ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): + raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) + + 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 macaroons_ is not None and not isinstance(macaroons_, (bytes, str)): + raise Exception("Expected macaroons_ to be a str, received: {}".format(type(macaroons_))) + + if password_ is not None and not isinstance(password_, (bytes, str)): + raise Exception("Expected password_ to be a str, received: {}".format(type(password_))) + + self.addrs = addrs_ + self.auth_tag = auth_tag_ + self.ca_cert = ca_cert_ + self.controller_alias = controller_alias_ + self.controller_tag = controller_tag_ + self.macaroons = macaroons_ + self.password = password_ + self.unknown_fields = unknown_fields + + + +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 + phase : str + success : bool + ''' + migration_id_ = migration_id + phase_ = phase + success_ = success + + # Validate arguments against known Juju API types. + 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_))) + + self.migration_id = migration_id_ + self.phase = phase_ + self.success = success_ + self.unknown_fields = 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] + migration_id : str + phase : str + success_count : int + unknown_count : int + unknown_sample : typing.Sequence[str] + ''' + failed_ = failed + migration_id_ = migration_id + phase_ = phase + success_count_ = success_count + unknown_count_ = unknown_count + unknown_sample_ = unknown_sample + + # Validate arguments against known Juju API types. + if failed_ is not None and not isinstance(failed_, (bytes, str, list)): + raise Exception("Expected failed_ to be a Sequence, received: {}".format(type(failed_))) + + 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_count_ is not None and not isinstance(success_count_, int): + raise Exception("Expected success_count_ to be a int, received: {}".format(type(success_count_))) + + if unknown_count_ is not None and not isinstance(unknown_count_, int): + raise Exception("Expected unknown_count_ to be a int, received: {}".format(type(unknown_count_))) + + if unknown_sample_ is not None and not isinstance(unknown_sample_, (bytes, str, list)): + raise Exception("Expected unknown_sample_ to be a Sequence, received: {}".format(type(unknown_sample_))) + + self.failed = failed_ + self.migration_id = migration_id_ + self.phase = phase_ + self.success_count = success_count_ + self.unknown_count = unknown_count_ + self.unknown_sample = unknown_sample_ + self.unknown_fields = unknown_fields + + + +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 + owner_tag : str + type_ : str + uuid : str + ''' + name_ = name + owner_tag_ = owner_tag + type__ = type_ + uuid_ = uuid + + # Validate arguments against known Juju API types. + 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 type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.name = name_ + self.owner_tag = owner_tag_ + self.type_ = type__ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +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] + annotations : typing.Mapping[str, str] + cloud : str + controller : str + credential : str + messages : typing.Sequence[~ModelSummaryMessage] + name : str + region : str + removed : bool + size : ModelSummarySize + status : str + uuid : str + ''' + admins_ = admins + annotations_ = annotations + cloud_ = cloud + controller_ = controller + credential_ = credential + messages_ = [ModelSummaryMessage.from_json(o) for o in messages or []] + name_ = name + region_ = region + removed_ = removed + size_ = ModelSummarySize.from_json(size) if size else None + status_ = status + uuid_ = uuid + + # Validate arguments against known Juju API types. + if admins_ is not None and not isinstance(admins_, (bytes, str, list)): + raise Exception("Expected admins_ to be a Sequence, received: {}".format(type(admins_))) + + if annotations_ is not None and not isinstance(annotations_, dict): + raise Exception("Expected annotations_ to be a Mapping, received: {}".format(type(annotations_))) + + if cloud_ is not None and not isinstance(cloud_, (bytes, str)): + raise Exception("Expected cloud_ to be a str, received: {}".format(type(cloud_))) + + if controller_ is not None and not isinstance(controller_, (bytes, str)): + raise Exception("Expected controller_ to be a str, received: {}".format(type(controller_))) + + if credential_ is not None and not isinstance(credential_, (bytes, str)): + raise Exception("Expected credential_ to be a str, received: {}".format(type(credential_))) + + 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 name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if region_ is not None and not isinstance(region_, (bytes, str)): + raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + + if removed_ is not None and not isinstance(removed_, bool): + raise Exception("Expected removed_ to be a bool, received: {}".format(type(removed_))) + + if size_ is not None and not isinstance(size_, (dict, ModelSummarySize)): + raise Exception("Expected size_ to be a ModelSummarySize, received: {}".format(type(size_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.admins = admins_ + self.annotations = annotations_ + self.cloud = cloud_ + self.controller = controller_ + self.credential = credential_ + self.messages = messages_ + self.name = name_ + self.region = region_ + self.removed = removed_ + self.size = size_ + self.status = status_ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +class ModelAccess(Type): + _toSchema = {'access': 'access', 'model': 'model'} + _toPy = {'access': 'access', 'model': 'model'} + def __init__(self, access=None, model=None, **unknown_fields): + ''' + access : str + model : str + ''' + access_ = access + model_ = model + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if model_ is not None and not isinstance(model_, (bytes, str)): + raise Exception("Expected model_ to be a str, received: {}".format(type(model_))) + + self.access = access_ + self.model = model_ + self.unknown_fields = 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 + ''' + model_tag_ = model_tag + + # Validate arguments against known Juju API types. + 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_))) + + self.model_tag = model_tag_ + self.unknown_fields = 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] + model_uuid : str + name : str + owner_tag : str + ''' + blocks_ = blocks + model_uuid_ = model_uuid + name_ = name + owner_tag_ = owner_tag + + # Validate arguments against known Juju API types. + if blocks_ is not None and not isinstance(blocks_, (bytes, str, list)): + raise Exception("Expected blocks_ to be a Sequence, received: {}".format(type(blocks_))) + + if model_uuid_ is not None and not isinstance(model_uuid_, (bytes, str)): + raise Exception("Expected model_uuid_ to be a str, received: {}".format(type(model_uuid_))) + + 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_))) + + self.blocks = blocks_ + self.model_uuid = model_uuid_ + self.name = name_ + self.owner_tag = owner_tag_ + self.unknown_fields = unknown_fields + + + +class ModelBlockInfoList(Type): + _toSchema = {'models': 'models'} + _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): + ''' + models : typing.Sequence[~ModelBlockInfo] + ''' + models_ = [ModelBlockInfo.from_json(o) for o in models or []] + + # Validate arguments against known Juju API types. + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + self.models = models_ + self.unknown_fields = unknown_fields + + + +class ModelConfigResult(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): + ''' + config : typing.Mapping[str, typing.Any] + ''' + config_ = config + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + self.config = config_ + self.unknown_fields = unknown_fields + + + +class ModelConfigResults(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): + ''' + config : typing.Mapping[str, ~ConfigValue] + ''' + config_ = {k: ConfigValue.from_json(v) for k, v in (config or dict()).items()} + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + self.config = config_ + self.unknown_fields = 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 + config : typing.Mapping[str, typing.Any] + credential : str + name : str + owner_tag : str + region : str + ''' + cloud_tag_ = cloud_tag + config_ = config + credential_ = credential + name_ = name + owner_tag_ = owner_tag + region_ = region + + # Validate arguments against known Juju API types. + 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_))) + + self.cloud_tag = cloud_tag_ + self.config = config_ + self.credential = credential_ + self.name = name_ + self.owner_tag = owner_tag_ + self.region = region_ + self.unknown_fields = unknown_fields + + + +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 + exists : bool + model_tag : str + valid : bool + ''' + credential_tag_ = credential_tag + exists_ = exists + model_tag_ = model_tag + valid_ = valid + + # Validate arguments against known Juju API types. + if credential_tag_ is not None and not isinstance(credential_tag_, (bytes, str)): + raise Exception("Expected credential_tag_ to be a str, received: {}".format(type(credential_tag_))) + + if exists_ is not None and not isinstance(exists_, bool): + raise Exception("Expected exists_ to be a bool, received: {}".format(type(exists_))) + + 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 valid_ is not None and not isinstance(valid_, bool): + raise Exception("Expected valid_ to be a bool, received: {}".format(type(valid_))) + + self.credential_tag = credential_tag_ + self.exists = exists_ + self.model_tag = model_tag_ + self.valid = valid_ + self.unknown_fields = unknown_fields + + + +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 + cloud_tag : str + config : typing.Mapping[str, typing.Any] + ''' + cloud_region_ = cloud_region + cloud_tag_ = cloud_tag + config_ = config + + # Validate arguments against known Juju API types. + if cloud_region_ is not None and not isinstance(cloud_region_, (bytes, str)): + raise Exception("Expected cloud_region_ to be a str, received: {}".format(type(cloud_region_))) + + 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_))) + + self.cloud_region = cloud_region_ + self.cloud_tag = cloud_tag_ + self.config = config_ + self.unknown_fields = unknown_fields + + + +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 + default : Any + regions : typing.Sequence[~RegionDefaults] + ''' + controller_ = controller + default_ = default + regions_ = [RegionDefaults.from_json(o) for o in regions or []] + + # Validate arguments against known Juju API types. + if regions_ is not None and not isinstance(regions_, (bytes, str, list)): + raise Exception("Expected regions_ to be a Sequence, received: {}".format(type(regions_))) + + self.controller = controller_ + self.default = default_ + self.regions = regions_ + self.unknown_fields = 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] + error : Error + ''' + config_ = {k: ModelDefaults.from_json(v) for k, v in (config or dict()).items()} + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.config = config_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class ModelDefaultsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ModelDefaultsResult] + ''' + results_ = [ModelDefaultsResult.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 ModelEntityCount(Type): + _toSchema = {'count': 'count', 'entity': 'entity'} + _toPy = {'count': 'count', 'entity': 'entity'} + def __init__(self, count=None, entity=None, **unknown_fields): + ''' + count : int + entity : str + ''' + count_ = count + entity_ = entity + + # Validate arguments against known Juju API types. + if count_ is not None and not isinstance(count_, int): + raise Exception("Expected count_ to be a int, received: {}".format(type(count_))) + + if entity_ is not None and not isinstance(entity_, (bytes, str)): + raise Exception("Expected entity_ to be a str, received: {}".format(type(entity_))) + + self.count = count_ + self.entity = entity_ + self.unknown_fields = 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 + id_ : str + message : str + provider_id : str + status : str + ''' + detachable_ = detachable + id__ = id_ + message_ = message + provider_id_ = provider_id + status_ = status + + # Validate arguments against known Juju API types. + if detachable_ is not None and not isinstance(detachable_, bool): + raise Exception("Expected detachable_ to be a bool, received: {}".format(type(detachable_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.detachable = detachable_ + self.id_ = id__ + self.message = message_ + self.provider_id = provider_id_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +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_series': 'default-series', 'is_controller': 'is-controller', 'life': 'life', 'machines': 'machines', 'migration': 'migration', 'name': 'name', 'owner_tag': 'owner-tag', 'provider_type': 'provider-type', '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-series': 'default_series', 'is-controller': 'is_controller', 'life': 'life', 'machines': 'machines', 'migration': 'migration', 'name': 'name', 'owner-tag': 'owner_tag', 'provider-type': 'provider_type', '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_series=None, is_controller=None, life=None, machines=None, migration=None, name=None, owner_tag=None, provider_type=None, sla=None, status=None, supported_features=None, type_=None, users=None, uuid=None, **unknown_fields): + ''' + agent_version : Number + cloud_credential_tag : str + cloud_credential_validity : bool + cloud_region : str + cloud_tag : str + controller_uuid : str + default_series : str + is_controller : bool + life : str + machines : typing.Sequence[~ModelMachineInfo] + migration : ModelMigrationStatus + name : str + owner_tag : str + provider_type : str + sla : ModelSLAInfo + status : EntityStatus + supported_features : typing.Sequence[~SupportedFeature] + type_ : str + users : typing.Sequence[~ModelUserInfo] + uuid : str + ''' + agent_version_ = Number.from_json(agent_version) if agent_version else None + 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_series_ = default_series + is_controller_ = is_controller + life_ = life + machines_ = [ModelMachineInfo.from_json(o) for o in machines or []] + migration_ = ModelMigrationStatus.from_json(migration) if migration else None + name_ = name + owner_tag_ = owner_tag + provider_type_ = provider_type + sla_ = ModelSLAInfo.from_json(sla) if sla else None + status_ = EntityStatus.from_json(status) if status else None + supported_features_ = [SupportedFeature.from_json(o) for o in supported_features or []] + type__ = type_ + users_ = [ModelUserInfo.from_json(o) for o in users or []] + uuid_ = uuid + + # Validate arguments against known Juju API types. + 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 cloud_credential_tag_ is not None and not isinstance(cloud_credential_tag_, (bytes, str)): + raise Exception("Expected cloud_credential_tag_ to be a str, received: {}".format(type(cloud_credential_tag_))) + + if cloud_credential_validity_ is not None and not isinstance(cloud_credential_validity_, bool): + raise Exception("Expected cloud_credential_validity_ to be a bool, received: {}".format(type(cloud_credential_validity_))) + + if cloud_region_ is not None and not isinstance(cloud_region_, (bytes, str)): + raise Exception("Expected cloud_region_ to be a str, received: {}".format(type(cloud_region_))) + + 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 controller_uuid_ is not None and not isinstance(controller_uuid_, (bytes, str)): + raise Exception("Expected controller_uuid_ to be a str, received: {}".format(type(controller_uuid_))) + + if default_series_ is not None and not isinstance(default_series_, (bytes, str)): + raise Exception("Expected default_series_ to be a str, received: {}".format(type(default_series_))) + + if is_controller_ is not None and not isinstance(is_controller_, bool): + raise Exception("Expected is_controller_ to be a bool, received: {}".format(type(is_controller_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + 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 migration_ is not None and not isinstance(migration_, (dict, ModelMigrationStatus)): + raise Exception("Expected migration_ to be a ModelMigrationStatus, received: {}".format(type(migration_))) + + 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 provider_type_ is not None and not isinstance(provider_type_, (bytes, str)): + raise Exception("Expected provider_type_ to be a str, received: {}".format(type(provider_type_))) + + if sla_ is not None and not isinstance(sla_, (dict, ModelSLAInfo)): + raise Exception("Expected sla_ to be a ModelSLAInfo, received: {}".format(type(sla_))) + + if status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + if supported_features_ is not None and not isinstance(supported_features_, (bytes, str, list)): + raise Exception("Expected supported_features_ to be a Sequence, received: {}".format(type(supported_features_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if users_ is not None and not isinstance(users_, (bytes, str, list)): + raise Exception("Expected users_ to be a Sequence, received: {}".format(type(users_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.agent_version = agent_version_ + self.cloud_credential_tag = cloud_credential_tag_ + self.cloud_credential_validity = cloud_credential_validity_ + self.cloud_region = cloud_region_ + self.cloud_tag = cloud_tag_ + self.controller_uuid = controller_uuid_ + self.default_series = default_series_ + self.is_controller = is_controller_ + self.life = life_ + self.machines = machines_ + self.migration = migration_ + self.name = name_ + self.owner_tag = owner_tag_ + self.provider_type = provider_type_ + self.sla = sla_ + self.status = status_ + self.supported_features = supported_features_ + self.type_ = type__ + self.users = users_ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +class ModelInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ModelInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = ModelInfo.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, ModelInfo)): + raise Exception("Expected result_ to be a ModelInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ModelInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ModelInfoResult] + ''' + results_ = [ModelInfoResult.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 ModelInstanceTypesConstraint(Type): + _toSchema = {'value': 'value'} + _toPy = {'value': 'value'} + def __init__(self, value=None, **unknown_fields): + ''' + value : Value + ''' + value_ = Value.from_json(value) if value else None + + # Validate arguments against known Juju API types. + if value_ is not None and not isinstance(value_, (dict, Value)): + raise Exception("Expected value_ to be a Value, received: {}".format(type(value_))) + + self.value = value_ + self.unknown_fields = unknown_fields + + + +class ModelInstanceTypesConstraints(Type): + _toSchema = {'constraints': 'constraints'} + _toPy = {'constraints': 'constraints'} + def __init__(self, constraints=None, **unknown_fields): + ''' + constraints : typing.Sequence[~ModelInstanceTypesConstraint] + ''' + constraints_ = [ModelInstanceTypesConstraint.from_json(o) for o in constraints or []] + + # Validate arguments against known Juju API types. + if constraints_ is not None and not isinstance(constraints_, (bytes, str, list)): + raise Exception("Expected constraints_ to be a Sequence, received: {}".format(type(constraints_))) + + self.constraints = constraints_ + self.unknown_fields = 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 + ha_primary : bool + hardware : MachineHardware + has_vote : bool + id_ : str + instance_id : str + message : str + status : str + wants_vote : bool + ''' + display_name_ = display_name + ha_primary_ = ha_primary + hardware_ = MachineHardware.from_json(hardware) if hardware else None + has_vote_ = has_vote + id__ = id_ + instance_id_ = instance_id + message_ = message + status_ = status + wants_vote_ = wants_vote + + # Validate arguments against known Juju API types. + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if ha_primary_ is not None and not isinstance(ha_primary_, bool): + raise Exception("Expected ha_primary_ to be a bool, received: {}".format(type(ha_primary_))) + + if hardware_ is not None and not isinstance(hardware_, (dict, MachineHardware)): + raise Exception("Expected hardware_ to be a MachineHardware, received: {}".format(type(hardware_))) + + if has_vote_ is not None and not isinstance(has_vote_, bool): + raise Exception("Expected has_vote_ to be a bool, received: {}".format(type(has_vote_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): + raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if wants_vote_ is not None and not isinstance(wants_vote_, bool): + raise Exception("Expected wants_vote_ to be a bool, received: {}".format(type(wants_vote_))) + + self.display_name = display_name_ + self.ha_primary = ha_primary_ + self.hardware = hardware_ + self.has_vote = has_vote_ + self.id_ = id__ + self.instance_id = instance_id_ + self.message = message_ + self.status = status_ + self.wants_vote = wants_vote_ + self.unknown_fields = unknown_fields + + + +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 + start : str + status : str + ''' + end_ = end + start_ = start + status_ = status + + # Validate arguments against known Juju API types. + if end_ is not None and not isinstance(end_, (bytes, str)): + raise Exception("Expected end_ to be a str, received: {}".format(type(end_))) + + if start_ is not None and not isinstance(start_, (bytes, str)): + raise Exception("Expected start_ to be a str, received: {}".format(type(start_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.end = end_ + self.start = start_ + self.status = status_ + self.unknown_fields = 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] + image_details : DockerImageInfo + version : Number + ''' + api_addresses_ = api_addresses + image_details_ = DockerImageInfo.from_json(image_details) if image_details else None + version_ = Number.from_json(version) if version else None + + # Validate arguments against known Juju API types. + if api_addresses_ is not None and not isinstance(api_addresses_, (bytes, str, list)): + raise Exception("Expected api_addresses_ to be a Sequence, received: {}".format(type(api_addresses_))) + + if image_details_ is not None and not isinstance(image_details_, (dict, DockerImageInfo)): + raise Exception("Expected image_details_ to be a DockerImageInfo, received: {}".format(type(image_details_))) + + if version_ is not None and not isinstance(version_, (dict, Number)): + raise Exception("Expected version_ to be a Number, received: {}".format(type(version_))) + + self.api_addresses = api_addresses_ + self.image_details = image_details_ + self.version = version_ + self.unknown_fields = 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 + name : str + type_ : str + uuid : str + ''' + error_ = Error.from_json(error) if error else None + name_ = name + type__ = type_ + uuid_ = uuid + + # 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 name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.error = error_ + self.name = name_ + self.type_ = type__ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +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 + creds : typing.Sequence[int] + level : str + owner : str + ''' + modelslainfo_ = ModelSLAInfo.from_json(modelslainfo) if modelslainfo else None + creds_ = creds + level_ = level + owner_ = owner + + # Validate arguments against known Juju API types. + 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_))) + + self.modelslainfo = modelslainfo_ + self.creds = creds_ + self.level = level_ + self.owner = owner_ + self.unknown_fields = unknown_fields + + + +class ModelSLAInfo(Type): + _toSchema = {'level': 'level', 'owner': 'owner'} + _toPy = {'level': 'level', 'owner': 'owner'} + def __init__(self, level=None, owner=None, **unknown_fields): + ''' + level : str + owner : str + ''' + level_ = level + owner_ = owner + + # Validate arguments against known Juju API types. + 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_))) + + self.level = level_ + self.owner = owner_ + self.unknown_fields = unknown_fields + + + +class ModelSequencesResult(Type): + _toSchema = {'sequences': 'sequences'} + _toPy = {'sequences': 'sequences'} + def __init__(self, sequences=None, **unknown_fields): + ''' + sequences : typing.Mapping[str, int] + ''' + sequences_ = sequences + + # Validate arguments against known Juju API types. + if sequences_ is not None and not isinstance(sequences_, dict): + raise Exception("Expected sequences_ to be a Mapping, received: {}".format(type(sequences_))) + + self.sequences = sequences_ + self.unknown_fields = unknown_fields + + + +class ModelSet(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): + ''' + config : typing.Mapping[str, typing.Any] + ''' + config_ = config + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, dict): + raise Exception("Expected config_ to be a Mapping, received: {}".format(type(config_))) + + self.config = config_ + self.unknown_fields = unknown_fields + + + +class ModelStatus(Type): + _toSchema = {'application_count': 'application-count', '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', '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, 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 + error : Error + filesystems : typing.Sequence[~ModelFilesystemInfo] + hosted_machine_count : int + life : str + machines : typing.Sequence[~ModelMachineInfo] + model_tag : str + owner_tag : str + type_ : str + unit_count : int + volumes : typing.Sequence[~ModelVolumeInfo] + ''' + application_count_ = application_count + error_ = Error.from_json(error) if error else None + filesystems_ = [ModelFilesystemInfo.from_json(o) for o in filesystems or []] + hosted_machine_count_ = hosted_machine_count + life_ = life + machines_ = [ModelMachineInfo.from_json(o) for o in machines or []] + model_tag_ = model_tag + owner_tag_ = owner_tag + type__ = type_ + unit_count_ = unit_count + volumes_ = [ModelVolumeInfo.from_json(o) for o in volumes or []] + + # Validate arguments against known Juju API types. + if application_count_ is not None and not isinstance(application_count_, int): + raise Exception("Expected application_count_ to be a int, received: {}".format(type(application_count_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if filesystems_ is not None and not isinstance(filesystems_, (bytes, str, list)): + raise Exception("Expected filesystems_ to be a Sequence, received: {}".format(type(filesystems_))) + + if hosted_machine_count_ is not None and not isinstance(hosted_machine_count_, int): + raise Exception("Expected hosted_machine_count_ to be a int, received: {}".format(type(hosted_machine_count_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + 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 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 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 type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if unit_count_ is not None and not isinstance(unit_count_, int): + raise Exception("Expected unit_count_ to be a int, received: {}".format(type(unit_count_))) + + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.application_count = application_count_ + self.error = error_ + self.filesystems = filesystems_ + self.hosted_machine_count = hosted_machine_count_ + self.life = life_ + self.machines = machines_ + self.model_tag = model_tag_ + self.owner_tag = owner_tag_ + self.type_ = type__ + self.unit_count = unit_count_ + self.volumes = volumes_ + self.unknown_fields = unknown_fields + + + +class ModelStatusInfo(Type): + _toSchema = {'available_version': 'available-version', 'cloud_tag': 'cloud-tag', 'migration': 'migration', 'name': 'name', 'region': 'region', 'version': 'version'} + _toPy = {'available-version': 'available_version', 'cloud-tag': 'cloud_tag', 'migration': 'migration', 'name': 'name', 'region': 'region', 'version': 'version'} + def __init__(self, available_version=None, cloud_tag=None, migration=None, name=None, region=None, version=None, **unknown_fields): + ''' + available_version : str + cloud_tag : str + migration : str + name : str + region : str + version : str + ''' + available_version_ = available_version + cloud_tag_ = cloud_tag + migration_ = migration + name_ = name + region_ = region + version_ = version + + # Validate arguments against known Juju API types. + if available_version_ is not None and not isinstance(available_version_, (bytes, str)): + raise Exception("Expected available_version_ to be a str, received: {}".format(type(available_version_))) + + 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 migration_ is not None and not isinstance(migration_, (bytes, str)): + raise Exception("Expected migration_ to be a str, received: {}".format(type(migration_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if region_ is not None and not isinstance(region_, (bytes, str)): + raise Exception("Expected region_ to be a str, received: {}".format(type(region_))) + + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + + self.available_version = available_version_ + self.cloud_tag = cloud_tag_ + self.migration = migration_ + self.name = name_ + self.region = region_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class ModelStatusResults(Type): + _toSchema = {'models': 'models'} + _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): + ''' + models : typing.Sequence[~ModelStatus] + ''' + models_ = [ModelStatus.from_json(o) for o in models or []] + + # Validate arguments against known Juju API types. + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + self.models = models_ + self.unknown_fields = 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 + user_tag : str + ''' + all__ = all_ + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + 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_))) + + self.all_ = all__ + self.user_tag = user_tag_ + self.unknown_fields = 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 + cloud_credential_tag : str + cloud_region : str + cloud_tag : str + controller_uuid : str + counts : typing.Sequence[~ModelEntityCount] + default_series : str + is_controller : bool + last_connection : str + life : str + migration : ModelMigrationStatus + name : str + owner_tag : str + provider_type : str + sla : ModelSLAInfo + status : EntityStatus + type_ : str + user_access : str + uuid : str + ''' + agent_version_ = Number.from_json(agent_version) if agent_version else None + cloud_credential_tag_ = cloud_credential_tag + cloud_region_ = cloud_region + cloud_tag_ = cloud_tag + controller_uuid_ = controller_uuid + counts_ = [ModelEntityCount.from_json(o) for o in counts or []] + default_series_ = default_series + is_controller_ = is_controller + last_connection_ = last_connection + life_ = life + migration_ = ModelMigrationStatus.from_json(migration) if migration else None + name_ = name + owner_tag_ = owner_tag + provider_type_ = provider_type + sla_ = ModelSLAInfo.from_json(sla) if sla else None + status_ = EntityStatus.from_json(status) if status else None + type__ = type_ + user_access_ = user_access + uuid_ = uuid + + # Validate arguments against known Juju API types. + 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 cloud_credential_tag_ is not None and not isinstance(cloud_credential_tag_, (bytes, str)): + raise Exception("Expected cloud_credential_tag_ to be a str, received: {}".format(type(cloud_credential_tag_))) + + if cloud_region_ is not None and not isinstance(cloud_region_, (bytes, str)): + raise Exception("Expected cloud_region_ to be a str, received: {}".format(type(cloud_region_))) + + 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 controller_uuid_ is not None and not isinstance(controller_uuid_, (bytes, str)): + raise Exception("Expected controller_uuid_ to be a str, received: {}".format(type(controller_uuid_))) + + if counts_ is not None and not isinstance(counts_, (bytes, str, list)): + raise Exception("Expected counts_ to be a Sequence, received: {}".format(type(counts_))) + + if default_series_ is not None and not isinstance(default_series_, (bytes, str)): + raise Exception("Expected default_series_ to be a str, received: {}".format(type(default_series_))) + + if is_controller_ is not None and not isinstance(is_controller_, bool): + raise Exception("Expected is_controller_ to be a bool, received: {}".format(type(is_controller_))) + + if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): + raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if migration_ is not None and not isinstance(migration_, (dict, ModelMigrationStatus)): + raise Exception("Expected migration_ to be a ModelMigrationStatus, received: {}".format(type(migration_))) + + 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 provider_type_ is not None and not isinstance(provider_type_, (bytes, str)): + raise Exception("Expected provider_type_ to be a str, received: {}".format(type(provider_type_))) + + if sla_ is not None and not isinstance(sla_, (dict, ModelSLAInfo)): + raise Exception("Expected sla_ to be a ModelSLAInfo, received: {}".format(type(sla_))) + + if status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if user_access_ is not None and not isinstance(user_access_, (bytes, str)): + raise Exception("Expected user_access_ to be a str, received: {}".format(type(user_access_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.agent_version = agent_version_ + self.cloud_credential_tag = cloud_credential_tag_ + self.cloud_region = cloud_region_ + self.cloud_tag = cloud_tag_ + self.controller_uuid = controller_uuid_ + self.counts = counts_ + self.default_series = default_series_ + self.is_controller = is_controller_ + self.last_connection = last_connection_ + self.life = life_ + self.migration = migration_ + self.name = name_ + self.owner_tag = owner_tag_ + self.provider_type = provider_type_ + self.sla = sla_ + self.status = status_ + self.type_ = type__ + self.user_access = user_access_ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +class ModelSummaryMessage(Type): + _toSchema = {'agent': 'agent', 'message': 'message'} + _toPy = {'agent': 'agent', 'message': 'message'} + def __init__(self, agent=None, message=None, **unknown_fields): + ''' + agent : str + message : str + ''' + agent_ = agent + message_ = message + + # Validate arguments against known Juju API types. + if agent_ is not None and not isinstance(agent_, (bytes, str)): + raise Exception("Expected agent_ to be a str, received: {}".format(type(agent_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + self.agent = agent_ + self.message = message_ + self.unknown_fields = 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 + result : ModelSummary + ''' + error_ = Error.from_json(error) if error else None + result_ = ModelSummary.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, ModelSummary)): + raise Exception("Expected result_ to be a ModelSummary, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ModelSummaryResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ModelSummaryResult] + ''' + results_ = [ModelSummaryResult.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 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 + containers : int + machines : int + relations : int + units : int + ''' + applications_ = applications + containers_ = containers + machines_ = machines + relations_ = relations + units_ = units + + # Validate arguments against known Juju API types. + if applications_ is not None and not isinstance(applications_, int): + raise Exception("Expected applications_ to be a int, received: {}".format(type(applications_))) + + if containers_ is not None and not isinstance(containers_, int): + raise Exception("Expected containers_ to be a int, received: {}".format(type(containers_))) + + if machines_ is not None and not isinstance(machines_, int): + raise Exception("Expected machines_ to be a int, received: {}".format(type(machines_))) + + if relations_ is not None and not isinstance(relations_, int): + raise Exception("Expected relations_ to be a int, received: {}".format(type(relations_))) + + if units_ is not None and not isinstance(units_, int): + raise Exception("Expected units_ to be a int, received: {}".format(type(units_))) + + self.applications = applications_ + self.containers = containers_ + self.machines = machines_ + self.relations = relations_ + self.units = units_ + self.unknown_fields = unknown_fields + + + +class ModelTag(Type): + _toSchema = {} + _toPy = {} + def __init__(self, **unknown_fields): + ''' + + ''' + self.unknown_fields = unknown_fields + + + +class ModelUnset(Type): + _toSchema = {'keys': 'keys'} + _toPy = {'keys': 'keys'} + def __init__(self, keys=None, **unknown_fields): + ''' + keys : typing.Sequence[str] + ''' + keys_ = keys + + # Validate arguments against known Juju API types. + if keys_ is not None and not isinstance(keys_, (bytes, str, list)): + raise Exception("Expected keys_ to be a Sequence, received: {}".format(type(keys_))) + + self.keys = keys_ + self.unknown_fields = 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 + cloud_tag : str + keys : typing.Sequence[str] + ''' + cloud_region_ = cloud_region + cloud_tag_ = cloud_tag + keys_ = keys + + # Validate arguments against known Juju API types. + if cloud_region_ is not None and not isinstance(cloud_region_, (bytes, str)): + raise Exception("Expected cloud_region_ to be a str, received: {}".format(type(cloud_region_))) + + 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 keys_ is not None and not isinstance(keys_, (bytes, str, list)): + raise Exception("Expected keys_ to be a Sequence, received: {}".format(type(keys_))) + + self.cloud_region = cloud_region_ + self.cloud_tag = cloud_tag_ + self.keys = keys_ + self.unknown_fields = unknown_fields + + + +class ModelUserInfo(Type): + _toSchema = {'access': 'access', 'display_name': 'display-name', 'last_connection': 'last-connection', 'user': 'user'} + _toPy = {'access': 'access', 'display-name': 'display_name', 'last-connection': 'last_connection', 'user': 'user'} + def __init__(self, access=None, display_name=None, last_connection=None, user=None, **unknown_fields): + ''' + access : str + display_name : str + last_connection : str + user : str + ''' + access_ = access + display_name_ = display_name + last_connection_ = last_connection + user_ = user + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): + raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) + + if user_ is not None and not isinstance(user_, (bytes, str)): + raise Exception("Expected user_ to be a str, received: {}".format(type(user_))) + + self.access = access_ + self.display_name = display_name_ + self.last_connection = last_connection_ + self.user = user_ + self.unknown_fields = unknown_fields + + + +class ModelUserInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ModelUserInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = ModelUserInfo.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, ModelUserInfo)): + raise Exception("Expected result_ to be a ModelUserInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ModelUserInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ModelUserInfoResult] + ''' + results_ = [ModelUserInfoResult.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 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 + id_ : str + message : str + provider_id : str + status : str + ''' + detachable_ = detachable + id__ = id_ + message_ = message + provider_id_ = provider_id + status_ = status + + # Validate arguments against known Juju API types. + if detachable_ is not None and not isinstance(detachable_, bool): + raise Exception("Expected detachable_ to be a bool, received: {}".format(type(detachable_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.detachable = detachable_ + self.id_ = id__ + self.message = message_ + self.provider_id = provider_id_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +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 + action : str + cloud_tag : str + user_tag : str + ''' + access_ = access + action_ = action + cloud_tag_ = cloud_tag + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if action_ is not None and not isinstance(action_, (bytes, str)): + raise Exception("Expected action_ to be a str, received: {}".format(type(action_))) + + 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 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_))) + + self.access = access_ + self.action = action_ + self.cloud_tag = cloud_tag_ + self.user_tag = user_tag_ + self.unknown_fields = unknown_fields + + + +class ModifyCloudAccessRequest(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~ModifyCloudAccess] + ''' + changes_ = [ModifyCloudAccess.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = 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 + action : str + user_tag : str + ''' + access_ = access + action_ = action + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if action_ is not None and not isinstance(action_, (bytes, str)): + raise Exception("Expected action_ to be a str, received: {}".format(type(action_))) + + 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_))) + + self.access = access_ + self.action = action_ + self.user_tag = user_tag_ + self.unknown_fields = unknown_fields + + + +class ModifyControllerAccessRequest(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~ModifyControllerAccess] + ''' + changes_ = [ModifyControllerAccess.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = 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 + action : str + model_tag : str + user_tag : str + ''' + access_ = access + action_ = action + model_tag_ = model_tag + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if action_ is not None and not isinstance(action_, (bytes, str)): + raise Exception("Expected action_ to be a str, received: {}".format(type(action_))) + + 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 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_))) + + self.access = access_ + self.action = action_ + self.model_tag = model_tag_ + self.user_tag = user_tag_ + self.unknown_fields = unknown_fields + + + +class ModifyModelAccessRequest(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~ModifyModelAccess] + ''' + changes_ = [ModifyModelAccess.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = 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 + action : str + offer_url : str + user_tag : str + ''' + access_ = access + action_ = action + offer_url_ = offer_url + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if action_ is not None and not isinstance(action_, (bytes, str)): + raise Exception("Expected action_ to be a str, received: {}".format(type(action_))) + + 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 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_))) + + self.access = access_ + self.action = action_ + self.offer_url = offer_url_ + self.user_tag = user_tag_ + self.unknown_fields = unknown_fields + + + +class ModifyOfferAccessRequest(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~ModifyOfferAccess] + ''' + changes_ = [ModifyOfferAccess.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = 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] + user : str + ''' + ssh_keys_ = ssh_keys + user_ = user + + # Validate arguments against known Juju API types. + 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_))) + + self.ssh_keys = ssh_keys_ + self.user = user_ + self.unknown_fields = unknown_fields + + + +class MongoUpgradeResults(Type): + _toSchema = {'ha_members': 'ha-members', 'master': 'master', 'rs_members': 'rs-members'} + _toPy = {'ha-members': 'ha_members', 'master': 'master', 'rs-members': 'rs_members'} + def __init__(self, ha_members=None, master=None, rs_members=None, **unknown_fields): + ''' + ha_members : typing.Sequence[~HAMember] + master : HAMember + rs_members : typing.Sequence[~Member] + ''' + ha_members_ = [HAMember.from_json(o) for o in ha_members or []] + master_ = HAMember.from_json(master) if master else None + rs_members_ = [Member.from_json(o) for o in rs_members or []] + + # Validate arguments against known Juju API types. + if ha_members_ is not None and not isinstance(ha_members_, (bytes, str, list)): + raise Exception("Expected ha_members_ to be a Sequence, received: {}".format(type(ha_members_))) + + if master_ is not None and not isinstance(master_, (dict, HAMember)): + raise Exception("Expected master_ to be a HAMember, received: {}".format(type(master_))) + + if rs_members_ is not None and not isinstance(rs_members_, (bytes, str, list)): + raise Exception("Expected rs_members_ to be a Sequence, received: {}".format(type(rs_members_))) + + self.ha_members = ha_members_ + self.master = master_ + self.rs_members = rs_members_ + self.unknown_fields = unknown_fields + + + +class MongoVersion(Type): + _toSchema = {'engine': 'engine', 'major': 'major', 'minor': 'minor', 'patch': 'patch'} + _toPy = {'engine': 'engine', 'major': 'major', 'minor': 'minor', 'patch': 'patch'} + def __init__(self, engine=None, major=None, minor=None, patch=None, **unknown_fields): + ''' + engine : str + major : int + minor : int + patch : str + ''' + engine_ = engine + major_ = major + minor_ = minor + patch_ = patch + + # Validate arguments against known Juju API types. + if engine_ is not None and not isinstance(engine_, (bytes, str)): + raise Exception("Expected engine_ to be a str, received: {}".format(type(engine_))) + + if major_ is not None and not isinstance(major_, int): + raise Exception("Expected major_ to be a int, received: {}".format(type(major_))) + + if minor_ is not None and not isinstance(minor_, int): + raise Exception("Expected minor_ to be a int, received: {}".format(type(minor_))) + + if patch_ is not None and not isinstance(patch_, (bytes, str)): + raise Exception("Expected patch_ to be a str, received: {}".format(type(patch_))) + + self.engine = engine_ + self.major = major_ + self.minor = minor_ + self.patch = patch_ + self.unknown_fields = 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 + space_tag : str + subnets : typing.Sequence[str] + ''' + force_ = force + space_tag_ = space_tag + subnets_ = subnets + + # Validate arguments against known Juju API types. + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + 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 subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): + raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) + + self.force = force_ + self.space_tag = space_tag_ + self.subnets = subnets_ + self.unknown_fields = unknown_fields + + + +class MoveSubnetsParams(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~MoveSubnetsParam] + ''' + args_ = [MoveSubnetsParam.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 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 + moved_subnets : typing.Sequence[~MovedSubnet] + new_space : str + ''' + error_ = Error.from_json(error) if error else None + moved_subnets_ = [MovedSubnet.from_json(o) for o in moved_subnets or []] + new_space_ = new_space + + # 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 moved_subnets_ is not None and not isinstance(moved_subnets_, (bytes, str, list)): + raise Exception("Expected moved_subnets_ to be a Sequence, received: {}".format(type(moved_subnets_))) + + if new_space_ is not None and not isinstance(new_space_, (bytes, str)): + raise Exception("Expected new_space_ to be a str, received: {}".format(type(new_space_))) + + self.error = error_ + self.moved_subnets = moved_subnets_ + self.new_space = new_space_ + self.unknown_fields = unknown_fields + + + +class MoveSubnetsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~MoveSubnetsResult] + ''' + results_ = [MoveSubnetsResult.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 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 + old_space : str + subnet : str + ''' + cidr_ = cidr + old_space_ = old_space + subnet_ = subnet + + # Validate arguments against known Juju API types. + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + + if old_space_ is not None and not isinstance(old_space_, (bytes, str)): + raise Exception("Expected old_space_ to be a str, received: {}".format(type(old_space_))) + + if subnet_ is not None and not isinstance(subnet_, (bytes, str)): + raise Exception("Expected subnet_ to be a str, received: {}".format(type(subnet_))) + + self.cidr = cidr_ + self.old_space = old_space_ + self.subnet = subnet_ + self.unknown_fields = 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 + addresses : typing.Sequence[~Address] + cidr : str + config_type : str + device_index : int + disabled : bool + dns_search_domains : typing.Sequence[str] + dns_servers : typing.Sequence[str] + gateway_address : str + interface_name : str + interface_type : str + is_default_gateway : bool + mac_address : str + mtu : int + no_auto_start : bool + origin : str + parent_interface_name : str + provider_address_id : str + provider_id : str + provider_network_id : str + provider_space_id : str + provider_subnet_id : str + provider_vlan_id : str + routes : typing.Sequence[~NetworkRoute] + shadow_addresses : typing.Sequence[~Address] + virtual_port_type : str + vlan_tag : int + ''' + address_ = address + addresses_ = [Address.from_json(o) for o in addresses or []] + 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_ = [NetworkRoute.from_json(o) for o in routes or []] + shadow_addresses_ = [Address.from_json(o) for o in shadow_addresses or []] + virtual_port_type_ = virtual_port_type + vlan_tag_ = vlan_tag + + # Validate arguments against known Juju API types. + if address_ is not None and not isinstance(address_, (bytes, str)): + raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) + + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + + if config_type_ is not None and not isinstance(config_type_, (bytes, str)): + raise Exception("Expected config_type_ to be a str, received: {}".format(type(config_type_))) + + if device_index_ is not None and not isinstance(device_index_, int): + raise Exception("Expected device_index_ to be a int, received: {}".format(type(device_index_))) + + if disabled_ is not None and not isinstance(disabled_, bool): + raise Exception("Expected disabled_ to be a bool, received: {}".format(type(disabled_))) + + if dns_search_domains_ is not None and not isinstance(dns_search_domains_, (bytes, str, list)): + raise Exception("Expected dns_search_domains_ to be a Sequence, received: {}".format(type(dns_search_domains_))) + + if dns_servers_ is not None and not isinstance(dns_servers_, (bytes, str, list)): + raise Exception("Expected dns_servers_ to be a Sequence, received: {}".format(type(dns_servers_))) + + if gateway_address_ is not None and not isinstance(gateway_address_, (bytes, str)): + raise Exception("Expected gateway_address_ to be a str, received: {}".format(type(gateway_address_))) + + if interface_name_ is not None and not isinstance(interface_name_, (bytes, str)): + raise Exception("Expected interface_name_ to be a str, received: {}".format(type(interface_name_))) + + if interface_type_ is not None and not isinstance(interface_type_, (bytes, str)): + raise Exception("Expected interface_type_ to be a str, received: {}".format(type(interface_type_))) + + if is_default_gateway_ is not None and not isinstance(is_default_gateway_, bool): + raise Exception("Expected is_default_gateway_ to be a bool, received: {}".format(type(is_default_gateway_))) + + if mac_address_ is not None and not isinstance(mac_address_, (bytes, str)): + raise Exception("Expected mac_address_ to be a str, received: {}".format(type(mac_address_))) + + if mtu_ is not None and not isinstance(mtu_, int): + raise Exception("Expected mtu_ to be a int, received: {}".format(type(mtu_))) + + if no_auto_start_ is not None and not isinstance(no_auto_start_, bool): + raise Exception("Expected no_auto_start_ to be a bool, received: {}".format(type(no_auto_start_))) + + if origin_ is not None and not isinstance(origin_, (bytes, str)): + raise Exception("Expected origin_ to be a str, received: {}".format(type(origin_))) + + if parent_interface_name_ is not None and not isinstance(parent_interface_name_, (bytes, str)): + raise Exception("Expected parent_interface_name_ to be a str, received: {}".format(type(parent_interface_name_))) + + if provider_address_id_ is not None and not isinstance(provider_address_id_, (bytes, str)): + raise Exception("Expected provider_address_id_ to be a str, received: {}".format(type(provider_address_id_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if provider_network_id_ is not None and not isinstance(provider_network_id_, (bytes, str)): + raise Exception("Expected provider_network_id_ to be a str, received: {}".format(type(provider_network_id_))) + + if provider_space_id_ is not None and not isinstance(provider_space_id_, (bytes, str)): + raise Exception("Expected provider_space_id_ to be a str, received: {}".format(type(provider_space_id_))) + + if provider_subnet_id_ is not None and not isinstance(provider_subnet_id_, (bytes, str)): + raise Exception("Expected provider_subnet_id_ to be a str, received: {}".format(type(provider_subnet_id_))) + + if provider_vlan_id_ is not None and not isinstance(provider_vlan_id_, (bytes, str)): + raise Exception("Expected provider_vlan_id_ to be a str, received: {}".format(type(provider_vlan_id_))) + + if routes_ is not None and not isinstance(routes_, (bytes, str, list)): + raise Exception("Expected routes_ to be a Sequence, received: {}".format(type(routes_))) + + if shadow_addresses_ is not None and not isinstance(shadow_addresses_, (bytes, str, list)): + raise Exception("Expected shadow_addresses_ to be a Sequence, received: {}".format(type(shadow_addresses_))) + + if virtual_port_type_ is not None and not isinstance(virtual_port_type_, (bytes, str)): + raise Exception("Expected virtual_port_type_ to be a str, received: {}".format(type(virtual_port_type_))) + + if vlan_tag_ is not None and not isinstance(vlan_tag_, int): + raise Exception("Expected vlan_tag_ to be a int, received: {}".format(type(vlan_tag_))) + + self.address = address_ + self.addresses = addresses_ + self.cidr = cidr_ + self.config_type = config_type_ + self.device_index = device_index_ + self.disabled = disabled_ + self.dns_search_domains = dns_search_domains_ + self.dns_servers = dns_servers_ + self.gateway_address = gateway_address_ + self.interface_name = interface_name_ + self.interface_type = interface_type_ + self.is_default_gateway = is_default_gateway_ + self.mac_address = mac_address_ + self.mtu = mtu_ + self.no_auto_start = no_auto_start_ + self.origin = origin_ + self.parent_interface_name = parent_interface_name_ + self.provider_address_id = provider_address_id_ + self.provider_id = provider_id_ + self.provider_network_id = provider_network_id_ + self.provider_space_id = provider_space_id_ + self.provider_subnet_id = provider_subnet_id_ + self.provider_vlan_id = provider_vlan_id_ + self.routes = routes_ + self.shadow_addresses = shadow_addresses_ + self.virtual_port_type = virtual_port_type_ + self.vlan_tag = vlan_tag_ + self.unknown_fields = unknown_fields + + + +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] + interface_name : str + mac_address : str + ''' + addresses_ = [InterfaceAddress.from_json(o) for o in addresses or []] + interface_name_ = interface_name + mac_address_ = mac_address + + # Validate arguments against known Juju API types. + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if interface_name_ is not None and not isinstance(interface_name_, (bytes, str)): + raise Exception("Expected interface_name_ to be a str, received: {}".format(type(interface_name_))) + + if mac_address_ is not None and not isinstance(mac_address_, (bytes, str)): + raise Exception("Expected mac_address_ to be a str, received: {}".format(type(mac_address_))) + + self.addresses = addresses_ + self.interface_name = interface_name_ + self.mac_address = mac_address_ + self.unknown_fields = unknown_fields + + + +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] + relation_id : int + unit : str + ''' + bindings_ = bindings + relation_id_ = relation_id + unit_ = unit + + # Validate arguments against known Juju API types. + 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_))) + + self.bindings = bindings_ + self.relation_id = relation_id_ + self.unit = unit_ + self.unknown_fields = 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] + egress_subnets : typing.Sequence[str] + error : Error + ingress_addresses : typing.Sequence[str] + ''' + bind_addresses_ = [NetworkInfo.from_json(o) for o in bind_addresses or []] + egress_subnets_ = egress_subnets + error_ = Error.from_json(error) if error else None + ingress_addresses_ = ingress_addresses + + # Validate arguments against known Juju API types. + if bind_addresses_ is not None and not isinstance(bind_addresses_, (bytes, str, list)): + raise Exception("Expected bind_addresses_ to be a Sequence, received: {}".format(type(bind_addresses_))) + + if egress_subnets_ is not None and not isinstance(egress_subnets_, (bytes, str, list)): + raise Exception("Expected egress_subnets_ to be a Sequence, received: {}".format(type(egress_subnets_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if ingress_addresses_ is not None and not isinstance(ingress_addresses_, (bytes, str, list)): + raise Exception("Expected ingress_addresses_ to be a Sequence, received: {}".format(type(ingress_addresses_))) + + self.bind_addresses = bind_addresses_ + self.egress_subnets = egress_subnets_ + self.error = error_ + self.ingress_addresses = ingress_addresses_ + self.unknown_fields = unknown_fields + + + +class NetworkInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Mapping[str, ~NetworkInfoResult] + ''' + results_ = {k: NetworkInfoResult.from_json(v) for k, v in (results or dict()).items()} + + # Validate arguments against known Juju API types. + if results_ is not None and not isinstance(results_, dict): + raise Exception("Expected results_ to be a Mapping, received: {}".format(type(results_))) + + self.results = results_ + self.unknown_fields = 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] + gateway : str + ip_addresses : typing.Sequence[str] + is_up : bool + mac_address : str + space : str + ''' + dns_nameservers_ = dns_nameservers + gateway_ = gateway + ip_addresses_ = ip_addresses + is_up_ = is_up + mac_address_ = mac_address + space_ = space + + # Validate arguments against known Juju API types. + if dns_nameservers_ is not None and not isinstance(dns_nameservers_, (bytes, str, list)): + raise Exception("Expected dns_nameservers_ to be a Sequence, received: {}".format(type(dns_nameservers_))) + + if gateway_ is not None and not isinstance(gateway_, (bytes, str)): + raise Exception("Expected gateway_ to be a str, received: {}".format(type(gateway_))) + + if ip_addresses_ is not None and not isinstance(ip_addresses_, (bytes, str, list)): + raise Exception("Expected ip_addresses_ to be a Sequence, received: {}".format(type(ip_addresses_))) + + if is_up_ is not None and not isinstance(is_up_, bool): + raise Exception("Expected is_up_ to be a bool, received: {}".format(type(is_up_))) + + if mac_address_ is not None and not isinstance(mac_address_, (bytes, str)): + raise Exception("Expected mac_address_ to be a str, received: {}".format(type(mac_address_))) + + if space_ is not None and not isinstance(space_, (bytes, str)): + raise Exception("Expected space_ to be a str, received: {}".format(type(space_))) + + self.dns_nameservers = dns_nameservers_ + self.gateway = gateway_ + self.ip_addresses = ip_addresses_ + self.is_up = is_up_ + self.mac_address = mac_address_ + self.space = space_ + self.unknown_fields = unknown_fields + + + +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 + gateway_ip : str + metric : int + ''' + destination_cidr_ = destination_cidr + gateway_ip_ = gateway_ip + metric_ = metric + + # Validate arguments against known Juju API types. + if destination_cidr_ is not None and not isinstance(destination_cidr_, (bytes, str)): + raise Exception("Expected destination_cidr_ to be a str, received: {}".format(type(destination_cidr_))) + + if gateway_ip_ is not None and not isinstance(gateway_ip_, (bytes, str)): + raise Exception("Expected gateway_ip_ to be a str, received: {}".format(type(gateway_ip_))) + + if metric_ is not None and not isinstance(metric_, int): + raise Exception("Expected metric_ to be a int, received: {}".format(type(metric_))) + + self.destination_cidr = destination_cidr_ + self.gateway_ip = gateway_ip_ + self.metric = metric_ + self.unknown_fields = unknown_fields + + + +class NotifyWatchResult(Type): + _toSchema = {'error': 'error', 'notifywatcherid': 'NotifyWatcherId'} + _toPy = {'NotifyWatcherId': 'notifywatcherid', 'error': 'error'} + def __init__(self, notifywatcherid=None, error=None, **unknown_fields): + ''' + notifywatcherid : str + error : Error + ''' + notifywatcherid_ = notifywatcherid + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if notifywatcherid_ is not None and not isinstance(notifywatcherid_, (bytes, str)): + raise Exception("Expected notifywatcherid_ to be a str, received: {}".format(type(notifywatcherid_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.notifywatcherid = notifywatcherid_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class NotifyWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~NotifyWatchResult] + ''' + results_ = [NotifyWatchResult.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 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 + major : int + minor : int + patch : int + tag : str + ''' + build_ = build + major_ = major + minor_ = minor + patch_ = patch + tag_ = tag + + # Validate arguments against known Juju API types. + if build_ is not None and not isinstance(build_, int): + raise Exception("Expected build_ to be a int, received: {}".format(type(build_))) + + if major_ is not None and not isinstance(major_, int): + raise Exception("Expected major_ to be a int, received: {}".format(type(major_))) + + if minor_ is not None and not isinstance(minor_, int): + raise Exception("Expected minor_ to be a int, received: {}".format(type(minor_))) + + if patch_ is not None and not isinstance(patch_, int): + raise Exception("Expected patch_ to be a int, received: {}".format(type(patch_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.build = build_ + self.major = major_ + self.minor = minor_ + self.patch = patch_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +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 + macaroons : typing.Sequence[~Macaroon] + offer_uuid : str + ''' + bakery_version_ = bakery_version + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + offer_uuid_ = offer_uuid + + # Validate arguments against known Juju API types. + 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 macaroons_ is not None and not isinstance(macaroons_, (bytes, str, list)): + raise Exception("Expected macaroons_ to be a Sequence, received: {}".format(type(macaroons_))) + + 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_))) + + self.bakery_version = bakery_version_ + self.macaroons = macaroons_ + self.offer_uuid = offer_uuid_ + self.unknown_fields = unknown_fields + + + +class OfferArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~OfferArg] + ''' + args_ = [OfferArg.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 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 + ingress_subnets : typing.Sequence[str] + relation_id : int + source_model_tag : str + status : EntityStatus + username : str + ''' + endpoint_ = endpoint + ingress_subnets_ = ingress_subnets + relation_id_ = relation_id + source_model_tag_ = source_model_tag + status_ = EntityStatus.from_json(status) if status else None + username_ = username + + # Validate arguments against known Juju API types. + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if ingress_subnets_ is not None and not isinstance(ingress_subnets_, (bytes, str, list)): + raise Exception("Expected ingress_subnets_ to be a Sequence, received: {}".format(type(ingress_subnets_))) + + 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 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 status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + if username_ is not None and not isinstance(username_, (bytes, str)): + raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) + + self.endpoint = endpoint_ + self.ingress_subnets = ingress_subnets_ + self.relation_id = relation_id_ + self.source_model_tag = source_model_tag_ + self.status = status_ + self.username = username_ + self.unknown_fields = unknown_fields + + + +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] + application_description : str + application_name : str + application_user : str + connected_users : typing.Sequence[str] + endpoints : typing.Sequence[~EndpointFilterAttributes] + model_name : str + offer_name : str + owner_name : str + ''' + allowed_users_ = allowed_users + application_description_ = application_description + application_name_ = application_name + application_user_ = application_user + connected_users_ = connected_users + endpoints_ = [EndpointFilterAttributes.from_json(o) for o in endpoints or []] + model_name_ = model_name + offer_name_ = offer_name + owner_name_ = owner_name + + # Validate arguments against known Juju API types. + if allowed_users_ is not None and not isinstance(allowed_users_, (bytes, str, list)): + raise Exception("Expected allowed_users_ to be a Sequence, received: {}".format(type(allowed_users_))) + + 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 application_user_ is not None and not isinstance(application_user_, (bytes, str)): + raise Exception("Expected application_user_ to be a str, received: {}".format(type(application_user_))) + + if connected_users_ is not None and not isinstance(connected_users_, (bytes, str, list)): + raise Exception("Expected connected_users_ to be a Sequence, received: {}".format(type(connected_users_))) + + 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 model_name_ is not None and not isinstance(model_name_, (bytes, str)): + raise Exception("Expected model_name_ to be a str, received: {}".format(type(model_name_))) + + 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 owner_name_ is not None and not isinstance(owner_name_, (bytes, str)): + raise Exception("Expected owner_name_ to be a str, received: {}".format(type(owner_name_))) + + self.allowed_users = allowed_users_ + self.application_description = application_description_ + self.application_name = application_name_ + self.application_user = application_user_ + self.connected_users = connected_users_ + self.endpoints = endpoints_ + self.model_name = model_name_ + self.offer_name = offer_name_ + self.owner_name = owner_name_ + self.unknown_fields = unknown_fields + + + +class OfferFilters(Type): + _toSchema = {'filters': 'Filters'} + _toPy = {'Filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): + ''' + filters : typing.Sequence[~OfferFilter] + ''' + filters_ = [OfferFilter.from_json(o) for o in filters or []] + + # Validate arguments against known Juju API types. + if filters_ is not None and not isinstance(filters_, (bytes, str, list)): + raise Exception("Expected filters_ to be a Sequence, received: {}".format(type(filters_))) + + self.filters = filters_ + self.unknown_fields = 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 + status : EntityStatus + ''' + offer_name_ = offer_name + status_ = EntityStatus.from_json(status) if status else None + + # Validate arguments against known Juju API types. + 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 status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + self.offer_name = offer_name_ + self.status = status_ + self.unknown_fields = 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] + error : Error + watcher_id : str + ''' + changes_ = [OfferStatusChange.from_json(o) for o in changes or []] + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class OfferStatusWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~OfferStatusWatchResult] + ''' + results_ = [OfferStatusWatchResult.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 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 + offer_urls : typing.Sequence[str] + ''' + bakery_version_ = bakery_version + offer_urls_ = offer_urls + + # Validate arguments against known Juju API types. + 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_))) + + self.bakery_version = bakery_version_ + self.offer_urls = offer_urls_ + self.unknown_fields = 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 + display_name : str + user : str + ''' + access_ = access + display_name_ = display_name + user_ = user + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if user_ is not None and not isinstance(user_, (bytes, str)): + raise Exception("Expected user_ to be a str, received: {}".format(type(user_))) + + self.access = access_ + self.display_name = display_name_ + self.user = user_ + self.unknown_fields = 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 + unit_port_ranges : typing.Mapping[str, typing.Sequence[~OpenUnitPortRangesByEndpoint]] + ''' + error_ = Error.from_json(error) if error else None + unit_port_ranges_ = {k: OpenUnitPortRangesByEndpoint.from_json(v) for k, v in (unit_port_ranges or dict()).items()} + + # 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 unit_port_ranges_ is not None and not isinstance(unit_port_ranges_, dict): + raise Exception("Expected unit_port_ranges_ to be a Mapping, received: {}".format(type(unit_port_ranges_))) + + self.error = error_ + self.unit_port_ranges = unit_port_ranges_ + self.unknown_fields = unknown_fields + + + +class OpenMachinePortRangesByEndpointResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~OpenMachinePortRangesByEndpointResult] + ''' + results_ = [OpenMachinePortRangesByEndpointResult.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 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 + unit_port_ranges : typing.Mapping[str, typing.Sequence[~OpenUnitPortRanges]] + ''' + error_ = Error.from_json(error) if error else None + unit_port_ranges_ = {k: OpenUnitPortRanges.from_json(v) for k, v in (unit_port_ranges or dict()).items()} + + # 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 unit_port_ranges_ is not None and not isinstance(unit_port_ranges_, dict): + raise Exception("Expected unit_port_ranges_ to be a Mapping, received: {}".format(type(unit_port_ranges_))) + + self.error = error_ + self.unit_port_ranges = unit_port_ranges_ + self.unknown_fields = unknown_fields + + + +class OpenMachinePortRangesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~OpenMachinePortRangesResult] + ''' + results_ = [OpenMachinePortRangesResult.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 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 + port_ranges : typing.Sequence[~PortRange] + subnet_cidrs : typing.Sequence[str] + ''' + endpoint_ = endpoint + port_ranges_ = [PortRange.from_json(o) for o in port_ranges or []] + subnet_cidrs_ = subnet_cidrs + + # Validate arguments against known Juju API types. + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if port_ranges_ is not None and not isinstance(port_ranges_, (bytes, str, list)): + raise Exception("Expected port_ranges_ to be a Sequence, received: {}".format(type(port_ranges_))) + + if subnet_cidrs_ is not None and not isinstance(subnet_cidrs_, (bytes, str, list)): + raise Exception("Expected subnet_cidrs_ to be a Sequence, received: {}".format(type(subnet_cidrs_))) + + self.endpoint = endpoint_ + self.port_ranges = port_ranges_ + self.subnet_cidrs = subnet_cidrs_ + self.unknown_fields = unknown_fields + + + +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 + port_ranges : typing.Sequence[~PortRange] + ''' + endpoint_ = endpoint + port_ranges_ = [PortRange.from_json(o) for o in port_ranges or []] + + # Validate arguments against known Juju API types. + if endpoint_ is not None and not isinstance(endpoint_, (bytes, str)): + raise Exception("Expected endpoint_ to be a str, received: {}".format(type(endpoint_))) + + if port_ranges_ is not None and not isinstance(port_ranges_, (bytes, str, list)): + raise Exception("Expected port_ranges_ to be a Sequence, received: {}".format(type(port_ranges_))) + + self.endpoint = endpoint_ + self.port_ranges = port_ranges_ + self.unknown_fields = 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] + applications : typing.Sequence[str] + limit : int + machines : typing.Sequence[str] + offset : int + status : typing.Sequence[str] + units : typing.Sequence[str] + ''' + actions_ = actions + applications_ = applications + limit_ = limit + machines_ = machines + offset_ = offset + status_ = status + units_ = units + + # Validate arguments against known Juju API types. + 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_))) + + self.actions = actions_ + self.applications = applications_ + self.limit = limit_ + self.machines = machines_ + self.offset = offset_ + self.status = status_ + self.units = units_ + self.unknown_fields = unknown_fields + + + +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] + completed : str + enqueued : str + error : Error + fail : str + operation : str + started : str + status : str + summary : str + ''' + actions_ = [ActionResult.from_json(o) for o in actions or []] + completed_ = completed + enqueued_ = enqueued + error_ = Error.from_json(error) if error else None + fail_ = fail + operation_ = operation + started_ = started + status_ = status + summary_ = summary + + # Validate arguments against known Juju API types. + 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 completed_ is not None and not isinstance(completed_, (bytes, str)): + raise Exception("Expected completed_ to be a str, received: {}".format(type(completed_))) + + if enqueued_ is not None and not isinstance(enqueued_, (bytes, str)): + raise Exception("Expected enqueued_ to be a str, received: {}".format(type(enqueued_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if fail_ is not None and not isinstance(fail_, (bytes, str)): + raise Exception("Expected fail_ to be a str, received: {}".format(type(fail_))) + + if operation_ is not None and not isinstance(operation_, (bytes, str)): + raise Exception("Expected operation_ to be a str, received: {}".format(type(operation_))) + + if started_ is not None and not isinstance(started_, (bytes, str)): + raise Exception("Expected started_ to be a str, received: {}".format(type(started_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if summary_ is not None and not isinstance(summary_, (bytes, str)): + raise Exception("Expected summary_ to be a str, received: {}".format(type(summary_))) + + self.actions = actions_ + self.completed = completed_ + self.enqueued = enqueued_ + self.error = error_ + self.fail = fail_ + self.operation = operation_ + self.started = started_ + self.status = status_ + self.summary = summary_ + self.unknown_fields = unknown_fields + + + +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] + truncated : bool + ''' + results_ = [OperationResult.from_json(o) for o in results or []] + truncated_ = truncated + + # 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_))) + + if truncated_ is not None and not isinstance(truncated_, bool): + raise Exception("Expected truncated_ to be a bool, received: {}".format(type(truncated_))) + + self.results = results_ + self.truncated = truncated_ + self.unknown_fields = unknown_fields + + + +class OperatorProvisioningInfo(Type): + _toSchema = {'api_addresses': 'api-addresses', 'charm_storage': 'charm-storage', 'error': 'error', 'image_details': 'image-details', 'tags': 'tags', 'version': 'version'} + _toPy = {'api-addresses': 'api_addresses', 'charm-storage': 'charm_storage', 'error': 'error', 'image-details': 'image_details', 'tags': 'tags', 'version': 'version'} + def __init__(self, api_addresses=None, charm_storage=None, error=None, image_details=None, tags=None, version=None, **unknown_fields): + ''' + api_addresses : typing.Sequence[str] + charm_storage : KubernetesFilesystemParams + error : Error + image_details : DockerImageInfo + tags : typing.Mapping[str, str] + version : Number + ''' + api_addresses_ = api_addresses + charm_storage_ = KubernetesFilesystemParams.from_json(charm_storage) if charm_storage else None + error_ = Error.from_json(error) if error else None + image_details_ = DockerImageInfo.from_json(image_details) if image_details else None + tags_ = tags + version_ = Number.from_json(version) if version else None + + # Validate arguments against known Juju API types. + if api_addresses_ is not None and not isinstance(api_addresses_, (bytes, str, list)): + raise Exception("Expected api_addresses_ to be a Sequence, received: {}".format(type(api_addresses_))) + + if charm_storage_ is not None and not isinstance(charm_storage_, (dict, KubernetesFilesystemParams)): + raise Exception("Expected charm_storage_ to be a KubernetesFilesystemParams, received: {}".format(type(charm_storage_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if image_details_ is not None and not isinstance(image_details_, (dict, DockerImageInfo)): + raise Exception("Expected image_details_ to be a DockerImageInfo, received: {}".format(type(image_details_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if version_ is not None and not isinstance(version_, (dict, Number)): + raise Exception("Expected version_ to be a Number, received: {}".format(type(version_))) + + self.api_addresses = api_addresses_ + self.charm_storage = charm_storage_ + self.error = error_ + self.image_details = image_details_ + self.tags = tags_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class OperatorProvisioningInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~OperatorProvisioningInfo] + ''' + results_ = [OperatorProvisioningInfo.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 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 + id_ : str + labels : typing.Sequence[str] + machine : str + status : str + type_ : str + unit : str + ''' + class__ = class_ + id__ = id_ + labels_ = labels + machine_ = machine + status_ = status + type__ = type_ + unit_ = unit + + # Validate arguments against known Juju API types. + if class__ is not None and not isinstance(class__, (bytes, str)): + raise Exception("Expected class__ to be a str, received: {}".format(type(class__))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if labels_ is not None and not isinstance(labels_, (bytes, str, list)): + raise Exception("Expected labels_ to be a Sequence, received: {}".format(type(labels_))) + + if machine_ is not None and not isinstance(machine_, (bytes, str)): + raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if unit_ is not None and not isinstance(unit_, (bytes, str)): + raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + + self.class_ = class__ + self.id_ = id__ + self.labels = labels_ + self.machine = machine_ + self.status = status_ + self.type_ = type__ + self.unit = unit_ + self.unknown_fields = unknown_fields + + + +class PayloadListArgs(Type): + _toSchema = {'patterns': 'patterns'} + _toPy = {'patterns': 'patterns'} + def __init__(self, patterns=None, **unknown_fields): + ''' + patterns : typing.Sequence[str] + ''' + patterns_ = patterns + + # Validate arguments against known Juju API types. + if patterns_ is not None and not isinstance(patterns_, (bytes, str, list)): + raise Exception("Expected patterns_ to be a Sequence, received: {}".format(type(patterns_))) + + self.patterns = patterns_ + self.unknown_fields = unknown_fields + + + +class PayloadListResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~Payload] + ''' + results_ = [Payload.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 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 + error : Error + not_found : bool + payload : Payload + tag : str + ''' + entity_ = Entity.from_json(entity) if entity else None + error_ = Error.from_json(error) if error else None + not_found_ = not_found + payload_ = Payload.from_json(payload) if payload else None + tag_ = tag + + # Validate arguments against known Juju API types. + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if not_found_ is not None and not isinstance(not_found_, bool): + raise Exception("Expected not_found_ to be a bool, received: {}".format(type(not_found_))) + + if payload_ is not None and not isinstance(payload_, (dict, Payload)): + raise Exception("Expected payload_ to be a Payload, received: {}".format(type(payload_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.entity = entity_ + self.error = error_ + self.not_found = not_found_ + self.payload = payload_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class PayloadResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~PayloadResult] + ''' + results_ = [PayloadResult.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 PhaseResult(Type): + _toSchema = {'error': 'error', 'phase': 'phase'} + _toPy = {'error': 'error', 'phase': 'phase'} + def __init__(self, error=None, phase=None, **unknown_fields): + ''' + error : Error + phase : str + ''' + error_ = Error.from_json(error) if error else None + phase_ = phase + + # 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 phase_ is not None and not isinstance(phase_, (bytes, str)): + raise Exception("Expected phase_ to be a str, received: {}".format(type(phase_))) + + self.error = error_ + self.phase = phase_ + self.unknown_fields = unknown_fields + + + +class PhaseResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~PhaseResult] + ''' + results_ = [PhaseResult.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 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 + error : Error + ''' + application_name_ = application_name + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.application_name = application_name_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class PinApplicationsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~PinApplicationResult] + ''' + results_ = [PinApplicationResult.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 PinnedLeadershipResult(Type): + _toSchema = {'result': 'result'} + _toPy = {'result': 'result'} + def __init__(self, result=None, **unknown_fields): + ''' + result : typing.Mapping[str, typing.Sequence[str]] + ''' + result_ = result + + # Validate arguments against known Juju API types. + if result_ is not None and not isinstance(result_, dict): + raise Exception("Expected result_ to be a Mapping, received: {}".format(type(result_))) + + self.result = result_ + self.unknown_fields = 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 + scope : str + ''' + directive_ = directive + scope_ = scope + + # Validate arguments against known Juju API types. + if directive_ is not None and not isinstance(directive_, (bytes, str)): + raise Exception("Expected directive_ to be a str, received: {}".format(type(directive_))) + + if scope_ is not None and not isinstance(scope_, (bytes, str)): + raise Exception("Expected scope_ to be a str, received: {}".format(type(scope_))) + + self.directive = directive_ + self.scope = scope_ + self.unknown_fields = unknown_fields + + + +class Platform(Type): + _toSchema = {'architecture': 'architecture', 'os': 'os', 'series': 'series'} + _toPy = {'architecture': 'architecture', 'os': 'os', 'series': 'series'} + def __init__(self, architecture=None, os=None, series=None, **unknown_fields): + ''' + architecture : str + os : str + series : str + ''' + architecture_ = architecture + os_ = os + series_ = series + + # Validate arguments against known Juju API types. + if architecture_ is not None and not isinstance(architecture_, (bytes, str)): + raise Exception("Expected architecture_ to be a str, received: {}".format(type(architecture_))) + + if os_ is not None and not isinstance(os_, (bytes, str)): + raise Exception("Expected os_ to be a str, received: {}".format(type(os_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + self.architecture = architecture_ + self.os = os_ + self.series = series_ + self.unknown_fields = 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 + tag : str + ''' + spec_ = spec + tag_ = tag + + # Validate arguments against known Juju API types. + if spec_ is not None and not isinstance(spec_, (bytes, str)): + raise Exception("Expected spec_ to be a str, received: {}".format(type(spec_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.spec = spec_ + self.tag = tag_ + self.unknown_fields = 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 + protocol : str + to_port : int + ''' + from_port_ = from_port + protocol_ = protocol + to_port_ = to_port + + # Validate arguments against known Juju API types. + if from_port_ is not None and not isinstance(from_port_, int): + raise Exception("Expected from_port_ to be a int, received: {}".format(type(from_port_))) + + if protocol_ is not None and not isinstance(protocol_, (bytes, str)): + raise Exception("Expected protocol_ to be a str, received: {}".format(type(protocol_))) + + if to_port_ is not None and not isinstance(to_port_, int): + raise Exception("Expected to_port_ to be a int, received: {}".format(type(to_port_))) + + self.from_port = from_port_ + self.protocol = protocol_ + self.to_port = to_port_ + self.unknown_fields = unknown_fields + + + +class PrivateAddress(Type): + _toSchema = {'target': 'target'} + _toPy = {'target': 'target'} + def __init__(self, target=None, **unknown_fields): + ''' + target : str + ''' + target_ = target + + # Validate arguments against known Juju API types. + if target_ is not None and not isinstance(target_, (bytes, str)): + raise Exception("Expected target_ to be a str, received: {}".format(type(target_))) + + self.target = target_ + self.unknown_fields = unknown_fields + + + +class PrivateAddressResults(Type): + _toSchema = {'private_address': 'private-address'} + _toPy = {'private-address': 'private_address'} + def __init__(self, private_address=None, **unknown_fields): + ''' + private_address : str + ''' + private_address_ = private_address + + # Validate arguments against known Juju API types. + if private_address_ is not None and not isinstance(private_address_, (bytes, str)): + raise Exception("Expected private_address_ to be a str, received: {}".format(type(private_address_))) + + self.private_address = private_address_ + self.unknown_fields = 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 + ''' + controller_alias_ = controller_alias + + # Validate arguments against known Juju API types. + 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_))) + + self.controller_alias = controller_alias_ + self.unknown_fields = unknown_fields + + + +class ProfileChangeResult(Type): + _toSchema = {'error': 'error', 'new_profile_name': 'new-profile-name', 'old_profile_name': 'old-profile-name', 'profile': 'profile', 'subordinate': 'subordinate'} + _toPy = {'error': 'error', 'new-profile-name': 'new_profile_name', 'old-profile-name': 'old_profile_name', 'profile': 'profile', 'subordinate': 'subordinate'} + def __init__(self, error=None, new_profile_name=None, old_profile_name=None, profile=None, subordinate=None, **unknown_fields): + ''' + error : Error + new_profile_name : str + old_profile_name : str + profile : CharmLXDProfile + subordinate : bool + ''' + error_ = Error.from_json(error) if error else None + new_profile_name_ = new_profile_name + old_profile_name_ = old_profile_name + profile_ = CharmLXDProfile.from_json(profile) if profile else None + subordinate_ = subordinate + + # 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 new_profile_name_ is not None and not isinstance(new_profile_name_, (bytes, str)): + raise Exception("Expected new_profile_name_ to be a str, received: {}".format(type(new_profile_name_))) + + if old_profile_name_ is not None and not isinstance(old_profile_name_, (bytes, str)): + raise Exception("Expected old_profile_name_ to be a str, received: {}".format(type(old_profile_name_))) + + if profile_ is not None and not isinstance(profile_, (dict, CharmLXDProfile)): + raise Exception("Expected profile_ to be a CharmLXDProfile, received: {}".format(type(profile_))) + + if subordinate_ is not None and not isinstance(subordinate_, bool): + raise Exception("Expected subordinate_ to be a bool, received: {}".format(type(subordinate_))) + + self.error = error_ + self.new_profile_name = new_profile_name_ + self.old_profile_name = old_profile_name_ + self.profile = profile_ + self.subordinate = subordinate_ + self.unknown_fields = unknown_fields + + + +class ProfileChangeResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ProfileChangeResult] + ''' + results_ = [ProfileChangeResult.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 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 + error : Error + profile : CharmLXDProfile + revision : int + ''' + application_name_ = application_name + error_ = Error.from_json(error) if error else None + profile_ = CharmLXDProfile.from_json(profile) if profile else None + revision_ = revision + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if profile_ is not None and not isinstance(profile_, (dict, CharmLXDProfile)): + raise Exception("Expected profile_ to be a CharmLXDProfile, received: {}".format(type(profile_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + self.application_name = application_name_ + self.error = error_ + self.profile = profile_ + self.revision = revision_ + self.unknown_fields = unknown_fields + + + +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 + mac_address : str + provider_id : str + ''' + interface_name_ = interface_name + mac_address_ = mac_address + provider_id_ = provider_id + + # Validate arguments against known Juju API types. + if interface_name_ is not None and not isinstance(interface_name_, (bytes, str)): + raise Exception("Expected interface_name_ to be a str, received: {}".format(type(interface_name_))) + + if mac_address_ is not None and not isinstance(mac_address_, (bytes, str)): + raise Exception("Expected mac_address_ to be a str, received: {}".format(type(mac_address_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + self.interface_name = interface_name_ + self.mac_address = mac_address_ + self.provider_id = provider_id_ + self.unknown_fields = unknown_fields + + + +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 + interfaces : typing.Sequence[~ProviderInterfaceInfo] + machine_tag : str + ''' + error_ = Error.from_json(error) if error else None + interfaces_ = [ProviderInterfaceInfo.from_json(o) for o in interfaces or []] + machine_tag_ = machine_tag + + # 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 interfaces_ is not None and not isinstance(interfaces_, (bytes, str, list)): + raise Exception("Expected interfaces_ to be a Sequence, received: {}".format(type(interfaces_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + self.error = error_ + self.interfaces = interfaces_ + self.machine_tag = machine_tag_ + self.unknown_fields = unknown_fields + + + +class ProviderInterfaceInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ProviderInterfaceInfoResult] + ''' + results_ = [ProviderInterfaceInfoResult.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 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] + tag : str + ''' + config_ = [NetworkConfig.from_json(o) for o in config or []] + tag_ = tag + + # Validate arguments against known Juju API types. + 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_))) + + self.config = config_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class ProviderSpace(Type): + _toSchema = {'error': 'error', 'name': 'name', 'provider_id': 'provider-id', 'subnets': 'subnets'} + _toPy = {'error': 'error', 'name': 'name', 'provider-id': 'provider_id', 'subnets': 'subnets'} + def __init__(self, error=None, name=None, provider_id=None, subnets=None, **unknown_fields): + ''' + error : Error + name : str + provider_id : str + subnets : typing.Sequence[~Subnet] + ''' + error_ = Error.from_json(error) if error else None + name_ = name + provider_id_ = provider_id + subnets_ = [Subnet.from_json(o) for o in subnets or []] + + # 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 name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): + raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) + + self.error = error_ + self.name = name_ + self.provider_id = provider_id_ + self.subnets = subnets_ + self.unknown_fields = unknown_fields + + + +class ProvisioningInfo(Type): + _toSchema = {'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', 'series': 'series', 'subnets_to_zones': 'subnets-to-zones', 'tags': 'tags', 'volume_attachments': 'volume-attachments', 'volumes': 'volumes'} + _toPy = {'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', 'series': 'series', 'subnets-to-zones': 'subnets_to_zones', 'tags': 'tags', 'volume-attachments': 'volume_attachments', 'volumes': 'volumes'} + def __init__(self, charm_lxd_profiles=None, cloudinit_userdata=None, constraints=None, controller_config=None, endpoint_bindings=None, image_metadata=None, jobs=None, placement=None, series=None, subnets_to_zones=None, tags=None, volume_attachments=None, volumes=None, **unknown_fields): + ''' + charm_lxd_profiles : typing.Sequence[str] + cloudinit_userdata : typing.Mapping[str, typing.Any] + constraints : Value + controller_config : typing.Mapping[str, typing.Any] + endpoint_bindings : typing.Mapping[str, str] + image_metadata : typing.Sequence[~CloudImageMetadata] + jobs : typing.Sequence[str] + placement : str + series : str + subnets_to_zones : typing.Mapping[str, typing.Sequence[str]] + tags : typing.Mapping[str, str] + volume_attachments : typing.Sequence[~VolumeAttachmentParams] + volumes : typing.Sequence[~VolumeParams] + ''' + charm_lxd_profiles_ = charm_lxd_profiles + cloudinit_userdata_ = cloudinit_userdata + constraints_ = Value.from_json(constraints) if constraints else None + controller_config_ = controller_config + endpoint_bindings_ = endpoint_bindings + image_metadata_ = [CloudImageMetadata.from_json(o) for o in image_metadata or []] + jobs_ = jobs + placement_ = placement + series_ = series + subnets_to_zones_ = subnets_to_zones + tags_ = tags + volume_attachments_ = [VolumeAttachmentParams.from_json(o) for o in volume_attachments or []] + volumes_ = [VolumeParams.from_json(o) for o in volumes or []] + + # Validate arguments against known Juju API types. + if charm_lxd_profiles_ is not None and not isinstance(charm_lxd_profiles_, (bytes, str, list)): + raise Exception("Expected charm_lxd_profiles_ to be a Sequence, received: {}".format(type(charm_lxd_profiles_))) + + if cloudinit_userdata_ is not None and not isinstance(cloudinit_userdata_, dict): + raise Exception("Expected cloudinit_userdata_ to be a Mapping, received: {}".format(type(cloudinit_userdata_))) + + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if controller_config_ is not None and not isinstance(controller_config_, dict): + raise Exception("Expected controller_config_ to be a Mapping, received: {}".format(type(controller_config_))) + + 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 image_metadata_ is not None and not isinstance(image_metadata_, (bytes, str, list)): + raise Exception("Expected image_metadata_ to be a Sequence, received: {}".format(type(image_metadata_))) + + if jobs_ is not None and not isinstance(jobs_, (bytes, str, list)): + raise Exception("Expected jobs_ to be a Sequence, received: {}".format(type(jobs_))) + + if placement_ is not None and not isinstance(placement_, (bytes, str)): + raise Exception("Expected placement_ to be a str, received: {}".format(type(placement_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if subnets_to_zones_ is not None and not isinstance(subnets_to_zones_, dict): + raise Exception("Expected subnets_to_zones_ to be a Mapping, received: {}".format(type(subnets_to_zones_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + 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_))) + + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.charm_lxd_profiles = charm_lxd_profiles_ + self.cloudinit_userdata = cloudinit_userdata_ + self.constraints = constraints_ + self.controller_config = controller_config_ + self.endpoint_bindings = endpoint_bindings_ + self.image_metadata = image_metadata_ + self.jobs = jobs_ + self.placement = placement_ + self.series = series_ + self.subnets_to_zones = subnets_to_zones_ + self.tags = tags_ + self.volume_attachments = volume_attachments_ + self.volumes = volumes_ + self.unknown_fields = unknown_fields + + + +class ProvisioningInfoBase(Type): + _toSchema = {'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', 'series': 'series', 'tags': 'tags', 'volume_attachments': 'volume-attachments', 'volumes': 'volumes'} + _toPy = {'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', 'series': 'series', 'tags': 'tags', 'volume-attachments': 'volume_attachments', 'volumes': 'volumes'} + def __init__(self, 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, series=None, tags=None, volume_attachments=None, volumes=None, **unknown_fields): + ''' + charm_lxd_profiles : typing.Sequence[str] + cloudinit_userdata : typing.Mapping[str, typing.Any] + constraints : Value + controller_config : typing.Mapping[str, typing.Any] + endpoint_bindings : typing.Mapping[str, str] + image_metadata : typing.Sequence[~CloudImageMetadata] + jobs : typing.Sequence[str] + placement : str + root_disk : VolumeParams + series : str + tags : typing.Mapping[str, str] + volume_attachments : typing.Sequence[~VolumeAttachmentParams] + volumes : typing.Sequence[~VolumeParams] + ''' + charm_lxd_profiles_ = charm_lxd_profiles + cloudinit_userdata_ = cloudinit_userdata + constraints_ = Value.from_json(constraints) if constraints else None + controller_config_ = controller_config + endpoint_bindings_ = endpoint_bindings + image_metadata_ = [CloudImageMetadata.from_json(o) for o in image_metadata or []] + jobs_ = jobs + placement_ = placement + root_disk_ = VolumeParams.from_json(root_disk) if root_disk else None + series_ = series + tags_ = tags + volume_attachments_ = [VolumeAttachmentParams.from_json(o) for o in volume_attachments or []] + volumes_ = [VolumeParams.from_json(o) for o in volumes or []] + + # Validate arguments against known Juju API types. + if charm_lxd_profiles_ is not None and not isinstance(charm_lxd_profiles_, (bytes, str, list)): + raise Exception("Expected charm_lxd_profiles_ to be a Sequence, received: {}".format(type(charm_lxd_profiles_))) + + if cloudinit_userdata_ is not None and not isinstance(cloudinit_userdata_, dict): + raise Exception("Expected cloudinit_userdata_ to be a Mapping, received: {}".format(type(cloudinit_userdata_))) + + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if controller_config_ is not None and not isinstance(controller_config_, dict): + raise Exception("Expected controller_config_ to be a Mapping, received: {}".format(type(controller_config_))) + + 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 image_metadata_ is not None and not isinstance(image_metadata_, (bytes, str, list)): + raise Exception("Expected image_metadata_ to be a Sequence, received: {}".format(type(image_metadata_))) + + if jobs_ is not None and not isinstance(jobs_, (bytes, str, list)): + raise Exception("Expected jobs_ to be a Sequence, received: {}".format(type(jobs_))) + + if placement_ is not None and not isinstance(placement_, (bytes, str)): + raise Exception("Expected placement_ to be a str, received: {}".format(type(placement_))) + + if root_disk_ is not None and not isinstance(root_disk_, (dict, VolumeParams)): + raise Exception("Expected root_disk_ to be a VolumeParams, received: {}".format(type(root_disk_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + 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_))) + + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.charm_lxd_profiles = charm_lxd_profiles_ + self.cloudinit_userdata = cloudinit_userdata_ + self.constraints = constraints_ + self.controller_config = controller_config_ + self.endpoint_bindings = endpoint_bindings_ + self.image_metadata = image_metadata_ + self.jobs = jobs_ + self.placement = placement_ + self.root_disk = root_disk_ + self.series = series_ + self.tags = tags_ + self.volume_attachments = volume_attachments_ + self.volumes = volumes_ + self.unknown_fields = unknown_fields + + + +class ProvisioningInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ProvisioningInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = ProvisioningInfo.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, ProvisioningInfo)): + raise Exception("Expected result_ to be a ProvisioningInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ProvisioningInfoResultV10(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : ProvisioningInfoV10 + ''' + error_ = Error.from_json(error) if error else None + result_ = ProvisioningInfoV10.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, ProvisioningInfoV10)): + raise Exception("Expected result_ to be a ProvisioningInfoV10, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class ProvisioningInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ProvisioningInfoResult] + ''' + results_ = [ProvisioningInfoResult.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 ProvisioningInfoResultsV10(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ProvisioningInfoResultV10] + ''' + results_ = [ProvisioningInfoResultV10.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 ProvisioningInfoV10(Type): + _toSchema = {'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', 'provisioninginfobase': 'ProvisioningInfoBase', 'provisioningnetworktopology': 'ProvisioningNetworkTopology', 'root_disk': 'root-disk', 'series': 'series', 'space_subnets': 'space-subnets', 'subnet_zones': 'subnet-zones', 'tags': 'tags', 'volume_attachments': 'volume-attachments', 'volumes': 'volumes'} + _toPy = {'ProvisioningInfoBase': 'provisioninginfobase', 'ProvisioningNetworkTopology': 'provisioningnetworktopology', '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', 'series': 'series', 'space-subnets': 'space_subnets', 'subnet-zones': 'subnet_zones', 'tags': 'tags', 'volume-attachments': 'volume_attachments', 'volumes': 'volumes'} + def __init__(self, provisioninginfobase=None, provisioningnetworktopology=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, series=None, space_subnets=None, subnet_zones=None, tags=None, volume_attachments=None, volumes=None, **unknown_fields): + ''' + provisioninginfobase : ProvisioningInfoBase + provisioningnetworktopology : ProvisioningNetworkTopology + charm_lxd_profiles : typing.Sequence[str] + cloudinit_userdata : typing.Mapping[str, typing.Any] + constraints : Value + controller_config : typing.Mapping[str, typing.Any] + endpoint_bindings : typing.Mapping[str, str] + image_metadata : typing.Sequence[~CloudImageMetadata] + jobs : typing.Sequence[str] + placement : str + root_disk : VolumeParams + series : str + space_subnets : typing.Mapping[str, typing.Sequence[str]] + subnet_zones : typing.Mapping[str, typing.Sequence[str]] + tags : typing.Mapping[str, str] + volume_attachments : typing.Sequence[~VolumeAttachmentParams] + volumes : typing.Sequence[~VolumeParams] + ''' + provisioninginfobase_ = ProvisioningInfoBase.from_json(provisioninginfobase) if provisioninginfobase else None + provisioningnetworktopology_ = ProvisioningNetworkTopology.from_json(provisioningnetworktopology) if provisioningnetworktopology else None + charm_lxd_profiles_ = charm_lxd_profiles + cloudinit_userdata_ = cloudinit_userdata + constraints_ = Value.from_json(constraints) if constraints else None + controller_config_ = controller_config + endpoint_bindings_ = endpoint_bindings + image_metadata_ = [CloudImageMetadata.from_json(o) for o in image_metadata or []] + jobs_ = jobs + placement_ = placement + root_disk_ = VolumeParams.from_json(root_disk) if root_disk else None + series_ = series + space_subnets_ = space_subnets + subnet_zones_ = subnet_zones + tags_ = tags + volume_attachments_ = [VolumeAttachmentParams.from_json(o) for o in volume_attachments or []] + volumes_ = [VolumeParams.from_json(o) for o in volumes or []] + + # Validate arguments against known Juju API types. + if provisioninginfobase_ is not None and not isinstance(provisioninginfobase_, (dict, ProvisioningInfoBase)): + raise Exception("Expected provisioninginfobase_ to be a ProvisioningInfoBase, received: {}".format(type(provisioninginfobase_))) + + if provisioningnetworktopology_ is not None and not isinstance(provisioningnetworktopology_, (dict, ProvisioningNetworkTopology)): + raise Exception("Expected provisioningnetworktopology_ to be a ProvisioningNetworkTopology, received: {}".format(type(provisioningnetworktopology_))) + + if charm_lxd_profiles_ is not None and not isinstance(charm_lxd_profiles_, (bytes, str, list)): + raise Exception("Expected charm_lxd_profiles_ to be a Sequence, received: {}".format(type(charm_lxd_profiles_))) + + if cloudinit_userdata_ is not None and not isinstance(cloudinit_userdata_, dict): + raise Exception("Expected cloudinit_userdata_ to be a Mapping, received: {}".format(type(cloudinit_userdata_))) + + if constraints_ is not None and not isinstance(constraints_, (dict, Value)): + raise Exception("Expected constraints_ to be a Value, received: {}".format(type(constraints_))) + + if controller_config_ is not None and not isinstance(controller_config_, dict): + raise Exception("Expected controller_config_ to be a Mapping, received: {}".format(type(controller_config_))) + + 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 image_metadata_ is not None and not isinstance(image_metadata_, (bytes, str, list)): + raise Exception("Expected image_metadata_ to be a Sequence, received: {}".format(type(image_metadata_))) + + if jobs_ is not None and not isinstance(jobs_, (bytes, str, list)): + raise Exception("Expected jobs_ to be a Sequence, received: {}".format(type(jobs_))) + + if placement_ is not None and not isinstance(placement_, (bytes, str)): + raise Exception("Expected placement_ to be a str, received: {}".format(type(placement_))) + + if root_disk_ is not None and not isinstance(root_disk_, (dict, VolumeParams)): + raise Exception("Expected root_disk_ to be a VolumeParams, received: {}".format(type(root_disk_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if space_subnets_ is not None and not isinstance(space_subnets_, dict): + raise Exception("Expected space_subnets_ to be a Mapping, received: {}".format(type(space_subnets_))) + + if subnet_zones_ is not None and not isinstance(subnet_zones_, dict): + raise Exception("Expected subnet_zones_ to be a Mapping, received: {}".format(type(subnet_zones_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + 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_))) + + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.provisioninginfobase = provisioninginfobase_ + self.provisioningnetworktopology = provisioningnetworktopology_ + self.charm_lxd_profiles = charm_lxd_profiles_ + self.cloudinit_userdata = cloudinit_userdata_ + self.constraints = constraints_ + self.controller_config = controller_config_ + self.endpoint_bindings = endpoint_bindings_ + self.image_metadata = image_metadata_ + self.jobs = jobs_ + self.placement = placement_ + self.root_disk = root_disk_ + self.series = series_ + self.space_subnets = space_subnets_ + self.subnet_zones = subnet_zones_ + self.tags = tags_ + self.volume_attachments = volume_attachments_ + self.volumes = volumes_ + self.unknown_fields = 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]] + subnet_zones : typing.Mapping[str, typing.Sequence[str]] + ''' + space_subnets_ = space_subnets + subnet_zones_ = subnet_zones + + # Validate arguments against known Juju API types. + if space_subnets_ is not None and not isinstance(space_subnets_, dict): + raise Exception("Expected space_subnets_ to be a Mapping, received: {}".format(type(space_subnets_))) + + if subnet_zones_ is not None and not isinstance(subnet_zones_, dict): + raise Exception("Expected subnet_zones_ to be a Mapping, received: {}".format(type(subnet_zones_))) + + self.space_subnets = space_subnets_ + self.subnet_zones = subnet_zones_ + self.unknown_fields = 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 + disable_package_commands : bool + machine_id : str + nonce : str + ''' + data_dir_ = data_dir + disable_package_commands_ = disable_package_commands + machine_id_ = machine_id + nonce_ = nonce + + # Validate arguments against known Juju API types. + 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_))) + + self.data_dir = data_dir_ + self.disable_package_commands = disable_package_commands_ + self.machine_id = machine_id_ + self.nonce = nonce_ + self.unknown_fields = unknown_fields + + + +class ProvisioningScriptResult(Type): + _toSchema = {'script': 'script'} + _toPy = {'script': 'script'} + def __init__(self, script=None, **unknown_fields): + ''' + script : str + ''' + script_ = script + + # Validate arguments against known Juju API types. + if script_ is not None and not isinstance(script_, (bytes, str)): + raise Exception("Expected script_ to be a str, received: {}".format(type(script_))) + + self.script = script_ + self.unknown_fields = 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 + http : str + https : str + no_proxy : str + ''' + ftp_ = ftp + http_ = http + https_ = https + no_proxy_ = no_proxy + + # Validate arguments against known Juju API types. + if ftp_ is not None and not isinstance(ftp_, (bytes, str)): + raise Exception("Expected ftp_ to be a str, received: {}".format(type(ftp_))) + + if http_ is not None and not isinstance(http_, (bytes, str)): + raise Exception("Expected http_ to be a str, received: {}".format(type(http_))) + + if https_ is not None and not isinstance(https_, (bytes, str)): + raise Exception("Expected https_ to be a str, received: {}".format(type(https_))) + + if no_proxy_ is not None and not isinstance(no_proxy_, (bytes, str)): + raise Exception("Expected no_proxy_ to be a str, received: {}".format(type(no_proxy_))) + + self.ftp = ftp_ + self.http = http_ + self.https = https_ + self.no_proxy = no_proxy_ + self.unknown_fields = unknown_fields + + + +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 + apt_proxy_settings : ProxyConfig + error : Error + juju_proxy_settings : ProxyConfig + legacy_proxy_settings : ProxyConfig + snap_proxy_settings : ProxyConfig + snap_store_assertions : str + snap_store_id : str + snap_store_proxy_url : str + ''' + apt_mirror_ = apt_mirror + apt_proxy_settings_ = ProxyConfig.from_json(apt_proxy_settings) if apt_proxy_settings else None + error_ = Error.from_json(error) if error else None + juju_proxy_settings_ = ProxyConfig.from_json(juju_proxy_settings) if juju_proxy_settings else None + legacy_proxy_settings_ = ProxyConfig.from_json(legacy_proxy_settings) if legacy_proxy_settings else None + snap_proxy_settings_ = ProxyConfig.from_json(snap_proxy_settings) if snap_proxy_settings else None + snap_store_assertions_ = snap_store_assertions + snap_store_id_ = snap_store_id + snap_store_proxy_url_ = snap_store_proxy_url + + # Validate arguments against known Juju API types. + if apt_mirror_ is not None and not isinstance(apt_mirror_, (bytes, str)): + raise Exception("Expected apt_mirror_ to be a str, received: {}".format(type(apt_mirror_))) + + if apt_proxy_settings_ is not None and not isinstance(apt_proxy_settings_, (dict, ProxyConfig)): + raise Exception("Expected apt_proxy_settings_ to be a ProxyConfig, received: {}".format(type(apt_proxy_settings_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if juju_proxy_settings_ is not None and not isinstance(juju_proxy_settings_, (dict, ProxyConfig)): + raise Exception("Expected juju_proxy_settings_ to be a ProxyConfig, received: {}".format(type(juju_proxy_settings_))) + + if legacy_proxy_settings_ is not None and not isinstance(legacy_proxy_settings_, (dict, ProxyConfig)): + raise Exception("Expected legacy_proxy_settings_ to be a ProxyConfig, received: {}".format(type(legacy_proxy_settings_))) + + if snap_proxy_settings_ is not None and not isinstance(snap_proxy_settings_, (dict, ProxyConfig)): + raise Exception("Expected snap_proxy_settings_ to be a ProxyConfig, received: {}".format(type(snap_proxy_settings_))) + + if snap_store_assertions_ is not None and not isinstance(snap_store_assertions_, (bytes, str)): + raise Exception("Expected snap_store_assertions_ to be a str, received: {}".format(type(snap_store_assertions_))) + + if snap_store_id_ is not None and not isinstance(snap_store_id_, (bytes, str)): + raise Exception("Expected snap_store_id_ to be a str, received: {}".format(type(snap_store_id_))) + + if snap_store_proxy_url_ is not None and not isinstance(snap_store_proxy_url_, (bytes, str)): + raise Exception("Expected snap_store_proxy_url_ to be a str, received: {}".format(type(snap_store_proxy_url_))) + + self.apt_mirror = apt_mirror_ + self.apt_proxy_settings = apt_proxy_settings_ + self.error = error_ + self.juju_proxy_settings = juju_proxy_settings_ + self.legacy_proxy_settings = legacy_proxy_settings_ + self.snap_proxy_settings = snap_proxy_settings_ + self.snap_store_assertions = snap_store_assertions_ + self.snap_store_id = snap_store_id_ + self.snap_store_proxy_url = snap_store_proxy_url_ + self.unknown_fields = unknown_fields + + + +class ProxyConfigResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ProxyConfigResult] + ''' + results_ = [ProxyConfigResult.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 PublicAddress(Type): + _toSchema = {'target': 'target'} + _toPy = {'target': 'target'} + def __init__(self, target=None, **unknown_fields): + ''' + target : str + ''' + target_ = target + + # Validate arguments against known Juju API types. + if target_ is not None and not isinstance(target_, (bytes, str)): + raise Exception("Expected target_ to be a str, received: {}".format(type(target_))) + + self.target = target_ + self.unknown_fields = unknown_fields + + + +class PublicAddressResults(Type): + _toSchema = {'public_address': 'public-address'} + _toPy = {'public-address': 'public_address'} + def __init__(self, public_address=None, **unknown_fields): + ''' + public_address : str + ''' + public_address_ = public_address + + # Validate arguments against known Juju API types. + if public_address_ is not None and not isinstance(public_address_, (bytes, str)): + raise Exception("Expected public_address_ to be a str, received: {}".format(type(public_address_))) + + self.public_address = public_address_ + self.unknown_fields = unknown_fields + + + +class Query(Type): + _toSchema = {'category': 'category', 'channel': 'channel', 'platforms': 'platforms', 'publisher': 'publisher', 'query': 'query', 'relation_provides': 'relation-provides', 'relation_requires': 'relation-requires', 'type_': 'type'} + _toPy = {'category': 'category', 'channel': 'channel', 'platforms': 'platforms', 'publisher': 'publisher', 'query': 'query', 'relation-provides': 'relation_provides', 'relation-requires': 'relation_requires', 'type': 'type_'} + def __init__(self, category=None, channel=None, platforms=None, publisher=None, query=None, relation_provides=None, relation_requires=None, type_=None, **unknown_fields): + ''' + category : str + channel : str + platforms : str + publisher : str + query : str + relation_provides : str + relation_requires : str + type_ : str + ''' + category_ = category + channel_ = channel + platforms_ = platforms + publisher_ = publisher + query_ = query + relation_provides_ = relation_provides + relation_requires_ = relation_requires + type__ = type_ + + # Validate arguments against known Juju API types. + if category_ is not None and not isinstance(category_, (bytes, str)): + raise Exception("Expected category_ to be a str, received: {}".format(type(category_))) + + if channel_ is not None and not isinstance(channel_, (bytes, str)): + raise Exception("Expected channel_ to be a str, received: {}".format(type(channel_))) + + if platforms_ is not None and not isinstance(platforms_, (bytes, str)): + raise Exception("Expected platforms_ to be a str, received: {}".format(type(platforms_))) + + if publisher_ is not None and not isinstance(publisher_, (bytes, str)): + raise Exception("Expected publisher_ to be a str, received: {}".format(type(publisher_))) + + if query_ is not None and not isinstance(query_, (bytes, str)): + raise Exception("Expected query_ to be a str, received: {}".format(type(query_))) + + if relation_provides_ is not None and not isinstance(relation_provides_, (bytes, str)): + raise Exception("Expected relation_provides_ to be a str, received: {}".format(type(relation_provides_))) + + if relation_requires_ is not None and not isinstance(relation_requires_, (bytes, str)): + raise Exception("Expected relation_requires_ to be a str, received: {}".format(type(relation_requires_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + self.category = category_ + self.channel = channel_ + self.platforms = platforms_ + self.publisher = publisher_ + self.query = query_ + self.relation_provides = relation_provides_ + self.relation_requires = relation_requires_ + self.type_ = type__ + self.unknown_fields = unknown_fields + + + +class QueryApplicationOffersResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ApplicationOfferAdminDetails] + ''' + results_ = [ApplicationOfferAdminDetails.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'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : str + ''' + error_ = Error.from_json(error) if error else None + result_ = result + + # 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_, (bytes, str)): + raise Exception("Expected result_ to be a str, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RebootActionResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RebootActionResult] + ''' + results_ = [RebootActionResult.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 RecordAgentStartInformationArg(Type): + _toSchema = {'hostname': 'hostname', 'tag': 'tag'} + _toPy = {'hostname': 'hostname', 'tag': 'tag'} + def __init__(self, hostname=None, tag=None, **unknown_fields): + ''' + hostname : str + tag : str + ''' + hostname_ = hostname + tag_ = tag + + # Validate arguments against known Juju API types. + if hostname_ is not None and not isinstance(hostname_, (bytes, str)): + raise Exception("Expected hostname_ to be a str, received: {}".format(type(hostname_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.hostname = hostname_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class RecordAgentStartInformationArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~RecordAgentStartInformationArg] + ''' + args_ = [RecordAgentStartInformationArg.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 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 + servers : typing.Sequence[~HostPort] + ''' + ca_cert_ = ca_cert + servers_ = [HostPort.from_json(o) for o in servers or []] + + # Validate arguments against known Juju API types. + if ca_cert_ is not None and not isinstance(ca_cert_, (bytes, str)): + raise Exception("Expected ca_cert_ to be a str, received: {}".format(type(ca_cert_))) + + if servers_ is not None and not isinstance(servers_, (bytes, str, list)): + raise Exception("Expected servers_ to be a Sequence, received: {}".format(type(servers_))) + + self.ca_cert = ca_cert_ + self.servers = servers_ + self.unknown_fields = 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 + value : Any + ''' + region_name_ = region_name + value_ = value + + # Validate arguments against known Juju API types. + if region_name_ is not None and not isinstance(region_name_, (bytes, str)): + raise Exception("Expected region_name_ to be a str, received: {}".format(type(region_name_))) + + self.region_name = region_name_ + self.value = value_ + self.unknown_fields = 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): + ''' + application_token : str + bakery_version : int + consume_version : int + local_endpoint_name : str + macaroons : typing.Sequence[~Macaroon] + offer_uuid : str + relation_token : str + remote_endpoint : RemoteEndpoint + remote_space : RemoteSpace + source_model_tag : str + ''' + application_token_ = application_token + bakery_version_ = bakery_version + consume_version_ = consume_version + local_endpoint_name_ = local_endpoint_name + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + 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. + if application_token_ is not None and not isinstance(application_token_, (bytes, str)): + raise Exception("Expected application_token_ to be a str, received: {}".format(type(application_token_))) + + 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 consume_version_ is not None and not isinstance(consume_version_, int): + raise Exception("Expected consume_version_ to be a int, received: {}".format(type(consume_version_))) + + if local_endpoint_name_ is not None and not isinstance(local_endpoint_name_, (bytes, str)): + raise Exception("Expected local_endpoint_name_ to be a str, received: {}".format(type(local_endpoint_name_))) + + 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 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 relation_token_ is not None and not isinstance(relation_token_, (bytes, str)): + raise Exception("Expected relation_token_ to be a str, received: {}".format(type(relation_token_))) + + 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_))) + + self.application_token = application_token_ + self.bakery_version = bakery_version_ + self.consume_version = consume_version_ + self.local_endpoint_name = local_endpoint_name_ + self.macaroons = macaroons_ + 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 + + + +class RegisterRemoteRelationArgs(Type): + _toSchema = {'relations': 'relations'} + _toPy = {'relations': 'relations'} + def __init__(self, relations=None, **unknown_fields): + ''' + relations : typing.Sequence[~RegisterRemoteRelationArg] + ''' + relations_ = [RegisterRemoteRelationArg.from_json(o) for o in relations or []] + + # Validate arguments against known Juju API types. + if relations_ is not None and not isinstance(relations_, (bytes, str, list)): + raise Exception("Expected relations_ to be a Sequence, received: {}".format(type(relations_))) + + self.relations = relations_ + self.unknown_fields = 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 + result : RemoteRelationDetails + ''' + error_ = Error.from_json(error) if error else None + result_ = RemoteRelationDetails.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, RemoteRelationDetails)): + raise Exception("Expected result_ to be a RemoteRelationDetails, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RegisterRemoteRelationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RegisterRemoteRelationResult] + ''' + results_ = [RegisterRemoteRelationResult.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 RelationChange(Type): + _toSchema = {'changedunits': 'changedunits', 'departedunits': 'departedunits', 'id_': 'id', 'life': 'life'} + _toPy = {'changedunits': 'changedunits', 'departedunits': 'departedunits', 'id': 'id_', 'life': 'life'} + def __init__(self, changedunits=None, departedunits=None, id_=None, life=None, **unknown_fields): + ''' + changedunits : typing.Mapping[str, ~RelationUnitChange] + departedunits : typing.Sequence[str] + id_ : int + life : str + ''' + changedunits_ = {k: RelationUnitChange.from_json(v) for k, v in (changedunits or dict()).items()} + departedunits_ = departedunits + id__ = id_ + life_ = life + + # Validate arguments against known Juju API types. + if changedunits_ is not None and not isinstance(changedunits_, dict): + raise Exception("Expected changedunits_ to be a Mapping, received: {}".format(type(changedunits_))) + + if departedunits_ is not None and not isinstance(departedunits_, (bytes, str, list)): + raise Exception("Expected departedunits_ to be a Sequence, received: {}".format(type(departedunits_))) + + if id__ is not None and not isinstance(id__, int): + raise Exception("Expected id__ to be a int, received: {}".format(type(id__))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + self.changedunits = changedunits_ + self.departedunits = departedunits_ + self.id_ = id__ + self.life = life_ + self.unknown_fields = 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 + unitdata : typing.Mapping[str, typing.Any] + ''' + inscope_ = inscope + unitdata_ = unitdata + + # Validate arguments against known Juju API types. + if inscope_ is not None and not isinstance(inscope_, bool): + raise Exception("Expected inscope_ to be a bool, received: {}".format(type(inscope_))) + + if unitdata_ is not None and not isinstance(unitdata_, dict): + raise Exception("Expected unitdata_ to be a Mapping, received: {}".format(type(unitdata_))) + + self.inscope = inscope_ + self.unitdata = unitdata_ + self.unknown_fields = 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] + ''' + relation_ids_ = relation_ids + + # Validate arguments against known Juju API types. + 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_))) + + self.relation_ids = relation_ids_ + self.unknown_fields = 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 + life : str + suspended : bool + suspended_reason : str + ''' + key_ = key + life_ = life + suspended_ = suspended + suspended_reason_ = suspended_reason + + # Validate arguments against known Juju API types. + if key_ is not None and not isinstance(key_, (bytes, str)): + raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if suspended_ is not None and not isinstance(suspended_, bool): + raise Exception("Expected suspended_ to be a bool, received: {}".format(type(suspended_))) + + if suspended_reason_ is not None and not isinstance(suspended_reason_, (bytes, str)): + raise Exception("Expected suspended_reason_ to be a str, received: {}".format(type(suspended_reason_))) + + self.key = key_ + self.life = life_ + self.suspended = suspended_ + self.suspended_reason = suspended_reason_ + self.unknown_fields = unknown_fields + + + +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] + error : Error + watcher_id : str + ''' + changes_ = [RelationLifeSuspendedStatusChange.from_json(o) for o in changes or []] + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ + self.unknown_fields = 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 + endpoint : Endpoint + error : Error + id_ : int + key : str + life : str + other_application : str + ''' + bool__ = bool_ + endpoint_ = Endpoint.from_json(endpoint) if endpoint else None + error_ = Error.from_json(error) if error else None + id__ = id_ + key_ = key + life_ = life + other_application_ = other_application + + # Validate arguments against known Juju API types. + if bool__ is not None and not isinstance(bool__, bool): + raise Exception("Expected bool__ to be a bool, received: {}".format(type(bool__))) + + if endpoint_ is not None and not isinstance(endpoint_, (dict, Endpoint)): + raise Exception("Expected endpoint_ to be a Endpoint, received: {}".format(type(endpoint_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if id__ is not None and not isinstance(id__, int): + raise Exception("Expected id__ to be a int, received: {}".format(type(id__))) + + if key_ is not None and not isinstance(key_, (bytes, str)): + raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if other_application_ is not None and not isinstance(other_application_, (bytes, str)): + raise Exception("Expected other_application_ to be a str, received: {}".format(type(other_application_))) + + self.bool_ = bool__ + self.endpoint = endpoint_ + self.error = error_ + self.id_ = id__ + self.key = key_ + self.life = life_ + self.other_application = other_application_ + self.unknown_fields = unknown_fields + + + +class RelationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RelationResult] + ''' + results_ = [RelationResult.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 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] + id_ : int + interface : str + key : str + scope : str + status : DetailedStatus + ''' + endpoints_ = [EndpointStatus.from_json(o) for o in endpoints or []] + id__ = id_ + interface_ = interface + key_ = key + scope_ = scope + status_ = DetailedStatus.from_json(status) if status else None + + # Validate arguments against known Juju API types. + 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 id__ is not None and not isinstance(id__, int): + raise Exception("Expected id__ to be a int, received: {}".format(type(id__))) + + if interface_ is not None and not isinstance(interface_, (bytes, str)): + raise Exception("Expected interface_ to be a str, received: {}".format(type(interface_))) + + if key_ is not None and not isinstance(key_, (bytes, str)): + raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) + + if scope_ is not None and not isinstance(scope_, (bytes, str)): + raise Exception("Expected scope_ to be a str, received: {}".format(type(scope_))) + + if status_ is not None and not isinstance(status_, (dict, DetailedStatus)): + raise Exception("Expected status_ to be a DetailedStatus, received: {}".format(type(status_))) + + self.endpoints = endpoints_ + self.id_ = id__ + self.interface = interface_ + self.key = key_ + self.scope = scope_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +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 + relation_id : int + status : str + unit_tag : str + ''' + message_ = message + relation_id_ = relation_id + status_ = status + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + 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 status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.message = message_ + self.relation_id = relation_id_ + self.status = status_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +class RelationStatusArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~RelationStatusArg] + ''' + args_ = [RelationStatusArg.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 RelationStatusWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RelationLifeSuspendedStatusWatchResult] + ''' + results_ = [RelationLifeSuspendedStatusWatchResult.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 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 + relation_id : int + suspended : bool + ''' + message_ = message + relation_id_ = relation_id + suspended_ = suspended + + # Validate arguments against known Juju API types. + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + 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 suspended_ is not None and not isinstance(suspended_, bool): + raise Exception("Expected suspended_ to be a bool, received: {}".format(type(suspended_))) + + self.message = message_ + self.relation_id = relation_id_ + self.suspended = suspended_ + self.unknown_fields = unknown_fields + + + +class RelationSuspendedArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~RelationSuspendedArg] + ''' + args_ = [RelationSuspendedArg.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 RelationUnit(Type): + _toSchema = {'relation': 'relation', 'unit': 'unit'} + _toPy = {'relation': 'relation', 'unit': 'unit'} + def __init__(self, relation=None, unit=None, **unknown_fields): + ''' + relation : str + unit : str + ''' + relation_ = relation + unit_ = unit + + # Validate arguments against known Juju API types. + 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_))) + + self.relation = relation_ + self.unit = unit_ + self.unknown_fields = unknown_fields + + + +class RelationUnitChange(Type): + _toSchema = {'settings': 'settings'} + _toPy = {'settings': 'settings'} + def __init__(self, settings=None, **unknown_fields): + ''' + settings : typing.Mapping[str, typing.Any] + ''' + settings_ = settings + + # Validate arguments against known Juju API types. + if settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) + + self.settings = settings_ + self.unknown_fields = 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 + relation : str + remote_unit : str + ''' + local_unit_ = local_unit + relation_ = relation + remote_unit_ = remote_unit + + # Validate arguments against known Juju API types. + if local_unit_ is not None and not isinstance(local_unit_, (bytes, str)): + raise Exception("Expected local_unit_ to be a str, received: {}".format(type(local_unit_))) + + if relation_ is not None and not isinstance(relation_, (bytes, str)): + raise Exception("Expected relation_ to be a str, received: {}".format(type(relation_))) + + if remote_unit_ is not None and not isinstance(remote_unit_, (bytes, str)): + raise Exception("Expected remote_unit_ to be a str, received: {}".format(type(remote_unit_))) + + self.local_unit = local_unit_ + self.relation = relation_ + self.remote_unit = remote_unit_ + self.unknown_fields = unknown_fields + + + +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] + ''' + relation_unit_pairs_ = [RelationUnitPair.from_json(o) for o in relation_unit_pairs or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.relation_unit_pairs = relation_unit_pairs_ + self.unknown_fields = 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] + relation : str + settings : typing.Mapping[str, str] + unit : str + ''' + application_settings_ = application_settings + relation_ = relation + settings_ = settings + unit_ = unit + + # Validate arguments against known Juju API types. + if application_settings_ is not None and not isinstance(application_settings_, dict): + raise Exception("Expected application_settings_ to be a Mapping, received: {}".format(type(application_settings_))) + + if relation_ is not None and not isinstance(relation_, (bytes, str)): + raise Exception("Expected relation_ to be a str, received: {}".format(type(relation_))) + + if settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) + + if unit_ is not None and not isinstance(unit_, (bytes, str)): + raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + + self.application_settings = application_settings_ + self.relation = relation_ + self.settings = settings_ + self.unit = unit_ + self.unknown_fields = unknown_fields + + + +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 + relation_tag : str + suspended : bool + ''' + in_scope_ = in_scope + relation_tag_ = relation_tag + suspended_ = suspended + + # Validate arguments against known Juju API types. + if in_scope_ is not None and not isinstance(in_scope_, bool): + raise Exception("Expected in_scope_ to be a bool, received: {}".format(type(in_scope_))) + + if relation_tag_ is not None and not isinstance(relation_tag_, (bytes, str)): + raise Exception("Expected relation_tag_ to be a str, received: {}".format(type(relation_tag_))) + + if suspended_ is not None and not isinstance(suspended_, bool): + raise Exception("Expected suspended_ to be a bool, received: {}".format(type(suspended_))) + + self.in_scope = in_scope_ + self.relation_tag = relation_tag_ + self.suspended = suspended_ + self.unknown_fields = unknown_fields + + + +class RelationUnitStatusResult(Type): + _toSchema = {'error': 'error', 'results': 'results'} + _toPy = {'error': 'error', 'results': 'results'} + def __init__(self, error=None, results=None, **unknown_fields): + ''' + error : Error + results : typing.Sequence[~RelationUnitStatus] + ''' + error_ = Error.from_json(error) if error else None + results_ = [RelationUnitStatus.from_json(o) for o in results or []] + + # 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 results_ is not None and not isinstance(results_, (bytes, str, list)): + raise Exception("Expected results_ to be a Sequence, received: {}".format(type(results_))) + + self.error = error_ + self.results = results_ + self.unknown_fields = unknown_fields + + + +class RelationUnitStatusResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RelationUnitStatusResult] + ''' + results_ = [RelationUnitStatusResult.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 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] + ''' + relation_units_ = [RelationUnit.from_json(o) for o in relation_units or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.relation_units = relation_units_ + self.unknown_fields = 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] + changed : typing.Mapping[str, ~UnitSettings] + departed : typing.Sequence[str] + ''' + app_changed_ = app_changed + changed_ = {k: UnitSettings.from_json(v) for k, v in (changed or dict()).items()} + departed_ = departed + + # Validate arguments against known Juju API types. + if app_changed_ is not None and not isinstance(app_changed_, dict): + raise Exception("Expected app_changed_ to be a Mapping, received: {}".format(type(app_changed_))) + + if changed_ is not None and not isinstance(changed_, dict): + raise Exception("Expected changed_ to be a Mapping, received: {}".format(type(changed_))) + + if departed_ is not None and not isinstance(departed_, (bytes, str, list)): + raise Exception("Expected departed_ to be a Sequence, received: {}".format(type(departed_))) + + self.app_changed = app_changed_ + self.changed = changed_ + self.departed = departed_ + self.unknown_fields = unknown_fields + + + +class RelationUnitsSettings(Type): + _toSchema = {'relation_units': 'relation-units'} + _toPy = {'relation-units': 'relation_units'} + def __init__(self, relation_units=None, **unknown_fields): + ''' + relation_units : typing.Sequence[~RelationUnitSettings] + ''' + relation_units_ = [RelationUnitSettings.from_json(o) for o in relation_units or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.relation_units = relation_units_ + self.unknown_fields = unknown_fields + + + +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 + error : Error + watcher_id : str + ''' + changes_ = RelationUnitsChange.from_json(changes) if changes else None + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (dict, RelationUnitsChange)): + raise Exception("Expected changes_ to be a RelationUnitsChange, received: {}".format(type(changes_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class RelationUnitsWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RelationUnitsWatchResult] + ''' + results_ = [RelationUnitsWatchResult.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 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 + is_consumer_proxy : bool + life : str + macaroon : Macaroon + model_uuid : str + name : str + offer_uuid : str + status : str + ''' + consume_version_ = consume_version + is_consumer_proxy_ = is_consumer_proxy + life_ = life + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + model_uuid_ = model_uuid + name_ = name + offer_uuid_ = offer_uuid + status_ = status + + # Validate arguments against known Juju API types. + if consume_version_ is not None and not isinstance(consume_version_, int): + raise Exception("Expected consume_version_ to be a int, received: {}".format(type(consume_version_))) + + if is_consumer_proxy_ is not None and not isinstance(is_consumer_proxy_, bool): + raise Exception("Expected is_consumer_proxy_ to be a bool, received: {}".format(type(is_consumer_proxy_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + + if model_uuid_ is not None and not isinstance(model_uuid_, (bytes, str)): + raise Exception("Expected model_uuid_ to be a str, received: {}".format(type(model_uuid_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + 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 status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.consume_version = consume_version_ + self.is_consumer_proxy = is_consumer_proxy_ + self.life = life_ + self.macaroon = macaroon_ + self.model_uuid = model_uuid_ + self.name = name_ + self.offer_uuid = offer_uuid_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class RemoteApplicationChange(Type): + _toSchema = {'application_tag': 'application-tag', 'life': 'life', 'relations': 'relations'} + _toPy = {'application-tag': 'application_tag', 'life': 'life', 'relations': 'relations'} + def __init__(self, application_tag=None, life=None, relations=None, **unknown_fields): + ''' + application_tag : str + life : str + relations : RemoteRelationsChange + ''' + application_tag_ = application_tag + life_ = life + relations_ = RemoteRelationsChange.from_json(relations) if relations else None + + # Validate arguments against known Juju API types. + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if relations_ is not None and not isinstance(relations_, (dict, RemoteRelationsChange)): + raise Exception("Expected relations_ to be a RemoteRelationsChange, received: {}".format(type(relations_))) + + self.application_tag = application_tag_ + self.life = life_ + self.relations = relations_ + self.unknown_fields = unknown_fields + + + +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 + endpoints : typing.Sequence[~RemoteEndpoint] + icon_url_path : str + model_tag : str + name : str + offer_url : str + source_model_label : str + ''' + description_ = description + endpoints_ = [RemoteEndpoint.from_json(o) for o in endpoints or []] + icon_url_path_ = icon_url_path + model_tag_ = model_tag + name_ = name + offer_url_ = offer_url + source_model_label_ = source_model_label + + # Validate arguments against known Juju API types. + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(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 icon_url_path_ is not None and not isinstance(icon_url_path_, (bytes, str)): + raise Exception("Expected icon_url_path_ to be a str, received: {}".format(type(icon_url_path_))) + + 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 name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(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 source_model_label_ is not None and not isinstance(source_model_label_, (bytes, str)): + raise Exception("Expected source_model_label_ to be a str, received: {}".format(type(source_model_label_))) + + self.description = description_ + self.endpoints = endpoints_ + self.icon_url_path = icon_url_path_ + self.model_tag = model_tag_ + self.name = name_ + self.offer_url = offer_url_ + self.source_model_label = source_model_label_ + self.unknown_fields = unknown_fields + + + +class RemoteApplicationInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : RemoteApplicationInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = RemoteApplicationInfo.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, RemoteApplicationInfo)): + raise Exception("Expected result_ to be a RemoteApplicationInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RemoteApplicationInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoteApplicationInfoResult] + ''' + results_ = [RemoteApplicationInfoResult.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 RemoteApplicationResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : RemoteApplication + ''' + error_ = Error.from_json(error) if error else None + result_ = RemoteApplication.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, RemoteApplication)): + raise Exception("Expected result_ to be a RemoteApplication, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RemoteApplicationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoteApplicationResult] + ''' + results_ = [RemoteApplicationResult.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 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] + err : Error + life : str + offer_name : str + offer_url : str + relations : typing.Mapping[str, typing.Sequence[str]] + status : DetailedStatus + ''' + endpoints_ = [RemoteEndpoint.from_json(o) for o in endpoints or []] + err_ = Error.from_json(err) if err else None + life_ = life + offer_name_ = offer_name + offer_url_ = offer_url + relations_ = relations + status_ = DetailedStatus.from_json(status) if status else None + + # Validate arguments against known Juju API types. + 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 err_ is not None and not isinstance(err_, (dict, Error)): + raise Exception("Expected err_ to be a Error, received: {}".format(type(err_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + 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 relations_ is not None and not isinstance(relations_, dict): + raise Exception("Expected relations_ to be a Mapping, received: {}".format(type(relations_))) + + if status_ is not None and not isinstance(status_, (dict, DetailedStatus)): + raise Exception("Expected status_ to be a DetailedStatus, received: {}".format(type(status_))) + + self.endpoints = endpoints_ + self.err = err_ + self.life = life_ + self.offer_name = offer_name_ + self.offer_url = offer_url_ + self.relations = relations_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class RemoteApplicationWatchResult(Type): + _toSchema = {'change': 'change', 'error': 'error', 'id_': 'id'} + _toPy = {'change': 'change', 'error': 'error', 'id': 'id_'} + def __init__(self, change=None, error=None, id_=None, **unknown_fields): + ''' + change : RemoteApplicationChange + error : Error + id_ : str + ''' + change_ = RemoteApplicationChange.from_json(change) if change else None + error_ = Error.from_json(error) if error else None + id__ = id_ + + # Validate arguments against known Juju API types. + if change_ is not None and not isinstance(change_, (dict, RemoteApplicationChange)): + raise Exception("Expected change_ to be a RemoteApplicationChange, received: {}".format(type(change_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + self.change = change_ + self.error = error_ + self.id_ = id__ + self.unknown_fields = unknown_fields + + + +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 + limit : int + name : str + role : str + ''' + interface_ = interface + limit_ = limit + name_ = name + role_ = role + + # Validate arguments against known Juju API types. + if interface_ is not None and not isinstance(interface_, (bytes, str)): + raise Exception("Expected interface_ to be a str, received: {}".format(type(interface_))) + + if limit_ is not None and not isinstance(limit_, int): + raise Exception("Expected limit_ to be a int, received: {}".format(type(limit_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if role_ is not None and not isinstance(role_, (bytes, str)): + raise Exception("Expected role_ to be a str, received: {}".format(type(role_))) + + self.interface = interface_ + self.limit = limit_ + self.name = name_ + self.role = role_ + self.unknown_fields = unknown_fields + + + +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 + macaroons : typing.Sequence[~Macaroon] + relation_token : str + ''' + bakery_version_ = bakery_version + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + relation_token_ = relation_token + + # Validate arguments against known Juju API types. + 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 macaroons_ is not None and not isinstance(macaroons_, (bytes, str, list)): + raise Exception("Expected macaroons_ to be a Sequence, received: {}".format(type(macaroons_))) + + if relation_token_ is not None and not isinstance(relation_token_, (bytes, str)): + raise Exception("Expected relation_token_ to be a str, received: {}".format(type(relation_token_))) + + self.bakery_version = bakery_version_ + self.macaroons = macaroons_ + self.relation_token = relation_token_ + self.unknown_fields = unknown_fields + + + +class RemoteEntityArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~RemoteEntityArg] + ''' + args_ = [RemoteEntityArg.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 RemoteEntityId(Type): + _toSchema = {'model_uuid': 'model-uuid', 'token': 'token'} + _toPy = {'model-uuid': 'model_uuid', 'token': 'token'} + def __init__(self, model_uuid=None, token=None, **unknown_fields): + ''' + model_uuid : str + token : str + ''' + model_uuid_ = model_uuid + token_ = token + + # Validate arguments against known Juju API types. + if model_uuid_ is not None and not isinstance(model_uuid_, (bytes, str)): + raise Exception("Expected model_uuid_ to be a str, received: {}".format(type(model_uuid_))) + + if token_ is not None and not isinstance(token_, (bytes, str)): + raise Exception("Expected token_ to be a str, received: {}".format(type(token_))) + + self.model_uuid = model_uuid_ + self.token = token_ + self.unknown_fields = 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 + token : str + ''' + tag_ = tag + token_ = token + + # Validate arguments against known Juju API types. + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if token_ is not None and not isinstance(token_, (bytes, str)): + raise Exception("Expected token_ to be a str, received: {}".format(type(token_))) + + self.tag = tag_ + self.token = token_ + self.unknown_fields = unknown_fields + + + +class RemoteEntityTokenArgs(Type): + _toSchema = {'args': 'Args'} + _toPy = {'Args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~RemoteEntityTokenArg] + ''' + args_ = [RemoteEntityTokenArg.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 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'} + _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'} + 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, **unknown_fields): + ''' + application_name : str + endpoint : RemoteEndpoint + id_ : int + key : str + life : str + remote_application_name : str + remote_endpoint_name : str + source_model_uuid : str + suspended : bool + ''' + application_name_ = application_name + endpoint_ = RemoteEndpoint.from_json(endpoint) if endpoint else None + 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 + + # Validate arguments against known Juju API types. + 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 endpoint_ is not None and not isinstance(endpoint_, (dict, RemoteEndpoint)): + raise Exception("Expected endpoint_ to be a RemoteEndpoint, received: {}".format(type(endpoint_))) + + if id__ is not None and not isinstance(id__, int): + raise Exception("Expected id__ to be a int, received: {}".format(type(id__))) + + if key_ is not None and not isinstance(key_, (bytes, str)): + raise Exception("Expected key_ to be a str, received: {}".format(type(key_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if remote_application_name_ is not None and not isinstance(remote_application_name_, (bytes, str)): + raise Exception("Expected remote_application_name_ to be a str, received: {}".format(type(remote_application_name_))) + + if remote_endpoint_name_ is not None and not isinstance(remote_endpoint_name_, (bytes, str)): + raise Exception("Expected remote_endpoint_name_ to be a str, received: {}".format(type(remote_endpoint_name_))) + + if source_model_uuid_ is not None and not isinstance(source_model_uuid_, (bytes, str)): + raise Exception("Expected source_model_uuid_ to be a str, received: {}".format(type(source_model_uuid_))) + + if suspended_ is not None and not isinstance(suspended_, bool): + raise Exception("Expected suspended_ to be a bool, received: {}".format(type(suspended_))) + + self.application_name = application_name_ + self.endpoint = endpoint_ + self.id_ = id__ + self.key = key_ + self.life = life_ + self.remote_application_name = remote_application_name_ + self.remote_endpoint_name = remote_endpoint_name_ + self.source_model_uuid = source_model_uuid_ + self.suspended = suspended_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationChange(Type): + _toSchema = {'changed_units': 'changed-units', 'departed_units': 'departed-units', 'id_': 'id', 'life': 'life'} + _toPy = {'changed-units': 'changed_units', 'departed-units': 'departed_units', 'id': 'id_', 'life': 'life'} + def __init__(self, changed_units=None, departed_units=None, id_=None, life=None, **unknown_fields): + ''' + changed_units : typing.Mapping[str, ~RemoteRelationUnitChange] + departed_units : typing.Sequence[str] + id_ : int + life : str + ''' + changed_units_ = {k: RemoteRelationUnitChange.from_json(v) for k, v in (changed_units or dict()).items()} + departed_units_ = departed_units + id__ = id_ + life_ = life + + # Validate arguments against known Juju API types. + if changed_units_ is not None and not isinstance(changed_units_, dict): + raise Exception("Expected changed_units_ to be a Mapping, received: {}".format(type(changed_units_))) + + if departed_units_ is not None and not isinstance(departed_units_, (bytes, str, list)): + raise Exception("Expected departed_units_ to be a Sequence, received: {}".format(type(departed_units_))) + + if id__ is not None and not isinstance(id__, int): + raise Exception("Expected id__ to be a int, received: {}".format(type(id__))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + self.changed_units = changed_units_ + self.departed_units = departed_units_ + self.id_ = id__ + self.life = life_ + self.unknown_fields = unknown_fields + + + +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] + application_token : str + bakery_version : int + changed_units : typing.Sequence[~RemoteRelationUnitChange] + departed_units : typing.Sequence[int] + force_cleanup : bool + life : str + macaroons : typing.Sequence[~Macaroon] + relation_token : str + suspended : bool + suspended_reason : str + unit_count : int + ''' + application_settings_ = application_settings + application_token_ = application_token + bakery_version_ = bakery_version + changed_units_ = [RemoteRelationUnitChange.from_json(o) for o in changed_units or []] + departed_units_ = departed_units + force_cleanup_ = force_cleanup + life_ = life + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + relation_token_ = relation_token + suspended_ = suspended + suspended_reason_ = suspended_reason + unit_count_ = unit_count + + # Validate arguments against known Juju API types. + if application_settings_ is not None and not isinstance(application_settings_, dict): + raise Exception("Expected application_settings_ to be a Mapping, received: {}".format(type(application_settings_))) + + if application_token_ is not None and not isinstance(application_token_, (bytes, str)): + raise Exception("Expected application_token_ to be a str, received: {}".format(type(application_token_))) + + 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 changed_units_ is not None and not isinstance(changed_units_, (bytes, str, list)): + raise Exception("Expected changed_units_ to be a Sequence, received: {}".format(type(changed_units_))) + + if departed_units_ is not None and not isinstance(departed_units_, (bytes, str, list)): + raise Exception("Expected departed_units_ to be a Sequence, received: {}".format(type(departed_units_))) + + if force_cleanup_ is not None and not isinstance(force_cleanup_, bool): + raise Exception("Expected force_cleanup_ to be a bool, received: {}".format(type(force_cleanup_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + 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 relation_token_ is not None and not isinstance(relation_token_, (bytes, str)): + raise Exception("Expected relation_token_ to be a str, received: {}".format(type(relation_token_))) + + if suspended_ is not None and not isinstance(suspended_, bool): + raise Exception("Expected suspended_ to be a bool, received: {}".format(type(suspended_))) + + if suspended_reason_ is not None and not isinstance(suspended_reason_, (bytes, str)): + raise Exception("Expected suspended_reason_ to be a str, received: {}".format(type(suspended_reason_))) + + if unit_count_ is not None and not isinstance(unit_count_, int): + raise Exception("Expected unit_count_ to be a int, received: {}".format(type(unit_count_))) + + self.application_settings = application_settings_ + self.application_token = application_token_ + self.bakery_version = bakery_version_ + self.changed_units = changed_units_ + self.departed_units = departed_units_ + self.force_cleanup = force_cleanup_ + self.life = life_ + self.macaroons = macaroons_ + self.relation_token = relation_token_ + self.suspended = suspended_ + self.suspended_reason = suspended_reason_ + self.unit_count = unit_count_ + self.unknown_fields = unknown_fields + + + +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 + macaroon : Macaroon + relation_token : str + ''' + bakery_version_ = bakery_version + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + relation_token_ = relation_token + + # Validate arguments against known Juju API types. + 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 macaroon_ is not None and not isinstance(macaroon_, (dict, Macaroon)): + raise Exception("Expected macaroon_ to be a Macaroon, received: {}".format(type(macaroon_))) + + if relation_token_ is not None and not isinstance(relation_token_, (bytes, str)): + raise Exception("Expected relation_token_ to be a str, received: {}".format(type(relation_token_))) + + self.bakery_version = bakery_version_ + self.macaroon = macaroon_ + self.relation_token = relation_token_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : RemoteRelation + ''' + error_ = Error.from_json(error) if error else None + result_ = RemoteRelation.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, RemoteRelation)): + raise Exception("Expected result_ to be a RemoteRelation, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoteRelationResult] + ''' + results_ = [RemoteRelationResult.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 RemoteRelationUnit(Type): + _toSchema = {'macaroons': 'macaroons', 'relation_token': 'relation-token', 'unit': 'unit'} + _toPy = {'macaroons': 'macaroons', 'relation-token': 'relation_token', 'unit': 'unit'} + def __init__(self, macaroons=None, relation_token=None, unit=None, **unknown_fields): + ''' + macaroons : typing.Sequence[~Macaroon] + relation_token : str + unit : str + ''' + macaroons_ = [Macaroon.from_json(o) for o in macaroons or []] + relation_token_ = relation_token + unit_ = unit + + # Validate arguments against known Juju API types. + 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 relation_token_ is not None and not isinstance(relation_token_, (bytes, str)): + raise Exception("Expected relation_token_ to be a str, received: {}".format(type(relation_token_))) + + if unit_ is not None and not isinstance(unit_, (bytes, str)): + raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + + self.macaroons = macaroons_ + self.relation_token = relation_token_ + self.unit = unit_ + self.unknown_fields = 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] + unit_id : int + ''' + settings_ = settings + unit_id_ = unit_id + + # Validate arguments against known Juju API types. + if settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) + + 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_))) + + self.settings = settings_ + self.unit_id = unit_id_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationUnits(Type): + _toSchema = {'relation_units': 'relation-units'} + _toPy = {'relation-units': 'relation_units'} + def __init__(self, relation_units=None, **unknown_fields): + ''' + relation_units : typing.Sequence[~RemoteRelationUnit] + ''' + relation_units_ = [RemoteRelationUnit.from_json(o) for o in relation_units or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.relation_units = relation_units_ + self.unknown_fields = 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 + error : Error + watcher_id : str + ''' + changes_ = RemoteRelationChangeEvent.from_json(changes) if changes else None + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (dict, RemoteRelationChangeEvent)): + raise Exception("Expected changes_ to be a RemoteRelationChangeEvent, received: {}".format(type(changes_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoteRelationWatchResult] + ''' + results_ = [RemoteRelationWatchResult.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 RemoteRelationsChange(Type): + _toSchema = {'changed': 'changed', 'initial': 'initial', 'removed': 'removed'} + _toPy = {'changed': 'changed', 'initial': 'initial', 'removed': 'removed'} + def __init__(self, changed=None, initial=None, removed=None, **unknown_fields): + ''' + changed : typing.Sequence[~RemoteRelationChange] + initial : bool + removed : typing.Sequence[int] + ''' + changed_ = [RemoteRelationChange.from_json(o) for o in changed or []] + initial_ = initial + removed_ = removed + + # Validate arguments against known Juju API types. + if changed_ is not None and not isinstance(changed_, (bytes, str, list)): + raise Exception("Expected changed_ to be a Sequence, received: {}".format(type(changed_))) + + if initial_ is not None and not isinstance(initial_, bool): + raise Exception("Expected initial_ to be a bool, received: {}".format(type(initial_))) + + if removed_ is not None and not isinstance(removed_, (bytes, str, list)): + raise Exception("Expected removed_ to be a Sequence, received: {}".format(type(removed_))) + + self.changed = changed_ + self.initial = initial_ + self.removed = removed_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationsChanges(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~RemoteRelationChangeEvent] + ''' + changes_ = [RemoteRelationChangeEvent.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = unknown_fields + + + +class RemoteRelationsWatchResult(Type): + _toSchema = {'change': 'change', 'error': 'error', 'remoterelationswatcherid': 'RemoteRelationsWatcherId'} + _toPy = {'RemoteRelationsWatcherId': 'remoterelationswatcherid', 'change': 'change', 'error': 'error'} + def __init__(self, remoterelationswatcherid=None, change=None, error=None, **unknown_fields): + ''' + remoterelationswatcherid : str + change : RemoteRelationsChange + error : Error + ''' + remoterelationswatcherid_ = remoterelationswatcherid + change_ = RemoteRelationsChange.from_json(change) if change else None + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if remoterelationswatcherid_ is not None and not isinstance(remoterelationswatcherid_, (bytes, str)): + raise Exception("Expected remoterelationswatcherid_ to be a str, received: {}".format(type(remoterelationswatcherid_))) + + if change_ is not None and not isinstance(change_, (dict, RemoteRelationsChange)): + raise Exception("Expected change_ to be a RemoteRelationsChange, received: {}".format(type(change_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.remoterelationswatcherid = remoterelationswatcherid_ + self.change = change_ + self.error = error_ + self.unknown_fields = 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 + name : str + provider_attributes : typing.Mapping[str, typing.Any] + provider_id : str + subnets : typing.Sequence[~Subnet] + ''' + cloud_type_ = cloud_type + name_ = name + provider_attributes_ = provider_attributes + provider_id_ = provider_id + subnets_ = [Subnet.from_json(o) for o in subnets or []] + + # Validate arguments against known Juju API types. + if cloud_type_ is not None and not isinstance(cloud_type_, (bytes, str)): + raise Exception("Expected cloud_type_ to be a str, received: {}".format(type(cloud_type_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if provider_attributes_ is not None and not isinstance(provider_attributes_, dict): + raise Exception("Expected provider_attributes_ to be a Mapping, received: {}".format(type(provider_attributes_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): + raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) + + self.cloud_type = cloud_type_ + self.name = name_ + self.provider_attributes = provider_attributes_ + self.provider_id = provider_id_ + self.subnets = subnets_ + self.unknown_fields = unknown_fields + + + +class RemoveBlocksArgs(Type): + _toSchema = {'all_': 'all'} + _toPy = {'all': 'all_'} + def __init__(self, all_=None, **unknown_fields): + ''' + all_ : bool + ''' + all__ = all_ + + # Validate arguments against known Juju API types. + if all__ is not None and not isinstance(all__, bool): + raise Exception("Expected all__ to be a bool, received: {}".format(type(all__))) + + self.all_ = all__ + self.unknown_fields = 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 + filesystem_id : str + provider : str + ''' + destroy_ = destroy + filesystem_id_ = filesystem_id + provider_ = provider + + # Validate arguments against known Juju API types. + if destroy_ is not None and not isinstance(destroy_, bool): + raise Exception("Expected destroy_ to be a bool, received: {}".format(type(destroy_))) + + if filesystem_id_ is not None and not isinstance(filesystem_id_, (bytes, str)): + raise Exception("Expected filesystem_id_ to be a str, received: {}".format(type(filesystem_id_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + self.destroy = destroy_ + self.filesystem_id = filesystem_id_ + self.provider = provider_ + self.unknown_fields = unknown_fields + + + +class RemoveFilesystemParamsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : RemoveFilesystemParams + ''' + error_ = Error.from_json(error) if error else None + result_ = RemoveFilesystemParams.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, RemoveFilesystemParams)): + raise Exception("Expected result_ to be a RemoveFilesystemParams, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RemoveFilesystemParamsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoveFilesystemParamsResult] + ''' + results_ = [RemoveFilesystemParamsResult.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 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 + force : bool + space : Entity + ''' + dry_run_ = dry_run + force_ = force + space_ = Entity.from_json(space) if space else None + + # Validate arguments against known Juju API types. + 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 space_ is not None and not isinstance(space_, (dict, Entity)): + raise Exception("Expected space_ to be a Entity, received: {}".format(type(space_))) + + self.dry_run = dry_run_ + self.force = force_ + self.space = space_ + self.unknown_fields = 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] + ''' + space_param_ = [RemoveSpaceParam.from_json(o) for o in space_param or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.space_param = space_param_ + self.unknown_fields = 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] + constraints : typing.Sequence[~Entity] + controller_settings : typing.Sequence[str] + error : Error + ''' + bindings_ = [Entity.from_json(o) for o in bindings or []] + constraints_ = [Entity.from_json(o) for o in constraints or []] + controller_settings_ = controller_settings + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + 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 constraints_ is not None and not isinstance(constraints_, (bytes, str, list)): + raise Exception("Expected constraints_ to be a Sequence, received: {}".format(type(constraints_))) + + if controller_settings_ is not None and not isinstance(controller_settings_, (bytes, str, list)): + raise Exception("Expected controller_settings_ to be a Sequence, received: {}".format(type(controller_settings_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.bindings = bindings_ + self.constraints = constraints_ + self.controller_settings = controller_settings_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class RemoveSpaceResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoveSpaceResult] + ''' + results_ = [RemoveSpaceResult.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 RemoveStorage(Type): + _toSchema = {'storage': 'storage'} + _toPy = {'storage': 'storage'} + def __init__(self, storage=None, **unknown_fields): + ''' + storage : typing.Sequence[~RemoveStorageInstance] + ''' + storage_ = [RemoveStorageInstance.from_json(o) for o in storage or []] + + # Validate arguments against known Juju API types. + if storage_ is not None and not isinstance(storage_, (bytes, str, list)): + raise Exception("Expected storage_ to be a Sequence, received: {}".format(type(storage_))) + + self.storage = storage_ + self.unknown_fields = 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 + destroy_storage : bool + force : bool + max_wait : int + tag : str + ''' + destroy_attachments_ = destroy_attachments + destroy_storage_ = destroy_storage + force_ = force + max_wait_ = max_wait + tag_ = tag + + # Validate arguments against known Juju API types. + if destroy_attachments_ is not None and not isinstance(destroy_attachments_, bool): + raise Exception("Expected destroy_attachments_ to be a bool, received: {}".format(type(destroy_attachments_))) + + 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 tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.destroy_attachments = destroy_attachments_ + self.destroy_storage = destroy_storage_ + self.force = force_ + self.max_wait = max_wait_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +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 + provider : str + volume_id : str + ''' + destroy_ = destroy + provider_ = provider + volume_id_ = volume_id + + # Validate arguments against known Juju API types. + if destroy_ is not None and not isinstance(destroy_, bool): + raise Exception("Expected destroy_ to be a bool, received: {}".format(type(destroy_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if volume_id_ is not None and not isinstance(volume_id_, (bytes, str)): + raise Exception("Expected volume_id_ to be a str, received: {}".format(type(volume_id_))) + + self.destroy = destroy_ + self.provider = provider_ + self.volume_id = volume_id_ + self.unknown_fields = 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 + result : RemoveVolumeParams + ''' + error_ = Error.from_json(error) if error else None + result_ = RemoveVolumeParams.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, RemoveVolumeParams)): + raise Exception("Expected result_ to be a RemoveVolumeParams, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RemoveVolumeParamsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RemoveVolumeParamsResult] + ''' + results_ = [RemoveVolumeParamsResult.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 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 + to_space_tag : str + ''' + from_space_tag_ = from_space_tag + to_space_tag_ = to_space_tag + + # Validate arguments against known Juju API types. + if from_space_tag_ is not None and not isinstance(from_space_tag_, (bytes, str)): + raise Exception("Expected from_space_tag_ to be a str, received: {}".format(type(from_space_tag_))) + + if to_space_tag_ is not None and not isinstance(to_space_tag_, (bytes, str)): + raise Exception("Expected to_space_tag_ to be a str, received: {}".format(type(to_space_tag_))) + + self.from_space_tag = from_space_tag_ + self.to_space_tag = to_space_tag_ + self.unknown_fields = unknown_fields + + + +class RenameSpacesParams(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~RenameSpaceParams] + ''' + changes_ = [RenameSpaceParams.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = unknown_fields + + + +class ResolveCharmResult(Type): + _toSchema = {'error': 'error', 'url': 'url'} + _toPy = {'error': 'error', 'url': 'url'} + def __init__(self, error=None, url=None, **unknown_fields): + ''' + error : str + url : str + ''' + error_ = error + url_ = url + + # Validate arguments against known Juju API types. + if error_ is not None and not isinstance(error_, (bytes, str)): + raise Exception("Expected error_ to be a str, received: {}".format(type(error_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.error = error_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class ResolveCharmResults(Type): + _toSchema = {'urls': 'urls'} + _toPy = {'urls': 'urls'} + def __init__(self, urls=None, **unknown_fields): + ''' + urls : typing.Sequence[~ResolveCharmResult] + ''' + urls_ = [ResolveCharmResult.from_json(o) for o in urls or []] + + # Validate arguments against known Juju API types. + if urls_ is not None and not isinstance(urls_, (bytes, str, list)): + raise Exception("Expected urls_ to be a Sequence, received: {}".format(type(urls_))) + + self.urls = urls_ + self.unknown_fields = 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 + reference : str + switch_charm : bool + ''' + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + reference_ = reference + switch_charm_ = switch_charm + + # Validate arguments against known Juju API types. + 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 reference_ is not None and not isinstance(reference_, (bytes, str)): + raise Exception("Expected reference_ to be a str, received: {}".format(type(reference_))) + + if switch_charm_ is not None and not isinstance(switch_charm_, bool): + raise Exception("Expected switch_charm_ to be a bool, received: {}".format(type(switch_charm_))) + + self.charm_origin = charm_origin_ + self.reference = reference_ + self.switch_charm = switch_charm_ + self.unknown_fields = unknown_fields + + + +class ResolveCharmWithChannelResult(Type): + _toSchema = {'charm_origin': 'charm-origin', 'error': 'error', 'supported_series': 'supported-series', 'url': 'url'} + _toPy = {'charm-origin': 'charm_origin', 'error': 'error', 'supported-series': 'supported_series', 'url': 'url'} + def __init__(self, charm_origin=None, error=None, supported_series=None, url=None, **unknown_fields): + ''' + charm_origin : CharmOrigin + error : Error + supported_series : typing.Sequence[str] + url : str + ''' + charm_origin_ = CharmOrigin.from_json(charm_origin) if charm_origin else None + error_ = Error.from_json(error) if error else None + supported_series_ = supported_series + url_ = url + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if supported_series_ is not None and not isinstance(supported_series_, (bytes, str, list)): + raise Exception("Expected supported_series_ to be a Sequence, received: {}".format(type(supported_series_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.charm_origin = charm_origin_ + self.error = error_ + self.supported_series = supported_series_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class ResolveCharmWithChannelResults(Type): + _toSchema = {'results': 'Results'} + _toPy = {'Results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ResolveCharmWithChannelResult] + ''' + results_ = [ResolveCharmWithChannelResult.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 ResolveCharms(Type): + _toSchema = {'references': 'references'} + _toPy = {'references': 'references'} + def __init__(self, references=None, **unknown_fields): + ''' + references : typing.Sequence[str] + ''' + references_ = references + + # Validate arguments against known Juju API types. + if references_ is not None and not isinstance(references_, (bytes, str, list)): + raise Exception("Expected references_ to be a Sequence, received: {}".format(type(references_))) + + self.references = references_ + self.unknown_fields = 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 + resolve : typing.Sequence[~ResolveCharmWithChannel] + ''' + macaroon_ = Macaroon.from_json(macaroon) if macaroon else None + resolve_ = [ResolveCharmWithChannel.from_json(o) for o in resolve or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.macaroon = macaroon_ + self.resolve = resolve_ + self.unknown_fields = unknown_fields + + + +class Resolved(Type): + _toSchema = {'retry': 'retry', 'unit_name': 'unit-name'} + _toPy = {'retry': 'retry', 'unit-name': 'unit_name'} + def __init__(self, retry=None, unit_name=None, **unknown_fields): + ''' + retry : bool + unit_name : str + ''' + retry_ = retry + unit_name_ = unit_name + + # Validate arguments against known Juju API types. + if retry_ is not None and not isinstance(retry_, bool): + raise Exception("Expected retry_ to be a bool, received: {}".format(type(retry_))) + + if unit_name_ is not None and not isinstance(unit_name_, (bytes, str)): + raise Exception("Expected unit_name_ to be a str, received: {}".format(type(unit_name_))) + + self.retry = retry_ + self.unit_name = unit_name_ + self.unknown_fields = 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 + mode : str + ''' + error_ = Error.from_json(error) if error else None + mode_ = mode + + # 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 mode_ is not None and not isinstance(mode_, (bytes, str)): + raise Exception("Expected mode_ to be a str, received: {}".format(type(mode_))) + + self.error = error_ + self.mode = mode_ + self.unknown_fields = unknown_fields + + + +class ResolvedModeResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ResolvedModeResult] + ''' + results_ = [ResolvedModeResult.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 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 + application : str + description : str + fingerprint : typing.Sequence[int] + id_ : str + name : str + origin : str + path : str + pending_id : str + revision : int + size : int + timestamp : str + type_ : str + username : str + ''' + charmresource_ = CharmResource.from_json(charmresource) if charmresource else None + 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 + + # Validate arguments against known Juju API types. + if charmresource_ is not None and not isinstance(charmresource_, (dict, CharmResource)): + raise Exception("Expected charmresource_ to be a CharmResource, received: {}".format(type(charmresource_))) + + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if fingerprint_ is not None and not isinstance(fingerprint_, (bytes, str, list)): + raise Exception("Expected fingerprint_ to be a Sequence, received: {}".format(type(fingerprint_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if origin_ is not None and not isinstance(origin_, (bytes, str)): + raise Exception("Expected origin_ to be a str, received: {}".format(type(origin_))) + + if path_ is not None and not isinstance(path_, (bytes, str)): + raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + + if pending_id_ is not None and not isinstance(pending_id_, (bytes, str)): + raise Exception("Expected pending_id_ to be a str, received: {}".format(type(pending_id_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if timestamp_ is not None and not isinstance(timestamp_, (bytes, str)): + raise Exception("Expected timestamp_ to be a str, received: {}".format(type(timestamp_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if username_ is not None and not isinstance(username_, (bytes, str)): + raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) + + self.charmresource = charmresource_ + self.application = application_ + self.description = description_ + self.fingerprint = fingerprint_ + self.id_ = id__ + self.name = name_ + self.origin = origin_ + self.path = path_ + self.pending_id = pending_id_ + self.revision = revision_ + self.size = size_ + self.timestamp = timestamp_ + self.type_ = type__ + self.username = username_ + self.unknown_fields = unknown_fields + + + +class ResourceResult(Type): + _toSchema = {'errorresult': 'ErrorResult', 'resource': 'resource'} + _toPy = {'ErrorResult': 'errorresult', 'resource': 'resource'} + def __init__(self, errorresult=None, resource=None, **unknown_fields): + ''' + errorresult : ErrorResult + resource : Resource + ''' + errorresult_ = ErrorResult.from_json(errorresult) if errorresult else None + resource_ = Resource.from_json(resource) if resource else None + + # Validate arguments against known Juju API types. + if errorresult_ is not None and not isinstance(errorresult_, (dict, ErrorResult)): + raise Exception("Expected errorresult_ to be a ErrorResult, received: {}".format(type(errorresult_))) + + if resource_ is not None and not isinstance(resource_, (dict, Resource)): + raise Exception("Expected resource_ to be a Resource, received: {}".format(type(resource_))) + + self.errorresult = errorresult_ + self.resource = resource_ + self.unknown_fields = unknown_fields + + + +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 + charm_store_resources : typing.Sequence[~CharmResource] + error : Error + resources : typing.Sequence[~Resource] + unit_resources : typing.Sequence[~UnitResources] + ''' + errorresult_ = ErrorResult.from_json(errorresult) if errorresult else None + charm_store_resources_ = [CharmResource.from_json(o) for o in charm_store_resources or []] + error_ = Error.from_json(error) if error else None + resources_ = [Resource.from_json(o) for o in resources or []] + unit_resources_ = [UnitResources.from_json(o) for o in unit_resources or []] + + # Validate arguments against known Juju API types. + if errorresult_ is not None and not isinstance(errorresult_, (dict, ErrorResult)): + raise Exception("Expected errorresult_ to be a ErrorResult, received: {}".format(type(errorresult_))) + + if charm_store_resources_ is not None and not isinstance(charm_store_resources_, (bytes, str, list)): + raise Exception("Expected charm_store_resources_ to be a Sequence, received: {}".format(type(charm_store_resources_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + 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 unit_resources_ is not None and not isinstance(unit_resources_, (bytes, str, list)): + raise Exception("Expected unit_resources_ to be a Sequence, received: {}".format(type(unit_resources_))) + + self.errorresult = errorresult_ + self.charm_store_resources = charm_store_resources_ + self.error = error_ + self.resources = resources_ + self.unit_resources = unit_resources_ + self.unknown_fields = unknown_fields + + + +class ResourcesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ResourcesResult] + ''' + results_ = [ResourcesResult.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 RestoreArgs(Type): + _toSchema = {'backup_id': 'backup-id'} + _toPy = {'backup-id': 'backup_id'} + def __init__(self, backup_id=None, **unknown_fields): + ''' + backup_id : str + ''' + backup_id_ = backup_id + + # Validate arguments against known Juju API types. + if backup_id_ is not None and not isinstance(backup_id_, (bytes, str)): + raise Exception("Expected backup_id_ to be a str, received: {}".format(type(backup_id_))) + + self.backup_id = backup_id_ + self.unknown_fields = unknown_fields + + + +class ResumeReplicationParams(Type): + _toSchema = {'members': 'members'} + _toPy = {'members': 'members'} + def __init__(self, members=None, **unknown_fields): + ''' + members : typing.Sequence[~Member] + ''' + members_ = [Member.from_json(o) for o in members or []] + + # Validate arguments against known Juju API types. + if members_ is not None and not isinstance(members_, (bytes, str, list)): + raise Exception("Expected members_ to be a Sequence, received: {}".format(type(members_))) + + self.members = members_ + self.unknown_fields = 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 + max_retry_time : int + min_retry_time : int + retry_time_factor : int + should_retry : bool + ''' + 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 + + # Validate arguments against known Juju API types. + if jitter_retry_time_ is not None and not isinstance(jitter_retry_time_, bool): + raise Exception("Expected jitter_retry_time_ to be a bool, received: {}".format(type(jitter_retry_time_))) + + if max_retry_time_ is not None and not isinstance(max_retry_time_, int): + raise Exception("Expected max_retry_time_ to be a int, received: {}".format(type(max_retry_time_))) + + if min_retry_time_ is not None and not isinstance(min_retry_time_, int): + raise Exception("Expected min_retry_time_ to be a int, received: {}".format(type(min_retry_time_))) + + if retry_time_factor_ is not None and not isinstance(retry_time_factor_, int): + raise Exception("Expected retry_time_factor_ to be a int, received: {}".format(type(retry_time_factor_))) + + if should_retry_ is not None and not isinstance(should_retry_, bool): + raise Exception("Expected should_retry_ to be a bool, received: {}".format(type(should_retry_))) + + self.jitter_retry_time = jitter_retry_time_ + self.max_retry_time = max_retry_time_ + self.min_retry_time = min_retry_time_ + self.retry_time_factor = retry_time_factor_ + self.should_retry = should_retry_ + self.unknown_fields = unknown_fields + + + +class RetryStrategyResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : RetryStrategy + ''' + error_ = Error.from_json(error) if error else None + result_ = RetryStrategy.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, RetryStrategy)): + raise Exception("Expected result_ to be a RetryStrategy, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class RetryStrategyResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~RetryStrategyResult] + ''' + results_ = [RetryStrategyResult.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 RevokeCredentialArg(Type): + _toSchema = {'force': 'force', 'tag': 'tag'} + _toPy = {'force': 'force', 'tag': 'tag'} + def __init__(self, force=None, tag=None, **unknown_fields): + ''' + force : bool + tag : str + ''' + force_ = force + tag_ = tag + + # Validate arguments against known Juju API types. + 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_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.force = force_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class RevokeCredentialArgs(Type): + _toSchema = {'credentials': 'credentials'} + _toPy = {'credentials': 'credentials'} + def __init__(self, credentials=None, **unknown_fields): + ''' + credentials : typing.Sequence[~RevokeCredentialArg] + ''' + credentials_ = [RevokeCredentialArg.from_json(o) for o in credentials or []] + + # Validate arguments against known Juju API types. + if credentials_ is not None and not isinstance(credentials_, (bytes, str, list)): + raise Exception("Expected credentials_ to be a Sequence, received: {}".format(type(credentials_))) + + self.credentials = credentials_ + self.unknown_fields = unknown_fields + + + +class RunParams(Type): + _toSchema = {'applications': 'applications', 'commands': 'commands', 'machines': 'machines', 'timeout': 'timeout', 'units': 'units', 'workload_context': 'workload-context'} + _toPy = {'applications': 'applications', 'commands': 'commands', 'machines': 'machines', 'timeout': 'timeout', 'units': 'units', 'workload-context': 'workload_context'} + def __init__(self, applications=None, commands=None, machines=None, timeout=None, units=None, workload_context=None, **unknown_fields): + ''' + applications : typing.Sequence[str] + commands : str + machines : typing.Sequence[str] + timeout : int + units : typing.Sequence[str] + workload_context : bool + ''' + applications_ = applications + commands_ = commands + machines_ = machines + timeout_ = timeout + units_ = units + workload_context_ = workload_context + + # Validate arguments against known Juju API types. + 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 machines_ is not None and not isinstance(machines_, (bytes, str, list)): + raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + + 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_))) + + self.applications = applications_ + self.commands = commands_ + self.machines = machines_ + self.timeout = timeout_ + self.units = units_ + self.workload_context = workload_context_ + self.unknown_fields = unknown_fields + + + +class SSHAddressResult(Type): + _toSchema = {'address': 'address', 'error': 'error'} + _toPy = {'address': 'address', 'error': 'error'} + def __init__(self, address=None, error=None, **unknown_fields): + ''' + address : str + error : Error + ''' + address_ = address + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if address_ is not None and not isinstance(address_, (bytes, str)): + raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.address = address_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class SSHAddressResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~SSHAddressResult] + ''' + results_ = [SSHAddressResult.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 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] + error : Error + ''' + addresses_ = addresses + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.addresses = addresses_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class SSHAddressesResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~SSHAddressesResult] + ''' + results_ = [SSHAddressesResult.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 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] + ''' + entity_keys_ = [SSHHostKeys.from_json(o) for o in entity_keys or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.entity_keys = entity_keys_ + self.unknown_fields = 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] + tag : str + ''' + public_keys_ = public_keys + tag_ = tag + + # Validate arguments against known Juju API types. + if public_keys_ is not None and not isinstance(public_keys_, (bytes, str, list)): + raise Exception("Expected public_keys_ to be a Sequence, received: {}".format(type(public_keys_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.public_keys = public_keys_ + self.tag = tag_ + self.unknown_fields = 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 + ''' + use_proxy_ = use_proxy + + # Validate arguments against known Juju API types. + if use_proxy_ is not None and not isinstance(use_proxy_, bool): + raise Exception("Expected use_proxy_ to be a bool, received: {}".format(type(use_proxy_))) + + self.use_proxy = use_proxy_ + self.unknown_fields = 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 + public_keys : typing.Sequence[str] + ''' + error_ = Error.from_json(error) if error else None + public_keys_ = public_keys + + # 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 public_keys_ is not None and not isinstance(public_keys_, (bytes, str, list)): + raise Exception("Expected public_keys_ to be a Sequence, received: {}".format(type(public_keys_))) + + self.error = error_ + self.public_keys = public_keys_ + self.unknown_fields = unknown_fields + + + +class SSHPublicKeysResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~SSHPublicKeysResult] + ''' + results_ = [SSHPublicKeysResult.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 ScaleApplicationInfo(Type): + _toSchema = {'num_units': 'num-units'} + _toPy = {'num-units': 'num_units'} + def __init__(self, num_units=None, **unknown_fields): + ''' + num_units : int + ''' + num_units_ = num_units + + # Validate arguments against known Juju API types. + 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_))) + + self.num_units = num_units_ + self.unknown_fields = 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 + force : bool + scale : int + scale_change : int + ''' + application_tag_ = application_tag + force_ = force + scale_ = scale + scale_change_ = scale_change + + # Validate arguments against known Juju API types. + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) + + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if scale_ is not None and not isinstance(scale_, int): + raise Exception("Expected scale_ to be a int, received: {}".format(type(scale_))) + + if scale_change_ is not None and not isinstance(scale_change_, int): + raise Exception("Expected scale_change_ to be a int, received: {}".format(type(scale_change_))) + + self.application_tag = application_tag_ + self.force = force_ + self.scale = scale_ + self.scale_change = scale_change_ + self.unknown_fields = unknown_fields + + + +class ScaleApplicationResult(Type): + _toSchema = {'error': 'error', 'info': 'info'} + _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): + ''' + error : Error + info : ScaleApplicationInfo + ''' + error_ = Error.from_json(error) if error else None + info_ = ScaleApplicationInfo.from_json(info) if info 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 info_ is not None and not isinstance(info_, (dict, ScaleApplicationInfo)): + raise Exception("Expected info_ to be a ScaleApplicationInfo, received: {}".format(type(info_))) + + self.error = error_ + self.info = info_ + self.unknown_fields = unknown_fields + + + +class ScaleApplicationResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ScaleApplicationResult] + ''' + results_ = [ScaleApplicationResult.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 ScaleApplicationsParams(Type): + _toSchema = {'applications': 'applications'} + _toPy = {'applications': 'applications'} + def __init__(self, applications=None, **unknown_fields): + ''' + applications : typing.Sequence[~ScaleApplicationParams] + ''' + applications_ = [ScaleApplicationParams.from_json(o) for o in applications or []] + + # Validate arguments against known Juju API types. + if applications_ is not None and not isinstance(applications_, (bytes, str, list)): + raise Exception("Expected applications_ to be a Sequence, received: {}".format(type(applications_))) + + self.applications = applications_ + self.unknown_fields = unknown_fields + + + +class SecretRotatedArg(Type): + _toSchema = {'url': 'url', 'when': 'when'} + _toPy = {'url': 'url', 'when': 'when'} + def __init__(self, url=None, when=None, **unknown_fields): + ''' + url : str + when : str + ''' + url_ = url + when_ = when + + # Validate arguments against known Juju API types. + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + if when_ is not None and not isinstance(when_, (bytes, str)): + raise Exception("Expected when_ to be a str, received: {}".format(type(when_))) + + self.url = url_ + self.when = when_ + self.unknown_fields = unknown_fields + + + +class SecretRotatedArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~SecretRotatedArg] + ''' + args_ = [SecretRotatedArg.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 SecretRotationChange(Type): + _toSchema = {'last_rotate_time': 'last-rotate-time', 'rotate_interval': 'rotate-interval', 'secret_id': 'secret-id', 'url': 'url'} + _toPy = {'last-rotate-time': 'last_rotate_time', 'rotate-interval': 'rotate_interval', 'secret-id': 'secret_id', 'url': 'url'} + def __init__(self, last_rotate_time=None, rotate_interval=None, secret_id=None, url=None, **unknown_fields): + ''' + last_rotate_time : str + rotate_interval : int + secret_id : int + url : str + ''' + last_rotate_time_ = last_rotate_time + rotate_interval_ = rotate_interval + secret_id_ = secret_id + url_ = url + + # Validate arguments against known Juju API types. + if last_rotate_time_ is not None and not isinstance(last_rotate_time_, (bytes, str)): + raise Exception("Expected last_rotate_time_ to be a str, received: {}".format(type(last_rotate_time_))) + + if rotate_interval_ is not None and not isinstance(rotate_interval_, int): + raise Exception("Expected rotate_interval_ to be a int, received: {}".format(type(rotate_interval_))) + + if secret_id_ is not None and not isinstance(secret_id_, int): + raise Exception("Expected secret_id_ to be a int, received: {}".format(type(secret_id_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.last_rotate_time = last_rotate_time_ + self.rotate_interval = rotate_interval_ + self.secret_id = secret_id_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class SecretRotationWatchResult(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[~SecretRotationChange] + error : Error + watcher_id : str + ''' + changes_ = [SecretRotationChange.from_json(o) for o in changes or []] + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class SecretRotationWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~SecretRotationWatchResult] + ''' + results_ = [SecretRotationWatchResult.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 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] + error : Error + ''' + data_ = data + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.data = data_ + self.error = error_ + self.unknown_fields = unknown_fields + + + +class SecretValueResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~SecretValueResult] + ''' + results_ = [SecretValueResult.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 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] + charms : typing.Sequence[str] + resources : typing.Sequence[~SerializedModelResource] + tools : typing.Sequence[~SerializedModelTools] + ''' + bytes__ = bytes_ + charms_ = charms + resources_ = [SerializedModelResource.from_json(o) for o in resources or []] + tools_ = [SerializedModelTools.from_json(o) for o in tools or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.bytes_ = bytes__ + self.charms = charms_ + self.resources = resources_ + self.tools = tools_ + self.unknown_fields = unknown_fields + + + +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 + application_revision : SerializedModelResourceRevision + charmstore_revision : SerializedModelResourceRevision + name : str + unit_revisions : typing.Mapping[str, ~SerializedModelResourceRevision] + ''' + application_ = application + application_revision_ = SerializedModelResourceRevision.from_json(application_revision) if application_revision else None + charmstore_revision_ = SerializedModelResourceRevision.from_json(charmstore_revision) if charmstore_revision else None + name_ = name + unit_revisions_ = {k: SerializedModelResourceRevision.from_json(v) for k, v in (unit_revisions or dict()).items()} + + # Validate arguments against known Juju API types. + if application_ is not None and not isinstance(application_, (bytes, str)): + raise Exception("Expected application_ to be a str, received: {}".format(type(application_))) + + if application_revision_ is not None and not isinstance(application_revision_, (dict, SerializedModelResourceRevision)): + raise Exception("Expected application_revision_ to be a SerializedModelResourceRevision, received: {}".format(type(application_revision_))) + + if charmstore_revision_ is not None and not isinstance(charmstore_revision_, (dict, SerializedModelResourceRevision)): + raise Exception("Expected charmstore_revision_ to be a SerializedModelResourceRevision, received: {}".format(type(charmstore_revision_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if unit_revisions_ is not None and not isinstance(unit_revisions_, dict): + raise Exception("Expected unit_revisions_ to be a Mapping, received: {}".format(type(unit_revisions_))) + + self.application = application_ + self.application_revision = application_revision_ + self.charmstore_revision = charmstore_revision_ + self.name = name_ + self.unit_revisions = unit_revisions_ + self.unknown_fields = unknown_fields + + + +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 + fingerprint : str + origin : str + path : str + revision : int + size : int + timestamp : str + type_ : str + username : str + ''' + description_ = description + fingerprint_ = fingerprint + origin_ = origin + path_ = path + revision_ = revision + size_ = size + timestamp_ = timestamp + type__ = type_ + username_ = username + + # Validate arguments against known Juju API types. + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if fingerprint_ is not None and not isinstance(fingerprint_, (bytes, str)): + raise Exception("Expected fingerprint_ to be a str, received: {}".format(type(fingerprint_))) + + if origin_ is not None and not isinstance(origin_, (bytes, str)): + raise Exception("Expected origin_ to be a str, received: {}".format(type(origin_))) + + if path_ is not None and not isinstance(path_, (bytes, str)): + raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + + if revision_ is not None and not isinstance(revision_, int): + raise Exception("Expected revision_ to be a int, received: {}".format(type(revision_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if timestamp_ is not None and not isinstance(timestamp_, (bytes, str)): + raise Exception("Expected timestamp_ to be a str, received: {}".format(type(timestamp_))) + + if type__ is not None and not isinstance(type__, (bytes, str)): + raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + + if username_ is not None and not isinstance(username_, (bytes, str)): + raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) + + self.description = description_ + self.fingerprint = fingerprint_ + self.origin = origin_ + self.path = path_ + self.revision = revision_ + self.size = size_ + self.timestamp = timestamp_ + self.type_ = type__ + self.username = username_ + self.unknown_fields = unknown_fields + + + +class SerializedModelTools(Type): + _toSchema = {'uri': 'uri', 'version': 'version'} + _toPy = {'uri': 'uri', 'version': 'version'} + def __init__(self, uri=None, version=None, **unknown_fields): + ''' + uri : str + version : str + ''' + uri_ = uri + version_ = version + + # Validate arguments against known Juju API types. + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + + self.uri = uri_ + self.version = version_ + self.unknown_fields = 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 + constraints : Value + ''' + application_ = application + constraints_ = Value.from_json(constraints) if constraints else None + + # Validate arguments against known Juju API types. + 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_))) + + self.application = application_ + self.constraints = constraints_ + self.unknown_fields = unknown_fields + + + +class SetExternalControllerInfoParams(Type): + _toSchema = {'info': 'info'} + _toPy = {'info': 'info'} + def __init__(self, info=None, **unknown_fields): + ''' + info : ExternalControllerInfo + ''' + info_ = ExternalControllerInfo.from_json(info) if info else None + + # Validate arguments against known Juju API types. + if info_ is not None and not isinstance(info_, (dict, ExternalControllerInfo)): + raise Exception("Expected info_ to be a ExternalControllerInfo, received: {}".format(type(info_))) + + self.info = info_ + self.unknown_fields = unknown_fields + + + +class SetExternalControllersInfoParams(Type): + _toSchema = {'controllers': 'controllers'} + _toPy = {'controllers': 'controllers'} + def __init__(self, controllers=None, **unknown_fields): + ''' + controllers : typing.Sequence[~SetExternalControllerInfoParams] + ''' + controllers_ = [SetExternalControllerInfoParams.from_json(o) for o in controllers or []] + + # Validate arguments against known Juju API types. + if controllers_ is not None and not isinstance(controllers_, (bytes, str, list)): + raise Exception("Expected controllers_ to be a Sequence, received: {}".format(type(controllers_))) + + self.controllers = controllers_ + self.unknown_fields = 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] + ''' + machine_block_devices_ = [MachineBlockDevices.from_json(o) for o in machine_block_devices or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.machine_block_devices = machine_block_devices_ + self.unknown_fields = 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] + tag : str + ''' + config_ = [NetworkConfig.from_json(o) for o in config or []] + tag_ = tag + + # Validate arguments against known Juju API types. + 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_))) + + self.config = config_ + self.tag = tag_ + self.unknown_fields = 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] + ''' + machine_addresses_ = [MachineAddresses.from_json(o) for o in machine_addresses or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.machine_addresses = machine_addresses_ + self.unknown_fields = unknown_fields + + + +class SetMigrationPhaseArgs(Type): + _toSchema = {'phase': 'phase'} + _toPy = {'phase': 'phase'} + def __init__(self, phase=None, **unknown_fields): + ''' + phase : str + ''' + phase_ = phase + + # Validate arguments against known Juju API types. + if phase_ is not None and not isinstance(phase_, (bytes, str)): + raise Exception("Expected phase_ to be a str, received: {}".format(type(phase_))) + + self.phase = phase_ + self.unknown_fields = unknown_fields + + + +class SetMigrationStatusMessageArgs(Type): + _toSchema = {'message': 'message'} + _toPy = {'message': 'message'} + def __init__(self, message=None, **unknown_fields): + ''' + message : str + ''' + message_ = message + + # Validate arguments against known Juju API types. + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + self.message = message_ + self.unknown_fields = unknown_fields + + + +class SetModelAgentVersion(Type): + _toSchema = {'agent_stream': 'agent-stream', 'force': 'force', 'version': 'version'} + _toPy = {'agent-stream': 'agent_stream', 'force': 'force', 'version': 'version'} + def __init__(self, agent_stream=None, force=None, version=None, **unknown_fields): + ''' + agent_stream : str + force : bool + version : Number + ''' + agent_stream_ = agent_stream + force_ = force + version_ = Number.from_json(version) if version else None + + # Validate arguments against known Juju API types. + 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 force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if version_ is not None and not isinstance(version_, (dict, Number)): + raise Exception("Expected version_ to be a Number, received: {}".format(type(version_))) + + self.agent_stream = agent_stream_ + self.force = force_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class SetModelDefaults(Type): + _toSchema = {'config': 'config'} + _toPy = {'config': 'config'} + def __init__(self, config=None, **unknown_fields): + ''' + config : typing.Sequence[~ModelDefaultValues] + ''' + config_ = [ModelDefaultValues.from_json(o) for o in config or []] + + # Validate arguments against known Juju API types. + if config_ is not None and not isinstance(config_, (bytes, str, list)): + raise Exception("Expected config_ to be a Sequence, received: {}".format(type(config_))) + + self.config = config_ + self.unknown_fields = 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 + version : int + ''' + model_tag_ = model_tag + version_ = version + + # Validate arguments against known Juju API types. + 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 version_ is not None and not isinstance(version_, int): + raise Exception("Expected version_ to be a int, received: {}".format(type(version_))) + + self.model_tag = model_tag_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class SetModelEnvironVersions(Type): + _toSchema = {'models': 'models'} + _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): + ''' + models : typing.Sequence[~SetModelEnvironVersion] + ''' + models_ = [SetModelEnvironVersion.from_json(o) for o in models or []] + + # Validate arguments against known Juju API types. + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + self.models = models_ + self.unknown_fields = 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 + status : str + tag : str + ''' + entity_ = Entity.from_json(entity) if entity else None + status_ = status + tag_ = tag + + # Validate arguments against known Juju API types. + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.entity = entity_ + self.status = status_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class SetPayloadStatusArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~SetPayloadStatusArg] + ''' + args_ = [SetPayloadStatusArg.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 SetPodSpecParams(Type): + _toSchema = {'specs': 'specs'} + _toPy = {'specs': 'specs'} + def __init__(self, specs=None, **unknown_fields): + ''' + specs : typing.Sequence[~EntityString] + ''' + specs_ = [EntityString.from_json(o) for o in specs or []] + + # Validate arguments against known Juju API types. + if specs_ is not None and not isinstance(specs_, (bytes, str, list)): + raise Exception("Expected specs_ to be a Sequence, received: {}".format(type(specs_))) + + self.specs = specs_ + self.unknown_fields = unknown_fields + + + +class SetPodSpecParamsV2(Type): + _toSchema = {'specs': 'specs'} + _toPy = {'specs': 'specs'} + def __init__(self, specs=None, **unknown_fields): + ''' + specs : typing.Sequence[~PodSpec] + ''' + specs_ = [PodSpec.from_json(o) for o in specs or []] + + # Validate arguments against known Juju API types. + if specs_ is not None and not isinstance(specs_, (bytes, str, list)): + raise Exception("Expected specs_ to be a Sequence, received: {}".format(type(specs_))) + + self.specs = specs_ + self.unknown_fields = 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 + profiles : typing.Sequence[str] + ''' + entity_ = Entity.from_json(entity) if entity else None + profiles_ = profiles + + # Validate arguments against known Juju API types. + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) + + if profiles_ is not None and not isinstance(profiles_, (bytes, str, list)): + raise Exception("Expected profiles_ to be a Sequence, received: {}".format(type(profiles_))) + + self.entity = entity_ + self.profiles = profiles_ + self.unknown_fields = unknown_fields + + + +class SetProfileArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~SetProfileArg] + ''' + args_ = [SetProfileArg.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 SetProfileUpgradeCompleteArg(Type): + _toSchema = {'entity': 'entity', 'message': 'message'} + _toPy = {'entity': 'entity', 'message': 'message'} + def __init__(self, entity=None, message=None, **unknown_fields): + ''' + entity : Entity + message : str + ''' + entity_ = Entity.from_json(entity) if entity else None + message_ = message + + # Validate arguments against known Juju API types. + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + self.entity = entity_ + self.message = message_ + self.unknown_fields = unknown_fields + + + +class SetProfileUpgradeCompleteArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~SetProfileUpgradeCompleteArg] + ''' + args_ = [SetProfileUpgradeCompleteArg.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 SetProviderNetworkConfig(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~ProviderNetworkConfig] + ''' + args_ = [ProviderNetworkConfig.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 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] + error : Error + modified : bool + ''' + addresses_ = [Address.from_json(o) for o in addresses or []] + error_ = Error.from_json(error) if error else None + modified_ = modified + + # Validate arguments against known Juju API types. + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if modified_ is not None and not isinstance(modified_, bool): + raise Exception("Expected modified_ to be a bool, received: {}".format(type(modified_))) + + self.addresses = addresses_ + self.error = error_ + self.modified = modified_ + self.unknown_fields = unknown_fields + + + +class SetProviderNetworkConfigResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~SetProviderNetworkConfigResult] + ''' + results_ = [SetProviderNetworkConfigResult.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 SetStatus(Type): + _toSchema = {'entities': 'entities'} + _toPy = {'entities': 'entities'} + def __init__(self, entities=None, **unknown_fields): + ''' + entities : typing.Sequence[~EntityStatusArgs] + ''' + entities_ = [EntityStatusArgs.from_json(o) for o in entities or []] + + # Validate arguments against known Juju API types. + if entities_ is not None and not isinstance(entities_, (bytes, str, list)): + raise Exception("Expected entities_ to be a Sequence, received: {}".format(type(entities_))) + + self.entities = entities_ + self.unknown_fields = unknown_fields + + + +class SetStatusArg(Type): + _toSchema = {'entity': 'Entity', 'status': 'status'} + _toPy = {'Entity': 'entity', 'status': 'status'} + def __init__(self, entity=None, status=None, **unknown_fields): + ''' + entity : Entity + status : str + ''' + entity_ = Entity.from_json(entity) if entity else None + status_ = status + + # Validate arguments against known Juju API types. + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.entity = entity_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class SetStatusArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~SetStatusArg] + ''' + args_ = [SetStatusArg.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 SetUnitStateArg(Type): + _toSchema = {'charm_state': 'charm-state', 'meter_status_state': 'meter-status-state', 'relation_state': 'relation-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', 'storage-state': 'storage_state', 'tag': 'tag', 'uniter-state': 'uniter_state'} + def __init__(self, charm_state=None, meter_status_state=None, relation_state=None, storage_state=None, tag=None, uniter_state=None, **unknown_fields): + ''' + charm_state : typing.Mapping[str, str] + meter_status_state : str + relation_state : typing.Mapping[str, str] + storage_state : str + tag : str + uniter_state : str + ''' + charm_state_ = charm_state + meter_status_state_ = meter_status_state + relation_state_ = relation_state + storage_state_ = storage_state + tag_ = tag + uniter_state_ = uniter_state + + # Validate arguments against known Juju API types. + if charm_state_ is not None and not isinstance(charm_state_, dict): + raise Exception("Expected charm_state_ to be a Mapping, received: {}".format(type(charm_state_))) + + if meter_status_state_ is not None and not isinstance(meter_status_state_, (bytes, str)): + raise Exception("Expected meter_status_state_ to be a str, received: {}".format(type(meter_status_state_))) + + if relation_state_ is not None and not isinstance(relation_state_, dict): + raise Exception("Expected relation_state_ to be a Mapping, received: {}".format(type(relation_state_))) + + if storage_state_ is not None and not isinstance(storage_state_, (bytes, str)): + raise Exception("Expected storage_state_ to be a str, received: {}".format(type(storage_state_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if uniter_state_ is not None and not isinstance(uniter_state_, (bytes, str)): + raise Exception("Expected uniter_state_ to be a str, received: {}".format(type(uniter_state_))) + + self.charm_state = charm_state_ + self.meter_status_state = meter_status_state_ + self.relation_state = relation_state_ + self.storage_state = storage_state_ + self.tag = tag_ + self.uniter_state = uniter_state_ + self.unknown_fields = unknown_fields + + + +class SetUnitStateArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~SetUnitStateArg] + ''' + args_ = [SetUnitStateArg.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 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 + ftp : str + http : str + https : str + noproxy : str + ''' + autonoproxy_ = autonoproxy + ftp_ = ftp + http_ = http + https_ = https + noproxy_ = noproxy + + # Validate arguments against known Juju API types. + if autonoproxy_ is not None and not isinstance(autonoproxy_, (bytes, str)): + raise Exception("Expected autonoproxy_ to be a str, received: {}".format(type(autonoproxy_))) + + if ftp_ is not None and not isinstance(ftp_, (bytes, str)): + raise Exception("Expected ftp_ to be a str, received: {}".format(type(ftp_))) + + if http_ is not None and not isinstance(http_, (bytes, str)): + raise Exception("Expected http_ to be a str, received: {}".format(type(http_))) + + if https_ is not None and not isinstance(https_, (bytes, str)): + raise Exception("Expected https_ to be a str, received: {}".format(type(https_))) + + if noproxy_ is not None and not isinstance(noproxy_, (bytes, str)): + raise Exception("Expected noproxy_ to be a str, received: {}".format(type(noproxy_))) + + self.autonoproxy = autonoproxy_ + self.ftp = ftp_ + self.http = http_ + self.https = https_ + self.noproxy = noproxy_ + self.unknown_fields = unknown_fields + + + +class SettingsResult(Type): + _toSchema = {'error': 'error', 'settings': 'settings'} + _toPy = {'error': 'error', 'settings': 'settings'} + def __init__(self, error=None, settings=None, **unknown_fields): + ''' + error : Error + settings : typing.Mapping[str, str] + ''' + error_ = Error.from_json(error) if error else None + settings_ = settings + + # 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 settings_ is not None and not isinstance(settings_, dict): + raise Exception("Expected settings_ to be a Mapping, received: {}".format(type(settings_))) + + self.error = error_ + self.settings = settings_ + self.unknown_fields = unknown_fields + + + +class SettingsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~SettingsResult] + ''' + results_ = [SettingsResult.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 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] + error : Error + machine_count : int + space : Space + ''' + applications_ = applications + error_ = Error.from_json(error) if error else None + machine_count_ = machine_count + space_ = Space.from_json(space) if space else None + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if machine_count_ is not None and not isinstance(machine_count_, int): + raise Exception("Expected machine_count_ to be a int, received: {}".format(type(machine_count_))) + + if space_ is not None and not isinstance(space_, (dict, Space)): + raise Exception("Expected space_ to be a Space, received: {}".format(type(space_))) + + self.applications = applications_ + self.error = error_ + self.machine_count = machine_count_ + self.space = space_ + self.unknown_fields = unknown_fields + + + +class ShowSpaceResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ShowSpaceResult] + ''' + results_ = [ShowSpaceResult.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 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 + duration : int + entity_tag : str + ''' + claimant_tag_ = claimant_tag + duration_ = duration + entity_tag_ = entity_tag + + # Validate arguments against known Juju API types. + if claimant_tag_ is not None and not isinstance(claimant_tag_, (bytes, str)): + raise Exception("Expected claimant_tag_ to be a str, received: {}".format(type(claimant_tag_))) + + if duration_ is not None and not isinstance(duration_, int): + raise Exception("Expected duration_ to be a int, received: {}".format(type(duration_))) + + if entity_tag_ is not None and not isinstance(entity_tag_, (bytes, str)): + raise Exception("Expected entity_tag_ to be a str, received: {}".format(type(entity_tag_))) + + self.claimant_tag = claimant_tag_ + self.duration = duration_ + self.entity_tag = entity_tag_ + self.unknown_fields = unknown_fields + + + +class SingularClaims(Type): + _toSchema = {'claims': 'claims'} + _toPy = {'claims': 'claims'} + def __init__(self, claims=None, **unknown_fields): + ''' + claims : typing.Sequence[~SingularClaim] + ''' + claims_ = [SingularClaim.from_json(o) for o in claims or []] + + # Validate arguments against known Juju API types. + if claims_ is not None and not isinstance(claims_, (bytes, str, list)): + raise Exception("Expected claims_ to be a Sequence, received: {}".format(type(claims_))) + + self.claims = claims_ + self.unknown_fields = 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 + id_ : str + name : str + subnets : typing.Sequence[~Subnet] + ''' + error_ = Error.from_json(error) if error else None + id__ = id_ + name_ = name + subnets_ = [Subnet.from_json(o) for o in subnets or []] + + # 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 id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): + raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) + + self.error = error_ + self.id_ = id__ + self.name = name_ + self.subnets = subnets_ + self.unknown_fields = unknown_fields + + + +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 + name : str + provider_id : str + subnets : typing.Sequence[~SubnetV3] + ''' + id__ = id_ + name_ = name + provider_id_ = provider_id + subnets_ = [SubnetV3.from_json(o) for o in subnets or []] + + # Validate arguments against known Juju API types. + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): + raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) + + self.id_ = id__ + self.name = name_ + self.provider_id = provider_id_ + self.subnets = subnets_ + self.unknown_fields = unknown_fields + + + +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] + ''' + space_infos_ = [SpaceInfo.from_json(o) for o in space_infos or []] + + # Validate arguments against known Juju API types. + if space_infos_ is not None and not isinstance(space_infos_, (bytes, str, list)): + raise Exception("Expected space_infos_ to be a Sequence, received: {}".format(type(space_infos_))) + + self.space_infos = space_infos_ + self.unknown_fields = 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] + ''' + space_ids_ = space_ids + + # Validate arguments against known Juju API types. + 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_))) + + self.space_ids = space_ids_ + self.unknown_fields = unknown_fields + + + +class SpaceResult(Type): + _toSchema = {'error': 'error', 'tag': 'tag'} + _toPy = {'error': 'error', 'tag': 'tag'} + def __init__(self, error=None, tag=None, **unknown_fields): + ''' + error : Error + tag : str + ''' + error_ = Error.from_json(error) if error else None + tag_ = tag + + # 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 tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.error = error_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class SpaceResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~SpaceResult] + ''' + results_ = [SpaceResult.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 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 + ca_private_key : str + cert : str + controller_api_port : int + private_key : str + shared_secret : str + state_port : int + system_identity : str + ''' + 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 + + # Validate arguments against known Juju API types. + if api_port_ is not None and not isinstance(api_port_, int): + raise Exception("Expected api_port_ to be a int, received: {}".format(type(api_port_))) + + if ca_private_key_ is not None and not isinstance(ca_private_key_, (bytes, str)): + raise Exception("Expected ca_private_key_ to be a str, received: {}".format(type(ca_private_key_))) + + if cert_ is not None and not isinstance(cert_, (bytes, str)): + raise Exception("Expected cert_ to be a str, received: {}".format(type(cert_))) + + if controller_api_port_ is not None and not isinstance(controller_api_port_, int): + raise Exception("Expected controller_api_port_ to be a int, received: {}".format(type(controller_api_port_))) + + if private_key_ is not None and not isinstance(private_key_, (bytes, str)): + raise Exception("Expected private_key_ to be a str, received: {}".format(type(private_key_))) + + if shared_secret_ is not None and not isinstance(shared_secret_, (bytes, str)): + raise Exception("Expected shared_secret_ to be a str, received: {}".format(type(shared_secret_))) + + if state_port_ is not None and not isinstance(state_port_, int): + raise Exception("Expected state_port_ to be a int, received: {}".format(type(state_port_))) + + if system_identity_ is not None and not isinstance(system_identity_, (bytes, str)): + raise Exception("Expected system_identity_ to be a str, received: {}".format(type(system_identity_))) + + self.api_port = api_port_ + self.ca_private_key = ca_private_key_ + self.cert = cert_ + self.controller_api_port = controller_api_port_ + self.private_key = private_key_ + self.shared_secret = shared_secret_ + self.state_port = state_port_ + self.system_identity = system_identity_ + self.unknown_fields = unknown_fields + + + +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 + delta : int + exclude : typing.Sequence[str] + size : int + ''' + date_ = date + delta_ = delta + exclude_ = exclude + size_ = size + + # Validate arguments against known Juju API types. + if date_ is not None and not isinstance(date_, (bytes, str)): + raise Exception("Expected date_ to be a str, received: {}".format(type(date_))) + + if delta_ is not None and not isinstance(delta_, int): + raise Exception("Expected delta_ to be a int, received: {}".format(type(delta_))) + + if exclude_ is not None and not isinstance(exclude_, (bytes, str, list)): + raise Exception("Expected exclude_ to be a Sequence, received: {}".format(type(exclude_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + self.date = date_ + self.delta = delta_ + self.exclude = exclude_ + self.size = size_ + self.unknown_fields = unknown_fields + + + +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 + max_history_time : int + ''' + max_history_mb_ = max_history_mb + max_history_time_ = max_history_time + + # Validate arguments against known Juju API types. + 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_))) + + self.max_history_mb = max_history_mb_ + self.max_history_time = max_history_time_ + self.unknown_fields = 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 + historykind : str + size : int + tag : str + ''' + filter__ = StatusHistoryFilter.from_json(filter_) if filter_ else None + historykind_ = historykind + size_ = size + tag_ = tag + + # Validate arguments against known Juju API types. + if filter__ is not None and not isinstance(filter__, (dict, StatusHistoryFilter)): + raise Exception("Expected filter__ to be a StatusHistoryFilter, received: {}".format(type(filter__))) + + if historykind_ is not None and not isinstance(historykind_, (bytes, str)): + raise Exception("Expected historykind_ to be a str, received: {}".format(type(historykind_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.filter_ = filter__ + self.historykind = historykind_ + self.size = size_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class StatusHistoryRequests(Type): + _toSchema = {'requests': 'requests'} + _toPy = {'requests': 'requests'} + def __init__(self, requests=None, **unknown_fields): + ''' + requests : typing.Sequence[~StatusHistoryRequest] + ''' + requests_ = [StatusHistoryRequest.from_json(o) for o in requests or []] + + # Validate arguments against known Juju API types. + if requests_ is not None and not isinstance(requests_, (bytes, str, list)): + raise Exception("Expected requests_ to be a Sequence, received: {}".format(type(requests_))) + + self.requests = requests_ + self.unknown_fields = 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 + history : History + ''' + error_ = Error.from_json(error) if error else None + history_ = History.from_json(history) if history 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 history_ is not None and not isinstance(history_, (dict, History)): + raise Exception("Expected history_ to be a History, received: {}".format(type(history_))) + + self.error = error_ + self.history = history_ + self.unknown_fields = unknown_fields + + + +class StatusHistoryResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~StatusHistoryResult] + ''' + results_ = [StatusHistoryResult.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 StatusParams(Type): + _toSchema = {'patterns': 'patterns'} + _toPy = {'patterns': 'patterns'} + def __init__(self, patterns=None, **unknown_fields): + ''' + patterns : typing.Sequence[str] + ''' + patterns_ = patterns + + # Validate arguments against known Juju API types. + if patterns_ is not None and not isinstance(patterns_, (bytes, str, list)): + raise Exception("Expected patterns_ to be a Sequence, received: {}".format(type(patterns_))) + + self.patterns = patterns_ + self.unknown_fields = 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] + error : Error + id_ : str + info : str + life : str + since : str + status : str + ''' + data_ = data + error_ = Error.from_json(error) if error else None + id__ = id_ + info_ = info + life_ = life + since_ = since + status_ = status + + # Validate arguments against known Juju API types. + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if info_ is not None and not isinstance(info_, (bytes, str)): + raise Exception("Expected info_ to be a str, received: {}".format(type(info_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if since_ is not None and not isinstance(since_, (bytes, str)): + raise Exception("Expected since_ to be a str, received: {}".format(type(since_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.data = data_ + self.error = error_ + self.id_ = id__ + self.info = info_ + self.life = life_ + self.since = since_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class StatusResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~StatusResult] + ''' + results_ = [StatusResult.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 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 + storage : StorageConstraints + unit : str + ''' + name_ = name + storage_ = StorageConstraints.from_json(storage) if storage else None + unit_ = unit + + # Validate arguments against known Juju API types. + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if storage_ is not None and not isinstance(storage_, (dict, StorageConstraints)): + raise Exception("Expected storage_ to be a StorageConstraints, received: {}".format(type(storage_))) + + if unit_ is not None and not isinstance(unit_, (bytes, str)): + raise Exception("Expected unit_ to be a str, received: {}".format(type(unit_))) + + self.name = name_ + self.storage = storage_ + self.unit = unit_ + self.unknown_fields = 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 + life : str + location : str + owner_tag : str + storage_tag : str + unit_tag : str + ''' + kind_ = kind + life_ = life + location_ = location + owner_tag_ = owner_tag + storage_tag_ = storage_tag + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if kind_ is not None and not isinstance(kind_, int): + raise Exception("Expected kind_ to be a int, received: {}".format(type(kind_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if location_ is not None and not isinstance(location_, (bytes, str)): + raise Exception("Expected location_ to be a str, received: {}".format(type(location_))) + + 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 storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): + raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.kind = kind_ + self.life = life_ + self.location = location_ + self.owner_tag = owner_tag_ + self.storage_tag = storage_tag_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +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 + location : str + machine_tag : str + storage_tag : str + unit_tag : str + ''' + life_ = life + location_ = location + machine_tag_ = machine_tag + storage_tag_ = storage_tag + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if location_ is not None and not isinstance(location_, (bytes, str)): + raise Exception("Expected location_ to be a str, received: {}".format(type(location_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + if storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): + raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.life = life_ + self.location = location_ + self.machine_tag = machine_tag_ + self.storage_tag = storage_tag_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +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 + unit_tag : str + ''' + storage_tag_ = storage_tag + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): + raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.storage_tag = storage_tag_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +class StorageAttachmentIds(Type): + _toSchema = {'ids': 'ids'} + _toPy = {'ids': 'ids'} + def __init__(self, ids=None, **unknown_fields): + ''' + ids : typing.Sequence[~StorageAttachmentId] + ''' + ids_ = [StorageAttachmentId.from_json(o) for o in ids or []] + + # Validate arguments against known Juju API types. + if ids_ is not None and not isinstance(ids_, (bytes, str, list)): + raise Exception("Expected ids_ to be a Sequence, received: {}".format(type(ids_))) + + self.ids = ids_ + self.unknown_fields = 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 + result : StorageAttachmentIds + ''' + error_ = Error.from_json(error) if error else None + result_ = StorageAttachmentIds.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, StorageAttachmentIds)): + raise Exception("Expected result_ to be a StorageAttachmentIds, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class StorageAttachmentIdsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~StorageAttachmentIdsResult] + ''' + results_ = [StorageAttachmentIdsResult.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 StorageAttachmentResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : StorageAttachment + ''' + error_ = Error.from_json(error) if error else None + result_ = StorageAttachment.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, StorageAttachment)): + raise Exception("Expected result_ to be a StorageAttachment, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class StorageAttachmentResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~StorageAttachmentResult] + ''' + results_ = [StorageAttachmentResult.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 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 + pool : str + size : int + ''' + count_ = count + pool_ = pool + size_ = size + + # Validate arguments against known Juju API types. + if count_ is not None and not isinstance(count_, int): + raise Exception("Expected count_ to be a int, received: {}".format(type(count_))) + + if pool_ is not None and not isinstance(pool_, (bytes, str)): + raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + self.count = count_ + self.pool = pool_ + self.size = size_ + self.unknown_fields = 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 + ids : StorageAttachmentIds + max_wait : int + ''' + force_ = force + ids_ = StorageAttachmentIds.from_json(ids) if ids else None + max_wait_ = max_wait + + # Validate arguments against known Juju API types. + 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_))) + + self.force = force_ + self.ids = ids_ + self.max_wait = max_wait_ + self.unknown_fields = 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] + kind : int + life : str + owner_tag : str + persistent : bool + status : EntityStatus + storage_tag : str + ''' + attachments_ = {k: StorageAttachmentDetails.from_json(v) for k, v in (attachments or dict()).items()} + kind_ = kind + life_ = life + owner_tag_ = owner_tag + persistent_ = persistent + status_ = EntityStatus.from_json(status) if status else None + storage_tag_ = storage_tag + + # Validate arguments against known Juju API types. + if attachments_ is not None and not isinstance(attachments_, dict): + raise Exception("Expected attachments_ to be a Mapping, received: {}".format(type(attachments_))) + + if kind_ is not None and not isinstance(kind_, int): + raise Exception("Expected kind_ to be a int, received: {}".format(type(kind_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + 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 persistent_ is not None and not isinstance(persistent_, bool): + raise Exception("Expected persistent_ to be a bool, received: {}".format(type(persistent_))) + + if status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + if storage_tag_ is not None and not isinstance(storage_tag_, (bytes, str)): + raise Exception("Expected storage_tag_ to be a str, received: {}".format(type(storage_tag_))) + + self.attachments = attachments_ + self.kind = kind_ + self.life = life_ + self.owner_tag = owner_tag_ + self.persistent = persistent_ + self.status = status_ + self.storage_tag = storage_tag_ + self.unknown_fields = unknown_fields + + + +class StorageDetailsListResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : typing.Sequence[~StorageDetails] + ''' + error_ = Error.from_json(error) if error else None + result_ = [StorageDetails.from_json(o) for o in result or []] + + # 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_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class StorageDetailsListResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~StorageDetailsListResult] + ''' + results_ = [StorageDetailsListResult.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 StorageDetailsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : StorageDetails + ''' + error_ = Error.from_json(error) if error else None + result_ = StorageDetails.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, StorageDetails)): + raise Exception("Expected result_ to be a StorageDetails, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class StorageDetailsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~StorageDetailsResult] + ''' + results_ = [StorageDetailsResult.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 StorageFilter(Type): + _toSchema = {} + _toPy = {} + def __init__(self, **unknown_fields): + ''' + + ''' + self.unknown_fields = unknown_fields + + + +class StorageFilters(Type): + _toSchema = {'filters': 'filters'} + _toPy = {'filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): + ''' + filters : typing.Sequence[~StorageFilter] + ''' + filters_ = [StorageFilter.from_json(o) for o in filters or []] + + # Validate arguments against known Juju API types. + if filters_ is not None and not isinstance(filters_, (bytes, str, list)): + raise Exception("Expected filters_ to be a Sequence, received: {}".format(type(filters_))) + + self.filters = filters_ + self.unknown_fields = 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] + name : str + provider : str + ''' + attrs_ = attrs + name_ = name + provider_ = provider + + # Validate arguments against known Juju API types. + if attrs_ is not None and not isinstance(attrs_, dict): + raise Exception("Expected attrs_ to be a Mapping, received: {}".format(type(attrs_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + self.attrs = attrs_ + self.name = name_ + self.provider = provider_ + self.unknown_fields = unknown_fields + + + +class StoragePoolArgs(Type): + _toSchema = {'pools': 'pools'} + _toPy = {'pools': 'pools'} + def __init__(self, pools=None, **unknown_fields): + ''' + pools : typing.Sequence[~StoragePool] + ''' + pools_ = [StoragePool.from_json(o) for o in pools or []] + + # Validate arguments against known Juju API types. + if pools_ is not None and not isinstance(pools_, (bytes, str, list)): + raise Exception("Expected pools_ to be a Sequence, received: {}".format(type(pools_))) + + self.pools = pools_ + self.unknown_fields = unknown_fields + + + +class StoragePoolDeleteArg(Type): + _toSchema = {'name': 'name'} + _toPy = {'name': 'name'} + def __init__(self, name=None, **unknown_fields): + ''' + name : str + ''' + name_ = name + + # Validate arguments against known Juju API types. + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + self.name = name_ + self.unknown_fields = unknown_fields + + + +class StoragePoolDeleteArgs(Type): + _toSchema = {'pools': 'pools'} + _toPy = {'pools': 'pools'} + def __init__(self, pools=None, **unknown_fields): + ''' + pools : typing.Sequence[~StoragePoolDeleteArg] + ''' + pools_ = [StoragePoolDeleteArg.from_json(o) for o in pools or []] + + # Validate arguments against known Juju API types. + if pools_ is not None and not isinstance(pools_, (bytes, str, list)): + raise Exception("Expected pools_ to be a Sequence, received: {}".format(type(pools_))) + + self.pools = pools_ + self.unknown_fields = 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] + providers : typing.Sequence[str] + ''' + names_ = names + providers_ = providers + + # Validate arguments against known Juju API types. + 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 providers_ is not None and not isinstance(providers_, (bytes, str, list)): + raise Exception("Expected providers_ to be a Sequence, received: {}".format(type(providers_))) + + self.names = names_ + self.providers = providers_ + self.unknown_fields = unknown_fields + + + +class StoragePoolFilters(Type): + _toSchema = {'filters': 'filters'} + _toPy = {'filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): + ''' + filters : typing.Sequence[~StoragePoolFilter] + ''' + filters_ = [StoragePoolFilter.from_json(o) for o in filters or []] + + # Validate arguments against known Juju API types. + if filters_ is not None and not isinstance(filters_, (bytes, str, list)): + raise Exception("Expected filters_ to be a Sequence, received: {}".format(type(filters_))) + + self.filters = filters_ + self.unknown_fields = 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 + storage_pools : typing.Sequence[~StoragePool] + ''' + error_ = Error.from_json(error) if error else None + storage_pools_ = [StoragePool.from_json(o) for o in storage_pools or []] + + # 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 storage_pools_ is not None and not isinstance(storage_pools_, (bytes, str, list)): + raise Exception("Expected storage_pools_ to be a Sequence, received: {}".format(type(storage_pools_))) + + self.error = error_ + self.storage_pools = storage_pools_ + self.unknown_fields = unknown_fields + + + +class StoragePoolsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~StoragePoolsResult] + ''' + results_ = [StoragePoolsResult.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 StoragesAddParams(Type): + _toSchema = {'storages': 'storages'} + _toPy = {'storages': 'storages'} + def __init__(self, storages=None, **unknown_fields): + ''' + storages : typing.Sequence[~StorageAddParams] + ''' + storages_ = [StorageAddParams.from_json(o) for o in storages or []] + + # Validate arguments against known Juju API types. + if storages_ is not None and not isinstance(storages_, (bytes, str, list)): + raise Exception("Expected storages_ to be a Sequence, received: {}".format(type(storages_))) + + self.storages = storages_ + self.unknown_fields = 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 + ok : bool + result : str + ''' + error_ = Error.from_json(error) if error else None + ok_ = ok + result_ = result + + # 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 ok_ is not None and not isinstance(ok_, bool): + raise Exception("Expected ok_ to be a bool, received: {}".format(type(ok_))) + + if result_ is not None and not isinstance(result_, (bytes, str)): + raise Exception("Expected result_ to be a str, received: {}".format(type(result_))) + + self.error = error_ + self.ok = ok_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class StringBoolResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~StringBoolResult] + ''' + results_ = [StringBoolResult.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 StringResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : str + ''' + error_ = Error.from_json(error) if error else None + result_ = result + + # 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_, (bytes, str)): + raise Exception("Expected result_ to be a str, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class StringResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~StringResult] + ''' + results_ = [StringResult.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 StringsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : typing.Sequence[str] + ''' + error_ = Error.from_json(error) if error else None + result_ = result + + # 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_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class StringsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~StringsResult] + ''' + results_ = [StringsResult.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 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] + error : Error + watcher_id : str + ''' + changes_ = changes + error_ = Error.from_json(error) if error else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + 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 error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.changes = changes_ + self.error = error_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class StringsWatchResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~StringsWatchResult] + ''' + results_ = [StringsWatchResult.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 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 + life : str + provider_id : str + provider_network_id : str + provider_space_id : str + space_tag : str + status : str + vlan_tag : int + zones : typing.Sequence[str] + ''' + 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 + + # Validate arguments against known Juju API types. + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if provider_network_id_ is not None and not isinstance(provider_network_id_, (bytes, str)): + raise Exception("Expected provider_network_id_ to be a str, received: {}".format(type(provider_network_id_))) + + if provider_space_id_ is not None and not isinstance(provider_space_id_, (bytes, str)): + raise Exception("Expected provider_space_id_ to be a str, received: {}".format(type(provider_space_id_))) + + 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 status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if vlan_tag_ is not None and not isinstance(vlan_tag_, int): + raise Exception("Expected vlan_tag_ to be a int, received: {}".format(type(vlan_tag_))) + + if zones_ is not None and not isinstance(zones_, (bytes, str, list)): + raise Exception("Expected zones_ to be a Sequence, received: {}".format(type(zones_))) + + self.cidr = cidr_ + self.life = life_ + self.provider_id = provider_id_ + self.provider_network_id = provider_network_id_ + self.provider_space_id = provider_space_id_ + self.space_tag = space_tag_ + self.status = status_ + self.vlan_tag = vlan_tag_ + self.zones = zones_ + self.unknown_fields = unknown_fields + + + +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 + cidr : str + id_ : str + life : str + provider_id : str + provider_network_id : str + provider_space_id : str + space_tag : str + status : str + vlan_tag : int + zones : typing.Sequence[str] + ''' + subnet_ = Subnet.from_json(subnet) if subnet else None + 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 + + # Validate arguments against known Juju API types. + if subnet_ is not None and not isinstance(subnet_, (dict, Subnet)): + raise Exception("Expected subnet_ to be a Subnet, received: {}".format(type(subnet_))) + + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if provider_network_id_ is not None and not isinstance(provider_network_id_, (bytes, str)): + raise Exception("Expected provider_network_id_ to be a str, received: {}".format(type(provider_network_id_))) + + if provider_space_id_ is not None and not isinstance(provider_space_id_, (bytes, str)): + raise Exception("Expected provider_space_id_ to be a str, received: {}".format(type(provider_space_id_))) + + 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 status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if vlan_tag_ is not None and not isinstance(vlan_tag_, int): + raise Exception("Expected vlan_tag_ to be a int, received: {}".format(type(vlan_tag_))) + + if zones_ is not None and not isinstance(zones_, (bytes, str, list)): + raise Exception("Expected zones_ to be a Sequence, received: {}".format(type(zones_))) + + self.subnet = subnet_ + self.cidr = cidr_ + self.id_ = id__ + self.life = life_ + self.provider_id = provider_id_ + self.provider_network_id = provider_network_id_ + self.provider_space_id = provider_space_id_ + self.space_tag = space_tag_ + self.status = status_ + self.vlan_tag = vlan_tag_ + self.zones = zones_ + self.unknown_fields = unknown_fields + + + +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 + subnetv2 : SubnetV2 + cidr : str + fan_info : FanConfigEntry + id_ : str + is_public : bool + life : str + provider_id : str + provider_network_id : str + provider_space_id : str + space_id : str + space_tag : str + status : str + vlan_tag : int + zones : typing.Sequence[str] + ''' + subnet_ = Subnet.from_json(subnet) if subnet else None + subnetv2_ = SubnetV2.from_json(subnetv2) if subnetv2 else None + cidr_ = cidr + fan_info_ = FanConfigEntry.from_json(fan_info) if fan_info else None + 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 + + # Validate arguments against known Juju API types. + if subnet_ is not None and not isinstance(subnet_, (dict, Subnet)): + raise Exception("Expected subnet_ to be a Subnet, received: {}".format(type(subnet_))) + + if subnetv2_ is not None and not isinstance(subnetv2_, (dict, SubnetV2)): + raise Exception("Expected subnetv2_ to be a SubnetV2, received: {}".format(type(subnetv2_))) + + if cidr_ is not None and not isinstance(cidr_, (bytes, str)): + raise Exception("Expected cidr_ to be a str, received: {}".format(type(cidr_))) + + if fan_info_ is not None and not isinstance(fan_info_, (dict, FanConfigEntry)): + raise Exception("Expected fan_info_ to be a FanConfigEntry, received: {}".format(type(fan_info_))) + + if id__ is not None and not isinstance(id__, (bytes, str)): + raise Exception("Expected id__ to be a str, received: {}".format(type(id__))) + + if is_public_ is not None and not isinstance(is_public_, bool): + raise Exception("Expected is_public_ to be a bool, received: {}".format(type(is_public_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if provider_network_id_ is not None and not isinstance(provider_network_id_, (bytes, str)): + raise Exception("Expected provider_network_id_ to be a str, received: {}".format(type(provider_network_id_))) + + if provider_space_id_ is not None and not isinstance(provider_space_id_, (bytes, str)): + raise Exception("Expected provider_space_id_ to be a str, received: {}".format(type(provider_space_id_))) + + if space_id_ is not None and not isinstance(space_id_, (bytes, str)): + raise Exception("Expected space_id_ to be a str, received: {}".format(type(space_id_))) + + 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 status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if vlan_tag_ is not None and not isinstance(vlan_tag_, int): + raise Exception("Expected vlan_tag_ to be a int, received: {}".format(type(vlan_tag_))) + + if zones_ is not None and not isinstance(zones_, (bytes, str, list)): + raise Exception("Expected zones_ to be a Sequence, received: {}".format(type(zones_))) + + self.subnet = subnet_ + self.subnetv2 = subnetv2_ + self.cidr = cidr_ + self.fan_info = fan_info_ + self.id_ = id__ + self.is_public = is_public_ + self.life = life_ + self.provider_id = provider_id_ + self.provider_network_id = provider_network_id_ + self.provider_space_id = provider_space_id_ + self.space_id = space_id_ + self.space_tag = space_tag_ + self.status = status_ + self.vlan_tag = vlan_tag_ + self.zones = zones_ + self.unknown_fields = unknown_fields + + + +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 + zone : str + ''' + space_tag_ = space_tag + zone_ = zone + + # Validate arguments against known Juju API types. + 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_))) + + self.space_tag = space_tag_ + self.zone = zone_ + self.unknown_fields = 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 + subnets : typing.Sequence[~SubnetV2] + ''' + error_ = Error.from_json(error) if error else None + subnets_ = [SubnetV2.from_json(o) for o in subnets or []] + + # 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 subnets_ is not None and not isinstance(subnets_, (bytes, str, list)): + raise Exception("Expected subnets_ to be a Sequence, received: {}".format(type(subnets_))) + + self.error = error_ + self.subnets = subnets_ + self.unknown_fields = unknown_fields + + + +class SubnetsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~SubnetsResult] + ''' + results_ = [SubnetsResult.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 SummaryWatcherID(Type): + _toSchema = {'watcher_id': 'watcher-id'} + _toPy = {'watcher-id': 'watcher_id'} + def __init__(self, watcher_id=None, **unknown_fields): + ''' + watcher_id : str + ''' + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class SummaryWatcherNextResults(Type): + _toSchema = {'models': 'models'} + _toPy = {'models': 'models'} + def __init__(self, models=None, **unknown_fields): + ''' + models : typing.Sequence[~ModelAbstract] + ''' + models_ = [ModelAbstract.from_json(o) for o in models or []] + + # Validate arguments against known Juju API types. + if models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + self.models = models_ + self.unknown_fields = 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 + name : str + version : str + ''' + description_ = description + name_ = name + version_ = version + + # Validate arguments against known Juju API types. + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if version_ is not None and not isinstance(version_, (bytes, str)): + raise Exception("Expected version_ to be a str, received: {}".format(type(version_))) + + self.description = description_ + self.name = name_ + self.version = version_ + self.unknown_fields = 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 + tag : str + ''' + credential_ = CloudCredential.from_json(credential) if credential else None + tag_ = tag + + # Validate arguments against known Juju API types. + if credential_ is not None and not isinstance(credential_, (dict, CloudCredential)): + raise Exception("Expected credential_ to be a CloudCredential, received: {}".format(type(credential_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.credential = credential_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class TaggedCredentials(Type): + _toSchema = {'credentials': 'credentials'} + _toPy = {'credentials': 'credentials'} + def __init__(self, credentials=None, **unknown_fields): + ''' + credentials : typing.Sequence[~TaggedCredential] + ''' + credentials_ = [TaggedCredential.from_json(o) for o in credentials or []] + + # Validate arguments against known Juju API types. + if credentials_ is not None and not isinstance(credentials_, (bytes, str, list)): + raise Exception("Expected credentials_ to be a Sequence, received: {}".format(type(credentials_))) + + self.credentials = credentials_ + self.unknown_fields = 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 + token : str + ''' + error_ = Error.from_json(error) if error else None + token_ = token + + # 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 token_ is not None and not isinstance(token_, (bytes, str)): + raise Exception("Expected token_ to be a str, received: {}".format(type(token_))) + + self.error = error_ + self.token = token_ + self.unknown_fields = unknown_fields + + + +class TokenResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~TokenResult] + ''' + results_ = [TokenResult.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 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 + size : int + url : str + version : Binary + ''' + sha256_ = sha256 + size_ = size + url_ = url + version_ = Binary.from_json(version) if version else None + + # Validate arguments against known Juju API types. + if sha256_ is not None and not isinstance(sha256_, (bytes, str)): + raise Exception("Expected sha256_ to be a str, received: {}".format(type(sha256_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + if version_ is not None and not isinstance(version_, (dict, Binary)): + raise Exception("Expected version_ to be a Binary, received: {}".format(type(version_))) + + self.sha256 = sha256_ + self.size = size_ + self.url = url_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class ToolsResult(Type): + _toSchema = {'error': 'error', 'tools': 'tools'} + _toPy = {'error': 'error', 'tools': 'tools'} + def __init__(self, error=None, tools=None, **unknown_fields): + ''' + error : Error + tools : typing.Sequence[~Tools] + ''' + error_ = Error.from_json(error) if error else None + tools_ = [Tools.from_json(o) for o in tools or []] + + # 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 tools_ is not None and not isinstance(tools_, (bytes, str, list)): + raise Exception("Expected tools_ to be a Sequence, received: {}".format(type(tools_))) + + self.error = error_ + self.tools = tools_ + self.unknown_fields = unknown_fields + + + +class ToolsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ToolsResult] + ''' + results_ = [ToolsResult.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 TrackArgs(Type): + _toSchema = {'payloads': 'payloads'} + _toPy = {'payloads': 'payloads'} + def __init__(self, payloads=None, **unknown_fields): + ''' + payloads : typing.Sequence[~Payload] + ''' + payloads_ = [Payload.from_json(o) for o in payloads or []] + + # Validate arguments against known Juju API types. + if payloads_ is not None and not isinstance(payloads_, (bytes, str, list)): + raise Exception("Expected payloads_ to be a Sequence, received: {}".format(type(payloads_))) + + self.payloads = payloads_ + self.unknown_fields = unknown_fields + + + +class TrackPayloadArgs(Type): + _toSchema = {'payloads': 'payloads'} + _toPy = {'payloads': 'payloads'} + def __init__(self, payloads=None, **unknown_fields): + ''' + payloads : typing.Sequence[~Payload] + ''' + payloads_ = [Payload.from_json(o) for o in payloads or []] + + # Validate arguments against known Juju API types. + if payloads_ is not None and not isinstance(payloads_, (bytes, str, list)): + raise Exception("Expected payloads_ to be a Sequence, received: {}".format(type(payloads_))) + + self.payloads = payloads_ + self.unknown_fields = 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 + force_destroyed : bool + global_name : str + is_system : bool + life : str + name : str + uuid : str + ''' + destroy_timeout_ = destroy_timeout + force_destroyed_ = force_destroyed + global_name_ = global_name + is_system_ = is_system + life_ = life + name_ = name + uuid_ = uuid + + # Validate arguments against known Juju API types. + if destroy_timeout_ is not None and not isinstance(destroy_timeout_, int): + raise Exception("Expected destroy_timeout_ to be a int, received: {}".format(type(destroy_timeout_))) + + if force_destroyed_ is not None and not isinstance(force_destroyed_, bool): + raise Exception("Expected force_destroyed_ to be a bool, received: {}".format(type(force_destroyed_))) + + if global_name_ is not None and not isinstance(global_name_, (bytes, str)): + raise Exception("Expected global_name_ to be a str, received: {}".format(type(global_name_))) + + if is_system_ is not None and not isinstance(is_system_, bool): + raise Exception("Expected is_system_ to be a bool, received: {}".format(type(is_system_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.destroy_timeout = destroy_timeout_ + self.force_destroyed = force_destroyed_ + self.global_name = global_name_ + self.is_system = is_system_ + self.life = life_ + self.name = name_ + self.uuid = uuid_ + self.unknown_fields = unknown_fields + + + +class UndertakerModelInfoResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : UndertakerModelInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = UndertakerModelInfo.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, UndertakerModelInfo)): + raise Exception("Expected result_ to be a UndertakerModelInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = 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 + result : UnitResult + ''' + error_ = Error.from_json(error) if error else None + result_ = UnitResult.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, UnitResult)): + raise Exception("Expected result_ to be a UnitResult, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class UnitInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~UnitInfoResult] + ''' + results_ = [UnitInfoResult.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 UnitNetworkConfig(Type): + _toSchema = {'binding_name': 'binding-name', 'unit_tag': 'unit-tag'} + _toPy = {'binding-name': 'binding_name', 'unit-tag': 'unit_tag'} + def __init__(self, binding_name=None, unit_tag=None, **unknown_fields): + ''' + binding_name : str + unit_tag : str + ''' + binding_name_ = binding_name + unit_tag_ = unit_tag + + # Validate arguments against known Juju API types. + if binding_name_ is not None and not isinstance(binding_name_, (bytes, str)): + raise Exception("Expected binding_name_ to be a str, received: {}".format(type(binding_name_))) + + if unit_tag_ is not None and not isinstance(unit_tag_, (bytes, str)): + raise Exception("Expected unit_tag_ to be a str, received: {}".format(type(unit_tag_))) + + self.binding_name = binding_name_ + self.unit_tag = unit_tag_ + self.unknown_fields = unknown_fields + + + +class UnitNetworkConfigResult(Type): + _toSchema = {'error': 'error', 'info': 'info'} + _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): + ''' + error : Error + info : typing.Sequence[~NetworkConfig] + ''' + error_ = Error.from_json(error) if error else None + info_ = [NetworkConfig.from_json(o) for o in info or []] + + # 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 info_ is not None and not isinstance(info_, (bytes, str, list)): + raise Exception("Expected info_ to be a Sequence, received: {}".format(type(info_))) + + self.error = error_ + self.info = info_ + self.unknown_fields = unknown_fields + + + +class UnitNetworkConfigResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~UnitNetworkConfigResult] + ''' + results_ = [UnitNetworkConfigResult.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 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 + life : str + resolved : str + provider_id : str + ''' + error_ = Error.from_json(error) if error else None + life_ = life + resolved_ = resolved + provider_id_ = provider_id + + # 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 life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if resolved_ is not None and not isinstance(resolved_, (bytes, str)): + raise Exception("Expected resolved_ to be a str, received: {}".format(type(resolved_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + self.error = error_ + self.life = life_ + self.resolved = resolved_ + self.provider_id = provider_id_ + self.unknown_fields = unknown_fields + + + +class UnitRefreshResults(Type): + _toSchema = {'results': 'Results'} + _toPy = {'Results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~UnitRefreshResult] + ''' + results_ = [UnitRefreshResult.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 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 + error : Error + resource : Resource + ''' + errorresult_ = ErrorResult.from_json(errorresult) if errorresult else None + error_ = Error.from_json(error) if error else None + resource_ = Resource.from_json(resource) if resource else None + + # Validate arguments against known Juju API types. + if errorresult_ is not None and not isinstance(errorresult_, (dict, ErrorResult)): + raise Exception("Expected errorresult_ to be a ErrorResult, received: {}".format(type(errorresult_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if resource_ is not None and not isinstance(resource_, (dict, Resource)): + raise Exception("Expected resource_ to be a Resource, received: {}".format(type(resource_))) + + self.errorresult = errorresult_ + self.error = error_ + self.resource = resource_ + self.unknown_fields = 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 + download_progress : typing.Mapping[str, int] + resources : typing.Sequence[~Resource] + tag : str + ''' + entity_ = Entity.from_json(entity) if entity else None + download_progress_ = download_progress + resources_ = [Resource.from_json(o) for o in resources or []] + tag_ = tag + + # Validate arguments against known Juju API types. + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) + + if download_progress_ is not None and not isinstance(download_progress_, dict): + raise Exception("Expected download_progress_ to be a Mapping, received: {}".format(type(download_progress_))) + + 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_))) + + self.entity = entity_ + self.download_progress = download_progress_ + self.resources = resources_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +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 + error : Error + resources : typing.Sequence[~UnitResourceResult] + ''' + errorresult_ = ErrorResult.from_json(errorresult) if errorresult else None + error_ = Error.from_json(error) if error else None + resources_ = [UnitResourceResult.from_json(o) for o in resources or []] + + # Validate arguments against known Juju API types. + if errorresult_ is not None and not isinstance(errorresult_, (dict, ErrorResult)): + raise Exception("Expected errorresult_ to be a ErrorResult, received: {}".format(type(errorresult_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if resources_ is not None and not isinstance(resources_, (bytes, str, list)): + raise Exception("Expected resources_ to be a Sequence, received: {}".format(type(resources_))) + + self.errorresult = errorresult_ + self.error = error_ + self.resources = resources_ + self.unknown_fields = unknown_fields + + + +class UnitResult(Type): + _toSchema = {'address': 'address', 'charm': 'charm', 'leader': 'leader', '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', '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, machine=None, opened_ports=None, provider_id=None, public_address=None, relation_data=None, tag=None, workload_version=None, **unknown_fields): + ''' + address : str + charm : str + leader : bool + machine : str + opened_ports : typing.Sequence[str] + provider_id : str + public_address : str + relation_data : typing.Sequence[~EndpointRelationData] + tag : str + workload_version : str + ''' + address_ = address + charm_ = charm + leader_ = leader + machine_ = machine + opened_ports_ = opened_ports + provider_id_ = provider_id + public_address_ = public_address + relation_data_ = [EndpointRelationData.from_json(o) for o in relation_data or []] + tag_ = tag + workload_version_ = workload_version + + # Validate arguments against known Juju API types. + if address_ is not None and not isinstance(address_, (bytes, str)): + raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) + + if charm_ is not None and not isinstance(charm_, (bytes, str)): + raise Exception("Expected charm_ to be a str, received: {}".format(type(charm_))) + + if leader_ is not None and not isinstance(leader_, bool): + raise Exception("Expected leader_ to be a bool, received: {}".format(type(leader_))) + + if machine_ is not None and not isinstance(machine_, (bytes, str)): + raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) + + if opened_ports_ is not None and not isinstance(opened_ports_, (bytes, str, list)): + raise Exception("Expected opened_ports_ to be a Sequence, received: {}".format(type(opened_ports_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if public_address_ is not None and not isinstance(public_address_, (bytes, str)): + raise Exception("Expected public_address_ to be a str, received: {}".format(type(public_address_))) + + if relation_data_ is not None and not isinstance(relation_data_, (bytes, str, list)): + raise Exception("Expected relation_data_ to be a Sequence, received: {}".format(type(relation_data_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + if workload_version_ is not None and not isinstance(workload_version_, (bytes, str)): + raise Exception("Expected workload_version_ to be a str, received: {}".format(type(workload_version_))) + + self.address = address_ + self.charm = charm_ + self.leader = leader_ + self.machine = machine_ + self.opened_ports = opened_ports_ + self.provider_id = provider_id_ + self.public_address = public_address_ + self.relation_data = relation_data_ + self.tag = tag_ + self.workload_version = workload_version_ + self.unknown_fields = unknown_fields + + + +class UnitSettings(Type): + _toSchema = {'version': 'version'} + _toPy = {'version': 'version'} + def __init__(self, version=None, **unknown_fields): + ''' + version : int + ''' + version_ = version + + # Validate arguments against known Juju API types. + if version_ is not None and not isinstance(version_, int): + raise Exception("Expected version_ to be a int, received: {}".format(type(version_))) + + self.version = version_ + self.unknown_fields = unknown_fields + + + +class UnitStateResult(Type): + _toSchema = {'charm_state': 'charm-state', 'error': 'error', 'meter_status_state': 'meter-status-state', 'relation_state': 'relation-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', 'storage-state': 'storage_state', 'uniter-state': 'uniter_state'} + def __init__(self, charm_state=None, error=None, meter_status_state=None, relation_state=None, storage_state=None, uniter_state=None, **unknown_fields): + ''' + charm_state : typing.Mapping[str, str] + error : Error + meter_status_state : str + relation_state : typing.Mapping[str, str] + storage_state : str + uniter_state : str + ''' + charm_state_ = charm_state + error_ = Error.from_json(error) if error else None + meter_status_state_ = meter_status_state + relation_state_ = relation_state + storage_state_ = storage_state + uniter_state_ = uniter_state + + # Validate arguments against known Juju API types. + if charm_state_ is not None and not isinstance(charm_state_, dict): + raise Exception("Expected charm_state_ to be a Mapping, received: {}".format(type(charm_state_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if meter_status_state_ is not None and not isinstance(meter_status_state_, (bytes, str)): + raise Exception("Expected meter_status_state_ to be a str, received: {}".format(type(meter_status_state_))) + + if relation_state_ is not None and not isinstance(relation_state_, dict): + raise Exception("Expected relation_state_ to be a Mapping, received: {}".format(type(relation_state_))) + + if storage_state_ is not None and not isinstance(storage_state_, (bytes, str)): + raise Exception("Expected storage_state_ to be a str, received: {}".format(type(storage_state_))) + + if uniter_state_ is not None and not isinstance(uniter_state_, (bytes, str)): + raise Exception("Expected uniter_state_ to be a str, received: {}".format(type(uniter_state_))) + + self.charm_state = charm_state_ + self.error = error_ + self.meter_status_state = meter_status_state_ + self.relation_state = relation_state_ + self.storage_state = storage_state_ + self.uniter_state = uniter_state_ + self.unknown_fields = unknown_fields + + + +class UnitStateResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~UnitStateResult] + ''' + results_ = [UnitStateResult.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 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 + agent_status : DetailedStatus + charm : str + leader : bool + machine : str + opened_ports : typing.Sequence[str] + provider_id : str + public_address : str + subordinates : typing.Mapping[str, ~UnitStatus] + workload_status : DetailedStatus + workload_version : str + ''' + address_ = address + agent_status_ = DetailedStatus.from_json(agent_status) if agent_status else None + charm_ = charm + leader_ = leader + machine_ = machine + opened_ports_ = opened_ports + provider_id_ = provider_id + public_address_ = public_address + subordinates_ = {k: UnitStatus.from_json(v) for k, v in (subordinates or dict()).items()} + workload_status_ = DetailedStatus.from_json(workload_status) if workload_status else None + workload_version_ = workload_version + + # Validate arguments against known Juju API types. + if address_ is not None and not isinstance(address_, (bytes, str)): + raise Exception("Expected address_ to be a str, received: {}".format(type(address_))) + + if agent_status_ is not None and not isinstance(agent_status_, (dict, DetailedStatus)): + raise Exception("Expected agent_status_ to be a DetailedStatus, received: {}".format(type(agent_status_))) + + if charm_ is not None and not isinstance(charm_, (bytes, str)): + raise Exception("Expected charm_ to be a str, received: {}".format(type(charm_))) + + if leader_ is not None and not isinstance(leader_, bool): + raise Exception("Expected leader_ to be a bool, received: {}".format(type(leader_))) + + if machine_ is not None and not isinstance(machine_, (bytes, str)): + raise Exception("Expected machine_ to be a str, received: {}".format(type(machine_))) + + if opened_ports_ is not None and not isinstance(opened_ports_, (bytes, str, list)): + raise Exception("Expected opened_ports_ to be a Sequence, received: {}".format(type(opened_ports_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if public_address_ is not None and not isinstance(public_address_, (bytes, str)): + raise Exception("Expected public_address_ to be a str, received: {}".format(type(public_address_))) + + if subordinates_ is not None and not isinstance(subordinates_, dict): + raise Exception("Expected subordinates_ to be a Mapping, received: {}".format(type(subordinates_))) + + if workload_status_ is not None and not isinstance(workload_status_, (dict, DetailedStatus)): + raise Exception("Expected workload_status_ to be a DetailedStatus, received: {}".format(type(workload_status_))) + + if workload_version_ is not None and not isinstance(workload_version_, (bytes, str)): + raise Exception("Expected workload_version_ to be a str, received: {}".format(type(workload_version_))) + + self.address = address_ + self.agent_status = agent_status_ + self.charm = charm_ + self.leader = leader_ + self.machine = machine_ + self.opened_ports = opened_ports_ + self.provider_id = provider_id_ + self.public_address = public_address_ + self.subordinates = subordinates_ + self.workload_status = workload_status_ + self.workload_version = workload_version_ + self.unknown_fields = unknown_fields + + + +class UnitsNetworkConfig(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~UnitNetworkConfig] + ''' + args_ = [UnitNetworkConfig.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 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 + retry : bool + tags : Entities + ''' + all__ = all_ + retry_ = retry + tags_ = Entities.from_json(tags) if tags else None + + # Validate arguments against known Juju API types. + 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_))) + + self.all_ = all__ + self.retry = retry_ + self.tags = tags_ + self.unknown_fields = unknown_fields + + + +class UnsetModelDefaults(Type): + _toSchema = {'keys': 'keys'} + _toPy = {'keys': 'keys'} + def __init__(self, keys=None, **unknown_fields): + ''' + keys : typing.Sequence[~ModelUnsetKeys] + ''' + keys_ = [ModelUnsetKeys.from_json(o) for o in keys or []] + + # Validate arguments against known Juju API types. + if keys_ is not None and not isinstance(keys_, (bytes, str, list)): + raise Exception("Expected keys_ to be a Sequence, received: {}".format(type(keys_))) + + self.keys = keys_ + self.unknown_fields = 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] + application_tag : str + generation : int + provider_id : str + scale : int + ''' + addresses_ = [Address.from_json(o) for o in addresses or []] + application_tag_ = application_tag + generation_ = generation + provider_id_ = provider_id + scale_ = scale + + # Validate arguments against known Juju API types. + if addresses_ is not None and not isinstance(addresses_, (bytes, str, list)): + raise Exception("Expected addresses_ to be a Sequence, received: {}".format(type(addresses_))) + + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) + + if generation_ is not None and not isinstance(generation_, int): + raise Exception("Expected generation_ to be a int, received: {}".format(type(generation_))) + + if provider_id_ is not None and not isinstance(provider_id_, (bytes, str)): + raise Exception("Expected provider_id_ to be a str, received: {}".format(type(provider_id_))) + + if scale_ is not None and not isinstance(scale_, int): + raise Exception("Expected scale_ to be a int, received: {}".format(type(scale_))) + + self.addresses = addresses_ + self.application_tag = application_tag_ + self.generation = generation_ + self.provider_id = provider_id_ + self.scale = scale_ + self.unknown_fields = unknown_fields + + + +class UpdateApplicationServiceArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~UpdateApplicationServiceArg] + ''' + args_ = [UpdateApplicationServiceArg.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 UpdateApplicationUnitArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~UpdateApplicationUnits] + ''' + args_ = [UpdateApplicationUnits.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 UpdateApplicationUnitResult(Type): + _toSchema = {'error': 'error', 'info': 'info'} + _toPy = {'error': 'error', 'info': 'info'} + def __init__(self, error=None, info=None, **unknown_fields): + ''' + error : Error + info : UpdateApplicationUnitsInfo + ''' + error_ = Error.from_json(error) if error else None + info_ = UpdateApplicationUnitsInfo.from_json(info) if info 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 info_ is not None and not isinstance(info_, (dict, UpdateApplicationUnitsInfo)): + raise Exception("Expected info_ to be a UpdateApplicationUnitsInfo, received: {}".format(type(info_))) + + self.error = error_ + self.info = info_ + self.unknown_fields = unknown_fields + + + +class UpdateApplicationUnitResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~UpdateApplicationUnitResult] + ''' + results_ = [UpdateApplicationUnitResult.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 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 + generation : int + scale : int + status : EntityStatus + units : typing.Sequence[~ApplicationUnitParams] + ''' + application_tag_ = application_tag + generation_ = generation + scale_ = scale + status_ = EntityStatus.from_json(status) if status else None + units_ = [ApplicationUnitParams.from_json(o) for o in units or []] + + # Validate arguments against known Juju API types. + if application_tag_ is not None and not isinstance(application_tag_, (bytes, str)): + raise Exception("Expected application_tag_ to be a str, received: {}".format(type(application_tag_))) + + if generation_ is not None and not isinstance(generation_, int): + raise Exception("Expected generation_ to be a int, received: {}".format(type(generation_))) + + if scale_ is not None and not isinstance(scale_, int): + raise Exception("Expected scale_ to be a int, received: {}".format(type(scale_))) + + if status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, 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_))) + + self.application_tag = application_tag_ + self.generation = generation_ + self.scale = scale_ + self.status = status_ + self.units = units_ + self.unknown_fields = unknown_fields + + + +class UpdateApplicationUnitsInfo(Type): + _toSchema = {'units': 'units'} + _toPy = {'units': 'units'} + def __init__(self, units=None, **unknown_fields): + ''' + units : typing.Sequence[~ApplicationUnitInfo] + ''' + units_ = [ApplicationUnitInfo.from_json(o) for o in units or []] + + # Validate arguments against known Juju API types. + if units_ is not None and not isinstance(units_, (bytes, str, list)): + raise Exception("Expected units_ to be a Sequence, received: {}".format(type(units_))) + + self.units = units_ + self.unknown_fields = 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 + enable_os_upgrade : bool + ''' + enable_os_refresh_update_ = enable_os_refresh_update + enable_os_upgrade_ = enable_os_upgrade + + # Validate arguments against known Juju API types. + if enable_os_refresh_update_ is not None and not isinstance(enable_os_refresh_update_, bool): + raise Exception("Expected enable_os_refresh_update_ to be a bool, received: {}".format(type(enable_os_refresh_update_))) + + if enable_os_upgrade_ is not None and not isinstance(enable_os_upgrade_, bool): + raise Exception("Expected enable_os_upgrade_ to be a bool, received: {}".format(type(enable_os_upgrade_))) + + self.enable_os_refresh_update = enable_os_refresh_update_ + self.enable_os_upgrade = enable_os_upgrade_ + self.unknown_fields = unknown_fields + + + +class UpdateCloudArgs(Type): + _toSchema = {'clouds': 'clouds'} + _toPy = {'clouds': 'clouds'} + def __init__(self, clouds=None, **unknown_fields): + ''' + clouds : typing.Sequence[~AddCloudArgs] + ''' + clouds_ = [AddCloudArgs.from_json(o) for o in clouds or []] + + # Validate arguments against known Juju API types. + if clouds_ is not None and not isinstance(clouds_, (bytes, str, list)): + raise Exception("Expected clouds_ to be a Sequence, received: {}".format(type(clouds_))) + + self.clouds = clouds_ + self.unknown_fields = unknown_fields + + + +class UpdateCloudCredential(Type): + _toSchema = {'credential': 'credential', 'tag': 'tag'} + _toPy = {'credential': 'credential', 'tag': 'tag'} + def __init__(self, credential=None, tag=None, **unknown_fields): + ''' + credential : CloudCredential + tag : str + ''' + credential_ = CloudCredential.from_json(credential) if credential else None + tag_ = tag + + # Validate arguments against known Juju API types. + if credential_ is not None and not isinstance(credential_, (dict, CloudCredential)): + raise Exception("Expected credential_ to be a CloudCredential, received: {}".format(type(credential_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.credential = credential_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class UpdateCloudCredentials(Type): + _toSchema = {'credentials': 'credentials'} + _toPy = {'credentials': 'credentials'} + def __init__(self, credentials=None, **unknown_fields): + ''' + credentials : typing.Sequence[~UpdateCloudCredential] + ''' + credentials_ = [UpdateCloudCredential.from_json(o) for o in credentials or []] + + # Validate arguments against known Juju API types. + if credentials_ is not None and not isinstance(credentials_, (bytes, str, list)): + raise Exception("Expected credentials_ to be a Sequence, received: {}".format(type(credentials_))) + + self.credentials = credentials_ + self.unknown_fields = 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 + model_tag : str + ''' + info_ = ExternalControllerInfo.from_json(info) if info else None + model_tag_ = model_tag + + # Validate arguments against known Juju API types. + if info_ is not None and not isinstance(info_, (dict, ExternalControllerInfo)): + raise Exception("Expected info_ to be a ExternalControllerInfo, received: {}".format(type(info_))) + + 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_))) + + self.info = info_ + self.model_tag = model_tag_ + self.unknown_fields = unknown_fields + + + +class UpdateControllersForModelsParams(Type): + _toSchema = {'changes': 'changes'} + _toPy = {'changes': 'changes'} + def __init__(self, changes=None, **unknown_fields): + ''' + changes : typing.Sequence[~UpdateControllerForModel] + ''' + changes_ = [UpdateControllerForModel.from_json(o) for o in changes or []] + + # Validate arguments against known Juju API types. + if changes_ is not None and not isinstance(changes_, (bytes, str, list)): + raise Exception("Expected changes_ to be a Sequence, received: {}".format(type(changes_))) + + self.changes = changes_ + self.unknown_fields = 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] + force : bool + ''' + credentials_ = [TaggedCredential.from_json(o) for o in credentials or []] + force_ = force + + # Validate arguments against known Juju API types. + 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_))) + + self.credentials = credentials_ + self.force = force_ + self.unknown_fields = 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] + name : str + uuid : str + ''' + errors_ = [ErrorResult.from_json(o) for o in errors or []] + name_ = name + uuid_ = uuid + + # Validate arguments against known Juju API types. + if errors_ is not None and not isinstance(errors_, (bytes, str, list)): + raise Exception("Expected errors_ to be a Sequence, received: {}".format(type(errors_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + if uuid_ is not None and not isinstance(uuid_, (bytes, str)): + raise Exception("Expected uuid_ to be a str, received: {}".format(type(uuid_))) + + self.errors = errors_ + self.name = name_ + self.uuid = uuid_ + self.unknown_fields = 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 + models : typing.Sequence[~UpdateCredentialModelResult] + tag : str + ''' + error_ = Error.from_json(error) if error else None + models_ = [UpdateCredentialModelResult.from_json(o) for o in models or []] + tag_ = tag + + # 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 models_ is not None and not isinstance(models_, (bytes, str, list)): + raise Exception("Expected models_ to be a Sequence, received: {}".format(type(models_))) + + if tag_ is not None and not isinstance(tag_, (bytes, str)): + raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + + self.error = error_ + self.models = models_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class UpdateCredentialResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~UpdateCredentialResult] + ''' + results_ = [UpdateCredentialResult.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 UpdateSecretArg(Type): + _toSchema = {'data': 'data', 'description': 'description', 'params': 'params', 'rotate_interval': 'rotate-interval', 'status': 'status', 'tags': 'tags', 'url': 'url'} + _toPy = {'data': 'data', 'description': 'description', 'params': 'params', 'rotate-interval': 'rotate_interval', 'status': 'status', 'tags': 'tags', 'url': 'url'} + def __init__(self, data=None, description=None, params=None, rotate_interval=None, status=None, tags=None, url=None, **unknown_fields): + ''' + data : typing.Mapping[str, str] + description : str + params : typing.Mapping[str, typing.Any] + rotate_interval : int + status : str + tags : typing.Mapping[str, str] + url : str + ''' + data_ = data + description_ = description + params_ = params + rotate_interval_ = rotate_interval + status_ = status + tags_ = tags + url_ = url + + # Validate arguments against known Juju API types. + if data_ is not None and not isinstance(data_, dict): + raise Exception("Expected data_ to be a Mapping, received: {}".format(type(data_))) + + if description_ is not None and not isinstance(description_, (bytes, str)): + raise Exception("Expected description_ to be a str, received: {}".format(type(description_))) + + if params_ is not None and not isinstance(params_, dict): + raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) + + if rotate_interval_ is not None and not isinstance(rotate_interval_, int): + raise Exception("Expected rotate_interval_ to be a int, received: {}".format(type(rotate_interval_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if url_ is not None and not isinstance(url_, (bytes, str)): + raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + + self.data = data_ + self.description = description_ + self.params = params_ + self.rotate_interval = rotate_interval_ + self.status = status_ + self.tags = tags_ + self.url = url_ + self.unknown_fields = unknown_fields + + + +class UpdateSecretArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~UpdateSecretArg] + ''' + args_ = [UpdateSecretArg.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 UpdateSeriesArg(Type): + _toSchema = {'force': 'force', 'series': 'series', 'tag': 'tag'} + _toPy = {'force': 'force', 'series': 'series', 'tag': 'tag'} + def __init__(self, force=None, series=None, tag=None, **unknown_fields): + ''' + force : bool + series : str + tag : Entity + ''' + force_ = force + series_ = series + tag_ = Entity.from_json(tag) if tag else None + + # Validate arguments against known Juju API types. + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if series_ is not None and not isinstance(series_, (bytes, str)): + raise Exception("Expected series_ to be a str, received: {}".format(type(series_))) + + if tag_ is not None and not isinstance(tag_, (dict, Entity)): + raise Exception("Expected tag_ to be a Entity, received: {}".format(type(tag_))) + + self.force = force_ + self.series = series_ + self.tag = tag_ + self.unknown_fields = unknown_fields + + + +class UpdateSeriesArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~UpdateSeriesArg] + ''' + args_ = [UpdateSeriesArg.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 UpgradeMongoParams(Type): + _toSchema = {'target': 'target'} + _toPy = {'target': 'target'} + def __init__(self, target=None, **unknown_fields): + ''' + target : MongoVersion + ''' + target_ = MongoVersion.from_json(target) if target else None + + # Validate arguments against known Juju API types. + if target_ is not None and not isinstance(target_, (dict, MongoVersion)): + raise Exception("Expected target_ to be a MongoVersion, received: {}".format(type(target_))) + + self.target = target_ + self.unknown_fields = 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 + watcher_id : str + ''' + entity_ = Entity.from_json(entity) if entity else None + watcher_id_ = watcher_id + + # Validate arguments against known Juju API types. + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) + + if watcher_id_ is not None and not isinstance(watcher_id_, (bytes, str)): + raise Exception("Expected watcher_id_ to be a str, received: {}".format(type(watcher_id_))) + + self.entity = entity_ + self.watcher_id = watcher_id_ + self.unknown_fields = unknown_fields + + + +class UpgradeSeriesNotificationParams(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~UpgradeSeriesNotificationParam] + ''' + params_ = [UpgradeSeriesNotificationParam.from_json(o) for o in params or []] + + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + + self.params = params_ + self.unknown_fields = 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] + message : str + ''' + entities_ = [Entity.from_json(o) for o in entities or []] + message_ = message + + # Validate arguments against known Juju API types. + 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_))) + + self.entities = entities_ + self.message = message_ + self.unknown_fields = 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 + message : str + status : str + ''' + entity_ = Entity.from_json(entity) if entity else None + message_ = message + status_ = status + + # Validate arguments against known Juju API types. + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) + + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) + + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + self.entity = entity_ + self.message = message_ + self.status = status_ + self.unknown_fields = unknown_fields + + + +class UpgradeSeriesStatusParams(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~UpgradeSeriesStatusParam] + ''' + params_ = [UpgradeSeriesStatusParam.from_json(o) for o in params or []] + + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + + self.params = params_ + self.unknown_fields = 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 + status : str + target : str + ''' + error_ = Error.from_json(error) if error else None + status_ = status + target_ = target + + # 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 status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + + if target_ is not None and not isinstance(target_, (bytes, str)): + raise Exception("Expected target_ to be a str, received: {}".format(type(target_))) + + self.error = error_ + self.status = status_ + self.target = target_ + self.unknown_fields = unknown_fields + + + +class UpgradeSeriesStatusResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~UpgradeSeriesStatusResult] + ''' + results_ = [UpgradeSeriesStatusResult.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 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 + unit_names : typing.Sequence[str] + ''' + error_ = Error.from_json(error) if error else None + unit_names_ = unit_names + + # 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 unit_names_ is not None and not isinstance(unit_names_, (bytes, str, list)): + raise Exception("Expected unit_names_ to be a Sequence, received: {}".format(type(unit_names_))) + + self.error = error_ + self.unit_names = unit_names_ + self.unknown_fields = unknown_fields + + + +class UpgradeSeriesUnitsResults(Type): + _toSchema = {'results': 'Results'} + _toPy = {'Results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~UpgradeSeriesUnitsResult] + ''' + results_ = [UpgradeSeriesUnitsResult.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 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 + user_tag : str + ''' + access_ = access + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + 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_))) + + self.access = access_ + self.user_tag = user_tag_ + self.unknown_fields = 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 + result : UserAccess + ''' + error_ = Error.from_json(error) if error else None + result_ = UserAccess.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, UserAccess)): + raise Exception("Expected result_ to be a UserAccess, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class UserAccessResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~UserAccessResult] + ''' + results_ = [UserAccessResult.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 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 + user_tag : str + ''' + cloud_tag_ = cloud_tag + user_tag_ = user_tag + + # Validate arguments against known Juju API types. + 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 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_))) + + self.cloud_tag = cloud_tag_ + self.user_tag = user_tag_ + self.unknown_fields = 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] + ''' + user_clouds_ = [UserCloud.from_json(o) for o in user_clouds or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.user_clouds = user_clouds_ + self.unknown_fields = 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 + created_by : str + date_created : str + disabled : bool + display_name : str + last_connection : str + username : str + ''' + access_ = access + created_by_ = created_by + date_created_ = date_created + disabled_ = disabled + display_name_ = display_name + last_connection_ = last_connection + username_ = username + + # Validate arguments against known Juju API types. + if access_ is not None and not isinstance(access_, (bytes, str)): + raise Exception("Expected access_ to be a str, received: {}".format(type(access_))) + + if created_by_ is not None and not isinstance(created_by_, (bytes, str)): + raise Exception("Expected created_by_ to be a str, received: {}".format(type(created_by_))) + + if date_created_ is not None and not isinstance(date_created_, (bytes, str)): + raise Exception("Expected date_created_ to be a str, received: {}".format(type(date_created_))) + + if disabled_ is not None and not isinstance(disabled_, bool): + raise Exception("Expected disabled_ to be a bool, received: {}".format(type(disabled_))) + + if display_name_ is not None and not isinstance(display_name_, (bytes, str)): + raise Exception("Expected display_name_ to be a str, received: {}".format(type(display_name_))) + + if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): + raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) + + if username_ is not None and not isinstance(username_, (bytes, str)): + raise Exception("Expected username_ to be a str, received: {}".format(type(username_))) + + self.access = access_ + self.created_by = created_by_ + self.date_created = date_created_ + self.disabled = disabled_ + self.display_name = display_name_ + self.last_connection = last_connection_ + self.username = username_ + self.unknown_fields = unknown_fields + + + +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] + include_disabled : bool + ''' + entities_ = [Entity.from_json(o) for o in entities or []] + include_disabled_ = include_disabled + + # Validate arguments against known Juju API types. + 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_))) + + self.entities = entities_ + self.include_disabled = include_disabled_ + self.unknown_fields = 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 + result : UserInfo + ''' + error_ = Error.from_json(error) if error else None + result_ = UserInfo.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, UserInfo)): + raise Exception("Expected result_ to be a UserInfo, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class UserInfoResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~UserInfoResult] + ''' + results_ = [UserInfoResult.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 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 + model : Model + ''' + last_connection_ = last_connection + model_ = Model.from_json(model) if model else None + + # Validate arguments against known Juju API types. + if last_connection_ is not None and not isinstance(last_connection_, (bytes, str)): + raise Exception("Expected last_connection_ to be a str, received: {}".format(type(last_connection_))) + + if model_ is not None and not isinstance(model_, (dict, Model)): + raise Exception("Expected model_ to be a Model, received: {}".format(type(model_))) + + self.last_connection = last_connection_ + self.model = model_ + self.unknown_fields = 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] + ''' + user_models_ = [UserModel.from_json(o) for o in user_models or []] + + # Validate arguments against known Juju API types. + if user_models_ is not None and not isinstance(user_models_, (bytes, str, list)): + raise Exception("Expected user_models_ to be a Sequence, received: {}".format(type(user_models_))) + + self.user_models = user_models_ + self.unknown_fields = unknown_fields + + + +class ValidateModelUpgradeParam(Type): + _toSchema = {'model_tag': 'model-tag'} + _toPy = {'model-tag': 'model_tag'} + def __init__(self, model_tag=None, **unknown_fields): + ''' + model_tag : str + ''' + model_tag_ = model_tag + + # Validate arguments against known Juju API types. + 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_))) + + self.model_tag = model_tag_ + self.unknown_fields = unknown_fields + + + +class ValidateModelUpgradeParams(Type): + _toSchema = {'force': 'force', 'model': 'model'} + _toPy = {'force': 'force', 'model': 'model'} + def __init__(self, force=None, model=None, **unknown_fields): + ''' + force : bool + model : typing.Sequence[~ValidateModelUpgradeParam] + ''' + force_ = force + model_ = [ValidateModelUpgradeParam.from_json(o) for o in model or []] + + # Validate arguments against known Juju API types. + if force_ is not None and not isinstance(force_, bool): + raise Exception("Expected force_ to be a bool, received: {}".format(type(force_))) + + if model_ is not None and not isinstance(model_, (bytes, str, list)): + raise Exception("Expected model_ to be a Sequence, received: {}".format(type(model_))) + + self.force = force_ + self.model = model_ + self.unknown_fields = unknown_fields + + + +class Value(Type): + _toSchema = {'allocate_public_ip': 'allocate-public-ip', 'arch': 'arch', 'container': 'container', 'cores': 'cores', 'cpu_power': 'cpu-power', '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', '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, 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 + arch : str + container : str + cores : int + cpu_power : int + instance_role : str + instance_type : str + mem : int + root_disk : int + root_disk_source : str + spaces : typing.Sequence[str] + tags : typing.Sequence[str] + virt_type : str + zones : typing.Sequence[str] + ''' + allocate_public_ip_ = allocate_public_ip + arch_ = arch + container_ = container + cores_ = cores + cpu_power_ = cpu_power + 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 + + # Validate arguments against known Juju API types. + if allocate_public_ip_ is not None and not isinstance(allocate_public_ip_, bool): + raise Exception("Expected allocate_public_ip_ to be a bool, received: {}".format(type(allocate_public_ip_))) + + if arch_ is not None and not isinstance(arch_, (bytes, str)): + raise Exception("Expected arch_ to be a str, received: {}".format(type(arch_))) + + if container_ is not None and not isinstance(container_, (bytes, str)): + raise Exception("Expected container_ to be a str, received: {}".format(type(container_))) + + if cores_ is not None and not isinstance(cores_, int): + raise Exception("Expected cores_ to be a int, received: {}".format(type(cores_))) + + if cpu_power_ is not None and not isinstance(cpu_power_, int): + raise Exception("Expected cpu_power_ to be a int, received: {}".format(type(cpu_power_))) + + if instance_role_ is not None and not isinstance(instance_role_, (bytes, str)): + raise Exception("Expected instance_role_ to be a str, received: {}".format(type(instance_role_))) + + if instance_type_ is not None and not isinstance(instance_type_, (bytes, str)): + raise Exception("Expected instance_type_ to be a str, received: {}".format(type(instance_type_))) + + if mem_ is not None and not isinstance(mem_, int): + raise Exception("Expected mem_ to be a int, received: {}".format(type(mem_))) + + if root_disk_ is not None and not isinstance(root_disk_, int): + raise Exception("Expected root_disk_ to be a int, received: {}".format(type(root_disk_))) + + if root_disk_source_ is not None and not isinstance(root_disk_source_, (bytes, str)): + raise Exception("Expected root_disk_source_ to be a str, received: {}".format(type(root_disk_source_))) + + if spaces_ is not None and not isinstance(spaces_, (bytes, str, list)): + raise Exception("Expected spaces_ to be a Sequence, received: {}".format(type(spaces_))) + + if tags_ is not None and not isinstance(tags_, (bytes, str, list)): + raise Exception("Expected tags_ to be a Sequence, received: {}".format(type(tags_))) + + 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_))) + + if zones_ is not None and not isinstance(zones_, (bytes, str, list)): + raise Exception("Expected zones_ to be a Sequence, received: {}".format(type(zones_))) + + self.allocate_public_ip = allocate_public_ip_ + self.arch = arch_ + self.container = container_ + self.cores = cores_ + self.cpu_power = cpu_power_ + self.instance_role = instance_role_ + self.instance_type = instance_type_ + self.mem = mem_ + self.root_disk = root_disk_ + self.root_disk_source = root_disk_source_ + self.spaces = spaces_ + self.tags = tags_ + self.virt_type = virt_type_ + self.zones = zones_ + self.unknown_fields = unknown_fields + + + +class Version(Type): + _toSchema = {'version': 'version'} + _toPy = {'version': 'version'} + def __init__(self, version=None, **unknown_fields): + ''' + version : Binary + ''' + version_ = Binary.from_json(version) if version else None + + # Validate arguments against known Juju API types. + if version_ is not None and not isinstance(version_, (dict, Binary)): + raise Exception("Expected version_ to be a Binary, received: {}".format(type(version_))) + + self.version = version_ + self.unknown_fields = 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 + version : Number + ''' + error_ = Error.from_json(error) if error else None + version_ = Number.from_json(version) if version 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 version_ is not None and not isinstance(version_, (dict, Number)): + raise Exception("Expected version_ to be a Number, received: {}".format(type(version_))) + + self.error = error_ + self.version = version_ + self.unknown_fields = unknown_fields + + + +class VersionResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~VersionResult] + ''' + results_ = [VersionResult.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 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 + volume_tag : str + ''' + info_ = VolumeInfo.from_json(info) if info else None + volume_tag_ = volume_tag + + # Validate arguments against known Juju API types. + if info_ is not None and not isinstance(info_, (dict, VolumeInfo)): + raise Exception("Expected info_ to be a VolumeInfo, received: {}".format(type(info_))) + + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + + self.info = info_ + self.volume_tag = volume_tag_ + self.unknown_fields = 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 + machine_tag : str + volume_tag : str + ''' + info_ = VolumeAttachmentInfo.from_json(info) if info else None + machine_tag_ = machine_tag + volume_tag_ = volume_tag + + # Validate arguments against known Juju API types. + if info_ is not None and not isinstance(info_, (dict, VolumeAttachmentInfo)): + raise Exception("Expected info_ to be a VolumeAttachmentInfo, received: {}".format(type(info_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + + self.info = info_ + self.machine_tag = machine_tag_ + self.volume_tag = volume_tag_ + self.unknown_fields = unknown_fields + + + +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 + bus_address : str + device_link : str + device_name : str + life : str + plan_info : VolumeAttachmentPlanInfo + read_only : bool + ''' + volumeattachmentinfo_ = VolumeAttachmentInfo.from_json(volumeattachmentinfo) if volumeattachmentinfo else None + bus_address_ = bus_address + device_link_ = device_link + device_name_ = device_name + life_ = life + plan_info_ = VolumeAttachmentPlanInfo.from_json(plan_info) if plan_info else None + read_only_ = read_only + + # Validate arguments against known Juju API types. + if volumeattachmentinfo_ is not None and not isinstance(volumeattachmentinfo_, (dict, VolumeAttachmentInfo)): + raise Exception("Expected volumeattachmentinfo_ to be a VolumeAttachmentInfo, received: {}".format(type(volumeattachmentinfo_))) + + if bus_address_ is not None and not isinstance(bus_address_, (bytes, str)): + raise Exception("Expected bus_address_ to be a str, received: {}".format(type(bus_address_))) + + if device_link_ is not None and not isinstance(device_link_, (bytes, str)): + raise Exception("Expected device_link_ to be a str, received: {}".format(type(device_link_))) + + if device_name_ is not None and not isinstance(device_name_, (bytes, str)): + raise Exception("Expected device_name_ to be a str, received: {}".format(type(device_name_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if plan_info_ is not None and not isinstance(plan_info_, (dict, VolumeAttachmentPlanInfo)): + raise Exception("Expected plan_info_ to be a VolumeAttachmentPlanInfo, received: {}".format(type(plan_info_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + self.volumeattachmentinfo = volumeattachmentinfo_ + self.bus_address = bus_address_ + self.device_link = device_link_ + self.device_name = device_name_ + self.life = life_ + self.plan_info = plan_info_ + self.read_only = read_only_ + self.unknown_fields = unknown_fields + + + +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 + device_link : str + device_name : str + plan_info : VolumeAttachmentPlanInfo + read_only : bool + ''' + bus_address_ = bus_address + device_link_ = device_link + device_name_ = device_name + plan_info_ = VolumeAttachmentPlanInfo.from_json(plan_info) if plan_info else None + read_only_ = read_only + + # Validate arguments against known Juju API types. + if bus_address_ is not None and not isinstance(bus_address_, (bytes, str)): + raise Exception("Expected bus_address_ to be a str, received: {}".format(type(bus_address_))) + + if device_link_ is not None and not isinstance(device_link_, (bytes, str)): + raise Exception("Expected device_link_ to be a str, received: {}".format(type(device_link_))) + + if device_name_ is not None and not isinstance(device_name_, (bytes, str)): + raise Exception("Expected device_name_ to be a str, received: {}".format(type(device_name_))) + + if plan_info_ is not None and not isinstance(plan_info_, (dict, VolumeAttachmentPlanInfo)): + raise Exception("Expected plan_info_ to be a VolumeAttachmentPlanInfo, received: {}".format(type(plan_info_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + self.bus_address = bus_address_ + self.device_link = device_link_ + self.device_name = device_name_ + self.plan_info = plan_info_ + self.read_only = read_only_ + self.unknown_fields = unknown_fields + + + +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 + machine_tag : str + provider : str + read_only : bool + volume_id : str + volume_tag : str + ''' + instance_id_ = instance_id + machine_tag_ = machine_tag + provider_ = provider + read_only_ = read_only + volume_id_ = volume_id + volume_tag_ = volume_tag + + # Validate arguments against known Juju API types. + if instance_id_ is not None and not isinstance(instance_id_, (bytes, str)): + raise Exception("Expected instance_id_ to be a str, received: {}".format(type(instance_id_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if read_only_ is not None and not isinstance(read_only_, bool): + raise Exception("Expected read_only_ to be a bool, received: {}".format(type(read_only_))) + + if volume_id_ is not None and not isinstance(volume_id_, (bytes, str)): + raise Exception("Expected volume_id_ to be a str, received: {}".format(type(volume_id_))) + + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + + self.instance_id = instance_id_ + self.machine_tag = machine_tag_ + self.provider = provider_ + self.read_only = read_only_ + self.volume_id = volume_id_ + self.volume_tag = volume_tag_ + self.unknown_fields = unknown_fields + + + +class VolumeAttachmentParamsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : VolumeAttachmentParams + ''' + error_ = Error.from_json(error) if error else None + result_ = VolumeAttachmentParams.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, VolumeAttachmentParams)): + raise Exception("Expected result_ to be a VolumeAttachmentParams, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class VolumeAttachmentParamsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~VolumeAttachmentParamsResult] + ''' + results_ = [VolumeAttachmentParamsResult.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 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 + life : str + machine_tag : str + plan_info : VolumeAttachmentPlanInfo + volume_tag : str + ''' + block_device_ = BlockDevice.from_json(block_device) if block_device else None + life_ = life + machine_tag_ = machine_tag + plan_info_ = VolumeAttachmentPlanInfo.from_json(plan_info) if plan_info else None + volume_tag_ = volume_tag + + # Validate arguments against known Juju API types. + if block_device_ is not None and not isinstance(block_device_, (dict, BlockDevice)): + raise Exception("Expected block_device_ to be a BlockDevice, received: {}".format(type(block_device_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + if plan_info_ is not None and not isinstance(plan_info_, (dict, VolumeAttachmentPlanInfo)): + raise Exception("Expected plan_info_ to be a VolumeAttachmentPlanInfo, received: {}".format(type(plan_info_))) + + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + + self.block_device = block_device_ + self.life = life_ + self.machine_tag = machine_tag_ + self.plan_info = plan_info_ + self.volume_tag = volume_tag_ + self.unknown_fields = unknown_fields + + + +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] + device_type : str + ''' + device_attributes_ = device_attributes + device_type_ = device_type + + # Validate arguments against known Juju API types. + if device_attributes_ is not None and not isinstance(device_attributes_, dict): + raise Exception("Expected device_attributes_ to be a Mapping, received: {}".format(type(device_attributes_))) + + if device_type_ is not None and not isinstance(device_type_, (bytes, str)): + raise Exception("Expected device_type_ to be a str, received: {}".format(type(device_type_))) + + self.device_attributes = device_attributes_ + self.device_type = device_type_ + self.unknown_fields = 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 + result : VolumeAttachmentPlan + ''' + error_ = Error.from_json(error) if error else None + result_ = VolumeAttachmentPlan.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, VolumeAttachmentPlan)): + raise Exception("Expected result_ to be a VolumeAttachmentPlan, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class VolumeAttachmentPlanResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~VolumeAttachmentPlanResult] + ''' + results_ = [VolumeAttachmentPlanResult.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 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] + ''' + volume_plans_ = [VolumeAttachmentPlan.from_json(o) for o in volume_plans or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.volume_plans = volume_plans_ + self.unknown_fields = 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 + result : VolumeAttachment + ''' + error_ = Error.from_json(error) if error else None + result_ = VolumeAttachment.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, VolumeAttachment)): + raise Exception("Expected result_ to be a VolumeAttachment, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class VolumeAttachmentResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~VolumeAttachmentResult] + ''' + results_ = [VolumeAttachmentResult.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 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] + ''' + volume_attachments_ = [VolumeAttachment.from_json(o) for o in volume_attachments or []] + + # Validate arguments against known Juju API types. + 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_))) + + self.volume_attachments = volume_attachments_ + self.unknown_fields = 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 + life : str + machine_attachments : typing.Mapping[str, ~VolumeAttachmentDetails] + status : EntityStatus + storage : StorageDetails + unit_attachments : typing.Mapping[str, ~VolumeAttachmentDetails] + volume_tag : str + ''' + info_ = VolumeInfo.from_json(info) if info else None + life_ = life + machine_attachments_ = {k: VolumeAttachmentDetails.from_json(v) for k, v in (machine_attachments or dict()).items()} + status_ = EntityStatus.from_json(status) if status else None + storage_ = StorageDetails.from_json(storage) if storage else None + unit_attachments_ = {k: VolumeAttachmentDetails.from_json(v) for k, v in (unit_attachments or dict()).items()} + volume_tag_ = volume_tag + + # Validate arguments against known Juju API types. + if info_ is not None and not isinstance(info_, (dict, VolumeInfo)): + raise Exception("Expected info_ to be a VolumeInfo, received: {}".format(type(info_))) + + if life_ is not None and not isinstance(life_, (bytes, str)): + raise Exception("Expected life_ to be a str, received: {}".format(type(life_))) + + if machine_attachments_ is not None and not isinstance(machine_attachments_, dict): + raise Exception("Expected machine_attachments_ to be a Mapping, received: {}".format(type(machine_attachments_))) + + if status_ is not None and not isinstance(status_, (dict, EntityStatus)): + raise Exception("Expected status_ to be a EntityStatus, received: {}".format(type(status_))) + + if storage_ is not None and not isinstance(storage_, (dict, StorageDetails)): + raise Exception("Expected storage_ to be a StorageDetails, received: {}".format(type(storage_))) + + if unit_attachments_ is not None and not isinstance(unit_attachments_, dict): + raise Exception("Expected unit_attachments_ to be a Mapping, received: {}".format(type(unit_attachments_))) + + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + + self.info = info_ + self.life = life_ + self.machine_attachments = machine_attachments_ + self.status = status_ + self.storage = storage_ + self.unit_attachments = unit_attachments_ + self.volume_tag = volume_tag_ + self.unknown_fields = unknown_fields + + + +class VolumeDetailsListResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : typing.Sequence[~VolumeDetails] + ''' + error_ = Error.from_json(error) if error else None + result_ = [VolumeDetails.from_json(o) for o in result or []] + + # 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_, (bytes, str, list)): + raise Exception("Expected result_ to be a Sequence, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class VolumeDetailsListResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~VolumeDetailsListResult] + ''' + results_ = [VolumeDetailsListResult.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 VolumeFilter(Type): + _toSchema = {'machines': 'machines'} + _toPy = {'machines': 'machines'} + def __init__(self, machines=None, **unknown_fields): + ''' + machines : typing.Sequence[str] + ''' + machines_ = machines + + # Validate arguments against known Juju API types. + if machines_ is not None and not isinstance(machines_, (bytes, str, list)): + raise Exception("Expected machines_ to be a Sequence, received: {}".format(type(machines_))) + + self.machines = machines_ + self.unknown_fields = unknown_fields + + + +class VolumeFilters(Type): + _toSchema = {'filters': 'filters'} + _toPy = {'filters': 'filters'} + def __init__(self, filters=None, **unknown_fields): + ''' + filters : typing.Sequence[~VolumeFilter] + ''' + filters_ = [VolumeFilter.from_json(o) for o in filters or []] + + # Validate arguments against known Juju API types. + if filters_ is not None and not isinstance(filters_, (bytes, str, list)): + raise Exception("Expected filters_ to be a Sequence, received: {}".format(type(filters_))) + + self.filters = filters_ + self.unknown_fields = 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 + persistent : bool + pool : str + size : int + volume_id : str + wwn : str + ''' + hardware_id_ = hardware_id + persistent_ = persistent + pool_ = pool + size_ = size + volume_id_ = volume_id + wwn_ = wwn + + # Validate arguments against known Juju API types. + if hardware_id_ is not None and not isinstance(hardware_id_, (bytes, str)): + raise Exception("Expected hardware_id_ to be a str, received: {}".format(type(hardware_id_))) + + if persistent_ is not None and not isinstance(persistent_, bool): + raise Exception("Expected persistent_ to be a bool, received: {}".format(type(persistent_))) + + if pool_ is not None and not isinstance(pool_, (bytes, str)): + raise Exception("Expected pool_ to be a str, received: {}".format(type(pool_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if volume_id_ is not None and not isinstance(volume_id_, (bytes, str)): + raise Exception("Expected volume_id_ to be a str, received: {}".format(type(volume_id_))) + + if wwn_ is not None and not isinstance(wwn_, (bytes, str)): + raise Exception("Expected wwn_ to be a str, received: {}".format(type(wwn_))) + + self.hardware_id = hardware_id_ + self.persistent = persistent_ + self.pool = pool_ + self.size = size_ + self.volume_id = volume_id_ + self.wwn = wwn_ + self.unknown_fields = unknown_fields + + + +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 + attributes : typing.Mapping[str, typing.Any] + provider : str + size : int + tags : typing.Mapping[str, str] + volume_tag : str + ''' + attachment_ = VolumeAttachmentParams.from_json(attachment) if attachment else None + attributes_ = attributes + provider_ = provider + size_ = size + tags_ = tags + volume_tag_ = volume_tag + + # Validate arguments against known Juju API types. + if attachment_ is not None and not isinstance(attachment_, (dict, VolumeAttachmentParams)): + raise Exception("Expected attachment_ to be a VolumeAttachmentParams, received: {}".format(type(attachment_))) + + if attributes_ is not None and not isinstance(attributes_, dict): + raise Exception("Expected attributes_ to be a Mapping, received: {}".format(type(attributes_))) + + if provider_ is not None and not isinstance(provider_, (bytes, str)): + raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) + + if size_ is not None and not isinstance(size_, int): + raise Exception("Expected size_ to be a int, received: {}".format(type(size_))) + + if tags_ is not None and not isinstance(tags_, dict): + raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + + if volume_tag_ is not None and not isinstance(volume_tag_, (bytes, str)): + raise Exception("Expected volume_tag_ to be a str, received: {}".format(type(volume_tag_))) + + self.attachment = attachment_ + self.attributes = attributes_ + self.provider = provider_ + self.size = size_ + self.tags = tags_ + self.volume_tag = volume_tag_ + self.unknown_fields = unknown_fields + + + +class VolumeParamsResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : VolumeParams + ''' + error_ = Error.from_json(error) if error else None + result_ = VolumeParams.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, VolumeParams)): + raise Exception("Expected result_ to be a VolumeParams, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class VolumeParamsResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~VolumeParamsResult] + ''' + results_ = [VolumeParamsResult.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 VolumeResult(Type): + _toSchema = {'error': 'error', 'result': 'result'} + _toPy = {'error': 'error', 'result': 'result'} + def __init__(self, error=None, result=None, **unknown_fields): + ''' + error : Error + result : Volume + ''' + error_ = Error.from_json(error) if error else None + result_ = Volume.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, Volume)): + raise Exception("Expected result_ to be a Volume, received: {}".format(type(result_))) + + self.error = error_ + self.result = result_ + self.unknown_fields = unknown_fields + + + +class VolumeResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~VolumeResult] + ''' + results_ = [VolumeResult.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 Volumes(Type): + _toSchema = {'volumes': 'volumes'} + _toPy = {'volumes': 'volumes'} + def __init__(self, volumes=None, **unknown_fields): + ''' + volumes : typing.Sequence[~Volume] + ''' + volumes_ = [Volume.from_json(o) for o in volumes or []] + + # Validate arguments against known Juju API types. + if volumes_ is not None and not isinstance(volumes_, (bytes, str, list)): + raise Exception("Expected volumes_ to be a Sequence, received: {}".format(type(volumes_))) + + self.volumes = volumes_ + self.unknown_fields = 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 + machine_tag : str + ''' + container_type_ = container_type + machine_tag_ = machine_tag + + # Validate arguments against known Juju API types. + if container_type_ is not None and not isinstance(container_type_, (bytes, str)): + raise Exception("Expected container_type_ to be a str, received: {}".format(type(container_type_))) + + if machine_tag_ is not None and not isinstance(machine_tag_, (bytes, str)): + raise Exception("Expected machine_tag_ to be a str, received: {}".format(type(machine_tag_))) + + self.container_type = container_type_ + self.machine_tag = machine_tag_ + self.unknown_fields = 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 + entity : Entity + ''' + container_ = container + entity_ = Entity.from_json(entity) if entity else None + + # Validate arguments against known Juju API types. + if container_ is not None and not isinstance(container_, (bytes, str)): + raise Exception("Expected container_ to be a str, received: {}".format(type(container_))) + + if entity_ is not None and not isinstance(entity_, (dict, Entity)): + raise Exception("Expected entity_ to be a Entity, received: {}".format(type(entity_))) + + self.container = container_ + self.entity = entity_ + self.unknown_fields = unknown_fields + + + +class WatchContainerStartArgs(Type): + _toSchema = {'args': 'args'} + _toPy = {'args': 'args'} + def __init__(self, args=None, **unknown_fields): + ''' + args : typing.Sequence[~WatchContainerStartArg] + ''' + args_ = [WatchContainerStartArg.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 WatchContainers(Type): + _toSchema = {'params': 'params'} + _toPy = {'params': 'params'} + def __init__(self, params=None, **unknown_fields): + ''' + params : typing.Sequence[~WatchContainer] + ''' + params_ = [WatchContainer.from_json(o) for o in params or []] + + # Validate arguments against known Juju API types. + if params_ is not None and not isinstance(params_, (bytes, str, list)): + raise Exception("Expected params_ to be a Sequence, received: {}".format(type(params_))) + + self.params = params_ + self.unknown_fields = 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 + error : Error + name : str + ''' + available_ = available + error_ = Error.from_json(error) if error else None + name_ = name + + # Validate arguments against known Juju API types. + if available_ is not None and not isinstance(available_, bool): + raise Exception("Expected available_ to be a bool, received: {}".format(type(available_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + if name_ is not None and not isinstance(name_, (bytes, str)): + raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) + + self.available = available_ + self.error = error_ + self.name = name_ + self.unknown_fields = unknown_fields + + + +class ZoneResults(Type): + _toSchema = {'results': 'results'} + _toPy = {'results': 'results'} + def __init__(self, results=None, **unknown_fields): + ''' + results : typing.Sequence[~ZoneResult] + ''' + results_ = [ZoneResult.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 + + diff --git a/juju/client/schemas-juju-2.0.0.json b/juju/client/retired_schemas/schemas-juju-2.0.0.json similarity index 100% rename from juju/client/schemas-juju-2.0.0.json rename to juju/client/retired_schemas/schemas-juju-2.0.0.json diff --git a/juju/client/schemas-juju-2.0.1.json b/juju/client/retired_schemas/schemas-juju-2.0.1.json similarity index 100% rename from juju/client/schemas-juju-2.0.1.json rename to juju/client/retired_schemas/schemas-juju-2.0.1.json diff --git a/juju/client/schemas-juju-2.0.2.json b/juju/client/retired_schemas/schemas-juju-2.0.2.json similarity index 100% rename from juju/client/schemas-juju-2.0.2.json rename to juju/client/retired_schemas/schemas-juju-2.0.2.json diff --git a/juju/client/schemas-juju-2.0.3.json b/juju/client/retired_schemas/schemas-juju-2.0.3.json similarity index 100% rename from juju/client/schemas-juju-2.0.3.json rename to juju/client/retired_schemas/schemas-juju-2.0.3.json diff --git a/juju/client/schemas-juju-2.1.0.json b/juju/client/retired_schemas/schemas-juju-2.1.0.json similarity index 100% rename from juju/client/schemas-juju-2.1.0.json rename to juju/client/retired_schemas/schemas-juju-2.1.0.json diff --git a/juju/client/schemas-juju-2.1.1.json b/juju/client/retired_schemas/schemas-juju-2.1.1.json similarity index 100% rename from juju/client/schemas-juju-2.1.1.json rename to juju/client/retired_schemas/schemas-juju-2.1.1.json diff --git a/juju/client/schemas-juju-2.1.2.json b/juju/client/retired_schemas/schemas-juju-2.1.2.json similarity index 100% rename from juju/client/schemas-juju-2.1.2.json rename to juju/client/retired_schemas/schemas-juju-2.1.2.json diff --git a/juju/client/schemas-juju-2.2-alpha1.json b/juju/client/retired_schemas/schemas-juju-2.2-alpha1.json similarity index 100% rename from juju/client/schemas-juju-2.2-alpha1.json rename to juju/client/retired_schemas/schemas-juju-2.2-alpha1.json diff --git a/juju/client/schemas-juju-2.2-beta1.json b/juju/client/retired_schemas/schemas-juju-2.2-beta1.json similarity index 100% rename from juju/client/schemas-juju-2.2-beta1.json rename to juju/client/retired_schemas/schemas-juju-2.2-beta1.json diff --git a/juju/client/schemas-juju-2.2-beta2.json b/juju/client/retired_schemas/schemas-juju-2.2-beta2.json similarity index 100% rename from juju/client/schemas-juju-2.2-beta2.json rename to juju/client/retired_schemas/schemas-juju-2.2-beta2.json diff --git a/juju/client/schemas-juju-2.2-rc1.json b/juju/client/retired_schemas/schemas-juju-2.2-rc1.json similarity index 100% rename from juju/client/schemas-juju-2.2-rc1.json rename to juju/client/retired_schemas/schemas-juju-2.2-rc1.json diff --git a/juju/client/schemas-juju-2.3-alpha1.json b/juju/client/retired_schemas/schemas-juju-2.3-alpha1.json similarity index 100% rename from juju/client/schemas-juju-2.3-alpha1.json rename to juju/client/retired_schemas/schemas-juju-2.3-alpha1.json diff --git a/juju/client/schemas-juju-2.5-rc1.json b/juju/client/retired_schemas/schemas-juju-2.5-rc1.json similarity index 100% rename from juju/client/schemas-juju-2.5-rc1.json rename to juju/client/retired_schemas/schemas-juju-2.5-rc1.json diff --git a/juju/client/schemas-juju-2.6.3.json b/juju/client/retired_schemas/schemas-juju-2.6.3.json similarity index 100% rename from juju/client/schemas-juju-2.6.3.json rename to juju/client/retired_schemas/schemas-juju-2.6.3.json diff --git a/juju/client/schemas-juju-2.6.4.json b/juju/client/retired_schemas/schemas-juju-2.6.4.json similarity index 100% rename from juju/client/schemas-juju-2.6.4.json rename to juju/client/retired_schemas/schemas-juju-2.6.4.json diff --git a/juju/client/schemas-juju-2.6.5.json b/juju/client/retired_schemas/schemas-juju-2.6.5.json similarity index 100% rename from juju/client/schemas-juju-2.6.5.json rename to juju/client/retired_schemas/schemas-juju-2.6.5.json diff --git a/juju/client/schemas-juju-2.6.6.json b/juju/client/retired_schemas/schemas-juju-2.6.6.json similarity index 100% rename from juju/client/schemas-juju-2.6.6.json rename to juju/client/retired_schemas/schemas-juju-2.6.6.json diff --git a/juju/client/schemas-juju-2.7.0.json b/juju/client/retired_schemas/schemas-juju-2.7.0.json similarity index 100% rename from juju/client/schemas-juju-2.7.0.json rename to juju/client/retired_schemas/schemas-juju-2.7.0.json diff --git a/juju/client/schemas-juju-2.8-beta1.json b/juju/client/retired_schemas/schemas-juju-2.8-beta1.json similarity index 100% rename from juju/client/schemas-juju-2.8-beta1.json rename to juju/client/retired_schemas/schemas-juju-2.8-beta1.json diff --git a/juju/client/schemas-juju-2.8-rc2.json b/juju/client/retired_schemas/schemas-juju-2.8-rc2.json similarity index 100% rename from juju/client/schemas-juju-2.8-rc2.json rename to juju/client/retired_schemas/schemas-juju-2.8-rc2.json diff --git a/juju/client/schemas-juju-2.8.1.json b/juju/client/retired_schemas/schemas-juju-2.8.1.json similarity index 100% rename from juju/client/schemas-juju-2.8.1.json rename to juju/client/retired_schemas/schemas-juju-2.8.1.json diff --git a/juju/client/schemas-juju-2.8.10.json b/juju/client/retired_schemas/schemas-juju-2.8.10.json similarity index 100% rename from juju/client/schemas-juju-2.8.10.json rename to juju/client/retired_schemas/schemas-juju-2.8.10.json diff --git a/juju/client/schemas-juju-2.8.3.json b/juju/client/retired_schemas/schemas-juju-2.8.3.json similarity index 100% rename from juju/client/schemas-juju-2.8.3.json rename to juju/client/retired_schemas/schemas-juju-2.8.3.json diff --git a/juju/client/schemas-juju-2.9-beta1.json b/juju/client/retired_schemas/schemas-juju-2.9-beta1.json similarity index 100% rename from juju/client/schemas-juju-2.9-beta1.json rename to juju/client/retired_schemas/schemas-juju-2.9-beta1.json diff --git a/juju/client/schemas-juju-2.9-rc3.json b/juju/client/retired_schemas/schemas-juju-2.9-rc3.json similarity index 100% rename from juju/client/schemas-juju-2.9-rc3.json rename to juju/client/retired_schemas/schemas-juju-2.9-rc3.json diff --git a/juju/client/schemas-juju-2.9-rc8.json b/juju/client/retired_schemas/schemas-juju-2.9-rc8.json similarity index 100% rename from juju/client/schemas-juju-2.9-rc8.json rename to juju/client/retired_schemas/schemas-juju-2.9-rc8.json diff --git a/juju/client/schemas-juju-2.9.0.json b/juju/client/retired_schemas/schemas-juju-2.9.0.json similarity index 100% rename from juju/client/schemas-juju-2.9.0.json rename to juju/client/retired_schemas/schemas-juju-2.9.0.json diff --git a/juju/client/schemas-juju-2.9.1.json b/juju/client/retired_schemas/schemas-juju-2.9.1.json similarity index 100% rename from juju/client/schemas-juju-2.9.1.json rename to juju/client/retired_schemas/schemas-juju-2.9.1.json diff --git a/juju/client/schemas-juju-2.9.17.json b/juju/client/retired_schemas/schemas-juju-2.9.17.json similarity index 100% rename from juju/client/schemas-juju-2.9.17.json rename to juju/client/retired_schemas/schemas-juju-2.9.17.json diff --git a/juju/client/schemas-juju-2.9.19.json b/juju/client/retired_schemas/schemas-juju-2.9.19.json similarity index 100% rename from juju/client/schemas-juju-2.9.19.json rename to juju/client/retired_schemas/schemas-juju-2.9.19.json diff --git a/juju/client/schemas-juju-2.9.24.json b/juju/client/retired_schemas/schemas-juju-2.9.24.json similarity index 100% rename from juju/client/schemas-juju-2.9.24.json rename to juju/client/retired_schemas/schemas-juju-2.9.24.json diff --git a/juju/client/schemas-juju-2.9.27.json b/juju/client/retired_schemas/schemas-juju-2.9.27.json similarity index 100% rename from juju/client/schemas-juju-2.9.27.json rename to juju/client/retired_schemas/schemas-juju-2.9.27.json diff --git a/juju/client/schemas-juju-2.9.33.json b/juju/client/schemas-juju-2.9.33.json new file mode 100644 index 000000000..873591946 --- /dev/null +++ b/juju/client/schemas-juju-2.9.33.json @@ -0,0 +1,50548 @@ +[ + { + "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." + }, + "Enqueue": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Actions" + }, + "Result": { + "$ref": "#/definitions/ActionResults" + } + }, + "description": "Enqueue takes a list of Actions and queues them up to be executed by\nthe designated ActionReceiver, returning the params.Action for each\nenqueued Action, or an error if there was a problem enqueueing the\nAction." + }, + "EnqueueOperation": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Actions" + }, + "Result": { + "$ref": "#/definitions/EnqueuedActionsV2" + } + }, + "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." + }, + "FindActionTagsByPrefix": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FindTags" + }, + "Result": { + "$ref": "#/definitions/FindTagsResults" + } + }, + "description": "FindActionTagsByPrefix takes a list of string prefixes and finds\ncorresponding ActionTags that match that prefix.\nTODO(juju3) - rename API method since we only need prefix matching for UUIDs" + }, + "FindActionsByNames": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FindActionsByNames" + }, + "Result": { + "$ref": "#/definitions/ActionsByNames" + } + } + }, + "ListAll": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionsByReceivers" + } + }, + "description": "ListAll takes a list of Entities representing ActionReceivers and\nreturns all of the Actions that have been enqueued or run by each of\nthose Entities." + }, + "ListCompleted": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionsByReceivers" + } + }, + "description": "ListCompleted takes a list of Entities representing ActionReceivers\nand returns all of the Actions that have been run on each of those\nEntities." + }, + "ListOperations": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/OperationQueryArgs" + }, + "Result": { + "$ref": "#/definitions/OperationResults" + } + }, + "description": "ListOperations fetches the called actions for specified apps/units." + }, + "ListPending": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionsByReceivers" + } + }, + "description": "ListPending takes a list of Entities representing ActionReceivers\nand returns all of the Actions that are enqueued for each of those\nEntities." + }, + "ListRunning": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ActionsByReceivers" + } + }, + "description": "ListRunning takes a list of Entities representing ActionReceivers and\nreturns all of the Actions that have are running on each of those\nEntities." + }, + "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/EnqueuedActionsV2" + } + }, + "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/EnqueuedActionsV2" + } + }, + "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": { + "name": { + "type": "string" + }, + "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 + }, + "ActionsByName": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionResult" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ActionsByNames": { + "type": "object", + "properties": { + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionsByName" + } + } + }, + "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 + }, + "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 + }, + "EnqueuedActionsV2": { + "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" + ] + }, + "FindActionsByNames": { + "type": "object", + "properties": { + "names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "FindTags": { + "type": "object", + "properties": { + "prefixes": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "prefixes" + ] + }, + "FindTagsResults": { + "type": "object", + "properties": { + "matches": { + "type": "object", + "patternProperties": { + ".*": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + } + } + }, + "additionalProperties": false, + "required": [ + "matches" + ] + }, + "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" + }, + "machines": { + "type": "array", + "items": { + "type": "string" + } + }, + "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": "", + "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" + } + } + }, + "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" + }, + "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": "AgentAPIV3 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": "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": 3, + "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": 2, + "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": "APIv14 provides the Application API facade for version 14.\nIt adds Leader.", + "Version": 14, + "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/ConsumeApplicationArgs" + }, + "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." + }, + "Destroy": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationDestroy" + } + }, + "description": "Destroy destroys a given application, local or remote.\n\nNOTE(axw) this exists only for backwards compatibility,\nfor API facade versions 1-3; clients should prefer its\nsuccessor, DestroyApplication, below. Until all consumers\nhave been updated, or we bump a major version, we can't\ndrop this.\n\nTODO(axw) 2017-03-16 #1673323\nDrop this in Juju 3.0." + }, + "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." + }, + "DestroyUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyApplicationUnits" + } + }, + "description": "DestroyUnits removes a given set of application units.\n\nNOTE(axw) this exists only for backwards compatibility,\nfor API facade versions 1-3; clients should prefer its\nsuccessor, DestroyUnit, below. Until all consumers have\nbeen updated, or we bump a major version, we can't drop\nthis.\n\nTODO(axw) 2017-03-16 #1673323\nDrop this in Juju 3.0." + }, + "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." + }, + "GetCharmURL": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationGet" + }, + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "GetCharmURL returns the charm URL the given application is\nrunning at present." + }, + "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." + }, + "Set": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationSet" + } + }, + "description": "Set implements the server side of Application.Set.\nIt does not unset values that are set to an empty string.\nUnset should be used for that." + }, + "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": "SetConfig 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." + }, + "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)." + }, + "Unset": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationUnset" + } + }, + "description": "Unset implements the server side of Client.Unset." + }, + "UnsetApplicationsConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationConfigUnsetArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UnsetApplicationsConfig implements the server side of Application.UnsetApplicationsConfig." + }, + "UpdateApplicationSeries": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdateApplicationSeries updates the application series. Series for\nsubordinates 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" + } + } + }, + "series": { + "type": "string" + }, + "storage": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/Constraints" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "series", + "charm-url", + "channel", + "num-units", + "config-yaml", + "constraints", + "Force" + ] + }, + "ApplicationDestroy": { + "type": "object", + "properties": { + "application": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application" + ] + }, + "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 + } + } + }, + "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" + } + } + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "charm", + "config", + "constraints", + "series", + "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" + ] + }, + "ApplicationOfferDetails": { + "type": "object", + "properties": { + "application-description": { + "type": "string" + }, + "bindings": { + "type": "object", + "patternProperties": { + ".*": { + "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" + }, + "spaces": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteSpace" + } + }, + "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": { + "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" + }, + "series": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "principal", + "exposed", + "remote", + "life" + ] + }, + "ApplicationSet": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "options": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "branch", + "options" + ] + }, + "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-series": { + "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-series" + ] + }, + "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" + ] + }, + "CharmOrigin": { + "type": "object", + "properties": { + "architecture": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "id": { + "type": "string" + }, + "instance-key": { + "type": "string" + }, + "os": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "risk": { + "type": "string" + }, + "series": { + "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" + ] + }, + "ConsumeApplicationArg": { + "type": "object", + "properties": { + "ApplicationOfferDetails": { + "$ref": "#/definitions/ApplicationOfferDetails" + }, + "application-alias": { + "type": "string" + }, + "application-description": { + "type": "string" + }, + "bindings": { + "type": "object", + "patternProperties": { + ".*": { + "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" + }, + "spaces": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteSpace" + } + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferUserDetails" + } + } + }, + "additionalProperties": false, + "required": [ + "source-model-tag", + "offer-uuid", + "offer-url", + "offer-name", + "application-description", + "ApplicationOfferDetails" + ] + }, + "ConsumeApplicationArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/ConsumeApplicationArg" + } + } + }, + "additionalProperties": false + }, + "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" + }, + "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 + }, + "DestroyApplicationUnits": { + "type": "object", + "properties": { + "unit-names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "unit-names" + ] + }, + "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" + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit-tag", + "force" + ] + }, + "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" + ] + }, + "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" + ] + }, + "RemoteSpace": { + "type": "object", + "properties": { + "cloud-type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "provider-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider-id": { + "type": "string" + }, + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/Subnet" + } + } + }, + "additionalProperties": false, + "required": [ + "cloud-type", + "name", + "provider-id", + "provider-attributes", + "subnets" + ] + }, + "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" + ] + }, + "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" + ] + }, + "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 + }, + "UpdateSeriesArg": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "series": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force", + "series" + ] + }, + "UpdateSeriesArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSeriesArg" + } + } + }, + "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" + }, + "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": "OffersAPIV4 implements the cross model interface V4.", + "Version": 4, + "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/QueryApplicationOffersResults" + } + }, + "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/QueryApplicationOffersResults" + } + }, + "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 GUI 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" + ] + }, + "ApplicationOfferAdminDetails": { + "type": "object", + "properties": { + "ApplicationOfferDetails": { + "$ref": "#/definitions/ApplicationOfferDetails" + }, + "application-description": { + "type": "string" + }, + "application-name": { + "type": "string" + }, + "bindings": { + "type": "object", + "patternProperties": { + ".*": { + "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" + }, + "spaces": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteSpace" + } + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferUserDetails" + } + } + }, + "additionalProperties": false, + "required": [ + "source-model-tag", + "offer-uuid", + "offer-url", + "offer-name", + "application-description", + "ApplicationOfferDetails", + "application-name", + "charm-url" + ] + }, + "ApplicationOfferDetails": { + "type": "object", + "properties": { + "application-description": { + "type": "string" + }, + "bindings": { + "type": "object", + "patternProperties": { + ".*": { + "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" + }, + "spaces": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteSpace" + } + }, + "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/ApplicationOfferAdminDetails" + } + }, + "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/ApplicationOfferDetails" + } + }, + "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/ApplicationOfferDetails" + } + }, + "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" + ] + }, + "QueryApplicationOffersResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationOfferAdminDetails" + } + } + }, + "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" + ] + }, + "RemoteSpace": { + "type": "object", + "properties": { + "cloud-type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "provider-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider-id": { + "type": "string" + }, + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/Subnet" + } + } + }, + "additionalProperties": false, + "required": [ + "cloud-type", + "name", + "provider-id", + "provider-attributes", + "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": "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": "APIv3 serves backup-specific API methods for version 3.", + "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" + } + } + }, + "Info": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BackupsInfoArgs" + }, + "Result": { + "$ref": "#/definitions/BackupsMetadataResult" + } + }, + "description": "Info provides the implementation of the API method." + }, + "List": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BackupsListArgs" + }, + "Result": { + "$ref": "#/definitions/BackupsListResult" + } + }, + "description": "List provides the implementation of the API method." + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BackupsRemoveArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Remove deletes the backups defined by ID from the database." + }, + "Restore": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RestoreArgs" + } + }, + "description": "Restore implements the server side of Backups.Restore." + } + }, + "definitions": { + "BackupsCreateArgs": { + "type": "object", + "properties": { + "no-download": { + "type": "boolean" + }, + "notes": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "notes", + "no-download" + ] + }, + "BackupsInfoArgs": { + "type": "object", + "properties": { + "id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "id" + ] + }, + "BackupsListArgs": { + "type": "object", + "additionalProperties": false + }, + "BackupsListResult": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/definitions/BackupsMetadataResult" + } + } + }, + "additionalProperties": false, + "required": [ + "list" + ] + }, + "BackupsMetadataResult": { + "type": "object", + "properties": { + "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" + }, + "series": { + "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", + "series", + "filename", + "format-version", + "controller-uuid", + "controller-machine-id", + "controller-machine-inst-id", + "ha-nodes" + ] + }, + "BackupsRemoveArgs": { + "type": "object", + "properties": { + "ids": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "ids" + ] + }, + "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" + ] + }, + "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" + ] + }, + "RestoreArgs": { + "type": "object", + "properties": { + "backup-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "backup-id" + ] + } + } + } + }, + { + "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" + } + }, + "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." + }, + "CAASApplicationGarbageCollect": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CAASApplicationGarbageCollectArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "CAASApplicationGarbageCollect cleans up units that have gone away permanently.\nOnly observed units will be deleted as new units could have surfaced between\nthe capturing of kuberentes pod state/application state and this call." + }, + "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." + }, + "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/CAASApplicationProvisioningInfoResults" + } + }, + "description": "ProvisioningInfo returns the info needed to provision a caas 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." + }, + "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." + }, + "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" + ] + }, + "CAASApplicationGarbageCollectArg": { + "type": "object", + "properties": { + "active-pod-names": { + "type": "array", + "items": { + "type": "string" + } + }, + "application": { + "$ref": "#/definitions/Entity" + }, + "desired-replicas": { + "type": "integer" + }, + "force": { + "type": "boolean" + }, + "observed-units": { + "$ref": "#/definitions/Entities" + } + }, + "additionalProperties": false, + "required": [ + "application", + "observed-units", + "desired-replicas", + "active-pod-names", + "force" + ] + }, + "CAASApplicationGarbageCollectArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/CAASApplicationGarbageCollectArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "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" + ] + }, + "CAASApplicationProvisioningInfo": { + "type": "object", + "properties": { + "api-addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "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" + }, + "series": { + "type": "string" + }, + "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" + ] + }, + "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": { + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + } + }, + "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" + } + }, + "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" + ] + }, + "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" + }, + "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": { + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + } + }, + "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" + } + }, + "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": "CAASFirewallerEmbedded", + "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." + }, + "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" + ] + }, + "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": { + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + } + }, + "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" + } + }, + "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" + ] + }, + "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" + } + } + } + }, + "definitions": { + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + } + } + } + }, + { + "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." + } + }, + "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": { + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + } + }, + "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" + } + }, + "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" + } + }, + "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", + "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": { + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + } + }, + "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" + } + }, + "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" + }, + "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": "CharmHub", + "Description": "CharmHubAPI API provides the CharmHub API facade for version 1.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Find": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Query" + }, + "Result": { + "$ref": "#/definitions/CharmHubEntityFindResult" + } + }, + "description": "Find queries the CharmHub API with a given entity ID." + }, + "Info": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Info" + }, + "Result": { + "$ref": "#/definitions/CharmHubEntityInfoResult" + } + }, + "description": "Info queries the CharmHub API with a given entity ID." + } + }, + "definitions": { + "BundleCharm": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "package-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "package-id" + ] + }, + "Channel": { + "type": "object", + "properties": { + "platforms": { + "type": "array", + "items": { + "$ref": "#/definitions/Platform" + } + }, + "released-at": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "risk": { + "type": "string" + }, + "size": { + "type": "integer" + }, + "track": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "released-at", + "track", + "risk", + "revision", + "size", + "version", + "platforms" + ] + }, + "CharmHubBundle": { + "type": "object", + "properties": { + "charms": { + "type": "array", + "items": { + "$ref": "#/definitions/BundleCharm" + } + } + }, + "additionalProperties": false, + "required": [ + "charms" + ] + }, + "CharmHubCharm": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/CharmOption" + } + } + }, + "relations": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + } + } + }, + "subordinate": { + "type": "boolean" + }, + "used-by": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "config", + "relations", + "subordinate", + "used-by" + ] + }, + "CharmHubEntityFindResult": { + "type": "object", + "properties": { + "errors": { + "$ref": "#/definitions/ErrorResponse" + }, + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/FindResponse" + } + } + }, + "additionalProperties": false, + "required": [ + "result", + "errors" + ] + }, + "CharmHubEntityInfoResult": { + "type": "object", + "properties": { + "errors": { + "$ref": "#/definitions/ErrorResponse" + }, + "result": { + "$ref": "#/definitions/InfoResponse" + } + }, + "additionalProperties": false, + "required": [ + "result", + "errors" + ] + }, + "CharmHubError": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "code", + "message" + ] + }, + "CharmOption": { + "type": "object", + "properties": { + "default": { + "type": "object", + "additionalProperties": true + }, + "description": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type" + ] + }, + "ErrorResponse": { + "type": "object", + "properties": { + "error-list": { + "$ref": "#/definitions/CharmHubError" + } + }, + "additionalProperties": false, + "required": [ + "error-list" + ] + }, + "FindResponse": { + "type": "object", + "properties": { + "architectures": { + "type": "array", + "items": { + "type": "string" + } + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "os": { + "type": "array", + "items": { + "type": "string" + } + }, + "publisher": { + "type": "string" + }, + "series": { + "type": "array", + "items": { + "type": "string" + } + }, + "store-url": { + "type": "string" + }, + "summary": { + "type": "string" + }, + "type": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "id", + "name", + "publisher", + "summary", + "version", + "store-url" + ] + }, + "Info": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "InfoResponse": { + "type": "object", + "properties": { + "bundle": { + "$ref": "#/definitions/CharmHubBundle" + }, + "channel-map": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/Channel" + } + } + }, + "charm": { + "$ref": "#/definitions/CharmHubCharm" + }, + "description": { + "type": "string" + }, + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "publisher": { + "type": "string" + }, + "series": { + "type": "array", + "items": { + "type": "string" + } + }, + "store-url": { + "type": "string" + }, + "summary": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string" + } + }, + "tracks": { + "type": "array", + "items": { + "type": "string" + } + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "id", + "name", + "description", + "publisher", + "summary", + "series", + "store-url", + "tags", + "channel-map", + "tracks" + ] + }, + "Platform": { + "type": "object", + "properties": { + "architecture": { + "type": "string" + }, + "os": { + "type": "string" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "architecture", + "os", + "series" + ] + }, + "Query": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "channel": { + "type": "string" + }, + "platforms": { + "type": "string" + }, + "publisher": { + "type": "string" + }, + "query": { + "type": "string" + }, + "relation-provides": { + "type": "string" + }, + "relation-requires": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "query" + ] + } + } + } + }, + { + "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": "API implements the charms interface and is the concrete\nimplementation of the API end point.", + "Version": 4, + "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()." + }, + "AddCharmWithAuthorization": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddCharmWithAuth" + }, + "Result": { + "$ref": "#/definitions/CharmOriginResult" + } + }, + "description": "AddCharmWithAuthorization adds the given charm URL (which must include\nrevision) to the environment, if it does not exist yet. Local charms are\nnot supported, only charm store and charm hub URLs. See also AddLocalCharm().\n\nThe authorization macaroon, args.CharmStoreMacaroon, may be\nomitted, in which case this call is equivalent to AddCharm." + }, + "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." + }, + "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": { + "AddCharmWithAuth": { + "type": "object", + "properties": { + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "force": { + "type": "boolean" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "series": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "charm-origin", + "macaroon", + "force", + "series" + ] + }, + "AddCharmWithOrigin": { + "type": "object", + "properties": { + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "force": { + "type": "boolean" + }, + "series": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "charm-origin", + "force", + "series" + ] + }, + "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" + ] + }, + "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": { + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + } + }, + "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" + } + }, + "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" + }, + "branch": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "id": { + "type": "string" + }, + "instance-key": { + "type": "string" + }, + "os": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "risk": { + "type": "string" + }, + "series": { + "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-series": { + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "charm-origin", + "supported-series" + ] + }, + "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": 5, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + }, + "description": "APIHostPorts returns the API host/port addresses stored in state.\nTODO(juju3) - remove" + }, + "AbortCurrentUpgrade": { + "type": "object", + "description": "AbortCurrentUpgrade aborts and archives the current upgrade\nsynchronisation record, if any." + }, + "AddCharm": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddCharm" + } + }, + "description": "NOTE: AddCharm is deprecated as of juju 2.9 and charms facade version 3.\nPlease discontinue use and move to the charms facade version.\n\nTODO(juju3) - remove" + }, + "AddCharmWithAuthorization": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddCharmWithAuthorization" + } + }, + "description": "AddCharmWithAuthorization adds the given charm URL (which must include\nrevision) to the model, if it does not exist yet. Local charms are not\nsupported, only charm store URLs. See also AddLocalCharm().\n\nThe authorization macaroon, args.CharmStoreMacaroon, may be omitted, in\nwhich case this call is equivalent to AddCharm.\n\nNOTE: AddCharmWithAuthorization is deprecated as of juju 2.9 and charms\nfacade version 3. Please discontinue use and move to the charms facade\nversion.\n\nTODO(juju3) - remove" + }, + "AddMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddMachines" + }, + "Result": { + "$ref": "#/definitions/AddMachinesResults" + } + }, + "description": "AddMachines adds new machines with the supplied parameters.\nTODO(juju3) - remove" + }, + "AddMachinesV2": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddMachines" + }, + "Result": { + "$ref": "#/definitions/AddMachinesResults" + } + }, + "description": "AddMachinesV2 adds new machines with the supplied parameters.\nTODO(juju3) - remove" + }, + "AgentVersion": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/AgentVersionResult" + } + }, + "description": "AgentVersion returns the current version that the API server is running.\nTODO(juju3) - remove" + }, + "CACert": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/BytesResult" + } + }, + "description": "CACert returns the certificate used to validate the state connection." + }, + "DestroyMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyMachines" + } + }, + "description": "DestroyMachines removes a given set of machines.\nTODO(juju3) - remove" + }, + "FindTools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FindToolsParams" + }, + "Result": { + "$ref": "#/definitions/FindToolsResult" + } + }, + "description": "FindTools returns a List containing all tools matching the given parameters." + }, + "FullStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StatusParams" + }, + "Result": { + "$ref": "#/definitions/FullStatus" + } + }, + "description": "FullStatus gives the information needed for juju status over the api" + }, + "GetBundleChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/BundleChangesParams" + }, + "Result": { + "$ref": "#/definitions/BundleChangesResults" + } + }, + "description": "GetBundleChanges 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.\nDeprecated: clients should use the GetChanges endpoint on the Bundle facade.\nNote: any new feature in the future like devices will never be supported here." + }, + "GetModelConstraints": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/GetConstraintsResults" + } + }, + "description": "GetModelConstraints returns the constraints for the model.\nTODO(juju3) - remove" + }, + "InjectMachines": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddMachines" + }, + "Result": { + "$ref": "#/definitions/AddMachinesResults" + } + }, + "description": "InjectMachines injects a machine into state with provisioned status.\nTODO(juju3) - remove" + }, + "ModelGet": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResults" + } + }, + "description": "ModelGet implements the server-side part of the\nmodel-config CLI command." + }, + "ModelInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelInfo" + } + }, + "description": "ModelInfo returns information about the current model.\nTODO(juju3) - remove" + }, + "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." + }, + "ModelUserInfo": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelUserInfoResults" + } + }, + "description": "ModelUserInfo returns information on all users in the model.\nTODO(juju3) - remove" + }, + "PrivateAddress": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/PrivateAddress" + }, + "Result": { + "$ref": "#/definitions/PrivateAddressResults" + } + }, + "description": "PrivateAddress implements the server side of Client.PrivateAddress.\nTODO(juju3) - remove as this is unused" + }, + "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.\nTODO(juju3) - remove" + }, + "PublicAddress": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/PublicAddress" + }, + "Result": { + "$ref": "#/definitions/PublicAddressResults" + } + }, + "description": "PublicAddress implements the server side of Client.PublicAddress.\nTODO(juju3) - remove as this is unused" + }, + "ResolveCharms": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ResolveCharms" + }, + "Result": { + "$ref": "#/definitions/ResolveCharmResults" + } + }, + "description": "ResolveCharms resolves the best available charm URLs with series, for charm\nlocations without a series specified.\n\nNOTE: ResolveCharms is deprecated as of juju 2.9 and charms facade version 3.\nPlease discontinue use and move to the charms facade version.\n\nTODO(juju3) - remove" + }, + "Resolved": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Resolved" + } + }, + "description": "Resolved implements the server side of Client.Resolved." + }, + "RetryProvisioning": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RetryProvisioning marks a provisioning error as transient on the machines.\nTODO(juju3) - remove" + }, + "SLALevel": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "SLALevel returns the current sla level for the model." + }, + "SetModelAgentVersion": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetModelAgentVersion" + } + }, + "description": "SetModelAgentVersion sets the model agent version." + }, + "SetModelConstraints": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetConstraints" + } + }, + "description": "SetModelConstraints sets the constraints for the model.\nTODO(juju3) - remove" + }, + "SetSLALevel": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ModelSLA" + } + }, + "description": "SetSLALevel sets the sla level on the model." + }, + "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": { + "APIHostPortsResult": { + "type": "object", + "properties": { + "servers": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/HostPort" + } + } + } + }, + "additionalProperties": false, + "required": [ + "servers" + ] + }, + "AddCharm": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "channel", + "force" + ] + }, + "AddCharmWithAuthorization": { + "type": "object", + "properties": { + "channel": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "channel", + "macaroon", + "force" + ] + }, + "AddMachineParams": { + "type": "object", + "properties": { + "addresses": { + "type": "array", + "items": { + "$ref": "#/definitions/Address" + } + }, + "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" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "series", + "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" + ] + }, + "AgentVersionResult": { + "type": "object", + "properties": { + "version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + }, + "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": { + "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" + } + } + } + }, + "series": { + "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", + "series", + "exposed", + "life", + "relations", + "can-upgrade-to", + "subordinate-to", + "units", + "meter-statuses", + "status", + "workload-version", + "endpoint-bindings", + "public-address" + ] + }, + "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" + ] + }, + "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" + ] + }, + "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 + }, + "BytesResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "ConfigValue": { + "type": "object", + "properties": { + "source": { + "type": "string" + }, + "value": { + "type": "object", + "additionalProperties": true + } + }, + "additionalProperties": false, + "required": [ + "value", + "source" + ] + }, + "Constraints": { + "type": "object", + "properties": { + "Count": { + "type": "integer" + }, + "Pool": { + "type": "string" + }, + "Size": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "Pool", + "Size", + "Count" + ] + }, + "DestroyMachines": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "machine-names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "machine-names", + "force" + ] + }, + "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" + ] + }, + "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" + ] + }, + "ExposedEndpoint": { + "type": "object", + "properties": { + "expose-to-cidrs": { + "type": "array", + "items": { + "type": "string" + } + }, + "expose-to-spaces": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "FindToolsParams": { + "type": "object", + "properties": { + "agentstream": { + "type": "string" + }, + "arch": { + "type": "string" + }, + "major": { + "type": "integer" + }, + "minor": { + "type": "integer" + }, + "number": { + "$ref": "#/definitions/Number" + }, + "os-type": { + "type": "string" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "number", + "major", + "minor", + "arch", + "series", + "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" + }, + "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" + } + } + } + }, + "additionalProperties": false, + "required": [ + "model", + "machines", + "applications", + "remote-applications", + "offers", + "relations", + "controller-timestamp", + "branches" + ] + }, + "GetConstraintsResults": { + "type": "object", + "properties": { + "constraints": { + "$ref": "#/definitions/Value" + } + }, + "additionalProperties": false, + "required": [ + "constraints" + ] + }, + "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" + } + } + }, + "additionalProperties": false + }, + "History": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "statuses": { + "type": "array", + "items": { + "$ref": "#/definitions/DetailedStatus" + } + } + }, + "additionalProperties": false, + "required": [ + "statuses" + ] + }, + "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" + ] + }, + "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" + ] + }, + "Macaroon": { + "type": "object", + "additionalProperties": false + }, + "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" + } + } + }, + "additionalProperties": false + }, + "MachineStatus": { + "type": "object", + "properties": { + "agent-status": { + "$ref": "#/definitions/DetailedStatus" + }, + "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" + }, + "series": { + "type": "string" + }, + "wants-vote": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "agent-status", + "instance-status", + "modification-status", + "dns-name", + "instance-id", + "display-name", + "series", + "id", + "containers", + "constraints", + "hardware", + "jobs", + "has-vote", + "wants-vote" + ] + }, + "MeterStatus": { + "type": "object", + "properties": { + "color": { + "type": "string" + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "color", + "message" + ] + }, + "ModelConfigResults": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/ConfigValue" + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "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-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" + }, + "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", + "sla", + "agent-version" + ] + }, + "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" + ] + }, + "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" + ] + }, + "ModelSet": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + }, + "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" + ] + }, + "ModelUnset": { + "type": "object", + "properties": { + "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" + ] + }, + "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" + ] + }, + "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" + ] + }, + "Placement": { + "type": "object", + "properties": { + "directive": { + "type": "string" + }, + "scope": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "scope", + "directive" + ] + }, + "PrivateAddress": { + "type": "object", + "properties": { + "target": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "target" + ] + }, + "PrivateAddressResults": { + "type": "object", + "properties": { + "private-address": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "private-address" + ] + }, + "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" + ] + }, + "PublicAddress": { + "type": "object", + "properties": { + "target": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "target" + ] + }, + "PublicAddressResults": { + "type": "object", + "properties": { + "public-address": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "public-address" + ] + }, + "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" + ] + }, + "ResolveCharmResult": { + "type": "object", + "properties": { + "error": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false + }, + "ResolveCharmResults": { + "type": "object", + "properties": { + "urls": { + "type": "array", + "items": { + "$ref": "#/definitions/ResolveCharmResult" + } + } + }, + "additionalProperties": false, + "required": [ + "urls" + ] + }, + "ResolveCharms": { + "type": "object", + "properties": { + "references": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "references" + ] + }, + "Resolved": { + "type": "object", + "properties": { + "retry": { + "type": "boolean" + }, + "unit-name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit-name", + "retry" + ] + }, + "SetConstraints": { + "type": "object", + "properties": { + "application": { + "type": "string" + }, + "constraints": { + "$ref": "#/definitions/Value" + } + }, + "additionalProperties": false, + "required": [ + "application", + "constraints" + ] + }, + "SetModelAgentVersion": { + "type": "object", + "properties": { + "agent-stream": { + "type": "string" + }, + "force": { + "type": "boolean" + }, + "version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "version" + ] + }, + "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": { + "patterns": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "patterns" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "SupportedFeature": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "name": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "description" + ] + }, + "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" + ] + }, + "Value": { + "type": "object", + "properties": { + "allocate-public-ip": { + "type": "boolean" + }, + "arch": { + "type": "string" + }, + "container": { + "type": "string" + }, + "cores": { + "type": "integer" + }, + "cpu-power": { + "type": "integer" + }, + "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": "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" + }, + "deprecated": { + "type": "boolean" + }, + "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" + }, + "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." + }, + "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" + ] + }, + "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" + } + } + }, + "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" + ] + }, + "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" + }, + "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" + ] + }, + "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": "CrossModelRelationsAPI provides access to the CrossModelRelations API facade.", + "Version": 2, + "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." + }, + "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": { + "application-token": { + "type": "string" + }, + "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", + "application-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" + }, + "remote-space": { + "$ref": "#/definitions/RemoteSpace" + }, + "source-model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application-token", + "source-model-tag", + "relation-token", + "remote-endpoint", + "remote-space", + "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 + }, + "RemoteSpace": { + "type": "object", + "properties": { + "cloud-type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "provider-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider-id": { + "type": "string" + }, + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/Subnet" + } + } + }, + "additionalProperties": false, + "required": [ + "cloud-type", + "name", + "provider-id", + "provider-attributes", + "subnets" + ] + }, + "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" + ] + } + } + } + }, + { + "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": "FirewallRules", + "Description": "API provides the firewallrules facade APIs for v1.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ListFirewallRules": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ListFirewallRulesResults" + } + }, + "description": "ListFirewallRules returns all the firewall rules." + }, + "SetFirewallRules": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FirewallRuleArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetFirewallRules creates or updates the specified firewall rules." + } + }, + "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" + ] + }, + "FirewallRule": { + "type": "object", + "properties": { + "known-service": { + "type": "string" + }, + "whitelist-cidrs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "known-service" + ] + }, + "FirewallRuleArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/FirewallRule" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "ListFirewallRulesResults": { + "type": "object", + "properties": { + "Rules": { + "type": "array", + "items": { + "$ref": "#/definitions/FirewallRule" + } + } + }, + "additionalProperties": false, + "required": [ + "Rules" + ] + } + } + } + }, + { + "Name": "Firewaller", + "Description": "FirewallerAPIV7 provides access to the Firewaller v7 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." + }, + "FirewallRules": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/KnownServiceArgs" + }, + "Result": { + "$ref": "#/definitions/ListFirewallRulesResults" + } + }, + "description": "FirewallRules returns the firewall rules for the specified well known service types." + }, + "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." + }, + "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." + }, + "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" + ] + }, + "FirewallRule": { + "type": "object", + "properties": { + "known-service": { + "type": "string" + }, + "whitelist-cidrs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "known-service" + ] + }, + "KnownServiceArgs": { + "type": "object", + "properties": { + "known-services": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "known-services" + ] + }, + "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" + ] + }, + "ListFirewallRulesResults": { + "type": "object", + "properties": { + "Rules": { + "type": "array", + "items": { + "$ref": "#/definitions/FirewallRule" + } + } + }, + "additionalProperties": false, + "required": [ + "Rules" + ] + }, + "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" + } + }, + "series": { + "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" + }, + "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": "ImageManager", + "Description": "ImageManagerAPI implements the ImageManager interface and is the concrete\nimplementation of the api end point.", + "Version": 2, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "DeleteImages": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ImageFilterParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "DeleteImages deletes the images matching the specified filter." + }, + "ListImages": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ImageFilterParams" + }, + "Result": { + "$ref": "#/definitions/ListImageResult" + } + }, + "description": "ListImages returns images matching the specified filter." + } + }, + "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" + ] + }, + "ImageFilterParams": { + "type": "object", + "properties": { + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/ImageSpec" + } + } + }, + "additionalProperties": false, + "required": [ + "images" + ] + }, + "ImageMetadata": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time" + }, + "kind": { + "type": "string" + }, + "series": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "kind", + "arch", + "series", + "url", + "created" + ] + }, + "ImageSpec": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "kind", + "arch", + "series" + ] + }, + "ListImageResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/ImageMetadata" + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + } + } + } + }, + { + "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" + }, + "series": { + "type": "string" + }, + "source": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "version": { + "type": "string" + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "image-id", + "region", + "version", + "series", + "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" + }, + "series": { + "type": "array", + "items": { + "type": "string" + } + }, + "stream": { + "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." + }, + "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 implements the KeyUpdater interface and is the concrete\nimplementation of the api end point.", + "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": { + "name": { + "type": "string" + }, + "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": "MachineManagerAPIV7 defines the Version 7 of Machine Manager API.\nAdds provisioning methods moved from client facade.", + "Version": 7, + "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." + }, + "DestroyMachine": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/DestroyMachineResults" + } + }, + "description": "DestroyMachine removes a set of machines from the model.\nTODO(juju3) - remove" + }, + "DestroyMachineWithParams": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyMachinesParams" + }, + "Result": { + "$ref": "#/definitions/DestroyMachineResults" + } + }, + "description": "DestroyMachineWithParams removes a set of machines from the model." + }, + "ForceDestroyMachine": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/DestroyMachineResults" + } + }, + "description": "ForceDestroyMachine forcibly removes a set of machines from the model.\nTODO(juju3) - remove\nAlso from ModelManger v6 this call is less useful as it does not support MaxWait customisation." + }, + "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/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RetryProvisioning marks a provisioning error as transient on the machines." + }, + "UpgradeSeriesComplete": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "UpgradeSeriesComplete marks a machine as having completed a managed series\nupgrade." + }, + "UpgradeSeriesPrepare": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "UpgradeSeriesPrepare prepares a machine for a OS series upgrade." + }, + "UpgradeSeriesValidate": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArgs" + }, + "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" + } + }, + "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" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "series", + "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" + ] + }, + "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": { + "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" + } + } + }, + "additionalProperties": false + }, + "InstanceType": { + "type": "object", + "properties": { + "arches": { + "type": "array", + "items": { + "type": "string" + } + }, + "cost": { + "type": "integer" + }, + "cpu-cores": { + "type": "integer" + }, + "deprecated": { + "type": "boolean" + }, + "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" + ] + }, + "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" + ] + }, + "UpdateSeriesArg": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "series": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force", + "series" + ] + }, + "UpdateSeriesArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSeriesArg" + } + } + }, + "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" + }, + "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." + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "ModelUUID returns the model UUID that this machine resides in.\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." + }, + "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" + ] + }, + "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": "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" + } + } + }, + "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" + } + } + }, + "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." + }, + "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" + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "name", + "owner-tag", + "agent-version", + "controller-agent-version" + ] + }, + "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": 1, + "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/ModelArgs" + } + }, + "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." + }, + "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": { + "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" + }, + "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" + }, + "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.", + "Version": 9, + "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." + }, + "ValidateModelUpgrades": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ValidateModelUpgradeParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ValidateModelUpgrades validates if a model is allowed to perform an upgrade.\nExamples of why you would want to block a model upgrade, would be situations\nlike upgrade-series. If performing an upgrade-series we don't know the\ncurrent status of the machine, so performing an upgrade-model can lead to\nbad unintended errors down the line." + } + }, + "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" + } + } + }, + "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" + ] + }, + "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-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" + }, + "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", + "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" + ] + }, + "ModelParam": { + "type": "object", + "properties": { + "model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag" + ] + }, + "ModelSLAInfo": { + "type": "object", + "properties": { + "level": { + "type": "string" + }, + "owner": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "level", + "owner" + ] + }, + "ModelStatus": { + "type": "object", + "properties": { + "application-count": { + "type": "integer" + }, + "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" + ] + }, + "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" + ] + }, + "ValidateModelUpgradeParams": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "model": { + "type": "array", + "items": { + "$ref": "#/definitions/ModelParam" + } + } + }, + "additionalProperties": false, + "required": [ + "model", + "force" + ] + } + } + } + }, + { + "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/UpgradeModel" + } + }, + "description": "UpgradeModel upgrades a model." + } + }, + "definitions": { + "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" + ] + }, + "UpgradeModel": { + "type": "object", + "properties": { + "agent-stream": { + "type": "string" + }, + "dry-run": { + "type": "boolean" + }, + "ignore-agent-versions": { + "type": "boolean" + }, + "model-tag": { + "type": "string" + }, + "to-version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "to-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/ProvisioningInfoResultsV10" + } + }, + "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." + }, + "Series": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "Series returns the deployed series for each given machine entity." + }, + "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" + ] + }, + "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" + }, + "series": { + "type": "string" + }, + "source": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "version": { + "type": "string" + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "image-id", + "region", + "version", + "series", + "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" + }, + "minor": { + "type": "integer" + }, + "number": { + "$ref": "#/definitions/Number" + }, + "os-type": { + "type": "string" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "number", + "major", + "minor", + "arch", + "series", + "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" + } + } + }, + "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" + ] + }, + "ProvisioningInfoBase": { + "type": "object", + "properties": { + "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" + }, + "series": { + "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", + "series", + "placement", + "jobs" + ] + }, + "ProvisioningInfoResultV10": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "$ref": "#/definitions/ProvisioningInfoV10" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, + "ProvisioningInfoResultsV10": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ProvisioningInfoResultV10" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ProvisioningInfoV10": { + "type": "object", + "properties": { + "ProvisioningInfoBase": { + "$ref": "#/definitions/ProvisioningInfoBase" + }, + "ProvisioningNetworkTopology": { + "$ref": "#/definitions/ProvisioningNetworkTopology" + }, + "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" + }, + "series": { + "type": "string" + }, + "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", + "series", + "placement", + "jobs", + "ProvisioningInfoBase", + "subnet-zones", + "space-subnets", + "ProvisioningNetworkTopology" + ] + }, + "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" + }, + "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": "APIv2 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": "RaftLease", + "Description": "", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ApplyLease": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/LeaseOperationsV2" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "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" + ] + }, + "LeaseOperationCommand": { + "type": "object", + "properties": { + "duration": { + "type": "integer" + }, + "holder": { + "type": "string" + }, + "lease": { + "type": "string" + }, + "model-uuid": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "new-time": { + "type": "string", + "format": "date-time" + }, + "old-time": { + "type": "string", + "format": "date-time" + }, + "operation": { + "type": "string" + }, + "pin-entity": { + "type": "string" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "version", + "operation" + ] + }, + "LeaseOperationsV2": { + "type": "object", + "properties": { + "commands": { + "type": "array", + "items": { + "$ref": "#/definitions/LeaseOperationCommand" + } + } + }, + "additionalProperties": false, + "required": [ + "commands" + ] + } + } + } + }, + { + "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." + }, + "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" + ] + }, + "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 + }, + "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": 2, + "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, CharmStore 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" + ] + }, + "CharmOrigin": { + "type": "object", + "properties": { + "architecture": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "id": { + "type": "string" + }, + "instance-key": { + "type": "string" + }, + "os": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "risk": { + "type": "string" + }, + "series": { + "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": "Resumer", + "Description": "ResumerAPI implements the API used by the resumer worker.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "ResumeTransactions": { + "type": "object" + } + } + } + }, + { + "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": 3, + "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." + }, + "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.\nTODO(juju3) - remove" + }, + "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": { + "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" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + } + } + } + }, + { + "Name": "SecretsManager", + "Description": "SecretsManagerAPI is the implementation for the SecretsManager facade.\nThis is only a stub implementation to keep older unit agents happy.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "WatchSecretsRotationChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SecretRotationWatchResults" + } + } + } + }, + "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" + ] + }, + "SecretRotationChange": { + "type": "object", + "properties": { + "last-rotate-time": { + "type": "string", + "format": "date-time" + }, + "rotate-interval": { + "type": "integer" + }, + "secret-id": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "secret-id", + "url", + "rotate-interval", + "last-rotate-time" + ] + }, + "SecretRotationWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRotationChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "SecretRotationWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRotationWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "SecretsRotationWatcher", + "Description": "", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SecretRotationWatchResult" + } + }, + "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" + ] + }, + "SecretRotationChange": { + "type": "object", + "properties": { + "last-rotate-time": { + "type": "string", + "format": "date-time" + }, + "rotate-interval": { + "type": "integer" + }, + "secret-id": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "secret-id", + "url", + "rotate-interval", + "last-rotate-time" + ] + }, + "SecretRotationWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRotationChange" + } + }, + "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 4.", + "Version": 4, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AddSubnets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddSubnetsParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "AddSubnets adds existing subnets to Juju." + }, + "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": { + "AddSubnetParams": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "provider-network-id": { + "type": "string" + }, + "space-tag": { + "type": "string" + }, + "subnet-provider-id": { + "type": "string" + }, + "vlan-tag": { + "type": "integer" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "space-tag" + ] + }, + "AddSubnetsParams": { + "type": "object", + "properties": { + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/AddSubnetParams" + } + } + }, + "additionalProperties": false, + "required": [ + "subnets" + ] + }, + "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" + ] + }, + "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" + ] + }, + "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": { + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + }, + "description": "ModelConfig returns the 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." + }, + "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": { + "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" + ] + }, + "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\n error 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, which\naugments the payload of the CommitHookChanges API call and introduces\nthe OpenedMachinePortRanges call as a replacement for AllMachinePorts.", + "Version": 18, + "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." + }, + "AddUnitStorage": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StoragesAddParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "AddUnitStorage validates and creates additional storage instances for units.\nFailures on an individual storage instance do not block remaining\ninstances from being processed." + }, + "AllMachinePorts": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachinePortsResults" + } + }, + "description": "AllMachinePorts returns all opened port ranges for each given\nmachine (on all networks).\n\nDEPRECATED: clients should switch to the OpenedMachinePortRanges API call\nwhen using the V17+ API.\n\nTODO(achilleasa): remove from V17 once all client references to this API\nhave been changed to use the new API." + }, + "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." + }, + "ClosePorts": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntitiesPortRanges" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ClosePorts sets the policy of the port range with protocol to be\nclosed, for all given units." + }, + "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." + }, + "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" + }, + "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." + }, + "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." + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "ModelUUID returns the model UUID that this unit resides in.\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." + }, + "NetworkInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/NetworkInfoParams" + }, + "Result": { + "$ref": "#/definitions/NetworkInfoResults" + } + }, + "description": "NetworkInfo returns network interfaces/addresses for specified bindings." + }, + "OpenPorts": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntitiesPortRanges" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "OpenedMachinePortRangesByEndpoint": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/OpenMachinePortRangesByEndpointResults" + } + }, + "description": "OpenedMachinePortRangesByEndpoint returns the port ranges opened by each\nunit on the provided machines grouped by application endpoint." + }, + "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." + }, + "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." + }, + "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." + }, + "UpdateSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnitsSettings" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdateSettings persists all changes made to the local settings of\nall given pairs of relation and unit. Keys with empty values are\nconsidered a signal to delete these values." + }, + "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)." + }, + "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" + } + } + }, + "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()." + }, + "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" + ] + }, + "Action": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "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" + } + }, + "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" + ] + }, + "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" + ] + }, + "EntitiesPortRanges": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPortRange" + } + } + }, + "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" + ] + }, + "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" + ] + }, + "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" + ] + }, + "MachinePortRange": { + "type": "object", + "properties": { + "port-range": { + "$ref": "#/definitions/PortRange" + }, + "relation-tag": { + "type": "string" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit-tag", + "relation-tag", + "port-range" + ] + }, + "MachinePortsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "ports": { + "type": "array", + "items": { + "$ref": "#/definitions/MachinePortRange" + } + } + }, + "additionalProperties": false, + "required": [ + "ports" + ] + }, + "MachinePortsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/MachinePortsResult" + } + } + }, + "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" + ] + }, + "OpenMachinePortRangesByEndpointResult": { + "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" + ] + }, + "OpenMachinePortRangesByEndpointResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/OpenMachinePortRangesByEndpointResult" + } + } + }, + "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" + ] + }, + "RelationUnitsSettings": { + "type": "object", + "properties": { + "relation-units": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitSettings" + } + } + }, + "additionalProperties": false, + "required": [ + "relation-units" + ] + }, + "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" + ] + }, + "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" + } + } + }, + "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 + }, + "StoragesAddParams": { + "type": "object", + "properties": { + "storages": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAddParams" + } + } + }, + "additionalProperties": false, + "required": [ + "storages" + ] + }, + "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" + } + } + }, + "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" + ] + }, + "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": "UpgradeSeries", + "Description": "API serves methods required by the machine agent upgrade-series 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-series workflow,\nmaking this value incorrect." + }, + "FinishUpgradeSeries": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArgs" + }, + "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-series lock." + }, + "MachineStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UpgradeSeriesStatusResults" + } + }, + "description": "MachineStatus gets the current upgrade-series 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-series 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-series 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-series 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": { + "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" + ] + }, + "UpdateSeriesArg": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "series": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force", + "series" + ] + }, + "UpdateSeriesArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSeriesArg" + } + } + }, + "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" + } + } + }, + "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": "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 diff --git a/juju/client/schemas-juju-3.0.json b/juju/client/schemas-juju-3.0.json new file mode 100644 index 000000000..76b1b612e --- /dev/null +++ b/juju/client/schemas-juju-3.0.json @@ -0,0 +1,48631 @@ +[ + { + "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" + }, + "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": "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": 3, + "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": 2, + "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": "APIv13 provides the Application API facade for version 13.", + "Version": 13, + "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/ConsumeApplicationArgs" + }, + "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." + }, + "Destroy": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationDestroy" + } + }, + "description": "Destroy destroys a given application, local or remote.\n\nNOTE(axw) this exists only for backwards compatibility,\nfor API facade versions 1-3; clients should prefer its\nsuccessor, DestroyApplication, below. Until all consumers\nhave been updated, or we bump a major version, we can't\ndrop this.\n\nTODO(axw) 2017-03-16 #1673323\nDrop this in Juju 3.0." + }, + "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." + }, + "DestroyUnits": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/DestroyApplicationUnits" + } + }, + "description": "DestroyUnits removes a given set of application units.\n\nNOTE(axw) this exists only for backwards compatibility,\nfor API facade versions 1-3; clients should prefer its\nsuccessor, DestroyUnit, below. Until all consumers have\nbeen updated, or we bump a major version, we can't drop\nthis.\n\nTODO(axw) 2017-03-16 #1673323\nDrop this in Juju 3.0." + }, + "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." + }, + "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." + }, + "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." + }, + "UpdateApplicationSeries": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdateApplicationSeries updates the application series. Series for\nsubordinates 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" + } + } + }, + "series": { + "type": "string" + }, + "storage": { + "type": "object", + "patternProperties": { + ".*": { + "$ref": "#/definitions/Constraints" + } + } + } + }, + "additionalProperties": false, + "required": [ + "application", + "series", + "charm-url", + "channel", + "num-units", + "config-yaml", + "constraints", + "Force" + ] + }, + "ApplicationDestroy": { + "type": "object", + "properties": { + "application": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application" + ] + }, + "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 + } + } + }, + "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" + } + } + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application", + "charm", + "config", + "constraints", + "series", + "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" + ] + }, + "ApplicationOfferDetails": { + "type": "object", + "properties": { + "application-description": { + "type": "string" + }, + "bindings": { + "type": "object", + "patternProperties": { + ".*": { + "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" + }, + "spaces": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteSpace" + } + }, + "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": { + "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" + }, + "series": { + "type": "string" + }, + "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-series": { + "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-series" + ] + }, + "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" + ] + }, + "CharmOrigin": { + "type": "object", + "properties": { + "architecture": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "id": { + "type": "string" + }, + "instance-key": { + "type": "string" + }, + "os": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "risk": { + "type": "string" + }, + "series": { + "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" + ] + }, + "ConsumeApplicationArg": { + "type": "object", + "properties": { + "ApplicationOfferDetails": { + "$ref": "#/definitions/ApplicationOfferDetails" + }, + "application-alias": { + "type": "string" + }, + "application-description": { + "type": "string" + }, + "bindings": { + "type": "object", + "patternProperties": { + ".*": { + "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" + }, + "spaces": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteSpace" + } + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferUserDetails" + } + } + }, + "additionalProperties": false, + "required": [ + "source-model-tag", + "offer-uuid", + "offer-url", + "offer-name", + "application-description", + "ApplicationOfferDetails" + ] + }, + "ConsumeApplicationArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/ConsumeApplicationArg" + } + } + }, + "additionalProperties": false + }, + "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" + }, + "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 + }, + "DestroyApplicationUnits": { + "type": "object", + "properties": { + "unit-names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "unit-names" + ] + }, + "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" + }, + "force": { + "type": "boolean" + }, + "max-wait": { + "type": "integer" + }, + "unit-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "unit-tag", + "force" + ] + }, + "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" + ] + }, + "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" + ] + }, + "RemoteSpace": { + "type": "object", + "properties": { + "cloud-type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "provider-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider-id": { + "type": "string" + }, + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/Subnet" + } + } + }, + "additionalProperties": false, + "required": [ + "cloud-type", + "name", + "provider-id", + "provider-attributes", + "subnets" + ] + }, + "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 + }, + "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" + ] + }, + "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 + }, + "UpdateSeriesArg": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "series": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force", + "series" + ] + }, + "UpdateSeriesArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSeriesArg" + } + } + }, + "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" + }, + "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": "OffersAPI implements the cross model interface and is the concrete\nimplementation of the api end point.", + "Version": 4, + "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/QueryApplicationOffersResults" + } + }, + "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/QueryApplicationOffersResults" + } + }, + "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" + ] + }, + "ApplicationOfferAdminDetails": { + "type": "object", + "properties": { + "ApplicationOfferDetails": { + "$ref": "#/definitions/ApplicationOfferDetails" + }, + "application-description": { + "type": "string" + }, + "application-name": { + "type": "string" + }, + "bindings": { + "type": "object", + "patternProperties": { + ".*": { + "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" + }, + "spaces": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteSpace" + } + }, + "users": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferUserDetails" + } + } + }, + "additionalProperties": false, + "required": [ + "source-model-tag", + "offer-uuid", + "offer-url", + "offer-name", + "application-description", + "ApplicationOfferDetails", + "application-name", + "charm-url" + ] + }, + "ApplicationOfferDetails": { + "type": "object", + "properties": { + "application-description": { + "type": "string" + }, + "bindings": { + "type": "object", + "patternProperties": { + ".*": { + "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" + }, + "spaces": { + "type": "array", + "items": { + "$ref": "#/definitions/RemoteSpace" + } + }, + "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/ApplicationOfferAdminDetails" + } + }, + "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/ApplicationOfferDetails" + } + }, + "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/ApplicationOfferDetails" + } + }, + "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" + ] + }, + "QueryApplicationOffersResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationOfferAdminDetails" + } + } + }, + "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" + ] + }, + "RemoteSpace": { + "type": "object", + "properties": { + "cloud-type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "provider-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider-id": { + "type": "string" + }, + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/Subnet" + } + } + }, + "additionalProperties": false, + "required": [ + "cloud-type", + "name", + "provider-id", + "provider-attributes", + "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": "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": { + "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" + }, + "series": { + "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", + "series", + "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" + } + }, + "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." + }, + "CAASApplicationGarbageCollect": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CAASApplicationGarbageCollectArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "CAASApplicationGarbageCollect cleans up units that have gone away permanently.\nOnly observed units will be deleted as new units could have surfaced between\nthe capturing of kuberentes pod state/application state and this call." + }, + "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." + }, + "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/CAASApplicationProvisioningInfoResults" + } + }, + "description": "ProvisioningInfo returns the info needed to provision a caas 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." + }, + "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." + }, + "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" + ] + }, + "CAASApplicationGarbageCollectArg": { + "type": "object", + "properties": { + "active-pod-names": { + "type": "array", + "items": { + "type": "string" + } + }, + "application": { + "$ref": "#/definitions/Entity" + }, + "desired-replicas": { + "type": "integer" + }, + "force": { + "type": "boolean" + }, + "observed-units": { + "$ref": "#/definitions/Entities" + } + }, + "additionalProperties": false, + "required": [ + "application", + "observed-units", + "desired-replicas", + "active-pod-names", + "force" + ] + }, + "CAASApplicationGarbageCollectArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/CAASApplicationGarbageCollectArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "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" + ] + }, + "CAASApplicationProvisioningInfo": { + "type": "object", + "properties": { + "api-addresses": { + "type": "array", + "items": { + "type": "string" + } + }, + "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" + }, + "series": { + "type": "string" + }, + "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" + ] + }, + "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": { + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + } + }, + "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" + } + }, + "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" + ] + }, + "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" + }, + "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": { + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + } + }, + "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" + } + }, + "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": "CAASFirewallerEmbedded", + "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." + }, + "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" + ] + }, + "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": { + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + } + }, + "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" + } + }, + "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" + ] + }, + "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" + } + } + } + }, + "definitions": { + "ControllerConfigResult": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + } + }, + "additionalProperties": false, + "required": [ + "config" + ] + } + } + } + }, + { + "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." + } + }, + "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": { + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + } + }, + "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" + } + }, + "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" + } + }, + "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", + "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": { + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + } + }, + "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" + } + }, + "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" + }, + "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": "API implements the charms interface and is the concrete\nimplementation of the API end point.", + "Version": 4, + "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()." + }, + "AddCharmWithAuthorization": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddCharmWithAuth" + }, + "Result": { + "$ref": "#/definitions/CharmOriginResult" + } + }, + "description": "AddCharmWithAuthorization adds the given charm URL (which must include\nrevision) to the environment, if it does not exist yet. Local charms are\nnot supported, only charm store and charm hub URLs. See also AddLocalCharm().\n\nThe authorization macaroon, args.CharmStoreMacaroon, may be\nomitted, in which case this call is equivalent to AddCharm." + }, + "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." + }, + "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": { + "AddCharmWithAuth": { + "type": "object", + "properties": { + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "force": { + "type": "boolean" + }, + "macaroon": { + "$ref": "#/definitions/Macaroon" + }, + "series": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "charm-origin", + "macaroon", + "force", + "series" + ] + }, + "AddCharmWithOrigin": { + "type": "object", + "properties": { + "charm-origin": { + "$ref": "#/definitions/CharmOrigin" + }, + "force": { + "type": "boolean" + }, + "series": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "charm-origin", + "force", + "series" + ] + }, + "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" + ] + }, + "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": { + "mounts": { + "type": "array", + "items": { + "$ref": "#/definitions/CharmMount" + } + }, + "resource": { + "type": "string" + } + }, + "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" + } + }, + "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" + }, + "branch": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "id": { + "type": "string" + }, + "instance-key": { + "type": "string" + }, + "os": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "risk": { + "type": "string" + }, + "series": { + "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-series": { + "type": "array", + "items": { + "type": "string" + } + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "charm-origin", + "supported-series" + ] + }, + "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": 5, + "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." + }, + "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": { + "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" + } + } + } + }, + "series": { + "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", + "series", + "exposed", + "life", + "relations", + "can-upgrade-to", + "subordinate-to", + "units", + "meter-statuses", + "status", + "workload-version", + "endpoint-bindings", + "public-address" + ] + }, + "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" + ] + }, + "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 + }, + "FindToolsParams": { + "type": "object", + "properties": { + "agentstream": { + "type": "string" + }, + "arch": { + "type": "string" + }, + "major": { + "type": "integer" + }, + "minor": { + "type": "integer" + }, + "number": { + "$ref": "#/definitions/Number" + }, + "os-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "number", + "major", + "minor", + "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" + }, + "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" + } + } + } + }, + "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" + }, + "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" + }, + "series": { + "type": "string" + }, + "wants-vote": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "agent-status", + "instance-status", + "modification-status", + "dns-name", + "instance-id", + "display-name", + "series", + "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": { + "patterns": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "patterns" + ] + }, + "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" + ] + } + } + } + }, + { + "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" + }, + "deprecated": { + "type": "boolean" + }, + "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" + }, + "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/DashboardConnectionProxy" + }, + "ssh-connection": { + "$ref": "#/definitions/DashboardConnectionSSHTunnel" + } + }, + "additionalProperties": false, + "required": [ + "proxy-connection", + "ssh-connection" + ] + }, + "DashboardConnectionProxy": { + "type": "object", + "properties": { + "config": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "config", + "type" + ] + }, + "DashboardConnectionSSHTunnel": { + "type": "object", + "properties": { + "host": { + "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" + } + } + }, + "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" + ] + }, + "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" + }, + "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" + ] + }, + "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": "CrossModelRelationsAPI provides access to the CrossModelRelations API facade.", + "Version": 2, + "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." + }, + "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": { + "application-token": { + "type": "string" + }, + "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", + "application-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" + }, + "remote-space": { + "$ref": "#/definitions/RemoteSpace" + }, + "source-model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "application-token", + "source-model-tag", + "relation-token", + "remote-endpoint", + "remote-space", + "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 + }, + "RemoteSpace": { + "type": "object", + "properties": { + "cloud-type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "provider-attributes": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "provider-id": { + "type": "string" + }, + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/Subnet" + } + } + }, + "additionalProperties": false, + "required": [ + "cloud-type", + "name", + "provider-id", + "provider-attributes", + "subnets" + ] + }, + "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" + ] + } + } + } + }, + { + "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": "FirewallRules", + "Description": "API provides the firewallrules facade APIs for v1.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ListFirewallRules": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ListFirewallRulesResults" + } + }, + "description": "ListFirewallRules returns all the firewall rules." + }, + "SetFirewallRules": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FirewallRuleArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetFirewallRules creates or updates the specified firewall rules." + } + }, + "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" + ] + }, + "FirewallRule": { + "type": "object", + "properties": { + "known-service": { + "type": "string" + }, + "whitelist-cidrs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "known-service" + ] + }, + "FirewallRuleArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/FirewallRule" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "ListFirewallRulesResults": { + "type": "object", + "properties": { + "Rules": { + "type": "array", + "items": { + "$ref": "#/definitions/FirewallRule" + } + } + }, + "additionalProperties": false, + "required": [ + "Rules" + ] + } + } + } + }, + { + "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." + }, + "FirewallRules": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/KnownServiceArgs" + }, + "Result": { + "$ref": "#/definitions/ListFirewallRulesResults" + } + }, + "description": "FirewallRules returns the firewall rules for the specified well known service types." + }, + "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." + }, + "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." + }, + "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" + ] + }, + "FirewallRule": { + "type": "object", + "properties": { + "known-service": { + "type": "string" + }, + "whitelist-cidrs": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "known-service" + ] + }, + "KnownServiceArgs": { + "type": "object", + "properties": { + "known-services": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "known-services" + ] + }, + "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" + ] + }, + "ListFirewallRulesResults": { + "type": "object", + "properties": { + "Rules": { + "type": "array", + "items": { + "$ref": "#/definitions/FirewallRule" + } + } + }, + "additionalProperties": false, + "required": [ + "Rules" + ] + }, + "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" + } + }, + "series": { + "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" + }, + "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": "ImageManager", + "Description": "ImageManagerAPI implements the ImageManager interface and is the concrete\nimplementation of the api end point.", + "Version": 2, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "DeleteImages": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ImageFilterParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "DeleteImages deletes the images matching the specified filter." + }, + "ListImages": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ImageFilterParams" + }, + "Result": { + "$ref": "#/definitions/ListImageResult" + } + }, + "description": "ListImages returns images matching the specified filter." + } + }, + "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" + ] + }, + "ImageFilterParams": { + "type": "object", + "properties": { + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/ImageSpec" + } + } + }, + "additionalProperties": false, + "required": [ + "images" + ] + }, + "ImageMetadata": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "created": { + "type": "string", + "format": "date-time" + }, + "kind": { + "type": "string" + }, + "series": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "kind", + "arch", + "series", + "url", + "created" + ] + }, + "ImageSpec": { + "type": "object", + "properties": { + "arch": { + "type": "string" + }, + "kind": { + "type": "string" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "kind", + "arch", + "series" + ] + }, + "ListImageResult": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/definitions/ImageMetadata" + } + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + } + } + } + }, + { + "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" + }, + "series": { + "type": "string" + }, + "source": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "version": { + "type": "string" + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "image-id", + "region", + "version", + "series", + "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" + }, + "series": { + "type": "array", + "items": { + "type": "string" + } + }, + "stream": { + "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 implements the KeyUpdater interface and is the concrete\nimplementation of the api end point.", + "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": 7, + "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." + }, + "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/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "RetryProvisioning marks a provisioning error as transient on the machines." + }, + "UpgradeSeriesComplete": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "UpgradeSeriesComplete marks a machine as having completed a managed series\nupgrade." + }, + "UpgradeSeriesPrepare": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArg" + }, + "Result": { + "$ref": "#/definitions/ErrorResult" + } + }, + "description": "UpgradeSeriesPrepare prepares a machine for a OS series upgrade." + }, + "UpgradeSeriesValidate": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArgs" + }, + "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" + } + }, + "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" + }, + "series": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "series", + "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" + ] + }, + "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": { + "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" + } + } + }, + "additionalProperties": false + }, + "InstanceType": { + "type": "object", + "properties": { + "arches": { + "type": "array", + "items": { + "type": "string" + } + }, + "cost": { + "type": "integer" + }, + "cpu-cores": { + "type": "integer" + }, + "deprecated": { + "type": "boolean" + }, + "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" + ] + }, + "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" + ] + }, + "UpdateSeriesArg": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "series": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force", + "series" + ] + }, + "UpdateSeriesArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSeriesArg" + } + } + }, + "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" + }, + "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" + } + } + }, + "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" + } + } + }, + "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." + }, + "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" + }, + "name": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "uuid": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uuid", + "name", + "owner-tag", + "agent-version", + "controller-agent-version" + ] + }, + "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": 1, + "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/ModelArgs" + } + }, + "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." + }, + "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": { + "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" + }, + "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" + }, + "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.", + "Version": 9, + "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" + } + } + }, + "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" + ] + }, + "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-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" + }, + "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", + "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" + }, + "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" + ] + }, + "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/UpgradeModel" + } + }, + "description": "UpgradeModel upgrades a model." + } + }, + "definitions": { + "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" + ] + }, + "UpgradeModel": { + "type": "object", + "properties": { + "agent-stream": { + "type": "string" + }, + "dry-run": { + "type": "boolean" + }, + "ignore-agent-versions": { + "type": "boolean" + }, + "model-tag": { + "type": "string" + }, + "to-version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "to-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." + }, + "Series": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "Series returns the deployed series for each given machine entity." + }, + "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" + ] + }, + "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" + }, + "series": { + "type": "string" + }, + "source": { + "type": "string" + }, + "stream": { + "type": "string" + }, + "version": { + "type": "string" + }, + "virt-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "image-id", + "region", + "version", + "series", + "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" + }, + "minor": { + "type": "integer" + }, + "number": { + "$ref": "#/definitions/Number" + }, + "os-type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "number", + "major", + "minor", + "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" + } + } + }, + "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" + }, + "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" + }, + "series": { + "type": "string" + }, + "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", + "series", + "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" + }, + "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": "RaftLease", + "Description": "", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ApplyLease": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/LeaseOperationsV2" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + } + }, + "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" + ] + }, + "LeaseOperationCommand": { + "type": "object", + "properties": { + "duration": { + "type": "integer" + }, + "holder": { + "type": "string" + }, + "lease": { + "type": "string" + }, + "model-uuid": { + "type": "string" + }, + "namespace": { + "type": "string" + }, + "new-time": { + "type": "string", + "format": "date-time" + }, + "old-time": { + "type": "string", + "format": "date-time" + }, + "operation": { + "type": "string" + }, + "pin-entity": { + "type": "string" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "version", + "operation" + ] + }, + "LeaseOperationsV2": { + "type": "object", + "properties": { + "commands": { + "type": "array", + "items": { + "$ref": "#/definitions/LeaseOperationCommand" + } + } + }, + "additionalProperties": false, + "required": [ + "commands" + ] + } + } + } + }, + { + "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." + }, + "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" + ] + }, + "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 + }, + "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": 2, + "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, CharmStore 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" + ] + }, + "CharmOrigin": { + "type": "object", + "properties": { + "architecture": { + "type": "string" + }, + "branch": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "id": { + "type": "string" + }, + "instance-key": { + "type": "string" + }, + "os": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "risk": { + "type": "string" + }, + "series": { + "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": "Resumer", + "Description": "ResumerAPI implements the API used by the resumer worker.", + "Version": 2, + "AvailableTo": [ + "controller-machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "ResumeTransactions": { + "type": "object" + } + } + } + }, + { + "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": 3, + "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 given\nentity in args. Machines and units are supported as entity types.\nTODO(wpk): 2017-05-17 This is a temporary solution, we should not fetch environ here\nbut get the addresses from state. We will be changing it since we want to have space-aware\nSSH settings." + }, + "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." + }, + "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": { + "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" + ] + }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + } + } + } + }, + { + "Name": "Secrets", + "Description": "SecretsAPI is the backend for the Secrets facade.", + "Version": 1, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "ListSecrets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ListSecretsArgs" + }, + "Result": { + "$ref": "#/definitions/ListSecretResults" + } + }, + "description": "ListSecrets lists available 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" + ] + }, + "ListSecretResult": { + "type": "object", + "properties": { + "create-time": { + "type": "string", + "format": "date-time" + }, + "description": { + "type": "string" + }, + "int": { + "type": "integer" + }, + "path": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "rotate-interval": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "update-time": { + "type": "string", + "format": "date-time" + }, + "url": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/SecretValueResult" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "url", + "path", + "version", + "rotate-interval", + "status", + "int", + "provider", + "revision", + "create-time", + "update-time" + ] + }, + "ListSecretResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ListSecretResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "ListSecretsArgs": { + "type": "object", + "properties": { + "show-secrets": { + "type": "boolean" + } + }, + "additionalProperties": false, + "required": [ + "show-secrets" + ] + }, + "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": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "CreateSecrets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/CreateSecretArgs" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "CreateSecrets creates new secrets." + }, + "GetSecretValues": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/GetSecretArgs" + }, + "Result": { + "$ref": "#/definitions/SecretValueResults" + } + }, + "description": "GetSecretValues returns the secret values for the specified secrets." + }, + "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/StringResults" + } + }, + "description": "UpdateSecrets updates the specified secrets." + }, + "WatchSecretsRotationChanges": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/SecretRotationWatchResults" + } + }, + "description": "WatchSecretsRotationChanges sets up a watcher to notify of changes to secret rotation config." + } + }, + "definitions": { + "CreateSecretArg": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "path": { + "type": "string" + }, + "rotate-interval": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "type": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "type", + "path", + "rotate-interval", + "status" + ] + }, + "CreateSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/CreateSecretArg" + } + } + }, + "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" + ] + }, + "GetSecretArg": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false + }, + "GetSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/GetSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "SecretRotatedArg": { + "type": "object", + "properties": { + "url": { + "type": "string" + }, + "when": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "required": [ + "url", + "when" + ] + }, + "SecretRotatedArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRotatedArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "SecretRotationChange": { + "type": "object", + "properties": { + "last-rotate-time": { + "type": "string", + "format": "date-time" + }, + "rotate-interval": { + "type": "integer" + }, + "secret-id": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "secret-id", + "url", + "rotate-interval", + "last-rotate-time" + ] + }, + "SecretRotationWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRotationChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + }, + "SecretRotationWatchResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRotationWatchResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SecretValueResult": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false + }, + "SecretValueResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretValueResult" + } + } + }, + "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" + ] + }, + "UpdateSecretArg": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-interval": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "tags": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "url", + "rotate-interval", + "status" + ] + }, + "UpdateSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + } + } + } + }, + { + "Name": "SecretsRotationWatcher", + "Description": "srvSecretRotationWatcher defines the API wrapping a SecretsRotationWatcher.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/SecretRotationWatchResult" + } + }, + "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" + ] + }, + "SecretRotationChange": { + "type": "object", + "properties": { + "last-rotate-time": { + "type": "string", + "format": "date-time" + }, + "rotate-interval": { + "type": "integer" + }, + "secret-id": { + "type": "integer" + }, + "url": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "secret-id", + "url", + "rotate-interval", + "last-rotate-time" + ] + }, + "SecretRotationWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRotationChange" + } + }, + "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 4.", + "Version": 4, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "AddSubnets": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/AddSubnetsParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "AddSubnets adds existing subnets to Juju." + }, + "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": { + "AddSubnetParams": { + "type": "object", + "properties": { + "cidr": { + "type": "string" + }, + "provider-network-id": { + "type": "string" + }, + "space-tag": { + "type": "string" + }, + "subnet-provider-id": { + "type": "string" + }, + "vlan-tag": { + "type": "integer" + }, + "zones": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "space-tag" + ] + }, + "AddSubnetsParams": { + "type": "object", + "properties": { + "subnets": { + "type": "array", + "items": { + "$ref": "#/definitions/AddSubnetParams" + } + } + }, + "additionalProperties": false, + "required": [ + "subnets" + ] + }, + "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" + ] + }, + "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" + ] + }, + "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": { + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + }, + "description": "ModelConfig returns the 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." + }, + "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": { + "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" + ] + }, + "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\n error 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": 18, + "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." + }, + "AddUnitStorage": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/StoragesAddParams" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "AddUnitStorage validates and creates additional storage instances for units.\nFailures on an individual storage instance do not block remaining\ninstances from being processed." + }, + "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." + }, + "ClosePorts": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntitiesPortRanges" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ClosePorts sets the policy of the port range with protocol to be\nclosed, for all given units." + }, + "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." + }, + "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" + }, + "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." + }, + "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." + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "ModelUUID returns the model UUID that this unit resides in.\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." + }, + "NetworkInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/NetworkInfoParams" + }, + "Result": { + "$ref": "#/definitions/NetworkInfoResults" + } + }, + "description": "NetworkInfo returns network interfaces/addresses for specified bindings." + }, + "OpenPorts": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/EntitiesPortRanges" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + } + }, + "OpenedMachinePortRangesByEndpoint": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/OpenMachinePortRangesByEndpointResults" + } + }, + "description": "OpenedMachinePortRangesByEndpoint returns the port ranges opened by each\nunit on the provided machines grouped by application endpoint." + }, + "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." + }, + "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." + }, + "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." + }, + "UpdateSettings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/RelationUnitsSettings" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "UpdateSettings persists all changes made to the local settings of\nall given pairs of relation and unit. Keys with empty values are\nconsidered a signal to delete these values." + }, + "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)." + }, + "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" + } + } + }, + "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()." + }, + "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" + ] + }, + "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" + } + }, + "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" + ] + }, + "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" + ] + }, + "EntitiesPortRanges": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/EntityPortRange" + } + } + }, + "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" + ] + }, + "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" + ] + }, + "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" + ] + }, + "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" + ] + }, + "OpenMachinePortRangesByEndpointResult": { + "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" + ] + }, + "OpenMachinePortRangesByEndpointResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/OpenMachinePortRangesByEndpointResult" + } + } + }, + "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" + ] + }, + "RelationUnitsSettings": { + "type": "object", + "properties": { + "relation-units": { + "type": "array", + "items": { + "$ref": "#/definitions/RelationUnitSettings" + } + } + }, + "additionalProperties": false, + "required": [ + "relation-units" + ] + }, + "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" + ] + }, + "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" + } + } + }, + "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 + }, + "StoragesAddParams": { + "type": "object", + "properties": { + "storages": { + "type": "array", + "items": { + "$ref": "#/definitions/StorageAddParams" + } + } + }, + "additionalProperties": false, + "required": [ + "storages" + ] + }, + "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" + } + } + }, + "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" + ] + }, + "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": "UpgradeSeries", + "Description": "API serves methods required by the machine agent upgrade-series 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-series workflow,\nmaking this value incorrect." + }, + "FinishUpgradeSeries": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UpdateSeriesArgs" + }, + "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-series lock." + }, + "MachineStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/UpgradeSeriesStatusResults" + } + }, + "description": "MachineStatus gets the current upgrade-series 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-series 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-series 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-series 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": { + "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" + ] + }, + "UpdateSeriesArg": { + "type": "object", + "properties": { + "force": { + "type": "boolean" + }, + "series": { + "type": "string" + }, + "tag": { + "$ref": "#/definitions/Entity" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "force", + "series" + ] + }, + "UpdateSeriesArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSeriesArg" + } + } + }, + "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" + } + } + }, + "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": "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 diff --git a/juju/client/schemas-juju-latest.json b/juju/client/schemas-juju-latest.json index 953a5aa21..1e9f820b0 120000 --- a/juju/client/schemas-juju-latest.json +++ b/juju/client/schemas-juju-latest.json @@ -1 +1 @@ -schemas-juju-2.9.27.json \ No newline at end of file +schemas-juju-3.0.json \ No newline at end of file diff --git a/juju/controller.py b/juju/controller.py index 0fa58b011..fe9205ea8 100644 --- a/juju/controller.py +++ b/juju/controller.py @@ -351,6 +351,7 @@ async def add_model( model = Model(jujudata=self._connector.jujudata) kwargs = self.connection().connect_params() kwargs['uuid'] = model_info.uuid + model._info = model_info await model._connect_direct(**kwargs) return model @@ -479,6 +480,30 @@ async def enable_user(self, username): entity = client.Entity(tag.user(username)) return await user_facade.EnableUser(entities=[entity]) + async def get_model_info(self, model_name=None, model_uuid=None): + """Return a client.ModelInfo object for a given Model. + + Retrieves latest info for this Model from the api server. The + return value is cached on the Model.info attribute so that the + valued may be accessed again without another api call, if + desired. + + This method is called automatically when the Model is connected, + resulting in Model.info being initialized without requiring an + explicit call to this method. + + """ + if model_uuid is None and model_name is None: + raise errors.JujuError("get_model_info requires either a name or a uuid for a model") + + facade = client.ModelManagerFacade.from_connection(self.connection()) + if model_uuid is None: + uuids = await self.model_uuids() + model_uuid = uuids[model_name] + entity = client.Entity(tag.model(model_uuid)) + _model_info_results = await facade.ModelInfo(entities=[entity]) + return _model_info_results.results[0].result + async def cloud(self, name=None): """Get Cloud @@ -782,7 +807,7 @@ async def get_consume_details(self, endpoint): model to consume the specified offers represented by the urls. """ facade = client.ApplicationOffersFacade.from_connection(self.connection()) - offers = await facade.GetConsumeDetails(offer_urls=[endpoint]) + offers = await facade.GetConsumeDetails(offer_urls=client.OfferURLs(offer_urls=[endpoint])) if len(offers.results) != 1: raise JujuAPIError("expected to find one result") result = offers.results[0] diff --git a/juju/errors.py b/juju/errors.py index c0f5cf00e..aefabadd2 100644 --- a/juju/errors.py +++ b/juju/errors.py @@ -107,3 +107,7 @@ class JujuModelConfigError(JujuConfigError): class AbstractMethodError(Exception): pass + + +class PylibjujuError(JujuError): + pass diff --git a/juju/machine.py b/juju/machine.py index 8a497ca6e..e73e21a11 100644 --- a/juju/machine.py +++ b/juju/machine.py @@ -22,14 +22,16 @@ async def destroy(self, force=False): Blocks until the machine is actually removed. """ - facade = client.ClientFacade.from_connection(self.connection) - - log.debug( - 'Destroying machine %s', self.id) + if self.connection.is_using_old_client: + # Then we'll use the DestroyMachines from client.ClientFacade + facade = client.ClientFacade.from_connection(self.connection) + await facade.DestroyMachines(force=force, machine_names=[self.id]) + else: + facade = client.MachineManagerFacade.from_connection(self.connection) + await facade.DestroyMachineWithParams(force=force, machine_tags=[tag.machine(self.id)]) - await facade.DestroyMachines(force=force, machine_names=[self.id]) - return await self.model._wait( - 'machine', self.id, 'remove') + log.debug('Destroying machine %s', self.id) + return await self.model._wait('machine', self.id, 'remove') remove = destroy async def get_annotations(self): diff --git a/juju/model.py b/juju/model.py index d829ea90a..9abc0dd5b 100644 --- a/juju/model.py +++ b/juju/model.py @@ -25,13 +25,12 @@ from .charmhub import CharmHub from .charmstore import CharmStore from .client import client, connector -from .client.client import ConfigValue, Value from .client.overrides import Caveat, Macaroon from .constraints import parse as parse_constraints from .controller import Controller, ConnectedController from .delta import get_entity_class, get_entity_delta from .errors import JujuAPIError, JujuError, JujuModelConfigError, JujuBackupError -from .errors import JujuAppError, JujuUnitError, JujuAgentError, JujuMachineError +from .errors import JujuAppError, JujuUnitError, JujuAgentError, JujuMachineError, PylibjujuError from .exceptions import DeadEntityException from .names import is_valid_application from .offerendpoints import ParseError as OfferParseError @@ -689,6 +688,7 @@ async def connect(self, *args, **kwargs): is_debug_log_conn = 'debug_log_conn' in kwargs if not is_debug_log_conn: await self.disconnect() + model_name = model_uuid = None if 'endpoint' not in kwargs and len(args) < 2: if args and 'model_name' in kwargs: raise TypeError('connect() got multiple values for model_name') @@ -723,6 +723,7 @@ async def connect(self, *args, **kwargs): ] for i, arg in enumerate(args): kwargs[arg_names[i]] = arg + model_uuid = kwargs['uuid'] if not {'endpoint', 'uuid'}.issubset(kwargs): raise ValueError('endpoint and uuid are required ' 'if model_name not given') @@ -732,7 +733,7 @@ async def connect(self, *args, **kwargs): 'if model_name not given') await self._connector.connect(**kwargs) if not is_debug_log_conn: - await self._after_connect() + await self._after_connect(model_name, model_uuid) async def connect_model(self, model_name, **kwargs): """ @@ -753,11 +754,17 @@ async def connect_to(self, connection): await self._connect_direct(**conn_params) async def _connect_direct(self, **kwargs): + if self.info: + uuid = self.info.uuid + elif 'uuid' in kwargs: + uuid = kwargs['uuid'] + else: + raise PylibjujuError("Unable to find uuid for the model") await self.disconnect() await self._connector.connect(**kwargs) - await self._after_connect() + await self._after_connect(model_uuid=uuid) - async def _after_connect(self): + async def _after_connect(self, model_name=None, model_uuid=None): self._watch() # Wait for the first packet of data from the AllWatcher, @@ -768,7 +775,11 @@ async def _after_connect(self): # to do is make one RPC call. await self._watch_received.wait() - await self.get_info() + if self.info is None: + contr = await self.get_controller() + self._info = await contr.get_model_info(model_name, model_uuid) + log.debug('Got ModelInfo: %s', vars(self.info)) + self.uuid = self.info.uuid async def disconnect(self): @@ -969,26 +980,6 @@ def charmhub(self): def charmstore(self): return self._charmstore - async def get_info(self): - """Return a client.ModelInfo object for this Model. - - Retrieves latest info for this Model from the api server. The - return value is cached on the Model.info attribute so that the - valued may be accessed again without another api call, if - desired. - - This method is called automatically when the Model is connected, - resulting in Model.info being initialized without requiring an - explicit call to this method. - - """ - facade = client.ClientFacade.from_connection(self.connection()) - - self._info = await facade.ModelInfo() - log.debug('Got ModelInfo: %s', vars(self.info)) - - return self.info - @property def info(self): """Return the cached client.ModelInfo object for this Model. @@ -1321,7 +1312,7 @@ async def add_machine( params.series = series # Submit the request. - client_facade = client.ClientFacade.from_connection(self.connection()) + client_facade = client.MachineManagerFacade.from_connection(self.connection()) results = await client_facade.AddMachines(params=[params]) error = results.machines[0].error if error: @@ -1644,13 +1635,7 @@ async def deploy( resources = await self._add_charmhub_resources(res.app_name, identifier, add_charm_res.charm_origin) - charm_info = await self.charmhub.info(url.name) - is_subordinate = False - try: - is_subordinate = charm_info.result.charm.subordinate - except AttributeError: - log.warning('CharmHub.Info : unable to retrieve the subordinate information') - if is_subordinate: + if self.charmhub.is_subordinate(url.name): if num_units > 1: raise JujuError("cannot use num_units with subordinate application") num_units = 0 @@ -2017,7 +2002,7 @@ async def get_config(self): result = await config_facade.ModelGet() config = result.config for key, value in config.items(): - config[key] = ConfigValue.from_json(value) + config[key] = client.ConfigValue.from_json(value) return config async def get_constraints(self): @@ -2026,8 +2011,12 @@ async def get_constraints(self): :returns: A ``dict`` of constraints. """ constraints = {} - client_facade = client.ClientFacade.from_connection(self.connection()) - result = await client_facade.GetModelConstraints() + facade_cls = client.ModelConfigFacade + if self.connection().is_using_old_client: + facade_cls = client.ClientFacade + + facade = facade_cls.from_connection(self.connection()) + result = await facade.GetModelConstraints() # GetModelConstraints returns GetConstraintsResults which has a # 'constraints' attribute. If no constraints have been set @@ -2037,7 +2026,7 @@ async def get_constraints(self): # set. if result.constraints: constraint_types = [a for a in dir(result.constraints) - if a in Value._toSchema.keys()] + if a in client.Value._toSchema.keys()] for constraint in constraint_types: value = getattr(result.constraints, constraint) if value is not None: @@ -2131,7 +2120,7 @@ async def set_config(self, config): new_conf = {} for key, value in config.items(): - if isinstance(value, ConfigValue): + if isinstance(value, client.ConfigValue): new_conf[key] = value.value elif isinstance(value, str): new_conf[key] = value @@ -2144,8 +2133,12 @@ async def set_constraints(self, constraints): :param dict config: Mapping of model constraints """ - client_facade = client.ClientFacade.from_connection(self.connection()) - await client_facade.SetModelConstraints( + facade_cls = client.ModelConfigFacade + if self.connection().is_using_old_client: + facade_cls = client.ClientFacade + facade = facade_cls.from_connection(self.connection()) + + await facade.SetModelConstraints( application='', constraints=constraints) diff --git a/juju/provisioner.py b/juju/provisioner.py index db27762a4..0cde675f6 100644 --- a/juju/provisioner.py +++ b/juju/provisioner.py @@ -306,8 +306,13 @@ async def install_agent(self, connection, nonce, machine_id): # charms will fail to deploy disable_package_commands = False - client_facade = client.ClientFacade.from_connection(connection) - results = await client_facade.ProvisioningScript( + facade_cls = client.MachineManagerFacade + if connection.is_using_old_client: + facade_cls = client.ClientFacade + + facade = facade_cls.from_connection(connection) + + results = await facade.ProvisioningScript( data_dir=data_dir, disable_package_commands=disable_package_commands, machine_id=machine_id, diff --git a/juju/unit.py b/juju/unit.py index b797c0c81..9957496c3 100644 --- a/juju/unit.py +++ b/juju/unit.py @@ -145,7 +145,8 @@ async def run(self, command, timeout=None): timeout=timeout, units=[self.name], ) - return await self.model.wait_for_action(res.results[0].action.tag) + the_action = res.results[0] if self.connection.is_using_old_client else res.actions[0] + return await self.model.wait_for_action(the_action.action.tag) async def run_action(self, action_name, **params): """Run an action on this unit. diff --git a/tests/integration/bundle/bundle-include-base64.yaml b/tests/integration/bundle/bundle-include-base64.yaml index b9d4199ce..8f8be3946 100644 --- a/tests/integration/bundle/bundle-include-base64.yaml +++ b/tests/integration/bundle/bundle-include-base64.yaml @@ -5,8 +5,7 @@ applications: num_units: 1 mysql: charm: "mysql" - channel: "candidate" - series: "trusty" + channel: candidate num_units: 1 options: max-connections: 2 diff --git a/tests/integration/test_application.py b/tests/integration/test_application.py index cafdc9ae4..e2a74dd05 100644 --- a/tests/integration/test_application.py +++ b/tests/integration/test_application.py @@ -3,6 +3,7 @@ import pytest from .. import base +from juju import jasyncio MB = 1 @@ -40,6 +41,8 @@ async def test_action(event_loop): constraints = await ubuntu_app.get_constraints() assert constraints['mem'] == 512 * MB + await jasyncio.sleep(5) + # check action definitions actions = await ubuntu_app.get_actions() assert 'backup' in actions.keys() diff --git a/tests/integration/test_charmhub.py b/tests/integration/test_charmhub.py index 5deba5a23..00b8d27f8 100644 --- a/tests/integration/test_charmhub.py +++ b/tests/integration/test_charmhub.py @@ -9,13 +9,13 @@ @pytest.mark.asyncio async def test_info(event_loop): async with base.CleanModel() as model: - result = await model.charmhub.info("hello-juju") - - assert result.result.name == "hello-juju" + _, name = model.charmhub.get_charm_id("hello-juju") + assert name == "hello-juju" @base.bootstrapped @pytest.mark.asyncio +@pytest.mark.skip('CharmHub facade no longer exists') async def test_info_with_channel(event_loop): async with base.CleanModel() as model: result = await model.charmhub.info("hello-juju", "latest/stable") @@ -26,6 +26,7 @@ async def test_info_with_channel(event_loop): @base.bootstrapped @pytest.mark.asyncio +@pytest.mark.skip('CharmHub facade no longer exists') async def test_info_not_found(event_loop): async with base.CleanModel() as model: try: @@ -38,6 +39,7 @@ async def test_info_not_found(event_loop): @base.bootstrapped @pytest.mark.asyncio +@pytest.mark.skip('CharmHub facade no longer exists') async def test_find(event_loop): async with base.CleanModel() as model: result = await model.charmhub.find("kube") @@ -50,6 +52,7 @@ async def test_find(event_loop): @base.bootstrapped @pytest.mark.asyncio +@pytest.mark.skip('CharmHub facade no longer exists') async def test_find_bundles(event_loop): async with base.CleanModel() as model: result = await model.charmhub.find("kube", charm_type="bundle") @@ -62,6 +65,7 @@ async def test_find_bundles(event_loop): @base.bootstrapped @pytest.mark.asyncio +@pytest.mark.skip('CharmHub facade no longer exists') async def test_find_all(event_loop): async with base.CleanModel() as model: result = await model.charmhub.find("") diff --git a/tests/integration/test_errors.py b/tests/integration/test_errors.py index d454765b6..5fc868cfa 100644 --- a/tests/integration/test_errors.py +++ b/tests/integration/test_errors.py @@ -54,7 +54,7 @@ async def test_juju_error_in_results_list(event_loop): @pytest.mark.asyncio async def test_juju_error_in_result(event_loop): ''' - Verify that we raise a JujuError when appropraite when we are + Verify that we raise a JujuError when appropriate when we are looking at a single result coming back. ''' @@ -65,4 +65,4 @@ async def test_juju_error_in_result(event_loop): app_facade = client.ApplicationFacade.from_connection(model.connection()) with pytest.raises(JujuError): - return await app_facade.GetCharmURL(application='foo') + return await app_facade.GetCharmURLOrigin(application='foo') diff --git a/tests/integration/test_model.py b/tests/integration/test_model.py index 872a24c60..bc820396e 100644 --- a/tests/integration/test_model.py +++ b/tests/integration/test_model.py @@ -13,7 +13,7 @@ import pylxd import pytest from juju import jasyncio -from juju.client.client import ApplicationFacade, ConfigValue +from juju.client import client from juju.errors import JujuError, JujuUnitError, JujuConnectionError from juju.model import Model, ModelObserver from juju.utils import block_until, run_with_interrupt, wait_for_bundle @@ -337,7 +337,6 @@ async def test_add_machine(event_loop): 'mem': 256 * MB, }, disks=[{ - 'pool': 'rootfs', 'size': 10 * GB, 'count': 1, }], @@ -556,7 +555,7 @@ async def on_relation_add(self, delta, old, new, model): model.add_observer(TestObserver()) - real_app_facade = ApplicationFacade.from_connection(model.connection()) + real_app_facade = client.ApplicationFacade.from_connection(model.connection()) mock_app_facade = mock.MagicMock() async def mock_AddRelation(*args, **kwargs): @@ -568,7 +567,7 @@ async def mock_AddRelation(*args, **kwargs): mock_app_facade.AddRelation = mock_AddRelation - with mock.patch.object(ApplicationFacade, 'from_connection', + with mock.patch.object(client.ApplicationFacade, 'from_connection', return_value=mock_app_facade): my_relation = await run_with_interrupt(model.relate( 'ubuntu', @@ -847,7 +846,7 @@ async def test_config(event_loop): assert 'extra-info' not in result await model.set_config({ 'extra-info': 'booyah', - 'test-mode': ConfigValue(value=True), + 'test-mode': client.ConfigValue(value=True), }) result = await model.get_config() assert 'extra-info' in result @@ -866,7 +865,7 @@ async def test_config_with_json(event_loop): expected = ['foo', {'bar': 1}] await model.set_config({ 'extra-complex-info': json.dumps(expected), - 'test-mode': ConfigValue(value=True), + 'test-mode': client.ConfigValue(value=True), }) result = await model.get_config() assert 'extra-complex-info' in result diff --git a/tests/integration/test_unit.py b/tests/integration/test_unit.py index a3adb99c5..93e92a0ee 100644 --- a/tests/integration/test_unit.py +++ b/tests/integration/test_unit.py @@ -81,7 +81,7 @@ async def test_run(event_loop): for unit in app.units: action = await unit.run('unit-get public-address') assert isinstance(action, Action) - assert 'Stdout' in action.results + assert action.status == 'completed' break for unit in app.units: diff --git a/tests/unit/test_bundle.py b/tests/unit/test_bundle.py index 64c569ba6..78bdf7f75 100644 --- a/tests/unit/test_bundle.py +++ b/tests/unit/test_bundle.py @@ -307,12 +307,9 @@ async def test_run_with_charmhub_charm(self, event_loop): context.trusted = False context.model = model - info = Mock() - info.result.id_ = "12345" - info.errors.error_list.code = '' - info_func = base.AsyncMock(return_value=info) + info_func = mock.Mock(return_value=["12345", "name"]) - with patch.object(charmhub.CharmHub, 'info', info_func): + with patch.object(charmhub.CharmHub, 'get_charm_id', info_func): result = await change.run(context) assert result == "application" @@ -359,12 +356,9 @@ async def test_run_with_charmhub_charm_no_channel(self, event_loop): context.trusted = False context.model = model - info = Mock() - info.result.id_ = "12345" - info.errors.error_list.code = '' - info_func = base.AsyncMock(return_value=info) + info_func = mock.Mock(return_value=["12345", "name"]) - with patch.object(charmhub.CharmHub, 'info', info_func): + with patch.object(charmhub.CharmHub, 'get_charm_id', info_func): result = await change.run(context) assert result == "application" @@ -536,15 +530,15 @@ async def test_run(self, event_loop): charmstore = mock.Mock() charmstore.entityId = base.AsyncMock(return_value="entity_id") - client_facade = mock.Mock() - client_facade.AddCharm = base.AsyncMock(return_value=None) + charms_facade = mock.Mock() + charms_facade.AddCharm = base.AsyncMock(return_value=None) model = mock.Mock() model._add_charm = base.AsyncMock(return_value=None) context = mock.Mock() context.charmstore = charmstore - context.client_facade = client_facade + context.charms_facade = charms_facade context.origins = {} context.model = model @@ -554,8 +548,8 @@ async def test_run(self, event_loop): charmstore.entityId.assert_called_once() charmstore.entityId.assert_called_with("cs:charm", channel="channel") - client_facade.AddCharm.assert_called_once() - client_facade.AddCharm.assert_called_with(channel="channel", + charms_facade.AddCharm.assert_called_once() + charms_facade.AddCharm.assert_called_with(channel="channel", url="entity_id", force=False) @@ -612,22 +606,22 @@ async def test_run(self, event_loop): machines = [client.AddMachinesResult(machine="machine1")] - client_facade = mock.Mock() - client_facade.AddMachines = base.AsyncMock(return_value=client.AddMachinesResults(machines)) + machine_manager_facade = mock.Mock() + machine_manager_facade.AddMachines = base.AsyncMock(return_value=client.AddMachinesResults(machines)) context = mock.Mock() context.resolve.return_value = "parent_id1" - context.client_facade = client_facade + context.machine_manager_facade = machine_manager_facade result = await change.run(context) assert result == "machine1" - client_facade.AddMachines.assert_called_once() - client_facade.AddMachines.assert_called_with(params=[client.AddMachineParams(series="series", - constraints="{\"cores\":1}", - container_type="container_type", - parent_id="parent_id1", - jobs=["JobHostUnits"])]) + machine_manager_facade.AddMachines.assert_called_once() + machine_manager_facade.AddMachines.assert_called_with(params=[client.AddMachineParams(series="series", + constraints="{\"cores\":1}", + container_type="container_type", + parent_id="parent_id1", + jobs=["JobHostUnits"])]) class TestAddRelationChange(unittest.TestCase): @@ -1109,6 +1103,7 @@ async def __call__(self, *args, **kwargs): "Client": 17, "Application": 17, "Annotations": 17, + "MachineManager": 17, } model = mock.Mock() model.units = {} diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index 42134df70..9002d390c 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -17,6 +17,7 @@ def test_basics(): def test_from_connection(): connection = mock.Mock() connection.facades = {"Action": 2} + connection.info = {"server-version": '3.0'} action_facade = client.ActionFacade.from_connection(connection) assert action_facade diff --git a/tests/unit/test_connection.py b/tests/unit/test_connection.py index 59c0493c2..c4272d99f 100644 --- a/tests/unit/test_connection.py +++ b/tests/unit/test_connection.py @@ -54,6 +54,7 @@ async def test_out_of_order(event_loop): 'juju.client.connection.Connection.login', base.AsyncMock(return_value={'response': { 'facades': minimal_facades, + 'server-version': '3.0', }}), ), \ mock.patch('juju.client.connection.Connection._get_ssl'), \ @@ -150,7 +151,9 @@ async def test_follow_redirect(event_loop): wsForCont2 = WebsocketMock([ {'request-id': 1}, {'request-id': 2}, - {'request-id': 3, 'response': {'result': minimal_facades}}, + {'request-id': 3, 'response': {'result': minimal_facades, + 'server-version': '3.0', + }}, ]) con = None @@ -186,6 +189,7 @@ async def test_rpc_none_results(event_loop): 'juju.client.connection.Connection.login', base.AsyncMock(return_value={'response': { 'facades': minimal_facades, + 'server-version': '3.0', }}), ), \ mock.patch('juju.client.connection.Connection._get_ssl'), \ diff --git a/tox.ini b/tox.ini index 7726aa217..9cb5051da 100644 --- a/tox.ini +++ b/tox.ini @@ -76,5 +76,5 @@ envdir = {toxworkdir}/py3 commands = python {posargs} [flake8] -exclude = juju/client/_* +exclude = juju/client/_*, juju/client/old_clients ignore = E501,W504,E402