diff --git a/juju/action.py b/juju/action.py index 068b372cc..913c6cca3 100644 --- a/juju/action.py +++ b/juju/action.py @@ -2,9 +2,15 @@ class Action(model.ModelEntity): + + def __init__(self, entity_id, model, history_index=-1, connected=True): + super().__init__(entity_id, model, history_index, connected) + self.results = {} + @property def status(self): return self.data['status'] async def wait(self): - return await self.model.get_action_output(self.id) + self.results = await self.model.get_action_output(self.id) + return self diff --git a/juju/client/_client.py b/juju/client/_client.py index 11e5abd1d..9020e093e 100644 --- a/juju/client/_client.py +++ b/juju/client/_client.py @@ -4,28 +4,21 @@ 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, _client14 +from juju.client import _client7, _client1, _client3, _client2, _client14, _client4, _client6, _client5, _client11, _client9, _client18 CLIENTS = { - "2": _client2, + "7": _client7, "1": _client1, "3": _client3, + "2": _client2, + "14": _client14, "4": _client4, - "5": _client5, - "8": _client8, - "7": _client7, - "9": _client9, - "10": _client10, "6": _client6, - "12": _client12, + "5": _client5, "11": _client11, - "13": _client13, - "15": _client15, - "16": _client16, - "17": _client17, - "18": _client18, - "14": _client14 + "9": _client9, + "18": _client18 } @@ -127,10 +120,6 @@ class ApplicationOffersFacade(TypeFactory): pass -class ApplicationRelationsWatcherFacade(TypeFactory): - pass - - class ApplicationScalerFacade(TypeFactory): pass @@ -247,10 +236,6 @@ class DeployerFacade(TypeFactory): pass -class DiscoverSpacesFacade(TypeFactory): - pass - - class DiskManagerFacade(TypeFactory): pass @@ -455,10 +440,6 @@ class RelationUnitsWatcherFacade(TypeFactory): pass -class RemoteApplicationWatcherFacade(TypeFactory): - pass - - class RemoteRelationWatcherFacade(TypeFactory): pass @@ -467,10 +448,6 @@ class RemoteRelationsFacade(TypeFactory): pass -class RemoteRelationsWatcherFacade(TypeFactory): - pass - - class ResourcesFacade(TypeFactory): pass diff --git a/juju/client/_client1.py b/juju/client/_client1.py index 04056ca75..5169865b2 100644 --- a/juju/client/_client1.py +++ b/juju/client/_client1.py @@ -182,185 +182,6 @@ async def UpdateToolsAvailable(self): -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 @@ -457,169 +278,99 @@ async def Watch(self): -class BackupsFacade(Type): - name = 'Backups' +class CAASAdmissionFacade(Type): + name = 'CAASAdmission' 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'], + 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'}, - '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'}}, + '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(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): + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): ''' + ControllerAPIInfoForModels returns the controller api connection details for the specified models. - Returns -> 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='Backups', - request='FinishRestore', + msg = dict(type='CAASAdmission', + request='ControllerAPIInfoForModels', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(BackupsMetadataResult) - async def Info(self, id_=None): - ''' - id_ : str - Returns -> BackupsMetadataResult + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): ''' - 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 - - + ControllerConfig returns the controller's configuration. - @ReturnMapping(BackupsListResult) - async def List(self): - ''' - Returns -> BackupsListResult + Returns -> ControllerConfigResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='Backups', - request='List', + msg = dict(type='CAASAdmission', + request='ControllerConfig', version=1, params=_params) @@ -628,147 +379,32 @@ async def List(self): - @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' +class CAASApplicationFacade(Type): + name = 'CAASApplication' 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'], + 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'}, - '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'}, + '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'], @@ -781,7751 +417,410 @@ class CAASAdmissionFacade(Type): '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'}}, + '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(ControllerAPIInfoResults) - async def ControllerAPIInfoForModels(self, entities=None): + @ReturnMapping(CAASUnitIntroductionResult) + async def UnitIntroduction(self, pod_name=None, pod_uuid=None): ''' - ControllerAPIInfoForModels returns the controller api connection details for the specified models. + UnitIntroduction sets the status of each given entity. - entities : typing.Sequence[~Entity] - Returns -> ControllerAPIInfoResults + pod_name : str + pod_uuid : str + Returns -> CAASUnitIntroductionResult ''' - 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 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='CAASAdmission', - request='ControllerAPIInfoForModels', + msg = dict(type='CAASApplication', + request='UnitIntroduction', version=1, params=_params) - _params['entities'] = entities + _params['pod-name'] = pod_name + _params['pod-uuid'] = pod_uuid reply = await self.rpc(msg) return reply - @ReturnMapping(ControllerConfigResult) - async def ControllerConfig(self): + @ReturnMapping(CAASUnitTerminationResult) + async def UnitTerminating(self, tag=None): ''' - ControllerConfig returns the controller's configuration. - + UnitTerminating should be called by the CAASUnitTerminationWorker when + the agent receives a signal to exit. UnitTerminating will return how + the agent should shutdown. - Returns -> ControllerConfigResult + 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='CAASAdmission', - request='ControllerConfig', + msg = dict(type='CAASApplication', + request='UnitTerminating', version=1, params=_params) - + _params['tag'] = tag reply = await self.rpc(msg) return reply -class CAASAgentFacade(Type): - name = 'CAASAgent' +class CAASApplicationProvisionerFacade(Type): + name = 'CAASApplicationProvisioner' 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'}}, + 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-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': ['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'}, - 'GetCloudSpec': {'description': 'GetCloudSpec constructs the ' - 'CloudSpec for a validated and ' - 'authorized model.', - 'properties': {'Params': {'$ref': '#/definitions/ModelTag'}, - 'Result': {'$ref': '#/definitions/CloudSpecResult'}}, + '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'}, - 'ModelConfig': {'description': 'ModelConfig returns the ' - "current model's configuration.", - 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, + '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'}, - '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-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': ['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'}, - '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'}, - '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'}, - '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'}, - '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'}, - '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.', - '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'}, - '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(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(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): - ''' - 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 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): - ''' - 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 - - - - @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 - 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'], + 'CharmOption': {'additionalProperties': False, + 'properties': {'default': {'additionalProperties': True, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['type'], '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'}}, + 'CharmPayloadClass': {'additionalProperties': False, + 'properties': {'name': {'type': 'string'}, + 'type': {'type': 'string'}}, + 'required': ['name', 'type'], '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'}, + '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'}}, @@ -8545,6 +840,16 @@ class DeployerFacade(Type): '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'}}, @@ -8573,23 +878,96 @@ class DeployerFacade(Type): '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'}, + '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'}}, @@ -8605,21 +983,28 @@ class DeployerFacade(Type): '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'}, - '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'}, @@ -8631,40 +1016,145 @@ class DeployerFacade(Type): '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'}, + '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'}, + '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'}, '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'}, + 'ProvisioningInfo': {'description': 'ProvisioningInfo returns ' + 'the info needed to ' + 'provision a caas ' + 'application.', + '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 ' @@ -8672,112 +1162,166 @@ class DeployerFacade(Type): 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, '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'}, - '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'}}, + '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'}, 'WatchUnits': {'description': 'WatchUnits starts a ' - 'StringsWatcher to watch all ' - 'units belonging to\n' - 'to any entity (machine or ' - 'service) passed in args.', + '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): + @ReturnMapping(Charm) + async def ApplicationCharmInfo(self, tag=None): ''' - APIAddresses returns the list of addresses used to connect to the API. - + ApplicationCharmInfo returns information about an application's charm. - Returns -> StringsResult + 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='Deployer', - request='APIAddresses', + msg = dict(type='CAASApplicationProvisioner', + request='ApplicationCharmInfo', version=1, params=_params) - + _params['tag'] = tag reply = await self.rpc(msg) return reply - @ReturnMapping(APIHostPortsResult) - async def APIHostPorts(self): + @ReturnMapping(CAASApplicationOCIResourceResults) + async def ApplicationOCIResources(self, entities=None): ''' - APIHostPorts returns the API server addresses. - + ApplicationOCIResources returns the OCI image resources for an application. - Returns -> APIHostPortsResult + 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='Deployer', - request='APIHostPorts', + msg = dict(type='CAASApplicationProvisioner', + request='ApplicationOCIResources', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(DeployerConnectionValues) - async def ConnectionInfo(self): + @ReturnMapping(ErrorResults) + async def CAASApplicationGarbageCollect(self, args=None): ''' - ConnectionInfo returns all the address information that the - deployer task needs in one call. - + 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. - Returns -> DeployerConnectionValues + 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='Deployer', - request='ConnectionInfo', + 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): + @ReturnMapping(ErrorResults) + async def ClearApplicationsResources(self, entities=None): ''' - Life returns the life status of every supplied entity, where available. + ClearApplicationsResources clears the flags which indicate + applications still have resources in the cluster. entities : typing.Sequence[~Entity] - Returns -> LifeResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Deployer', - request='Life', + msg = dict(type='CAASApplicationProvisioner', + request='ClearApplicationsResources', version=1, params=_params) _params['entities'] = entities @@ -8786,46 +1330,44 @@ async def Life(self, entities=None): - @ReturnMapping(StringResult) - async def ModelUUID(self): + @ReturnMapping(LifeResults) + async def Life(self, entities=None): ''' - 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. - + Life returns the life status of every supplied entity, where available. - Returns -> StringResult + 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='ModelUUID', + msg = dict(type='CAASApplicationProvisioner', + request='Life', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def Remove(self, entities=None): + @ReturnMapping(CAASApplicationProvisioningInfoResults) + async def ProvisioningInfo(self, entities=None): ''' - Remove removes every given entity from state, calling EnsureDead - first, then Remove. It will fail if the entity is not present. + ProvisioningInfo returns the info needed to provision a caas application. entities : typing.Sequence[~Entity] - Returns -> ErrorResults + 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='Deployer', - request='Remove', + msg = dict(type='CAASApplicationProvisioner', + request='ProvisioningInfo', version=1, params=_params) _params['entities'] = entities @@ -8835,32 +1377,33 @@ async def Remove(self, entities=None): @ReturnMapping(ErrorResults) - async def SetPasswords(self, changes=None): + async def Remove(self, entities=None): ''' - SetPasswords sets the given password for each supplied entity, if possible. + Remove removes every given entity from state, calling EnsureDead + first, then Remove. It will fail if the entity is not present. - changes : typing.Sequence[~EntityPassword] + entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' - if changes is not None and not isinstance(changes, (bytes, str, list)): - raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Deployer', - request='SetPasswords', + msg = dict(type='CAASApplicationProvisioner', + request='Remove', version=1, params=_params) - _params['changes'] = changes + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetStatus(self, entities=None): + async def SetOperatorStatus(self, entities=None): ''' - SetStatus sets the status of the specified entities. + SetOperatorStatus sets the status of each given entity. entities : typing.Sequence[~EntityStatusArgs] Returns -> ErrorResults @@ -8870,8 +1413,8 @@ async def SetStatus(self, entities=None): # map input types to rpc msg _params = dict() - msg = dict(type='Deployer', - request='SetStatus', + msg = dict(type='CAASApplicationProvisioner', + request='SetOperatorStatus', version=1, params=_params) _params['entities'] = entities @@ -8880,43 +1423,44 @@ async def SetStatus(self, entities=None): - @ReturnMapping(NotifyWatchResult) - async def WatchAPIHostPorts(self): + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): ''' - WatchAPIHostPorts watches the API server addresses. - + SetPasswords sets the given password for each supplied entity, if possible. - Returns -> NotifyWatchResult + 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='WatchAPIHostPorts', + msg = dict(type='CAASApplicationProvisioner', + request='SetPasswords', version=1, params=_params) - + _params['changes'] = changes reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResults) - async def WatchUnits(self, entities=None): + @ReturnMapping(CAASUnitsResults) + async def Units(self, entities=None): ''' - WatchUnits starts a StringsWatcher to watch all units belonging to - to any entity (machine or service) passed in args. + Units returns all the units for each application specified. entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + 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='Deployer', - request='WatchUnits', + msg = dict(type='CAASApplicationProvisioner', + request='Units', version=1, params=_params) _params['entities'] = entities @@ -8925,260 +1469,92 @@ async def WatchUnits(self, entities=None): -class EnvironUpgraderFacade(Type): - name = 'EnvironUpgrader' - 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): + @ReturnMapping(UpdateApplicationUnitResults) + async def UpdateApplicationsUnits(self, args=None): ''' - ModelEnvironVersion returns the current version of the environ corresponding - to each specified model. + UpdateApplicationsUnits updates the Juju data model to reflect the given + units of the specified application. - entities : typing.Sequence[~Entity] - Returns -> IntResults + args : typing.Sequence[~UpdateApplicationUnits] + Returns -> UpdateApplicationUnitResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() - msg = dict(type='EnvironUpgrader', - request='ModelEnvironVersion', + msg = dict(type='CAASApplicationProvisioner', + request='UpdateApplicationsUnits', version=1, params=_params) - _params['entities'] = entities + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(IntResults) - async def ModelTargetEnvironVersion(self, entities=None): + @ReturnMapping(NotifyWatchResults) + async def Watch(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. + Watch starts an NotifyWatcher for each given entity. entities : typing.Sequence[~Entity] - Returns -> IntResults + 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='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', + msg = dict(type='CAASApplicationProvisioner', + request='Watch', version=1, params=_params) - _params['models'] = models + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetModelStatus(self, entities=None): + @ReturnMapping(StringsWatchResult) + async def WatchApplications(self): ''' - SetModelStatus sets the status of each given model. + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + + 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='EnvironUpgrader', - request='SetModelStatus', + msg = dict(type='CAASApplicationProvisioner', + request='WatchApplications', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchModelEnvironVersion(self, entities=None): + @ReturnMapping(StringsWatchResults) + async def WatchUnits(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. + 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 -> NotifyWatchResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='EnvironUpgrader', - request='WatchModelEnvironVersion', + msg = dict(type='CAASApplicationProvisioner', + request='WatchUnits', version=1, params=_params) _params['entities'] = entities @@ -9187,10 +1563,222 @@ async def WatchModelEnvironVersion(self, entities=None): -class ExternalControllerUpdaterFacade(Type): - name = 'ExternalControllerUpdater' +class CAASFirewallerEmbeddedFacade(Type): + name = 'CAASFirewallerEmbedded' version = 1 - schema = {'definitions': {'Entities': {'additionalProperties': False, + 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'], @@ -9207,45 +1795,31 @@ class ExternalControllerUpdaterFacade(Type): 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, - 'ErrorResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}}, + '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'}, - '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'}, + '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'}, @@ -9258,265 +1832,209 @@ class ExternalControllerUpdaterFacade(Type): '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'}}, + '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(ExternalControllerInfoResults) - async def ExternalControllerInfo(self, entities=None): + @ReturnMapping(Charm) + async def ApplicationCharmInfo(self, tag=None): ''' - ExternalControllerInfo returns the info for the specified external controllers. + ApplicationCharmInfo returns information about an application's charm. - entities : typing.Sequence[~Entity] - Returns -> ExternalControllerInfoResults + tag : str + Returns -> Charm ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if 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='ExternalControllerUpdater', - request='ExternalControllerInfo', + msg = dict(type='CAASFirewallerEmbedded', + request='ApplicationCharmInfo', version=1, params=_params) - _params['entities'] = entities + _params['tag'] = tag reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetExternalControllerInfo(self, controllers=None): + @ReturnMapping(ApplicationGetConfigResults) + async def ApplicationsConfig(self, entities=None): ''' - SetExternalControllerInfo saves the info for the specified external controllers. + ApplicationsConfig returns the config for the specified applications. - controllers : typing.Sequence[~SetExternalControllerInfoParams] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConfigResults ''' - if controllers is not None and not isinstance(controllers, (bytes, str, list)): - raise Exception("Expected controllers to be a Sequence, received: {}".format(type(controllers))) + if entities is not None and not isinstance(entities, (bytes, str, 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='SetExternalControllerInfo', + msg = dict(type='CAASFirewallerEmbedded', + request='ApplicationsConfig', version=1, params=_params) - _params['controllers'] = controllers + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResults) - async def WatchExternalControllers(self): + @ReturnMapping(Charm) + async def CharmInfo(self, url=None): ''' - WatchExternalControllers watches for the addition and removal of external - controller records to the local controller's database. - + CharmInfo returns information about the requested charm. - Returns -> StringsWatchResults + 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='ExternalControllerUpdater', - request='WatchExternalControllers', + msg = dict(type='CAASFirewallerEmbedded', + request='CharmInfo', version=1, params=_params) - + _params['url'] = url 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. - + @ReturnMapping(BoolResults) + async def IsExposed(self, entities=None): + ''' + IsExposed returns whether the specified applications are exposed. - Returns -> FanConfigResult + 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='FanConfigurer', - request='FanConfig', + msg = dict(type='CAASFirewallerEmbedded', + request='IsExposed', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def WatchForFanConfigChanges(self): + @ReturnMapping(LifeResults) + async def Life(self, entities=None): ''' - 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. - + Life returns the life status of every supplied entity, where available. - Returns -> NotifyWatchResult + 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='FanConfigurer', - request='WatchForFanConfigChanges', + msg = dict(type='CAASFirewallerEmbedded', + request='Life', version=1, params=_params) - + _params['entities'] = entities 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(NotifyWatchResults) + async def Watch(self, entities=None): + ''' + Watch starts an NotifyWatcher for each given entity. - @ReturnMapping(ListFirewallRulesResults) - async def ListFirewallRules(self): + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' - ListFirewallRules returns all the firewall rules. + if entities is not None and not isinstance(entities, (bytes, str, 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 - Returns -> ListFirewallRulesResults + + @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='FirewallRules', - request='ListFirewallRules', + msg = dict(type='CAASFirewallerEmbedded', + request='WatchApplications', version=1, params=_params) @@ -9525,117 +2043,254 @@ async def ListFirewallRules(self): - @ReturnMapping(ErrorResults) - async def SetFirewallRules(self, args=None): + @ReturnMapping(StringsWatchResults) + async def WatchOpenedPorts(self, entities=None): ''' - SetFirewallRules creates or updates the specified firewall rules. + WatchOpenedPorts returns a new StringsWatcher for each given + model tag. - args : typing.Sequence[~FirewallRule] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='FirewallRules', - request='SetFirewallRules', + msg = dict(type='CAASFirewallerEmbedded', + request='WatchOpenedPorts', version=1, params=_params) - _params['args'] = args + _params['entities'] = entities reply = await self.rpc(msg) return reply -class HostKeyReporterFacade(Type): - name = 'HostKeyReporter' +class CAASFirewallerFacade(Type): + name = 'CAASFirewaller' 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'], + 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'}, - 'ErrorResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}}, + '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'}, - 'ErrorResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, - 'type': 'array'}}, - 'required': ['results'], + 'CharmMetrics': {'additionalProperties': False, + 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, + 'type': 'object'}, + 'plan': {'$ref': '#/definitions/CharmPlan'}}, + 'required': ['metrics', 'plan'], 'type': 'object'}, - 'SSHHostKeySet': {'additionalProperties': False, - 'properties': {'entity-keys': {'items': {'$ref': '#/definitions/SSHHostKeys'}, - 'type': 'array'}}, - 'required': ['entity-keys'], + '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'}, - 'SSHHostKeys': {'additionalProperties': False, - 'properties': {'public-keys': {'items': {'type': 'string'}, + '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'}, - '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'}, + '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, @@ -9644,485 +2299,317 @@ class ImageMetadataManagerFacade(Type): 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, - 'ErrorResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}}, + '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'}, - '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'}, + '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': ['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'}}, + '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'}, - 'Save': {'description': 'Save stores given cloud image ' - 'metadata.\n' - 'It supports bulk calls.', - 'properties': {'Params': {'$ref': '#/definitions/MetadataSaveParams'}, - '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'}, + 'WatchApplications': {'description': 'WatchApplications starts ' + 'a StringsWatcher to ' + 'watch applications\n' + 'deployed to this model.', + 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + '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): + @ReturnMapping(Charm) + async def ApplicationCharmInfo(self, tag=None): ''' - List returns all found cloud image metadata that satisfy - given filter. - Returned list contains metadata ordered by priority. + ApplicationCharmInfo returns information about an application's charm. - arches : typing.Sequence[str] - region : str - root_storage_type : str - series : typing.Sequence[str] - stream : str - virt_type : str - Returns -> ListCloudImageMetadataResult + tag : str + Returns -> Charm ''' - 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))) + 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='ImageMetadataManager', - request='List', + msg = dict(type='CAASFirewaller', + request='ApplicationCharmInfo', 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 + _params['tag'] = tag reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def Save(self, metadata=None): + @ReturnMapping(ApplicationGetConfigResults) + async def ApplicationsConfig(self, entities=None): ''' - Save stores given cloud image metadata. - It supports bulk calls. + ApplicationsConfig returns the config for the specified applications. - metadata : typing.Sequence[~CloudImageMetadataList] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> ApplicationGetConfigResults ''' - if metadata is not None and not isinstance(metadata, (bytes, str, list)): - raise Exception("Expected metadata to be a Sequence, received: {}".format(type(metadata))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='ImageMetadataManager', - request='Save', + msg = dict(type='CAASFirewaller', + request='ApplicationsConfig', version=1, params=_params) - _params['metadata'] = metadata + _params['entities'] = entities 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): + @ReturnMapping(Charm) + async def CharmInfo(self, url=None): ''' - AddKeys adds new authorised ssh keys for the specified user. + CharmInfo returns information about the requested charm. - ssh_keys : typing.Sequence[str] - user : str - Returns -> ErrorResults + url : str + Returns -> Charm ''' - 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))) + 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='KeyManager', - request='AddKeys', + msg = dict(type='CAASFirewaller', + request='CharmInfo', version=1, params=_params) - _params['ssh-keys'] = ssh_keys - _params['user'] = user + _params['url'] = url 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 + @ReturnMapping(BoolResults) + async def IsExposed(self, entities=None): ''' - 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))) + IsExposed returns whether the specified applications are exposed. - if user is not None and not isinstance(user, (bytes, str)): - raise Exception("Expected user to be a str, received: {}".format(type(user))) + 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='KeyManager', - request='DeleteKeys', + msg = dict(type='CAASFirewaller', + request='IsExposed', version=1, params=_params) - _params['ssh-keys'] = ssh_keys - _params['user'] = user + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def ImportKeys(self, ssh_keys=None, user=None): + @ReturnMapping(LifeResults) + async def Life(self, entities=None): ''' - ImportKeys imports new authorised ssh keys from the specified key ids for the specified user. + Life returns the life status of every supplied entity, where available. - ssh_keys : typing.Sequence[str] - user : str - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> LifeResults ''' - 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))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='KeyManager', - request='ImportKeys', + msg = dict(type='CAASFirewaller', + request='Life', version=1, params=_params) - _params['ssh-keys'] = ssh_keys - _params['user'] = user + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(StringsResults) - async def ListKeys(self, entities=None, mode=None): + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): ''' - ListKeys returns the authorised ssh keys for the specified users. + Watch starts an NotifyWatcher for each given entity. - entities : Entities - mode : bool - Returns -> StringsResults + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' - 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))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='KeyManager', - request='ListKeys', + msg = dict(type='CAASFirewaller', + request='Watch', 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): + @ReturnMapping(StringsWatchResult) + async def WatchApplications(self): ''' - 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. + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. - entities : typing.Sequence[~Entity] - Returns -> StringsResults + + 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='KeyUpdater', - request='AuthorisedKeys', + msg = dict(type='CAASFirewaller', + request='WatchApplications', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchAuthorisedKeys(self, entities=None): +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): ''' - 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 + Returns -> ControllerConfigResult ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='KeyUpdater', - request='WatchAuthorisedKeys', + msg = dict(type='CAASModelConfigManager', + request='ControllerConfig', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply -class LifeFlagFacade(Type): - name = 'LifeFlag' +class CAASModelOperatorFacade(Type): + name = 'CAASModelOperator' 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'}, + 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, @@ -10131,401 +2618,338 @@ class LifeFlagFacade(Type): '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'], + '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'}, - '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'}}, + '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(LifeResults) - async def Life(self, entities=None): + @ReturnMapping(StringsResult) + async def APIAddresses(self): ''' - Life returns the life status of every supplied entity, where available. + APIAddresses returns the list of addresses used to connect to the API. - entities : typing.Sequence[~Entity] - Returns -> LifeResults + + Returns -> StringsResult ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='CAASModelOperator', + request='APIAddresses', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def Watch(self, entities=None): + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): ''' - Watch starts an NotifyWatcher for each given entity. + APIHostPorts returns the API server addresses. - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + + Returns -> APIHostPortsResult ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='CAASModelOperator', + request='APIHostPorts', 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): + @ReturnMapping(ModelOperatorInfo) + async def ModelOperatorProvisioningInfo(self): ''' - GetLastSent is a bulk call that gets the log forwarding "last sent" - record ID for each requested target. + ModelOperatorProvisioningInfo returns the information needed for provisioning + a new model operator into a caas cluster. - ids : typing.Sequence[~LogForwardingID] - Returns -> LogForwardingGetLastSentResults + + Returns -> ModelOperatorInfo ''' - 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', + msg = dict(type='CAASModelOperator', + request='ModelOperatorProvisioningInfo', version=1, params=_params) - _params['ids'] = ids + reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetLastSent(self, params=None): + @ReturnMapping(StringResult) + async def ModelUUID(self): ''' - SetLastSent is a bulk call that sets the log forwarding "last sent" - record ID for each requested target. + 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. - params : typing.Sequence[~LogForwardingSetLastSentParam] - Returns -> ErrorResults + + Returns -> StringResult ''' - 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', + msg = dict(type='CAASModelOperator', + request='ModelUUID', 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): + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): ''' - LoggingConfig reports the logging configuration for the agents specified. + SetPasswords sets the given password for each supplied entity, if possible. - entities : typing.Sequence[~Entity] - Returns -> StringResults + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) # map input types to rpc msg _params = dict() - msg = dict(type='Logger', - request='LoggingConfig', + msg = dict(type='CAASModelOperator', + request='SetPasswords', version=1, params=_params) - _params['entities'] = entities + _params['changes'] = changes reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchLoggingConfig(self, entities=None): + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): ''' - 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. + WatchAPIHostPorts watches the API server addresses. - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + + Returns -> NotifyWatchResult ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='CAASModelOperator', + request='WatchAPIHostPorts', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply -class MachineActionsFacade(Type): - name = 'MachineActions' +class CAASOperatorFacade(Type): + name = 'CAASOperator' version = 1 - 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'}, - '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'}, + 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, @@ -10542,6 +2966,82 @@ class MachineActionsFacade(Type): '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'}, @@ -10553,67 +3053,170 @@ class MachineActionsFacade(Type): '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'}, + '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(ActionResults) - async def Actions(self, entities=None): + @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): ''' - Actions returns the Actions by Tags passed and ensures that the machine asking - for them is the machine that has the actions + Charm returns the charm info for all given applications. entities : typing.Sequence[~Entity] - Returns -> ActionResults + 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='MachineActions', - request='Actions', + msg = dict(type='CAASOperator', + request='Charm', version=1, params=_params) _params['entities'] = entities @@ -10622,21 +3225,42 @@ async def Actions(self, entities=None): - @ReturnMapping(ErrorResults) - async def BeginActions(self, entities=None): + @ReturnMapping(ModelResult) + async def CurrentModel(self): ''' - BeginActions marks the actions represented by the passed in Tags as running. + 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 -> ErrorResults + 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='MachineActions', - request='BeginActions', + msg = dict(type='CAASOperator', + request='Life', version=1, params=_params) _params['entities'] = entities @@ -10645,46 +3269,46 @@ async def BeginActions(self, entities=None): - @ReturnMapping(ErrorResults) - async def FinishActions(self, results=None): + @ReturnMapping(StringResult) + async def ModelUUID(self): ''' - FinishActions saves the result of a completed Action + 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. - results : typing.Sequence[~ActionExecutionResult] - Returns -> ErrorResults + + Returns -> StringResult ''' - 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', + msg = dict(type='CAASOperator', + request='ModelUUID', version=1, params=_params) - _params['results'] = results + reply = await self.rpc(msg) return reply - @ReturnMapping(ActionsByReceivers) - async def RunningActions(self, entities=None): + @ReturnMapping(ErrorResults) + async def Remove(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. + 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 -> ActionsByReceivers + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='CAASOperator', + request='Remove', version=1, params=_params) _params['entities'] = entities @@ -10693,22 +3317,45 @@ async def RunningActions(self, entities=None): - @ReturnMapping(StringsWatchResults) - async def WatchActionNotifications(self, entities=None): + @ReturnMapping(ErrorResults) + async def SetPodSpec(self, specs=None): ''' - WatchActionNotifications returns a StringsWatcher for observing - incoming action calls to a machine. + SetPodSpec sets the container specs for a set of applications. + TODO(juju3) - remove - entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + 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='MachineActions', - request='WatchActionNotifications', + msg = dict(type='CAASOperator', + request='SetStatus', version=1, params=_params) _params['entities'] = entities @@ -10717,133 +3364,44 @@ async def WatchActionNotifications(self, entities=None): -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(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(EntitiesResults) - async def AllMachineRemovals(self, entities=None): + + + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): ''' - AllMachineRemovals returns tags for all of the machines that have - been marked for removal in the requested model. + Watch starts an NotifyWatcher for each given entity. entities : typing.Sequence[~Entity] - Returns -> EntitiesResults + 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='AllMachineRemovals', + msg = dict(type='CAASOperator', + request='Watch', version=1, params=_params) _params['entities'] = entities @@ -10852,71 +3410,68 @@ async def AllMachineRemovals(self, entities=None): - @ReturnMapping(None) - async def CompleteMachineRemovals(self, entities=None): + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): ''' - 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. + WatchAPIHostPorts watches the API server addresses. - entities : typing.Sequence[~Entity] - Returns -> None + + Returns -> NotifyWatchResult ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='CAASOperator', + request='WatchAPIHostPorts', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(ProviderInterfaceInfoResults) - async def GetMachineProviderInterfaceInfo(self, entities=None): + @ReturnMapping(StringsWatchResults) + async def WatchContainerStart(self, args=None): ''' - GetMachineProviderInterfaceInfo returns the provider details for - all network interfaces attached to the machines requested. + WatchContainerStart starts a StringWatcher to watch for container start events + on the CAAS api for a specific application and container. - entities : typing.Sequence[~Entity] - Returns -> ProviderInterfaceInfoResults + args : typing.Sequence[~WatchContainerStartArg] + 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))) + 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='MachineUndertaker', - request='GetMachineProviderInterfaceInfo', + msg = dict(type='CAASOperator', + request='WatchContainerStart', version=1, params=_params) - _params['entities'] = entities + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchMachineRemovals(self, entities=None): + @ReturnMapping(StringsWatchResults) + async def WatchUnits(self, entities=None): ''' - WatchMachineRemovals returns a watcher that will signal each time a - machine is marked for removal. + 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 -> NotifyWatchResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='MachineUndertaker', - request='WatchMachineRemovals', + msg = dict(type='CAASOperator', + request='WatchUnits', version=1, params=_params) _params['entities'] = entities @@ -10925,8 +3480,8 @@ async def WatchMachineRemovals(self, entities=None): -class MachinerFacade(Type): - name = 'Machiner' +class CAASOperatorProvisionerFacade(Type): + name = 'CAASOperatorProvisioner' version = 1 schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, @@ -10935,13 +3490,218 @@ class MachinerFacade(Type): 'required': ['servers'], 'type': 'object'}, 'Address': {'additionalProperties': False, - 'properties': {'scope': {'type': 'string'}, + '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'}}, @@ -10951,18 +3711,16 @@ class MachinerFacade(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'}, + '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, @@ -10979,8 +3737,16 @@ class MachinerFacade(Type): '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'}, @@ -10993,17 +3759,40 @@ class MachinerFacade(Type): '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'}, + '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'}}, @@ -11014,89 +3803,41 @@ class MachinerFacade(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'}, - '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'}, + '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'}}, @@ -11106,40 +3847,86 @@ class MachinerFacade(Type): 'properties': {'error': {'$ref': '#/definitions/Error'}, 'result': {'items': {'type': 'string'}, 'type': 'array'}}, - 'type': 'object'}}, - 'properties': {'APIAddresses': {'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, + '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': {'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, + 'APIHostPorts': {'description': 'APIHostPorts returns the API ' + 'server addresses.', + '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'}, + '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': {'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, + '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'}, - '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'}}, + 'OperatorProvisioningInfo': {'description': 'OperatorProvisioningInfo ' + 'returns the info ' + 'needed to ' + 'provision an ' + 'operator.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/OperatorProvisioningInfoResults'}}, 'type': 'object'}, - 'SetStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'UpdateStatus': {'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, + 'SetPasswords': {'description': 'SetPasswords sets the given ' + 'password for each supplied ' + 'entity, if possible.', + 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, - 'Watch': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, - 'type': 'object'}, - 'WatchAPIHostPorts': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, + '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'} @@ -11147,13 +3934,15 @@ class MachinerFacade(Type): @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', + msg = dict(type='CAASOperatorProvisioner', request='APIAddresses', version=1, params=_params) @@ -11166,56 +3955,85 @@ async def APIAddresses(self): @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. - Returns -> APIHostPortsResult + 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='Machiner', - request='APIHostPorts', + msg = dict(type='CAASOperatorProvisioner', + request='ApplicationCharmInfo', version=1, params=_params) - + _params['tag'] = tag reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def EnsureDead(self, entities=None): + @ReturnMapping(Charm) + async def CharmInfo(self, url=None): ''' - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + CharmInfo returns information about the requested charm. + + url : str + Returns -> Charm ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if url is not None and not isinstance(url, (bytes, str)): + raise Exception("Expected url to be a str, received: {}".format(type(url))) # map input types to rpc msg _params = dict() - msg = dict(type='Machiner', - request='EnsureDead', + msg = dict(type='CAASOperatorProvisioner', + request='CharmInfo', version=1, params=_params) - _params['entities'] = entities + _params['url'] = url reply = await self.rpc(msg) return reply - @ReturnMapping(JobsResults) - async def Jobs(self, entities=None): + @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 -> JobsResults + 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='Machiner', - request='Jobs', + msg = dict(type='CAASOperatorProvisioner', + request='IssueOperatorCertificate', version=1, params=_params) _params['entities'] = entities @@ -11227,6 +4045,8 @@ async def Jobs(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 ''' @@ -11235,7 +4055,7 @@ async def Life(self, entities=None): # map input types to rpc msg _params = dict() - msg = dict(type='Machiner', + msg = dict(type='CAASOperatorProvisioner', request='Life', version=1, params=_params) @@ -11248,13 +4068,18 @@ async def Life(self, entities=None): @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='Machiner', + msg = dict(type='CAASOperatorProvisioner', request='ModelUUID', version=1, params=_params) @@ -11264,99 +4089,246 @@ async def ModelUUID(self): + @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 SetMachineAddresses(self, machine_addresses=None): + async def SetPasswords(self, changes=None): ''' - machine_addresses : typing.Sequence[~MachineAddresses] + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] 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))) + 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='Machiner', - request='SetMachineAddresses', + msg = dict(type='CAASOperatorProvisioner', + request='SetPasswords', version=1, params=_params) - _params['machine-addresses'] = machine_addresses + _params['changes'] = changes 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 + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): ''' - if config is not None and not isinstance(config, (bytes, str, list)): - raise Exception("Expected config to be a Sequence, received: {}".format(type(config))) + WatchAPIHostPorts watches the API server addresses. - if tag is not None and not isinstance(tag, (bytes, str)): - raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + + Returns -> NotifyWatchResult + ''' # map input types to rpc msg _params = dict() - msg = dict(type='Machiner', - request='SetObservedNetworkConfig', + msg = dict(type='CAASOperatorProvisioner', + request='WatchAPIHostPorts', 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): + @ReturnMapping(StringsWatchResult) + async def WatchApplications(self): ''' - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. + + + 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='Machiner', - request='SetProviderNetworkConfig', + msg = dict(type='CAASOperatorProvisioner', + request='WatchApplications', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetStatus(self, entities=None): +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): ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + UpgradeOperator upgrades the operator for the specified agents. + + agent_tag : str + version : Number + Returns -> ErrorResult ''' - 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 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='Machiner', - request='SetStatus', + msg = dict(type='CAASOperatorUpgrader', + request='UpgradeOperator', version=1, params=_params) - _params['entities'] = entities + _params['agent-tag'] = agent_tag + _params['version'] = version reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def UpdateStatus(self, entities=None): - ''' - entities : typing.Sequence[~EntityStatusArgs] +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)): @@ -11364,8 +4336,8 @@ async def UpdateStatus(self, entities=None): # map input types to rpc msg _params = dict() - msg = dict(type='Machiner', - request='UpdateStatus', + msg = dict(type='CharmDownloader', + request='DownloadApplicationCharms', version=1, params=_params) _params['entities'] = entities @@ -11374,151 +4346,277 @@ async def UpdateStatus(self, entities=None): - @ReturnMapping(NotifyWatchResults) - async def Watch(self, entities=None): + @ReturnMapping(StringsWatchResult) + async def WatchApplicationsWithPendingCharms(self): ''' - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + 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 ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='CharmDownloader', + request='WatchApplicationsWithPendingCharms', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def WatchAPIHostPorts(self): +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. - Returns -> NotifyWatchResult + 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))) - # map input types to rpc msg - _params = dict() - msg = dict(type='Machiner', - request='WatchAPIHostPorts', - version=1, - params=_params) + if channel is not None and not isinstance(channel, (bytes, str)): + raise Exception("Expected channel to be a str, received: {}".format(type(channel))) - reply = await self.rpc(msg) - return reply + 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))) -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'} - + 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))) - @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))) + 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='MeterStatus', - request='GetMeterStatus', + msg = dict(type='CharmHub', + request='Find', version=1, params=_params) - _params['entities'] = entities + _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(NotifyWatchResults) - async def WatchMeterStatus(self, entities=None): + @ReturnMapping(CharmHubEntityInfoResult) + async def Info(self, channel=None, tag=None): ''' - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + Info queries the CharmHub API with a given entity ID. + + channel : str + tag : str + Returns -> CharmHubEntityInfoResult ''' - 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 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='MeterStatus', - request='WatchMeterStatus', + msg = dict(type='CharmHub', + request='Info', version=1, params=_params) - _params['entities'] = entities + _params['channel'] = channel + _params['tag'] = tag reply = await self.rpc(msg) return reply -class MetricsManagerFacade(Type): - name = 'MetricsManager' +class CredentialManagerFacade(Type): + name = 'CredentialManager' 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, + schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, @@ -11529,127 +4627,59 @@ class MetricsManagerFacade(Type): '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'}}, + '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(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): + @ReturnMapping(ErrorResult) + async def InvalidateModelCredential(self, reason=None): ''' - SendMetrics will send any unsent metrics onto the metric collection service. + InvalidateModelCredential marks the cloud credential for this model as invalid. - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + reason : str + Returns -> ErrorResult ''' - 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 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='MetricsManager', - request='SendMetrics', + msg = dict(type='CredentialManager', + request='InvalidateModelCredential', version=1, params=_params) - _params['entities'] = entities + _params['reason'] = reason reply = await self.rpc(msg) return reply -class MigrationFlagFacade(Type): - name = 'MigrationFlag' +class CrossControllerFacade(Type): + name = 'CrossController' 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'}, + 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, @@ -11667,83 +4697,123 @@ class MigrationFlagFacade(Type): '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'}}, + '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(PhaseResults) - async def Phase(self, entities=None): + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerInfo(self): ''' - Phase returns the current migration phase or an error for every - supplied entity. + ControllerInfo returns the API info for the controller. - entities : typing.Sequence[~Entity] - Returns -> PhaseResults + + 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='MigrationFlag', - request='Phase', + msg = dict(type='CrossController', + request='ControllerInfo', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply @ReturnMapping(NotifyWatchResults) - async def Watch(self, entities=None): + async def WatchControllerInfo(self): ''' - Watch returns an id for use with the NotifyWatcher facade, or an - error, for every supplied entity. + WatchControllerInfo creates a watcher that notifies when the API info + for the controller 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='MigrationFlag', - request='Watch', + msg = dict(type='CrossController', + request='WatchControllerInfo', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply -class MigrationMasterFacade(Type): - name = 'MigrationMaster' +class DeployerFacade(Type): + name = 'Deployer' version = 1 - schema = {'definitions': {'Error': {'additionalProperties': False, + 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'}}, @@ -11751,173 +4821,153 @@ class MigrationMasterFacade(Type): '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'}, + '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'}, - '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'}}, + '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'}, - 'ModelInfo': {'properties': {'Result': {'$ref': '#/definitions/MigrationModelInfo'}}, + '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'}, - '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'}}, + '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(SerializedModel) - async def Export(self): + @ReturnMapping(StringsResult) + async def APIAddresses(self): ''' + APIAddresses returns the list of addresses used to connect to the API. + - Returns -> SerializedModel + Returns -> StringsResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='MigrationMaster', - request='Export', + msg = dict(type='Deployer', + request='APIAddresses', version=1, params=_params) @@ -11926,17 +4976,19 @@ async def Export(self): - @ReturnMapping(MasterMigrationStatus) - async def MigrationStatus(self): + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): ''' + APIHostPorts returns the API server addresses. - Returns -> MasterMigrationStatus + + Returns -> APIHostPortsResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='MigrationMaster', - request='MigrationStatus', + msg = dict(type='Deployer', + request='APIHostPorts', version=1, params=_params) @@ -11945,17 +4997,20 @@ async def MigrationStatus(self): - @ReturnMapping(MinionReports) - async def MinionReports(self): + @ReturnMapping(DeployerConnectionValues) + async def ConnectionInfo(self): ''' + ConnectionInfo returns all the address information that the + deployer task needs in one call. - Returns -> MinionReports + + Returns -> DeployerConnectionValues ''' # map input types to rpc msg _params = dict() - msg = dict(type='MigrationMaster', - request='MinionReports', + msg = dict(type='Deployer', + request='ConnectionInfo', version=1, params=_params) @@ -11964,36 +5019,45 @@ async def MinionReports(self): - @ReturnMapping(MigrationModelInfo) - async def ModelInfo(self): + @ReturnMapping(LifeResults) + async def Life(self, entities=None): ''' + Life returns the life status of every supplied entity, where available. - Returns -> MigrationModelInfo + 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='MigrationMaster', - request='ModelInfo', + msg = dict(type='Deployer', + request='Life', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Prechecks(self): + @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 -> None + + Returns -> StringResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='MigrationMaster', - request='Prechecks', + msg = dict(type='Deployer', + request='ModelUUID', version=1, params=_params) @@ -12002,78 +5066,89 @@ async def Prechecks(self): - @ReturnMapping(None) - async def Reap(self): + @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. - Returns -> 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='MigrationMaster', - request='Reap', + msg = dict(type='Deployer', + request='Remove', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def SetPhase(self, phase=None): + @ReturnMapping(ErrorResults) + async def SetPasswords(self, changes=None): ''' - phase : str - Returns -> None + SetPasswords sets the given password for each supplied entity, if possible. + + changes : typing.Sequence[~EntityPassword] + Returns -> ErrorResults ''' - if phase is not None and not isinstance(phase, (bytes, str)): - raise Exception("Expected phase to be a str, received: {}".format(type(phase))) + 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='MigrationMaster', - request='SetPhase', + msg = dict(type='Deployer', + request='SetPasswords', version=1, params=_params) - _params['phase'] = phase + _params['changes'] = changes reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def SetStatusMessage(self, message=None): + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): ''' - message : str - Returns -> None + SetStatus sets the status of the specified entities. + + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults ''' - if message is not None and not isinstance(message, (bytes, str)): - raise Exception("Expected message to be a str, received: {}".format(type(message))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='MigrationMaster', - request='SetStatusMessage', + msg = dict(type='Deployer', + request='SetStatus', version=1, params=_params) - _params['message'] = message + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(NotifyWatchResult) - async def Watch(self): + async def WatchAPIHostPorts(self): ''' + WatchAPIHostPorts watches the API server addresses. + Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='MigrationMaster', - request='Watch', + msg = dict(type='Deployer', + request='WatchAPIHostPorts', version=1, params=_params) @@ -12082,238 +5157,304 @@ async def Watch(self): - @ReturnMapping(NotifyWatchResult) - async def WatchMinionReports(self): + @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 EnvironUpgraderFacade(Type): + name = 'EnvironUpgrader' + 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. - Returns -> NotifyWatchResult + 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='MigrationMaster', - request='WatchMinionReports', + msg = dict(type='EnvironUpgrader', + request='ModelEnvironVersion', version=1, params=_params) - + _params['entities'] = entities 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): + @ReturnMapping(IntResults) + async def ModelTargetEnvironVersion(self, entities=None): ''' - Report allows a migration minion to submit whether it succeeded or - failed for a specific migration phase. + ModelTargetEnvironVersion returns the target version of the environ + corresponding to each specified model. The target version is the + environ provider's version. - migration_id : str - phase : str - success : bool - Returns -> None + entities : typing.Sequence[~Entity] + Returns -> IntResults ''' - 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))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='MigrationMinion', - request='Report', + msg = dict(type='EnvironUpgrader', + request='ModelTargetEnvironVersion', version=1, params=_params) - _params['migration-id'] = migration_id - _params['phase'] = phase - _params['success'] = success + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def Watch(self): + @ReturnMapping(ErrorResults) + async def SetModelEnvironVersion(self, models=None): ''' - 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. - + SetModelEnvironVersion sets the current version of the environ corresponding + to each specified model. - Returns -> NotifyWatchResult + 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='MigrationMinion', - request='Watch', + msg = dict(type='EnvironUpgrader', + request='SetModelEnvironVersion', version=1, params=_params) - + _params['models'] = models 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): + @ReturnMapping(ErrorResults) + async def SetModelStatus(self, entities=None): ''' - Next returns when the status for a model migration for the - associated model changes. The current details for the active - migration are returned. - + SetModelStatus sets the status of each given model. - Returns -> MigrationStatus + 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='MigrationStatusWatcher', - request='Next', + msg = dict(type='EnvironUpgrader', + request='SetModelStatus', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Stop(self): + @ReturnMapping(NotifyWatchResults) + async def WatchModelEnvironVersion(self, entities=None): ''' - Stop stops the watcher. + 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. - Returns -> 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='MigrationStatusWatcher', - request='Stop', + msg = dict(type='EnvironUpgrader', + request='WatchModelEnvironVersion', version=1, params=_params) - + _params['entities'] = entities 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'}, + 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, @@ -12330,275 +5471,214 @@ class MigrationTargetFacade(Type): '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'], + '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'}, - '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'}}, + '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(None) - async def Abort(self, model_tag=None): + @ReturnMapping(ExternalControllerInfoResults) + async def ExternalControllerInfo(self, entities=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. + ExternalControllerInfo returns the info for the specified external controllers. - model_tag : str - Returns -> None + entities : typing.Sequence[~Entity] + Returns -> ExternalControllerInfoResults ''' - 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 entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='MigrationTarget', - request='Abort', + msg = dict(type='ExternalControllerUpdater', + request='ExternalControllerInfo', version=1, params=_params) - _params['model-tag'] = model_tag + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Activate(self, model_tag=None): + @ReturnMapping(ErrorResults) + async def SetExternalControllerInfo(self, controllers=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. + SetExternalControllerInfo saves the info for the specified external controllers. - model_tag : str - Returns -> None + controllers : typing.Sequence[~SetExternalControllerInfoParams] + 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))) + 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='MigrationTarget', - request='Activate', + msg = dict(type='ExternalControllerUpdater', + request='SetExternalControllerInfo', version=1, params=_params) - _params['model-tag'] = model_tag + _params['controllers'] = controllers reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def AdoptResources(self, model_tag=None, source_controller_version=None): + @ReturnMapping(StringsWatchResults) + async def WatchExternalControllers(self): ''' - 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. + WatchExternalControllers watches for the addition and removal of external + controller records to the local controller's database. - 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))) + Returns -> StringsWatchResults + ''' # map input types to rpc msg _params = dict() - msg = dict(type='MigrationTarget', - request='AdoptResources', + msg = dict(type='ExternalControllerUpdater', + request='WatchExternalControllers', 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): +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): ''' - CACert returns the certificate used to validate the state connection. + FanConfig returns current FAN configuration. - Returns -> BytesResult + Returns -> FanConfigResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='MigrationTarget', - request='CACert', + msg = dict(type='FanConfigurer', + request='FanConfig', version=1, params=_params) @@ -12607,346 +5687,380 @@ async def CACert(self): - @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 + @ReturnMapping(NotifyWatchResult) + async def WatchForFanConfigChanges(self): ''' - 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 - - + 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. - @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 + Returns -> NotifyWatchResult ''' - 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', + msg = dict(type='FanConfigurer', + request='WatchForFanConfigChanges', 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. +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'} + - 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. + @ReturnMapping(ListFirewallRulesResults) + async def ListFirewallRules(self): + ''' + ListFirewallRules returns all the firewall rules. - Returns the zero time if no logs have been transferred. - model_tag : str - Returns -> str + Returns -> ListFirewallRulesResults ''' - 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', + msg = dict(type='FirewallRules', + request='ListFirewallRules', 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): + @ReturnMapping(ErrorResults) + async def SetFirewallRules(self, args=None): ''' - Prechecks ensure that the target controller is ready to accept a - model migration. + SetFirewallRules creates or updates the specified firewall rules. - agent_version : Number - controller_agent_version : Number - name : str - owner_tag : str - uuid : str - Returns -> None + args : typing.Sequence[~FirewallRule] + Returns -> ErrorResults ''' - 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))) + 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='MigrationTarget', - request='Prechecks', + msg = dict(type='FirewallRules', + request='SetFirewallRules', 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 + _params['args'] = args reply = await self.rpc(msg) return reply -class ModelConfigFacade(Type): - name = 'ModelConfig' +class HostKeyReporterFacade(Type): + name = 'HostKeyReporter' version = 1 - schema = {'definitions': {'ConfigValue': {'additionalProperties': False, - 'properties': {'source': {'type': 'string'}, - 'value': {'additionalProperties': True, - 'type': 'object'}}, - 'required': ['value', 'source'], - 'type': 'object'}, - 'Error': {'additionalProperties': False, + schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, - 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, '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'], + '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'}, - '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'}}, + '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(ModelConfigResults) - async def ModelGet(self): + @ReturnMapping(ErrorResults) + async def ReportKeys(self, entity_keys=None): ''' + ReportKeys sets the SSH host keys for one or more entities. - Returns -> ModelConfigResults + 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='ModelConfig', - request='ModelGet', + msg = dict(type='HostKeyReporter', + request='ReportKeys', version=1, params=_params) - + _params['entity-keys'] = entity_keys reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def ModelSet(self, config=None): +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): ''' - config : typing.Mapping[str, typing.Any] - Returns -> None + Delete deletes cloud image metadata for given image ids. + It supports bulk calls. + + image_ids : typing.Sequence[str] + Returns -> ErrorResults ''' - if config is not None and not isinstance(config, dict): - raise Exception("Expected config to be a Mapping, received: {}".format(type(config))) + 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='ModelConfig', - request='ModelSet', + msg = dict(type='ImageMetadataManager', + request='Delete', version=1, params=_params) - _params['config'] = config + _params['image-ids'] = image_ids reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def ModelUnset(self, keys=None): + @ReturnMapping(ListCloudImageMetadataResult) + async def List(self, arches=None, region=None, root_storage_type=None, series=None, stream=None, virt_type=None): ''' - keys : typing.Sequence[str] - Returns -> 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 keys is not None and not isinstance(keys, (bytes, str, list)): - raise Exception("Expected keys to be a Sequence, received: {}".format(type(keys))) + if arches is not None and not isinstance(arches, (bytes, str, list)): + raise Exception("Expected arches to be a Sequence, received: {}".format(type(arches))) - # 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 + 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))) - @ReturnMapping(StringResult) - async def SLALevel(self): - ''' + if stream is not None and not isinstance(stream, (bytes, str)): + raise Exception("Expected stream to be a str, received: {}".format(type(stream))) - Returns -> StringResult - ''' + 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='ModelConfig', - request='SLALevel', + 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(None) - async def SetSLALevel(self, modelslainfo=None, creds=None): - ''' - modelslainfo : ModelSLAInfo - creds : typing.Sequence[int] - Returns -> None + @ReturnMapping(ErrorResults) + async def Save(self, metadata=None): ''' - if modelslainfo is not None and not isinstance(modelslainfo, (dict, ModelSLAInfo)): - raise Exception("Expected modelslainfo to be a ModelSLAInfo, received: {}".format(type(modelslainfo))) + Save stores given cloud image metadata. + It supports bulk calls. - if creds is not None and not isinstance(creds, (bytes, str, list)): - raise Exception("Expected creds to be a Sequence, received: {}".format(type(creds))) + 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='ModelConfig', - request='SetSLALevel', + msg = dict(type='ImageMetadataManager', + request='Save', version=1, params=_params) - _params['ModelSLAInfo'] = modelslainfo - _params['creds'] = creds + _params['metadata'] = metadata reply = await self.rpc(msg) return reply -class ModelGenerationFacade(Type): - name = 'ModelGeneration' +class KeyManagerFacade(Type): + name = 'KeyManager' 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'}, + 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'], @@ -12967,478 +6081,395 @@ class ModelGenerationFacade(Type): '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'], + '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'}, - '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'}}, + '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'}, - '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'}}, + '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(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 + @ReturnMapping(ErrorResults) + async def AddKeys(self, ssh_keys=None, user=None): ''' - 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 - - + AddKeys adds new authorised ssh keys for the specified user. - @ReturnMapping(IntResult) - async def CommitBranch(self, branch=None): - ''' - branch : str - Returns -> IntResult + ssh_keys : typing.Sequence[str] + user : str + 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))) - - # 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 - - + 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))) - @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))) + 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='ModelGeneration', - request='HasActiveBranch', + msg = dict(type='KeyManager', + request='AddKeys', version=1, params=_params) - _params['branch'] = branch + _params['ssh-keys'] = ssh_keys + _params['user'] = user reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def TrackBranch(self, branch=None, entities=None): + async def DeleteKeys(self, ssh_keys=None, user=None): ''' - branch : str - entities : typing.Sequence[~Entity] + DeleteKeys deletes the authorised ssh keys for the specified user. + + ssh_keys : typing.Sequence[str] + user : str 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 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 entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + 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='ModelGeneration', - request='TrackBranch', + msg = dict(type='KeyManager', + request='DeleteKeys', version=1, params=_params) - _params['branch'] = branch - _params['entities'] = entities + _params['ssh-keys'] = ssh_keys + _params['user'] = user 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): + @ReturnMapping(ErrorResults) + async def ImportKeys(self, ssh_keys=None, user=None): ''' - Next will return the current state of everything on the first call - and subsequent calls will return just those model summaries that have - changed. - + ImportKeys imports new authorised ssh keys from the specified key ids for the specified user. - Returns -> SummaryWatcherNextResults + 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='ModelSummaryWatcher', - request='Next', + 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(None) - async def Stop(self): + @ReturnMapping(StringsResults) + async def ListKeys(self, entities=None, mode=None): ''' - Stop stops the watcher. - + ListKeys returns the authorised ssh keys for the specified users. - Returns -> None + 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='ModelSummaryWatcher', - request='Stop', + msg = dict(type='KeyManager', + request='ListKeys', version=1, params=_params) - + _params['entities'] = entities + _params['mode'] = mode 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' +class KeyUpdaterFacade(Type): + name = 'KeyUpdater' version = 1 - 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'], + 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'}, - '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'}, - 'UpgradeModel': {'description': 'UpgradeModel upgrades a ' - 'model.', - 'properties': {'Params': {'$ref': '#/definitions/UpgradeModel'}}, - '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(None) - async def AbortModelUpgrade(self, model_tag=None): + @ReturnMapping(StringsResults) + async def AuthorisedKeys(self, entities=None): ''' - AbortModelUpgrade aborts and archives the model upgrade - synchronisation record, if any. + 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. - model_tag : str - Returns -> None + entities : typing.Sequence[~Entity] + Returns -> StringsResults ''' - 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 entities is not None and not isinstance(entities, (bytes, str, 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='AbortModelUpgrade', + msg = dict(type='KeyUpdater', + request='AuthorisedKeys', version=1, params=_params) - _params['model-tag'] = model_tag + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def UpgradeModel(self, agent_stream=None, dry_run=None, ignore_agent_versions=None, model_tag=None, to_version=None): + @ReturnMapping(NotifyWatchResults) + async def WatchAuthorisedKeys(self, entities=None): ''' - UpgradeModel upgrades a model. + 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. - agent_stream : str - dry_run : bool - ignore_agent_versions : bool - model_tag : str - to_version : Number - Returns -> None + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' - 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))) + if entities is not None and not isinstance(entities, (bytes, str, 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='UpgradeModel', + msg = dict(type='KeyUpdater', + request='WatchAuthorisedKeys', version=1, params=_params) - _params['agent-stream'] = agent_stream - _params['dry-run'] = dry_run - _params['ignore-agent-versions'] = ignore_agent_versions - _params['model-tag'] = model_tag - _params['to-version'] = to_version + _params['entities'] = entities reply = await self.rpc(msg) return reply -class NotifyWatcherFacade(Type): - name = 'NotifyWatcher' +class LifeFlagFacade(Type): + name = 'LifeFlag' 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.', + 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'}, - 'Stop': {'description': 'Stop stops the watcher.', - '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(None) - async def Next(self): + @ReturnMapping(LifeResults) + async def Life(self, entities=None): ''' - 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. - + Life returns the life status of every supplied entity, where available. - Returns -> 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='NotifyWatcher', - request='Next', + msg = dict(type='LifeFlag', + request='Life', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Stop(self): + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): ''' - Stop stops the watcher. - + Watch starts an NotifyWatcher for each given entity. - Returns -> 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='NotifyWatcher', - request='Stop', + msg = dict(type='LifeFlag', + request='Watch', version=1, params=_params) - + _params['entities'] = entities 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' +class LogForwardingFacade(Type): + name = 'LogForwarding' 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, + schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, @@ -13446,160 +6477,303 @@ class OfferStatusWatcherFacade(Type): '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'}}, + '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(OfferStatusWatchResult) - async def Next(self): + @ReturnMapping(LogForwardingGetLastSentResults) + async def GetLastSent(self, ids=None): ''' - 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. - + GetLastSent is a bulk call that gets the log forwarding "last sent" + record ID for each requested target. - Returns -> OfferStatusWatchResult + 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='OfferStatusWatcher', - request='Next', + msg = dict(type='LogForwarding', + request='GetLastSent', version=1, params=_params) - + _params['ids'] = ids reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Stop(self): + @ReturnMapping(ErrorResults) + async def SetLastSent(self, params=None): ''' - Stop stops the watcher. + 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. - Returns -> 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='OfferStatusWatcher', - request='Stop', + msg = dict(type='Logger', + request='LoggingConfig', version=1, params=_params) - + _params['entities'] = entities 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): + @ReturnMapping(NotifyWatchResults) + async def WatchLoggingConfig(self, entities=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. + 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. - patterns : typing.Sequence[str] - Returns -> PayloadListResults + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' - if patterns is not None and not isinstance(patterns, (bytes, str, list)): - raise Exception("Expected patterns to be a Sequence, received: {}".format(type(patterns))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Payloads', - request='List', + msg = dict(type='Logger', + request='WatchLoggingConfig', version=1, params=_params) - _params['patterns'] = patterns + _params['entities'] = entities reply = await self.rpc(msg) return reply -class PayloadsHookContextFacade(Type): - name = 'PayloadsHookContext' +class MachineActionsFacade(Type): + name = 'MachineActions' version = 1 - schema = {'definitions': {'Entities': {'additionalProperties': False, + 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'}, + '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'], @@ -13610,122 +6784,92 @@ class PayloadsHookContextFacade(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'}, - '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.', + '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/PayloadResults'}}, - 'type': 'object'}}, + '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(PayloadResults) - async def List(self, entities=None): + @ReturnMapping(ActionResults) + async def Actions(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. + 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 -> PayloadResults + 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='PayloadsHookContext', - request='List', + msg = dict(type='MachineActions', + request='Actions', version=1, params=_params) _params['entities'] = entities @@ -13734,90 +6878,69 @@ async def List(self, entities=None): - @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): + @ReturnMapping(ErrorResults) + async def BeginActions(self, entities=None): ''' - SetStatus sets the raw status of a payload. + BeginActions marks the actions represented by the passed in Tags as running. - args : typing.Sequence[~SetPayloadStatusArg] - Returns -> PayloadResults + entities : typing.Sequence[~Entity] + Returns -> ErrorResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='PayloadsHookContext', - request='SetStatus', + msg = dict(type='MachineActions', + request='BeginActions', version=1, params=_params) - _params['args'] = args + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(PayloadResults) - async def Track(self, payloads=None): + @ReturnMapping(ErrorResults) + async def FinishActions(self, results=None): ''' - Track stores a payload to be tracked in state. + FinishActions saves the result of a completed Action - payloads : typing.Sequence[~Payload] - Returns -> PayloadResults + results : typing.Sequence[~ActionExecutionResult] + Returns -> ErrorResults ''' - if payloads is not None and not isinstance(payloads, (bytes, str, list)): - raise Exception("Expected payloads to be a Sequence, received: {}".format(type(payloads))) + if 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='PayloadsHookContext', - request='Track', + msg = dict(type='MachineActions', + request='FinishActions', version=1, params=_params) - _params['payloads'] = payloads + _params['results'] = results reply = await self.rpc(msg) return reply - @ReturnMapping(PayloadResults) - async def Untrack(self, entities=None): + @ReturnMapping(ActionsByReceivers) + async def RunningActions(self, entities=None): ''' - Untrack marks the identified payload as no longer being tracked. + 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 -> PayloadResults + 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='PayloadsHookContext', - request='Untrack', + msg = dict(type='MachineActions', + request='RunningActions', version=1, params=_params) _params['entities'] = entities @@ -13826,74 +6949,61 @@ async def Untrack(self, entities=None): -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): + @ReturnMapping(StringsWatchResults) + async def WatchActionNotifications(self, entities=None): ''' + WatchActionNotifications returns a StringsWatcher for observing + incoming action calls to a machine. - Returns -> 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='Pinger', - request='Stop', + msg = dict(type='MachineActions', + request='WatchActionNotifications', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply -class ProxyUpdaterFacade(Type): - name = 'ProxyUpdater' +class MachineUndertakerFacade(Type): + name = 'MachineUndertaker' version = 1 schema = {'definitions': {'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, + 'EntitiesResult': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, + 'type': 'array'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['entities'], + 'type': 'object'}, + 'EntitiesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/EntitiesResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, - 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, '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'}}, @@ -13904,50 +7014,92 @@ class ProxyUpdaterFacade(Type): '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'], + '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'}, - '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'}}, + '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(ProxyConfigResults) - async def ProxyConfig(self, entities=None): + @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 -> ProxyConfigResults + 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='ProxyUpdater', - request='ProxyConfig', + msg = dict(type='MachineUndertaker', + request='AllMachineRemovals', version=1, params=_params) _params['entities'] = entities @@ -13956,19 +7108,23 @@ async def ProxyConfig(self, entities=None): - @ReturnMapping(NotifyWatchResults) - async def WatchForProxyConfigAndAPIHostPortChanges(self, entities=None): + @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 -> NotifyWatchResults + 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='ProxyUpdater', - request='WatchForProxyConfigAndAPIHostPortChanges', + msg = dict(type='MachineUndertaker', + request='CompleteMachineRemovals', version=1, params=_params) _params['entities'] = entities @@ -13977,191 +7133,67 @@ async def WatchForProxyConfigAndAPIHostPortChanges(self, entities=None): -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): + @ReturnMapping(ProviderInterfaceInfoResults) + async def GetMachineProviderInterfaceInfo(self, entities=None): ''' - 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. - + GetMachineProviderInterfaceInfo returns the provider details for + all network interfaces attached to the machines requested. - Returns -> RelationLifeSuspendedStatusWatchResult + 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='RelationStatusWatcher', - request='Next', + msg = dict(type='MachineUndertaker', + request='GetMachineProviderInterfaceInfo', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Stop(self): + @ReturnMapping(NotifyWatchResults) + async def WatchMachineRemovals(self, entities=None): ''' - Stop stops the watcher. - + WatchMachineRemovals returns a watcher that will signal each time a + machine is marked for removal. - Returns -> 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='RelationStatusWatcher', - request='Stop', + msg = dict(type='MachineUndertaker', + request='WatchMachineRemovals', version=1, params=_params) - + _params['entities'] = entities 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' +class MetricsManagerFacade(Type): + name = 'MetricsManager' version = 1 - schema = {'definitions': {'Error': {'additionalProperties': False, + 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'}}, @@ -14169,54 +7201,61 @@ class RelationUnitsWatcherFacade(Type): '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'], + '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': {'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'}}, + '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(RelationUnitsWatchResult) - async def Next(self): + @ReturnMapping(None) + async def AddJujuMachineMetrics(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. + AddJujuMachineMetrics adds a metric that counts the number of + non-container machines in the current model. - Returns -> RelationUnitsWatchResult + Returns -> None ''' # map input types to rpc msg _params = dict() - msg = dict(type='RelationUnitsWatcher', - request='Next', + msg = dict(type='MetricsManager', + request='AddJujuMachineMetrics', version=1, params=_params) @@ -14225,158 +7264,159 @@ async def Next(self): - @ReturnMapping(None) - async def Stop(self): + @ReturnMapping(ErrorResults) + async def CleanupOldMetrics(self, entities=None): ''' - Stop stops the watcher. - + 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. - Returns -> 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='RelationUnitsWatcher', - request='Stop', + msg = dict(type='MetricsManager', + request='CleanupOldMetrics', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - async def rpc(self, msg): + @ReturnMapping(ErrorResults) + async def SendMetrics(self, entities=None): ''' - Patch rpc method to add Id. + SendMetrics will send any unsent metrics onto the metric collection service. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults ''' - if not hasattr(self, 'Id'): - raise RuntimeError('Missing "Id" field') - msg['Id'] = id + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) - from .facade import TypeEncoder - reply = await self.connection.rpc(msg, encoder=TypeEncoder) + # 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 RemoteApplicationWatcherFacade(Type): - name = 'RemoteApplicationWatcher' +class MigrationFlagFacade(Type): + name = 'MigrationFlag' version = 1 - schema = {'definitions': {'Error': {'additionalProperties': False, + 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'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, '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'}}, + '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(RemoteApplicationWatchResult) - async def Next(self): + @ReturnMapping(PhaseResults) + async def Phase(self, entities=None): ''' + Phase returns the current migration phase or an error for every + supplied entity. - Returns -> RemoteApplicationWatchResult + 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='RemoteApplicationWatcher', - request='Next', + msg = dict(type='MigrationFlag', + request='Phase', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Stop(self): + @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. - Returns -> 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='RemoteApplicationWatcher', - request='Stop', + msg = dict(type='MigrationFlag', + request='Watch', version=1, params=_params) - + _params['entities'] = entities 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' +class MigrationMinionFacade(Type): + name = 'MigrationMinion' version = 1 schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, @@ -14386,83 +7426,95 @@ class RemoteRelationWatcherFacade(Type): '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', - 'unit-count'], - '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'}}, + '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(RemoteRelationWatchResult) - async def Next(self): + @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. - Returns -> RemoteRelationWatchResult + 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='RemoteRelationWatcher', - request='Next', + 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(None) - async def Stop(self): + @ReturnMapping(NotifyWatchResult) + async def Watch(self): ''' - Stop stops the watcher. + 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 -> None + Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='RemoteRelationWatcher', - request='Stop', + msg = dict(type='MigrationMinion', + request='Watch', version=1, params=_params) @@ -14471,605 +7523,635 @@ async def Stop(self): - async def rpc(self, msg): +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): ''' - Patch rpc method to add Id. + 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 ''' - 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 + # 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 -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'], + + @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'}, - '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'}}, + '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'}, - 'TokenResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/TokenResult'}, + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, 'type': 'array'}}, + 'required': ['results'], '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'}}, + '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'}, - 'ExportEntities': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/TokenResults'}}, + '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'}, - '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'}, + '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'}, - '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'}}, + '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(ErrorResults) - async def ConsumeRemoteRelationChanges(self, changes=None): + @ReturnMapping(None) + async def Abort(self, model_tag=None): ''' - changes : typing.Sequence[~RemoteRelationChangeEvent] - Returns -> ErrorResults + 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 changes is not None and not isinstance(changes, (bytes, str, list)): - raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + 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='RemoteRelations', - request='ConsumeRemoteRelationChanges', + msg = dict(type='MigrationTarget', + request='Abort', version=1, params=_params) - _params['changes'] = changes + _params['model-tag'] = model_tag reply = await self.rpc(msg) return reply - @ReturnMapping(ControllerAPIInfoResults) - async def ControllerAPIInfoForModels(self, entities=None): + @ReturnMapping(None) + async def Activate(self, model_tag=None): ''' - entities : typing.Sequence[~Entity] - Returns -> ControllerAPIInfoResults + 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 entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + 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='RemoteRelations', - request='ControllerAPIInfoForModels', + msg = dict(type='MigrationTarget', + request='Activate', version=1, params=_params) - _params['entities'] = entities + _params['model-tag'] = model_tag reply = await self.rpc(msg) return reply - @ReturnMapping(ControllerConfigResult) - async def ControllerConfig(self): + @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. - Returns -> ControllerConfigResult + 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='RemoteRelations', - request='ControllerConfig', + 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(TokenResults) - async def ExportEntities(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> TokenResults + @ReturnMapping(BytesResult) + async def CACert(self): ''' - if entities is not None and not isinstance(entities, (bytes, str, 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 - + CACert returns the certificate used to validate the state connection. - @ReturnMapping(StringResults) - async def GetTokens(self, args=None): - ''' - args : typing.Sequence[~GetTokenArg] - Returns -> StringResults + Returns -> BytesResult ''' - 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', + msg = dict(type='MigrationTarget', + request='CACert', version=1, params=_params) - _params['Args'] = args + reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def ImportRemoteEntities(self, args=None): + async def CheckMachines(self, model_tag=None): ''' - args : typing.Sequence[~RemoteEntityTokenArg] + CheckMachines compares the machines in state with the ones reported + by the provider and reports any discrepancies. + + model_tag : str Returns -> ErrorResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if 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='RemoteRelations', - request='ImportRemoteEntities', + msg = dict(type='MigrationTarget', + request='CheckMachines', version=1, params=_params) - _params['Args'] = args + _params['model-tag'] = model_tag reply = await self.rpc(msg) return reply - @ReturnMapping(SettingsResults) - async def RelationUnitSettings(self, relation_units=None): + @ReturnMapping(None) + async def Import(self, bytes_=None, charms=None, resources=None, tools=None): ''' - relation_units : typing.Sequence[~RelationUnit] - Returns -> SettingsResults + 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 relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + if 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='RemoteRelations', - request='RelationUnitSettings', + msg = dict(type='MigrationTarget', + request='Import', version=1, params=_params) - _params['relation-units'] = relation_units + _params['bytes'] = bytes_ + _params['charms'] = charms + _params['resources'] = resources + _params['tools'] = tools reply = await self.rpc(msg) return reply - @ReturnMapping(RemoteRelationResults) - async def Relations(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> RemoteRelationResults + @ReturnMapping(str) + async def LatestLogTime(self, model_tag=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))) + 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. - # 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 + 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. - @ReturnMapping(RemoteApplicationResults) - async def RemoteApplications(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> RemoteApplicationResults + model_tag : str + Returns -> str ''' - 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 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='RemoteRelations', - request='RemoteApplications', + msg = dict(type='MigrationTarget', + request='LatestLogTime', version=1, params=_params) - _params['entities'] = entities + _params['model-tag'] = model_tag reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SaveMacaroons(self, args=None): + @ReturnMapping(None) + async def Prechecks(self, agent_version=None, controller_agent_version=None, name=None, owner_tag=None, uuid=None): ''' - args : typing.Sequence[~EntityMacaroonArg] - Returns -> ErrorResults + 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 args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + 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))) - # 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 + 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))) - @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))) + 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='RemoteRelations', - request='SetRemoteApplicationsStatus', + msg = dict(type='MigrationTarget', + request='Prechecks', version=1, params=_params) - _params['entities'] = entities + _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 - @ReturnMapping(RelationUnitsWatchResults) - async def WatchLocalRelationUnits(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> RelationUnitsWatchResults +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): ''' - if entities is not None and not isinstance(entities, (bytes, str, 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 - + Next will return the current state of everything on the first call + and subsequent calls will return just those model summaries that have + changed. - @ReturnMapping(StringsWatchResults) - async def WatchRemoteApplicationRelations(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + Returns -> SummaryWatcherNextResults ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='ModelSummaryWatcher', + request='Next', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResult) - async def WatchRemoteApplications(self): + @ReturnMapping(None) + async def Stop(self): ''' + Stop stops the watcher. - Returns -> StringsWatchResult + + Returns -> None ''' # map input types to rpc msg _params = dict() - msg = dict(type='RemoteRelations', - request='WatchRemoteApplications', + msg = dict(type='ModelSummaryWatcher', + request='Stop', version=1, params=_params) @@ -15078,511 +8160,229 @@ async def WatchRemoteApplications(self): - @ReturnMapping(StringsWatchResult) - async def WatchRemoteRelations(self): + async def rpc(self, msg): ''' - - Returns -> StringsWatchResult + Patch rpc method to add Id. ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id - # map input types to rpc msg - _params = dict() - msg = dict(type='RemoteRelations', - request='WatchRemoteRelations', - version=1, - params=_params) - - reply = await self.rpc(msg) + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply -class RemoteRelationsWatcherFacade(Type): - name = 'RemoteRelationsWatcher' +class ModelUpgraderFacade(Type): + name = 'ModelUpgrader' version = 1 schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, - 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, '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'}}, + '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'}, + 'UpgradeModelParams': {'additionalProperties': False, + 'properties': {'agent-stream': {'type': 'string'}, + 'dry-run': {'type': 'boolean'}, + 'ignore-agent-versions': {'type': 'boolean'}, + 'model-tag': {'type': 'string'}, + 'target-version': {'$ref': '#/definitions/Number'}}, + 'required': ['model-tag', + 'target-version'], + 'type': 'object'}, + 'UpgradeModelResult': {'additionalProperties': False, + 'properties': {'chosen-version': {'$ref': '#/definitions/Number'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['chosen-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'}, + 'UpgradeModel': {'description': 'UpgradeModel upgrades a ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/UpgradeModelParams'}, + 'Result': {'$ref': '#/definitions/UpgradeModelResult'}}, + 'type': 'object'}}, 'type': 'object'} - @ReturnMapping(RemoteRelationsWatchResult) - async def Next(self): + @ReturnMapping(None) + async def AbortModelUpgrade(self, model_tag=None): ''' + AbortModelUpgrade aborts and archives the model upgrade + synchronisation record, if any. - Returns -> RemoteRelationsWatchResult + 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='RemoteRelationsWatcher', - request='Next', + msg = dict(type='ModelUpgrader', + request='AbortModelUpgrade', version=1, params=_params) - + _params['model-tag'] = model_tag reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Stop(self): + @ReturnMapping(UpgradeModelResult) + async def UpgradeModel(self, agent_stream=None, dry_run=None, ignore_agent_versions=None, model_tag=None, target_version=None): ''' + UpgradeModel upgrades a model. - Returns -> None + agent_stream : str + dry_run : bool + ignore_agent_versions : bool + model_tag : str + target_version : Number + Returns -> UpgradeModelResult ''' + if agent_stream is not None and not isinstance(agent_stream, (bytes, str)): + raise Exception("Expected agent_stream to be a str, received: {}".format(type(agent_stream))) + + if dry_run is not None and not isinstance(dry_run, bool): + raise Exception("Expected dry_run to be a bool, received: {}".format(type(dry_run))) + + if ignore_agent_versions is not None and not isinstance(ignore_agent_versions, bool): + raise Exception("Expected ignore_agent_versions to be a bool, received: {}".format(type(ignore_agent_versions))) + + if model_tag is not None and not isinstance(model_tag, (bytes, str)): + raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) + + if target_version is not None and not isinstance(target_version, (dict, Number)): + raise Exception("Expected target_version to be a Number, received: {}".format(type(target_version))) # map input types to rpc msg _params = dict() - msg = dict(type='RemoteRelationsWatcher', - request='Stop', + msg = dict(type='ModelUpgrader', + request='UpgradeModel', version=1, params=_params) - + _params['agent-stream'] = agent_stream + _params['dry-run'] = dry_run + _params['ignore-agent-versions'] = ignore_agent_versions + _params['model-tag'] = model_tag + _params['target-version'] = target_version reply = 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' +class NotifyWatcherFacade(Type): + name = 'NotifyWatcher' 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'}}, + 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(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 + @ReturnMapping(None) + async def Next(self): ''' - 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))) + 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. - 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))) + Returns -> None + ''' # map input types to rpc msg _params = dict() - msg = dict(type='Resources', - request='AddPendingResources', + msg = dict(type='NotifyWatcher', + request='Next', 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): + @ReturnMapping(None) + async def Stop(self): ''' - ListResources returns the list of resources for the given application. + Stop stops the watcher. - entities : typing.Sequence[~Entity] - Returns -> ResourcesResults + + 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='Resources', - request='ListResources', + msg = dict(type='NotifyWatcher', + request='Stop', 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): + async def rpc(self, msg): ''' - 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 + Patch rpc method to add Id. ''' - 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))) + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id - # 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) + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply -class RetryStrategyFacade(Type): - name = 'RetryStrategy' +class OfferStatusWatcherFacade(Type): + name = 'OfferStatusWatcher' 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'}, + 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, @@ -15591,111 +8391,158 @@ class RetryStrategyFacade(Type): 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, - 'NotifyWatchResult': {'additionalProperties': False, - 'properties': {'NotifyWatcherId': {'type': 'string'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['NotifyWatcherId'], + 'OfferStatusChange': {'additionalProperties': False, + 'properties': {'offer-name': {'type': 'string'}, + 'status': {'$ref': '#/definitions/EntityStatus'}}, + 'required': ['offer-name', 'status'], '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'}}, + '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(RetryStrategyResults) - async def RetryStrategy(self, entities=None): + @ReturnMapping(OfferStatusWatchResult) + async def Next(self): ''' - RetryStrategy returns RetryStrategyResults that can be used by any code that uses - to configure the retry timer that's currently in juju utils. + 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. - entities : typing.Sequence[~Entity] - Returns -> RetryStrategyResults + + Returns -> OfferStatusWatchResult ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='OfferStatusWatcher', + request='Next', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchRetryStrategy(self, entities=None): + @ReturnMapping(None) + async def Stop(self): ''' - WatchRetryStrategy watches for changes to the model. Currently we only allow - changes to the boolean that determines whether retries should be attempted or not. + Stop stops the watcher. - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + + 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='RetryStrategy', - request='WatchRetryStrategy', + msg = dict(type='OfferStatusWatcher', + request='Stop', version=1, params=_params) - _params['entities'] = entities + + 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 SSHClientFacade(Type): - name = 'SSHClient' +class PayloadsHookContextFacade(Type): + name = 'PayloadsHookContext' version = 1 schema = {'definitions': {'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, @@ -15708,65 +8555,122 @@ class SSHClientFacade(Type): 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, - 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, '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'}}, + 'LookUpPayloadArg': {'additionalProperties': False, + 'properties': {'id': {'type': 'string'}, + 'name': {'type': 'string'}}, + 'required': ['name', 'id'], 'type': 'object'}, - 'SSHAddressResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressResult'}, - 'type': 'array'}}, - 'required': ['results'], + 'LookUpPayloadArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/LookUpPayloadArg'}, + 'type': 'array'}}, + 'required': ['args'], 'type': 'object'}, - 'SSHProxyResult': {'additionalProperties': False, - 'properties': {'use-proxy': {'type': 'boolean'}}, - 'required': ['use-proxy'], + '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'}, - 'SSHPublicKeysResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'public-keys': {'items': {'type': 'string'}, - 'type': 'array'}}, + 'SetPayloadStatusArg': {'additionalProperties': False, + 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, + 'status': {'type': 'string'}, + 'tag': {'type': 'string'}}, + 'required': ['tag', + 'Entity', + 'status'], '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'}}, + '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'}, - 'PublicAddress': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/SSHAddressResults'}}, - 'type': 'object'}, - 'PublicKeys': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/SSHPublicKeysResults'}}, - '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(SSHAddressResults) - async def PrivateAddress(self, entities=None): + @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 -> SSHAddressResults + 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='SSHClient', - request='PrivateAddress', + msg = dict(type='PayloadsHookContext', + request='List', version=1, params=_params) _params['entities'] = entities @@ -15775,440 +8679,347 @@ async def PrivateAddress(self, entities=None): - @ReturnMapping(SSHProxyResult) - async def Proxy(self): - ''' - - Returns -> SSHProxyResult + @ReturnMapping(PayloadResults) + async def LookUp(self, args=None): ''' + LookUp identifies the payload with the provided name and raw ID. - # 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 + args : typing.Sequence[~LookUpPayloadArg] + 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))) + 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='SSHClient', - request='PublicAddress', + msg = dict(type='PayloadsHookContext', + request='LookUp', version=1, params=_params) - _params['entities'] = entities + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(SSHPublicKeysResults) - async def PublicKeys(self, entities=None): + @ReturnMapping(PayloadResults) + async def SetStatus(self, args=None): ''' - entities : typing.Sequence[~Entity] - Returns -> SSHPublicKeysResults + SetStatus sets the raw status of a payload. + + args : typing.Sequence[~SetPayloadStatusArg] + 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))) + 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='SSHClient', - request='PublicKeys', + msg = dict(type='PayloadsHookContext', + request='SetStatus', version=1, params=_params) - _params['entities'] = entities + _params['args'] = args 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): + @ReturnMapping(PayloadResults) + async def Track(self, payloads=None): ''' - ListSecrets lists available secrets. + Track stores a payload to be tracked in state. - show_secrets : bool - Returns -> ListSecretResults + payloads : typing.Sequence[~Payload] + Returns -> PayloadResults ''' - 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))) + 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='Secrets', - request='ListSecrets', + msg = dict(type='PayloadsHookContext', + request='Track', version=1, params=_params) - _params['show-secrets'] = show_secrets + _params['payloads'] = payloads 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'}}, + @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(StringResults) - async def CreateSecrets(self, args=None): + @ReturnMapping(None) + async def Ping(self): ''' - CreateSecrets creates new secrets. - args : typing.Sequence[~CreateSecretArg] - Returns -> StringResults + Returns -> None ''' - 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', + msg = dict(type='Pinger', + request='Ping', version=1, params=_params) - _params['args'] = args + reply = await self.rpc(msg) return reply - @ReturnMapping(SecretValueResults) - async def GetSecretValues(self, args=None): + @ReturnMapping(None) + async def Stop(self): ''' - GetSecretValues returns the secret values for the specified secrets. - args : typing.Sequence[~GetSecretArg] - Returns -> SecretValueResults + Returns -> None ''' - 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', + msg = dict(type='Pinger', + request='Stop', version=1, params=_params) - _params['args'] = args + reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SecretsRotated(self, args=None): +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): ''' - SecretsRotated records when secrets were last rotated. + 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. - args : typing.Sequence[~SecretRotatedArg] - Returns -> ErrorResults + + Returns -> RelationLifeSuspendedStatusWatchResult ''' - 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', + msg = dict(type='RelationStatusWatcher', + request='Next', version=1, params=_params) - _params['args'] = args + reply = await self.rpc(msg) return reply - @ReturnMapping(StringResults) - async def UpdateSecrets(self, args=None): + @ReturnMapping(None) + async def Stop(self): ''' - UpdateSecrets updates the specified secrets. + Stop stops the watcher. - args : typing.Sequence[~UpdateSecretArg] - Returns -> StringResults + + Returns -> None ''' - 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', + msg = dict(type='RelationStatusWatcher', + request='Stop', version=1, params=_params) - _params['args'] = args + reply = await self.rpc(msg) return reply - @ReturnMapping(SecretRotationWatchResults) - async def WatchSecretsRotationChanges(self, entities=None): + async def rpc(self, msg): ''' - WatchSecretsRotationChanges sets up a watcher to notify of changes to secret rotation config. + Patch rpc method to add Id. + ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id - entities : typing.Sequence[~Entity] - Returns -> SecretRotationWatchResults + 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 ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='RelationUnitsWatcher', + request='Next', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply -class SecretsRotationWatcherFacade(Type): - name = 'SecretsRotationWatcher' + @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 RemoteRelationWatcherFacade(Type): + name = 'RemoteRelationWatcher' version = 1 schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, @@ -16218,52 +9029,61 @@ class SecretsRotationWatcherFacade(Type): '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'}, + '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', + 'unit-count'], + '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': {'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'}}, + 'properties': {'Next': {'properties': {'Result': {'$ref': '#/definitions/RemoteRelationWatchResult'}}, 'type': 'object'}, 'Stop': {'description': 'Stop stops the watcher.', 'type': 'object'}}, 'type': 'object'} - @ReturnMapping(SecretRotationWatchResult) + @ReturnMapping(RemoteRelationWatchResult) 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 + Returns -> RemoteRelationWatchResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='SecretsRotationWatcher', + msg = dict(type='RemoteRelationWatcher', request='Next', version=1, params=_params) @@ -16284,7 +9104,7 @@ async def Stop(self): # map input types to rpc msg _params = dict() - msg = dict(type='SecretsRotationWatcher', + msg = dict(type='RemoteRelationWatcher', request='Stop', version=1, params=_params) @@ -16308,8 +9128,130 @@ async def rpc(self, msg): -class SingularFacade(Type): - name = 'Singular' +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'}, @@ -16322,79 +9264,107 @@ class SingularFacade(Type): 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, - 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, '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'], + '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'}, - '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'}}, + '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(ErrorResults) - async def Claim(self, claims=None): + @ReturnMapping(RetryStrategyResults) + async def RetryStrategy(self, entities=None): ''' - claims : typing.Sequence[~SingularClaim] - Returns -> ErrorResults + 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 claims is not None and not isinstance(claims, (bytes, str, list)): - raise Exception("Expected claims to be a Sequence, received: {}".format(type(claims))) + if entities is not None and not isinstance(entities, (bytes, str, 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='Claim', + msg = dict(type='RetryStrategy', + request='RetryStrategy', version=1, params=_params) - _params['claims'] = claims + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def Wait(self, entities=None): + @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 -> ErrorResults + 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='Singular', - request='Wait', + msg = dict(type='RetryStrategy', + request='WatchRetryStrategy', version=1, params=_params) _params['entities'] = entities @@ -16403,8 +9373,8 @@ async def Wait(self, entities=None): -class StringsWatcherFacade(Type): - name = 'StringsWatcher' +class SecretsFacade(Type): + name = 'Secrets' version = 1 schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, @@ -16414,315 +9384,451 @@ class StringsWatcherFacade(Type): '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'}}, + 'ListSecretResult': {'additionalProperties': False, + 'properties': {'create-time': {'format': 'date-time', + 'type': 'string'}, + 'description': {'type': 'string'}, + 'expire-time': {'format': 'date-time', + 'type': 'string'}, + 'label': {'type': 'string'}, + 'next-rotate-time': {'format': 'date-time', + 'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'provider': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'revision': {'type': 'integer'}, + 'rotate-policy': {'type': 'string'}, + 'update-time': {'format': 'date-time', + 'type': 'string'}, + 'uri': {'type': 'string'}, + 'value': {'$ref': '#/definitions/SecretValueResult'}, + 'version': {'type': 'integer'}}, + 'required': ['uri', + 'version', + 'owner-tag', + '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(StringsWatchResult) - async def Next(self): + @ReturnMapping(ListSecretResults) + async def ListSecrets(self, show_secrets=None): ''' - 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. - + ListSecrets lists available secrets. - Returns -> StringsWatchResult + 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='StringsWatcher', - request='Next', + msg = dict(type='Secrets', + request='ListSecrets', version=1, params=_params) - + _params['show-secrets'] = show_secrets reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Stop(self): - ''' - Stop stops the watcher. +class SecretsManagerFacade(Type): + name = 'SecretsManager' + version = 1 + schema = {'definitions': {'CreateSecretArg': {'additionalProperties': False, + 'properties': {'UpsertSecretArg': {'$ref': '#/definitions/UpsertSecretArg'}, + 'data': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'expire-time': {'format': 'date-time', + 'type': 'string'}, + 'label': {'type': 'string'}, + 'owner-tag': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'rotate-policy': {'type': 'string'}}, + 'required': ['UpsertSecretArg', + 'owner-tag'], + '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': {'label': {'type': 'string'}, + 'peek': {'type': 'boolean'}, + 'update': {'type': 'boolean'}, + 'uri': {'type': 'string'}}, + 'required': ['uri'], + 'type': 'object'}, + 'GetSecretArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/GetSecretArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'SecretRotatedArg': {'additionalProperties': False, + 'properties': {'uri': {'type': 'string'}, + 'when': {'format': 'date-time', + 'type': 'string'}}, + 'required': ['uri', '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'}, + 'uri': {'type': 'string'}}, + 'required': ['uri', + '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': {'UpsertSecretArg': {'$ref': '#/definitions/UpsertSecretArg'}, + 'data': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'expire-time': {'format': 'date-time', + 'type': 'string'}, + 'label': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'rotate-policy': {'type': 'string'}, + 'uri': {'type': 'string'}}, + 'required': ['UpsertSecretArg', 'uri'], + 'type': 'object'}, + 'UpdateSecretArgs': {'additionalProperties': False, + 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSecretArg'}, + 'type': 'array'}}, + 'required': ['args'], + 'type': 'object'}, + 'UpsertSecretArg': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, + 'type': 'object'}, + 'description': {'type': 'string'}, + 'expire-time': {'format': 'date-time', + 'type': 'string'}, + 'label': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'rotate-policy': {'type': 'string'}}, + '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/ErrorResults'}}, + '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. - Returns -> None + 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='StringsWatcher', - request='Stop', + _params = dict() + msg = dict(type='SecretsManager', + request='CreateSecrets', version=1, params=_params) - + _params['args'] = args 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): + @ReturnMapping(SecretValueResults) + async def GetSecretValues(self, args=None): ''' - ModelConfig returns the model's configuration. - + GetSecretValues returns the secret values for the specified secrets. - Returns -> ModelConfigResult + 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='Undertaker', - request='ModelConfig', + msg = dict(type='SecretsManager', + request='GetSecretValues', version=1, params=_params) - + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(UndertakerModelInfoResult) - async def ModelInfo(self): + @ReturnMapping(ErrorResults) + async def SecretsRotated(self, args=None): ''' - ModelInfo returns information on the model needed by the undertaker worker. - + SecretsRotated records when secrets were last rotated. - Returns -> UndertakerModelInfoResult + 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='Undertaker', - request='ModelInfo', + msg = dict(type='SecretsManager', + request='SecretsRotated', version=1, params=_params) - + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def ProcessDyingModel(self): + @ReturnMapping(ErrorResults) + async def UpdateSecrets(self, args=None): ''' - 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. - + UpdateSecrets updates the specified secrets. - Returns -> None + args : typing.Sequence[~UpdateSecretArg] + Returns -> ErrorResults ''' + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() - msg = dict(type='Undertaker', - request='ProcessDyingModel', + msg = dict(type='SecretsManager', + request='UpdateSecrets', version=1, params=_params) - + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def RemoveModel(self): + @ReturnMapping(SecretRotationWatchResults) + async def WatchSecretsRotationChanges(self, entities=None): ''' - RemoveModel removes any records of this model from Juju. - + WatchSecretsRotationChanges sets up a watcher to notify of changes to secret rotation config. - Returns -> None + 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='Undertaker', - request='RemoveModel', + msg = dict(type='SecretsManager', + request='WatchSecretsRotationChanges', version=1, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetStatus(self, entities=None): +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'}, + 'uri': {'type': 'string'}}, + 'required': ['uri', + '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): ''' - SetStatus sets the status of each given entity. + 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. - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + + Returns -> SecretRotationWatchResult ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='SecretsRotationWatcher', + request='Next', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchModelResources(self): + @ReturnMapping(None) + async def Stop(self): ''' - WatchModelResources creates watchers for changes to the lifecycle of an - model's machines and applications and storage. + Stop stops the watcher. - Returns -> NotifyWatchResults + Returns -> None ''' # map input types to rpc msg _params = dict() - msg = dict(type='Undertaker', - request='WatchModelResources', + msg = dict(type='SecretsRotationWatcher', + request='Stop', version=1, params=_params) @@ -16731,31 +9837,24 @@ async def WatchModelResources(self): -class UnitAssignerFacade(Type): - name = 'UnitAssigner' + 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 StringsWatcherFacade(Type): + name = 'StringsWatcher' 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, + schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, @@ -16763,19 +9862,6 @@ class UnitAssignerFacade(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'}, - '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'}, @@ -16783,128 +9869,92 @@ class UnitAssignerFacade(Type): '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'}}, + '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(ErrorResults) - async def AssignUnits(self, entities=None): + @ReturnMapping(StringsWatchResult) + async def Next(self): ''' - 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. + 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. - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + + 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='UnitAssigner', - request='AssignUnits', + msg = dict(type='StringsWatcher', + request='Next', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetAgentStatus(self, entities=None): + @ReturnMapping(None) + async def Stop(self): ''' - SetAgentStatus will set status for agents of Units passed in args, if one - of the args is not an Unit it will fail. + Stop stops the watcher. - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + + 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='UnitAssigner', - request='SetAgentStatus', + msg = dict(type='StringsWatcher', + request='Stop', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResult) - async def WatchUnitAssignments(self): + async def rpc(self, msg): ''' - WatchUnitAssignments returns a strings watcher that is notified when new unit - assignments are added to the db. - - - Returns -> StringsWatchResult + Patch rpc method to add Id. ''' + if not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id - # map input types to rpc msg - _params = dict() - msg = dict(type='UnitAssigner', - request='WatchUnitAssignments', - version=1, - params=_params) - - reply = await self.rpc(msg) + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply -class UpgradeSeriesFacade(Type): - name = 'UpgradeSeries' +class UndertakerFacade(Type): + name = 'Undertaker' 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'}, + 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, @@ -16918,175 +9968,121 @@ class UpgradeSeriesFacade(Type): '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': 'array'}}, + 'required': ['results'], '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'}}, + '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(ErrorResults) - async def FinishUpgradeSeries(self, args=None): - ''' - args : typing.Sequence[~UpdateSeriesArg] - Returns -> ErrorResults + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): ''' - 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 - + ModelConfig returns the model's configuration. - @ReturnMapping(UpgradeSeriesStatusResults) - async def MachineStatus(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> UpgradeSeriesStatusResults + Returns -> ModelConfigResult ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='Undertaker', + request='ModelConfig', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(PinApplicationsResults) - async def PinMachineApplications(self): + @ReturnMapping(UndertakerModelInfoResult) + async def ModelInfo(self): ''' + ModelInfo returns information on the model needed by the undertaker worker. + - Returns -> PinApplicationsResults + Returns -> UndertakerModelInfoResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='UpgradeSeries', - request='PinMachineApplications', + msg = dict(type='Undertaker', + request='ModelInfo', version=1, params=_params) @@ -17095,17 +10091,20 @@ async def PinMachineApplications(self): - @ReturnMapping(PinnedLeadershipResult) - async def PinnedLeadership(self): + @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 -> PinnedLeadershipResult + Returns -> None ''' # map input types to rpc msg _params = dict() - msg = dict(type='UpgradeSeries', - request='PinnedLeadership', + msg = dict(type='Undertaker', + request='ProcessDyingModel', version=1, params=_params) @@ -17114,129 +10113,169 @@ async def PinnedLeadership(self): - @ReturnMapping(ErrorResults) - async def SetMachineStatus(self, params=None): - ''' - params : typing.Sequence[~UpgradeSeriesStatusParam] - Returns -> ErrorResults + @ReturnMapping(None) + async def RemoveModel(self): ''' - 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 - + RemoveModel removes any records of this model from Juju. - @ReturnMapping(ErrorResults) - async def SetUpgradeSeriesUnitStatus(self, params=None): - ''' - params : typing.Sequence[~UpgradeSeriesStatusParam] - Returns -> ErrorResults + Returns -> None ''' - 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', + msg = dict(type='Undertaker', + request='RemoveModel', version=1, params=_params) - _params['params'] = params + reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def StartUnitCompletion(self, entities=None, message=None): + async def SetStatus(self, entities=None): ''' - entities : typing.Sequence[~Entity] - message : str + 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))) - 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', + msg = dict(type='Undertaker', + request='SetStatus', 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 + @ReturnMapping(NotifyWatchResults) + async def WatchModelResources(self): ''' - if entities is not None and not isinstance(entities, (bytes, str, 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 - + WatchModelResources creates watchers for changes to the lifecycle of an + model's machines and applications and storage. - @ReturnMapping(EntitiesResults) - async def UnitsCompleted(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> EntitiesResults + 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='UnitsCompleted', + msg = dict(type='Undertaker', + request='WatchModelResources', version=1, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(EntitiesResults) - async def UnitsPrepared(self, entities=None): +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 -> EntitiesResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='UnitAssigner', + request='AssignUnits', version=1, params=_params) _params['entities'] = entities @@ -17245,38 +10284,22 @@ async def UnitsPrepared(self, entities=None): - @ReturnMapping(PinApplicationsResults) - async def UnpinMachineApplications(self): - ''' - - Returns -> PinApplicationsResults + @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. - # 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 + 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='UpgradeSeriesUnitStatus', + msg = dict(type='UnitAssigner', + request='SetAgentStatus', version=1, params=_params) _params['entities'] = entities @@ -17285,67 +10308,23 @@ async def UpgradeSeriesUnitStatus(self, entities=None): - @ReturnMapping(NotifyWatchResults) - async def WatchUpgradeSeriesNotifications(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + @ReturnMapping(StringsWatchResult) + async def WatchUnitAssignments(self): ''' - if entities is not None and not isinstance(entities, (bytes, str, 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 - - + WatchUnitAssignments returns a strings watcher that is notified when new unit + assignments are added to the db. -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 + 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='UpgradeSteps', - request='ResetKVMMachineModificationStatusIdle', + msg = dict(type='UnitAssigner', + request='WatchUnitAssignments', version=1, params=_params) - _params['tag'] = tag + reply = await self.rpc(msg) return reply @@ -17559,254 +10538,6 @@ async def WatchAPIVersion(self, entities=None): -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 diff --git a/juju/client/_client11.py b/juju/client/_client11.py index fcd2166a4..6d24058cb 100644 --- a/juju/client/_client11.py +++ b/juju/client/_client11.py @@ -5,1554 +5,6 @@ from juju.client._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 diff --git a/juju/client/_client14.py b/juju/client/_client14.py index 04c0297ea..458947b1d 100644 --- a/juju/client/_client14.py +++ b/juju/client/_client14.py @@ -216,15 +216,6 @@ class ApplicationFacade(Type): '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'}, @@ -799,12 +790,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 ' @@ -853,20 +838,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' @@ -908,10 +886,6 @@ class ApplicationFacade(Type): '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 ' @@ -1350,35 +1324,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=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): ''' @@ -1557,41 +1502,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=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): ''' @@ -1678,7 +1588,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. @@ -1827,39 +1737,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=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): ''' diff --git a/juju/client/_client2.py b/juju/client/_client2.py index b40b5980c..4941fd906 100644 --- a/juju/client/_client2.py +++ b/juju/client/_client2.py @@ -5,302 +5,173 @@ from juju.client._definitions import * -class ActionFacade(Type): - name = 'Action' +class AllWatcherFacade(Type): + name = 'AllWatcher' 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'}}, + schema = {'definitions': {'AllWatcherNextResults': {'additionalProperties': False, + 'properties': {'deltas': {'items': {'$ref': '#/definitions/Delta'}, + 'type': 'array'}}, + 'required': ['deltas'], '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'}}, + '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(ActionResults) - async def Actions(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> ActionResults + @ReturnMapping(AllWatcherNextResults) + async def Next(self): ''' - if entities is not None and not isinstance(entities, (bytes, str, 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 - + Next will return the current state of everything on the first call + and subsequent calls will - @ReturnMapping(ApplicationsCharmActionsResults) - async def ApplicationsCharmsActions(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> ApplicationsCharmActionsResults + Returns -> AllWatcherNextResults ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='AllWatcher', + request='Next', 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 + @ReturnMapping(None) + async def Stop(self): ''' - 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 - + Stop stops the watcher. - @ReturnMapping(FindTagsResults) - async def FindActionTagsByPrefix(self, prefixes=None): - ''' - prefixes : typing.Sequence[str] - Returns -> FindTagsResults + Returns -> None ''' - 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', + msg = dict(type='AllWatcher', + request='Stop', version=2, params=_params) - _params['prefixes'] = prefixes + reply = await self.rpc(msg) return reply - @ReturnMapping(ActionsByNames) - async def FindActionsByNames(self, names=None): + async def rpc(self, msg): ''' - names : typing.Sequence[str] - Returns -> ActionsByNames + Patch rpc method to add Id. ''' - 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 not hasattr(self, 'Id'): + raise RuntimeError('Missing "Id" field') + msg['Id'] = id - # 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) + from .facade import TypeEncoder + reply = await self.connection.rpc(msg, encoder=TypeEncoder) return reply - @ReturnMapping(ActionsByReceivers) - async def ListAll(self, entities=None): +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 -> ActionsByReceivers + 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='Action', - request='ListAll', + msg = dict(type='Annotations', + request='Get', version=2, params=_params) _params['entities'] = entities @@ -309,170 +180,161 @@ async def ListAll(self, entities=None): - @ReturnMapping(ActionsByReceivers) - async def ListCompleted(self, entities=None): + @ReturnMapping(ErrorResults) + async def Set(self, annotations=None): ''' - entities : typing.Sequence[~Entity] - Returns -> ActionsByReceivers + Set stores annotations for given entities + + annotations : typing.Sequence[~EntityAnnotations] + Returns -> ErrorResults ''' - 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 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='Action', - request='ListCompleted', + msg = dict(type='Annotations', + request='Set', version=2, params=_params) - _params['entities'] = entities + _params['annotations'] = annotations 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 +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(). - @ReturnMapping(ActionsByReceivers) - async def ListRunning(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> ActionsByReceivers + Returns -> BlockResults ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='Block', + request='List', 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 + @ReturnMapping(ErrorResult) + async def SwitchBlockOff(self, message=None, type_=None): ''' - 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))) + SwitchBlockOff implements Block.SwitchBlockOff(). - if timeout is not None and not isinstance(timeout, int): - raise Exception("Expected timeout to be a int, received: {}".format(type(timeout))) + 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 units is not None and not isinstance(units, (bytes, str, list)): - raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + 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='Action', - request='Run', + msg = dict(type='Block', + request='SwitchBlockOff', version=2, params=_params) - _params['applications'] = applications - _params['commands'] = commands - _params['machines'] = machines - _params['timeout'] = timeout - _params['units'] = units + _params['message'] = message + _params['type'] = type_ 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 + @ReturnMapping(ErrorResult) + async def SwitchBlockOn(self, message=None, type_=None): ''' - 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))) + SwitchBlockOn implements Block.SwitchBlockOn(). - if timeout is not None and not isinstance(timeout, int): - raise Exception("Expected timeout to be a int, received: {}".format(type(timeout))) + 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 units is not None and not isinstance(units, (bytes, str, list)): - raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) + 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='Action', - request='RunOnAllMachines', + msg = dict(type='Block', + request='SwitchBlockOn', version=2, params=_params) - _params['applications'] = applications - _params['commands'] = commands - _params['machines'] = machines - _params['timeout'] = timeout - _params['units'] = units + _params['message'] = message + _params['type'] = type_ reply = await self.rpc(msg) return reply -class AgentFacade(Type): - name = 'Agent' +class CAASAgentFacade(Type): + name = 'CAASAgent' 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, + schema = {'definitions': {'CloudCredential': {'additionalProperties': False, 'properties': {'attrs': {'patternProperties': {'.*': {'type': 'string'}}, 'type': 'object'}, 'auth-type': {'type': 'string'}, @@ -530,16 +392,6 @@ class AgentFacade(Type): '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, @@ -548,18 +400,6 @@ class AgentFacade(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'}, - 'IsMasterResult': {'additionalProperties': False, - 'properties': {'master': {'type': 'boolean'}}, - 'required': ['master'], - 'type': 'object'}, 'ModelConfigResult': {'additionalProperties': False, 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, @@ -576,31 +416,8 @@ class AgentFacade(Type): '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 " + 'type': 'object'}}, + 'properties': {'CloudSpec': {'description': "CloudSpec returns the model's " 'cloud spec.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, @@ -626,23 +443,10 @@ class AgentFacade(Type): '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 ' @@ -650,12 +454,6 @@ class AgentFacade(Type): '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 ' @@ -681,29 +479,6 @@ class AgentFacade(Type): '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): ''' @@ -717,7 +492,7 @@ async def CloudSpec(self, entities=None): # map input types to rpc msg _params = dict() - msg = dict(type='Agent', + msg = dict(type='CAASAgent', request='CloudSpec', version=2, params=_params) @@ -740,7 +515,7 @@ async def ControllerAPIInfoForModels(self, entities=None): # map input types to rpc msg _params = dict() - msg = dict(type='Agent', + msg = dict(type='CAASAgent', request='ControllerAPIInfoForModels', version=2, params=_params) @@ -761,7 +536,7 @@ async def ControllerConfig(self): # map input types to rpc msg _params = dict() - msg = dict(type='Agent', + msg = dict(type='CAASAgent', request='ControllerConfig', version=2, params=_params) @@ -782,7 +557,7 @@ async def GetCloudSpec(self): # map input types to rpc msg _params = dict() - msg = dict(type='Agent', + msg = dict(type='CAASAgent', request='GetCloudSpec', version=2, params=_params) @@ -792,46 +567,6 @@ async def GetCloudSpec(self): - @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): ''' @@ -843,7 +578,7 @@ async def ModelConfig(self): # map input types to rpc msg _params = dict() - msg = dict(type='Agent', + msg = dict(type='CAASAgent', request='ModelConfig', version=2, params=_params) @@ -853,48 +588,6 @@ async def ModelConfig(self): - @ReturnMapping(ErrorResults) - async def SetPasswords(self, changes=None): - ''' - SetPasswords sets the given password for each supplied entity, if possible. - - changes : typing.Sequence[~EntityPassword] - Returns -> ErrorResults - ''' - if changes is not None and not isinstance(changes, (bytes, str, list)): - raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='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): ''' @@ -908,7 +601,7 @@ async def WatchCloudSpecsChanges(self, entities=None): # map input types to rpc msg _params = dict() - msg = dict(type='Agent', + msg = dict(type='CAASAgent', request='WatchCloudSpecsChanges', version=2, params=_params) @@ -918,29 +611,6 @@ async def WatchCloudSpecsChanges(self, entities=None): - @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): ''' @@ -956,7 +626,7 @@ async def WatchForModelConfigChanges(self): # map input types to rpc msg _params = dict() - msg = dict(type='Agent', + msg = dict(type='CAASAgent', request='WatchForModelConfigChanges', version=2, params=_params) @@ -966,8779 +636,272 @@ async def WatchForModelConfigChanges(self): -class AllModelWatcherFacade(Type): - name = 'AllModelWatcher' +class CAASUnitProvisionerFacade(Type): + name = 'CAASUnitProvisioner' 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'}, - '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'}, - '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'}, - 'image-repo': {'$ref': '#/definitions/DockerImageInfo'}, - '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', - 'unit-count'], - 'type': 'object'}, - 'RemoteRelationDetails': {'additionalProperties': False, - 'properties': {'bakery-version': {'type': 'integer'}, - 'macaroon': {'$ref': '#/definitions/Macaroon'}, - 'relation-token': {'type': 'string'}}, - 'required': ['relation-token'], - 'type': 'object'}, - 'RemoteRelationUnitChange': {'additionalProperties': False, - 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'unit-id': {'type': 'integer'}}, - 'required': ['unit-id'], - 'type': 'object'}, - 'RemoteRelationWatchResult': {'additionalProperties': False, - 'properties': {'changes': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, - 'error': {'$ref': '#/definitions/Error'}, - 'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id', - 'changes'], - 'type': 'object'}, - 'RemoteRelationWatchResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteRelationWatchResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'RemoteRelationsChanges': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, - 'type': 'array'}}, - 'type': 'object'}, - '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'], + 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'}, - 'ErrorResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}}, + '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'}, - 'ErrorResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, - 'type': 'array'}}, - 'required': ['results'], + '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'}, - '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'], + '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'}, - '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, + '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'}, + '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'], @@ -9747,11 +910,28 @@ class MetricsDebugFacade(Type): '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'}, + '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, @@ -9768,841 +948,786 @@ class MetricsDebugFacade(Type): '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'], + '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'}, + 'image-repo': {'$ref': '#/definitions/DockerImageInfo'}, + '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'}, - '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'], + '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'}, - 'MetricResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/EntityMetrics'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, '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'], + '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'}, - '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'}, + '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': ['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'], + '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'}, - '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'], + 'ApplicationsScale': {'description': 'ApplicationsScale ' + 'returns the scaling info ' + 'for specified ' + 'applications in this ' + 'model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/IntResults'}}, '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.', + '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'}, - '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.', + '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'}, - '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'}}, + 'ProvisioningInfo': {'description': 'ProvisioningInfo returns ' + 'the provisioning info for ' + 'specified applications in ' + 'this model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/KubernetesProvisioningInfoResults'}}, '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'}}, + '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'}, - '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'}}, + '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(SerializedModel) - async def Export(self): + @ReturnMapping(Charm) + async def ApplicationCharmInfo(self, tag=None): ''' - Export serializes the model associated with the API connection. - + ApplicationCharmInfo returns information about an application's charm. - Returns -> SerializedModel + 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='MigrationMaster', - request='Export', + msg = dict(type='CAASUnitProvisioner', + request='ApplicationCharmInfo', version=2, params=_params) - + _params['tag'] = tag reply = await self.rpc(msg) return reply - @ReturnMapping(MasterMigrationStatus) - async def MigrationStatus(self): + @ReturnMapping(ApplicationGetConfigResults) + async def ApplicationsConfig(self, entities=None): ''' - MigrationStatus returns the details and progress of the latest - model migration. - + ApplicationsConfig returns the config for the specified applications. - Returns -> MasterMigrationStatus + 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='MigrationMaster', - request='MigrationStatus', + msg = dict(type='CAASUnitProvisioner', + request='ApplicationsConfig', version=2, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(MinionReports) - async def MinionReports(self): + @ReturnMapping(IntResults) + async def ApplicationsScale(self, entities=None): ''' - MinionReports returns details of the reports made by migration - minions to the controller for the current migration phase. - + ApplicationsScale returns the scaling info for specified applications in this model. - Returns -> MinionReports + 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='MigrationMaster', - request='MinionReports', + msg = dict(type='CAASUnitProvisioner', + request='ApplicationsScale', version=2, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(MigrationModelInfo) - async def ModelInfo(self): + @ReturnMapping(BoolResults) + async def ApplicationsTrust(self, entities=None): ''' - ModelInfo returns essential information about the model to be - migrated. - + ApplicationsTrust returns the trust status for specified applications in this model. - Returns -> MigrationModelInfo + 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='MigrationMaster', - request='ModelInfo', + msg = dict(type='CAASUnitProvisioner', + request='ApplicationsTrust', version=2, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Prechecks(self): + @ReturnMapping(Charm) + async def CharmInfo(self, url=None): ''' - Prechecks performs pre-migration checks on the model and - (source) controller. - + CharmInfo returns information about the requested charm. - Returns -> None + 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='MigrationMaster', - request='Prechecks', + msg = dict(type='CAASUnitProvisioner', + request='CharmInfo', version=2, params=_params) - + _params['url'] = url reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def ProcessRelations(self, controller_alias=None): + @ReturnMapping(ErrorResults) + async def ClearApplicationsResources(self, entities=None): ''' - ProcessRelations processes any relations that need updating after an export. - This should help fix any remoteApplications that have been migrated. + ClearApplicationsResources clears the flags which indicate + applications still have resources in the cluster. - controller_alias : str - Returns -> None + entities : typing.Sequence[~Entity] + Returns -> ErrorResults ''' - 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 entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='MigrationMaster', - request='ProcessRelations', + msg = dict(type='CAASUnitProvisioner', + request='ClearApplicationsResources', version=2, params=_params) - _params['controller-alias'] = controller_alias + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Reap(self): + @ReturnMapping(StringResults) + async def DeploymentMode(self, entities=None): ''' - Reap removes all documents for the model associated with the API - connection. - + DeploymentMode returns the deployment mode of the given applications' charms. - Returns -> 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='MigrationMaster', - request='Reap', + msg = dict(type='CAASUnitProvisioner', + request='DeploymentMode', version=2, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def SetPhase(self, phase=None): + @ReturnMapping(LifeResults) + async def Life(self, entities=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. + Life returns the life status of every supplied entity, where available. - phase : str - Returns -> None + entities : typing.Sequence[~Entity] + Returns -> LifeResults ''' - if phase is not None and not isinstance(phase, (bytes, str)): - raise Exception("Expected phase to be a str, received: {}".format(type(phase))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='MigrationMaster', - request='SetPhase', + msg = dict(type='CAASUnitProvisioner', + request='Life', version=2, params=_params) - _params['phase'] = phase + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def SetStatusMessage(self, message=None): + @ReturnMapping(KubernetesProvisioningInfoResults) + async def ProvisioningInfo(self, entities=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. + ProvisioningInfo returns the provisioning info for specified applications in this model. - message : str - Returns -> None + entities : typing.Sequence[~Entity] + Returns -> KubernetesProvisioningInfoResults ''' - if message is not None and not isinstance(message, (bytes, str)): - raise Exception("Expected message to be a str, received: {}".format(type(message))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='MigrationMaster', - request='SetStatusMessage', + msg = dict(type='CAASUnitProvisioner', + request='ProvisioningInfo', version=2, params=_params) - _params['message'] = message + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def Watch(self): + @ReturnMapping(ErrorResults) + async def SetOperatorStatus(self, entities=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. - + SetOperatorStatus updates the operator status for each given application. - Returns -> NotifyWatchResult + 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='MigrationMaster', - request='Watch', + msg = dict(type='CAASUnitProvisioner', + request='SetOperatorStatus', version=2, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def WatchMinionReports(self): + @ReturnMapping(ErrorResults) + async def UpdateApplicationsService(self, args=None): ''' - WatchMinionReports sets up a watcher which reports when a report - for a migration minion has arrived. - + UpdateApplicationsService updates the Juju data model to reflect the given + service details of the specified application. - Returns -> NotifyWatchResult + 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='MigrationMaster', - request='WatchMinionReports', + msg = dict(type='CAASUnitProvisioner', + request='UpdateApplicationsService', version=2, params=_params) - + _params['args'] = args 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): + @ReturnMapping(UpdateApplicationUnitResults) + async def UpdateApplicationsUnits(self, args=None): ''' - ModelGet implements the server-side part of the - model-config CLI command. - + UpdateApplicationsUnits updates the Juju data model to reflect the given + units of the specified application. - Returns -> ModelConfigResults + 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='ModelConfig', - request='ModelGet', + msg = dict(type='CAASUnitProvisioner', + request='UpdateApplicationsUnits', version=2, params=_params) - + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def ModelSet(self, config=None): + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): ''' - ModelSet implements the server-side part of the - set-model-config CLI command. + Watch starts a NotifyWatcher for each entity given. - config : typing.Mapping[str, typing.Any] - Returns -> None + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' - if config is not None and not isinstance(config, dict): - raise Exception("Expected config to be a Mapping, received: {}".format(type(config))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='ModelConfig', - request='ModelSet', + msg = dict(type='CAASUnitProvisioner', + request='Watch', version=2, params=_params) - _params['config'] = config + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def ModelUnset(self, keys=None): + @ReturnMapping(StringsWatchResult) + async def WatchApplications(self): ''' - ModelUnset implements the server-side part of the - set-model-config CLI command. + WatchApplications starts a StringsWatcher to watch applications + deployed to this model. - keys : typing.Sequence[str] - Returns -> None + + Returns -> StringsWatchResult ''' - 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', + msg = dict(type='CAASUnitProvisioner', + request='WatchApplications', version=2, params=_params) - _params['keys'] = keys + reply = await self.rpc(msg) return reply - @ReturnMapping(StringResult) - async def SLALevel(self): + @ReturnMapping(NotifyWatchResults) + async def WatchApplicationsScale(self, entities=None): ''' - SLALevel returns the current sla level for the model. - + WatchApplicationsScale starts a NotifyWatcher to watch changes + to the applications' scale. - Returns -> StringResult + 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='ModelConfig', - request='SLALevel', + msg = dict(type='CAASUnitProvisioner', + request='WatchApplicationsScale', version=2, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ModelSequencesResult) - async def Sequences(self): + @ReturnMapping(StringsWatchResults) + async def WatchApplicationsTrustHash(self, entities=None): ''' - Sequences returns the model's sequence names and next values. - + WatchApplicationsTrustHash starts a StringsWatcher to watch changes + to the applications' trust status. - Returns -> ModelSequencesResult + 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='ModelConfig', - request='Sequences', + msg = dict(type='CAASUnitProvisioner', + request='WatchApplicationsTrustHash', version=2, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def SetSLALevel(self, modelslainfo=None, creds=None, level=None, owner=None): + @ReturnMapping(NotifyWatchResults) + async def WatchPodSpec(self, entities=None): ''' - SetSLALevel sets the sla level on the model. + WatchPodSpec starts a NotifyWatcher to watch changes to the + pod spec for specified units in this model. - modelslainfo : ModelSLAInfo - creds : typing.Sequence[int] - level : str - owner : str - Returns -> None + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' - 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 entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='ModelConfig', - request='SetSLALevel', + msg = dict(type='CAASUnitProvisioner', + request='WatchPodSpec', version=2, params=_params) - _params['ModelSLAInfo'] = modelslainfo - _params['creds'] = creds - _params['level'] = level - _params['owner'] = owner + _params['entities'] = entities reply = await self.rpc(msg) return reply -class ModelGenerationFacade(Type): - name = 'ModelGeneration' +class CharmRevisionUpdaterFacade(Type): + name = 'CharmRevisionUpdater' 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, + schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, @@ -10612,218 +1737,270 @@ class ModelGenerationFacade(Type): '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'}}, + '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 AbortBranch(self, branch=None): + async def UpdateLatestRevisions(self): ''' - branch : str + UpdateLatestRevisions retrieves the latest revision information from the charm store for all deployed charms + and records this information in state. + + 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', + msg = dict(type='CharmRevisionUpdater', + request='UpdateLatestRevisions', version=2, params=_params) - _params['branch'] = branch + reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResult) - async def AddBranch(self, branch=None): +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): ''' - branch : str - Returns -> ErrorResult + 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 ''' - 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', + msg = dict(type='Cleaner', + request='WatchCleanups', 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 +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): ''' - if branches is not None and not isinstance(branches, (bytes, str, list)): - raise Exception("Expected branches to be a Sequence, received: {}".format(type(branches))) + InvalidateModelCredential marks the cloud credential for this model as invalid. - if detailed is not None and not isinstance(detailed, bool): - raise Exception("Expected detailed to be a bool, received: {}".format(type(detailed))) + 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='ModelGeneration', - request='BranchInfo', + msg = dict(type='CredentialValidator', + request='InvalidateModelCredential', version=2, params=_params) - _params['branches'] = branches - _params['detailed'] = detailed + _params['reason'] = reason reply = await self.rpc(msg) return reply - @ReturnMapping(IntResult) - async def CommitBranch(self, branch=None): + @ReturnMapping(ModelCredential) + async def ModelCredential(self): ''' - branch : str - Returns -> IntResult + ModelCredential returns cloud credential information for a model. + + + Returns -> ModelCredential ''' - 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', + msg = dict(type='CredentialValidator', + request='ModelCredential', version=2, params=_params) - _params['branch'] = branch + reply = await self.rpc(msg) return reply - @ReturnMapping(BoolResult) - async def HasActiveBranch(self, branch=None): + @ReturnMapping(NotifyWatchResult) + async def WatchCredential(self, tag=None): ''' - branch : str - Returns -> BoolResult + WatchCredential returns a NotifyWatcher that observes + changes to a given cloud credential. + + tag : str + Returns -> NotifyWatchResult ''' - if branch is not None and not isinstance(branch, (bytes, str)): - raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + 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='ModelGeneration', - request='HasActiveBranch', + msg = dict(type='CredentialValidator', + request='WatchCredential', version=2, params=_params) - _params['branch'] = branch + _params['tag'] = tag 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 + @ReturnMapping(NotifyWatchResult) + async def WatchModelCredential(self): ''' - if branch is not None and not isinstance(branch, (bytes, str)): - raise Exception("Expected branch to be a str, received: {}".format(type(branch))) + WatchModelCredential returns a NotifyWatcher that watches what cloud credential a model uses. - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + + Returns -> NotifyWatchResult + ''' # map input types to rpc msg _params = dict() - msg = dict(type='ModelGeneration', - request='TrackBranch', + msg = dict(type='CredentialValidator', + request='WatchModelCredential', version=2, params=_params) - _params['branch'] = branch - _params['entities'] = entities + reply = await self.rpc(msg) return reply -class ModelManagerFacade(Type): - name = 'ModelManager' +class CrossModelRelationsFacade(Type): + name = 'CrossModelRelations' 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, + schema = {'definitions': {'EntityStatus': {'additionalProperties': False, 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, @@ -10835,656 +2012,544 @@ class ModelManagerFacade(Type): 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, - 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, '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'], + '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', + 'unit-count'], + 'type': 'object'}, + 'RemoteRelationDetails': {'additionalProperties': False, + 'properties': {'bakery-version': {'type': 'integer'}, + 'macaroon': {'$ref': '#/definitions/Macaroon'}, + 'relation-token': {'type': 'string'}}, + 'required': ['relation-token'], + 'type': 'object'}, + 'RemoteRelationUnitChange': {'additionalProperties': False, + 'properties': {'settings': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'unit-id': {'type': 'integer'}}, + 'required': ['unit-id'], + 'type': 'object'}, + 'RemoteRelationWatchResult': {'additionalProperties': False, + 'properties': {'changes': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, + 'error': {'$ref': '#/definitions/Error'}, + 'watcher-id': {'type': 'string'}}, + 'required': ['watcher-id', + 'changes'], + 'type': 'object'}, + 'RemoteRelationWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/RemoteRelationWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'RemoteRelationsChanges': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/RemoteRelationChangeEvent'}, + 'type': 'array'}}, + 'type': 'object'}, + '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'}, - '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'], + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, + 'type': 'array'}}, + 'required': ['results'], 'type': 'object'}, - 'ModelInfo': {'additionalProperties': False, - 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, - 'cloud-credential-tag': {'type': 'string'}, - 'cloud-region': {'type': 'string'}, - 'cloud-tag': {'type': 'string'}, - 'controller-uuid': {'type': 'string'}, - 'default-series': {'type': 'string'}, - 'life': {'type': 'string'}, - 'machines': {'items': {'$ref': '#/definitions/ModelMachineInfo'}, - 'type': 'array'}, - 'migration': {'$ref': '#/definitions/ModelMigrationStatus'}, - 'name': {'type': 'string'}, - 'owner-tag': {'type': 'string'}, - 'provider-type': {'type': 'string'}, - 'sla': {'$ref': '#/definitions/ModelSLAInfo'}, - 'status': {'$ref': '#/definitions/EntityStatus'}, - 'users': {'items': {'$ref': '#/definitions/ModelUserInfo'}, - 'type': 'array'}, - 'uuid': {'type': 'string'}}, - 'required': ['name', - 'uuid', - 'controller-uuid', - 'cloud-tag', - 'owner-tag', - 'life', - 'users', - 'machines', - 'sla', - 'agent-version'], - 'type': 'object'}, - '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'}}, + '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'}, - 'UnsetModelDefaults': {'properties': {'Params': {'$ref': '#/definitions/UnsetModelDefaults'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - '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(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 + @ReturnMapping(ErrorResults) + async def PublishIngressNetworkChanges(self, changes=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='ModelManager', - request='DumpModelsDB', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - + PublishIngressNetworkChanges publishes changes to the required + ingress addresses to the model hosting the offer in the relation. - @ReturnMapping(UserModelList) - async def ListModels(self, tag=None): - ''' - tag : str - Returns -> UserModelList + changes : typing.Sequence[~IngressNetworksChangeEvent] + Returns -> ErrorResults ''' - if tag is not None and not isinstance(tag, (bytes, str)): - raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + if 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='ListModels', + msg = dict(type='CrossModelRelations', + request='PublishIngressNetworkChanges', version=2, params=_params) - _params['tag'] = tag + _params['changes'] = changes reply = await self.rpc(msg) return reply - @ReturnMapping(ModelDefaultsResult) - async def ModelDefaults(self): + @ReturnMapping(ErrorResults) + async def PublishRelationChanges(self, changes=None): ''' + PublishRelationChanges publishes relation changes to the + model hosting the remote application involved in the relation. - Returns -> ModelDefaultsResult + 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='ModelManager', - request='ModelDefaults', + msg = dict(type='CrossModelRelations', + request='PublishRelationChanges', version=2, params=_params) - + _params['changes'] = changes reply = await self.rpc(msg) return reply - @ReturnMapping(ModelInfoResults) - async def ModelInfo(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> ModelInfoResults + @ReturnMapping(RegisterRemoteRelationResults) + async def RegisterRemoteRelations(self, relations=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='ModelManager', - request='ModelInfo', - version=2, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - + RegisterRemoteRelations sets up the model to participate + in the specified relations. This operation is idempotent. - @ReturnMapping(ModelStatusResults) - async def ModelStatus(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> ModelStatusResults + relations : typing.Sequence[~RegisterRemoteRelationArg] + Returns -> RegisterRemoteRelationResults ''' - 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 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='ModelManager', - request='ModelStatus', + msg = dict(type='CrossModelRelations', + request='RegisterRemoteRelations', version=2, params=_params) - _params['entities'] = entities + _params['relations'] = relations reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def ModifyModelAccess(self, changes=None): - ''' - changes : typing.Sequence[~ModifyModelAccess] - Returns -> ErrorResults + @ReturnMapping(StringsWatchResults) + async def WatchEgressAddressesForRelations(self, args=None): ''' - 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 - - + 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. - @ReturnMapping(ErrorResults) - async def SetModelDefaults(self, config=None): - ''' - config : typing.Sequence[~ModelDefaultValues] - Returns -> ErrorResults + args : typing.Sequence[~RemoteEntityArg] + Returns -> StringsWatchResults ''' - 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 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='ModelManager', - request='SetModelDefaults', + msg = dict(type='CrossModelRelations', + request='WatchEgressAddressesForRelations', version=2, params=_params) - _params['config'] = config + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def UnsetModelDefaults(self, keys=None): + @ReturnMapping(OfferStatusWatchResults) + async def WatchOfferStatus(self, args=None): ''' - keys : typing.Sequence[~ModelUnsetKeys] - Returns -> ErrorResults + WatchOfferStatus starts an OfferStatusWatcher for + watching the status of an offer. + + args : typing.Sequence[~OfferArg] + Returns -> OfferStatusWatchResults ''' - if keys is not None and not isinstance(keys, (bytes, str, list)): - raise Exception("Expected keys to be a Sequence, received: {}".format(type(keys))) + 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='ModelManager', - request='UnsetModelDefaults', + msg = dict(type='CrossModelRelations', + request='WatchOfferStatus', version=2, params=_params) - _params['keys'] = keys + _params['args'] = args 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): + @ReturnMapping(RemoteRelationWatchResults) + async def WatchRelationChanges(self, args=None): ''' - ProxyConfig returns the proxy settings for the current model. + 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. - entities : typing.Sequence[~Entity] - Returns -> ProxyConfigResults + args : typing.Sequence[~RemoteEntityArg] + 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))) + 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='ProxyUpdater', - request='ProxyConfig', + msg = dict(type='CrossModelRelations', + request='WatchRelationChanges', version=2, params=_params) - _params['entities'] = entities + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchForProxyConfigAndAPIHostPortChanges(self, entities=None): + @ReturnMapping(RelationStatusWatchResults) + async def WatchRelationsSuspendedStatus(self, args=None): ''' - WatchForProxyConfigAndAPIHostPortChanges watches for changes to the proxy and api host port settings. + WatchRelationsSuspendedStatus starts a RelationStatusWatcher for + watching the life and suspended status of a relation. - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + args : typing.Sequence[~RemoteEntityArg] + Returns -> RelationStatusWatchResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() - msg = dict(type='ProxyUpdater', - request='WatchForProxyConfigAndAPIHostPortChanges', + msg = dict(type='CrossModelRelations', + request='WatchRelationsSuspendedStatus', version=2, params=_params) - _params['entities'] = entities + _params['args'] = args reply = await self.rpc(msg) return reply -class RaftLeaseFacade(Type): - name = 'RaftLease' +class DiskManagerFacade(Type): + name = 'DiskManager' version = 2 - schema = {'definitions': {'Error': {'additionalProperties': False, + 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'}}, @@ -11500,65 +2565,54 @@ class RaftLeaseFacade(Type): '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'}}, + '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 ApplyLease(self, commands=None): + async def SetMachineBlockDevices(self, machine_block_devices=None): ''' - commands : typing.Sequence[~LeaseOperationCommand] + machine_block_devices : typing.Sequence[~MachineBlockDevices] 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))) + 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='RaftLease', - request='ApplyLease', + msg = dict(type='DiskManager', + request='SetMachineBlockDevices', version=2, params=_params) - _params['commands'] = commands + _params['machine-block-devices'] = machine_block_devices reply = await self.rpc(msg) return reply -class RebootFacade(Type): - name = 'Reboot' +class EntityWatcherFacade(Type): + name = 'EntityWatcher' 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'}, + 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, @@ -11566,729 +2620,624 @@ class RebootFacade(Type): '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'}}, + '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(ErrorResults) - async def ClearReboot(self, entities=None): + @ReturnMapping(EntitiesWatchResult) + async def Next(self): ''' - ClearReboot will clear the reboot flag on provided machines, if it exists. + 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. - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + + Returns -> EntitiesWatchResult ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='EntityWatcher', + request='Next', version=2, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(RebootActionResults) - async def GetRebootAction(self, entities=None): + @ReturnMapping(None) + async def Stop(self): ''' - 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). + 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'} + - entities : typing.Sequence[~Entity] - Returns -> RebootActionResults + @ReturnMapping(MachineStorageIdsWatchResult) + async def Next(self): ''' - if entities is not None and not isinstance(entities, (bytes, str, 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 - - + 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. - @ReturnMapping(ErrorResults) - async def RequestReboot(self, entities=None): - ''' - RequestReboot sets the reboot flag on the provided machines - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + Returns -> MachineStorageIdsWatchResult ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='FilesystemAttachmentsWatcher', + request='Next', version=2, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def WatchForRebootEvent(self): + @ReturnMapping(None) + async def Stop(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). + Stop stops the watcher. - Returns -> NotifyWatchResult + Returns -> None ''' # 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'}, - 'unit-count': {'type': 'integer'}}, - 'required': ['life', - 'suspended', - 'id', - 'key', - 'application-name', - 'endpoint', - 'unit-count', - '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', - 'unit-count'], - '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'], + _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'}, - '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'], + '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'}, - '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'}}, + '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'}, - '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'}}, + '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'}, - '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'}}, + '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 ConsumeRemoteRelationChanges(self, changes=None): + async def DeleteImages(self, images=None): ''' - ConsumeRemoteRelationChanges consumes changes to settings originating - from the remote/offering side of relations. + DeleteImages deletes the images matching the specified filter. - changes : typing.Sequence[~RemoteRelationChangeEvent] + images : typing.Sequence[~ImageSpec] Returns -> ErrorResults ''' - if changes is not None and not isinstance(changes, (bytes, str, list)): - raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + if 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='RemoteRelations', - request='ConsumeRemoteRelationChanges', + msg = dict(type='ImageManager', + request='DeleteImages', version=2, params=_params) - _params['changes'] = changes + _params['images'] = images reply = await self.rpc(msg) return reply - @ReturnMapping(ControllerAPIInfoResults) - async def ControllerAPIInfoForModels(self, entities=None): + @ReturnMapping(ListImageResult) + async def ListImages(self, images=None): ''' - ControllerAPIInfoForModels returns the controller api connection details for the specified models. + ListImages returns images matching the specified filter. - entities : typing.Sequence[~Entity] - Returns -> ControllerAPIInfoResults + images : typing.Sequence[~ImageSpec] + Returns -> ListImageResult ''' - 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 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='RemoteRelations', - request='ControllerAPIInfoForModels', + msg = dict(type='ImageManager', + request='ListImages', version=2, params=_params) - _params['entities'] = entities + _params['images'] = images reply = await self.rpc(msg) return reply - @ReturnMapping(ControllerConfigResult) - async def ControllerConfig(self): - ''' - ControllerConfig returns the controller's configuration. +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. - Returns -> ControllerConfigResult + 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='RemoteRelations', - request='ControllerConfig', + msg = dict(type='LeadershipService', + request='BlockUntilLeadershipReleased', version=2, params=_params) - + _params['Name'] = name reply = await self.rpc(msg) return reply - @ReturnMapping(TokenResults) - async def ExportEntities(self, entities=None): + @ReturnMapping(ClaimLeadershipBulkResults) + async def ClaimLeadership(self, params=None): ''' - ExportEntities allocates unique, remote entity IDs for the given entities in the local model. + ClaimLeadership makes a leadership claim with the given parameters. - entities : typing.Sequence[~Entity] - Returns -> TokenResults + params : typing.Sequence[~ClaimLeadershipParams] + Returns -> ClaimLeadershipBulkResults ''' - 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 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='RemoteRelations', - request='ExportEntities', + msg = dict(type='LeadershipService', + request='ClaimLeadership', version=2, params=_params) - _params['entities'] = entities + _params['params'] = params reply = await self.rpc(msg) return reply - @ReturnMapping(StringResults) - async def GetTokens(self, args=None): +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): ''' - GetTokens returns the token associated with the entities with the given tags for the given models. + GetMeterStatus returns meter status information for each unit. - args : typing.Sequence[~GetTokenArg] - Returns -> StringResults + entities : typing.Sequence[~Entity] + Returns -> MeterStatusResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='RemoteRelations', - request='GetTokens', + msg = dict(type='MeterStatus', + request='GetMeterStatus', version=2, params=_params) - _params['Args'] = args + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def ImportRemoteEntities(self, args=None): + async def SetState(self, args=None): ''' - ImportRemoteEntities adds entities to the remote entities collection with the specified opaque tokens. + 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[~RemoteEntityTokenArg] + args : typing.Sequence[~SetUnitStateArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): @@ -12296,32 +3245,32 @@ async def ImportRemoteEntities(self, args=None): # map input types to rpc msg _params = dict() - msg = dict(type='RemoteRelations', - request='ImportRemoteEntities', + msg = dict(type='MeterStatus', + request='SetState', version=2, params=_params) - _params['Args'] = args + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(RemoteRelationResults) - async def Relations(self, entities=None): + @ReturnMapping(UnitStateResults) + async def State(self, entities=None): ''' - Relations returns information about the cross-model relations with the specified keys - in the local model. + 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 -> RemoteRelationResults + 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='RemoteRelations', - request='Relations', + msg = dict(type='MeterStatus', + request='State', version=2, params=_params) _params['entities'] = entities @@ -12330,22 +3279,22 @@ async def Relations(self, entities=None): - @ReturnMapping(RemoteApplicationResults) - async def RemoteApplications(self, entities=None): + @ReturnMapping(NotifyWatchResults) + async def WatchMeterStatus(self, entities=None): ''' - RemoteApplications returns the current state of the remote applications with - the specified names in the local model. + WatchMeterStatus returns a NotifyWatcher for observing changes + to each unit's meter status. entities : typing.Sequence[~Entity] - Returns -> RemoteApplicationResults + 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='RemoteRelations', - request='RemoteApplications', + msg = dict(type='MeterStatus', + request='WatchMeterStatus', version=2, params=_params) _params['entities'] = entities @@ -12354,44 +3303,179 @@ async def RemoteApplications(self, entities=None): +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 SaveMacaroons(self, args=None): + async def AddMetricBatches(self, batches=None): ''' - SaveMacaroons saves the macaroons for the given entities. + AddMetricBatches implements the MetricsAdder interface. - args : typing.Sequence[~EntityMacaroonArg] + batches : typing.Sequence[~MetricBatchParam] Returns -> ErrorResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if 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='RemoteRelations', - request='SaveMacaroons', + msg = dict(type='MetricsAdder', + request='AddMetricBatches', version=2, params=_params) - _params['Args'] = args + _params['batches'] = batches reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetRemoteApplicationsStatus(self, entities=None): +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): ''' - SetRemoteApplicationsStatus sets the status for the specified remote applications. + GetMetrics returns all metrics stored by the state server. - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + 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='RemoteRelations', - request='SetRemoteApplicationsStatus', + msg = dict(type='MetricsDebug', + request='GetMetrics', version=2, params=_params) _params['entities'] = entities @@ -12401,73 +3485,125 @@ async def SetRemoteApplicationsStatus(self, entities=None): @ReturnMapping(ErrorResults) - async def UpdateControllersForModels(self, changes=None): + async def SetMeterStatus(self, statues=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. + SetMeterStatus sets meter statuses for entities. - changes : typing.Sequence[~UpdateControllerForModel] + statues : typing.Sequence[~MeterStatusParam] Returns -> ErrorResults ''' - if changes is not None and not isinstance(changes, (bytes, str, list)): - raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + if 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='RemoteRelations', - request='UpdateControllersForModels', + msg = dict(type='MetricsDebug', + request='SetMeterStatus', version=2, params=_params) - _params['changes'] = changes + _params['statues'] = statues 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 - - +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(StringsWatchResults) - async def WatchRemoteApplicationRelations(self, entities=None): + @ReturnMapping(ProxyConfigResults) + async def ProxyConfig(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. + ProxyConfig returns the proxy settings for the current model. entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + 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='RemoteRelations', - request='WatchRemoteApplicationRelations', + _params = dict() + msg = dict(type='ProxyUpdater', + request='ProxyConfig', version=2, params=_params) _params['entities'] = entities @@ -12476,113 +3612,103 @@ async def WatchRemoteApplicationRelations(self, entities=None): - @ReturnMapping(StringsWatchResult) - async def WatchRemoteApplications(self): + @ReturnMapping(NotifyWatchResults) + async def WatchForProxyConfigAndAPIHostPortChanges(self, entities=None): ''' - 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. - + WatchForProxyConfigAndAPIHostPortChanges watches for changes to the proxy and api host port settings. - Returns -> StringsWatchResult + 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='RemoteRelations', - request='WatchRemoteApplications', + msg = dict(type='ProxyUpdater', + request='WatchForProxyConfigAndAPIHostPortChanges', version=2, params=_params) - + _params['entities'] = entities 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. - +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'} + - Returns -> StringsWatchResult + @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='RemoteRelations', - request='WatchRemoteRelations', + msg = dict(type='RaftLease', + request='ApplyLease', version=2, params=_params) - + _params['commands'] = commands reply = await self.rpc(msg) return reply -class ResourcesFacade(Type): - name = 'Resources' +class RebootFacade(Type): + name = 'Reboot' 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'}, + 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'], @@ -12598,162 +3724,136 @@ class ResourcesFacade(Type): 'ErrorResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}}, 'type': 'object'}, - 'ListResourcesArgs': {'additionalProperties': False, - 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, - 'type': 'array'}}, - 'required': ['entities'], + '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'}, - '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'}}, + 'RebootActionResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, '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'}}, + '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(AddPendingResourcesResult) - async def AddPendingResources(self, entity=None, charm_origin=None, macaroon=None, resources=None, tag=None, url=None): + @ReturnMapping(ErrorResults) + async def ClearReboot(self, entities=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. + ClearReboot will clear the reboot flag on provided machines, if it exists. - entity : Entity - charm_origin : CharmOrigin - macaroon : Macaroon - resources : typing.Sequence[~CharmResource] - tag : str - url : str - Returns -> AddPendingResourcesResult + entities : typing.Sequence[~Entity] + Returns -> ErrorResults ''' - if entity is not None and not isinstance(entity, (dict, Entity)): - raise Exception("Expected entity to be a Entity, received: {}".format(type(entity))) + 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 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))) + # 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 - 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))) + @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). - if url is not None and not isinstance(url, (bytes, str)): - raise Exception("Expected url to be a str, received: {}".format(type(url))) + 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='Resources', - request='AddPendingResources', + msg = dict(type='Reboot', + request='GetRebootAction', version=2, params=_params) - _params['Entity'] = entity - _params['charm-origin'] = charm_origin - _params['macaroon'] = macaroon - _params['resources'] = resources - _params['tag'] = tag - _params['url'] = url + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ResourcesResults) - async def ListResources(self, entities=None): + @ReturnMapping(ErrorResults) + async def RequestReboot(self, entities=None): ''' - ListResources returns the list of resources for the given application. + RequestReboot sets the reboot flag on the provided machines entities : typing.Sequence[~Entity] - Returns -> ResourcesResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='Reboot', + request='RequestReboot', version=2, params=_params) _params['entities'] = entities @@ -12762,23 +3862,20 @@ async def ListResources(self, entities=None): -class ResumerFacade(Type): - name = 'Resumer' - version = 2 - schema = {'properties': {'ResumeTransactions': {'type': 'object'}}, 'type': 'object'} - - - @ReturnMapping(None) - async def ResumeTransactions(self): + @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 -> None + + Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='Resumer', - request='ResumeTransactions', + msg = dict(type='Reboot', + request='WatchForRebootEvent', version=2, params=_params) @@ -12787,10 +3884,29 @@ async def ResumeTransactions(self): -class SSHClientFacade(Type): - name = 'SSHClient' +class RemoteRelationsFacade(Type): + name = 'RemoteRelations' version = 2 - schema = {'definitions': {'Entities': {'additionalProperties': False, + 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'], @@ -12799,6 +3915,28 @@ class SSHClientFacade(Type): '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, @@ -12807,134 +3945,423 @@ class SSHClientFacade(Type): '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'}, + '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'}, - 'error': {'$ref': '#/definitions/Error'}}, - 'required': ['addresses'], + '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'}, + 'unit-count': {'type': 'integer'}}, + 'required': ['life', + 'suspended', + 'id', + 'key', + 'application-name', + 'endpoint', + 'unit-count', + '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', + 'unit-count'], + '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'}, - 'SSHAddressesResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/SSHAddressesResult'}, + 'StringsWatchResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, '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'}}, + 'TokenResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'token': {'type': 'string'}}, 'type': 'object'}, - 'PrivateAddress': {'description': 'PrivateAddress reports the ' - 'preferred private network ' - 'address for one or\n' - 'more entities. Machines and ' - 'units are supported.', + '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/SSHAddressResults'}}, + 'Result': {'$ref': '#/definitions/TokenResults'}}, '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'}}, + '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'}, - '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'}}, + '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(SSHAddressesResults) - async def AllAddresses(self, entities=None): + @ReturnMapping(ErrorResults) + async def ConsumeRemoteRelationChanges(self, changes=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. + ConsumeRemoteRelationChanges consumes changes to settings originating + from the remote/offering side of relations. - entities : typing.Sequence[~Entity] - Returns -> SSHAddressesResults + changes : typing.Sequence[~RemoteRelationChangeEvent] + Returns -> ErrorResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) # map input types to rpc msg _params = dict() - msg = dict(type='SSHClient', - request='AllAddresses', + msg = dict(type='RemoteRelations', + request='ConsumeRemoteRelationChanges', version=2, params=_params) - _params['entities'] = entities + _params['changes'] = changes reply = await self.rpc(msg) return reply - @ReturnMapping(SSHAddressResults) - async def PrivateAddress(self, entities=None): + @ReturnMapping(ControllerAPIInfoResults) + async def ControllerAPIInfoForModels(self, entities=None): ''' - PrivateAddress reports the preferred private network address for one or - more entities. Machines and units are supported. + ControllerAPIInfoForModels returns the controller api connection details for the specified models. entities : typing.Sequence[~Entity] - Returns -> SSHAddressResults + 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='SSHClient', - request='PrivateAddress', + msg = dict(type='RemoteRelations', + request='ControllerAPIInfoForModels', version=2, params=_params) _params['entities'] = entities @@ -12943,20 +4370,19 @@ async def PrivateAddress(self, entities=None): - @ReturnMapping(SSHProxyResult) - async def Proxy(self): + @ReturnMapping(ControllerConfigResult) + async def ControllerConfig(self): ''' - Proxy returns whether SSH connections should be proxied through the - controller hosts for the model associated with the API connection. + ControllerConfig returns the controller's configuration. - Returns -> SSHProxyResult + Returns -> ControllerConfigResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='SSHClient', - request='Proxy', + msg = dict(type='RemoteRelations', + request='ControllerConfig', version=2, params=_params) @@ -12965,46 +4391,21 @@ async def Proxy(self): - @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): + @ReturnMapping(TokenResults) + async def ExportEntities(self, entities=None): ''' - PublicKeys returns the public SSH hosts for one or more - entities. Machines and units are supported. + ExportEntities allocates unique, remote entity IDs for the given entities in the local model. entities : typing.Sequence[~Entity] - Returns -> SSHPublicKeysResults + 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='SSHClient', - request='PublicKeys', + msg = dict(type='RemoteRelations', + request='ExportEntities', version=2, params=_params) _params['entities'] = entities @@ -13013,522 +4414,238 @@ async def PublicKeys(self, entities=None): -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): + @ReturnMapping(StringResults) + async def GetTokens(self, args=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.) + GetTokens returns the token associated with the entities with the given tags for the given models. - claims : typing.Sequence[~SingularClaim] - Returns -> ErrorResults + args : typing.Sequence[~GetTokenArg] + Returns -> StringResults ''' - if claims is not None and not isinstance(claims, (bytes, str, list)): - raise Exception("Expected claims to be a Sequence, received: {}".format(type(claims))) + 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='Singular', - request='Claim', + msg = dict(type='RemoteRelations', + request='GetTokens', version=2, params=_params) - _params['claims'] = claims + _params['Args'] = args reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def Wait(self, entities=None): + async def ImportRemoteEntities(self, args=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.) + ImportRemoteEntities adds entities to the remote entities collection with the specified opaque tokens. - entities : typing.Sequence[~Entity] + args : typing.Sequence[~RemoteEntityTokenArg] Returns -> ErrorResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if args is not None and not isinstance(args, (bytes, str, list)): + raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() - msg = dict(type='Singular', - request='Wait', + msg = dict(type='RemoteRelations', + request='ImportRemoteEntities', version=2, params=_params) - _params['entities'] = entities + _params['Args'] = args 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): + + + @ReturnMapping(RemoteRelationResults) + async def Relations(self, entities=None): ''' - spaces : typing.Sequence[~CreateSpaceParams] - Returns -> ErrorResults + Relations returns information about the cross-model relations with the specified keys + in the local model. + + entities : typing.Sequence[~Entity] + Returns -> RemoteRelationResults ''' - 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 entities is not None and not isinstance(entities, (bytes, str, 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='CreateSpaces', + msg = dict(type='RemoteRelations', + request='Relations', version=2, params=_params) - _params['spaces'] = spaces + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ListSpacesResults) - async def ListSpaces(self): + @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. - Returns -> ListSpacesResults + 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='Spaces', - request='ListSpaces', + msg = dict(type='RemoteRelations', + request='RemoteApplications', version=2, params=_params) - + _params['entities'] = entities 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): + @ReturnMapping(ErrorResults) + async def SaveMacaroons(self, args=None): ''' - ModelConfig returns the current model's configuration. - + SaveMacaroons saves the macaroons for the given entities. - Returns -> ModelConfigResult + 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='StatusHistory', - request='ModelConfig', + msg = dict(type='RemoteRelations', + request='SaveMacaroons', version=2, params=_params) - + _params['Args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Prune(self, max_history_mb=None, max_history_time=None): + @ReturnMapping(ErrorResults) + async def SetRemoteApplicationsStatus(self, entities=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. + SetRemoteApplicationsStatus sets the status for the specified remote applications. - max_history_mb : int - max_history_time : int - Returns -> None + entities : typing.Sequence[~EntityStatusArgs] + Returns -> ErrorResults ''' - 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))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='StatusHistory', - request='Prune', + msg = dict(type='RemoteRelations', + request='SetRemoteApplicationsStatus', version=2, params=_params) - _params['max-history-mb'] = max_history_mb - _params['max-history-time'] = max_history_time + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def WatchForModelConfigChanges(self): + @ReturnMapping(ErrorResults) + async def UpdateControllersForModels(self, changes=None): ''' - WatchForModelConfigChanges returns a NotifyWatcher that observes - changes to the model configuration. - Note that although the NotifyWatchResult contains an Error field, - it's not used because we are only returning a single watcher, - so we use the regular error return. - + 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. - Returns -> NotifyWatchResult + 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='StatusHistory', - request='WatchForModelConfigChanges', + msg = dict(type='RemoteRelations', + request='UpdateControllersForModels', version=2, params=_params) - + _params['changes'] = changes 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): + @ReturnMapping(RemoteRelationWatchResults) + async def WatchLocalRelationChanges(self, entities=None): ''' - subnets : typing.Sequence[~AddSubnetParams] - Returns -> ErrorResults + 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 subnets is not None and not isinstance(subnets, (bytes, str, list)): - raise Exception("Expected subnets to be a Sequence, received: {}".format(type(subnets))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Subnets', - request='AddSubnets', + msg = dict(type='RemoteRelations', + request='WatchLocalRelationChanges', version=2, params=_params) - _params['subnets'] = subnets + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(SpaceResults) - async def AllSpaces(self): + @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. - Returns -> SpaceResults + 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='Subnets', - request='AllSpaces', + msg = dict(type='RemoteRelations', + request='WatchRemoteApplicationRelations', version=2, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ZoneResults) - async def AllZones(self): - ''' + @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 -> ZoneResults + Returns -> StringsWatchResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='Subnets', - request='AllZones', + msg = dict(type='RemoteRelations', + request='WatchRemoteApplications', version=2, params=_params) @@ -13537,51 +4654,89 @@ async def AllZones(self): - @ReturnMapping(ListSubnetsResults) - async def ListSubnets(self, space_tag=None, zone=None): - ''' - space_tag : str - zone : str - Returns -> ListSubnetsResults + @ReturnMapping(StringsWatchResult) + async def WatchRemoteRelations(self): ''' - 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))) + 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. + - if zone is not None and not isinstance(zone, (bytes, str)): - raise Exception("Expected zone to be a str, received: {}".format(type(zone))) + Returns -> StringsWatchResult + ''' # map input types to rpc msg _params = dict() - msg = dict(type='Subnets', - request='ListSubnets', + msg = dict(type='RemoteRelations', + request='WatchRemoteRelations', version=2, params=_params) - _params['space-tag'] = space_tag - _params['zone'] = zone + reply = await self.rpc(msg) return reply -class UpgradeSeriesFacade(Type): - name = 'UpgradeSeries' +class ResourcesFacade(Type): + name = 'Resources' 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'}, + 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'], @@ -13597,302 +4752,162 @@ class UpgradeSeriesFacade(Type): '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'}, + 'ListResourcesArgs': {'additionalProperties': False, + 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, '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'}, + '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': ['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'], + 'required': ['ErrorResult', + 'resources', + 'charm-store-resources', + 'unit-resources'], 'type': 'object'}, - 'UpdateSeriesArgs': {'additionalProperties': False, - 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, - 'type': 'array'}}, - 'required': ['args'], + 'ResourcesResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ResourcesResult'}, + 'type': 'array'}}, + 'required': ['results'], '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'}}, + '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'}, - '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'}}, + '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(StringResults) - async def CurrentSeries(self, entities=None): + @ReturnMapping(AddPendingResourcesResult) + async def AddPendingResources(self, entity=None, charm_origin=None, macaroon=None, resources=None, tag=None, url=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. + 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. - entities : typing.Sequence[~Entity] - Returns -> StringResults + entity : Entity + charm_origin : CharmOrigin + macaroon : Macaroon + resources : typing.Sequence[~CharmResource] + tag : str + url : str + Returns -> AddPendingResourcesResult ''' - if entities is not None and not isinstance(entities, (bytes, str, 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 + 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))) - @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. + if resources is not None and not isinstance(resources, (bytes, str, list)): + raise Exception("Expected resources to be a Sequence, received: {}".format(type(resources))) - 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))) + 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='UpgradeSeries', - request='FinishUpgradeSeries', + msg = dict(type='Resources', + request='AddPendingResources', version=2, params=_params) - _params['args'] = args + _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(UpgradeSeriesStatusResults) - async def MachineStatus(self, entities=None): + @ReturnMapping(ResourcesResults) + async def ListResources(self, entities=None): ''' - MachineStatus gets the current upgrade-series status of a machine. + ListResources returns the list of resources for the given application. entities : typing.Sequence[~Entity] - Returns -> UpgradeSeriesStatusResults + 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='UpgradeSeries', - request='MachineStatus', + msg = dict(type='Resources', + request='ListResources', version=2, params=_params) _params['entities'] = entities @@ -13901,42 +4916,23 @@ async def MachineStatus(self, entities=None): - @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 - - +class ResumerFacade(Type): + name = 'Resumer' + version = 2 + schema = {'properties': {'ResumeTransactions': {'type': 'object'}}, 'type': 'object'} + - @ReturnMapping(PinnedLeadershipResult) - async def PinnedLeadership(self): + @ReturnMapping(None) + async def ResumeTransactions(self): ''' - PinnedLeadership returns all pinned applications and the entities that - require their pinned behaviour, for leadership in the current model. - - Returns -> PinnedLeadershipResult + Returns -> None ''' # map input types to rpc msg _params = dict() - msg = dict(type='UpgradeSeries', - request='PinnedLeadership', + msg = dict(type='Resumer', + request='ResumeTransactions', version=2, params=_params) @@ -13945,122 +4941,114 @@ async def PinnedLeadership(self): - @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 - - +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 SetUpgradeSeriesUnitStatus(self, params=None): + async def Claim(self, claims=None): ''' - SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit. - If no upgrade is in progress an error is returned instead. + 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.) - params : typing.Sequence[~UpgradeSeriesStatusParam] + claims : typing.Sequence[~SingularClaim] Returns -> ErrorResults ''' - if params is not None and not isinstance(params, (bytes, str, list)): - raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + if 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='UpgradeSeries', - request='SetUpgradeSeriesUnitStatus', + msg = dict(type='Singular', + request='Claim', version=2, params=_params) - _params['params'] = params + _params['claims'] = claims reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def StartUnitCompletion(self, entities=None, message=None): + async def Wait(self, entities=None): ''' - StartUnitCompletion starts the upgrade series completion phase for all subordinate - units of a given machine. + 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] - 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', + msg = dict(type='Singular', + request='Wait', version=2, params=_params) _params['entities'] = entities @@ -14069,45 +5057,84 @@ async def UnitsCompleted(self, entities=None): - @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 - - +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(PinApplicationsResults) - async def UnpinMachineApplications(self): + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): ''' - UnpinMachineApplications unpins leadership for applications represented by - units running on the auth'd machine. + ModelConfig returns the current model's configuration. - Returns -> PinApplicationsResults + Returns -> ModelConfigResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='UpgradeSeries', - request='UnpinMachineApplications', + msg = dict(type='StatusHistory', + request='ModelConfig', version=2, params=_params) @@ -14116,49 +5143,56 @@ async def UnpinMachineApplications(self): - @ReturnMapping(UpgradeSeriesStatusResults) - async def UpgradeSeriesUnitStatus(self, entities=None): + @ReturnMapping(None) + async def Prune(self, max_history_mb=None, max_history_time=None): ''' - UpgradeSeriesUnitStatus returns the current preparation status of an - upgrading unit. - If no series upgrade is in progress an error is returned instead. + Prune endpoint removes status history entries until + only the ones newer than now - p.MaxHistoryTime remain and + the history is smaller than p.MaxHistoryMB. - entities : typing.Sequence[~Entity] - Returns -> UpgradeSeriesStatusResults + max_history_mb : int + max_history_time : int + 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))) + 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='UpgradeSeries', - request='UpgradeSeriesUnitStatus', + msg = dict(type='StatusHistory', + request='Prune', version=2, params=_params) - _params['entities'] = entities + _params['max-history-mb'] = max_history_mb + _params['max-history-time'] = max_history_time reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchUpgradeSeriesNotifications(self, entities=None): + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): ''' - WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks. + 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. - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + + Returns -> NotifyWatchResult ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='StatusHistory', + request='WatchForModelConfigChanges', version=2, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply @@ -14289,341 +5323,6 @@ async def WriteAgentState(self, args=None): -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 diff --git a/juju/client/_client3.py b/juju/client/_client3.py index f25d588ca..b05667309 100644 --- a/juju/client/_client3.py +++ b/juju/client/_client3.py @@ -5,452 +5,6 @@ from juju.client._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 @@ -1237,902 +791,585 @@ async def rpc(self, msg): -class ApplicationFacade(Type): - name = 'Application' +class BackupsFacade(Type): + name = 'Backups' 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'], + schema = {'definitions': {'BackupsCreateArgs': {'additionalProperties': False, + 'properties': {'no-download': {'type': 'boolean'}, + 'notes': {'type': 'string'}}, + 'required': ['notes', 'no-download'], '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'], + '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'}, - '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'}}, + '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(AddRelationResults) - async def AddRelation(self, endpoints=None): - ''' - endpoints : typing.Sequence[str] - Returns -> AddRelationResults + @ReturnMapping(BackupsMetadataResult) + async def Create(self, no_download=None, notes=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='AddRelation', - version=3, - params=_params) - _params['endpoints'] = endpoints - reply = await self.rpc(msg) - return reply - - + Create is the API method that requests juju to create a new backup + of its state. - @ReturnMapping(AddApplicationUnitsResults) - async def AddUnits(self, application=None, num_units=None, placement=None): - ''' - application : str - num_units : int - placement : typing.Sequence[~Placement] - Returns -> AddApplicationUnitsResults + no_download : bool + notes : str + Returns -> BackupsMetadataResult ''' - 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 - - + 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))) - @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))) + 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='Application', - request='CharmRelations', + msg = dict(type='Backups', + request='Create', version=3, params=_params) - _params['application'] = application + _params['no-download'] = no_download + _params['notes'] = notes 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 - - +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 Destroy(self, application=None): - ''' - application : str - Returns -> None + async def UpdateFromPublishedImages(self): ''' - 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 - + UpdateFromPublishedImages is now a no-op. + It is retained for compatibility. - @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', + msg = dict(type='ImageMetadata', + request='UpdateFromPublishedImages', 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 - - +class InstanceMutaterFacade(Type): + name = 'InstanceMutater' + version = 3 + 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'}, + '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(ApplicationGetResults) - async def Get(self, application=None): + @ReturnMapping(CharmProfilingInfoResult) + async def CharmProfilingInfo(self, tag=None): ''' - application : str - Returns -> ApplicationGetResults + 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 application is not None and not isinstance(application, (bytes, str)): - raise Exception("Expected application to be a str, received: {}".format(type(application))) + 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='Get', + msg = dict(type='InstanceMutater', + request='CharmProfilingInfo', version=3, params=_params) - _params['application'] = application + _params['tag'] = tag reply = await self.rpc(msg) return reply - @ReturnMapping(StringResult) - async def GetCharmURL(self, application=None): + @ReturnMapping(ContainerTypeResult) + async def ContainerType(self, tag=None): ''' - application : str - Returns -> StringResult + ContainerType returns the container type of a machine. + + tag : str + Returns -> ContainerTypeResult ''' - if application is not None and not isinstance(application, (bytes, str)): - raise Exception("Expected application to be a str, received: {}".format(type(application))) + 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='GetCharmURL', + msg = dict(type='InstanceMutater', + request='ContainerType', version=3, params=_params) - _params['application'] = application + _params['tag'] = tag reply = await self.rpc(msg) return reply - @ReturnMapping(GetConstraintsResults) - async def GetConstraints(self, application=None): + @ReturnMapping(LifeResults) + async def Life(self, entities=None): ''' - application : str - Returns -> GetConstraintsResults + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults ''' - if application is not None and not isinstance(application, (bytes, str)): - raise Exception("Expected application to be a str, received: {}".format(type(application))) + if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='InstanceMutater', + request='Life', version=3, params=_params) - _params['application'] = application + _params['entities'] = entities 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 + @ReturnMapping(ErrorResults) + async def SetCharmProfiles(self, args=None): ''' - if application is not None and not isinstance(application, (bytes, str)): - raise Exception("Expected application to be a str, received: {}".format(type(application))) + SetCharmProfiles records the given slice of charm profile names. - if options is not None and not isinstance(options, dict): - raise Exception("Expected options to be a Mapping, received: {}".format(type(options))) + 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='Application', - request='Set', + msg = dict(type='InstanceMutater', + request='SetCharmProfiles', version=3, params=_params) - _params['application'] = application - _params['options'] = options + _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_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 + @ReturnMapping(ErrorResults) + async def SetModificationStatus(self, entities=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))) + 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. - 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))) + 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='Application', - request='SetCharm', + msg = dict(type='InstanceMutater', + request='SetModificationStatus', 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 + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def SetConstraints(self, application=None, constraints=None): - ''' - application : str - constraints : Value - Returns -> None + @ReturnMapping(StringsWatchResult) + async def WatchContainers(self, tag=None): ''' - if application is not None and not isinstance(application, (bytes, str)): - raise Exception("Expected application to be a str, received: {}".format(type(application))) + WatchContainers starts a watcher to track Containers on a given + machine. - if constraints is not None and not isinstance(constraints, (dict, Value)): - raise Exception("Expected constraints to be a Value, received: {}".format(type(constraints))) + 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='Application', - request='SetConstraints', + msg = dict(type='InstanceMutater', + request='WatchContainers', version=3, params=_params) - _params['application'] = application - _params['constraints'] = constraints + _params['tag'] = tag reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetMetricCredentials(self, creds=None): + @ReturnMapping(NotifyWatchResults) + async def WatchLXDProfileVerificationNeeded(self, entities=None): ''' - creds : typing.Sequence[~ApplicationMetricCredential] - Returns -> ErrorResults + WatchLXDProfileVerificationNeeded starts a watcher to track Applications with + LXD Profiles. + + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' - 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 entities is not None and not isinstance(entities, (bytes, str, 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='SetMetricCredentials', + msg = dict(type='InstanceMutater', + request='WatchLXDProfileVerificationNeeded', version=3, params=_params) - _params['creds'] = creds + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Unexpose(self, application=None): - ''' - application : str - Returns -> None + @ReturnMapping(StringsWatchResult) + async def WatchMachines(self): ''' - 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 - + 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. - @ReturnMapping(None) - async def Unset(self, application=None, options=None): - ''' - application : str - options : typing.Sequence[str] - Returns -> None + Returns -> StringsWatchResult ''' - 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', + msg = dict(type='InstanceMutater', + request='WatchMachines', 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 + @ReturnMapping(StringsWatchResult) + async def WatchModelMachines(self): ''' - 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))) + 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. - 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))) + Returns -> StringsWatchResult + ''' # map input types to rpc msg _params = dict() - msg = dict(type='Application', - request='Update', + msg = dict(type='InstanceMutater', + request='WatchModelMachines', 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' +class MigrationMasterFacade(Type): + name = 'MigrationMaster' 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, + schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, @@ -2140,502 +1377,69 @@ class ApplicationOffersFacade(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'}, - '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'], + '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'}, - '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 BackupsFacade(Type): - name = 'Backups' - version = 3 - schema = {'definitions': {'BackupsCreateArgs': {'additionalProperties': False, - 'properties': {'no-download': {'type': 'boolean'}, - 'notes': {'type': 'string'}}, - 'required': ['notes', 'no-download'], + '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'}, - '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'}, @@ -2647,10475 +1451,786 @@ class BackupsFacade(Type): '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 - 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 InstanceMutaterFacade(Type): - name = 'InstanceMutater' - version = 3 - 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'}, - '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(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=3, - 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=3, - 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=3, - 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=3, - 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=3, - 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=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() - 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'}, - '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'], - '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.', - 'properties': {'Params': {'$ref': '#/definitions/PrechecksArgs'}}, - '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, 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 -> 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 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): - ''' - GetModelConstraints returns the constraints for the model. - - - Returns -> GetConstraintsResults - ''' - - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelConfig', - request='GetModelConstraints', - version=3, - params=_params) - - reply = 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='ModelConfig', - request='ModelGet', - 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='ModelConfig', - 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='ModelConfig', - request='ModelUnset', - version=3, - 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=3, - 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=3, - params=_params) - - 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='ModelConfig', - 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='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 - - - -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'], + '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'], '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'], + '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'}, - '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'], + 'SetMigrationPhaseArgs': {'additionalProperties': False, + 'properties': {'phase': {'type': 'string'}}, + 'required': ['phase'], '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'], + 'SetMigrationStatusMessageArgs': {'additionalProperties': False, + 'properties': {'message': {'type': 'string'}}, + 'required': ['message'], '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'}}, + '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'}, - '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'}}, + '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.', + 'properties': {'Params': {'$ref': '#/definitions/PrechecksArgs'}}, + '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'}, - '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'}}, + 'Reap': {'description': 'Reap removes all documents for the ' + 'model associated with the API\n' + 'connection.', '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'}}, + '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'}, - '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'}}, + '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(LifeResults) - async def AttachmentLife(self, ids=None): - ''' - ids : typing.Sequence[~MachineStorageId] - Returns -> LifeResults + @ReturnMapping(SerializedModel) + async def Export(self): ''' - 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 - + Export serializes the model associated with the API connection. - @ReturnMapping(ErrorResults) - async def EnsureDead(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + Returns -> SerializedModel ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='MigrationMaster', + request='Export', 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 + @ReturnMapping(MasterMigrationStatus) + async def MigrationStatus(self): ''' - 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 - + MigrationStatus returns the details and progress of the latest + model migration. - @ReturnMapping(FilesystemParamsResults) - async def FilesystemParams(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> FilesystemParamsResults + Returns -> MasterMigrationStatus ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='MigrationMaster', + request='MigrationStatus', 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 + @ReturnMapping(StringResult) + async def MinionReportTimeout(self): ''' - if entities is not None and not isinstance(entities, (bytes, str, 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 - + 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. - @ReturnMapping(LifeResults) - async def Life(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> LifeResults + Returns -> StringResult ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='StorageProvisioner', - request='Life', + msg = dict(type='MigrationMaster', + request='MinionReportTimeout', 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 + @ReturnMapping(MinionReports) + async def MinionReports(self): ''' - if entities is not None and not isinstance(entities, (bytes, str, 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 - + MinionReports returns details of the reports made by migration + minions to the controller for the current migration phase. - @ReturnMapping(ErrorResults) - async def RemoveAttachment(self, ids=None): - ''' - ids : typing.Sequence[~MachineStorageId] - Returns -> ErrorResults + Returns -> MinionReports ''' - 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', + msg = dict(type='MigrationMaster', + request='MinionReports', 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 + @ReturnMapping(MigrationModelInfo) + async def ModelInfo(self): ''' - 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 - + ModelInfo returns essential information about the model to be + migrated. - @ReturnMapping(ErrorResults) - async def SetFilesystemInfo(self, filesystems=None): - ''' - filesystems : typing.Sequence[~Filesystem] - Returns -> ErrorResults + Returns -> MigrationModelInfo ''' - 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', + msg = dict(type='MigrationMaster', + request='ModelInfo', version=3, params=_params) - _params['filesystems'] = filesystems + reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetStatus(self, entities=None): + @ReturnMapping(None) + async def Prechecks(self, target_controller_version=None): ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + Prechecks performs pre-migration checks on the model and + (source) controller. + + target_controller_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))) + 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='StorageProvisioner', - request='SetStatus', + msg = dict(type='MigrationMaster', + request='Prechecks', version=3, params=_params) - _params['entities'] = entities + _params['target-controller-version'] = target_controller_version reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetVolumeAttachmentInfo(self, volume_attachments=None): + @ReturnMapping(None) + async def ProcessRelations(self, controller_alias=None): ''' - volume_attachments : typing.Sequence[~VolumeAttachment] - Returns -> ErrorResults + 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 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 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='StorageProvisioner', - request='SetVolumeAttachmentInfo', + msg = dict(type='MigrationMaster', + request='ProcessRelations', version=3, params=_params) - _params['volume-attachments'] = volume_attachments + _params['controller-alias'] = controller_alias reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetVolumeInfo(self, volumes=None): + @ReturnMapping(None) + async def Reap(self): ''' - volumes : typing.Sequence[~Volume] - Returns -> ErrorResults + Reap removes all documents for the model associated with the API + connection. + + + Returns -> None ''' - 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', + msg = dict(type='MigrationMaster', + request='Reap', version=3, params=_params) - _params['volumes'] = volumes + reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def UpdateStatus(self, entities=None): + @ReturnMapping(None) + async def SetPhase(self, phase=None): ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + 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 entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + 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='StorageProvisioner', - request='UpdateStatus', + msg = dict(type='MigrationMaster', + request='SetPhase', version=3, params=_params) - _params['entities'] = entities + _params['phase'] = phase reply = await self.rpc(msg) return reply - @ReturnMapping(VolumeAttachmentParamsResults) - async def VolumeAttachmentParams(self, ids=None): + @ReturnMapping(None) + async def SetStatusMessage(self, message=None): ''' - ids : typing.Sequence[~MachineStorageId] - Returns -> VolumeAttachmentParamsResults + 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 ids is not None and not isinstance(ids, (bytes, str, list)): - raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) + 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='StorageProvisioner', - request='VolumeAttachmentParams', + msg = dict(type='MigrationMaster', + request='SetStatusMessage', version=3, params=_params) - _params['ids'] = ids + _params['message'] = message reply = await self.rpc(msg) return reply - @ReturnMapping(VolumeAttachmentResults) - async def VolumeAttachments(self, ids=None): + @ReturnMapping(NotifyWatchResult) + async def Watch(self): ''' - ids : typing.Sequence[~MachineStorageId] - Returns -> VolumeAttachmentResults + 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 ''' - 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', + msg = dict(type='MigrationMaster', + request='Watch', version=3, params=_params) - _params['ids'] = ids + reply = await self.rpc(msg) return reply - @ReturnMapping(BlockDeviceResults) - async def VolumeBlockDevices(self, ids=None): + @ReturnMapping(NotifyWatchResult) + async def WatchMinionReports(self): ''' - ids : typing.Sequence[~MachineStorageId] - Returns -> BlockDeviceResults + WatchMinionReports sets up a watcher which reports when a report + for a migration minion has arrived. + + + Returns -> NotifyWatchResult ''' - if ids is not None and not isinstance(ids, (bytes, str, list)): - raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() - msg = dict(type='StorageProvisioner', - request='VolumeBlockDevices', + msg = dict(type='MigrationMaster', + request='WatchMinionReports', version=3, params=_params) - _params['ids'] = ids + reply = await self.rpc(msg) return reply - @ReturnMapping(VolumeParamsResults) - async def VolumeParams(self, entities=None): +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): ''' - entities : typing.Sequence[~Entity] - Returns -> VolumeParamsResults + GetModelConstraints returns the constraints for the model. + + + Returns -> GetConstraintsResults ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='ModelConfig', + request='GetModelConstraints', version=3, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(VolumeResults) - async def Volumes(self, entities=None): + @ReturnMapping(ModelConfigResults) + async def ModelGet(self): ''' - entities : typing.Sequence[~Entity] - Returns -> VolumeResults + ModelGet implements the server-side part of the + model-config CLI command. + + + Returns -> ModelConfigResults ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='ModelConfig', + request='ModelGet', version=3, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchBlockDevices(self, entities=None): + @ReturnMapping(None) + async def ModelSet(self, config=None): ''' - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + ModelSet implements the server-side part of the + set-model-config CLI command. + + config : typing.Mapping[str, typing.Any] + 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))) + 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='StorageProvisioner', - request='WatchBlockDevices', + msg = dict(type='ModelConfig', + request='ModelSet', version=3, params=_params) - _params['entities'] = entities + _params['config'] = config reply = await self.rpc(msg) return reply - @ReturnMapping(MachineStorageIdsWatchResults) - async def WatchFilesystemAttachments(self, entities=None): + @ReturnMapping(None) + async def ModelUnset(self, keys=None): ''' - entities : typing.Sequence[~Entity] - Returns -> MachineStorageIdsWatchResults + ModelUnset implements the server-side part of the + set-model-config CLI command. + + keys : typing.Sequence[str] + 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))) + 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='StorageProvisioner', - request='WatchFilesystemAttachments', + msg = dict(type='ModelConfig', + request='ModelUnset', version=3, params=_params) - _params['entities'] = entities + _params['keys'] = keys reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResults) - async def WatchFilesystems(self, entities=None): + @ReturnMapping(StringResult) + async def SLALevel(self): ''' - entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + SLALevel returns the current sla level for the model. + + + Returns -> StringResult ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='StorageProvisioner', - request='WatchFilesystems', + msg = dict(type='ModelConfig', + request='SLALevel', version=3, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchMachines(self, entities=None): + @ReturnMapping(ModelSequencesResult) + async def Sequences(self): ''' - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + Sequences returns the model's sequence names and next values. + + + Returns -> ModelSequencesResult ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='ModelConfig', + request='Sequences', version=3, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(MachineStorageIdsWatchResults) - async def WatchVolumeAttachments(self, entities=None): + @ReturnMapping(None) + async def SetModelConstraints(self, application=None, constraints=None): ''' - entities : typing.Sequence[~Entity] - Returns -> MachineStorageIdsWatchResults + SetModelConstraints sets the constraints for the model. + + application : str + constraints : Value + 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))) + 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='StorageProvisioner', - request='WatchVolumeAttachments', + msg = dict(type='ModelConfig', + request='SetModelConstraints', version=3, params=_params) - _params['entities'] = entities + _params['application'] = application + _params['constraints'] = constraints reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResults) - async def WatchVolumes(self, entities=None): + @ReturnMapping(None) + async def SetSLALevel(self, modelslainfo=None, creds=None, level=None, owner=None): ''' - entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + SetSLALevel sets the sla level on the model. + + modelslainfo : ModelSLAInfo + creds : typing.Sequence[int] + level : str + owner : str + 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))) + 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='StorageProvisioner', - request='WatchVolumes', + msg = dict(type='ModelConfig', + request='SetSLALevel', version=3, params=_params) - _params['entities'] = entities + _params['ModelSLAInfo'] = modelslainfo + _params['creds'] = creds + _params['level'] = level + _params['owner'] = owner reply = await self.rpc(msg) return reply -class SubnetsFacade(Type): - name = 'Subnets' +class SSHClientFacade(Type): + name = 'SSHClient' 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'}, + 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, @@ -13124,125 +2239,147 @@ class SubnetsFacade(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'}, - 'ListSubnetsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/Subnet'}, - 'type': 'array'}}, - 'required': ['results'], + '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'}, - 'SpaceResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'tag': {'type': 'string'}}, - 'required': ['tag'], + '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\n' + 'entity in args. The result is ' + 'sorted with public addresses ' + 'first.\n' + 'Machines and units are ' + 'supported as entity types.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/SSHAddressesResults'}}, 'type': 'object'}, - 'SpaceResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/SpaceResult'}, - 'type': 'array'}}, - 'required': ['results'], + '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'}, - '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'}}, + '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(ErrorResults) - async def AddSubnets(self, subnets=None): + @ReturnMapping(SSHAddressesResults) + async def AllAddresses(self, entities=None): ''' - subnets : typing.Sequence[~AddSubnetParams] - Returns -> ErrorResults + AllAddresses reports all addresses that might have SSH listening for each + entity in args. The result is sorted with public addresses first. + Machines and units are supported as entity types. + + entities : typing.Sequence[~Entity] + Returns -> SSHAddressesResults ''' - if subnets is not None and not isinstance(subnets, (bytes, str, list)): - raise Exception("Expected subnets to be a Sequence, received: {}".format(type(subnets))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Subnets', - request='AddSubnets', + msg = dict(type='SSHClient', + request='AllAddresses', version=3, params=_params) - _params['subnets'] = subnets + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(SpaceResults) - async def AllSpaces(self): + @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. - Returns -> SpaceResults + 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='Subnets', - request='AllSpaces', + msg = dict(type='SSHClient', + request='PrivateAddress', version=3, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ZoneResults) - async def AllZones(self): + @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 -> ZoneResults + Returns -> SSHProxyResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='Subnets', - request='AllZones', + msg = dict(type='SSHClient', + request='Proxy', version=3, params=_params) @@ -13251,27 +2388,49 @@ async def AllZones(self): - @ReturnMapping(ListSubnetsResults) - async def ListSubnets(self, space_tag=None, zone=None): + @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 ''' - space_tag : str - zone : str - Returns -> ListSubnetsResults + if entities is not None and not isinstance(entities, (bytes, str, 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): ''' - 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))) + PublicKeys returns the public SSH hosts for one or more + entities. Machines and units are supported. - if zone is not None and not isinstance(zone, (bytes, str)): - raise Exception("Expected zone to be a str, received: {}".format(type(zone))) + 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='Subnets', - request='ListSubnets', + msg = dict(type='SSHClient', + request='PublicKeys', version=3, params=_params) - _params['space-tag'] = space_tag - _params['zone'] = zone + _params['entities'] = entities reply = await self.rpc(msg) return reply diff --git a/juju/client/_client4.py b/juju/client/_client4.py index 812956725..89dab3dd9 100644 --- a/juju/client/_client4.py +++ b/juju/client/_client4.py @@ -5,263 +5,138 @@ from juju.client._definitions import * -class ApplicationFacade(Type): - name = 'Application' +class ApplicationOffersFacade(Type): + name = 'ApplicationOffers' 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'], + 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'}, - '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'}, + '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': ['creds'], + 'required': ['source-model-tag', + 'offer-uuid', + 'offer-url', + 'offer-name', + 'application-description', + 'ApplicationOfferDetails', + 'application-name', + 'charm-url'], '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'}}, + 'ApplicationOfferDetails': {'additionalProperties': False, + 'properties': {'application-description': {'type': 'string'}, + 'bindings': {'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'}}, + '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'}, - 'ConsumeApplicationResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'local-name': {'type': 'string'}}, + 'ApplicationOffersResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationOfferResult'}, + 'type': 'array'}}, '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'}}, + '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'}, - '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'}}, + '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'}, - 'DestroyApplicationUnits': {'additionalProperties': False, - 'properties': {'unit-names': {'items': {'type': 'string'}, + 'ConsumeOfferDetailsResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ConsumeOfferDetailsResult'}, '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'}, + 'type': 'object'}, + 'DestroyApplicationOffers': {'additionalProperties': False, + 'properties': {'force': {'type': 'boolean'}, + 'offer-urls': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['offer-urls'], + 'type': 'object'}, + 'EndpointFilterAttributes': {'additionalProperties': False, + 'properties': {'interface': {'type': 'string'}, + 'name': {'type': 'string'}, + 'role': {'type': 'string'}}, + 'required': ['role', + 'interface', + 'name'], + 'type': 'object'}, + 'EntityStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'info': {'type': 'string'}, + 'since': {'format': 'date-time', + 'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['status', 'info', 'since'], + 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, - 'info': {'$ref': '#/definitions/ErrorInfo'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, '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'}, @@ -270,2090 +145,1706 @@ class ApplicationFacade(Type): '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'}, + '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'}, - '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'}, + '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'}, - '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'}, + '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'}, - 'scope': {'type': 'string'}}, + 'role': {'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'}}, + 'limit'], 'type': 'object'}, - 'DestroyUnit': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/DestroyUnitResults'}}, - 'type': 'object'}, - 'DestroyUnits': {'properties': {'Params': {'$ref': '#/definitions/DestroyApplicationUnits'}}, + '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'}, - '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'}}, + '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'}, - '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'}}, + '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'}, - 'Update': {'properties': {'Params': {'$ref': '#/definitions/ApplicationUpdate'}}, - 'type': 'object'}}, + 'RemoteApplicationInfo': {'description': 'RemoteApplicationInfo ' + 'returns information ' + 'about the requested ' + 'remote application.\n' + 'This call currently ' + 'has no client side ' + 'API, only there for ' + 'the Dashboard at ' + 'this stage.', + 'properties': {'Params': {'$ref': '#/definitions/OfferURLs'}, + 'Result': {'$ref': '#/definitions/RemoteApplicationInfoResults'}}, + 'type': 'object'}}, 'type': 'object'} - @ReturnMapping(AddRelationResults) - async def AddRelation(self, endpoints=None): + @ReturnMapping(ApplicationOffersResults) + async def ApplicationOffers(self, bakery_version=None, offer_urls=None): ''' - endpoints : typing.Sequence[str] - Returns -> AddRelationResults + ApplicationOffers gets details about remote applications that match given URLs. + + bakery_version : int + offer_urls : typing.Sequence[str] + Returns -> ApplicationOffersResults ''' - 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 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='Application', - request='AddRelation', + msg = dict(type='ApplicationOffers', + request='ApplicationOffers', version=4, params=_params) - _params['endpoints'] = endpoints + _params['bakery-version'] = bakery_version + _params['offer-urls'] = offer_urls 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 + @ReturnMapping(ErrorResults) + async def DestroyOffers(self, force=None, offer_urls=None): ''' - if application is not None and not isinstance(application, (bytes, str)): - raise Exception("Expected application to be a str, received: {}".format(type(application))) + DestroyOffers removes the offers specified by the given URLs, forcing if necessary. - 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))) + 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 placement is not None and not isinstance(placement, (bytes, str, list)): - raise Exception("Expected placement to be a Sequence, received: {}".format(type(placement))) + 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='Application', - request='AddUnits', + msg = dict(type='ApplicationOffers', + request='DestroyOffers', version=4, params=_params) - _params['application'] = application - _params['num-units'] = num_units - _params['placement'] = placement + _params['force'] = force + _params['offer-urls'] = offer_urls reply = await self.rpc(msg) return reply - @ReturnMapping(ApplicationCharmRelationsResults) - async def CharmRelations(self, application=None): - ''' - application : str - Returns -> ApplicationCharmRelationsResults + @ReturnMapping(QueryApplicationOffersResults) + async def FindApplicationOffers(self, filters=None): ''' - if application is not None and not isinstance(application, (bytes, str)): - raise Exception("Expected application to be a str, received: {}".format(type(application))) + FindApplicationOffers gets details about remote applications that match given filter. - # 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 + filters : typing.Sequence[~OfferFilter] + Returns -> QueryApplicationOffersResults ''' - if application is not None and not isinstance(application, (bytes, str)): - raise Exception("Expected application to be a str, received: {}".format(type(application))) + 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='Application', - request='Expose', + msg = dict(type='ApplicationOffers', + request='FindApplicationOffers', version=4, params=_params) - _params['application'] = application + _params['Filters'] = filters reply = await self.rpc(msg) return reply - @ReturnMapping(ApplicationGetResults) - async def Get(self, application=None): - ''' - application : str - Returns -> ApplicationGetResults + @ReturnMapping(ConsumeOfferDetailsResults) + async def GetConsumeDetails(self, offer_urls=None, user_tag=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='Get', - version=4, - params=_params) - _params['application'] = application - reply = await self.rpc(msg) - return reply - - + 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. - @ReturnMapping(StringResult) - async def GetCharmURL(self, application=None): - ''' - application : str - Returns -> StringResult + offer_urls : OfferURLs + user_tag : str + Returns -> ConsumeOfferDetailsResults ''' - 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 - - + 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))) - @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))) + 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='Application', - request='GetConstraints', + msg = dict(type='ApplicationOffers', + request='GetConsumeDetails', version=4, params=_params) - _params['application'] = application + _params['offer-urls'] = offer_urls + _params['user-tag'] = user_tag reply = await self.rpc(msg) return reply - @ReturnMapping(RemoteApplicationInfoResults) - async def RemoteApplicationInfo(self, application_urls=None): - ''' - application_urls : typing.Sequence[str] - Returns -> RemoteApplicationInfoResults + @ReturnMapping(QueryApplicationOffersResults) + async def ListApplicationOffers(self, filters=None): ''' - 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 - - + ListApplicationOffers gets deployed details about application offers that match given filter. + The results contain details about the deployed applications such as connection count. - @ReturnMapping(None) - async def Set(self, application=None, options=None): - ''' - application : str - options : typing.Mapping[str, str] - Returns -> None + filters : typing.Sequence[~OfferFilter] + Returns -> QueryApplicationOffersResults ''' - 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))) + 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='Application', - request='Set', + msg = dict(type='ApplicationOffers', + request='ListApplicationOffers', version=4, params=_params) - _params['application'] = application - _params['options'] = options + _params['Filters'] = filters 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 + @ReturnMapping(ErrorResults) + async def ModifyOfferAccess(self, changes=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 - - + ModifyOfferAccess changes the application offer access granted to users. - @ReturnMapping(None) - async def SetConstraints(self, application=None, constraints=None): - ''' - application : str - constraints : Value - Returns -> None + changes : typing.Sequence[~ModifyOfferAccess] + Returns -> ErrorResults ''' - 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))) + 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='Application', - request='SetConstraints', + msg = dict(type='ApplicationOffers', + request='ModifyOfferAccess', version=4, params=_params) - _params['application'] = application - _params['constraints'] = constraints + _params['changes'] = changes reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetMetricCredentials(self, creds=None): + async def Offer(self, offers=None): ''' - creds : typing.Sequence[~ApplicationMetricCredential] + Offer makes application endpoints available for consumption at a specified URL. + + offers : typing.Sequence[~AddApplicationOffer] 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))) + 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='Application', - request='SetMetricCredentials', + msg = dict(type='ApplicationOffers', + request='Offer', version=4, params=_params) - _params['creds'] = creds + _params['Offers'] = offers reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def Unexpose(self, application=None): - ''' - application : str - Returns -> None + @ReturnMapping(RemoteApplicationInfoResults) + async def RemoteApplicationInfo(self, bakery_version=None, offer_urls=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 - - + RemoteApplicationInfo returns information about the requested remote application. + This call currently has no client side API, only there for the Dashboard at this stage. - @ReturnMapping(None) - async def Unset(self, application=None, options=None): - ''' - application : str - options : typing.Sequence[str] - Returns -> None + bakery_version : int + offer_urls : typing.Sequence[str] + Returns -> RemoteApplicationInfoResults ''' - if application is not None and not isinstance(application, (bytes, str)): - raise Exception("Expected application to be a str, received: {}".format(type(application))) + 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 options is not None and not isinstance(options, (bytes, str, list)): - raise Exception("Expected options to be a Sequence, received: {}".format(type(options))) + 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='Application', - request='Unset', + msg = dict(type='ApplicationOffers', + request='RemoteApplicationInfo', version=4, params=_params) - _params['application'] = application - _params['options'] = options + _params['bakery-version'] = bakery_version + _params['offer-urls'] = offer_urls 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' +class CharmsFacade(Type): + name = 'Charms' 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'], + 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'}, - 'ConsumeOfferDetailsResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/ConsumeOfferDetailsResult'}, - 'type': 'array'}}, + 'ApplicationCharmPlacements': {'additionalProperties': False, + 'properties': {'placements': {'items': {'$ref': '#/definitions/ApplicationCharmPlacement'}, + 'type': 'array'}}, + 'required': ['placements'], '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'], + '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'}, - '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'], + 'CharmActionSpec': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'params': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}}, + 'required': ['description', 'params'], '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'}, + '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'}, - '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'], + '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'}, - 'OfferFilters': {'additionalProperties': False, - 'properties': {'Filters': {'items': {'$ref': '#/definitions/OfferFilter'}, - 'type': 'array'}}, - 'required': ['Filters'], + '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'}, - 'OfferURLs': {'additionalProperties': False, - 'properties': {'bakery-version': {'type': 'integer'}, - 'offer-urls': {'items': {'type': 'string'}, - 'type': 'array'}}, + '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'}, - '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'}, + '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'}, - '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'], + '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'}, - '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'}}, + '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'}, - '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'}}, + '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'}, - 'Offer': {'description': 'Offer makes application endpoints ' - 'available for consumption at a ' - 'specified URL.', - 'properties': {'Params': {'$ref': '#/definitions/AddApplicationOffers'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'RemoteApplicationInfo': {'description': 'RemoteApplicationInfo ' - 'returns information ' - 'about the requested ' - 'remote application.\n' - 'This call currently ' - 'has no client side ' - 'API, only there for ' - 'the Dashboard at ' - 'this stage.', - 'properties': {'Params': {'$ref': '#/definitions/OfferURLs'}, - 'Result': {'$ref': '#/definitions/RemoteApplicationInfoResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ApplicationOffersResults) - async def ApplicationOffers(self, bakery_version=None, offer_urls=None): - ''' - ApplicationOffers gets details about remote applications that match given URLs. - - bakery_version : int - offer_urls : typing.Sequence[str] - Returns -> ApplicationOffersResults - ''' - if bakery_version is not None and not isinstance(bakery_version, int): - raise Exception("Expected bakery_version to be a int, received: {}".format(type(bakery_version))) - - if offer_urls is not None and not isinstance(offer_urls, (bytes, str, list)): - raise Exception("Expected offer_urls to be a Sequence, received: {}".format(type(offer_urls))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='ApplicationOffers', - request='ApplicationOffers', - version=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 - - + '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(QueryApplicationOffersResults) - async def ListApplicationOffers(self, filters=None): + @ReturnMapping(CharmOriginResult) + async def AddCharm(self, charm_origin=None, force=None, series=None, url=None): ''' - ListApplicationOffers gets deployed details about application offers that match given filter. - The results contain details about the deployed applications such as connection count. + 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(). - filters : typing.Sequence[~OfferFilter] - Returns -> QueryApplicationOffersResults + charm_origin : CharmOrigin + force : bool + series : str + url : str + Returns -> CharmOriginResult ''' - if filters is not None and not isinstance(filters, (bytes, str, list)): - raise Exception("Expected filters to be a Sequence, received: {}".format(type(filters))) + 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='ApplicationOffers', - request='ListApplicationOffers', + msg = dict(type='Charms', + request='AddCharm', version=4, params=_params) - _params['Filters'] = filters + _params['charm-origin'] = charm_origin + _params['force'] = force + _params['series'] = series + _params['url'] = url reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def ModifyOfferAccess(self, changes=None): + @ReturnMapping(CharmOriginResult) + async def AddCharmWithAuthorization(self, charm_origin=None, force=None, macaroon=None, series=None, url=None): ''' - ModifyOfferAccess changes the application offer access granted to users. + 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(). - changes : typing.Sequence[~ModifyOfferAccess] - Returns -> ErrorResults + 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 changes is not None and not isinstance(changes, (bytes, str, list)): - raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + 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='ApplicationOffers', - request='ModifyOfferAccess', + msg = dict(type='Charms', + request='AddCharmWithAuthorization', version=4, params=_params) - _params['changes'] = changes + _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(ErrorResults) - async def Offer(self, offers=None): + @ReturnMapping(Charm) + async def CharmInfo(self, url=None): ''' - Offer makes application endpoints available for consumption at a specified URL. + CharmInfo returns information about the requested charm. - offers : typing.Sequence[~AddApplicationOffer] - Returns -> ErrorResults + url : str + Returns -> Charm ''' - if offers is not None and not isinstance(offers, (bytes, str, list)): - raise Exception("Expected offers to be a Sequence, received: {}".format(type(offers))) + 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='ApplicationOffers', - request='Offer', - version=4, + msg = dict(type='Charms', + request='CharmInfo', + version=4, params=_params) - _params['Offers'] = offers + _params['url'] = url reply = await self.rpc(msg) return reply - @ReturnMapping(RemoteApplicationInfoResults) - async def RemoteApplicationInfo(self, bakery_version=None, offer_urls=None): + @ReturnMapping(ErrorResults) + async def CheckCharmPlacement(self, placements=None): ''' - RemoteApplicationInfo returns information about the requested remote application. - This call currently has no client side API, only there for the Dashboard at this stage. + CheckCharmPlacement checks if a charm is allowed to be placed with in a + given application. - bakery_version : int - offer_urls : typing.Sequence[str] - Returns -> RemoteApplicationInfoResults + placements : typing.Sequence[~ApplicationCharmPlacement] + Returns -> ErrorResults ''' - 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))) + 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='ApplicationOffers', - request='RemoteApplicationInfo', + msg = dict(type='Charms', + request='CheckCharmPlacement', version=4, params=_params) - _params['bakery-version'] = bakery_version - _params['offer-urls'] = offer_urls + _params['placements'] = placements 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(DownloadInfoResults) + async def GetDownloadInfos(self, entities=None): + ''' + GetDownloadInfos attempts to get the bundle corresponding to the charm url + and origin. - @ReturnMapping(StringResult) - async def ExportBundle(self): + entities : typing.Sequence[~CharmURLAndOrigin] + Returns -> DownloadInfoResults ''' - ExportBundle exports the current model configuration as bundle. + if entities is not None and not isinstance(entities, (bytes, str, 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 - Returns -> StringResult + + @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='Bundle', - request='ExportBundle', + msg = dict(type='Charms', + request='IsMetered', version=4, params=_params) - + _params['url'] = url reply = await self.rpc(msg) return reply - @ReturnMapping(BundleChangesResults) - async def GetChanges(self, bundleurl=None, yaml=None): + @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 ''' - 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. + 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 + - bundleurl : str - yaml : str - Returns -> BundleChangesResults + + @ReturnMapping(CharmResourcesResults) + async def ListCharmResources(self, entities=None): ''' - if bundleurl is not None and not isinstance(bundleurl, (bytes, str)): - raise Exception("Expected bundleurl to be a str, received: {}".format(type(bundleurl))) + ListCharmResources returns a series of resources for a given charm. - if yaml is not None and not isinstance(yaml, (bytes, str)): - raise Exception("Expected yaml to be a str, received: {}".format(type(yaml))) + 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='Bundle', - request='GetChanges', + msg = dict(type='Charms', + request='ListCharmResources', version=4, params=_params) - _params['bundleURL'] = bundleurl - _params['yaml'] = yaml + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(BundleChangesMapArgsResults) - async def GetChangesMapArgs(self, bundleurl=None, yaml=None): + @ReturnMapping(ResolveCharmWithChannelResults) + async def ResolveCharms(self, macaroon=None, resolve=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 + ResolveCharms resolves the given charm URLs with an optionally specified + preferred channel. Channel provided via CharmOrigin. - bundleurl : str - yaml : str - Returns -> BundleChangesMapArgsResults + macaroon : Macaroon + resolve : typing.Sequence[~ResolveCharmWithChannel] + Returns -> ResolveCharmWithChannelResults ''' - if bundleurl is not None and not isinstance(bundleurl, (bytes, str)): - raise Exception("Expected bundleurl to be a str, received: {}".format(type(bundleurl))) + if macaroon is not None and not isinstance(macaroon, (dict, Macaroon)): + raise Exception("Expected macaroon to be a Macaroon, received: {}".format(type(macaroon))) - if yaml is not None and not isinstance(yaml, (bytes, str)): - raise Exception("Expected yaml to be a str, received: {}".format(type(yaml))) + 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='Bundle', - request='GetChangesMapArgs', + msg = dict(type='Charms', + request='ResolveCharms', version=4, params=_params) - _params['bundleURL'] = bundleurl - _params['yaml'] = yaml + _params['macaroon'] = macaroon + _params['resolve'] = resolve reply = await self.rpc(msg) return reply -class CharmsFacade(Type): - name = 'Charms' +class InstancePollerFacade(Type): + name = 'InstancePoller' 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'], + 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'}, - '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'], + 'Error': {'additionalProperties': False, + 'properties': {'code': {'type': 'string'}, + 'info': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'message': {'type': 'string'}}, + 'required': ['message', 'code'], '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'], + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, 'type': 'object'}, - 'CharmMetrics': {'additionalProperties': False, - 'properties': {'metrics': {'patternProperties': {'.*': {'$ref': '#/definitions/CharmMetric'}}, - 'type': 'object'}, - 'plan': {'$ref': '#/definitions/CharmPlan'}}, - 'required': ['metrics', 'plan'], + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], 'type': 'object'}, - 'CharmMount': {'additionalProperties': False, - 'properties': {'location': {'type': 'string'}, - 'storage': {'type': 'string'}}, + 'LifeResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'life': {'type': 'string'}}, + 'required': ['life'], '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'], + 'LifeResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, + 'type': 'array'}}, + 'required': ['results'], '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'], + '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'}, - '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'}, + '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'}, - 'name': {'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'}, - 'path': {'type': 'string'}, - 'revision': {'type': 'integer'}, - 'size': {'type': 'integer'}, - 'type': {'type': 'string'}}, - 'required': ['name', - 'type', - 'path', - 'origin', - 'revision', - 'fingerprint', - 'size'], + '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'}, - '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'], + 'NetworkRoute': {'additionalProperties': False, + 'properties': {'destination-cidr': {'type': 'string'}, + 'gateway-ip': {'type': 'string'}, + 'metric': {'type': 'integer'}}, + 'required': ['destination-cidr', + 'gateway-ip', + 'metric'], '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'], + 'NotifyWatchResult': {'additionalProperties': False, + 'properties': {'NotifyWatcherId': {'type': 'string'}, + 'error': {'$ref': '#/definitions/Error'}}, + 'required': ['NotifyWatcherId'], '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'], + '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'}, - 'CharmsListResult': {'additionalProperties': False, - 'properties': {'charm-urls': {'items': {'type': 'string'}, - 'type': 'array'}}, - 'required': ['charm-urls'], + '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'}, - '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'], + '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'}, - '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'], + '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'}, - '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'}}, + '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(CharmOriginResult) - async def AddCharm(self, charm_origin=None, force=None, series=None, url=None): + @ReturnMapping(BoolResults) + async def AreManuallyProvisioned(self, entities=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(). + AreManuallyProvisioned returns whether each given entity is + manually provisioned or not. Only machine tags are accepted. - charm_origin : CharmOrigin - force : bool - series : str - url : str - Returns -> CharmOriginResult + entities : typing.Sequence[~Entity] + Returns -> BoolResults ''' - 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 entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) - 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='InstancePoller', + request='AreManuallyProvisioned', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply - 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))) + + @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='Charms', - request='AddCharm', + msg = dict(type='InstancePoller', + request='InstanceId', version=4, params=_params) - _params['charm-origin'] = charm_origin - _params['force'] = force - _params['series'] = series - _params['url'] = url + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(CharmOriginResult) - async def AddCharmWithAuthorization(self, charm_origin=None, force=None, macaroon=None, series=None, url=None): + @ReturnMapping(StatusResults) + async def InstanceStatus(self, entities=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. + InstanceStatus returns the instance status for each given entity. + Only machine tags are accepted. - charm_origin : CharmOrigin - force : bool - macaroon : Macaroon - series : str - url : str - Returns -> CharmOriginResult + entities : typing.Sequence[~Entity] + Returns -> StatusResults ''' - 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 entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) - 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='InstancePoller', + request='InstanceStatus', + version=4, + params=_params) + _params['entities'] = entities + reply = await self.rpc(msg) + return reply - 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))) + @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='Charms', - request='AddCharmWithAuthorization', + msg = dict(type='InstancePoller', + request='Life', version=4, params=_params) - _params['charm-origin'] = charm_origin - _params['force'] = force - _params['macaroon'] = macaroon - _params['series'] = series - _params['url'] = url + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(Charm) - async def CharmInfo(self, url=None): + @ReturnMapping(ModelConfigResult) + async def ModelConfig(self): ''' - CharmInfo returns information about the requested charm. + ModelConfig returns the current model's configuration. - url : str - Returns -> Charm + + Returns -> ModelConfigResult ''' - 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', + msg = dict(type='InstancePoller', + request='ModelConfig', version=4, params=_params) - _params['url'] = url + reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def CheckCharmPlacement(self, placements=None): + @ReturnMapping(MachineAddressesResults) + async def ProviderAddresses(self, entities=None): ''' - CheckCharmPlacement checks if a charm is allowed to be placed with in a - given application. + ProviderAddresses returns the list of all known provider addresses + for each given entity. Only machine tags are accepted. - placements : typing.Sequence[~ApplicationCharmPlacement] - Returns -> ErrorResults + entities : typing.Sequence[~Entity] + Returns -> MachineAddressesResults ''' - if placements is not None and not isinstance(placements, (bytes, str, list)): - raise Exception("Expected placements to be a Sequence, received: {}".format(type(placements))) + if entities is not None and not isinstance(entities, (bytes, str, 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='CheckCharmPlacement', + msg = dict(type='InstancePoller', + request='ProviderAddresses', version=4, params=_params) - _params['placements'] = placements + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(DownloadInfoResults) - async def GetDownloadInfos(self, entities=None): + @ReturnMapping(ErrorResults) + async def SetInstanceStatus(self, entities=None): ''' - GetDownloadInfos attempts to get the bundle corresponding to the charm url - and origin. + SetInstanceStatus updates the instance status for each given entity. + Only machine tags are accepted. - entities : typing.Sequence[~CharmURLAndOrigin] - Returns -> DownloadInfoResults + 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='Charms', - request='GetDownloadInfos', + msg = dict(type='InstancePoller', + request='SetInstanceStatus', version=4, params=_params) _params['entities'] = entities @@ -2362,69 +1853,74 @@ async def GetDownloadInfos(self, entities=None): - @ReturnMapping(IsMeteredResult) - async def IsMetered(self, url=None): + @ReturnMapping(ErrorResults) + async def SetProviderAddresses(self, machine_addresses=None): ''' - IsMetered returns whether or not the charm is metered. + SetProviderAddresses updates the list of known provider addresses + for each given entity. Only machine tags are accepted. - url : str - Returns -> IsMeteredResult + machine_addresses : typing.Sequence[~MachineAddresses] + Returns -> ErrorResults ''' - if url is not None and not isinstance(url, (bytes, str)): - raise Exception("Expected url to be a str, received: {}".format(type(url))) + 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='Charms', - request='IsMetered', + msg = dict(type='InstancePoller', + request='SetProviderAddresses', version=4, params=_params) - _params['url'] = url + _params['machine-addresses'] = machine_addresses reply = await self.rpc(msg) return reply - @ReturnMapping(CharmsListResult) - async def List(self, names=None): + @ReturnMapping(SetProviderNetworkConfigResults) + async def SetProviderNetworkConfig(self, args=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. + SetProviderNetworkConfig updates the provider addresses for one or more + machines. - names : typing.Sequence[str] - Returns -> CharmsListResult + 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 names is not None and not isinstance(names, (bytes, str, list)): - raise Exception("Expected names to be a Sequence, received: {}".format(type(names))) + 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='Charms', - request='List', + msg = dict(type='InstancePoller', + request='SetProviderNetworkConfig', version=4, params=_params) - _params['names'] = names + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(CharmResourcesResults) - async def ListCharmResources(self, entities=None): + @ReturnMapping(StatusResults) + async def Status(self, entities=None): ''' - ListCharmResources returns a series of resources for a given charm. + Status returns the status of each given entity. - entities : typing.Sequence[~CharmURLAndOrigin] - Returns -> CharmResourcesResults + 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='Charms', - request='ListCharmResources', + msg = dict(type='InstancePoller', + request='Status', version=4, params=_params) _params['entities'] = entities @@ -2433,303 +1929,111 @@ async def ListCharmResources(self, entities=None): - @ReturnMapping(ResolveCharmWithChannelResults) - async def ResolveCharms(self, macaroon=None, resolve=None): + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): ''' - ResolveCharms resolves the given charm URLs with an optionally specified - preferred channel. Channel provided via CharmOrigin. + 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. - macaroon : Macaroon - resolve : typing.Sequence[~ResolveCharmWithChannel] - Returns -> ResolveCharmWithChannelResults + + Returns -> NotifyWatchResult ''' - 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='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='Charms', - request='ResolveCharms', + msg = dict(type='InstancePoller', + request='WatchModelMachineStartTimes', version=4, params=_params) - _params['macaroon'] = macaroon - _params['resolve'] = resolve + + 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 ClientFacade(Type): - name = 'Client' +class ModelGenerationFacade(Type): + name = 'ModelGeneration' 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'], + 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'}, - 'EndpointStatus': {'additionalProperties': False, - 'properties': {'application': {'type': 'string'}, - 'name': {'type': 'string'}, - 'role': {'type': 'string'}, - 'subordinate': {'type': 'boolean'}}, - 'required': ['application', - 'name', - 'role', - 'subordinate'], + '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'}, - '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, @@ -2746,968 +2050,262 @@ class ClientFacade(Type): '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'], + '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'}, - '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'}, + 'GenerationApplication': {'additionalProperties': False, + 'properties': {'application': {'type': 'string'}, + 'config': {'patternProperties': {'.*': {'additionalProperties': True, + 'type': 'object'}}, + 'type': 'object'}, + 'pending': {'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'}, + 'progress': {'type': 'string'}, + 'tracking': {'items': {'type': 'string'}, 'type': 'array'}}, - 'required': ['requests'], + 'required': ['application', + 'progress', + 'config'], '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'], + 'GenerationId': {'additionalProperties': False, + 'properties': {'generation-id': {'type': 'integer'}}, + 'required': ['generation-id'], 'type': 'object'}, - 'SupportedFeature': {'additionalProperties': False, - 'properties': {'description': {'type': 'string'}, - 'name': {'type': 'string'}, - 'version': {'type': 'string'}}, - 'required': ['name', 'description'], + 'GenerationResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'generation': {'$ref': '#/definitions/Generation'}}, + 'required': ['generation'], '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'}}, + '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'}, - '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'}}, + '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'}, - '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'}}, + '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'}, - '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'}}, + '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'}, - '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'}}, + '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(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): + @ReturnMapping(ErrorResult) + async def AbortBranch(self, branch=None): ''' - AbortCurrentUpgrade aborts and archives the current upgrade - synchronisation record, if any. - + 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. - Returns -> 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='Client', - request='AbortCurrentUpgrade', + msg = dict(type='ModelGeneration', + request='AbortBranch', version=4, params=_params) - + _params['branch'] = branch reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def AddCharm(self, channel=None, force=None, url=None): + @ReturnMapping(ErrorResult) + async def AddBranch(self, branch=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 + AddBranch adds a new branch with the input name to the model. - channel : str - force : bool - url : str - Returns -> None + branch : str + Returns -> ErrorResult ''' - if channel is not None and not isinstance(channel, (bytes, str)): - raise Exception("Expected channel to be a str, received: {}".format(type(channel))) - - if force is not None and not isinstance(force, bool): - raise Exception("Expected force to be a bool, received: {}".format(type(force))) - - if url is not None and not isinstance(url, (bytes, str)): - raise Exception("Expected url to be a str, received: {}".format(type(url))) + 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='Client', - request='AddCharm', + msg = dict(type='ModelGeneration', + request='AddBranch', version=4, params=_params) - _params['channel'] = channel - _params['force'] = force - _params['url'] = url + _params['branch'] = branch 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 + @ReturnMapping(BranchResults) + async def BranchInfo(self, branches=None, detailed=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 - - + 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. - @ReturnMapping(AddMachinesResults) - async def AddMachines(self, params=None): + branches : typing.Sequence[str] + detailed : bool + Returns -> BranchResults ''' - AddMachines adds new machines with the supplied parameters. + if branches is not None and not isinstance(branches, (bytes, str, list)): + raise Exception("Expected branches to be a Sequence, received: {}".format(type(branches))) - 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))) + 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='Client', - request='AddMachines', + msg = dict(type='ModelGeneration', + request='BranchInfo', version=4, params=_params) - _params['params'] = params + _params['branches'] = branches + _params['detailed'] = detailed reply = await self.rpc(msg) return reply - @ReturnMapping(AddMachinesResults) - async def AddMachinesV2(self, params=None): + @ReturnMapping(IntResult) + async def CommitBranch(self, branch=None): ''' - AddMachinesV2 adds new machines with the supplied parameters. + CommitBranch commits the input branch, making its changes applicable to + the whole model and marking it complete. - params : typing.Sequence[~AddMachineParams] - Returns -> AddMachinesResults + branch : str + Returns -> IntResult ''' - if params is not None and not isinstance(params, (bytes, str, list)): - raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + if 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='Client', - request='AddMachinesV2', + msg = dict(type='ModelGeneration', + request='CommitBranch', version=4, params=_params) - _params['params'] = params + _params['branch'] = branch reply = await self.rpc(msg) return reply - @ReturnMapping(AgentVersionResult) - async def AgentVersion(self): + @ReturnMapping(BoolResult) + async def HasActiveBranch(self, branch=None): ''' - AgentVersion returns the current version that the API server is running. - + HasActiveBranch returns a true result if the input model has an "in-flight" + branch matching the input name. - Returns -> AgentVersionResult + 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='Client', - request='AgentVersion', + msg = dict(type='ModelGeneration', + request='HasActiveBranch', version=4, params=_params) - + _params['branch'] = branch reply = await self.rpc(msg) return reply - @ReturnMapping(BytesResult) - async def CACert(self): + @ReturnMapping(BranchResults) + async def ListCommits(self): ''' - CACert returns the certificate used to validate the state connection. + ListCommits will return the commits, hence only branches with generation_id higher than 0 - Returns -> BytesResult + Returns -> BranchResults ''' # map input types to rpc msg _params = dict() - msg = dict(type='Client', - request='CACert', + msg = dict(type='ModelGeneration', + request='ListCommits', version=4, params=_params) @@ -3716,6008 +2314,802 @@ async def CACert(self): - @ReturnMapping(None) - async def DestroyMachines(self, force=None, machine_names=None): + @ReturnMapping(GenerationResult) + async def ShowCommit(self, generation_id=None): ''' - DestroyMachines removes a given set of machines. + 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. - force : bool - machine_names : typing.Sequence[str] - Returns -> None + generation_id : int + Returns -> GenerationResult ''' - 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))) + 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='Client', - request='DestroyMachines', + msg = dict(type='ModelGeneration', + request='ShowCommit', version=4, params=_params) - _params['force'] = force - _params['machine-names'] = machine_names + _params['generation-id'] = generation_id 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): + @ReturnMapping(ErrorResults) + async def TrackBranch(self, branch=None, entities=None, num_units=None): ''' - FindTools returns a List containing all tools matching the given parameters. + TrackBranch marks the input units and/or applications as tracking the input + branch, causing them to realise changes made under that branch. - agentstream : str - arch : str - major : int - minor : int - number : Number - os_type : str - series : str - Returns -> FindToolsResult + branch : str + entities : typing.Sequence[~Entity] + num_units : int + Returns -> ErrorResults ''' - 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 branch is not None and not isinstance(branch, (bytes, str)): + raise Exception("Expected branch to be a str, received: {}".format(type(branch))) - 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 entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) - if series is not None and not isinstance(series, (bytes, str)): - raise Exception("Expected series to be a str, received: {}".format(type(series))) + 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='Client', - request='FindTools', + msg = dict(type='ModelGeneration', + request='TrackBranch', 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 + _params['branch'] = branch + _params['entities'] = entities + _params['num-units'] = num_units 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 - - +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(ErrorResults) - async def DestroyUnitStorageAttachments(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + @ReturnMapping(LifeResults) + async def AttachmentLife(self, ids=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='Uniter', - request='DestroyUnitStorageAttachments', - version=4, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - + AttachmentLife returns the lifecycle state of each specified machine + storage attachment. - @ReturnMapping(ErrorResults) - async def EnsureDead(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + ids : typing.Sequence[~MachineStorageId] + Returns -> LifeResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='EnsureDead', + msg = dict(type='StorageProvisioner', + request='AttachmentLife', version=4, params=_params) - _params['entities'] = entities + _params['ids'] = ids reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def EnterScope(self, relation_units=None): + async def CreateVolumeAttachmentPlans(self, volume_plans=None): ''' - relation_units : typing.Sequence[~RelationUnit] + volume_plans : typing.Sequence[~VolumeAttachmentPlan] Returns -> ErrorResults ''' - if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + if 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='Uniter', - request='EnterScope', + msg = dict(type='StorageProvisioner', + request='CreateVolumeAttachmentPlans', version=4, params=_params) - _params['relation-units'] = relation_units + _params['volume-plans'] = volume_plans 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 + async def EnsureDead(self, entities=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='Uniter', - request='HasSubordinates', - version=4, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - + 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). - @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', + msg = dict(type='StorageProvisioner', + request='EnsureDead', version=4, params=_params) _params['entities'] = entities @@ -9726,120 +3118,69 @@ async def Life(self, entities=None): - @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): + @ReturnMapping(FilesystemAttachmentParamsResults) + async def FilesystemAttachmentParams(self, ids=None): ''' + FilesystemAttachmentParams returns the parameters for creating the filesystem + attachments with the specified IDs. - Returns -> ModelConfigResult + 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='Uniter', - request='ModelConfig', + msg = dict(type='StorageProvisioner', + request='FilesystemAttachmentParams', version=4, params=_params) - + _params['ids'] = ids reply = await self.rpc(msg) return reply - @ReturnMapping(StringResult) - async def ModelUUID(self): - ''' - - Returns -> StringResult + @ReturnMapping(FilesystemAttachmentResults) + async def FilesystemAttachments(self, ids=None): ''' + FilesystemAttachments returns details of filesystem attachments with the specified IDs. - # 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 + ids : typing.Sequence[~MachineStorageId] + Returns -> FilesystemAttachmentResults ''' - if args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='NetworkConfig', + msg = dict(type='StorageProvisioner', + request='FilesystemAttachments', version=4, params=_params) - _params['args'] = args + _params['ids'] = ids reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def OpenPorts(self, entities=None): - ''' - entities : typing.Sequence[~EntityPortRange] - Returns -> ErrorResults + @ReturnMapping(FilesystemParamsResults) + async def FilesystemParams(self, entities=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='Uniter', - request='OpenPorts', - version=4, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - + FilesystemParams returns the parameters for creating the filesystems + with the specified tags. - @ReturnMapping(StringResults) - async def PrivateAddress(self, entities=None): - ''' entities : typing.Sequence[~Entity] - Returns -> StringResults + 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='Uniter', - request='PrivateAddress', + msg = dict(type='StorageProvisioner', + request='FilesystemParams', version=4, params=_params) _params['entities'] = entities @@ -9848,38 +3189,21 @@ async def PrivateAddress(self, entities=None): - @ReturnMapping(StringResult) - async def ProviderType(self): - ''' - - Returns -> StringResult + @ReturnMapping(FilesystemResults) + async def Filesystems(self, entities=None): ''' + Filesystems returns details of filesystems with the specified tags. - # 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 + 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='Uniter', - request='PublicAddress', + msg = dict(type='StorageProvisioner', + request='Filesystems', version=4, params=_params) _params['entities'] = entities @@ -9888,19 +3212,22 @@ async def PublicAddress(self, entities=None): - @ReturnMapping(GetLeadershipSettingsBulkResults) - async def Read(self, entities=None): + @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 -> GetLeadershipSettingsBulkResults + Returns -> StringResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='Read', + msg = dict(type='StorageProvisioner', + request='InstanceId', version=4, params=_params) _params['entities'] = entities @@ -9909,94 +3236,104 @@ async def Read(self, entities=None): - @ReturnMapping(SettingsResults) - async def ReadRemoteSettings(self, relation_unit_pairs=None): + @ReturnMapping(LifeResults) + async def Life(self, entities=None): ''' - relation_unit_pairs : typing.Sequence[~RelationUnitPair] - Returns -> SettingsResults + Life returns the life status of every supplied entity, where available. + + entities : typing.Sequence[~Entity] + Returns -> LifeResults ''' - if relation_unit_pairs is not None and not isinstance(relation_unit_pairs, (bytes, str, list)): - raise Exception("Expected relation_unit_pairs to be a Sequence, received: {}".format(type(relation_unit_pairs))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='ReadRemoteSettings', + msg = dict(type='StorageProvisioner', + request='Life', version=4, params=_params) - _params['relation-unit-pairs'] = relation_unit_pairs + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(SettingsResults) - async def ReadSettings(self, relation_units=None): + @ReturnMapping(ErrorResults) + async def Remove(self, entities=None): ''' - relation_units : typing.Sequence[~RelationUnit] - Returns -> SettingsResults + Remove removes volumes and filesystems from state. + + entities : typing.Sequence[~Entity] + Returns -> ErrorResults ''' - if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='ReadSettings', + msg = dict(type='StorageProvisioner', + request='Remove', version=4, params=_params) - _params['relation-units'] = relation_units + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(RelationResults) - async def Relation(self, relation_units=None): + @ReturnMapping(ErrorResults) + async def RemoveAttachment(self, ids=None): ''' - relation_units : typing.Sequence[~RelationUnit] - Returns -> RelationResults + RemoveAttachment removes the specified machine storage attachments + from state. + + ids : typing.Sequence[~MachineStorageId] + Returns -> ErrorResults ''' - if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + if 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='Relation', + msg = dict(type='StorageProvisioner', + request='RemoveAttachment', version=4, params=_params) - _params['relation-units'] = relation_units + _params['ids'] = ids reply = await self.rpc(msg) return reply - @ReturnMapping(RelationResults) - async def RelationById(self, relation_ids=None): + @ReturnMapping(RemoveFilesystemParamsResults) + async def RemoveFilesystemParams(self, entities=None): ''' - relation_ids : typing.Sequence[int] - Returns -> RelationResults + RemoveFilesystemParams returns the parameters for destroying or + releasing the filesystems with the specified tags. + + entities : typing.Sequence[~Entity] + Returns -> RemoveFilesystemParamsResults ''' - if relation_ids is not None and not isinstance(relation_ids, (bytes, str, list)): - raise Exception("Expected relation_ids to be a Sequence, received: {}".format(type(relation_ids))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='RelationById', + msg = dict(type='StorageProvisioner', + request='RemoveFilesystemParams', version=4, params=_params) - _params['relation-ids'] = relation_ids + _params['entities'] = entities reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def RemoveStorageAttachments(self, ids=None): + async def RemoveVolumeAttachmentPlan(self, ids=None): ''' - ids : typing.Sequence[~StorageAttachmentId] + ids : typing.Sequence[~MachineStorageId] Returns -> ErrorResults ''' if ids is not None and not isinstance(ids, (bytes, str, list)): @@ -10004,8 +3341,8 @@ async def RemoveStorageAttachments(self, ids=None): # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='RemoveStorageAttachments', + msg = dict(type='StorageProvisioner', + request='RemoveVolumeAttachmentPlan', version=4, params=_params) _params['ids'] = ids @@ -10014,19 +3351,22 @@ async def RemoveStorageAttachments(self, ids=None): - @ReturnMapping(ErrorResults) - async def RequestReboot(self, entities=None): + @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 -> ErrorResults + 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='Uniter', - request='RequestReboot', + msg = dict(type='StorageProvisioner', + request='RemoveVolumeParams', version=4, params=_params) _params['entities'] = entities @@ -10035,51 +3375,58 @@ async def RequestReboot(self, entities=None): - @ReturnMapping(ResolvedModeResults) - async def Resolved(self, entities=None): + @ReturnMapping(ErrorResults) + async def SetFilesystemAttachmentInfo(self, filesystem_attachments=None): ''' - entities : typing.Sequence[~Entity] - Returns -> ResolvedModeResults + SetFilesystemAttachmentInfo records the details of newly provisioned filesystem + attachments. + + filesystem_attachments : typing.Sequence[~FilesystemAttachment] + Returns -> ErrorResults ''' - 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 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='Uniter', - request='Resolved', + msg = dict(type='StorageProvisioner', + request='SetFilesystemAttachmentInfo', version=4, params=_params) - _params['entities'] = entities + _params['filesystem-attachments'] = filesystem_attachments reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetAgentStatus(self, entities=None): + async def SetFilesystemInfo(self, filesystems=None): ''' - entities : typing.Sequence[~EntityStatusArgs] + SetFilesystemInfo records the details of newly provisioned filesystems. + + filesystems : typing.Sequence[~Filesystem] Returns -> ErrorResults ''' - 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 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='Uniter', - request='SetAgentStatus', + msg = dict(type='StorageProvisioner', + request='SetFilesystemInfo', version=4, params=_params) - _params['entities'] = entities + _params['filesystems'] = filesystems reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetApplicationStatus(self, entities=None): + async def SetStatus(self, entities=None): ''' + SetStatus sets the status of each given entity. + entities : typing.Sequence[~EntityStatusArgs] Returns -> ErrorResults ''' @@ -10088,8 +3435,8 @@ async def SetApplicationStatus(self, entities=None): # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='SetApplicationStatus', + msg = dict(type='StorageProvisioner', + request='SetStatus', version=4, params=_params) _params['entities'] = entities @@ -10099,102 +3446,112 @@ async def SetApplicationStatus(self, entities=None): @ReturnMapping(ErrorResults) - async def SetCharmURL(self, entities=None): + async def SetVolumeAttachmentInfo(self, volume_attachments=None): ''' - entities : typing.Sequence[~EntityCharmURL] + SetVolumeAttachmentInfo records the details of newly provisioned volume + attachments. + + volume_attachments : typing.Sequence[~VolumeAttachment] Returns -> ErrorResults ''' - 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 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='Uniter', - request='SetCharmURL', + msg = dict(type='StorageProvisioner', + request='SetVolumeAttachmentInfo', version=4, params=_params) - _params['entities'] = entities + _params['volume-attachments'] = volume_attachments reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetStatus(self, entities=None): + async def SetVolumeAttachmentPlanBlockInfo(self, volume_plans=None): ''' - entities : typing.Sequence[~EntityStatusArgs] + volume_plans : typing.Sequence[~VolumeAttachmentPlan] Returns -> ErrorResults ''' - 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 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='Uniter', - request='SetStatus', + msg = dict(type='StorageProvisioner', + request='SetVolumeAttachmentPlanBlockInfo', version=4, params=_params) - _params['entities'] = entities + _params['volume-plans'] = volume_plans reply = await self.rpc(msg) return reply @ReturnMapping(ErrorResults) - async def SetUnitStatus(self, entities=None): + async def SetVolumeInfo(self, volumes=None): ''' - entities : typing.Sequence[~EntityStatusArgs] + SetVolumeInfo records the details of newly provisioned volumes. + + volumes : typing.Sequence[~Volume] Returns -> ErrorResults ''' - 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 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='Uniter', - request='SetUnitStatus', + msg = dict(type='StorageProvisioner', + request='SetVolumeInfo', version=4, params=_params) - _params['entities'] = entities + _params['volumes'] = volumes reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetWorkloadVersion(self, entities=None): + @ReturnMapping(VolumeAttachmentParamsResults) + async def VolumeAttachmentParams(self, ids=None): ''' - entities : typing.Sequence[~EntityWorkloadVersion] - Returns -> ErrorResults + VolumeAttachmentParams returns the parameters for creating the volume + attachments with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + Returns -> VolumeAttachmentParamsResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='SetWorkloadVersion', + msg = dict(type='StorageProvisioner', + request='VolumeAttachmentParams', version=4, params=_params) - _params['entities'] = entities + _params['ids'] = ids reply = await self.rpc(msg) return reply - @ReturnMapping(LifeResults) - async def StorageAttachmentLife(self, ids=None): + @ReturnMapping(VolumeAttachmentPlanResults) + async def VolumeAttachmentPlans(self, ids=None): ''' - ids : typing.Sequence[~StorageAttachmentId] - Returns -> LifeResults + 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='Uniter', - request='StorageAttachmentLife', + msg = dict(type='StorageProvisioner', + request='VolumeAttachmentPlans', version=4, params=_params) _params['ids'] = ids @@ -10203,19 +3560,21 @@ async def StorageAttachmentLife(self, ids=None): - @ReturnMapping(StorageAttachmentResults) - async def StorageAttachments(self, ids=None): + @ReturnMapping(VolumeAttachmentResults) + async def VolumeAttachments(self, ids=None): ''' - ids : typing.Sequence[~StorageAttachmentId] - Returns -> StorageAttachmentResults + 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='Uniter', - request='StorageAttachments', + msg = dict(type='StorageProvisioner', + request='VolumeAttachments', version=4, params=_params) _params['ids'] = ids @@ -10224,40 +3583,46 @@ async def StorageAttachments(self, ids=None): - @ReturnMapping(StatusResults) - async def UnitStatus(self, entities=None): + @ReturnMapping(BlockDeviceResults) + async def VolumeBlockDevices(self, ids=None): ''' - entities : typing.Sequence[~Entity] - Returns -> StatusResults + VolumeBlockDevices returns details of the block devices corresponding to the + volume attachments with the specified IDs. + + ids : typing.Sequence[~MachineStorageId] + Returns -> BlockDeviceResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if ids is not None and not isinstance(ids, (bytes, str, list)): + raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='UnitStatus', + msg = dict(type='StorageProvisioner', + request='VolumeBlockDevices', version=4, params=_params) - _params['entities'] = entities + _params['ids'] = ids reply = await self.rpc(msg) return reply - @ReturnMapping(StorageAttachmentIdsResults) - async def UnitStorageAttachments(self, entities=None): + @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 -> StorageAttachmentIdsResults + 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='Uniter', - request='UnitStorageAttachments', + msg = dict(type='StorageProvisioner', + request='VolumeParams', version=4, params=_params) _params['entities'] = entities @@ -10266,40 +3631,21 @@ async def UnitStorageAttachments(self, entities=None): - @ReturnMapping(ErrorResults) - async def UpdateSettings(self, relation_units=None): - ''' - relation_units : typing.Sequence[~RelationUnitSettings] - Returns -> ErrorResults + @ReturnMapping(VolumeResults) + async def Volumes(self, entities=None): ''' - 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 - - + Volumes returns details of volumes with the specified tags. - @ReturnMapping(NotifyWatchResults) - async def Watch(self, entities=None): - ''' entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + 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='Uniter', - request='Watch', + msg = dict(type='StorageProvisioner', + request='Volumes', version=4, params=_params) _params['entities'] = entities @@ -10308,17 +3654,20 @@ async def Watch(self, entities=None): - @ReturnMapping(NotifyWatchResult) - async def WatchAPIHostPorts(self): + @ReturnMapping(StringsWatchResult) + async def WatchApplications(self): ''' + WatchApplications starts a StringsWatcher to watch CAAS applications + deployed to this model. - Returns -> NotifyWatchResult + + Returns -> StringsWatchResult ''' # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='WatchAPIHostPorts', + msg = dict(type='StorageProvisioner', + request='WatchApplications', version=4, params=_params) @@ -10327,19 +3676,21 @@ async def WatchAPIHostPorts(self): - @ReturnMapping(StringsWatchResults) - async def WatchActionNotifications(self, entities=None): + @ReturnMapping(NotifyWatchResults) + async def WatchBlockDevices(self, entities=None): ''' + WatchBlockDevices watches for changes to the specified machines' block devices. + entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='WatchActionNotifications', + msg = dict(type='StorageProvisioner', + request='WatchBlockDevices', version=4, params=_params) _params['entities'] = entities @@ -10348,19 +3699,22 @@ async def WatchActionNotifications(self, entities=None): - @ReturnMapping(StringsWatchResults) - async def WatchApplicationRelations(self, entities=None): + @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 -> StringsWatchResults + 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='Uniter', - request='WatchApplicationRelations', + msg = dict(type='StorageProvisioner', + request='WatchFilesystemAttachments', version=4, params=_params) _params['entities'] = entities @@ -10369,19 +3723,22 @@ async def WatchApplicationRelations(self, entities=None): - @ReturnMapping(NotifyWatchResults) - async def WatchConfigSettings(self, entities=None): + @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 -> NotifyWatchResults + Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='WatchConfigSettings', + msg = dict(type='StorageProvisioner', + request='WatchFilesystems', version=4, params=_params) _params['entities'] = entities @@ -10390,38 +3747,45 @@ async def WatchConfigSettings(self, entities=None): - @ReturnMapping(NotifyWatchResult) - async def WatchForModelConfigChanges(self): + @ReturnMapping(NotifyWatchResults) + async def WatchMachines(self, entities=None): ''' + WatchMachines watches for changes to the specified machines. - Returns -> NotifyWatchResult + entities : typing.Sequence[~Entity] + Returns -> NotifyWatchResults ''' + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='WatchForModelConfigChanges', + msg = dict(type='StorageProvisioner', + request='WatchMachines', version=4, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchLeadershipSettings(self, entities=None): + @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 -> NotifyWatchResults + 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='Uniter', - request='WatchLeadershipSettings', + msg = dict(type='StorageProvisioner', + request='WatchVolumeAttachmentPlans', version=4, params=_params) _params['entities'] = entities @@ -10430,19 +3794,22 @@ async def WatchLeadershipSettings(self, entities=None): - @ReturnMapping(NotifyWatchResults) - async def WatchMeterStatus(self, entities=None): + @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 -> NotifyWatchResults + 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='Uniter', - request='WatchMeterStatus', + msg = dict(type='StorageProvisioner', + request='WatchVolumeAttachments', version=4, params=_params) _params['entities'] = entities @@ -10451,106 +3818,258 @@ async def WatchMeterStatus(self, entities=None): - @ReturnMapping(RelationUnitsWatchResults) - async def WatchRelationUnits(self, relation_units=None): + @ReturnMapping(StringsWatchResults) + async def WatchVolumes(self, entities=None): ''' - relation_units : typing.Sequence[~RelationUnit] - Returns -> RelationUnitsWatchResults + WatchVolumes watches for changes to volumes scoped to the + entity with the tag passed to NewState. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults ''' - if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='WatchRelationUnits', + msg = dict(type='StorageProvisioner', + request='WatchVolumes', version=4, params=_params) - _params['relation-units'] = relation_units + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchStorageAttachments(self, ids=None): +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): ''' - ids : typing.Sequence[~StorageAttachmentId] - Returns -> NotifyWatchResults + AddSubnets adds existing subnets to Juju. + + subnets : typing.Sequence[~AddSubnetParams] + 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))) + 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='Uniter', - request='WatchStorageAttachments', + msg = dict(type='Subnets', + request='AddSubnets', version=4, params=_params) - _params['ids'] = ids + _params['subnets'] = subnets reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchUnitAddresses(self, entities=None): + @ReturnMapping(ZoneResults) + async def AllZones(self): ''' - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + AllZones returns all availability zones known to Juju. If a + zone is unusable, unavailable, or deprecated the Available + field will be false. + + + Returns -> ZoneResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise 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', + msg = dict(type='Subnets', + request='AllZones', version=4, params=_params) - _params['entities'] = entities + reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResults) - async def WatchUnitStorageAttachments(self, entities=None): + @ReturnMapping(ListSubnetsResults) + async def ListSubnets(self, space_tag=None, zone=None): ''' - entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + ListSubnets returns the matching subnets after applying + optional filters. + + space_tag : str + zone : str + Returns -> ListSubnetsResults ''' - 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 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='Uniter', - request='WatchUnitStorageAttachments', + msg = dict(type='Subnets', + request='ListSubnets', version=4, params=_params) - _params['entities'] = entities + _params['space-tag'] = space_tag + _params['zone'] = zone reply = await self.rpc(msg) return reply - @ReturnMapping(StringResults) - async def WorkloadVersion(self, entities=None): + @ReturnMapping(SubnetsResults) + async def SubnetsByCIDR(self, cidrs=None): ''' - entities : typing.Sequence[~Entity] - Returns -> StringResults + SubnetsByCIDR returns the collection of subnets matching each CIDR in the input. + + cidrs : typing.Sequence[str] + Returns -> SubnetsResults ''' - 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 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='Uniter', - request='WorkloadVersion', + msg = dict(type='Subnets', + request='SubnetsByCIDR', version=4, params=_params) - _params['entities'] = entities + _params['cidrs'] = cidrs reply = await self.rpc(msg) return reply diff --git a/juju/client/_client5.py b/juju/client/_client5.py index 7cd679f6d..c3f970bbf 100644 --- a/juju/client/_client5.py +++ b/juju/client/_client5.py @@ -5,95 +5,131 @@ from juju.client._definitions import * -class ActionFacade(Type): - name = 'Action' +class ClientFacade(Type): + name = 'Client' 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'], + schema = {'definitions': {'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'}, - '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, + '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'}, + 'DetailedStatus': {'additionalProperties': False, + 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, - 'started': {'format': 'date-time', + 'err': {'$ref': '#/definitions/Error'}, + 'info': {'type': 'string'}, + 'kind': {'type': 'string'}, + 'life': {'type': 'string'}, + 'since': {'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'}}, + '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'}, - '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, @@ -102,1472 +138,459 @@ class ActionFacade(Type): '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'}, + 'ExposedEndpoint': {'additionalProperties': False, + 'properties': {'expose-to-cidrs': {'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'}}, + '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'}}, + 'required': ['number', + 'major', + 'minor', + 'arch', + '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'}, - 'ListRunning': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, + 'History': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'statuses': {'items': {'$ref': '#/definitions/DetailedStatus'}, + 'type': 'array'}}, + 'required': ['statuses'], + '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'}, - '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'}}, + 'MachineStatus': {'additionalProperties': False, + 'properties': {'agent-status': {'$ref': '#/definitions/DetailedStatus'}, + 'constraints': {'type': 'string'}, + 'containers': {'patternProperties': {'.*': {'$ref': '#/definitions/MachineStatus'}}, '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'}, + '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'}, - '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'}}, + 'jobs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'lxd-profiles': {'patternProperties': {'.*': {'$ref': '#/definitions/LXDProfile'}}, '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'], + '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'}, - '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'}}, + 'MeterStatus': {'additionalProperties': False, + 'properties': {'color': {'type': 'string'}, + 'message': {'type': 'string'}}, + 'required': ['color', 'message'], + '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'}, - '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'], + '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'}, - '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'}, + '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'}, - 'scope': {'type': 'string'}}, + 'role': {'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'], + 'limit'], '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'], + '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'}, - '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'}}, + 'Tools': {'additionalProperties': False, + 'properties': {'sha256': {'type': 'string'}, + 'size': {'type': 'integer'}, + 'url': {'type': 'string'}, + 'version': {'$ref': '#/definitions/Binary'}}, + 'required': ['version', 'url', 'size'], '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'}}, + '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(AddRelationResults) - async def AddRelation(self, endpoints=None): + @ReturnMapping(FindToolsResult) + async def FindTools(self, agentstream=None, arch=None, major=None, minor=None, number=None, os_type=None): ''' - endpoints : typing.Sequence[str] - Returns -> AddRelationResults + FindTools returns a List containing all tools matching the given parameters. + + agentstream : str + arch : str + major : int + minor : int + number : Number + os_type : str + Returns -> FindToolsResult ''' - 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 agentstream is not None and not isinstance(agentstream, (bytes, str)): + raise Exception("Expected agentstream to be a str, received: {}".format(type(agentstream))) - # 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 + 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))) - @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 - - + if number is not None and not isinstance(number, (dict, Number)): + raise Exception("Expected number to be a Number, received: {}".format(type(number))) - @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))) + 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='Application', - request='Get', + msg = dict(type='Client', + request='FindTools', version=5, params=_params) - _params['application'] = application + _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(StringResult) - async def GetCharmURL(self, application=None): - ''' - application : str - Returns -> StringResult + @ReturnMapping(FullStatus) + async def FullStatus(self, patterns=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='GetCharmURL', - version=5, - params=_params) - _params['application'] = application - reply = await self.rpc(msg) - return reply - - + FullStatus gives the information needed for juju status over the api - @ReturnMapping(GetConstraintsResults) - async def GetConstraints(self, application=None): - ''' - application : str - Returns -> GetConstraintsResults + patterns : typing.Sequence[str] + Returns -> FullStatus ''' - if application is not None and not isinstance(application, (bytes, str)): - raise Exception("Expected application to be a str, received: {}".format(type(application))) + 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='Application', - request='GetConstraints', + msg = dict(type='Client', + request='FullStatus', version=5, params=_params) - _params['application'] = application + _params['patterns'] = patterns 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 + @ReturnMapping(StatusHistoryResults) + async def StatusHistory(self, requests=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 - - + StatusHistory returns a slice of past statuses for several entities. - @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 + requests : typing.Sequence[~StatusHistoryRequest] + Returns -> StatusHistoryResults ''' - 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))) + 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='Application', - request='SetCharm', + msg = dict(type='Client', + request='StatusHistory', 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 + _params['requests'] = requests reply = await self.rpc(msg) return reply - @ReturnMapping(None) - async def SetConstraints(self, application=None, constraints=None): - ''' - application : str - constraints : Value - Returns -> None + @ReturnMapping(AllWatcherId) + async def WatchAll(self): ''' - 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 - + WatchAll initiates a watcher for entities in the connected model. - @ReturnMapping(ErrorResults) - async def SetMetricCredentials(self, creds=None): - ''' - creds : typing.Sequence[~ApplicationMetricCredential] - Returns -> ErrorResults + Returns -> AllWatcherId ''' - 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', + msg = dict(type='Client', + request='WatchAll', 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' +class MachinerFacade(Type): + name = 'Machiner' 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'}, + 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, @@ -1576,6935 +599,301 @@ class BundleFacade(Type): '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'}}, + 'ErrorResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}}, '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': {'AllWatcherId': {'additionalProperties': False, - 'properties': {'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id'], + 'ErrorResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, + 'type': 'array'}}, + 'required': ['results'], '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'}, + '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'}, - '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'}, - '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'}, - 'Error': {'additionalProperties': False, - 'properties': {'code': {'type': 'string'}, - 'info': {'patternProperties': {'.*': {'additionalProperties': True, - 'type': 'object'}}, - 'type': 'object'}, - 'message': {'type': 'string'}}, - 'required': ['message', 'code'], - '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'}}, - 'required': ['number', - 'major', - 'minor', - 'arch', - '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'}, + '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'}, - 'remote-applications': {'patternProperties': {'.*': {'$ref': '#/definitions/RemoteApplicationStatus'}}, - 'type': 'object'}}, - 'required': ['model', - 'machines', - 'applications', - 'remote-applications', - 'offers', - 'relations', - 'controller-timestamp', - 'branches'], - 'type': 'object'}, - 'History': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'statuses': {'items': {'$ref': '#/definitions/DetailedStatus'}, - 'type': 'array'}}, - 'required': ['statuses'], - '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'}, - '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'], + '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'}, - 'MeterStatus': {'additionalProperties': False, - 'properties': {'color': {'type': 'string'}, - 'message': {'type': 'string'}}, - 'required': ['color', 'message'], + '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'}, + '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'}, - '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'}, - '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'}, - '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'}}, + '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'}, - '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(FindToolsResult) - 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. - - agentstream : str - arch : str - major : int - minor : int - number : Number - os_type : str - Returns -> FindToolsResult - ''' - if agentstream is not None and not isinstance(agentstream, (bytes, str)): - raise Exception("Expected agentstream to be a str, received: {}".format(type(agentstream))) - - if arch is not None and not isinstance(arch, (bytes, str)): - raise Exception("Expected arch to be a str, received: {}".format(type(arch))) - - if major is not None and not isinstance(major, int): - raise Exception("Expected major to be a int, received: {}".format(type(major))) - - if 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))) - - # 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 - 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(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'], + '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'}, + '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'}, - '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'}}, + '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'}, - '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'}, - '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'}, - '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(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 - - + '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(ErrorResults) - async def SetUnitStatus(self, entities=None): - ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + @ReturnMapping(StringsResult) + async def APIAddresses(self): ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise 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 - + APIAddresses returns the list of addresses used to connect to the API. - @ReturnMapping(ErrorResults) - async def SetWorkloadVersion(self, entities=None): - ''' - entities : typing.Sequence[~EntityWorkloadVersion] - Returns -> ErrorResults + Returns -> StringsResult ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise 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', + msg = dict(type='Machiner', + request='APIAddresses', 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 + @ReturnMapping(APIHostPortsResult) + async def APIHostPorts(self): ''' - 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 - + APIHostPorts returns the API server addresses. - @ReturnMapping(StorageAttachmentResults) - async def StorageAttachments(self, ids=None): - ''' - ids : typing.Sequence[~StorageAttachmentId] - Returns -> StorageAttachmentResults + Returns -> APIHostPortsResult ''' - 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', + msg = dict(type='Machiner', + request='APIHostPorts', version=5, params=_params) - _params['ids'] = ids + reply = await self.rpc(msg) return reply - @ReturnMapping(StatusResults) - async def UnitStatus(self, entities=None): + @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 -> StatusResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise 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', + msg = dict(type='Machiner', + request='EnsureDead', version=5, params=_params) _params['entities'] = entities @@ -8513,19 +902,21 @@ async def UnitStatus(self, entities=None): - @ReturnMapping(StorageAttachmentIdsResults) - async def UnitStorageAttachments(self, entities=None): + @ReturnMapping(JobsResults) + async def Jobs(self, entities=None): ''' + Jobs returns the jobs assigned to the given entities. + entities : typing.Sequence[~Entity] - Returns -> StorageAttachmentIdsResults + 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='Uniter', - request='UnitStorageAttachments', + msg = dict(type='Machiner', + request='Jobs', version=5, params=_params) _params['entities'] = entities @@ -8534,40 +925,21 @@ async def UnitStorageAttachments(self, entities=None): - @ReturnMapping(ErrorResults) - async def UpdateSettings(self, relation_units=None): - ''' - relation_units : typing.Sequence[~RelationUnitSettings] - Returns -> ErrorResults + @ReturnMapping(LifeResults) + async def Life(self, entities=None): ''' - 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 - - + Life returns the life status of every supplied entity, where available. - @ReturnMapping(NotifyWatchResults) - async def Watch(self, entities=None): - ''' entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + Returns -> LifeResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='Watch', + msg = dict(type='Machiner', + request='Life', version=5, params=_params) _params['entities'] = entities @@ -8576,38 +948,45 @@ async def Watch(self, entities=None): - @ReturnMapping(NotifyWatchResult) - async def WatchAPIHostPorts(self): + @ReturnMapping(ErrorResults) + async def RecordAgentStartInformation(self, args=None): ''' + RecordAgentStartInformation syncs the machine model with information + reported by a machine agent when it starts. - Returns -> NotifyWatchResult + 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='Uniter', - request='WatchAPIHostPorts', + msg = dict(type='Machiner', + request='RecordAgentStartInformation', version=5, params=_params) - + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResults) - async def WatchActionNotifications(self, entities=None): + @ReturnMapping(ErrorResults) + async def RecordAgentStartTime(self, entities=None): ''' + RecordAgentStartTime updates the agent start time field in the machine doc. + entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise 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', + msg = dict(type='Machiner', + request='RecordAgentStartTime', version=5, params=_params) _params['entities'] = entities @@ -8616,80 +995,73 @@ async def WatchActionNotifications(self, entities=None): - @ReturnMapping(NotifyWatchResults) - async def WatchConfigSettings(self, entities=None): + @ReturnMapping(ErrorResults) + async def SetMachineAddresses(self, machine_addresses=None): ''' - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + machine_addresses : typing.Sequence[~MachineAddresses] + Returns -> ErrorResults ''' - 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 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='Uniter', - request='WatchConfigSettings', + msg = dict(type='Machiner', + request='SetMachineAddresses', version=5, params=_params) - _params['entities'] = entities + _params['machine-addresses'] = machine_addresses reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def WatchForModelConfigChanges(self): + @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. - Returns -> NotifyWatchResult + 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))) - # 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))) + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='WatchLeadershipSettings', + msg = dict(type='Machiner', + request='SetObservedNetworkConfig', version=5, params=_params) - _params['entities'] = entities + _params['config'] = config + _params['tag'] = tag reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchMeterStatus(self, entities=None): + @ReturnMapping(ErrorResults) + async def SetStatus(self, entities=None): ''' - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + 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='Uniter', - request='WatchMeterStatus', + msg = dict(type='Machiner', + request='SetStatus', version=5, params=_params) _params['entities'] = entities @@ -8698,51 +1070,11 @@ async def WatchMeterStatus(self, entities=None): - @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 + async def Watch(self, entities=None): ''' - 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 - - + Watch starts an NotifyWatcher for each given entity. - @ReturnMapping(NotifyWatchResults) - async def WatchUnitAddresses(self, entities=None): - ''' entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' @@ -8751,8 +1083,8 @@ async def WatchUnitAddresses(self, entities=None): # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='WatchUnitAddresses', + msg = dict(type='Machiner', + request='Watch', version=5, params=_params) _params['entities'] = entities @@ -8761,64 +1093,22 @@ async def WatchUnitAddresses(self, entities=None): - @ReturnMapping(StringsWatchResults) - async def WatchUnitRelations(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + @ReturnMapping(NotifyWatchResult) + async def WatchAPIHostPorts(self): ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise 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 - + WatchAPIHostPorts watches the API server addresses. - @ReturnMapping(StringsWatchResults) - async def WatchUnitStorageAttachments(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + Returns -> NotifyWatchResult ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise 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', + msg = dict(type='Machiner', + request='WatchAPIHostPorts', 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/_client6.py b/juju/client/_client6.py index 9b3a962ac..f72ca1105 100644 --- a/juju/client/_client6.py +++ b/juju/client/_client6.py @@ -5,101 +5,52 @@ from juju.client._definitions import * -class ActionFacade(Type): - name = 'Action' +class BundleFacade(Type): + name = 'Bundle' 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'}, + 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'}}, - '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'}, + '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, @@ -108,3351 +59,137 @@ class ActionFacade(Type): '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'}}, + 'ExportBundleParams': {'additionalProperties': False, + 'properties': {'include-charm-defaults': {'type': 'boolean'}}, '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'}}, + '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'}, - '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'}}, + '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(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): + @ReturnMapping(StringResult) + async def ExportBundle(self, include_charm_defaults=None): ''' - Cancel attempts to cancel enqueued Actions from running. + ExportBundle exports the current model configuration as bundle. - entities : typing.Sequence[~Entity] - Returns -> ActionResults + include_charm_defaults : bool + Returns -> StringResult ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + 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='Action', - request='Cancel', + msg = dict(type='Bundle', + request='ExportBundle', version=6, params=_params) - _params['entities'] = entities + _params['include-charm-defaults'] = include_charm_defaults 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 + @ReturnMapping(BundleChangesResults) + async def GetChanges(self, bundleurl=None, yaml=None): ''' - 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 - - + 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. - @ReturnMapping(EnqueuedActions) - async def EnqueueOperation(self, actions=None): + bundleurl : str + yaml : str + Returns -> BundleChangesResults ''' - 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. + if bundleurl is not None and not isinstance(bundleurl, (bytes, str)): + raise Exception("Expected bundleurl to be a str, received: {}".format(type(bundleurl))) - 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))) + 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='Action', - request='EnqueueOperation', + msg = dict(type='Bundle', + request='GetChanges', version=6, params=_params) - _params['actions'] = actions + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml reply = await self.rpc(msg) return reply - @ReturnMapping(FindTagsResults) - async def FindActionTagsByPrefix(self, prefixes=None): + @ReturnMapping(BundleChangesMapArgsResults) + async def GetChangesMapArgs(self, bundleurl=None, yaml=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 + 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 - prefixes : typing.Sequence[str] - Returns -> FindTagsResults + bundleurl : str + yaml : str + Returns -> BundleChangesMapArgsResults ''' - 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 - - + if bundleurl is not None and not isinstance(bundleurl, (bytes, str)): + raise Exception("Expected bundleurl to be a str, received: {}".format(type(bundleurl))) - @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))) + 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='Action', - request='FindActionsByNames', + msg = dict(type='Bundle', + request='GetChangesMapArgs', 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 + _params['bundleURL'] = bundleurl + _params['yaml'] = yaml reply = await self.rpc(msg) return reply diff --git a/juju/client/_client7.py b/juju/client/_client7.py index fdb123ba9..f3dbd1382 100644 --- a/juju/client/_client7.py +++ b/juju/client/_client7.py @@ -1474,13 +1474,19 @@ async def UserCredentials(self, user_clouds=None): -class ControllerFacade(Type): - name = 'Controller' +class FirewallerFacade(Type): + name = 'Firewaller' version = 7 - schema = {'definitions': {'AllWatcherId': {'additionalProperties': False, - 'properties': {'watcher-id': {'type': 'string'}}, - 'required': ['watcher-id'], - 'type': 'object'}, + 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'}, @@ -1495,8 +1501,10 @@ class ControllerFacade(Type): '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'], @@ -1509,12 +1517,6 @@ class ControllerFacade(Type): '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'}, @@ -1534,17 +1536,6 @@ class ControllerFacade(Type): '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'}}, @@ -1554,6 +1545,18 @@ class ControllerFacade(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, @@ -1570,163 +1573,71 @@ class ControllerFacade(Type): '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'], + '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'}, - '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'}, + 'ExposedEndpoint': {'additionalProperties': False, + 'properties': {'expose-to-cidrs': {'items': {'type': 'string'}, + 'type': 'array'}, + 'expose-to-spaces': {'items': {'type': 'string'}, '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'], + 'FanConfigEntry': {'additionalProperties': False, + 'properties': {'overlay': {'type': 'string'}, + 'underlay': {'type': 'string'}}, + 'required': ['underlay', 'overlay'], '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'], + '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'}, - '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'}, + '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': ['model-tag', - 'life', - 'type', - 'hosted-machine-count', - 'application-count', - 'unit-count', - 'owner-tag'], + 'required': ['results'], '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'], + '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'}, - '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'}, + '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'}}, @@ -1737,3524 +1648,65 @@ class ControllerFacade(Type): 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, - 'RemoveBlocksArgs': {'additionalProperties': False, - 'properties': {'all': {'type': 'boolean'}}, - 'required': ['all'], + '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'}, - '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'}}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], '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 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 - 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'}, @@ -5267,347 +1719,341 @@ class ProvisionerFacade(Type): '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'], + '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'}, - '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'}}, + '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'}, - 'ControllerAPIInfoForModels': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, + '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': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, + 'ControllerConfig': {'description': 'ControllerConfig returns ' + "the controller's " + 'configuration.', + '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'}, + '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'}, - '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'}, + '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': {'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'}}, + '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'}, - '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'}}, + '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'}, - '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'}}, + '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'}, - 'WatchModelMachines': {'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, + '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'}, - '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): - ''' + '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'} + - Returns -> BytesResult + @ReturnMapping(BoolResults) + async def AreManuallyProvisioned(self, entities=None): ''' + AreManuallyProvisioned returns whether each given entity is + manually provisioned or not. Only machine tags are accepted. - # 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 + 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='CharmProfileChangeInfo', + msg = dict(type='Firewaller', + request='AreManuallyProvisioned', version=7, params=_params) _params['entities'] = entities @@ -5616,19 +2062,21 @@ async def CharmProfileChangeInfo(self, entities=None): - @ReturnMapping(ConstraintsResults) - async def Constraints(self, entities=None): + @ReturnMapping(CloudSpecResults) + async def CloudSpec(self, entities=None): ''' + CloudSpec returns the model's cloud spec. + entities : typing.Sequence[~Entity] - Returns -> ConstraintsResults + 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='Provisioner', - request='Constraints', + msg = dict(type='Firewaller', + request='CloudSpec', version=7, params=_params) _params['entities'] = entities @@ -5637,49 +2085,11 @@ async def Constraints(self, entities=None): - @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): ''' + ControllerAPIInfoForModels returns the controller api connection details for the specified models. + entities : typing.Sequence[~Entity] Returns -> ControllerAPIInfoResults ''' @@ -5688,7 +2098,7 @@ async def ControllerAPIInfoForModels(self, entities=None): # map input types to rpc msg _params = dict() - msg = dict(type='Provisioner', + msg = dict(type='Firewaller', request='ControllerAPIInfoForModels', version=7, params=_params) @@ -5701,13 +2111,15 @@ async def ControllerAPIInfoForModels(self, entities=None): @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', + msg = dict(type='Firewaller', request='ControllerConfig', version=7, params=_params) @@ -5717,61 +2129,45 @@ async def ControllerConfig(self): - @ReturnMapping(DistributionGroupResults) - async def DistributionGroup(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> DistributionGroupResults + @ReturnMapping(ListFirewallRulesResults) + async def FirewallRules(self, known_services=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='Provisioner', - request='DistributionGroup', - version=7, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - + FirewallRules returns the firewall rules for the specified well known service types. - @ReturnMapping(StringsResults) - async def DistributionGroupByMachineId(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> StringsResults + known_services : typing.Sequence[str] + Returns -> ListFirewallRulesResults ''' - 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 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='Provisioner', - request='DistributionGroupByMachineId', + msg = dict(type='Firewaller', + request='FirewallRules', version=7, params=_params) - _params['entities'] = entities + _params['known-services'] = known_services reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def EnsureDead(self, entities=None): + @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 -> ErrorResults + Returns -> StringResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Provisioner', - request='EnsureDead', + msg = dict(type='Firewaller', + request='GetAssignedMachine', version=7, params=_params) _params['entities'] = entities @@ -5780,107 +2176,43 @@ async def EnsureDead(self, entities=None): - @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 + @ReturnMapping(CloudSpecResult) + async def GetCloudSpec(self): ''' - 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 - + GetCloudSpec constructs the CloudSpec for a validated and authorized model. - @ReturnMapping(MachineNetworkConfigResults) - async def GetContainerInterfaceInfo(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> MachineNetworkConfigResults + Returns -> CloudSpecResult ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='Firewaller', + request='GetCloudSpec', 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): + @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 -> HostNetworkChangeResults + 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='Provisioner', - request='HostChangesForContainers', + msg = dict(type='Firewaller', + request='GetExposeInfo', version=7, params=_params) _params['entities'] = entities @@ -5892,6 +2224,9 @@ async def HostChangesForContainers(self, entities=None): @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 ''' @@ -5900,7 +2235,7 @@ async def InstanceId(self, entities=None): # map input types to rpc msg _params = dict() - msg = dict(type='Provisioner', + msg = dict(type='Firewaller', request='InstanceId', version=7, params=_params) @@ -5910,51 +2245,11 @@ async def InstanceId(self, entities=None): - @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): ''' + Life returns the life status of every supplied entity, where available. + entities : typing.Sequence[~Entity] Returns -> LifeResults ''' @@ -5963,7 +2258,7 @@ async def Life(self, entities=None): # map input types to rpc msg _params = dict() - msg = dict(type='Provisioner', + msg = dict(type='Firewaller', request='Life', version=7, params=_params) @@ -5973,38 +2268,21 @@ async def Life(self, entities=None): - @ReturnMapping(StatusResults) - async def MachinesWithTransientErrors(self): - ''' - - Returns -> StatusResults + @ReturnMapping(MacaroonResults) + async def MacaroonForRelations(self, entities=None): ''' + MacaroonForRelations returns the macaroon for the specified relations. - # 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 + 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='Provisioner', - request='MarkMachinesForRemoval', + msg = dict(type='Firewaller', + request='MacaroonForRelations', version=7, params=_params) _params['entities'] = entities @@ -6016,13 +2294,15 @@ async def MarkMachinesForRemoval(self, entities=None): @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', + msg = dict(type='Firewaller', request='ModelConfig', version=7, params=_params) @@ -6032,59 +2312,24 @@ async def ModelConfig(self): - @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 + @ReturnMapping(OpenMachinePortRangesResults) + async def OpenedMachinePortRanges(self, entities=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='Provisioner', - request='PrepareContainerInterfaceInfo', - version=7, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - + 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. - @ReturnMapping(ProvisioningInfoResults) - async def ProvisioningInfo(self, entities=None): - ''' entities : typing.Sequence[~Entity] - Returns -> ProvisioningInfoResults + 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='Provisioner', - request='ProvisioningInfo', + msg = dict(type='Firewaller', + request='OpenedMachinePortRanges', version=7, params=_params) _params['entities'] = entities @@ -6094,9 +2339,11 @@ async def ProvisioningInfo(self, entities=None): @ReturnMapping(ErrorResults) - async def ReleaseContainerAddresses(self, entities=None): + async def SetRelationsStatus(self, entities=None): ''' - entities : typing.Sequence[~Entity] + 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)): @@ -6104,8 +2351,8 @@ async def ReleaseContainerAddresses(self, entities=None): # map input types to rpc msg _params = dict() - msg = dict(type='Provisioner', - request='ReleaseContainerAddresses', + msg = dict(type='Firewaller', + request='SetRelationsStatus', version=7, params=_params) _params['entities'] = entities @@ -6114,40 +2361,45 @@ async def ReleaseContainerAddresses(self, entities=None): - @ReturnMapping(ErrorResults) - async def Remove(self, entities=None): + @ReturnMapping(SpaceInfos) + async def SpaceInfos(self, space_ids=None): ''' - entities : typing.Sequence[~Entity] - Returns -> ErrorResults + 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 entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + 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='Provisioner', - request='Remove', + msg = dict(type='Firewaller', + request='SpaceInfos', version=7, params=_params) - _params['entities'] = entities + _params['space-ids'] = space_ids reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def RemoveUpgradeCharmProfileData(self, entities=None): + @ReturnMapping(NotifyWatchResults) + async def Watch(self, entities=None): ''' + Watch starts an NotifyWatcher for each given entity. + entities : typing.Sequence[~Entity] - Returns -> ErrorResults + 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='Provisioner', - request='RemoveUpgradeCharmProfileData', + msg = dict(type='Firewaller', + request='Watch', version=7, params=_params) _params['entities'] = entities @@ -6156,19 +2408,21 @@ async def RemoveUpgradeCharmProfileData(self, entities=None): - @ReturnMapping(StringResults) - async def Series(self, entities=None): + @ReturnMapping(NotifyWatchResults) + async def WatchCloudSpecsChanges(self, entities=None): ''' + WatchCloudSpecsChanges returns a watcher for cloud spec changes. + entities : typing.Sequence[~Entity] - Returns -> StringResults + 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='Provisioner', - request='Series', + msg = dict(type='Firewaller', + request='WatchCloudSpecsChanges', version=7, params=_params) _params['entities'] = entities @@ -6177,155 +2431,165 @@ async def Series(self, entities=None): - @ReturnMapping(ErrorResults) - async def SetCharmProfiles(self, args=None): + @ReturnMapping(StringsWatchResults) + async def WatchEgressAddressesForRelations(self, entities=None): ''' - args : typing.Sequence[~SetProfileArg] - Returns -> ErrorResults + 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 args is not None and not isinstance(args, (bytes, str, list)): - raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Provisioner', - request='SetCharmProfiles', + msg = dict(type='Firewaller', + request='WatchEgressAddressesForRelations', version=7, params=_params) - _params['args'] = args + _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 + @ReturnMapping(NotifyWatchResult) + async def WatchForModelConfigChanges(self): ''' - if config is not None and not isinstance(config, (bytes, str, list)): - raise Exception("Expected config to be a Sequence, received: {}".format(type(config))) + 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. + - if tag is not None and not isinstance(tag, (bytes, str)): - raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + Returns -> NotifyWatchResult + ''' # map input types to rpc msg _params = dict() - msg = dict(type='Provisioner', - request='SetHostMachineNetworkConfig', + msg = dict(type='Firewaller', + request='WatchForModelConfigChanges', 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): + @ReturnMapping(StringsWatchResults) + async def WatchIngressAddressesForRelations(self, entities=None): ''' - machines : typing.Sequence[~InstanceInfo] - Returns -> ErrorResults + WatchIngressAddressesForRelations creates a watcher that returns the ingress networks + that have been recorded against the specified relations. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults ''' - 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 entities is not None and not isinstance(entities, (bytes, str, 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='SetInstanceInfo', + msg = dict(type='Firewaller', + request='WatchIngressAddressesForRelations', version=7, params=_params) - _params['machines'] = machines + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetInstanceStatus(self, entities=None): + @ReturnMapping(StringsWatchResult) + async def WatchModelMachineStartTimes(self): ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + 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 ''' - if entities is not None and not isinstance(entities, (bytes, str, 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', + msg = dict(type='Firewaller', + request='WatchModelMachineStartTimes', 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 + @ReturnMapping(StringsWatchResult) + async def WatchModelMachines(self): ''' - if config is not None and not isinstance(config, (bytes, str, list)): - raise Exception("Expected config to be a Sequence, received: {}".format(type(config))) + WatchModelMachines returns a StringsWatcher that notifies of + changes to the life cycles of the top level machines in the current + model. + - if tag is not None and not isinstance(tag, (bytes, str)): - raise Exception("Expected tag to be a str, received: {}".format(type(tag))) + Returns -> StringsWatchResult + ''' # map input types to rpc msg _params = dict() - msg = dict(type='Provisioner', - request='SetObservedNetworkConfig', + msg = dict(type='Firewaller', + request='WatchModelMachines', 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): + @ReturnMapping(StringsWatchResults) + async def WatchOpenedPorts(self, entities=None): ''' - changes : typing.Sequence[~EntityPassword] - Returns -> ErrorResults + WatchOpenedPorts returns a new StringsWatcher for each given + model tag. + + entities : typing.Sequence[~Entity] + Returns -> StringsWatchResults ''' - if changes is not None and not isinstance(changes, (bytes, str, list)): - raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) + if entities is not None and not isinstance(entities, (bytes, str, list)): + raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() - msg = dict(type='Provisioner', - request='SetPasswords', + msg = dict(type='Firewaller', + request='WatchOpenedPorts', version=7, params=_params) - _params['changes'] = changes + _params['entities'] = entities reply = await self.rpc(msg) return reply - @ReturnMapping(ErrorResults) - async def SetProviderNetworkConfig(self, entities=None): + @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 -> ErrorResults + 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='Provisioner', - request='SetProviderNetworkConfig', + msg = dict(type='Firewaller', + request='WatchSubnets', version=7, params=_params) _params['entities'] = entities @@ -6334,19 +2598,22 @@ async def SetProviderNetworkConfig(self, entities=None): - @ReturnMapping(ErrorResults) - async def SetStatus(self, entities=None): + @ReturnMapping(StringsWatchResults) + async def WatchUnits(self, entities=None): ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + 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='Provisioner', - request='SetStatus', + msg = dict(type='Firewaller', + request='WatchUnits', version=7, params=_params) _params['entities'] = entities @@ -6355,19 +2622,372 @@ async def SetStatus(self, entities=None): - @ReturnMapping(ErrorResults) - async def SetSupportedContainers(self, params=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'}, + 'RetryProvisioningArgs': {'additionalProperties': False, + 'properties': {'all': {'type': 'boolean'}, + 'machines': {'items': {'type': 'string'}, + 'type': 'array'}}, + 'required': ['all'], + '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/RetryProvisioningArgs'}, + '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): ''' - params : typing.Sequence[~MachineContainers] - Returns -> ErrorResults + 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='Provisioner', - request='SetSupportedContainers', + msg = dict(type='MachineManager', + request='AddMachines', version=7, params=_params) _params['params'] = params @@ -6376,262 +2996,272 @@ async def SetSupportedContainers(self, params=None): - @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): + @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. - Returns -> StringsResult + 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))) - # 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 - + 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))) - @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))) + 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='Provisioner', - request='Status', + msg = dict(type='MachineManager', + request='DestroyMachineWithParams', version=7, params=_params) - _params['entities'] = entities + _params['force'] = force + _params['keep'] = keep + _params['machine-tags'] = machine_tags + _params['max-wait'] = max_wait reply = await self.rpc(msg) return reply - @ReturnMapping(ToolsResults) - async def Tools(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> ToolsResults + @ReturnMapping(StringsResults) + async def GetUpgradeSeriesMessages(self, params=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='Provisioner', - request='Tools', - version=7, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - + GetUpgradeSeriesMessages returns all new messages associated with upgrade + series events. Messages that have already been retrieved once are not + returned by this method. - @ReturnMapping(ErrorResults) - async def UpdateStatus(self, entities=None): - ''' - entities : typing.Sequence[~EntityStatusArgs] - Returns -> ErrorResults + params : typing.Sequence[~UpgradeSeriesNotificationParam] + 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))) + 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='UpdateStatus', + msg = dict(type='MachineManager', + request='GetUpgradeSeriesMessages', version=7, params=_params) - _params['entities'] = entities + _params['params'] = params reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def WatchAPIHostPorts(self): + @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. - Returns -> NotifyWatchResult + 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='Provisioner', - request='WatchAPIHostPorts', + msg = dict(type='MachineManager', + request='InstanceTypes', version=7, params=_params) - + _params['constraints'] = constraints reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResults) - async def WatchAllContainers(self, params=None): - ''' - params : typing.Sequence[~WatchContainer] - Returns -> StringsWatchResults + @ReturnMapping(ProvisioningScriptResult) + async def ProvisioningScript(self, data_dir=None, disable_package_commands=None, machine_id=None, nonce=None): ''' - if params is not None and not isinstance(params, (bytes, str, list)): - raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + ProvisioningScript returns a shell script that, when run, + provisions a machine agent on the machine executing the script. - # 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 + 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))) - @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))) + 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='Provisioner', - request='WatchContainers', + msg = dict(type='MachineManager', + request='ProvisioningScript', version=7, params=_params) - _params['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(StringsWatchResults) - async def WatchContainersCharmProfiles(self, params=None): + @ReturnMapping(ErrorResults) + async def RetryProvisioning(self, all_=None, machines=None): ''' - params : typing.Sequence[~WatchContainer] - Returns -> StringsWatchResults + RetryProvisioning marks a provisioning error as transient on the machines. + + all_ : bool + machines : typing.Sequence[str] + Returns -> ErrorResults ''' - if params is not None and not isinstance(params, (bytes, str, list)): - raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) + if all_ is not None and not isinstance(all_, bool): + raise Exception("Expected all_ to be a bool, received: {}".format(type(all_))) + + if machines is not None and not isinstance(machines, (bytes, str, list)): + raise Exception("Expected machines to be a Sequence, received: {}".format(type(machines))) # map input types to rpc msg _params = dict() - msg = dict(type='Provisioner', - request='WatchContainersCharmProfiles', + msg = dict(type='MachineManager', + request='RetryProvisioning', version=7, params=_params) - _params['params'] = params + _params['all'] = all_ + _params['machines'] = machines reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResult) - async def WatchForModelConfigChanges(self): + @ReturnMapping(ErrorResult) + async def UpgradeSeriesComplete(self, force=None, series=None, tag=None): ''' + UpgradeSeriesComplete marks a machine as having completed a managed series + upgrade. - Returns -> NotifyWatchResult + 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='Provisioner', - request='WatchForModelConfigChanges', + 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(NotifyWatchResult) - async def WatchMachineErrorRetry(self): + @ReturnMapping(ErrorResult) + async def UpgradeSeriesPrepare(self, force=None, series=None, tag=None): ''' + UpgradeSeriesPrepare prepares a machine for a OS series upgrade. - Returns -> NotifyWatchResult + 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='Provisioner', - request='WatchMachineErrorRetry', + 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(StringsWatchResult) - async def WatchModelMachines(self): + @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. - Returns -> StringsWatchResult + 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='Provisioner', - request='WatchModelMachines', + msg = dict(type='MachineManager', + request='UpgradeSeriesValidate', version=7, params=_params) - + _params['args'] = args reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResult) - async def WatchModelMachinesCharmProfiles(self): + @ReturnMapping(NotifyWatchResults) + async def WatchUpgradeSeriesNotifications(self, entities=None): ''' + WatchUpgradeSeriesNotifications returns a watcher that fires on upgrade + series events. - Returns -> StringsWatchResult + 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='Provisioner', - request='WatchModelMachinesCharmProfiles', + msg = dict(type='MachineManager', + request='WatchUpgradeSeriesNotifications', version=7, params=_params) - + _params['entities'] = entities reply = await self.rpc(msg) return reply diff --git a/juju/client/_client9.py b/juju/client/_client9.py index 22a04a3f7..2ed16f971 100644 --- a/juju/client/_client9.py +++ b/juju/client/_client9.py @@ -5,409 +5,39 @@ from juju.client._definitions import * -class ApplicationFacade(Type): - name = 'Application' +class ModelManagerFacade(Type): + name = 'ModelManager' 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'], + schema = {'definitions': {'ChangeModelCredentialParams': {'additionalProperties': False, + 'properties': {'credential-tag': {'type': 'string'}, + 'model-tag': {'type': 'string'}}, + 'required': ['model-tag', + 'credential-tag'], 'type': 'object'}, - 'ApplicationMetricCredentials': {'additionalProperties': False, - 'properties': {'creds': {'items': {'$ref': '#/definitions/ApplicationMetricCredential'}, - 'type': 'array'}}, - 'required': ['creds'], + 'ChangeModelCredentialsParams': {'additionalProperties': False, + 'properties': {'model-credentials': {'items': {'$ref': '#/definitions/ChangeModelCredentialParams'}, + 'type': 'array'}}, + 'required': ['model-credentials'], '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'], + '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'}, - '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'}, + 'DestroyModelsParams': {'additionalProperties': False, + 'properties': {'models': {'items': {'$ref': '#/definitions/DestroyModelParams'}, 'type': 'array'}}, - 'type': 'object'}, - 'DestroyUnitsParams': {'additionalProperties': False, - 'properties': {'units': {'items': {'$ref': '#/definitions/DestroyUnitParams'}, - 'type': 'array'}}, - 'required': ['units'], - 'type': 'object'}, + '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'}}, @@ -417,6 +47,16 @@ class ApplicationFacade(Type): '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, @@ -433,7215 +73,597 @@ class ApplicationFacade(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'], - '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'], + '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'}, - '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'], + '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'}, - 'UpdateSeriesArgs': {'additionalProperties': False, - 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSeriesArg'}, + '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'}}, - 'required': ['args'], + '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'}, - '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'}}, + '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'}, - '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'}}, + 'ModelInfoResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/ModelInfoResult'}, + 'type': 'array'}}, + 'required': ['results'], 'type': 'object'}, - 'ScaleApplications': {'properties': {'Params': {'$ref': '#/definitions/ScaleApplicationsParams'}, - 'Result': {'$ref': '#/definitions/ScaleApplicationResults'}}, + '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'}, - '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'}, - 'model-tag': {'type': 'string'}, - 'user': {'type': 'string'}}, - 'required': ['model-tag', - 'user', - 'display-name', - 'last-connection', - 'access'], - 'type': 'object'}, - 'ModelVolumeInfo': {'additionalProperties': False, - 'properties': {'detachable': {'type': 'boolean'}, - 'id': {'type': 'string'}, - 'message': {'type': 'string'}, - 'provider-id': {'type': 'string'}, - 'status': {'type': 'string'}}, - 'required': ['id'], - 'type': 'object'}, - 'ModifyModelAccess': {'additionalProperties': False, - 'properties': {'access': {'type': 'string'}, - 'action': {'type': 'string'}, - 'model-tag': {'type': 'string'}, - 'user-tag': {'type': 'string'}}, - 'required': ['user-tag', - 'action', - 'access', - 'model-tag'], - 'type': 'object'}, - 'ModifyModelAccessRequest': {'additionalProperties': False, - 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyModelAccess'}, - 'type': 'array'}}, - 'required': ['changes'], - 'type': 'object'}, - 'Number': {'additionalProperties': False, - 'properties': {'Build': {'type': 'integer'}, - 'Major': {'type': 'integer'}, - 'Minor': {'type': 'integer'}, - 'Patch': {'type': 'integer'}, - 'Tag': {'type': 'string'}}, - 'required': ['Major', - 'Minor', - 'Tag', - 'Patch', - 'Build'], - 'type': 'object'}, - 'RegionDefaults': {'additionalProperties': False, - 'properties': {'region-name': {'type': 'string'}, - 'value': {'additionalProperties': True, - 'type': 'object'}}, - 'required': ['region-name', 'value'], - 'type': 'object'}, - 'SetModelDefaults': {'additionalProperties': False, - 'properties': {'config': {'items': {'$ref': '#/definitions/ModelDefaultValues'}, - 'type': 'array'}}, - 'required': ['config'], - 'type': 'object'}, - 'StringResult': {'additionalProperties': False, - 'properties': {'error': {'$ref': '#/definitions/Error'}, - 'result': {'type': 'string'}}, - 'required': ['result'], - 'type': 'object'}, - 'StringResults': {'additionalProperties': False, - 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, - 'type': 'array'}}, - 'required': ['results'], - 'type': 'object'}, - 'SupportedFeature': {'additionalProperties': False, - 'properties': {'description': {'type': 'string'}, - 'name': {'type': 'string'}, - 'version': {'type': 'string'}}, - 'required': ['name', 'description'], - 'type': 'object'}, - 'UnsetModelDefaults': {'additionalProperties': False, - 'properties': {'keys': {'items': {'$ref': '#/definitions/ModelUnsetKeys'}, - 'type': 'array'}}, - 'required': ['keys'], - 'type': 'object'}, - 'UserModel': {'additionalProperties': False, - 'properties': {'last-connection': {'format': 'date-time', - 'type': 'string'}, - 'model': {'$ref': '#/definitions/Model'}}, - 'required': ['model', 'last-connection'], - 'type': 'object'}, - 'UserModelList': {'additionalProperties': False, - 'properties': {'user-models': {'items': {'$ref': '#/definitions/UserModel'}, - 'type': 'array'}}, - 'required': ['user-models'], - 'type': 'object'}}, - 'properties': {'ChangeModelCredential': {'description': 'ChangeModelCredential ' - 'changes cloud ' - 'credential reference ' - 'for models.\n' - 'These new cloud ' - 'credentials must ' - 'already exist on the ' - 'controller.', - 'properties': {'Params': {'$ref': '#/definitions/ChangeModelCredentialsParams'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'CreateModel': {'description': 'CreateModel creates a new ' - 'model using the account and\n' - 'model config specified in the ' - 'args.', - 'properties': {'Params': {'$ref': '#/definitions/ModelCreateArgs'}, - 'Result': {'$ref': '#/definitions/ModelInfo'}}, - 'type': 'object'}, - 'DestroyModels': {'description': 'DestroyModels will try to ' - 'destroy the specified ' - 'models.\n' - 'If there is a block on ' - 'destruction, this method ' - 'will return an error.\n' - 'From ModelManager v7 ' - 'onwards, DestroyModels gains ' - "'force' and 'max-wait' " - 'parameters.', - 'properties': {'Params': {'$ref': '#/definitions/DestroyModelsParams'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'DumpModels': {'description': 'DumpModels will export the ' - 'models into the database ' - 'agnostic\n' - 'representation. The user needs ' - 'to either be a controller ' - 'admin, or have\n' - 'admin privileges on the model ' - 'itself.', - 'properties': {'Params': {'$ref': '#/definitions/DumpModelRequest'}, - 'Result': {'$ref': '#/definitions/StringResults'}}, - 'type': 'object'}, - 'DumpModelsDB': {'description': 'DumpModelsDB will gather all ' - 'documents from all model ' - 'collections\n' - 'for the specified model. The ' - 'map result contains a map of ' - 'collection\n' - 'names to lists of documents ' - 'represented as maps.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/MapResults'}}, - 'type': 'object'}, - 'ListModelSummaries': {'description': 'ListModelSummaries ' - 'returns models that the ' - 'specified user\n' - 'has access to in the ' - 'current server. ' - 'Controller admins ' - '(superuser)\n' - 'can list models for any ' - 'user. Other users\n' - 'can only ask about ' - 'their own models.', - 'properties': {'Params': {'$ref': '#/definitions/ModelSummariesRequest'}, - 'Result': {'$ref': '#/definitions/ModelSummaryResults'}}, - 'type': 'object'}, - 'ListModels': {'description': 'ListModels returns the models ' - 'that the specified user\n' - 'has access to in the current ' - 'server. Controller admins ' - '(superuser)\n' - 'can list models for any user. ' - 'Other users\n' - 'can only ask about their own ' - 'models.', - 'properties': {'Params': {'$ref': '#/definitions/Entity'}, - 'Result': {'$ref': '#/definitions/UserModelList'}}, - 'type': 'object'}, - 'ModelDefaultsForClouds': {'description': 'ModelDefaultsForClouds ' - 'returns the default ' - 'config values for ' - 'the specified\n' - 'clouds.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ModelDefaultsResults'}}, - 'type': 'object'}, - 'ModelInfo': {'description': 'ModelInfo returns information ' - 'about the specified models.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ModelInfoResults'}}, - 'type': 'object'}, - 'ModelStatus': {'description': 'ModelStatus returns a summary ' - 'of the model.', - 'properties': {'Params': {'$ref': '#/definitions/Entities'}, - 'Result': {'$ref': '#/definitions/ModelStatusResults'}}, - 'type': 'object'}, - 'ModifyModelAccess': {'description': 'ModifyModelAccess ' - 'changes the model access ' - 'granted to users.', - 'properties': {'Params': {'$ref': '#/definitions/ModifyModelAccessRequest'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'SetModelDefaults': {'description': 'SetModelDefaults writes ' - 'new values for the ' - 'specified default model ' - 'settings.', - 'properties': {'Params': {'$ref': '#/definitions/SetModelDefaults'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}, - 'UnsetModelDefaults': {'description': 'UnsetModelDefaults ' - 'removes the specified ' - 'default model settings.', - 'properties': {'Params': {'$ref': '#/definitions/UnsetModelDefaults'}, - 'Result': {'$ref': '#/definitions/ErrorResults'}}, - 'type': 'object'}}, - 'type': 'object'} - - - @ReturnMapping(ErrorResults) - async def ChangeModelCredential(self, model_credentials=None): - ''' - ChangeModelCredential changes cloud credential reference for models. - These new cloud credentials must already exist on the controller. - - model_credentials : typing.Sequence[~ChangeModelCredentialParams] - Returns -> ErrorResults - ''' - if model_credentials is not None and not isinstance(model_credentials, (bytes, str, list)): - raise Exception("Expected model_credentials to be a Sequence, received: {}".format(type(model_credentials))) - - # map input types to rpc msg - _params = dict() - msg = dict(type='ModelManager', - request='ChangeModelCredential', - version=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 - - - -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 - - + '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'}, + 'model-tag': {'type': 'string'}, + 'user': {'type': 'string'}}, + 'required': ['model-tag', + 'user', + 'display-name', + 'last-connection', + 'access'], + 'type': 'object'}, + 'ModelVolumeInfo': {'additionalProperties': False, + 'properties': {'detachable': {'type': 'boolean'}, + 'id': {'type': 'string'}, + 'message': {'type': 'string'}, + 'provider-id': {'type': 'string'}, + 'status': {'type': 'string'}}, + 'required': ['id'], + 'type': 'object'}, + 'ModifyModelAccess': {'additionalProperties': False, + 'properties': {'access': {'type': 'string'}, + 'action': {'type': 'string'}, + 'model-tag': {'type': 'string'}, + 'user-tag': {'type': 'string'}}, + 'required': ['user-tag', + 'action', + 'access', + 'model-tag'], + 'type': 'object'}, + 'ModifyModelAccessRequest': {'additionalProperties': False, + 'properties': {'changes': {'items': {'$ref': '#/definitions/ModifyModelAccess'}, + 'type': 'array'}}, + 'required': ['changes'], + 'type': 'object'}, + 'Number': {'additionalProperties': False, + 'properties': {'Build': {'type': 'integer'}, + 'Major': {'type': 'integer'}, + 'Minor': {'type': 'integer'}, + 'Patch': {'type': 'integer'}, + 'Tag': {'type': 'string'}}, + 'required': ['Major', + 'Minor', + 'Tag', + 'Patch', + 'Build'], + 'type': 'object'}, + 'RegionDefaults': {'additionalProperties': False, + 'properties': {'region-name': {'type': 'string'}, + 'value': {'additionalProperties': True, + 'type': 'object'}}, + 'required': ['region-name', 'value'], + 'type': 'object'}, + 'SetModelDefaults': {'additionalProperties': False, + 'properties': {'config': {'items': {'$ref': '#/definitions/ModelDefaultValues'}, + 'type': 'array'}}, + 'required': ['config'], + 'type': 'object'}, + 'StringResult': {'additionalProperties': False, + 'properties': {'error': {'$ref': '#/definitions/Error'}, + 'result': {'type': 'string'}}, + 'required': ['result'], + 'type': 'object'}, + 'StringResults': {'additionalProperties': False, + 'properties': {'results': {'items': {'$ref': '#/definitions/StringResult'}, + 'type': 'array'}}, + 'required': ['results'], + 'type': 'object'}, + 'SupportedFeature': {'additionalProperties': False, + 'properties': {'description': {'type': 'string'}, + 'name': {'type': 'string'}, + 'version': {'type': 'string'}}, + 'required': ['name', 'description'], + 'type': 'object'}, + 'UnsetModelDefaults': {'additionalProperties': False, + 'properties': {'keys': {'items': {'$ref': '#/definitions/ModelUnsetKeys'}, + 'type': 'array'}}, + 'required': ['keys'], + 'type': 'object'}, + 'UserModel': {'additionalProperties': False, + 'properties': {'last-connection': {'format': 'date-time', + 'type': 'string'}, + 'model': {'$ref': '#/definitions/Model'}}, + 'required': ['model', 'last-connection'], + 'type': 'object'}, + 'UserModelList': {'additionalProperties': False, + 'properties': {'user-models': {'items': {'$ref': '#/definitions/UserModel'}, + 'type': 'array'}}, + 'required': ['user-models'], + 'type': 'object'}}, + 'properties': {'ChangeModelCredential': {'description': 'ChangeModelCredential ' + 'changes cloud ' + 'credential reference ' + 'for models.\n' + 'These new cloud ' + 'credentials must ' + 'already exist on the ' + 'controller.', + 'properties': {'Params': {'$ref': '#/definitions/ChangeModelCredentialsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'CreateModel': {'description': 'CreateModel creates a new ' + 'model using the account and\n' + 'model config specified in the ' + 'args.', + 'properties': {'Params': {'$ref': '#/definitions/ModelCreateArgs'}, + 'Result': {'$ref': '#/definitions/ModelInfo'}}, + 'type': 'object'}, + 'DestroyModels': {'description': 'DestroyModels will try to ' + 'destroy the specified ' + 'models.\n' + 'If there is a block on ' + 'destruction, this method ' + 'will return an error.\n' + 'From ModelManager v7 ' + 'onwards, DestroyModels gains ' + "'force' and 'max-wait' " + 'parameters.', + 'properties': {'Params': {'$ref': '#/definitions/DestroyModelsParams'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'DumpModels': {'description': 'DumpModels will export the ' + 'models into the database ' + 'agnostic\n' + 'representation. The user needs ' + 'to either be a controller ' + 'admin, or have\n' + 'admin privileges on the model ' + 'itself.', + 'properties': {'Params': {'$ref': '#/definitions/DumpModelRequest'}, + 'Result': {'$ref': '#/definitions/StringResults'}}, + 'type': 'object'}, + 'DumpModelsDB': {'description': 'DumpModelsDB will gather all ' + 'documents from all model ' + 'collections\n' + 'for the specified model. The ' + 'map result contains a map of ' + 'collection\n' + 'names to lists of documents ' + 'represented as maps.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/MapResults'}}, + 'type': 'object'}, + 'ListModelSummaries': {'description': 'ListModelSummaries ' + 'returns models that the ' + 'specified user\n' + 'has access to in the ' + 'current server. ' + 'Controller admins ' + '(superuser)\n' + 'can list models for any ' + 'user. Other users\n' + 'can only ask about ' + 'their own models.', + 'properties': {'Params': {'$ref': '#/definitions/ModelSummariesRequest'}, + 'Result': {'$ref': '#/definitions/ModelSummaryResults'}}, + 'type': 'object'}, + 'ListModels': {'description': 'ListModels returns the models ' + 'that the specified user\n' + 'has access to in the current ' + 'server. Controller admins ' + '(superuser)\n' + 'can list models for any user. ' + 'Other users\n' + 'can only ask about their own ' + 'models.', + 'properties': {'Params': {'$ref': '#/definitions/Entity'}, + 'Result': {'$ref': '#/definitions/UserModelList'}}, + 'type': 'object'}, + 'ModelDefaultsForClouds': {'description': 'ModelDefaultsForClouds ' + 'returns the default ' + 'config values for ' + 'the specified\n' + 'clouds.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelDefaultsResults'}}, + 'type': 'object'}, + 'ModelInfo': {'description': 'ModelInfo returns information ' + 'about the specified models.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelInfoResults'}}, + 'type': 'object'}, + 'ModelStatus': {'description': 'ModelStatus returns a summary ' + 'of the model.', + 'properties': {'Params': {'$ref': '#/definitions/Entities'}, + 'Result': {'$ref': '#/definitions/ModelStatusResults'}}, + 'type': 'object'}, + 'ModifyModelAccess': {'description': 'ModifyModelAccess ' + 'changes the model access ' + 'granted to users.', + 'properties': {'Params': {'$ref': '#/definitions/ModifyModelAccessRequest'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'SetModelDefaults': {'description': 'SetModelDefaults writes ' + 'new values for the ' + 'specified default model ' + 'settings.', + 'properties': {'Params': {'$ref': '#/definitions/SetModelDefaults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}, + 'UnsetModelDefaults': {'description': 'UnsetModelDefaults ' + 'removes the specified ' + 'default model settings.', + 'properties': {'Params': {'$ref': '#/definitions/UnsetModelDefaults'}, + 'Result': {'$ref': '#/definitions/ErrorResults'}}, + 'type': 'object'}}, + 'type': 'object'} + @ReturnMapping(ErrorResults) - async def UpdateSettings(self, relation_units=None): + async def ChangeModelCredential(self, model_credentials=None): ''' - relation_units : typing.Sequence[~RelationUnitSettings] + 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 relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + if 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='Uniter', - request='UpdateSettings', + msg = dict(type='ModelManager', + request='ChangeModelCredential', version=9, params=_params) - _params['relation-units'] = relation_units + _params['model-credentials'] = model_credentials reply = await self.rpc(msg) return reply - @ReturnMapping(UpgradeSeriesStatusResults) - async def UpgradeSeriesUnitStatus(self, entities=None): + @ReturnMapping(ModelInfo) + async def CreateModel(self, cloud_tag=None, config=None, credential=None, name=None, owner_tag=None, region=None): ''' - entities : typing.Sequence[~Entity] - Returns -> UpgradeSeriesStatusResults + 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 entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + 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))) - # 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 + 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))) - @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))) + 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='Uniter', - request='Watch', + msg = dict(type='ModelManager', + request='CreateModel', version=9, params=_params) - _params['entities'] = entities + _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(NotifyWatchResult) - async def WatchAPIHostPorts(self): + @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. - Returns -> NotifyWatchResult + 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='Uniter', - request='WatchAPIHostPorts', + msg = dict(type='ModelManager', + request='DestroyModels', version=9, params=_params) - + _params['models'] = models reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResults) - async def WatchActionNotifications(self, entities=None): + @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] - Returns -> StringsWatchResults + 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='Uniter', - request='WatchActionNotifications', + msg = dict(type='ModelManager', + request='DumpModels', version=9, params=_params) _params['entities'] = entities + _params['simplified'] = simplified reply = await self.rpc(msg) return reply - @ReturnMapping(StringsWatchResults) - async def WatchConfigSettingsHash(self, entities=None): + @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 -> StringsWatchResults + 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='Uniter', - request='WatchConfigSettingsHash', + msg = dict(type='ModelManager', + request='DumpModelsDB', version=9, params=_params) _params['entities'] = entities @@ -7650,122 +672,79 @@ async def WatchConfigSettingsHash(self, entities=None): - @ReturnMapping(NotifyWatchResult) - async def WatchForModelConfigChanges(self): + @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. - Returns -> NotifyWatchResult + 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_))) - # 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))) + 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='Uniter', - request='WatchLeadershipSettings', + msg = dict(type='ModelManager', + request='ListModelSummaries', version=9, params=_params) - _params['entities'] = entities + _params['all'] = all_ + _params['user-tag'] = user_tag reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchMeterStatus(self, entities=None): - ''' - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + @ReturnMapping(UserModelList) + async def ListModels(self, tag=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='Uniter', - request='WatchMeterStatus', - version=9, - params=_params) - _params['entities'] = entities - reply = await self.rpc(msg) - return reply - - + 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. - @ReturnMapping(RelationUnitsWatchResults) - async def WatchRelationUnits(self, relation_units=None): - ''' - relation_units : typing.Sequence[~RelationUnit] - Returns -> RelationUnitsWatchResults + tag : str + Returns -> UserModelList ''' - if relation_units is not None and not isinstance(relation_units, (bytes, str, list)): - raise Exception("Expected relation_units to be a Sequence, received: {}".format(type(relation_units))) + if tag is not None and not isinstance(tag, (bytes, str)): + raise Exception("Expected tag to be a str, received: {}".format(type(tag))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='WatchRelationUnits', + msg = dict(type='ModelManager', + request='ListModels', version=9, params=_params) - _params['relation-units'] = relation_units + _params['tag'] = tag reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchStorageAttachments(self, ids=None): - ''' - ids : typing.Sequence[~StorageAttachmentId] - Returns -> NotifyWatchResults + @ReturnMapping(ModelDefaultsResults) + async def ModelDefaultsForClouds(self, entities=None): ''' - 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 - - + ModelDefaultsForClouds returns the default config values for the specified + clouds. - @ReturnMapping(StringsWatchResults) - async def WatchTrustConfigSettingsHash(self, entities=None): - ''' entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + 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='Uniter', - request='WatchTrustConfigSettingsHash', + msg = dict(type='ModelManager', + request='ModelDefaultsForClouds', version=9, params=_params) _params['entities'] = entities @@ -7774,19 +753,21 @@ async def WatchTrustConfigSettingsHash(self, entities=None): - @ReturnMapping(StringsWatchResults) - async def WatchUnitAddressesHash(self, entities=None): + @ReturnMapping(ModelInfoResults) + async def ModelInfo(self, entities=None): ''' + ModelInfo returns information about the specified models. + entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + 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='Uniter', - request='WatchUnitAddressesHash', + msg = dict(type='ModelManager', + request='ModelInfo', version=9, params=_params) _params['entities'] = entities @@ -7795,19 +776,21 @@ async def WatchUnitAddressesHash(self, entities=None): - @ReturnMapping(StringsWatchResults) - async def WatchUnitRelations(self, entities=None): + @ReturnMapping(ModelStatusResults) + async def ModelStatus(self, entities=None): ''' + ModelStatus returns a summary of the model. + entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + 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='Uniter', - request='WatchUnitRelations', + msg = dict(type='ModelManager', + request='ModelStatus', version=9, params=_params) _params['entities'] = entities @@ -7816,64 +799,70 @@ async def WatchUnitRelations(self, entities=None): - @ReturnMapping(StringsWatchResults) - async def WatchUnitStorageAttachments(self, entities=None): + @ReturnMapping(ErrorResults) + async def ModifyModelAccess(self, changes=None): ''' - entities : typing.Sequence[~Entity] - Returns -> StringsWatchResults + ModifyModelAccess changes the model access granted to users. + + changes : typing.Sequence[~ModifyModelAccess] + Returns -> ErrorResults ''' - if entities is not None and not isinstance(entities, (bytes, str, list)): - raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) + if changes is not None and not isinstance(changes, (bytes, str, list)): + raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) # map input types to rpc msg _params = dict() - msg = dict(type='Uniter', - request='WatchUnitStorageAttachments', + msg = dict(type='ModelManager', + request='ModifyModelAccess', version=9, params=_params) - _params['entities'] = entities + _params['changes'] = changes reply = await self.rpc(msg) return reply - @ReturnMapping(NotifyWatchResults) - async def WatchUpgradeSeriesNotifications(self, entities=None): + @ReturnMapping(ErrorResults) + async def SetModelDefaults(self, config=None): ''' - entities : typing.Sequence[~Entity] - Returns -> NotifyWatchResults + SetModelDefaults writes new values for the specified default model settings. + + config : typing.Sequence[~ModelDefaultValues] + Returns -> ErrorResults ''' - 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 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='Uniter', - request='WatchUpgradeSeriesNotifications', + msg = dict(type='ModelManager', + request='SetModelDefaults', version=9, params=_params) - _params['entities'] = entities + _params['config'] = config reply = await self.rpc(msg) return reply - @ReturnMapping(StringResults) - async def WorkloadVersion(self, entities=None): + @ReturnMapping(ErrorResults) + async def UnsetModelDefaults(self, keys=None): ''' - entities : typing.Sequence[~Entity] - Returns -> StringResults + UnsetModelDefaults removes the specified default model settings. + + keys : typing.Sequence[~ModelUnsetKeys] + Returns -> ErrorResults ''' - 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 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='Uniter', - request='WorkloadVersion', + msg = dict(type='ModelManager', + request='UnsetModelDefaults', version=9, params=_params) - _params['entities'] = entities + _params['keys'] = keys reply = await self.rpc(msg) return reply diff --git a/juju/client/_definitions.py b/juju/client/_definitions.py index 69c74c262..de16ccdbe 100644 --- a/juju/client/_definitions.py +++ b/juju/client/_definitions.py @@ -850,66 +850,6 @@ def __init__(self, machines=None, **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'} @@ -1702,54 +1642,6 @@ def __init__(self, results=None, **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'} @@ -2086,72 +1978,6 @@ def __init__(self, application=None, application_config=None, channel=None, char -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'} @@ -2284,66 +2110,6 @@ def __init__(self, creds=None, **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'} @@ -2596,60 +2362,6 @@ def __init__(self, results=None, **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', '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'} @@ -2848,30 +2560,6 @@ def __init__(self, application=None, channel=None, charm_origin=None, charm_url= -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'} @@ -3070,24 +2758,6 @@ def __init__(self, name=None, **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'} @@ -3232,78 +2902,6 @@ def __init__(self, application=None, branch=None, options=None, **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'} @@ -5130,107 +4728,11 @@ def __init__(self, code=None, message=None, **unknown_fields): 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_))) + if message_ is not None and not isinstance(message_, (bytes, str)): + raise Exception("Expected message_ to be a str, received: {}".format(type(message_))) - self.actions = actions_ - self.config = config_ - self.lxd_profile = lxd_profile_ - self.meta = meta_ - self.metrics = metrics_ - self.revision = revision_ - self.url = url_ + self.code = code_ + self.message = message_ self.unknown_fields = unknown_fields @@ -6018,36 +5520,6 @@ def __init__(self, count_max=None, count_min=None, description=None, location=No -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'} @@ -7371,48 +6843,6 @@ def __init__(self, args=None, **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'} @@ -8014,61 +7444,61 @@ def __init__(self, specs=None, **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): + _toSchema = {'data': 'data', 'description': 'description', 'expire_time': 'expire-time', 'label': 'label', 'owner_tag': 'owner-tag', 'params': 'params', 'rotate_policy': 'rotate-policy', 'upsertsecretarg': 'UpsertSecretArg'} + _toPy = {'UpsertSecretArg': 'upsertsecretarg', 'data': 'data', 'description': 'description', 'expire-time': 'expire_time', 'label': 'label', 'owner-tag': 'owner_tag', 'params': 'params', 'rotate-policy': 'rotate_policy'} + def __init__(self, upsertsecretarg=None, data=None, description=None, expire_time=None, label=None, owner_tag=None, params=None, rotate_policy=None, **unknown_fields): ''' + upsertsecretarg : UpsertSecretArg data : typing.Mapping[str, str] description : str + expire_time : str + label : str + owner_tag : str params : typing.Mapping[str, typing.Any] - path : str - rotate_interval : int - status : str - tags : typing.Mapping[str, str] - type_ : str + rotate_policy : str ''' + upsertsecretarg_ = UpsertSecretArg.from_json(upsertsecretarg) if upsertsecretarg else None data_ = data description_ = description + expire_time_ = expire_time + label_ = label + owner_tag_ = owner_tag params_ = params - path_ = path - rotate_interval_ = rotate_interval - status_ = status - tags_ = tags - type__ = type_ + rotate_policy_ = rotate_policy # Validate arguments against known Juju API types. + if upsertsecretarg_ is not None and not isinstance(upsertsecretarg_, (dict, UpsertSecretArg)): + raise Exception("Expected upsertsecretarg_ to be a UpsertSecretArg, received: {}".format(type(upsertsecretarg_))) + 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 expire_time_ is not None and not isinstance(expire_time_, (bytes, str)): + raise Exception("Expected expire_time_ to be a str, received: {}".format(type(expire_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 label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) - if status_ is not None and not isinstance(status_, (bytes, str)): - raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + 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 tags_ is not None and not isinstance(tags_, dict): - raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + if params_ is not None and not isinstance(params_, dict): + raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) - if type__ is not None and not isinstance(type__, (bytes, str)): - raise Exception("Expected type__ to be a str, received: {}".format(type(type__))) + if rotate_policy_ is not None and not isinstance(rotate_policy_, (bytes, str)): + raise Exception("Expected rotate_policy_ to be a str, received: {}".format(type(rotate_policy_))) + self.upsertsecretarg = upsertsecretarg_ self.data = data_ self.description = description_ + self.expire_time = expire_time_ + self.label = label_ + self.owner_tag = owner_tag_ self.params = params_ - self.path = path_ - self.rotate_interval = rotate_interval_ - self.status = status_ - self.tags = tags_ - self.type_ = type__ + self.rotate_policy = rotate_policy_ self.unknown_fields = unknown_fields @@ -9054,24 +8484,6 @@ def __init__(self, bridge_name=None, host_device_name=None, mac_address=None, ** -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'} @@ -9954,42 +9366,6 @@ def __init__(self, entities=None, **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'} @@ -10020,30 +9396,6 @@ def __init__(self, code=None, info=None, message=None, **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'} @@ -11361,48 +10713,6 @@ def __init__(self, error=None, generation=None, **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'} @@ -11464,25 +10774,37 @@ def __init__(self, error=None, settings=None, **unknown_fields): class GetSecretArg(Type): - _toSchema = {'id_': 'id', 'url': 'url'} - _toPy = {'id': 'id_', 'url': 'url'} - def __init__(self, id_=None, url=None, **unknown_fields): + _toSchema = {'label': 'label', 'peek': 'peek', 'update': 'update', 'uri': 'uri'} + _toPy = {'label': 'label', 'peek': 'peek', 'update': 'update', 'uri': 'uri'} + def __init__(self, label=None, peek=None, update=None, uri=None, **unknown_fields): ''' - id_ : str - url : str + label : str + peek : bool + update : bool + uri : str ''' - id__ = id_ - url_ = url + label_ = label + peek_ = peek + update_ = update + uri_ = uri # 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 label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) - if url_ is not None and not isinstance(url_, (bytes, str)): - raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + if peek_ is not None and not isinstance(peek_, bool): + raise Exception("Expected peek_ to be a bool, received: {}".format(type(peek_))) - self.id_ = id__ - self.url = url_ + if update_ is not None and not isinstance(update_, bool): + raise Exception("Expected update_ to be a bool, received: {}".format(type(update_))) + + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + + self.label = label_ + self.peek = peek_ + self.update = update_ + self.uri = uri_ self.unknown_fields = unknown_fields @@ -11612,51 +10934,21 @@ class GoalStateStatus(Type): _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 + since : str + status : str ''' - public_address_ = Address.from_json(public_address) if public_address else None - series_ = series - tag_ = tag + since_ = since + status_ = status # 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 since_ is not None and not isinstance(since_, (bytes, str)): + raise Exception("Expected since_ to be a str, received: {}".format(type(since_))) - if tag_ is not None and not isinstance(tag_, (bytes, str)): - raise Exception("Expected tag_ to be a str, received: {}".format(type(tag_))) + if status_ is not None and not isinstance(status_, (bytes, str)): + raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) - self.public_address = public_address_ - self.series = series_ - self.tag = tag_ + self.since = since_ + self.status = status_ self.unknown_fields = unknown_fields @@ -13347,96 +12639,6 @@ def __init__(self, config=None, description=None, devices=None, **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'} @@ -13509,24 +12711,6 @@ def __init__(self, duration=None, holder=None, lease=None, model_uuid=None, name -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'} @@ -13774,37 +12958,37 @@ def __init__(self, entities=None, mode=None, **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): + _toSchema = {'create_time': 'create-time', 'description': 'description', 'expire_time': 'expire-time', 'label': 'label', 'next_rotate_time': 'next-rotate-time', 'owner_tag': 'owner-tag', 'provider': 'provider', 'provider_id': 'provider-id', 'revision': 'revision', 'rotate_policy': 'rotate-policy', 'update_time': 'update-time', 'uri': 'uri', 'value': 'value', 'version': 'version'} + _toPy = {'create-time': 'create_time', 'description': 'description', 'expire-time': 'expire_time', 'label': 'label', 'next-rotate-time': 'next_rotate_time', 'owner-tag': 'owner_tag', 'provider': 'provider', 'provider-id': 'provider_id', 'revision': 'revision', 'rotate-policy': 'rotate_policy', 'update-time': 'update_time', 'uri': 'uri', 'value': 'value', 'version': 'version'} + def __init__(self, create_time=None, description=None, expire_time=None, label=None, next_rotate_time=None, owner_tag=None, provider=None, provider_id=None, revision=None, rotate_policy=None, update_time=None, uri=None, value=None, version=None, **unknown_fields): ''' create_time : str description : str - int_ : int - path : str + expire_time : str + label : str + next_rotate_time : str + owner_tag : str provider : str provider_id : str revision : int - rotate_interval : int - status : str - tags : typing.Mapping[str, str] + rotate_policy : str update_time : str - url : str + uri : str value : SecretValueResult version : int ''' create_time_ = create_time description_ = description - int__ = int_ - path_ = path + expire_time_ = expire_time + label_ = label + next_rotate_time_ = next_rotate_time + owner_tag_ = owner_tag provider_ = provider provider_id_ = provider_id revision_ = revision - rotate_interval_ = rotate_interval - status_ = status - tags_ = tags + rotate_policy_ = rotate_policy update_time_ = update_time - url_ = url + uri_ = uri value_ = SecretValueResult.from_json(value) if value else None version_ = version @@ -13815,11 +12999,17 @@ def __init__(self, create_time=None, description=None, int_=None, path=None, pro 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 expire_time_ is not None and not isinstance(expire_time_, (bytes, str)): + raise Exception("Expected expire_time_ to be a str, received: {}".format(type(expire_time_))) - if path_ is not None and not isinstance(path_, (bytes, str)): - raise Exception("Expected path_ to be a str, received: {}".format(type(path_))) + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) + + if next_rotate_time_ is not None and not isinstance(next_rotate_time_, (bytes, str)): + raise Exception("Expected next_rotate_time_ to be a str, received: {}".format(type(next_rotate_time_))) + + 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_ is not None and not isinstance(provider_, (bytes, str)): raise Exception("Expected provider_ to be a str, received: {}".format(type(provider_))) @@ -13830,20 +13020,14 @@ def __init__(self, create_time=None, description=None, int_=None, path=None, pro 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 rotate_policy_ is not None and not isinstance(rotate_policy_, (bytes, str)): + raise Exception("Expected rotate_policy_ to be a str, received: {}".format(type(rotate_policy_))) 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 uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) if value_ is not None and not isinstance(value_, (dict, SecretValueResult)): raise Exception("Expected value_ to be a SecretValueResult, received: {}".format(type(value_))) @@ -13853,16 +13037,16 @@ def __init__(self, create_time=None, description=None, int_=None, path=None, pro self.create_time = create_time_ self.description = description_ - self.int_ = int__ - self.path = path_ + self.expire_time = expire_time_ + self.label = label_ + self.next_rotate_time = next_rotate_time_ + self.owner_tag = owner_tag_ self.provider = provider_ self.provider_id = provider_id_ self.revision = revision_ - self.rotate_interval = rotate_interval_ - self.status = status_ - self.tags = tags_ + self.rotate_policy = rotate_policy_ self.update_time = update_time_ - self.url = url_ + self.uri = uri_ self.value = value_ self.version = version_ self.unknown_fields = unknown_fields @@ -14241,48 +13425,6 @@ def __init__(self, bakery_discharge_required=None, controller_tag=None, discharg -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'} @@ -14684,48 +13826,6 @@ def __init__(self, port_range=None, relation_tag=None, unit_tag=None, **unknown_ -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'} @@ -15062,72 +14162,6 @@ def __init__(self, migration_id=None, phase=None, phase_changed_time=None, spec= -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'} @@ -16821,22 +15855,28 @@ def __init__(self, application_count=None, error=None, filesystems=None, hosted_ 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): + _toSchema = {'available_version': 'available-version', 'cloud_tag': 'cloud-tag', 'meter_status': 'meter-status', 'model_status': 'model-status', 'name': 'name', 'region': 'region', 'sla': 'sla', 'type_': 'type', 'version': 'version'} + _toPy = {'available-version': 'available_version', 'cloud-tag': 'cloud_tag', 'meter-status': 'meter_status', 'model-status': 'model_status', 'name': 'name', 'region': 'region', 'sla': 'sla', 'type': 'type_', 'version': 'version'} + def __init__(self, available_version=None, cloud_tag=None, meter_status=None, model_status=None, name=None, region=None, sla=None, type_=None, version=None, **unknown_fields): ''' available_version : str cloud_tag : str - migration : str + meter_status : MeterStatus + model_status : DetailedStatus name : str region : str + sla : str + type_ : str version : str ''' available_version_ = available_version cloud_tag_ = cloud_tag - migration_ = migration + meter_status_ = MeterStatus.from_json(meter_status) if meter_status else None + model_status_ = DetailedStatus.from_json(model_status) if model_status else None name_ = name region_ = region + sla_ = sla + type__ = type_ version_ = version # Validate arguments against known Juju API types. @@ -16846,8 +15886,11 @@ def __init__(self, available_version=None, cloud_tag=None, migration=None, name= 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 meter_status_ is not None and not isinstance(meter_status_, (dict, MeterStatus)): + raise Exception("Expected meter_status_ to be a MeterStatus, received: {}".format(type(meter_status_))) + + if model_status_ is not None and not isinstance(model_status_, (dict, DetailedStatus)): + raise Exception("Expected model_status_ to be a DetailedStatus, received: {}".format(type(model_status_))) if name_ is not None and not isinstance(name_, (bytes, str)): raise Exception("Expected name_ to be a str, received: {}".format(type(name_))) @@ -16855,14 +15898,23 @@ def __init__(self, available_version=None, cloud_tag=None, migration=None, 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 sla_ is not None and not isinstance(sla_, (bytes, str)): + raise Exception("Expected sla_ to be a str, received: {}".format(type(sla_))) + + 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.available_version = available_version_ self.cloud_tag = cloud_tag_ - self.migration = migration_ + self.meter_status = meter_status_ + self.model_status = model_status_ self.name = name_ self.region = region_ + self.sla = sla_ + self.type_ = type__ self.version = version_ self.unknown_fields = unknown_fields @@ -17563,72 +16615,6 @@ def __init__(self, ssh_keys=None, user=None, **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'} @@ -19291,66 +18277,6 @@ def __init__(self, controller_alias=None, **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'} @@ -19489,42 +18415,6 @@ def __init__(self, config=None, tag=None, **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', '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'} @@ -20494,42 +19384,6 @@ def __init__(self, results=None, **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'} @@ -20902,24 +19756,6 @@ def __init__(self, relation=None, unit=None, **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'} @@ -21250,36 +20086,6 @@ def __init__(self, consume_version=None, is_consumer_proxy=None, life=None, maca -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'} @@ -21472,36 +20278,6 @@ def __init__(self, endpoints=None, err=None, life=None, offer_name=None, offer_u -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'} @@ -21586,30 +20362,6 @@ def __init__(self, args=None, **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'} @@ -21709,53 +20461,17 @@ def __init__(self, application_name=None, endpoint=None, id_=None, key=None, lif 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__ - 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.unit_count = unit_count_ - 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.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.unit_count = unit_count_ self.unknown_fields = unknown_fields @@ -21916,36 +20632,6 @@ def __init__(self, results=None, **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'} @@ -21970,24 +20656,6 @@ def __init__(self, settings=None, unit_id=None, **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'} @@ -22036,36 +20704,6 @@ def __init__(self, results=None, **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'} @@ -22084,36 +20722,6 @@ def __init__(self, changes=None, **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'} @@ -22852,30 +21460,6 @@ def __init__(self, charmresource=None, application=None, description=None, finge -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'} @@ -22954,20 +21538,26 @@ def __init__(self, backup_id=None, **unknown_fields): -class ResumeReplicationParams(Type): - _toSchema = {'members': 'members'} - _toPy = {'members': 'members'} - def __init__(self, members=None, **unknown_fields): +class RetryProvisioningArgs(Type): + _toSchema = {'all_': 'all', 'machines': 'machines'} + _toPy = {'all': 'all_', 'machines': 'machines'} + def __init__(self, all_=None, machines=None, **unknown_fields): ''' - members : typing.Sequence[~Member] + all_ : bool + machines : typing.Sequence[str] ''' - members_ = [Member.from_json(o) for o in members or []] + all__ = all_ + machines_ = machines # 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_))) + if all__ is not None and not isinstance(all__, bool): + raise Exception("Expected all__ to be a bool, received: {}".format(type(all__))) - self.members = members_ + 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.all_ = all__ + self.machines = machines_ self.unknown_fields = unknown_fields @@ -23459,24 +22049,24 @@ def __init__(self, applications=None, **unknown_fields): class SecretRotatedArg(Type): - _toSchema = {'url': 'url', 'when': 'when'} - _toPy = {'url': 'url', 'when': 'when'} - def __init__(self, url=None, when=None, **unknown_fields): + _toSchema = {'uri': 'uri', 'when': 'when'} + _toPy = {'uri': 'uri', 'when': 'when'} + def __init__(self, uri=None, when=None, **unknown_fields): ''' - url : str + uri : str when : str ''' - url_ = url + uri_ = uri 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 uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) 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.uri = uri_ self.when = when_ self.unknown_fields = unknown_fields @@ -23501,19 +22091,17 @@ def __init__(self, args=None, **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): + _toSchema = {'last_rotate_time': 'last-rotate-time', 'rotate_interval': 'rotate-interval', 'uri': 'uri'} + _toPy = {'last-rotate-time': 'last_rotate_time', 'rotate-interval': 'rotate_interval', 'uri': 'uri'} + def __init__(self, last_rotate_time=None, rotate_interval=None, uri=None, **unknown_fields): ''' last_rotate_time : str rotate_interval : int - secret_id : int - url : str + uri : str ''' last_rotate_time_ = last_rotate_time rotate_interval_ = rotate_interval - secret_id_ = secret_id - url_ = url + uri_ = uri # Validate arguments against known Juju API types. if last_rotate_time_ is not None and not isinstance(last_rotate_time_, (bytes, str)): @@ -23522,16 +22110,12 @@ def __init__(self, last_rotate_time=None, rotate_interval=None, secret_id=None, 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_))) + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) self.last_rotate_time = last_rotate_time_ self.rotate_interval = rotate_interval_ - self.secret_id = secret_id_ - self.url = url_ + self.uri = uri_ self.unknown_fields = unknown_fields @@ -24106,24 +22690,6 @@ def __init__(self, specs=None, **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'} @@ -24166,48 +22732,6 @@ def __init__(self, args=None, **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'} @@ -24292,48 +22816,6 @@ def __init__(self, entities=None, **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'} @@ -24686,52 +23168,10 @@ def __init__(self, space_ids=None, **unknown_fields): 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_))) + 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.results = results_ + self.space_ids = space_ids_ self.unknown_fields = unknown_fields @@ -26421,24 +24861,6 @@ def __init__(self, results=None, **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'} @@ -26577,72 +24999,6 @@ def __init__(self, results=None, **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'} @@ -27033,24 +25389,6 @@ def __init__(self, address=None, agent_status=None, charm=None, leader=None, mac -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'} @@ -27321,48 +25659,6 @@ def __init__(self, clouds=None, **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'} @@ -27508,55 +25804,61 @@ def __init__(self, results=None, **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): + _toSchema = {'data': 'data', 'description': 'description', 'expire_time': 'expire-time', 'label': 'label', 'params': 'params', 'rotate_policy': 'rotate-policy', 'upsertsecretarg': 'UpsertSecretArg', 'uri': 'uri'} + _toPy = {'UpsertSecretArg': 'upsertsecretarg', 'data': 'data', 'description': 'description', 'expire-time': 'expire_time', 'label': 'label', 'params': 'params', 'rotate-policy': 'rotate_policy', 'uri': 'uri'} + def __init__(self, upsertsecretarg=None, data=None, description=None, expire_time=None, label=None, params=None, rotate_policy=None, uri=None, **unknown_fields): ''' + upsertsecretarg : UpsertSecretArg data : typing.Mapping[str, str] description : str + expire_time : str + label : str params : typing.Mapping[str, typing.Any] - rotate_interval : int - status : str - tags : typing.Mapping[str, str] - url : str + rotate_policy : str + uri : str ''' + upsertsecretarg_ = UpsertSecretArg.from_json(upsertsecretarg) if upsertsecretarg else None data_ = data description_ = description + expire_time_ = expire_time + label_ = label params_ = params - rotate_interval_ = rotate_interval - status_ = status - tags_ = tags - url_ = url + rotate_policy_ = rotate_policy + uri_ = uri # Validate arguments against known Juju API types. + if upsertsecretarg_ is not None and not isinstance(upsertsecretarg_, (dict, UpsertSecretArg)): + raise Exception("Expected upsertsecretarg_ to be a UpsertSecretArg, received: {}".format(type(upsertsecretarg_))) + 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 expire_time_ is not None and not isinstance(expire_time_, (bytes, str)): + raise Exception("Expected expire_time_ to be a str, received: {}".format(type(expire_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 label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) - if status_ is not None and not isinstance(status_, (bytes, str)): - raise Exception("Expected status_ to be a str, received: {}".format(type(status_))) + if params_ is not None and not isinstance(params_, dict): + raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) - if tags_ is not None and not isinstance(tags_, dict): - raise Exception("Expected tags_ to be a Mapping, received: {}".format(type(tags_))) + if rotate_policy_ is not None and not isinstance(rotate_policy_, (bytes, str)): + raise Exception("Expected rotate_policy_ to be a str, received: {}".format(type(rotate_policy_))) - if url_ is not None and not isinstance(url_, (bytes, str)): - raise Exception("Expected url_ to be a str, received: {}".format(type(url_))) + if uri_ is not None and not isinstance(uri_, (bytes, str)): + raise Exception("Expected uri_ to be a str, received: {}".format(type(uri_))) + self.upsertsecretarg = upsertsecretarg_ self.data = data_ self.description = description_ + self.expire_time = expire_time_ + self.label = label_ self.params = params_ - self.rotate_interval = rotate_interval_ - self.status = status_ - self.tags = tags_ - self.url = url_ + self.rotate_policy = rotate_policy_ + self.uri = uri_ self.unknown_fields = unknown_fields @@ -27669,20 +25971,68 @@ def __init__(self, agent_stream=None, dry_run=None, ignore_agent_versions=None, -class UpgradeMongoParams(Type): - _toSchema = {'target': 'target'} - _toPy = {'target': 'target'} - def __init__(self, target=None, **unknown_fields): +class UpgradeModelParams(Type): + _toSchema = {'agent_stream': 'agent-stream', 'dry_run': 'dry-run', 'ignore_agent_versions': 'ignore-agent-versions', 'model_tag': 'model-tag', 'target_version': 'target-version'} + _toPy = {'agent-stream': 'agent_stream', 'dry-run': 'dry_run', 'ignore-agent-versions': 'ignore_agent_versions', 'model-tag': 'model_tag', 'target-version': 'target_version'} + def __init__(self, agent_stream=None, dry_run=None, ignore_agent_versions=None, model_tag=None, target_version=None, **unknown_fields): ''' - target : MongoVersion + agent_stream : str + dry_run : bool + ignore_agent_versions : bool + model_tag : str + target_version : Number ''' - target_ = MongoVersion.from_json(target) if target else None + agent_stream_ = agent_stream + dry_run_ = dry_run + ignore_agent_versions_ = ignore_agent_versions + model_tag_ = model_tag + target_version_ = Number.from_json(target_version) if target_version 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_))) + 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_))) - self.target = target_ + if dry_run_ is not None and not isinstance(dry_run_, bool): + raise Exception("Expected dry_run_ to be a bool, received: {}".format(type(dry_run_))) + + if ignore_agent_versions_ is not None and not isinstance(ignore_agent_versions_, bool): + raise Exception("Expected ignore_agent_versions_ to be a bool, received: {}".format(type(ignore_agent_versions_))) + + if model_tag_ is not None and not isinstance(model_tag_, (bytes, str)): + raise Exception("Expected model_tag_ to be a str, received: {}".format(type(model_tag_))) + + if target_version_ is not None and not isinstance(target_version_, (dict, Number)): + raise Exception("Expected target_version_ to be a Number, received: {}".format(type(target_version_))) + + self.agent_stream = agent_stream_ + self.dry_run = dry_run_ + self.ignore_agent_versions = ignore_agent_versions_ + self.model_tag = model_tag_ + self.target_version = target_version_ + self.unknown_fields = unknown_fields + + + +class UpgradeModelResult(Type): + _toSchema = {'chosen_version': 'chosen-version', 'error': 'error'} + _toPy = {'chosen-version': 'chosen_version', 'error': 'error'} + def __init__(self, chosen_version=None, error=None, **unknown_fields): + ''' + chosen_version : Number + error : Error + ''' + chosen_version_ = Number.from_json(chosen_version) if chosen_version else None + error_ = Error.from_json(error) if error else None + + # Validate arguments against known Juju API types. + if chosen_version_ is not None and not isinstance(chosen_version_, (dict, Number)): + raise Exception("Expected chosen_version_ to be a Number, received: {}".format(type(chosen_version_))) + + if error_ is not None and not isinstance(error_, (dict, Error)): + raise Exception("Expected error_ to be a Error, received: {}".format(type(error_))) + + self.chosen_version = chosen_version_ + self.error = error_ self.unknown_fields = unknown_fields @@ -27891,6 +26241,54 @@ def __init__(self, results=None, **unknown_fields): +class UpsertSecretArg(Type): + _toSchema = {'data': 'data', 'description': 'description', 'expire_time': 'expire-time', 'label': 'label', 'params': 'params', 'rotate_policy': 'rotate-policy'} + _toPy = {'data': 'data', 'description': 'description', 'expire-time': 'expire_time', 'label': 'label', 'params': 'params', 'rotate-policy': 'rotate_policy'} + def __init__(self, data=None, description=None, expire_time=None, label=None, params=None, rotate_policy=None, **unknown_fields): + ''' + data : typing.Mapping[str, str] + description : str + expire_time : str + label : str + params : typing.Mapping[str, typing.Any] + rotate_policy : str + ''' + data_ = data + description_ = description + expire_time_ = expire_time + label_ = label + params_ = params + rotate_policy_ = rotate_policy + + # 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 expire_time_ is not None and not isinstance(expire_time_, (bytes, str)): + raise Exception("Expected expire_time_ to be a str, received: {}".format(type(expire_time_))) + + if label_ is not None and not isinstance(label_, (bytes, str)): + raise Exception("Expected label_ to be a str, received: {}".format(type(label_))) + + if params_ is not None and not isinstance(params_, dict): + raise Exception("Expected params_ to be a Mapping, received: {}".format(type(params_))) + + if rotate_policy_ is not None and not isinstance(rotate_policy_, (bytes, str)): + raise Exception("Expected rotate_policy_ to be a str, received: {}".format(type(rotate_policy_))) + + self.data = data_ + self.description = description_ + self.expire_time = expire_time_ + self.label = label_ + self.params = params_ + self.rotate_policy = rotate_policy_ + self.unknown_fields = unknown_fields + + + class UserAccess(Type): _toSchema = {'access': 'access', 'user_tag': 'user-tag'} _toPy = {'access': 'access', 'user-tag': 'user_tag'} @@ -28161,24 +26559,6 @@ def __init__(self, user_models=None, **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'} diff --git a/juju/client/connection.py b/juju/client/connection.py index 498084bdd..41561a482 100644 --- a/juju/client/connection.py +++ b/juju/client/connection.py @@ -22,7 +22,7 @@ '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]}, + 'Application': {'versions': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]}, 'ApplicationOffers': {'versions': [1, 2, 4]}, 'ApplicationScaler': {'versions': [1]}, 'Backups': {'versions': [1, 2, 3]}, @@ -55,6 +55,7 @@ 'ExternalControllerUpdater': {'versions': [1]}, 'Deployer': {'versions': [1]}, 'DiskManager': {'versions': [2]}, + 'EnvironUpgrader': {'versions': [1]}, 'FanConfigurer': {'versions': [1]}, 'Firewaller': {'versions': [3, 4, 5, 7]}, 'FirewallRules': {'versions': [1]}, diff --git a/juju/client/schemas-juju-3.0.json b/juju/client/schemas-juju-3.0.json index 76b1b612e..0a12c63b1 100644 --- a/juju/client/schemas-juju-3.0.json +++ b/juju/client/schemas-juju-3.0.json @@ -1833,8 +1833,8 @@ }, { "Name": "Application", - "Description": "APIv13 provides the Application API facade for version 13.", - "Version": 13, + "Description": "APIv14 provides the Application API facade for version 14.", + "Version": 14, "AvailableTo": [ "controller-machine-agent", "machine-agent", @@ -2048,6 +2048,18 @@ }, "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": { @@ -3840,6 +3852,21 @@ }, "additionalProperties": false }, + "StringResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "result" + ] + }, "Subnet": { "type": "object", "properties": { @@ -26464,7 +26491,7 @@ "type": "object", "properties": { "Params": { - "$ref": "#/definitions/Entities" + "$ref": "#/definitions/RetryProvisioningArgs" }, "Result": { "$ref": "#/definitions/ErrorResults" @@ -27057,6 +27084,24 @@ "script" ] }, + "RetryProvisioningArgs": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + }, + "machines": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "all" + ] + }, "StringsResult": { "type": "object", "properties": { @@ -32339,13 +32384,41 @@ "type": "object", "properties": { "Params": { - "$ref": "#/definitions/UpgradeModel" + "$ref": "#/definitions/UpgradeModelParams" + }, + "Result": { + "$ref": "#/definitions/UpgradeModelResult" } }, "description": "UpgradeModel upgrades a model." } }, "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, "ModelParam": { "type": "object", "properties": { @@ -32386,7 +32459,7 @@ "Build" ] }, - "UpgradeModel": { + "UpgradeModelParams": { "type": "object", "properties": { "agent-stream": { @@ -32401,14 +32474,29 @@ "model-tag": { "type": "string" }, - "to-version": { + "target-version": { "$ref": "#/definitions/Number" } }, "additionalProperties": false, "required": [ "model-tag", - "to-version" + "target-version" + ] + }, + "UpgradeModelResult": { + "type": "object", + "properties": { + "chosen-version": { + "$ref": "#/definitions/Number" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "chosen-version" ] } } @@ -38101,19 +38189,7 @@ "$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." + "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." }, "PrivateAddress": { "type": "object", @@ -38315,21 +38391,6 @@ "required": [ "results" ] - }, - "StringResult": { - "type": "object", - "properties": { - "error": { - "$ref": "#/definitions/Error" - }, - "result": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "result" - ] } } } @@ -38393,10 +38454,18 @@ "description": { "type": "string" }, - "int": { - "type": "integer" + "expire-time": { + "type": "string", + "format": "date-time" }, - "path": { + "label": { + "type": "string" + }, + "next-rotate-time": { + "type": "string", + "format": "date-time" + }, + "owner-tag": { "type": "string" }, "provider": { @@ -38408,25 +38477,14 @@ "revision": { "type": "integer" }, - "rotate-interval": { - "type": "integer" - }, - "status": { + "rotate-policy": { "type": "string" }, - "tags": { - "type": "object", - "patternProperties": { - ".*": { - "type": "string" - } - } - }, "update-time": { "type": "string", "format": "date-time" }, - "url": { + "uri": { "type": "string" }, "value": { @@ -38438,12 +38496,9 @@ }, "additionalProperties": false, "required": [ - "url", - "path", + "uri", "version", - "rotate-interval", - "status", - "int", + "owner-tag", "provider", "revision", "create-time", @@ -38553,7 +38608,7 @@ "$ref": "#/definitions/UpdateSecretArgs" }, "Result": { - "$ref": "#/definitions/StringResults" + "$ref": "#/definitions/ErrorResults" } }, "description": "UpdateSecrets updates the specified secrets." @@ -38575,6 +38630,9 @@ "CreateSecretArg": { "type": "object", "properties": { + "UpsertSecretArg": { + "$ref": "#/definitions/UpsertSecretArg" + }, "data": { "type": "object", "patternProperties": { @@ -38586,42 +38644,33 @@ "description": { "type": "string" }, - "params": { - "type": "object", - "patternProperties": { - ".*": { - "type": "object", - "additionalProperties": true - } - } + "expire-time": { + "type": "string", + "format": "date-time" }, - "path": { + "label": { "type": "string" }, - "rotate-interval": { - "type": "integer" - }, - "status": { + "owner-tag": { "type": "string" }, - "tags": { + "params": { "type": "object", "patternProperties": { ".*": { - "type": "string" + "type": "object", + "additionalProperties": true } } }, - "type": { + "rotate-policy": { "type": "string" } }, "additionalProperties": false, "required": [ - "type", - "path", - "rotate-interval", - "status" + "UpsertSecretArg", + "owner-tag" ] }, "CreateSecretArgs": { @@ -38718,14 +38767,23 @@ "GetSecretArg": { "type": "object", "properties": { - "id": { + "label": { "type": "string" }, - "url": { + "peek": { + "type": "boolean" + }, + "update": { + "type": "boolean" + }, + "uri": { "type": "string" } }, - "additionalProperties": false + "additionalProperties": false, + "required": [ + "uri" + ] }, "GetSecretArgs": { "type": "object", @@ -38745,7 +38803,7 @@ "SecretRotatedArg": { "type": "object", "properties": { - "url": { + "uri": { "type": "string" }, "when": { @@ -38755,7 +38813,7 @@ }, "additionalProperties": false, "required": [ - "url", + "uri", "when" ] }, @@ -38784,17 +38842,13 @@ "rotate-interval": { "type": "integer" }, - "secret-id": { - "type": "integer" - }, - "url": { + "uri": { "type": "string" } }, "additionalProperties": false, "required": [ - "secret-id", - "url", + "uri", "rotate-interval", "last-rotate-time" ] @@ -38901,6 +38955,9 @@ "UpdateSecretArg": { "type": "object", "properties": { + "UpsertSecretArg": { + "$ref": "#/definitions/UpsertSecretArg" + }, "data": { "type": "object", "patternProperties": { @@ -38912,6 +38969,13 @@ "description": { "type": "string" }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, "params": { "type": "object", "patternProperties": { @@ -38921,29 +38985,17 @@ } } }, - "rotate-interval": { - "type": "integer" - }, - "status": { + "rotate-policy": { "type": "string" }, - "tags": { - "type": "object", - "patternProperties": { - ".*": { - "type": "string" - } - } - }, - "url": { + "uri": { "type": "string" } }, "additionalProperties": false, "required": [ - "url", - "rotate-interval", - "status" + "UpsertSecretArg", + "uri" ] }, "UpdateSecretArgs": { @@ -38960,6 +39012,42 @@ "required": [ "args" ] + }, + "UpsertSecretArg": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-policy": { + "type": "string" + } + }, + "additionalProperties": false } } } @@ -39027,17 +39115,13 @@ "rotate-interval": { "type": "integer" }, - "secret-id": { - "type": "integer" - }, - "url": { + "uri": { "type": "string" } }, "additionalProperties": false, "required": [ - "secret-id", - "url", + "uri", "rotate-interval", "last-rotate-time" ] diff --git a/juju/client/schemas-juju-latest-new.json b/juju/client/schemas-juju-latest-new.json new file mode 100644 index 000000000..0a12c63b1 --- /dev/null +++ b/juju/client/schemas-juju-latest-new.json @@ -0,0 +1,48715 @@ +[ + { + "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": "APIv14 provides the Application API facade for version 14.", + "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." + }, + "GetCharmURLOrigin": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationGet" + }, + "Result": { + "$ref": "#/definitions/CharmURLOriginResult" + } + }, + "description": "GetCharmURLOrigin returns the charm URL and charm origin the given\napplication is running at present." + }, + "GetConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetConfigResults" + } + }, + "description": "GetConfig returns the charm config for each of the input applications." + }, + "GetConstraints": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ApplicationGetConstraintsResults" + } + }, + "description": "GetConstraints returns the constraints for a given application." + }, + "Leader": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entity" + }, + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "Leader returns the unit name of the leader for the given application." + }, + "MergeBindings": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationMergeBindingsArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "MergeBindings merges operator-defined bindings with the current bindings for\none or more applications." + }, + "ResolveUnitErrors": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/UnitsResolved" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ResolveUnitErrors marks errors on the specified units as resolved." + }, + "ScaleApplications": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ScaleApplicationsParams" + }, + "Result": { + "$ref": "#/definitions/ScaleApplicationResults" + } + }, + "description": "ScaleApplications scales the specified application to the requested number of units." + }, + "SetCharm": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationSetCharm" + } + }, + "description": "SetCharm sets the charm for a given for the application." + }, + "SetConfigs": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ConfigSetArgs" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetConfigs implements the server side of Application.SetConfig. Both\napplication and charm config are set. It does not unset values in\nConfig map that are set to an empty string. Unset should be used for that." + }, + "SetConstraints": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetConstraints" + } + }, + "description": "SetConstraints sets the constraints for a given application." + }, + "SetMetricCredentials": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ApplicationMetricCredentials" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "SetMetricCredentials sets credentials on the application." + }, + "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 + }, + "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": "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/RetryProvisioningArgs" + }, + "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" + ] + }, + "RetryProvisioningArgs": { + "type": "object", + "properties": { + "all": { + "type": "boolean" + }, + "machines": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "all" + ] + }, + "StringsResult": { + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/Error" + }, + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false + }, + "StringsResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/StringsResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "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/UpgradeModelParams" + }, + "Result": { + "$ref": "#/definitions/UpgradeModelResult" + } + }, + "description": "UpgradeModel upgrades a model." + } + }, + "definitions": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "ModelParam": { + "type": "object", + "properties": { + "model-tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "model-tag" + ] + }, + "Number": { + "type": "object", + "properties": { + "Build": { + "type": "integer" + }, + "Major": { + "type": "integer" + }, + "Minor": { + "type": "integer" + }, + "Patch": { + "type": "integer" + }, + "Tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "Major", + "Minor", + "Tag", + "Patch", + "Build" + ] + }, + "UpgradeModelParams": { + "type": "object", + "properties": { + "agent-stream": { + "type": "string" + }, + "dry-run": { + "type": "boolean" + }, + "ignore-agent-versions": { + "type": "boolean" + }, + "model-tag": { + "type": "string" + }, + "target-version": { + "$ref": "#/definitions/Number" + } + }, + "additionalProperties": false, + "required": [ + "model-tag", + "target-version" + ] + }, + "UpgradeModelResult": { + "type": "object", + "properties": { + "chosen-version": { + "$ref": "#/definitions/Number" + }, + "error": { + "$ref": "#/definitions/Error" + } + }, + "additionalProperties": false, + "required": [ + "chosen-version" + ] + } + } + } + }, + { + "Name": "NotifyWatcher", + "Description": "srvNotifyWatcher defines the API access to methods on a NotifyWatcher.\nEach client has its own current set of watchers, stored in resources.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "controller-user", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "description": "Next returns when a change has occurred to the\nentity being watched since the most recent call to Next\nor the Watch call that created the NotifyWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + } + } + }, + { + "Name": "OfferStatusWatcher", + "Description": "srvOfferStatusWatcher defines the API wrapping a crossmodelrelations.OfferStatusWatcher.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Next": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/OfferStatusWatchResult" + } + }, + "description": "Next returns when a change has occurred to an entity of the\ncollection being watched since the most recent call to Next\nor the Watch call that created the srvOfferStatusWatcher." + }, + "Stop": { + "type": "object", + "description": "Stop stops the watcher." + } + }, + "definitions": { + "EntityStatus": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "info": { + "type": "string" + }, + "since": { + "type": "string", + "format": "date-time" + }, + "status": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "status", + "info", + "since" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "OfferStatusChange": { + "type": "object", + "properties": { + "offer-name": { + "type": "string" + }, + "status": { + "$ref": "#/definitions/EntityStatus" + } + }, + "additionalProperties": false, + "required": [ + "offer-name", + "status" + ] + }, + "OfferStatusWatchResult": { + "type": "object", + "properties": { + "changes": { + "type": "array", + "items": { + "$ref": "#/definitions/OfferStatusChange" + } + }, + "error": { + "$ref": "#/definitions/Error" + }, + "watcher-id": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "watcher-id", + "changes" + ] + } + } + } + }, + { + "Name": "Payloads", + "Description": "API serves payload-specific API methods.", + "Version": 1, + "AvailableTo": [ + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "List": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/PayloadListArgs" + }, + "Result": { + "$ref": "#/definitions/PayloadListResults" + } + }, + "description": "List builds the list of payloads being tracked for\nthe given unit and IDs. If no IDs are provided then all tracked\npayloads for the unit are returned." + } + }, + "definitions": { + "Payload": { + "type": "object", + "properties": { + "class": { + "type": "string" + }, + "id": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "machine": { + "type": "string" + }, + "status": { + "type": "string" + }, + "type": { + "type": "string" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "class", + "type", + "id", + "status", + "labels", + "unit", + "machine" + ] + }, + "PayloadListArgs": { + "type": "object", + "properties": { + "patterns": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "patterns" + ] + }, + "PayloadListResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Payload" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + } + } + } + }, + { + "Name": "PayloadsHookContext", + "Description": "UnitFacade serves payload-specific API methods.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "List": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + }, + "description": "List builds the list of payload being tracked for\nthe given unit and IDs. If no IDs are provided then all tracked\npayloads for the unit are returned." + }, + "LookUp": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/LookUpPayloadArgs" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + }, + "description": "LookUp identifies the payload with the provided name and raw ID." + }, + "SetStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/SetPayloadStatusArgs" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + }, + "description": "SetStatus sets the raw status of a payload." + }, + "Track": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/TrackPayloadArgs" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + }, + "description": "Track stores a payload to be tracked in state." + }, + "Untrack": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/PayloadResults" + } + }, + "description": "Untrack marks the identified payload as no longer being tracked." + } + }, + "definitions": { + "Entities": { + "type": "object", + "properties": { + "entities": { + "type": "array", + "items": { + "$ref": "#/definitions/Entity" + } + } + }, + "additionalProperties": false, + "required": [ + "entities" + ] + }, + "Entity": { + "type": "object", + "properties": { + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag" + ] + }, + "Error": { + "type": "object", + "properties": { + "code": { + "type": "string" + }, + "info": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "message": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "message", + "code" + ] + }, + "LookUpPayloadArg": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "name", + "id" + ] + }, + "LookUpPayloadArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/LookUpPayloadArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "Payload": { + "type": "object", + "properties": { + "class": { + "type": "string" + }, + "id": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "machine": { + "type": "string" + }, + "status": { + "type": "string" + }, + "type": { + "type": "string" + }, + "unit": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "class", + "type", + "id", + "status", + "labels", + "unit", + "machine" + ] + }, + "PayloadResult": { + "type": "object", + "properties": { + "Entity": { + "$ref": "#/definitions/Entity" + }, + "error": { + "$ref": "#/definitions/Error" + }, + "not-found": { + "type": "boolean" + }, + "payload": { + "$ref": "#/definitions/Payload" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "Entity", + "payload", + "not-found" + ] + }, + "PayloadResults": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/PayloadResult" + } + } + }, + "additionalProperties": false, + "required": [ + "results" + ] + }, + "SetPayloadStatusArg": { + "type": "object", + "properties": { + "Entity": { + "$ref": "#/definitions/Entity" + }, + "status": { + "type": "string" + }, + "tag": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "tag", + "Entity", + "status" + ] + }, + "SetPayloadStatusArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/SetPayloadStatusArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "TrackPayloadArgs": { + "type": "object", + "properties": { + "payloads": { + "type": "array", + "items": { + "$ref": "#/definitions/Payload" + } + } + }, + "additionalProperties": false, + "required": [ + "payloads" + ] + } + } + } + }, + { + "Name": "Pinger", + "Description": "pinger describes a resource that can be pinged and stopped.", + "Version": 1, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent", + "unit-agent", + "controller-user", + "model-user" + ], + "Schema": { + "type": "object", + "properties": { + "Ping": { + "type": "object" + }, + "Stop": { + "type": "object" + } + } + } + }, + { + "Name": "Provisioner", + "Description": "ProvisionerAPIV11 provides v10 of the provisioner facade.\nIt relies on agent-set origin when calling SetHostMachineNetworkConfig.", + "Version": 11, + "AvailableTo": [ + "controller-machine-agent", + "machine-agent" + ], + "Schema": { + "type": "object", + "properties": { + "APIAddresses": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringsResult" + } + }, + "description": "APIAddresses returns the list of addresses used to connect to the API." + }, + "APIHostPorts": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/APIHostPortsResult" + } + }, + "description": "APIHostPorts returns the API server addresses." + }, + "AvailabilityZone": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "AvailabilityZone returns a provider-specific availability zone for each given machine entity" + }, + "CACert": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/BytesResult" + } + }, + "description": "CACert returns the certificate used to validate the state connection." + }, + "Constraints": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ConstraintsResults" + } + }, + "description": "Constraints returns the constraints for each given machine entity." + }, + "ContainerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ContainerConfig" + } + }, + "description": "ContainerConfig returns information from the model config that is\nneeded for container cloud-init." + }, + "ContainerManagerConfig": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/ContainerManagerConfigParams" + }, + "Result": { + "$ref": "#/definitions/ContainerManagerConfig" + } + }, + "description": "ContainerManagerConfig returns information from the model config that is\nneeded for configuring the container manager." + }, + "ControllerAPIInfoForModels": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ControllerAPIInfoResults" + } + }, + "description": "ControllerAPIInfoForModels returns the controller api connection details for the specified models." + }, + "ControllerConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ControllerConfigResult" + } + }, + "description": "ControllerConfig returns the controller's configuration." + }, + "DistributionGroup": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/DistributionGroupResults" + } + }, + "description": "DistributionGroup returns, for each given machine entity,\na slice of instance.Ids that belong to the same distribution\ngroup as that machine. This information may be used to\ndistribute instances for high availability." + }, + "DistributionGroupByMachineId": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringsResults" + } + }, + "description": "DistributionGroupByMachineId returns, for each given machine entity,\na slice of machine.Ids that belong to the same distribution\ngroup as that machine. This information may be used to\ndistribute instances for high availability." + }, + "EnsureDead": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "EnsureDead calls EnsureDead on each given entity from state. It\nwill fail if the entity is not present. If it's Alive, nothing will\nhappen (see state/EnsureDead() for units or machines)." + }, + "FindTools": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/FindToolsParams" + }, + "Result": { + "$ref": "#/definitions/FindToolsResult" + } + }, + "description": "FindTools returns a List containing all tools matching the given parameters." + }, + "GetContainerInterfaceInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineNetworkConfigResults" + } + }, + "description": "GetContainerInterfaceInfo returns information to configure networking for a\ncontainer. It accepts container tags as arguments." + }, + "GetContainerProfileInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ContainerProfileResults" + } + }, + "description": "GetContainerProfileInfo returns information to configure a lxd profile(s) for a\ncontainer based on the charms deployed to the container. It accepts container\ntags as arguments. Unlike machineLXDProfileNames which has the environ\nwrite the lxd profiles and returns the names of profiles already written." + }, + "HostChangesForContainers": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/HostNetworkChangeResults" + } + }, + "description": "HostChangesForContainers returns the set of changes that need to be done\nto the host machine to prepare it for the containers to be created.\nPass in a list of the containers that you want the changes for." + }, + "InstanceId": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StringResults" + } + }, + "description": "InstanceId returns the provider specific instance id for each given\nmachine or an CodeNotProvisioned error, if not set." + }, + "InstanceStatus": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/StatusResults" + } + }, + "description": "InstanceStatus returns the instance status for each given entity.\nOnly machine tags are accepted." + }, + "KeepInstance": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/BoolResults" + } + }, + "description": "KeepInstance returns the keep-instance value for each given machine entity." + }, + "Life": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/LifeResults" + } + }, + "description": "Life returns the life status of every supplied entity, where available." + }, + "MachinesWithTransientErrors": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StatusResults" + } + }, + "description": "MachinesWithTransientErrors returns status data for machines with provisioning\nerrors which are transient." + }, + "MarkMachinesForRemoval": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "MarkMachinesForRemoval indicates that the specified machines are\nready to have any provider-level resources cleaned up and then be\nremoved." + }, + "ModelConfig": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/ModelConfigResult" + } + }, + "description": "ModelConfig returns the current model's configuration." + }, + "ModelUUID": { + "type": "object", + "properties": { + "Result": { + "$ref": "#/definitions/StringResult" + } + }, + "description": "ModelUUID returns the model UUID that the current connection is for." + }, + "PrepareContainerInterfaceInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/MachineNetworkConfigResults" + } + }, + "description": "PrepareContainerInterfaceInfo allocates an address and returns information to\nconfigure networking for a container. It accepts container tags as arguments." + }, + "ProvisioningInfo": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ProvisioningInfoResults" + } + }, + "description": "ProvisioningInfo returns the provisioning information for each given machine entity.\nIt supports all positive space constraints." + }, + "ReleaseContainerAddresses": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "ReleaseContainerAddresses finds addresses allocated to a container and marks\nthem as Dead, to be released and removed. It accepts container tags as\narguments." + }, + "Remove": { + "type": "object", + "properties": { + "Params": { + "$ref": "#/definitions/Entities" + }, + "Result": { + "$ref": "#/definitions/ErrorResults" + } + }, + "description": "Remove removes every given entity from state, calling EnsureDead\nfirst, then Remove. It will fail if the entity is not present." + }, + "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\nentity in args. The result is sorted with public addresses first.\nMachines and units are supported as entity types." + }, + "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" + ] + } + } + } + }, + { + "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" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "next-rotate-time": { + "type": "string", + "format": "date-time" + }, + "owner-tag": { + "type": "string" + }, + "provider": { + "type": "string" + }, + "provider-id": { + "type": "string" + }, + "revision": { + "type": "integer" + }, + "rotate-policy": { + "type": "string" + }, + "update-time": { + "type": "string", + "format": "date-time" + }, + "uri": { + "type": "string" + }, + "value": { + "$ref": "#/definitions/SecretValueResult" + }, + "version": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "version", + "owner-tag", + "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/ErrorResults" + } + }, + "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": { + "UpsertSecretArg": { + "$ref": "#/definitions/UpsertSecretArg" + }, + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "owner-tag": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-policy": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "UpsertSecretArg", + "owner-tag" + ] + }, + "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": { + "label": { + "type": "string" + }, + "peek": { + "type": "boolean" + }, + "update": { + "type": "boolean" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri" + ] + }, + "GetSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/GetSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "SecretRotatedArg": { + "type": "object", + "properties": { + "uri": { + "type": "string" + }, + "when": { + "type": "string", + "format": "date-time" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "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" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "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": { + "UpsertSecretArg": { + "$ref": "#/definitions/UpsertSecretArg" + }, + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-policy": { + "type": "string" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "UpsertSecretArg", + "uri" + ] + }, + "UpdateSecretArgs": { + "type": "object", + "properties": { + "args": { + "type": "array", + "items": { + "$ref": "#/definitions/UpdateSecretArg" + } + } + }, + "additionalProperties": false, + "required": [ + "args" + ] + }, + "UpsertSecretArg": { + "type": "object", + "properties": { + "data": { + "type": "object", + "patternProperties": { + ".*": { + "type": "string" + } + } + }, + "description": { + "type": "string" + }, + "expire-time": { + "type": "string", + "format": "date-time" + }, + "label": { + "type": "string" + }, + "params": { + "type": "object", + "patternProperties": { + ".*": { + "type": "object", + "additionalProperties": true + } + } + }, + "rotate-policy": { + "type": "string" + } + }, + "additionalProperties": false + } + } + } + }, + { + "Name": "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" + }, + "uri": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "uri", + "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/controller.py b/juju/controller.py index 721b272fd..5d75739ca 100644 --- a/juju/controller.py +++ b/juju/controller.py @@ -244,7 +244,7 @@ async def add_credential(self, name=None, credential=None, cloud=None, log.debug('Uploading credential %s', name) cloud_facade = client.CloudFacade.from_connection(self.connection()) tagged_credentials = [ - client.UpdateCloudCredential( + client.TaggedCredential( tag=tag.credential(cloud, tag.untag('user-', owner), name), credential=credential, )] diff --git a/juju/model.py b/juju/model.py index 97d521d54..a0e0a2390 100644 --- a/juju/model.py +++ b/juju/model.py @@ -2262,7 +2262,19 @@ async def set_constraints(self, constraints): constraints=constraints) async def get_action_output(self, action_uuid, wait=None): - """Get the results of an action by ID. + """ Get the results of an action by ID. + + :param str action_uuid: Id of the action + :param int wait: Time in seconds to wait for action to complete. + :return dict: Output from action + :raises: :class:`JujuError` if invalid action_uuid + """ + action = await self._get_completed_action(action_uuid, wait=wait) + # ActionResult.output is None if the action produced no output + return {} if action.output is None else action.output + + async def _get_completed_action(self, action_uuid, wait=None): + """Get the completed internal _definitions.Action object. :param str action_uuid: Id of the action :param int wait: Time in seconds to wait for action to complete. @@ -2288,13 +2300,8 @@ async def _wait_for_action_status(): await jasyncio.wait_for( _wait_for_action_status(), timeout=wait) - action_output = await action_facade.Actions(entities=entity) - # ActionResult.output is None if the action produced no output - if action_output.results[0].output is None: - output = {} - else: - output = action_output.results[0].output - return output + action_results = await action_facade.Actions(entities=entity) + return action_results.results[0] async def get_action_status(self, uuid_or_prefix=None, name=None): """Get the status of all actions, filtered by ID, ID prefix, or name. diff --git a/juju/unit.py b/juju/unit.py index cecccadac..e65a824b0 100644 --- a/juju/unit.py +++ b/juju/unit.py @@ -227,22 +227,27 @@ async def run_action(self, action_name, **params): """ action_facade = client.ActionFacade.from_connection(self.connection) - log.debug('Starting action `%s` on %s', action_name, self.name) - res = await action_facade.EnqueueOperation(actions=[client.Action( + old_client = self.connection.is_using_old_client + + op = action_facade.Enqueue if old_client else action_facade.EnqueueOperation + res = await op(actions=[client.Action( name=action_name, parameters=params, receiver=self.tag, )]) - action = res.actions[0].result - error = res.actions[0].error + + _action = res.results[0] if old_client else res.actions[0] + action = _action.action + error = _action.error + if error and error.code == 'not found': raise ValueError('Action `%s` not found on %s' % (action_name, self.name)) elif error: raise Exception('Unknown action error: %s' % error.serialize()) - action_id = action[len('action-'):] + action_id = action.tag[len('action-'):] log.debug('Action started as %s', action_id) # we mustn't use wait_for_action because that blocks until the # action is complete, rather than just being in the model diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index 9002d390c..0c4f76320 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -16,7 +16,7 @@ def test_basics(): def test_from_connection(): connection = mock.Mock() - connection.facades = {"Action": 2} + connection.facades = {"Action": 7} connection.info = {"server-version": '3.0'} action_facade = client.ActionFacade.from_connection(connection) assert action_facade