Source code for juju.client._client1

# DO NOT CHANGE THIS FILE! This file is auto-generated by facade.py.
# Changes will be overwritten/lost when the file is regenerated.

from juju.client.facade import Type, ReturnMapping
from juju.client._definitions import *


[docs]class ActionPrunerFacade(Type): name = 'ActionPruner' version = 1 schema = {'definitions': {'ActionPruneArgs': {'additionalProperties': False, 'properties': {'max-history-mb': {'type': 'integer'}, 'max-history-time': {'type': 'integer'}}, 'required': ['max-history-time', 'max-history-mb'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'ModelConfigResult': {'additionalProperties': False, 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}}, 'required': ['config'], 'type': 'object'}, 'NotifyWatchResult': {'additionalProperties': False, 'properties': {'NotifyWatcherId': {'type': 'string'}, 'error': {'$ref': '#/definitions/Error'}}, 'required': ['NotifyWatcherId'], 'type': 'object'}}, 'properties': {'ModelConfig': {'description': 'ModelConfig returns the ' "current model's configuration.", 'properties': {'Result': {'$ref': '#/definitions/ModelConfigResult'}}, 'type': 'object'}, 'Prune': {'description': 'Prune endpoint removes action ' 'entries until\n' 'only the ones newer than now - ' 'p.MaxHistoryTime remain and\n' 'the history is smaller than ' 'p.MaxHistoryMB.', 'properties': {'Params': {'$ref': '#/definitions/ActionPruneArgs'}}, 'type': 'object'}, 'WatchForModelConfigChanges': {'description': 'WatchForModelConfigChanges ' 'returns a ' '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'}
[docs] @ReturnMapping(ModelConfigResult) async def ModelConfig(self): ''' ModelConfig returns the current model's configuration. Returns -> ModelConfigResult ''' # map input types to rpc msg _params = dict() msg = dict(type='ActionPruner', request='ModelConfig', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Prune(self, max_history_mb=None, max_history_time=None): ''' Prune endpoint removes action entries until only the ones newer than now - p.MaxHistoryTime remain and the history is smaller than p.MaxHistoryMB. max_history_mb : int max_history_time : int Returns -> None ''' if max_history_mb is not None and not isinstance(max_history_mb, int): raise Exception("Expected max_history_mb to be a int, received: {}".format(type(max_history_mb))) if max_history_time is not None and not isinstance(max_history_time, int): raise Exception("Expected max_history_time to be a int, received: {}".format(type(max_history_time))) # map input types to rpc msg _params = dict() msg = dict(type='ActionPruner', request='Prune', version=1, params=_params) _params['max-history-mb'] = max_history_mb _params['max-history-time'] = max_history_time reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResult) async def WatchForModelConfigChanges(self): ''' WatchForModelConfigChanges returns a NotifyWatcher that observes changes to the model configuration. Note that although the NotifyWatchResult contains an Error field, it's not used because we are only returning a single watcher, so we use the regular error return. Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='ActionPruner', request='WatchForModelConfigChanges', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]class AgentLifeFlagFacade(Type): name = 'AgentLifeFlag' version = 1 schema = {'definitions': {'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'LifeResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'life': {'type': 'string'}}, 'required': ['life'], 'type': 'object'}, 'LifeResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'NotifyWatchResult': {'additionalProperties': False, 'properties': {'NotifyWatcherId': {'type': 'string'}, 'error': {'$ref': '#/definitions/Error'}}, 'required': ['NotifyWatcherId'], 'type': 'object'}, 'NotifyWatchResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}}, 'properties': {'Life': {'description': 'Life returns the life status of every ' 'supplied entity, where available.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/LifeResults'}}, 'type': 'object'}, 'Watch': {'description': 'Watch starts an NotifyWatcher for ' 'each given entity.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @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='AgentLifeFlag', request='Life', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @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='AgentLifeFlag', request='Watch', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs]class AgentToolsFacade(Type): name = 'AgentTools' version = 1 schema = {'properties': {'UpdateToolsAvailable': {'description': 'UpdateToolsAvailable ' 'invokes a lookup and ' 'further update in ' 'environ\n' 'for new patches of ' 'the current tool ' 'versions.', 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(None) async def UpdateToolsAvailable(self): ''' UpdateToolsAvailable invokes a lookup and further update in environ for new patches of the current tool versions. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='AgentTools', request='UpdateToolsAvailable', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]class ApplicationScalerFacade(Type): name = 'ApplicationScaler' version = 1 schema = {'definitions': {'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'ErrorResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}}, 'type': 'object'}, 'ErrorResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'StringsWatchResult': {'additionalProperties': False, 'properties': {'changes': {'items': {'type': 'string'}, 'type': 'array'}, 'error': {'$ref': '#/definitions/Error'}, 'watcher-id': {'type': 'string'}}, 'required': ['watcher-id'], 'type': 'object'}}, 'properties': {'Rescale': {'description': 'Rescale causes any supplied ' 'services to be scaled up to their\n' 'minimum size.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'Watch': {'description': 'Watch returns a watcher that sends ' 'the names of services whose\n' 'unit count may be below their ' 'configured minimum.', 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(ErrorResults) async def Rescale(self, entities=None): ''' Rescale causes any supplied services to be scaled up to their minimum size. entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='ApplicationScaler', request='Rescale', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(StringsWatchResult) async def Watch(self): ''' Watch returns a watcher that sends the names of services whose unit count may be below their configured minimum. Returns -> StringsWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='ApplicationScaler', request='Watch', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]class CAASAdmissionFacade(Type): name = 'CAASAdmission' version = 1 schema = {'definitions': {'ControllerAPIInfoResult': {'additionalProperties': False, 'properties': {'addresses': {'items': {'type': 'string'}, 'type': 'array'}, 'cacert': {'type': 'string'}, 'error': {'$ref': '#/definitions/Error'}}, 'required': ['addresses', 'cacert'], 'type': 'object'}, 'ControllerAPIInfoResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ControllerAPIInfoResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'ControllerConfigResult': {'additionalProperties': False, 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}}, 'required': ['config'], 'type': 'object'}, 'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}}, 'properties': {'ControllerAPIInfoForModels': {'description': 'ControllerAPIInfoForModels ' 'returns the ' 'controller api ' 'connection ' 'details for the ' 'specified ' 'models.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/ControllerAPIInfoResults'}}, 'type': 'object'}, 'ControllerConfig': {'description': 'ControllerConfig returns ' "the controller's " 'configuration.', 'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(ControllerAPIInfoResults) async def ControllerAPIInfoForModels(self, entities=None): ''' ControllerAPIInfoForModels returns the controller api connection details for the specified models. entities : typing.Sequence[~Entity] Returns -> ControllerAPIInfoResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='CAASAdmission', request='ControllerAPIInfoForModels', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ControllerConfigResult) async def ControllerConfig(self): ''' ControllerConfig returns the controller's configuration. Returns -> ControllerConfigResult ''' # map input types to rpc msg _params = dict() msg = dict(type='CAASAdmission', request='ControllerConfig', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @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
[docs] @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
[docs]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'}, 'Base': {'additionalProperties': False, 'properties': {'channel': {'type': 'string'}, 'name': {'type': 'string'}}, 'required': ['name', 'channel'], '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'}, 'CAASApplicationProvisionerConfig': {'additionalProperties': False, 'properties': {'unmanaged-applications': {'$ref': '#/definitions/Entities'}}, 'type': 'object'}, 'CAASApplicationProvisionerConfigResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'provisioner-config': {'$ref': '#/definitions/CAASApplicationProvisionerConfig'}}, 'type': 'object'}, 'CAASApplicationProvisioningInfo': {'additionalProperties': False, 'properties': {'api-addresses': {'items': {'type': 'string'}, 'type': 'array'}, 'base': {'$ref': '#/definitions/Base'}, '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'}, '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'}, 'CAASApplicationProvisioningState': {'additionalProperties': False, 'properties': {'scale-target': {'type': 'integer'}, 'scaling': {'type': 'boolean'}}, 'required': ['scaling', 'scale-target'], 'type': 'object'}, 'CAASApplicationProvisioningStateArg': {'additionalProperties': False, 'properties': {'application': {'$ref': '#/definitions/Entity'}, 'provisioning-state': {'$ref': '#/definitions/CAASApplicationProvisioningState'}}, 'required': ['application', 'provisioning-state'], 'type': 'object'}, 'CAASApplicationProvisioningStateResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'provisioning-state': {'$ref': '#/definitions/CAASApplicationProvisioningState'}}, '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'}, 'DestroyUnitInfo': {'additionalProperties': False, 'properties': {'destroyed-storage': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}, 'detached-storage': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'type': 'object'}, 'DestroyUnitParams': {'additionalProperties': False, 'properties': {'destroy-storage': {'type': 'boolean'}, 'dry-run': {'type': 'boolean'}, 'force': {'type': 'boolean'}, 'max-wait': {'type': 'integer'}, 'unit-tag': {'type': 'string'}}, 'required': ['unit-tag'], 'type': 'object'}, 'DestroyUnitResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'info': {'$ref': '#/definitions/DestroyUnitInfo'}}, 'type': 'object'}, 'DestroyUnitResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/DestroyUnitResult'}, 'type': 'array'}}, 'type': 'object'}, 'DestroyUnitsParams': {'additionalProperties': False, 'properties': {'units': {'items': {'$ref': '#/definitions/DestroyUnitParams'}, 'type': 'array'}}, 'required': ['units'], 'type': 'object'}, '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'}, 'image-id': {'type': 'string'}, 'instance-role': {'type': 'string'}, 'instance-type': {'type': 'string'}, 'mem': {'type': 'integer'}, 'root-disk': {'type': 'integer'}, 'root-disk-source': {'type': 'string'}, 'spaces': {'items': {'type': 'string'}, 'type': 'array'}, 'tags': {'items': {'type': 'string'}, 'type': 'array'}, 'virt-type': {'type': 'string'}, 'zones': {'items': {'type': 'string'}, 'type': 'array'}}, 'type': 'object'}}, 'properties': {'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'}, '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'}, 'DestroyUnits': {'description': 'DestroyUnits is responsible ' 'for scaling down a set of ' 'units on the this\n' 'Application.', 'properties': {'Params': {'$ref': '#/definitions/DestroyUnitsParams'}, 'Result': {'$ref': '#/definitions/DestroyUnitResults'}}, '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'}, 'ProvisionerConfig': {'description': 'ProvisionerConfig ' 'returns the ' "provisioner's " 'configuration.', 'properties': {'Result': {'$ref': '#/definitions/CAASApplicationProvisionerConfigResult'}}, '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'}, 'ProvisioningState': {'description': 'ProvisioningState ' 'returns the provisioning ' 'state for the ' 'application.', 'properties': {'Params': {'$ref': '#/definitions/Entity'}, 'Result': {'$ref': '#/definitions/CAASApplicationProvisioningStateResult'}}, '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'}, 'SetProvisioningState': {'description': 'SetProvisioningState ' 'sets the provisioning ' 'state for the ' 'application.', 'properties': {'Params': {'$ref': '#/definitions/CAASApplicationProvisioningStateArg'}, 'Result': {'$ref': '#/definitions/ErrorResult'}}, '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'}, 'WatchProvisioningInfo': {'description': 'WatchProvisioningInfo ' 'provides a watcher ' 'for changes that ' 'affect the\n' 'information returned ' 'by ProvisioningInfo. ' 'This is useful for ' 'ensuring the\n' 'latest application ' 'stated is ensured.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, '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'}
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @ReturnMapping(DestroyUnitResults) async def DestroyUnits(self, units=None): ''' DestroyUnits is responsible for scaling down a set of units on the this Application. units : typing.Sequence[~DestroyUnitParams] Returns -> DestroyUnitResults ''' if units is not None and not isinstance(units, (bytes, str, list)): raise Exception("Expected units to be a Sequence, received: {}".format(type(units))) # map input types to rpc msg _params = dict() msg = dict(type='CAASApplicationProvisioner', request='DestroyUnits', version=1, params=_params) _params['units'] = units reply = await self.rpc(msg) return reply
[docs] @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
[docs] @ReturnMapping(CAASApplicationProvisionerConfigResult) async def ProvisionerConfig(self): ''' ProvisionerConfig returns the provisioner's configuration. Returns -> CAASApplicationProvisionerConfigResult ''' # map input types to rpc msg _params = dict() msg = dict(type='CAASApplicationProvisioner', request='ProvisionerConfig', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @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
[docs] @ReturnMapping(CAASApplicationProvisioningStateResult) async def ProvisioningState(self, tag=None): ''' ProvisioningState returns the provisioning state for the application. tag : str Returns -> CAASApplicationProvisioningStateResult ''' if tag is not None and not isinstance(tag, (bytes, str)): raise Exception("Expected tag to be a str, received: {}".format(type(tag))) # map input types to rpc msg _params = dict() msg = dict(type='CAASApplicationProvisioner', request='ProvisioningState', version=1, params=_params) _params['tag'] = tag reply = await self.rpc(msg) return reply
[docs] @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
[docs] @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
[docs] @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
[docs] @ReturnMapping(ErrorResult) async def SetProvisioningState(self, application=None, provisioning_state=None): ''' SetProvisioningState sets the provisioning state for the application. application : Entity provisioning_state : CAASApplicationProvisioningState Returns -> ErrorResult ''' if application is not None and not isinstance(application, (dict, Entity)): raise Exception("Expected application to be a Entity, received: {}".format(type(application))) if provisioning_state is not None and not isinstance(provisioning_state, (dict, CAASApplicationProvisioningState)): raise Exception("Expected provisioning_state to be a CAASApplicationProvisioningState, received: {}".format(type(provisioning_state))) # map input types to rpc msg _params = dict() msg = dict(type='CAASApplicationProvisioner', request='SetProvisioningState', version=1, params=_params) _params['application'] = application _params['provisioning-state'] = provisioning_state reply = await self.rpc(msg) return reply
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @ReturnMapping(NotifyWatchResults) async def WatchProvisioningInfo(self, entities=None): ''' WatchProvisioningInfo provides a watcher for changes that affect the information returned by ProvisioningInfo. This is useful for ensuring the latest application stated is ensured. entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='CAASApplicationProvisioner', request='WatchProvisioningInfo', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @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
[docs]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'}
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs]class CAASFirewallerSidecarFacade(Type): name = 'CAASFirewallerSidecar' version = 1 schema = {'definitions': {'ApplicationGetConfigResults': {'additionalProperties': False, 'properties': {'Results': {'items': {'$ref': '#/definitions/ConfigResult'}, 'type': 'array'}}, 'required': ['Results'], 'type': 'object'}, 'ApplicationOpenedPorts': {'additionalProperties': False, 'properties': {'endpoint': {'type': 'string'}, 'port-ranges': {'items': {'$ref': '#/definitions/PortRange'}, 'type': 'array'}}, 'required': ['endpoint', 'port-ranges'], 'type': 'object'}, 'ApplicationOpenedPortsResult': {'additionalProperties': False, 'properties': {'application-port-ranges': {'items': {'$ref': '#/definitions/ApplicationOpenedPorts'}, 'type': 'array'}, 'error': {'$ref': '#/definitions/Error'}}, 'required': ['application-port-ranges'], 'type': 'object'}, 'ApplicationOpenedPortsResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ApplicationOpenedPortsResult'}, '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'}, 'PortRange': {'additionalProperties': False, 'properties': {'from-port': {'type': 'integer'}, 'protocol': {'type': 'string'}, 'to-port': {'type': 'integer'}}, 'required': ['from-port', 'to-port', 'protocol'], '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'}, 'GetOpenedPorts': {'description': 'GetOpenedPorts returns all ' 'the opened ports for each ' 'given application tag.', 'properties': {'Params': {'$ref': '#/definitions/Entity'}, 'Result': {'$ref': '#/definitions/ApplicationOpenedPortsResults'}}, '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'}
[docs] @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='CAASFirewallerSidecar', request='ApplicationCharmInfo', version=1, params=_params) _params['tag'] = tag reply = await self.rpc(msg) return reply
[docs] @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='CAASFirewallerSidecar', request='ApplicationsConfig', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @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='CAASFirewallerSidecar', request='CharmInfo', version=1, params=_params) _params['url'] = url reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ApplicationOpenedPortsResults) async def GetOpenedPorts(self, tag=None): ''' GetOpenedPorts returns all the opened ports for each given application tag. tag : str Returns -> ApplicationOpenedPortsResults ''' if tag is not None and not isinstance(tag, (bytes, str)): raise Exception("Expected tag to be a str, received: {}".format(type(tag))) # map input types to rpc msg _params = dict() msg = dict(type='CAASFirewallerSidecar', request='GetOpenedPorts', version=1, params=_params) _params['tag'] = tag reply = await self.rpc(msg) return reply
[docs] @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='CAASFirewallerSidecar', request='IsExposed', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @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='CAASFirewallerSidecar', request='Life', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResults) async def Watch(self, entities=None): ''' Watch starts an NotifyWatcher for each given entity. entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='CAASFirewallerSidecar', request='Watch', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(StringsWatchResult) async def WatchApplications(self): ''' WatchApplications starts a StringsWatcher to watch applications deployed to this model. Returns -> StringsWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='CAASFirewallerSidecar', request='WatchApplications', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @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='CAASFirewallerSidecar', request='WatchOpenedPorts', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs]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'}, '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': {'ControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/ControllerConfigResult'}}, 'type': 'object'}, 'WatchControllerConfig': {'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @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
[docs] @ReturnMapping(NotifyWatchResult) async def WatchControllerConfig(self): ''' Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='CAASModelConfigManager', request='WatchControllerConfig', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]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'}, 'WatchModelOperatorProvisioningInfo': {'description': 'WatchModelOperatorProvisioningInfo ' 'provides ' 'a ' 'watcher ' 'for ' 'changes ' 'that ' 'affect ' 'the\n' 'information ' 'returned ' 'by ' 'ModelOperatorProvisioningInfo.', 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @ReturnMapping(NotifyWatchResult) async def WatchModelOperatorProvisioningInfo(self): ''' WatchModelOperatorProvisioningInfo provides a watcher for changes that affect the information returned by ModelOperatorProvisioningInfo. Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='CAASModelOperator', request='WatchModelOperatorProvisioningInfo', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs]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'}, 'base-image-details': {'$ref': '#/definitions/DockerImageInfo'}, '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', 'base-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'}
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs] @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
[docs]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'}
[docs] @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
[docs]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'}
[docs] @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
[docs] @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
[docs]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'}
[docs] @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
[docs]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'}
[docs] @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
[docs] @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
[docs]class CrossModelSecretsFacade(Type): name = 'CrossModelSecrets' 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'}, 'GetRemoteSecretAccessArg': {'additionalProperties': False, 'properties': {'application-token': {'type': 'string'}, 'unit-id': {'type': 'integer'}, 'uri': {'type': 'string'}}, 'required': ['application-token', 'unit-id', 'uri'], 'type': 'object'}, 'GetRemoteSecretAccessArgs': {'additionalProperties': False, 'properties': {'relations': {'items': {'$ref': '#/definitions/GetRemoteSecretAccessArg'}, 'type': 'array'}}, 'required': ['relations'], 'type': 'object'}, 'GetRemoteSecretContentArg': {'additionalProperties': False, 'properties': {'application-token': {'type': 'string'}, 'bakery-version': {'type': 'integer'}, 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, 'type': 'array'}, 'peek': {'type': 'boolean'}, 'refresh': {'type': 'boolean'}, 'revision': {'type': 'integer'}, 'unit-id': {'type': 'integer'}, 'uri': {'type': 'string'}}, 'required': ['application-token', 'unit-id', 'uri'], 'type': 'object'}, 'GetRemoteSecretContentArgs': {'additionalProperties': False, 'properties': {'relations': {'items': {'$ref': '#/definitions/GetRemoteSecretContentArg'}, 'type': 'array'}}, 'required': ['relations'], 'type': 'object'}, 'Macaroon': {'additionalProperties': False, 'type': 'object'}, 'SecretBackendConfig': {'additionalProperties': False, 'properties': {'params': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'type': {'type': 'string'}}, 'required': ['type'], 'type': 'object'}, 'SecretBackendConfigResult': {'additionalProperties': False, 'properties': {'config': {'$ref': '#/definitions/SecretBackendConfig'}, 'draining': {'type': 'boolean'}, 'model-controller': {'type': 'string'}, 'model-name': {'type': 'string'}, 'model-uuid': {'type': 'string'}}, 'required': ['model-controller', 'model-uuid', 'model-name', 'draining'], 'type': 'object'}, 'SecretContentParams': {'additionalProperties': False, 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, 'type': 'object'}, 'value-ref': {'$ref': '#/definitions/SecretValueRef'}}, 'type': 'object'}, 'SecretContentResult': {'additionalProperties': False, 'properties': {'backend-config': {'$ref': '#/definitions/SecretBackendConfigResult'}, 'content': {'$ref': '#/definitions/SecretContentParams'}, 'error': {'$ref': '#/definitions/Error'}, 'latest-revision': {'type': 'integer'}}, 'required': ['content'], 'type': 'object'}, 'SecretContentResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/SecretContentResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'SecretValueRef': {'additionalProperties': False, 'properties': {'backend-id': {'type': 'string'}, 'revision-id': {'type': 'string'}}, 'required': ['backend-id', 'revision-id'], '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': {'GetSecretAccessScope': {'description': 'GetSecretAccessScope ' 'returns the tokens ' 'for the access scope ' 'of the specified ' 'secrets and ' 'consumers.', 'properties': {'Params': {'$ref': '#/definitions/GetRemoteSecretAccessArgs'}, 'Result': {'$ref': '#/definitions/StringResults'}}, 'type': 'object'}, 'GetSecretContentInfo': {'description': 'GetSecretContentInfo ' 'returns the secret ' 'values for the ' 'specified secrets.', 'properties': {'Params': {'$ref': '#/definitions/GetRemoteSecretContentArgs'}, 'Result': {'$ref': '#/definitions/SecretContentResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(StringResults) async def GetSecretAccessScope(self, relations=None): ''' GetSecretAccessScope returns the tokens for the access scope of the specified secrets and consumers. relations : typing.Sequence[~GetRemoteSecretAccessArg] Returns -> StringResults ''' if relations is not None and not isinstance(relations, (bytes, str, list)): raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) # map input types to rpc msg _params = dict() msg = dict(type='CrossModelSecrets', request='GetSecretAccessScope', version=1, params=_params) _params['relations'] = relations reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(SecretContentResults) async def GetSecretContentInfo(self, relations=None): ''' GetSecretContentInfo returns the secret values for the specified secrets. relations : typing.Sequence[~GetRemoteSecretContentArg] Returns -> SecretContentResults ''' if relations is not None and not isinstance(relations, (bytes, str, list)): raise Exception("Expected relations to be a Sequence, received: {}".format(type(relations))) # map input types to rpc msg _params = dict() msg = dict(type='CrossModelSecrets', request='GetSecretContentInfo', version=1, params=_params) _params['relations'] = relations reply = await self.rpc(msg) return reply
[docs]class DeployerFacade(Type): name = 'Deployer' version = 1 schema = {'definitions': {'APIHostPortsResult': {'additionalProperties': False, 'properties': {'servers': {'items': {'items': {'$ref': '#/definitions/HostPort'}, 'type': 'array'}, 'type': 'array'}}, 'required': ['servers'], 'type': 'object'}, 'Address': {'additionalProperties': False, 'properties': {'cidr': {'type': 'string'}, 'config-type': {'type': 'string'}, 'is-secondary': {'type': 'boolean'}, 'scope': {'type': 'string'}, 'space-id': {'type': 'string'}, 'space-name': {'type': 'string'}, 'type': {'type': 'string'}, 'value': {'type': 'string'}}, 'required': ['value', 'type', 'scope'], 'type': 'object'}, 'DeployerConnectionValues': {'additionalProperties': False, 'properties': {'api-addresses': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['api-addresses'], 'type': 'object'}, 'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, 'EntityPassword': {'additionalProperties': False, 'properties': {'password': {'type': 'string'}, 'tag': {'type': 'string'}}, 'required': ['tag', 'password'], 'type': 'object'}, 'EntityPasswords': {'additionalProperties': False, 'properties': {'changes': {'items': {'$ref': '#/definitions/EntityPassword'}, 'type': 'array'}}, 'required': ['changes'], 'type': 'object'}, 'EntityStatusArgs': {'additionalProperties': False, 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'info': {'type': 'string'}, 'status': {'type': 'string'}, 'tag': {'type': 'string'}}, 'required': ['tag', 'status', 'info', 'data'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'ErrorResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}}, 'type': 'object'}, 'ErrorResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'HostPort': {'additionalProperties': False, 'properties': {'Address': {'$ref': '#/definitions/Address'}, 'cidr': {'type': 'string'}, 'config-type': {'type': 'string'}, 'is-secondary': {'type': 'boolean'}, 'port': {'type': 'integer'}, 'scope': {'type': 'string'}, 'space-id': {'type': 'string'}, 'space-name': {'type': 'string'}, 'type': {'type': 'string'}, 'value': {'type': 'string'}}, 'required': ['value', 'type', 'scope', 'Address', 'port'], 'type': 'object'}, 'LifeResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'life': {'type': 'string'}}, 'required': ['life'], 'type': 'object'}, 'LifeResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'NotifyWatchResult': {'additionalProperties': False, 'properties': {'NotifyWatcherId': {'type': 'string'}, 'error': {'$ref': '#/definitions/Error'}}, 'required': ['NotifyWatcherId'], 'type': 'object'}, 'SetStatus': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/EntityStatusArgs'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, 'StringResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'result': {'type': 'string'}}, 'required': ['result'], 'type': 'object'}, 'StringsResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'result': {'items': {'type': 'string'}, 'type': 'array'}}, 'type': 'object'}, 'StringsWatchResult': {'additionalProperties': False, 'properties': {'changes': {'items': {'type': 'string'}, 'type': 'array'}, 'error': {'$ref': '#/definitions/Error'}, 'watcher-id': {'type': 'string'}}, 'required': ['watcher-id'], 'type': 'object'}, 'StringsWatchResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}}, 'properties': {'APIAddresses': {'description': 'APIAddresses returns the list ' 'of addresses used to connect ' 'to the API.', 'properties': {'Result': {'$ref': '#/definitions/StringsResult'}}, 'type': 'object'}, 'APIHostPorts': {'description': 'APIHostPorts returns the API ' 'server addresses.', 'properties': {'Result': {'$ref': '#/definitions/APIHostPortsResult'}}, 'type': 'object'}, 'ConnectionInfo': {'description': 'ConnectionInfo returns all ' 'the address information ' 'that the\n' 'deployer task needs in one ' 'call.', 'properties': {'Result': {'$ref': '#/definitions/DeployerConnectionValues'}}, 'type': 'object'}, 'Life': {'description': 'Life returns the life status of every ' 'supplied entity, where available.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/LifeResults'}}, 'type': 'object'}, 'ModelUUID': {'description': 'ModelUUID returns the model UUID ' 'that this facade is deploying ' 'into.\n' 'It is implemented here directly ' 'as a result of removing it from\n' 'embedded APIAddresser *without* ' 'bumping the facade version.\n' 'It should be blanked when this ' 'facade version is next ' 'incremented.', 'properties': {'Result': {'$ref': '#/definitions/StringResult'}}, 'type': 'object'}, 'Remove': {'description': 'Remove removes every given entity ' 'from state, calling EnsureDead\n' 'first, then Remove. It will fail if ' 'the entity is not present.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'SetPasswords': {'description': 'SetPasswords sets the given ' 'password for each supplied ' 'entity, if possible.', 'properties': {'Params': {'$ref': '#/definitions/EntityPasswords'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'SetStatus': {'description': 'SetStatus sets the status of the ' 'specified entities.', 'properties': {'Params': {'$ref': '#/definitions/SetStatus'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'WatchAPIHostPorts': {'description': 'WatchAPIHostPorts ' 'watches the API server ' 'addresses.', 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, 'type': 'object'}, 'WatchUnits': {'description': 'WatchUnits starts a ' 'StringsWatcher to watch all ' 'units belonging to\n' 'to any entity (machine or ' 'service) passed in args.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(StringsResult) async def APIAddresses(self): ''' APIAddresses returns the list of addresses used to connect to the API. Returns -> StringsResult ''' # map input types to rpc msg _params = dict() msg = dict(type='Deployer', request='APIAddresses', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(APIHostPortsResult) async def APIHostPorts(self): ''' APIHostPorts returns the API server addresses. Returns -> APIHostPortsResult ''' # map input types to rpc msg _params = dict() msg = dict(type='Deployer', request='APIHostPorts', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(DeployerConnectionValues) async def ConnectionInfo(self): ''' ConnectionInfo returns all the address information that the deployer task needs in one call. Returns -> DeployerConnectionValues ''' # map input types to rpc msg _params = dict() msg = dict(type='Deployer', request='ConnectionInfo', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' Life returns the life status of every supplied entity, where available. entities : typing.Sequence[~Entity] Returns -> LifeResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Deployer', request='Life', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(StringResult) async def ModelUUID(self): ''' ModelUUID returns the model UUID that this facade is deploying into. It is implemented here directly as a result of removing it from embedded APIAddresser *without* bumping the facade version. It should be blanked when this facade version is next incremented. Returns -> StringResult ''' # map input types to rpc msg _params = dict() msg = dict(type='Deployer', request='ModelUUID', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def Remove(self, entities=None): ''' Remove removes every given entity from state, calling EnsureDead first, then Remove. It will fail if the entity is not present. entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Deployer', request='Remove', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def SetPasswords(self, changes=None): ''' SetPasswords sets the given password for each supplied entity, if possible. changes : typing.Sequence[~EntityPassword] Returns -> ErrorResults ''' if changes is not None and not isinstance(changes, (bytes, str, list)): raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) # map input types to rpc msg _params = dict() msg = dict(type='Deployer', request='SetPasswords', version=1, params=_params) _params['changes'] = changes reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def SetStatus(self, entities=None): ''' SetStatus sets the status of the specified entities. entities : typing.Sequence[~EntityStatusArgs] Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Deployer', request='SetStatus', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResult) async def WatchAPIHostPorts(self): ''' WatchAPIHostPorts watches the API server addresses. Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='Deployer', request='WatchAPIHostPorts', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @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
[docs]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'}
[docs] @ReturnMapping(IntResults) async def ModelEnvironVersion(self, entities=None): ''' ModelEnvironVersion returns the current version of the environ corresponding to each specified model. entities : typing.Sequence[~Entity] Returns -> IntResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='EnvironUpgrader', request='ModelEnvironVersion', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(IntResults) async def ModelTargetEnvironVersion(self, entities=None): ''' ModelTargetEnvironVersion returns the target version of the environ corresponding to each specified model. The target version is the environ provider's version. entities : typing.Sequence[~Entity] Returns -> IntResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='EnvironUpgrader', request='ModelTargetEnvironVersion', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def SetModelEnvironVersion(self, models=None): ''' SetModelEnvironVersion sets the current version of the environ corresponding to each specified model. models : typing.Sequence[~SetModelEnvironVersion] Returns -> ErrorResults ''' if models is not None and not isinstance(models, (bytes, str, list)): raise Exception("Expected models to be a Sequence, received: {}".format(type(models))) # map input types to rpc msg _params = dict() msg = dict(type='EnvironUpgrader', request='SetModelEnvironVersion', version=1, params=_params) _params['models'] = models reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def SetModelStatus(self, entities=None): ''' SetModelStatus sets the status of each given model. entities : typing.Sequence[~EntityStatusArgs] Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='EnvironUpgrader', request='SetModelStatus', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResults) async def WatchModelEnvironVersion(self, entities=None): ''' WatchModelEnvironVersion watches for changes to the environ version of the specified models. NOTE(axw) this is currently implemented in terms of state.Model.Watch, so the client may be notified of changes unrelated to the environ version. entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='EnvironUpgrader', request='WatchModelEnvironVersion', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs]class ExternalControllerUpdaterFacade(Type): name = 'ExternalControllerUpdater' version = 1 schema = {'definitions': {'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'ErrorResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}}, 'type': 'object'}, 'ErrorResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'ExternalControllerInfo': {'additionalProperties': False, 'properties': {'addrs': {'items': {'type': 'string'}, 'type': 'array'}, 'ca-cert': {'type': 'string'}, 'controller-alias': {'type': 'string'}, 'controller-tag': {'type': 'string'}}, 'required': ['controller-tag', 'controller-alias', 'addrs', 'ca-cert'], 'type': 'object'}, 'ExternalControllerInfoResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'result': {'$ref': '#/definitions/ExternalControllerInfo'}}, 'required': ['result', 'error'], 'type': 'object'}, 'ExternalControllerInfoResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ExternalControllerInfoResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'SetExternalControllerInfoParams': {'additionalProperties': False, 'properties': {'info': {'$ref': '#/definitions/ExternalControllerInfo'}}, 'required': ['info'], 'type': 'object'}, 'SetExternalControllersInfoParams': {'additionalProperties': False, 'properties': {'controllers': {'items': {'$ref': '#/definitions/SetExternalControllerInfoParams'}, 'type': 'array'}}, 'required': ['controllers'], 'type': 'object'}, 'StringsWatchResult': {'additionalProperties': False, 'properties': {'changes': {'items': {'type': 'string'}, 'type': 'array'}, 'error': {'$ref': '#/definitions/Error'}, 'watcher-id': {'type': 'string'}}, 'required': ['watcher-id'], 'type': 'object'}, 'StringsWatchResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}}, 'properties': {'ExternalControllerInfo': {'description': 'ExternalControllerInfo ' 'returns the info ' 'for the specified ' 'external ' 'controllers.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/ExternalControllerInfoResults'}}, 'type': 'object'}, 'SetExternalControllerInfo': {'description': 'SetExternalControllerInfo ' 'saves the info ' 'for the ' 'specified ' 'external ' 'controllers.', 'properties': {'Params': {'$ref': '#/definitions/SetExternalControllersInfoParams'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'WatchExternalControllers': {'description': 'WatchExternalControllers ' 'watches for the ' 'addition and ' 'removal of ' 'external\n' 'controller ' 'records to the ' 'local ' "controller's " 'database.', 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(ExternalControllerInfoResults) async def ExternalControllerInfo(self, entities=None): ''' ExternalControllerInfo returns the info for the specified external controllers. entities : typing.Sequence[~Entity] Returns -> ExternalControllerInfoResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='ExternalControllerUpdater', request='ExternalControllerInfo', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def SetExternalControllerInfo(self, controllers=None): ''' SetExternalControllerInfo saves the info for the specified external controllers. controllers : typing.Sequence[~SetExternalControllerInfoParams] Returns -> ErrorResults ''' if controllers is not None and not isinstance(controllers, (bytes, str, list)): raise Exception("Expected controllers to be a Sequence, received: {}".format(type(controllers))) # map input types to rpc msg _params = dict() msg = dict(type='ExternalControllerUpdater', request='SetExternalControllerInfo', version=1, params=_params) _params['controllers'] = controllers reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(StringsWatchResults) async def WatchExternalControllers(self): ''' WatchExternalControllers watches for the addition and removal of external controller records to the local controller's database. Returns -> StringsWatchResults ''' # map input types to rpc msg _params = dict() msg = dict(type='ExternalControllerUpdater', request='WatchExternalControllers', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @ReturnMapping(FanConfigResult) async def FanConfig(self): ''' FanConfig returns current FAN configuration. Returns -> FanConfigResult ''' # map input types to rpc msg _params = dict() msg = dict(type='FanConfigurer', request='FanConfig', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResult) async def WatchForFanConfigChanges(self): ''' WatchForFanConfigChanges returns a NotifyWatcher that observes changes to the FAN configuration. so we use the regular error return. TODO(wpk) 2017-09-21 We should use Model directly, and watch only for FanConfig changes. Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='FanConfigurer', request='WatchForFanConfigChanges', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @ReturnMapping(ListFirewallRulesResults) async def ListFirewallRules(self): ''' ListFirewallRules returns all the firewall rules. Returns -> ListFirewallRulesResults ''' # map input types to rpc msg _params = dict() msg = dict(type='FirewallRules', request='ListFirewallRules', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def SetFirewallRules(self, args=None): ''' SetFirewallRules creates or updates the specified firewall rules. args : typing.Sequence[~FirewallRule] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='FirewallRules', request='SetFirewallRules', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs]class HostKeyReporterFacade(Type): name = 'HostKeyReporter' version = 1 schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'ErrorResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}}, 'type': 'object'}, 'ErrorResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'SSHHostKeySet': {'additionalProperties': False, 'properties': {'entity-keys': {'items': {'$ref': '#/definitions/SSHHostKeys'}, 'type': 'array'}}, 'required': ['entity-keys'], 'type': 'object'}, 'SSHHostKeys': {'additionalProperties': False, 'properties': {'public-keys': {'items': {'type': 'string'}, 'type': 'array'}, 'tag': {'type': 'string'}}, 'required': ['tag', 'public-keys'], 'type': 'object'}}, 'properties': {'ReportKeys': {'description': 'ReportKeys sets the SSH host ' 'keys for one or more entities.', 'properties': {'Params': {'$ref': '#/definitions/SSHHostKeySet'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @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
[docs]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'}, 'source': {'type': 'string'}, 'stream': {'type': 'string'}, 'version': {'type': 'string'}, 'virt-type': {'type': 'string'}}, 'required': ['image-id', 'region', 'version', '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'}, 'stream': {'type': 'string'}, 'versions': {'items': {'type': 'string'}, 'type': 'array'}, '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'}
[docs] @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
[docs] @ReturnMapping(ListCloudImageMetadataResult) async def List(self, arches=None, region=None, root_storage_type=None, stream=None, versions=None, virt_type=None): ''' List returns all found cloud image metadata that satisfy given filter. Returned list contains metadata ordered by priority. arches : typing.Sequence[str] region : str root_storage_type : str stream : str versions : typing.Sequence[str] virt_type : str Returns -> ListCloudImageMetadataResult ''' if arches is not None and not isinstance(arches, (bytes, str, list)): raise Exception("Expected arches to be a Sequence, received: {}".format(type(arches))) if region is not None and not isinstance(region, (bytes, str)): raise Exception("Expected region to be a str, received: {}".format(type(region))) if root_storage_type is not None and not isinstance(root_storage_type, (bytes, str)): raise Exception("Expected root_storage_type to be a str, received: {}".format(type(root_storage_type))) if stream is not None and not isinstance(stream, (bytes, str)): raise Exception("Expected stream to be a str, received: {}".format(type(stream))) if versions is not None and not isinstance(versions, (bytes, str, list)): raise Exception("Expected versions to be a Sequence, received: {}".format(type(versions))) if virt_type is not None and not isinstance(virt_type, (bytes, str)): raise Exception("Expected virt_type to be a str, received: {}".format(type(virt_type))) # map input types to rpc msg _params = dict() msg = dict(type='ImageMetadataManager', request='List', version=1, params=_params) _params['arches'] = arches _params['region'] = region _params['root-storage-type'] = root_storage_type _params['stream'] = stream _params['versions'] = versions _params['virt-type'] = virt_type reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def Save(self, metadata=None): ''' Save stores given cloud image metadata. It supports bulk calls. metadata : typing.Sequence[~CloudImageMetadataList] Returns -> ErrorResults ''' if metadata is not None and not isinstance(metadata, (bytes, str, list)): raise Exception("Expected metadata to be a Sequence, received: {}".format(type(metadata))) # map input types to rpc msg _params = dict() msg = dict(type='ImageMetadataManager', request='Save', version=1, params=_params) _params['metadata'] = metadata reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @ReturnMapping(ErrorResults) async def AddKeys(self, ssh_keys=None, user=None): ''' AddKeys adds new authorised ssh keys for the specified user. ssh_keys : typing.Sequence[str] user : str Returns -> ErrorResults ''' if ssh_keys is not None and not isinstance(ssh_keys, (bytes, str, list)): raise Exception("Expected ssh_keys to be a Sequence, received: {}".format(type(ssh_keys))) if user is not None and not isinstance(user, (bytes, str)): raise Exception("Expected user to be a str, received: {}".format(type(user))) # map input types to rpc msg _params = dict() msg = dict(type='KeyManager', request='AddKeys', version=1, params=_params) _params['ssh-keys'] = ssh_keys _params['user'] = user reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def DeleteKeys(self, ssh_keys=None, user=None): ''' DeleteKeys deletes the authorised ssh keys for the specified user. ssh_keys : typing.Sequence[str] user : str Returns -> ErrorResults ''' if ssh_keys is not None and not isinstance(ssh_keys, (bytes, str, list)): raise Exception("Expected ssh_keys to be a Sequence, received: {}".format(type(ssh_keys))) if user is not None and not isinstance(user, (bytes, str)): raise Exception("Expected user to be a str, received: {}".format(type(user))) # map input types to rpc msg _params = dict() msg = dict(type='KeyManager', request='DeleteKeys', version=1, params=_params) _params['ssh-keys'] = ssh_keys _params['user'] = user reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def ImportKeys(self, ssh_keys=None, user=None): ''' ImportKeys imports new authorised ssh keys from the specified key ids for the specified user. ssh_keys : typing.Sequence[str] user : str Returns -> ErrorResults ''' if ssh_keys is not None and not isinstance(ssh_keys, (bytes, str, list)): raise Exception("Expected ssh_keys to be a Sequence, received: {}".format(type(ssh_keys))) if user is not None and not isinstance(user, (bytes, str)): raise Exception("Expected user to be a str, received: {}".format(type(user))) # map input types to rpc msg _params = dict() msg = dict(type='KeyManager', request='ImportKeys', version=1, params=_params) _params['ssh-keys'] = ssh_keys _params['user'] = user reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(StringsResults) async def ListKeys(self, entities=None, mode=None): ''' ListKeys returns the authorised ssh keys for the specified users. entities : Entities mode : bool Returns -> StringsResults ''' if entities is not None and not isinstance(entities, (dict, Entities)): raise Exception("Expected entities to be a Entities, received: {}".format(type(entities))) if mode is not None and not isinstance(mode, bool): raise Exception("Expected mode to be a bool, received: {}".format(type(mode))) # map input types to rpc msg _params = dict() msg = dict(type='KeyManager', request='ListKeys', version=1, params=_params) _params['entities'] = entities _params['mode'] = mode reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @ReturnMapping(StringsResults) async def AuthorisedKeys(self, entities=None): ''' AuthorisedKeys reports the authorised ssh keys for the specified machines. The current implementation relies on global authorised keys being stored in the model config. This will change as new user management and authorisation functionality is added. entities : typing.Sequence[~Entity] Returns -> StringsResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='KeyUpdater', request='AuthorisedKeys', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResults) async def WatchAuthorisedKeys(self, entities=None): ''' WatchAuthorisedKeys starts a watcher to track changes to the authorised ssh keys for the specified machines. The current implementation relies on global authorised keys being stored in the model config. This will change as new user management and authorisation functionality is added. entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='KeyUpdater', request='WatchAuthorisedKeys', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs]class LifeFlagFacade(Type): name = 'LifeFlag' version = 1 schema = {'definitions': {'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'LifeResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'life': {'type': 'string'}}, 'required': ['life'], 'type': 'object'}, 'LifeResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/LifeResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'NotifyWatchResult': {'additionalProperties': False, 'properties': {'NotifyWatcherId': {'type': 'string'}, 'error': {'$ref': '#/definitions/Error'}}, 'required': ['NotifyWatcherId'], 'type': 'object'}, 'NotifyWatchResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}}, 'properties': {'Life': {'description': 'Life returns the life status of every ' 'supplied entity, where available.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/LifeResults'}}, 'type': 'object'}, 'Watch': {'description': 'Watch starts an NotifyWatcher for ' 'each given entity.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(LifeResults) async def Life(self, entities=None): ''' Life returns the life status of every supplied entity, where available. entities : typing.Sequence[~Entity] Returns -> LifeResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='LifeFlag', request='Life', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResults) async def Watch(self, entities=None): ''' Watch starts an NotifyWatcher for each given entity. entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='LifeFlag', request='Watch', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @ReturnMapping(LogForwardingGetLastSentResults) async def GetLastSent(self, ids=None): ''' GetLastSent is a bulk call that gets the log forwarding "last sent" record ID for each requested target. ids : typing.Sequence[~LogForwardingID] Returns -> LogForwardingGetLastSentResults ''' if ids is not None and not isinstance(ids, (bytes, str, list)): raise Exception("Expected ids to be a Sequence, received: {}".format(type(ids))) # map input types to rpc msg _params = dict() msg = dict(type='LogForwarding', request='GetLastSent', version=1, params=_params) _params['ids'] = ids reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def SetLastSent(self, params=None): ''' SetLastSent is a bulk call that sets the log forwarding "last sent" record ID for each requested target. params : typing.Sequence[~LogForwardingSetLastSentParam] Returns -> ErrorResults ''' if params is not None and not isinstance(params, (bytes, str, list)): raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) # map input types to rpc msg _params = dict() msg = dict(type='LogForwarding', request='SetLastSent', version=1, params=_params) _params['params'] = params reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @ReturnMapping(StringResults) async def LoggingConfig(self, entities=None): ''' LoggingConfig reports the logging configuration for the agents specified. entities : typing.Sequence[~Entity] Returns -> StringResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Logger', request='LoggingConfig', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResults) async def WatchLoggingConfig(self, entities=None): ''' WatchLoggingConfig starts a watcher to track changes to the logging config for the agents specified.. Unfortunately the current infrastructure makes watching parts of the config non-trivial, so currently any change to the config will cause the watcher to notify the client. entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Logger', request='WatchLoggingConfig', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs]class MachineActionsFacade(Type): name = 'MachineActions' 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'}, 'type': 'array'}}, 'type': 'object'}, 'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'ErrorResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}}, 'type': 'object'}, 'ErrorResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'StringsWatchResult': {'additionalProperties': False, 'properties': {'changes': {'items': {'type': 'string'}, 'type': 'array'}, 'error': {'$ref': '#/definitions/Error'}, 'watcher-id': {'type': 'string'}}, 'required': ['watcher-id'], 'type': 'object'}, 'StringsWatchResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/StringsWatchResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}}, 'properties': {'Actions': {'description': 'Actions returns the Actions by ' 'Tags passed and ensures that the ' 'machine asking\n' 'for them is the machine that has ' 'the actions', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/ActionResults'}}, 'type': 'object'}, 'BeginActions': {'description': 'BeginActions marks the ' 'actions represented by the ' 'passed in Tags as running.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'FinishActions': {'description': 'FinishActions saves the ' 'result of a completed Action', 'properties': {'Params': {'$ref': '#/definitions/ActionExecutionResults'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'RunningActions': {'description': 'RunningActions lists the ' 'actions running for the ' 'entities passed in.\n' 'If we end up needing more ' 'than ListRunning at some ' 'point we could ' 'follow/abstract\n' "what's done in the client " 'actions package.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/ActionsByReceivers'}}, 'type': 'object'}, 'WatchActionNotifications': {'description': 'WatchActionNotifications ' 'returns a ' 'StringsWatcher ' 'for observing\n' 'incoming action ' 'calls to a ' 'machine.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(ActionResults) async def Actions(self, entities=None): ''' Actions returns the Actions by Tags passed and ensures that the machine asking for them is the machine that has the actions entities : typing.Sequence[~Entity] Returns -> ActionResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='MachineActions', request='Actions', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def BeginActions(self, entities=None): ''' BeginActions marks the actions represented by the passed in Tags as running. entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='MachineActions', request='BeginActions', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def FinishActions(self, results=None): ''' FinishActions saves the result of a completed Action results : typing.Sequence[~ActionExecutionResult] Returns -> ErrorResults ''' if results is not None and not isinstance(results, (bytes, str, list)): raise Exception("Expected results to be a Sequence, received: {}".format(type(results))) # map input types to rpc msg _params = dict() msg = dict(type='MachineActions', request='FinishActions', version=1, params=_params) _params['results'] = results reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ActionsByReceivers) async def RunningActions(self, entities=None): ''' RunningActions lists the actions running for the entities passed in. If we end up needing more than ListRunning at some point we could follow/abstract what's done in the client actions package. entities : typing.Sequence[~Entity] Returns -> ActionsByReceivers ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='MachineActions', request='RunningActions', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(StringsWatchResults) async def WatchActionNotifications(self, entities=None): ''' WatchActionNotifications returns a StringsWatcher for observing incoming action calls to a machine. entities : typing.Sequence[~Entity] Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='MachineActions', request='WatchActionNotifications', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @ReturnMapping(EntitiesResults) async def AllMachineRemovals(self, entities=None): ''' AllMachineRemovals returns tags for all of the machines that have been marked for removal in the requested model. entities : typing.Sequence[~Entity] Returns -> EntitiesResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='MachineUndertaker', request='AllMachineRemovals', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def CompleteMachineRemovals(self, entities=None): ''' CompleteMachineRemovals removes the specified machines from the model database. It should only be called once any provider-level cleanup has been done for those machines. entities : typing.Sequence[~Entity] Returns -> None ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='MachineUndertaker', request='CompleteMachineRemovals', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ProviderInterfaceInfoResults) async def GetMachineProviderInterfaceInfo(self, entities=None): ''' GetMachineProviderInterfaceInfo returns the provider details for all network interfaces attached to the machines requested. entities : typing.Sequence[~Entity] Returns -> ProviderInterfaceInfoResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='MachineUndertaker', request='GetMachineProviderInterfaceInfo', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResults) async def WatchMachineRemovals(self, entities=None): ''' WatchMachineRemovals returns a watcher that will signal each time a machine is marked for removal. entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='MachineUndertaker', request='WatchMachineRemovals', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs]class MetricsManagerFacade(Type): name = 'MetricsManager' version = 1 schema = {'definitions': {'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'ErrorResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}}, 'type': 'object'}, 'ErrorResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}}, 'properties': {'AddJujuMachineMetrics': {'description': 'AddJujuMachineMetrics ' 'adds a metric that ' 'counts the number ' 'of\n' 'non-container ' 'machines in the ' 'current model.', 'type': 'object'}, 'CleanupOldMetrics': {'description': 'CleanupOldMetrics ' 'removes old metrics from ' 'the collection.\n' 'The single arg params is ' 'expected to contain and ' 'model uuid.\n' 'Even though the call ' 'will delete all metrics ' 'across models\n' 'it serves to validate ' 'that the connection has ' 'access to at least one ' 'model.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'SendMetrics': {'description': 'SendMetrics will send any ' 'unsent metrics onto the metric ' 'collection service.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @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
[docs] @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
[docs] @ReturnMapping(ErrorResults) async def SendMetrics(self, entities=None): ''' SendMetrics will send any unsent metrics onto the metric collection service. entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='MetricsManager', request='SendMetrics', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs]class MigrationFlagFacade(Type): name = 'MigrationFlag' version = 1 schema = {'definitions': {'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'NotifyWatchResult': {'additionalProperties': False, 'properties': {'NotifyWatcherId': {'type': 'string'}, 'error': {'$ref': '#/definitions/Error'}}, 'required': ['NotifyWatcherId'], 'type': 'object'}, 'NotifyWatchResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'PhaseResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'phase': {'type': 'string'}}, 'type': 'object'}, 'PhaseResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/PhaseResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}}, 'properties': {'Phase': {'description': 'Phase returns the current migration ' 'phase or an error for every\n' 'supplied entity.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/PhaseResults'}}, 'type': 'object'}, 'Watch': {'description': 'Watch returns an id for use with the ' 'NotifyWatcher facade, or an\n' 'error, for every supplied entity.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(PhaseResults) async def Phase(self, entities=None): ''' Phase returns the current migration phase or an error for every supplied entity. entities : typing.Sequence[~Entity] Returns -> PhaseResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='MigrationFlag', request='Phase', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResults) async def Watch(self, entities=None): ''' Watch returns an id for use with the NotifyWatcher facade, or an error, for every supplied entity. entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='MigrationFlag', request='Watch', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @ReturnMapping(None) async def Report(self, migration_id=None, phase=None, success=None): ''' Report allows a migration minion to submit whether it succeeded or failed for a specific migration phase. migration_id : str phase : str success : bool Returns -> None ''' if migration_id is not None and not isinstance(migration_id, (bytes, str)): raise Exception("Expected migration_id to be a str, received: {}".format(type(migration_id))) if phase is not None and not isinstance(phase, (bytes, str)): raise Exception("Expected phase to be a str, received: {}".format(type(phase))) if success is not None and not isinstance(success, bool): raise Exception("Expected success to be a bool, received: {}".format(type(success))) # map input types to rpc msg _params = dict() msg = dict(type='MigrationMinion', request='Report', version=1, params=_params) _params['migration-id'] = migration_id _params['phase'] = phase _params['success'] = success reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResult) async def Watch(self): ''' Watch starts watching for status updates for a migration attempt for the model. It will report when a migration starts and when its status changes (including when it finishes). An initial event will be fired if there has ever been a migration attempt for the model. The MigrationStatusWatcher facade must be used to receive events from the watcher. Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='MigrationMinion', request='Watch', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @ReturnMapping(MigrationStatus) async def Next(self): ''' Next returns when the status for a model migration for the associated model changes. The current details for the active migration are returned. Returns -> MigrationStatus ''' # map input types to rpc msg _params = dict() msg = dict(type='MigrationStatusWatcher', request='Next', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @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
[docs] 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
[docs]class MigrationTargetFacade(Type): name = 'MigrationTarget' version = 1 schema = {'definitions': {'AdoptResourcesArgs': {'additionalProperties': False, 'properties': {'model-tag': {'type': 'string'}, 'source-controller-version': {'$ref': '#/definitions/Number'}}, 'required': ['model-tag', 'source-controller-version'], 'type': 'object'}, 'BytesResult': {'additionalProperties': False, 'properties': {'result': {'items': {'type': 'integer'}, 'type': 'array'}}, 'required': ['result'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'ErrorResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}}, 'type': 'object'}, 'ErrorResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'MigrationModelInfo': {'additionalProperties': False, 'properties': {'agent-version': {'$ref': '#/definitions/Number'}, 'controller-agent-version': {'$ref': '#/definitions/Number'}, 'name': {'type': 'string'}, 'owner-tag': {'type': 'string'}, 'uuid': {'type': 'string'}}, 'required': ['uuid', 'name', 'owner-tag', 'agent-version', 'controller-agent-version'], 'type': 'object'}, 'ModelArgs': {'additionalProperties': False, 'properties': {'model-tag': {'type': 'string'}}, 'required': ['model-tag'], 'type': 'object'}, 'Number': {'additionalProperties': False, 'properties': {'Build': {'type': 'integer'}, 'Major': {'type': 'integer'}, 'Minor': {'type': 'integer'}, 'Patch': {'type': 'integer'}, 'Tag': {'type': 'string'}}, 'required': ['Major', 'Minor', 'Tag', 'Patch', 'Build'], 'type': 'object'}, 'SerializedModel': {'additionalProperties': False, 'properties': {'bytes': {'items': {'type': 'integer'}, 'type': 'array'}, 'charms': {'items': {'type': 'string'}, 'type': 'array'}, 'resources': {'items': {'$ref': '#/definitions/SerializedModelResource'}, 'type': 'array'}, 'tools': {'items': {'$ref': '#/definitions/SerializedModelTools'}, 'type': 'array'}}, 'required': ['bytes', 'charms', 'tools', 'resources'], 'type': 'object'}, 'SerializedModelResource': {'additionalProperties': False, 'properties': {'application': {'type': 'string'}, 'application-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, 'charmstore-revision': {'$ref': '#/definitions/SerializedModelResourceRevision'}, 'name': {'type': 'string'}, 'unit-revisions': {'patternProperties': {'.*': {'$ref': '#/definitions/SerializedModelResourceRevision'}}, 'type': 'object'}}, 'required': ['application', 'name', 'application-revision', 'charmstore-revision', 'unit-revisions'], 'type': 'object'}, 'SerializedModelResourceRevision': {'additionalProperties': False, 'properties': {'description': {'type': 'string'}, 'fingerprint': {'type': 'string'}, 'origin': {'type': 'string'}, 'path': {'type': 'string'}, 'revision': {'type': 'integer'}, 'size': {'type': 'integer'}, 'timestamp': {'format': 'date-time', 'type': 'string'}, 'type': {'type': 'string'}, 'username': {'type': 'string'}}, 'required': ['revision', 'type', 'path', 'description', 'origin', 'fingerprint', 'size', 'timestamp'], 'type': 'object'}, 'SerializedModelTools': {'additionalProperties': False, 'properties': {'uri': {'type': 'string'}, 'version': {'type': 'string'}}, 'required': ['version', 'uri'], 'type': 'object'}}, 'properties': {'Abort': {'description': 'Abort removes the specified model ' 'from the database. It is an error ' 'to\n' 'attempt to Abort a model that has a ' 'migration mode other than importing.', 'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}}, 'type': 'object'}, 'Activate': {'description': 'Activate sets the migration mode ' 'of the model to "none", meaning ' 'it\n' 'is ready for use. It is an error ' 'to attempt to Abort a model that\n' 'has a migration mode other than ' 'importing.', 'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}}, 'type': 'object'}, 'AdoptResources': {'description': 'AdoptResources asks the ' 'cloud provider to update ' 'the controller\n' "tags for a model's " 'resources. This prevents ' 'the resources from\n' 'being destroyed if the ' 'source controller is ' 'destroyed after the\n' 'model is migrated away.', 'properties': {'Params': {'$ref': '#/definitions/AdoptResourcesArgs'}}, 'type': 'object'}, 'CACert': {'description': 'CACert returns the certificate used ' 'to validate the state connection.', 'properties': {'Result': {'$ref': '#/definitions/BytesResult'}}, 'type': 'object'}, 'CheckMachines': {'description': 'CheckMachines compares the ' 'machines in state with the ' 'ones reported\n' 'by the provider and reports ' 'any discrepancies.', 'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'Import': {'description': 'Import takes a serialized Juju ' 'model, deserializes it, and\n' 'recreates it in the receiving ' 'controller.', 'properties': {'Params': {'$ref': '#/definitions/SerializedModel'}}, 'type': 'object'}, 'LatestLogTime': {'description': 'LatestLogTime returns the ' 'time of the most recent log ' 'record\n' 'received by the logtransfer ' 'endpoint. This can be used ' 'as the start\n' 'point for streaming logs ' 'from the source if the ' 'transfer was\n' 'interrupted.\n' '\n' 'For performance reasons, not ' 'every time is tracked, so if ' 'the\n' 'target controller died ' 'during the transfer the ' 'latest log time\n' 'might be up to 2 minutes ' 'earlier. If the transfer was ' 'interrupted\n' 'in some other way (like the ' 'source controller going away ' 'or a\n' 'network partition) the time ' 'will be up-to-date.\n' '\n' 'Log messages are assumed to ' 'be sent in time order (which ' 'is how\n' 'debug-log emits them). If ' "that isn't the case then " 'this mechanism\n' "can't be used to avoid " 'duplicates when logtransfer ' 'is restarted.\n' '\n' 'Returns the zero time if no ' 'logs have been transferred.', 'properties': {'Params': {'$ref': '#/definitions/ModelArgs'}, 'Result': {'format': 'date-time', 'type': 'string'}}, 'type': 'object'}, 'Prechecks': {'description': 'Prechecks ensure that the target ' 'controller is ready to accept a\n' 'model migration.', 'properties': {'Params': {'$ref': '#/definitions/MigrationModelInfo'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(None) async def Abort(self, model_tag=None): ''' Abort removes the specified model from the database. It is an error to attempt to Abort a model that has a migration mode other than importing. model_tag : str Returns -> None ''' if model_tag is not None and not isinstance(model_tag, (bytes, str)): raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) # map input types to rpc msg _params = dict() msg = dict(type='MigrationTarget', request='Abort', version=1, params=_params) _params['model-tag'] = model_tag reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Activate(self, model_tag=None): ''' Activate sets the migration mode of the model to "none", meaning it is ready for use. It is an error to attempt to Abort a model that has a migration mode other than importing. model_tag : str Returns -> None ''' if model_tag is not None and not isinstance(model_tag, (bytes, str)): raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) # map input types to rpc msg _params = dict() msg = dict(type='MigrationTarget', request='Activate', version=1, params=_params) _params['model-tag'] = model_tag reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def AdoptResources(self, model_tag=None, source_controller_version=None): ''' AdoptResources asks the cloud provider to update the controller tags for a model's resources. This prevents the resources from being destroyed if the source controller is destroyed after the model is migrated away. model_tag : str source_controller_version : Number Returns -> None ''' if model_tag is not None and not isinstance(model_tag, (bytes, str)): raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) if source_controller_version is not None and not isinstance(source_controller_version, (dict, Number)): raise Exception("Expected source_controller_version to be a Number, received: {}".format(type(source_controller_version))) # map input types to rpc msg _params = dict() msg = dict(type='MigrationTarget', request='AdoptResources', version=1, params=_params) _params['model-tag'] = model_tag _params['source-controller-version'] = source_controller_version reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(BytesResult) async def CACert(self): ''' CACert returns the certificate used to validate the state connection. Returns -> BytesResult ''' # map input types to rpc msg _params = dict() msg = dict(type='MigrationTarget', request='CACert', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def CheckMachines(self, model_tag=None): ''' CheckMachines compares the machines in state with the ones reported by the provider and reports any discrepancies. model_tag : str Returns -> ErrorResults ''' if model_tag is not None and not isinstance(model_tag, (bytes, str)): raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) # map input types to rpc msg _params = dict() msg = dict(type='MigrationTarget', request='CheckMachines', version=1, params=_params) _params['model-tag'] = model_tag reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Import(self, bytes_=None, charms=None, resources=None, tools=None): ''' Import takes a serialized Juju model, deserializes it, and recreates it in the receiving controller. bytes_ : typing.Sequence[int] charms : typing.Sequence[str] resources : typing.Sequence[~SerializedModelResource] tools : typing.Sequence[~SerializedModelTools] Returns -> None ''' if bytes_ is not None and not isinstance(bytes_, (bytes, str, list)): raise Exception("Expected bytes_ to be a Sequence, received: {}".format(type(bytes_))) if charms is not None and not isinstance(charms, (bytes, str, list)): raise Exception("Expected charms to be a Sequence, received: {}".format(type(charms))) if resources is not None and not isinstance(resources, (bytes, str, list)): raise Exception("Expected resources to be a Sequence, received: {}".format(type(resources))) if tools is not None and not isinstance(tools, (bytes, str, list)): raise Exception("Expected tools to be a Sequence, received: {}".format(type(tools))) # map input types to rpc msg _params = dict() msg = dict(type='MigrationTarget', request='Import', version=1, params=_params) _params['bytes'] = bytes_ _params['charms'] = charms _params['resources'] = resources _params['tools'] = tools reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(str) async def LatestLogTime(self, model_tag=None): ''' LatestLogTime returns the time of the most recent log record received by the logtransfer endpoint. This can be used as the start point for streaming logs from the source if the transfer was interrupted. For performance reasons, not every time is tracked, so if the target controller died during the transfer the latest log time might be up to 2 minutes earlier. If the transfer was interrupted in some other way (like the source controller going away or a network partition) the time will be up-to-date. Log messages are assumed to be sent in time order (which is how debug-log emits them). If that isn't the case then this mechanism can't be used to avoid duplicates when logtransfer is restarted. Returns the zero time if no logs have been transferred. model_tag : str Returns -> str ''' if model_tag is not None and not isinstance(model_tag, (bytes, str)): raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) # map input types to rpc msg _params = dict() msg = dict(type='MigrationTarget', request='LatestLogTime', version=1, params=_params) _params['model-tag'] = model_tag reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Prechecks(self, agent_version=None, controller_agent_version=None, name=None, owner_tag=None, uuid=None): ''' Prechecks ensure that the target controller is ready to accept a model migration. agent_version : Number controller_agent_version : Number name : str owner_tag : str uuid : str Returns -> None ''' if agent_version is not None and not isinstance(agent_version, (dict, Number)): raise Exception("Expected agent_version to be a Number, received: {}".format(type(agent_version))) if controller_agent_version is not None and not isinstance(controller_agent_version, (dict, Number)): raise Exception("Expected controller_agent_version to be a Number, received: {}".format(type(controller_agent_version))) if name is not None and not isinstance(name, (bytes, str)): raise Exception("Expected name to be a str, received: {}".format(type(name))) if owner_tag is not None and not isinstance(owner_tag, (bytes, str)): raise Exception("Expected owner_tag to be a str, received: {}".format(type(owner_tag))) if uuid is not None and not isinstance(uuid, (bytes, str)): raise Exception("Expected uuid to be a str, received: {}".format(type(uuid))) # map input types to rpc msg _params = dict() msg = dict(type='MigrationTarget', request='Prechecks', version=1, params=_params) _params['agent-version'] = agent_version _params['controller-agent-version'] = controller_agent_version _params['name'] = name _params['owner-tag'] = owner_tag _params['uuid'] = uuid reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @ReturnMapping(SummaryWatcherNextResults) async def Next(self): ''' Next will return the current state of everything on the first call and subsequent calls will return just those model summaries that have changed. Returns -> SummaryWatcherNextResults ''' # map input types to rpc msg _params = dict() msg = dict(type='ModelSummaryWatcher', request='Next', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Stop(self): ''' Stop stops the watcher. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='ModelSummaryWatcher', request='Stop', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] 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
[docs]class ModelUpgraderFacade(Type): name = 'ModelUpgrader' 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'}, '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'}
[docs] @ReturnMapping(None) async def AbortModelUpgrade(self, model_tag=None): ''' AbortModelUpgrade aborts and archives the model upgrade synchronisation record, if any. model_tag : str Returns -> None ''' if model_tag is not None and not isinstance(model_tag, (bytes, str)): raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) # map input types to rpc msg _params = dict() msg = dict(type='ModelUpgrader', request='AbortModelUpgrade', version=1, params=_params) _params['model-tag'] = model_tag reply = await self.rpc(msg) return reply
[docs] @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. agent_stream : str dry_run : bool ignore_agent_versions : bool model_tag : str target_version : Number Returns -> UpgradeModelResult ''' if agent_stream is not None and not isinstance(agent_stream, (bytes, str)): raise Exception("Expected agent_stream to be a str, received: {}".format(type(agent_stream))) if dry_run is not None and not isinstance(dry_run, bool): raise Exception("Expected dry_run to be a bool, received: {}".format(type(dry_run))) if ignore_agent_versions is not None and not isinstance(ignore_agent_versions, bool): raise Exception("Expected ignore_agent_versions to be a bool, received: {}".format(type(ignore_agent_versions))) if model_tag is not None and not isinstance(model_tag, (bytes, str)): raise Exception("Expected model_tag to be a str, received: {}".format(type(model_tag))) if target_version is not None and not isinstance(target_version, (dict, Number)): raise Exception("Expected target_version to be a Number, received: {}".format(type(target_version))) # map input types to rpc msg _params = dict() msg = dict(type='ModelUpgrader', request='UpgradeModel', version=1, params=_params) _params['agent-stream'] = agent_stream _params['dry-run'] = dry_run _params['ignore-agent-versions'] = ignore_agent_versions _params['model-tag'] = model_tag _params['target-version'] = target_version reply = await self.rpc(msg) return reply
[docs]class NotifyWatcherFacade(Type): name = 'NotifyWatcher' version = 1 schema = {'properties': {'Next': {'description': 'Next returns when a change has ' 'occurred to the\n' 'entity being watched since the most ' 'recent call to Next\n' 'or the Watch call that created the ' 'NotifyWatcher.', 'type': 'object'}, 'Stop': {'description': 'Stop stops the watcher.', 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(None) async def Next(self): ''' Next returns when a change has occurred to the entity being watched since the most recent call to Next or the Watch call that created the NotifyWatcher. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='NotifyWatcher', request='Next', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Stop(self): ''' Stop stops the watcher. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='NotifyWatcher', request='Stop', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] 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
[docs]class OfferStatusWatcherFacade(Type): name = 'OfferStatusWatcher' version = 1 schema = {'definitions': {'EntityStatus': {'additionalProperties': False, 'properties': {'data': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'info': {'type': 'string'}, 'since': {'format': 'date-time', 'type': 'string'}, 'status': {'type': 'string'}}, 'required': ['status', 'info', 'since'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'OfferStatusChange': {'additionalProperties': False, 'properties': {'offer-name': {'type': 'string'}, 'status': {'$ref': '#/definitions/EntityStatus'}}, 'required': ['offer-name', 'status'], 'type': 'object'}, 'OfferStatusWatchResult': {'additionalProperties': False, 'properties': {'changes': {'items': {'$ref': '#/definitions/OfferStatusChange'}, 'type': 'array'}, 'error': {'$ref': '#/definitions/Error'}, 'watcher-id': {'type': 'string'}}, 'required': ['watcher-id', 'changes'], 'type': 'object'}}, 'properties': {'Next': {'description': 'Next returns when a change has ' 'occurred to an entity of the\n' 'collection being watched since the ' 'most recent call to Next\n' 'or the Watch call that created the ' 'srvOfferStatusWatcher.', 'properties': {'Result': {'$ref': '#/definitions/OfferStatusWatchResult'}}, 'type': 'object'}, 'Stop': {'description': 'Stop stops the watcher.', 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(OfferStatusWatchResult) async def Next(self): ''' Next returns when a change has occurred to an entity of the collection being watched since the most recent call to Next or the Watch call that created the srvOfferStatusWatcher. Returns -> OfferStatusWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='OfferStatusWatcher', request='Next', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Stop(self): ''' Stop stops the watcher. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='OfferStatusWatcher', request='Stop', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] 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
[docs]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'}
[docs] @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
[docs]class PayloadsHookContextFacade(Type): name = 'PayloadsHookContext' version = 1 schema = {'definitions': {'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'LookUpPayloadArg': {'additionalProperties': False, 'properties': {'id': {'type': 'string'}, 'name': {'type': 'string'}}, 'required': ['name', 'id'], 'type': 'object'}, 'LookUpPayloadArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/LookUpPayloadArg'}, 'type': 'array'}}, 'required': ['args'], 'type': 'object'}, 'Payload': {'additionalProperties': False, 'properties': {'class': {'type': 'string'}, 'id': {'type': 'string'}, 'labels': {'items': {'type': 'string'}, 'type': 'array'}, 'machine': {'type': 'string'}, 'status': {'type': 'string'}, 'type': {'type': 'string'}, 'unit': {'type': 'string'}}, 'required': ['class', 'type', 'id', 'status', 'labels', 'unit', 'machine'], 'type': 'object'}, 'PayloadResult': {'additionalProperties': False, 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, 'error': {'$ref': '#/definitions/Error'}, 'not-found': {'type': 'boolean'}, 'payload': {'$ref': '#/definitions/Payload'}, 'tag': {'type': 'string'}}, 'required': ['tag', 'Entity', 'payload', 'not-found'], 'type': 'object'}, 'PayloadResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/PayloadResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'SetPayloadStatusArg': {'additionalProperties': False, 'properties': {'Entity': {'$ref': '#/definitions/Entity'}, 'status': {'type': 'string'}, 'tag': {'type': 'string'}}, 'required': ['tag', 'Entity', 'status'], 'type': 'object'}, 'SetPayloadStatusArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/SetPayloadStatusArg'}, 'type': 'array'}}, 'required': ['args'], 'type': 'object'}, 'TrackPayloadArgs': {'additionalProperties': False, 'properties': {'payloads': {'items': {'$ref': '#/definitions/Payload'}, 'type': 'array'}}, 'required': ['payloads'], 'type': 'object'}}, 'properties': {'List': {'description': 'List builds the list of payload being ' 'tracked for\n' 'the given unit and IDs. If no IDs are ' 'provided then all tracked\n' 'payloads for the unit are returned.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/PayloadResults'}}, 'type': 'object'}, 'LookUp': {'description': 'LookUp identifies the payload with ' 'the provided name and raw ID.', 'properties': {'Params': {'$ref': '#/definitions/LookUpPayloadArgs'}, 'Result': {'$ref': '#/definitions/PayloadResults'}}, 'type': 'object'}, 'SetStatus': {'description': 'SetStatus sets the raw status of ' 'a payload.', 'properties': {'Params': {'$ref': '#/definitions/SetPayloadStatusArgs'}, 'Result': {'$ref': '#/definitions/PayloadResults'}}, 'type': 'object'}, 'Track': {'description': 'Track stores a payload to be tracked ' 'in state.', 'properties': {'Params': {'$ref': '#/definitions/TrackPayloadArgs'}, 'Result': {'$ref': '#/definitions/PayloadResults'}}, 'type': 'object'}, 'Untrack': {'description': 'Untrack marks the identified ' 'payload as no longer being ' 'tracked.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/PayloadResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(PayloadResults) async def List(self, entities=None): ''' List builds the list of payload being tracked for the given unit and IDs. If no IDs are provided then all tracked payloads for the unit are returned. entities : typing.Sequence[~Entity] Returns -> PayloadResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='PayloadsHookContext', request='List', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @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
[docs] @ReturnMapping(PayloadResults) async def SetStatus(self, args=None): ''' SetStatus sets the raw status of a payload. args : typing.Sequence[~SetPayloadStatusArg] Returns -> PayloadResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='PayloadsHookContext', request='SetStatus', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(PayloadResults) async def Track(self, payloads=None): ''' Track stores a payload to be tracked in state. payloads : typing.Sequence[~Payload] Returns -> PayloadResults ''' if payloads is not None and not isinstance(payloads, (bytes, str, list)): raise Exception("Expected payloads to be a Sequence, received: {}".format(type(payloads))) # map input types to rpc msg _params = dict() msg = dict(type='PayloadsHookContext', request='Track', version=1, params=_params) _params['payloads'] = payloads reply = await self.rpc(msg) return reply
[docs] @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
[docs]class PingerFacade(Type): name = 'Pinger' version = 1 schema = {'properties': {'Ping': {'type': 'object'}, 'Stop': {'type': 'object'}}, 'type': 'object'}
[docs] @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
[docs] @ReturnMapping(None) async def Stop(self): ''' Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='Pinger', request='Stop', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @ReturnMapping(RelationLifeSuspendedStatusWatchResult) async def Next(self): ''' Next returns when a change has occurred to an entity of the collection being watched since the most recent call to Next or the Watch call that created the srvRelationStatusWatcher. Returns -> RelationLifeSuspendedStatusWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='RelationStatusWatcher', request='Next', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Stop(self): ''' Stop stops the watcher. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='RelationStatusWatcher', request='Stop', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] 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
[docs]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'}
[docs] @ReturnMapping(RelationUnitsWatchResult) async def Next(self): ''' Next returns when a change has occurred to an entity of the collection being watched since the most recent call to Next or the Watch call that created the srvRelationUnitsWatcher. Returns -> RelationUnitsWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='RelationUnitsWatcher', request='Next', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @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
[docs] 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
[docs]class RemoteRelationWatcherFacade(Type): name = 'RemoteRelationWatcher' version = 1 schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'Macaroon': {'additionalProperties': False, 'type': 'object'}, 'RemoteRelationChangeEvent': {'additionalProperties': False, 'properties': {'application-settings': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'application-token': {'type': 'string'}, 'bakery-version': {'type': 'integer'}, 'changed-units': {'items': {'$ref': '#/definitions/RemoteRelationUnitChange'}, 'type': 'array'}, 'departed-units': {'items': {'type': 'integer'}, 'type': 'array'}, 'force-cleanup': {'type': 'boolean'}, 'life': {'type': 'string'}, 'macaroons': {'items': {'$ref': '#/definitions/Macaroon'}, 'type': 'array'}, 'relation-token': {'type': 'string'}, 'suspended': {'type': 'boolean'}, 'suspended-reason': {'type': 'string'}, 'unit-count': {'type': 'integer'}}, 'required': ['relation-token', 'application-token', 'life', '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'}}, 'type': 'object'}
[docs] @ReturnMapping(RemoteRelationWatchResult) async def Next(self): ''' Returns -> RemoteRelationWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='RemoteRelationWatcher', request='Next', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Stop(self): ''' Stop stops the watcher. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='RemoteRelationWatcher', request='Stop', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] 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
[docs]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'}
[docs] @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
[docs]class RetryStrategyFacade(Type): name = 'RetryStrategy' version = 1 schema = {'definitions': {'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'NotifyWatchResult': {'additionalProperties': False, 'properties': {'NotifyWatcherId': {'type': 'string'}, 'error': {'$ref': '#/definitions/Error'}}, 'required': ['NotifyWatcherId'], 'type': 'object'}, 'NotifyWatchResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'RetryStrategy': {'additionalProperties': False, 'properties': {'jitter-retry-time': {'type': 'boolean'}, 'max-retry-time': {'type': 'integer'}, 'min-retry-time': {'type': 'integer'}, 'retry-time-factor': {'type': 'integer'}, 'should-retry': {'type': 'boolean'}}, 'required': ['should-retry', 'min-retry-time', 'max-retry-time', 'jitter-retry-time', 'retry-time-factor'], 'type': 'object'}, 'RetryStrategyResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'result': {'$ref': '#/definitions/RetryStrategy'}}, 'type': 'object'}, 'RetryStrategyResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/RetryStrategyResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}}, 'properties': {'RetryStrategy': {'description': 'RetryStrategy returns ' 'RetryStrategyResults that ' 'can be used by any code that ' 'uses\n' 'to configure the retry timer ' "that's currently in juju " 'utils.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/RetryStrategyResults'}}, 'type': 'object'}, 'WatchRetryStrategy': {'description': 'WatchRetryStrategy ' 'watches for changes to ' 'the model. Currently we ' 'only allow\n' 'changes to the boolean ' 'that determines whether ' 'retries should be ' 'attempted or not.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(RetryStrategyResults) async def RetryStrategy(self, entities=None): ''' RetryStrategy returns RetryStrategyResults that can be used by any code that uses to configure the retry timer that's currently in juju utils. entities : typing.Sequence[~Entity] Returns -> RetryStrategyResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='RetryStrategy', request='RetryStrategy', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResults) async def WatchRetryStrategy(self, entities=None): ''' WatchRetryStrategy watches for changes to the model. Currently we only allow changes to the boolean that determines whether retries should be attempted or not. entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='RetryStrategy', request='WatchRetryStrategy', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs]class SecretBackendsFacade(Type): name = 'SecretBackends' version = 1 schema = {'definitions': {'AddSecretBackendArg': {'additionalProperties': False, 'properties': {'SecretBackend': {'$ref': '#/definitions/SecretBackend'}, 'backend-type': {'type': 'string'}, 'config': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'id': {'type': 'string'}, 'name': {'type': 'string'}, 'token-rotate-interval': {'type': 'integer'}}, 'required': ['name', 'backend-type', 'config', 'SecretBackend'], 'type': 'object'}, 'AddSecretBackendArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/AddSecretBackendArg'}, 'type': 'array'}}, 'required': ['args'], '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'}, 'ListSecretBackendsArgs': {'additionalProperties': False, 'properties': {'names': {'items': {'type': 'string'}, 'type': 'array'}, 'reveal': {'type': 'boolean'}}, 'required': ['names', 'reveal'], 'type': 'object'}, 'ListSecretBackendsResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/SecretBackendResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'RemoveSecretBackendArg': {'additionalProperties': False, 'properties': {'force': {'type': 'boolean'}, 'name': {'type': 'string'}}, 'required': ['name'], 'type': 'object'}, 'RemoveSecretBackendArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/RemoveSecretBackendArg'}, 'type': 'array'}}, 'required': ['args'], 'type': 'object'}, 'SecretBackend': {'additionalProperties': False, 'properties': {'backend-type': {'type': 'string'}, 'config': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'name': {'type': 'string'}, 'token-rotate-interval': {'type': 'integer'}}, 'required': ['name', 'backend-type', 'config'], 'type': 'object'}, 'SecretBackendResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'id': {'type': 'string'}, 'message': {'type': 'string'}, 'num-secrets': {'type': 'integer'}, 'result': {'$ref': '#/definitions/SecretBackend'}, 'status': {'type': 'string'}}, 'required': ['result', 'id', 'num-secrets', 'status'], 'type': 'object'}, 'UpdateSecretBackendArg': {'additionalProperties': False, 'properties': {'config': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'force': {'type': 'boolean'}, 'name': {'type': 'string'}, 'name-change': {'type': 'string'}, 'reset': {'items': {'type': 'string'}, 'type': 'array'}, 'token-rotate-interval': {'type': 'integer'}}, 'required': ['name', 'token-rotate-interval', 'config', 'reset'], 'type': 'object'}, 'UpdateSecretBackendArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/UpdateSecretBackendArg'}, 'type': 'array'}}, 'required': ['args'], 'type': 'object'}}, 'properties': {'AddSecretBackends': {'description': 'AddSecretBackends adds ' 'new secret backends.', 'properties': {'Params': {'$ref': '#/definitions/AddSecretBackendArgs'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'ListSecretBackends': {'description': 'ListSecretBackends ' 'lists available secret ' 'backends.', 'properties': {'Params': {'$ref': '#/definitions/ListSecretBackendsArgs'}, 'Result': {'$ref': '#/definitions/ListSecretBackendsResults'}}, 'type': 'object'}, 'RemoveSecretBackends': {'description': 'RemoveSecretBackends ' 'removes secret ' 'backends.', 'properties': {'Params': {'$ref': '#/definitions/RemoveSecretBackendArgs'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'UpdateSecretBackends': {'description': 'UpdateSecretBackends ' 'updates secret ' 'backends.', 'properties': {'Params': {'$ref': '#/definitions/UpdateSecretBackendArgs'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(ErrorResults) async def AddSecretBackends(self, args=None): ''' AddSecretBackends adds new secret backends. args : typing.Sequence[~AddSecretBackendArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretBackends', request='AddSecretBackends', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ListSecretBackendsResults) async def ListSecretBackends(self, names=None, reveal=None): ''' ListSecretBackends lists available secret backends. names : typing.Sequence[str] reveal : bool Returns -> ListSecretBackendsResults ''' if names is not None and not isinstance(names, (bytes, str, list)): raise Exception("Expected names to be a Sequence, received: {}".format(type(names))) if reveal is not None and not isinstance(reveal, bool): raise Exception("Expected reveal to be a bool, received: {}".format(type(reveal))) # map input types to rpc msg _params = dict() msg = dict(type='SecretBackends', request='ListSecretBackends', version=1, params=_params) _params['names'] = names _params['reveal'] = reveal reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def RemoveSecretBackends(self, args=None): ''' RemoveSecretBackends removes secret backends. args : typing.Sequence[~RemoveSecretBackendArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretBackends', request='RemoveSecretBackends', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def UpdateSecretBackends(self, args=None): ''' UpdateSecretBackends updates secret backends. args : typing.Sequence[~UpdateSecretBackendArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretBackends', request='UpdateSecretBackends', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs]class SecretBackendsManagerFacade(Type): name = 'SecretBackendsManager' 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'}, 'RotateSecretBackendArgs': {'additionalProperties': False, 'properties': {'backend-ids': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['backend-ids'], 'type': 'object'}, 'SecretBackendRotateChange': {'additionalProperties': False, 'properties': {'backend-name': {'type': 'string'}, 'id': {'type': 'string'}, 'next-trigger-time': {'format': 'date-time', 'type': 'string'}}, 'required': ['id', 'backend-name', 'next-trigger-time'], 'type': 'object'}, 'SecretBackendRotateWatchResult': {'additionalProperties': False, 'properties': {'changes': {'items': {'$ref': '#/definitions/SecretBackendRotateChange'}, 'type': 'array'}, 'error': {'$ref': '#/definitions/Error'}, 'watcher-id': {'type': 'string'}}, 'required': ['watcher-id', 'changes'], 'type': 'object'}}, 'properties': {'RotateBackendTokens': {'description': 'RotateBackendTokens ' 'rotates the tokens for ' 'the specified ' 'backends.', 'properties': {'Params': {'$ref': '#/definitions/RotateSecretBackendArgs'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'WatchSecretBackendsRotateChanges': {'description': 'WatchSecretBackendsRotateChanges ' 'sets up a ' 'watcher ' 'to notify ' 'of ' 'changes ' 'to secret ' 'backend ' 'rotations.', 'properties': {'Result': {'$ref': '#/definitions/SecretBackendRotateWatchResult'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(ErrorResults) async def RotateBackendTokens(self, backend_ids=None): ''' RotateBackendTokens rotates the tokens for the specified backends. backend_ids : typing.Sequence[str] Returns -> ErrorResults ''' if backend_ids is not None and not isinstance(backend_ids, (bytes, str, list)): raise Exception("Expected backend_ids to be a Sequence, received: {}".format(type(backend_ids))) # map input types to rpc msg _params = dict() msg = dict(type='SecretBackendsManager', request='RotateBackendTokens', version=1, params=_params) _params['backend-ids'] = backend_ids reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(SecretBackendRotateWatchResult) async def WatchSecretBackendsRotateChanges(self): ''' WatchSecretBackendsRotateChanges sets up a watcher to notify of changes to secret backend rotations. Returns -> SecretBackendRotateWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretBackendsManager', request='WatchSecretBackendsRotateChanges', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]class SecretBackendsRotateWatcherFacade(Type): name = 'SecretBackendsRotateWatcher' 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'}, 'SecretBackendRotateChange': {'additionalProperties': False, 'properties': {'backend-name': {'type': 'string'}, 'id': {'type': 'string'}, 'next-trigger-time': {'format': 'date-time', 'type': 'string'}}, 'required': ['id', 'backend-name', 'next-trigger-time'], 'type': 'object'}, 'SecretBackendRotateWatchResult': {'additionalProperties': False, 'properties': {'changes': {'items': {'$ref': '#/definitions/SecretBackendRotateChange'}, '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/SecretBackendRotateWatchResult'}}, 'type': 'object'}, 'Stop': {'description': 'Stop stops the watcher.', 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(SecretBackendRotateWatchResult) 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 -> SecretBackendRotateWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretBackendsRotateWatcher', request='Next', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Stop(self): ''' Stop stops the watcher. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretBackendsRotateWatcher', request='Stop', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] 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
[docs]class SecretsDrainFacade(Type): name = 'SecretsDrain' version = 1 schema = {'definitions': {'ChangeSecretBackendArg': {'additionalProperties': False, 'properties': {'content': {'$ref': '#/definitions/SecretContentParams'}, 'revision': {'type': 'integer'}, 'uri': {'type': 'string'}}, 'required': ['uri', 'revision'], 'type': 'object'}, 'ChangeSecretBackendArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/ChangeSecretBackendArg'}, 'type': 'array'}}, 'required': ['args'], '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'}, 'ListSecretResult': {'additionalProperties': False, 'properties': {'create-time': {'format': 'date-time', 'type': 'string'}, 'description': {'type': 'string'}, 'label': {'type': 'string'}, 'latest-expire-time': {'format': 'date-time', 'type': 'string'}, 'latest-revision': {'type': 'integer'}, 'next-rotate-time': {'format': 'date-time', 'type': 'string'}, 'owner-tag': {'type': 'string'}, 'revisions': {'items': {'$ref': '#/definitions/SecretRevision'}, 'type': 'array'}, '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', 'latest-revision', 'create-time', 'update-time', 'revisions'], 'type': 'object'}, 'ListSecretResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ListSecretResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'NotifyWatchResult': {'additionalProperties': False, 'properties': {'NotifyWatcherId': {'type': 'string'}, 'error': {'$ref': '#/definitions/Error'}}, 'required': ['NotifyWatcherId'], 'type': 'object'}, 'SecretContentParams': {'additionalProperties': False, 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, 'type': 'object'}, 'value-ref': {'$ref': '#/definitions/SecretValueRef'}}, 'type': 'object'}, 'SecretRevision': {'additionalProperties': False, 'properties': {'backend-name': {'type': 'string'}, 'create-time': {'format': 'date-time', 'type': 'string'}, 'expire-time': {'format': 'date-time', 'type': 'string'}, 'revision': {'type': 'integer'}, 'update-time': {'format': 'date-time', 'type': 'string'}, 'value-ref': {'$ref': '#/definitions/SecretValueRef'}}, 'required': ['revision'], 'type': 'object'}, 'SecretValueRef': {'additionalProperties': False, 'properties': {'backend-id': {'type': 'string'}, 'revision-id': {'type': 'string'}}, 'required': ['backend-id', 'revision-id'], 'type': 'object'}, 'SecretValueResult': {'additionalProperties': False, 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, 'type': 'object'}, 'error': {'$ref': '#/definitions/Error'}}, 'type': 'object'}}, 'properties': {'ChangeSecretBackend': {'description': 'ChangeSecretBackend ' 'updates the backend ' 'for the specified ' 'secret after migration ' 'done.', 'properties': {'Params': {'$ref': '#/definitions/ChangeSecretBackendArgs'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'GetSecretsToDrain': {'description': 'GetSecretsToDrain ' 'returns metadata for the ' 'secrets that need to be ' 'drained.', 'properties': {'Result': {'$ref': '#/definitions/ListSecretResults'}}, 'type': 'object'}, 'WatchSecretBackendChanged': {'description': 'WatchSecretBackendChanged ' 'sets up a ' 'watcher to ' 'notify of ' 'changes to the ' 'secret backend.', 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(ErrorResults) async def ChangeSecretBackend(self, args=None): ''' ChangeSecretBackend updates the backend for the specified secret after migration done. args : typing.Sequence[~ChangeSecretBackendArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsDrain', request='ChangeSecretBackend', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ListSecretResults) async def GetSecretsToDrain(self): ''' GetSecretsToDrain returns metadata for the secrets that need to be drained. Returns -> ListSecretResults ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretsDrain', request='GetSecretsToDrain', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResult) async def WatchSecretBackendChanged(self): ''' WatchSecretBackendChanged sets up a watcher to notify of changes to the secret backend. Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretsDrain', request='WatchSecretBackendChanged', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]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'}, 'label': {'type': 'string'}, 'latest-expire-time': {'format': 'date-time', 'type': 'string'}, 'latest-revision': {'type': 'integer'}, 'next-rotate-time': {'format': 'date-time', 'type': 'string'}, 'owner-tag': {'type': 'string'}, 'revisions': {'items': {'$ref': '#/definitions/SecretRevision'}, 'type': 'array'}, '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', 'latest-revision', 'create-time', 'update-time', 'revisions'], 'type': 'object'}, 'ListSecretResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ListSecretResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'ListSecretsArgs': {'additionalProperties': False, 'properties': {'filter': {'$ref': '#/definitions/SecretsFilter'}, 'show-secrets': {'type': 'boolean'}}, 'required': ['show-secrets', 'filter'], 'type': 'object'}, 'SecretRevision': {'additionalProperties': False, 'properties': {'backend-name': {'type': 'string'}, 'create-time': {'format': 'date-time', 'type': 'string'}, 'expire-time': {'format': 'date-time', 'type': 'string'}, 'revision': {'type': 'integer'}, 'update-time': {'format': 'date-time', 'type': 'string'}, 'value-ref': {'$ref': '#/definitions/SecretValueRef'}}, 'required': ['revision'], 'type': 'object'}, 'SecretValueRef': {'additionalProperties': False, 'properties': {'backend-id': {'type': 'string'}, 'revision-id': {'type': 'string'}}, 'required': ['backend-id', 'revision-id'], 'type': 'object'}, 'SecretValueResult': {'additionalProperties': False, 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, 'type': 'object'}, 'error': {'$ref': '#/definitions/Error'}}, 'type': 'object'}, 'SecretsFilter': {'additionalProperties': False, 'properties': {'owner-tag': {'type': 'string'}, 'revision': {'type': 'integer'}, 'uri': {'type': 'string'}}, 'type': 'object'}}, 'properties': {'ListSecrets': {'description': 'ListSecrets lists available ' 'secrets.', 'properties': {'Params': {'$ref': '#/definitions/ListSecretsArgs'}, 'Result': {'$ref': '#/definitions/ListSecretResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(ListSecretResults) async def ListSecrets(self, filter_=None, show_secrets=None): ''' ListSecrets lists available secrets. filter_ : SecretsFilter show_secrets : bool Returns -> ListSecretResults ''' if filter_ is not None and not isinstance(filter_, (dict, SecretsFilter)): raise Exception("Expected filter_ to be a SecretsFilter, received: {}".format(type(filter_))) if show_secrets is not None and not isinstance(show_secrets, bool): raise Exception("Expected show_secrets to be a bool, received: {}".format(type(show_secrets))) # map input types to rpc msg _params = dict() msg = dict(type='Secrets', request='ListSecrets', version=1, params=_params) _params['filter'] = filter_ _params['show-secrets'] = show_secrets reply = await self.rpc(msg) return reply
[docs]class SecretsManagerFacade(Type): name = 'SecretsManager' version = 1 schema = {'definitions': {'CreateSecretArg': {'additionalProperties': False, 'properties': {'UpsertSecretArg': {'$ref': '#/definitions/UpsertSecretArg'}, 'content': {'$ref': '#/definitions/SecretContentParams'}, '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'}, 'uri': {'type': 'string'}}, 'required': ['UpsertSecretArg', 'owner-tag'], 'type': 'object'}, 'CreateSecretArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/CreateSecretArg'}, 'type': 'array'}}, 'required': ['args'], 'type': 'object'}, 'CreateSecretURIsArg': {'additionalProperties': False, 'properties': {'count': {'type': 'integer'}}, 'required': ['count'], 'type': 'object'}, 'DeleteSecretArg': {'additionalProperties': False, 'properties': {'revisions': {'items': {'type': 'integer'}, 'type': 'array'}, 'uri': {'type': 'string'}}, 'required': ['uri'], 'type': 'object'}, 'DeleteSecretArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/DeleteSecretArg'}, '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'}, 'GetSecretConsumerInfoArgs': {'additionalProperties': False, 'properties': {'consumer-tag': {'type': 'string'}, 'uris': {'items': {'type': 'string'}, 'type': 'array'}}, 'required': ['consumer-tag', 'uris'], 'type': 'object'}, 'GetSecretContentArg': {'additionalProperties': False, 'properties': {'label': {'type': 'string'}, 'peek': {'type': 'boolean'}, 'refresh': {'type': 'boolean'}, 'uri': {'type': 'string'}}, 'required': ['uri'], 'type': 'object'}, 'GetSecretContentArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/GetSecretContentArg'}, 'type': 'array'}}, 'required': ['args'], 'type': 'object'}, 'GrantRevokeSecretArg': {'additionalProperties': False, 'properties': {'role': {'type': 'string'}, 'scope-tag': {'type': 'string'}, 'subject-tags': {'items': {'type': 'string'}, 'type': 'array'}, 'uri': {'type': 'string'}}, 'required': ['uri', 'scope-tag', 'subject-tags', 'role'], 'type': 'object'}, 'GrantRevokeSecretArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/GrantRevokeSecretArg'}, 'type': 'array'}}, 'required': ['args'], 'type': 'object'}, 'ListSecretResult': {'additionalProperties': False, 'properties': {'create-time': {'format': 'date-time', 'type': 'string'}, 'description': {'type': 'string'}, 'label': {'type': 'string'}, 'latest-expire-time': {'format': 'date-time', 'type': 'string'}, 'latest-revision': {'type': 'integer'}, 'next-rotate-time': {'format': 'date-time', 'type': 'string'}, 'owner-tag': {'type': 'string'}, 'revisions': {'items': {'$ref': '#/definitions/SecretRevision'}, 'type': 'array'}, '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', 'latest-revision', 'create-time', 'update-time', 'revisions'], 'type': 'object'}, 'ListSecretResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ListSecretResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'SecretBackendConfig': {'additionalProperties': False, 'properties': {'params': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'type': {'type': 'string'}}, 'required': ['type'], 'type': 'object'}, 'SecretBackendConfigResults': {'additionalProperties': False, 'properties': {'active-id': {'type': 'string'}, 'configs': {'patternProperties': {'.*': {'$ref': '#/definitions/SecretBackendConfig'}}, 'type': 'object'}, 'model-controller': {'type': 'string'}, 'model-name': {'type': 'string'}, 'model-uuid': {'type': 'string'}}, 'required': ['model-controller', 'model-uuid', 'model-name', 'active-id'], 'type': 'object'}, 'SecretConsumerInfoResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'label': {'type': 'string'}, 'revision': {'type': 'integer'}}, 'required': ['revision', 'label'], 'type': 'object'}, 'SecretConsumerInfoResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/SecretConsumerInfoResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'SecretContentParams': {'additionalProperties': False, 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, 'type': 'object'}, 'value-ref': {'$ref': '#/definitions/SecretValueRef'}}, 'type': 'object'}, 'SecretContentResult': {'additionalProperties': False, 'properties': {'content': {'$ref': '#/definitions/SecretContentParams'}, 'error': {'$ref': '#/definitions/Error'}}, 'required': ['content'], 'type': 'object'}, 'SecretContentResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/SecretContentResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'SecretRevision': {'additionalProperties': False, 'properties': {'backend-name': {'type': 'string'}, 'create-time': {'format': 'date-time', 'type': 'string'}, 'expire-time': {'format': 'date-time', 'type': 'string'}, 'revision': {'type': 'integer'}, 'update-time': {'format': 'date-time', 'type': 'string'}, 'value-ref': {'$ref': '#/definitions/SecretValueRef'}}, 'required': ['revision'], 'type': 'object'}, 'SecretRevisionArg': {'additionalProperties': False, 'properties': {'pending-delete': {'type': 'boolean'}, 'revisions': {'items': {'type': 'integer'}, 'type': 'array'}, 'uri': {'type': 'string'}}, 'required': ['uri', 'revisions', 'pending-delete'], 'type': 'object'}, 'SecretRotatedArg': {'additionalProperties': False, 'properties': {'original-revision': {'type': 'integer'}, 'skip': {'type': 'boolean'}, 'uri': {'type': 'string'}}, 'required': ['uri', 'original-revision', 'skip'], 'type': 'object'}, 'SecretRotatedArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/SecretRotatedArg'}, 'type': 'array'}}, 'required': ['args'], 'type': 'object'}, 'SecretTriggerChange': {'additionalProperties': False, 'properties': {'next-trigger-time': {'format': 'date-time', 'type': 'string'}, 'revision': {'type': 'integer'}, 'uri': {'type': 'string'}}, 'required': ['uri', 'next-trigger-time'], 'type': 'object'}, 'SecretTriggerWatchResult': {'additionalProperties': False, 'properties': {'changes': {'items': {'$ref': '#/definitions/SecretTriggerChange'}, 'type': 'array'}, 'error': {'$ref': '#/definitions/Error'}, 'watcher-id': {'type': 'string'}}, 'required': ['watcher-id', 'changes'], 'type': 'object'}, 'SecretValueRef': {'additionalProperties': False, 'properties': {'backend-id': {'type': 'string'}, 'revision-id': {'type': 'string'}}, 'required': ['backend-id', 'revision-id'], 'type': 'object'}, 'SecretValueResult': {'additionalProperties': False, 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, 'type': 'object'}, 'error': {'$ref': '#/definitions/Error'}}, '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'}, 'UpdateSecretArg': {'additionalProperties': False, 'properties': {'UpsertSecretArg': {'$ref': '#/definitions/UpsertSecretArg'}, 'content': {'$ref': '#/definitions/SecretContentParams'}, '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': {'content': {'$ref': '#/definitions/SecretContentParams'}, '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': {'CreateSecretURIs': {'description': 'CreateSecretURIs creates ' 'new secret URIs.', 'properties': {'Params': {'$ref': '#/definitions/CreateSecretURIsArg'}, 'Result': {'$ref': '#/definitions/StringResults'}}, 'type': 'object'}, 'CreateSecrets': {'description': 'CreateSecrets creates new ' 'secrets.', 'properties': {'Params': {'$ref': '#/definitions/CreateSecretArgs'}, 'Result': {'$ref': '#/definitions/StringResults'}}, 'type': 'object'}, 'GetConsumerSecretsRevisionInfo': {'description': 'GetConsumerSecretsRevisionInfo ' 'returns the ' 'latest ' 'secret ' 'revisions ' 'for the ' 'specified ' 'secrets.\n' 'This facade ' 'method is ' 'used for ' 'remote ' 'watcher to ' 'get the ' 'latest ' 'secret ' 'revisions ' 'and labels ' 'for a ' 'secret ' 'changed ' 'hook.', 'properties': {'Params': {'$ref': '#/definitions/GetSecretConsumerInfoArgs'}, 'Result': {'$ref': '#/definitions/SecretConsumerInfoResults'}}, 'type': 'object'}, 'GetSecretBackendConfig': {'description': 'GetSecretBackendConfig ' 'gets the config ' 'needed to create a ' 'client to secret ' 'backends.', 'properties': {'Result': {'$ref': '#/definitions/SecretBackendConfigResults'}}, 'type': 'object'}, 'GetSecretContentInfo': {'description': 'GetSecretContentInfo ' 'returns the secret ' 'values for the ' 'specified secrets.', 'properties': {'Params': {'$ref': '#/definitions/GetSecretContentArgs'}, 'Result': {'$ref': '#/definitions/SecretContentResults'}}, 'type': 'object'}, 'GetSecretMetadata': {'description': 'GetSecretMetadata ' 'returns metadata for the ' "caller's secrets.", 'properties': {'Result': {'$ref': '#/definitions/ListSecretResults'}}, 'type': 'object'}, 'GetSecretRevisionContentInfo': {'description': 'GetSecretRevisionContentInfo ' 'returns the ' 'secret values ' 'for the ' 'specified ' 'secret ' 'revisions.', 'properties': {'Params': {'$ref': '#/definitions/SecretRevisionArg'}, 'Result': {'$ref': '#/definitions/SecretContentResults'}}, 'type': 'object'}, 'GetSecretStoreConfig': {'description': 'GetSecretStoreConfig ' 'is for 3.0.x agents.\n' 'TODO(wallyworld) - ' 'remove when we auto ' 'upgrade migrated ' 'models.', 'properties': {'Result': {'$ref': '#/definitions/SecretBackendConfig'}}, 'type': 'object'}, 'RemoveSecrets': {'description': 'RemoveSecrets removes the ' 'specified secrets.', 'properties': {'Params': {'$ref': '#/definitions/DeleteSecretArgs'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'SecretsGrant': {'description': 'SecretsGrant grants access to ' 'a secret for the specified ' 'subjects.', 'properties': {'Params': {'$ref': '#/definitions/GrantRevokeSecretArgs'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'SecretsRevoke': {'description': 'SecretsRevoke revokes access ' 'to a secret for the ' 'specified subjects.', 'properties': {'Params': {'$ref': '#/definitions/GrantRevokeSecretArgs'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, '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'}, 'WatchConsumedSecretsChanges': {'description': 'WatchConsumedSecretsChanges ' 'sets up a ' 'watcher to ' 'notify of ' 'changes to ' 'secret ' 'revisions for ' 'the specified ' 'consumers.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/StringsWatchResults'}}, 'type': 'object'}, 'WatchObsolete': {'description': 'WatchObsolete returns a ' 'watcher for notifying when:\n' ' - a secret owned by the ' 'entity is deleted\n' ' - a secret revision owed ' 'by the entity no longer\n' ' has any consumers\n' '\n' 'Obsolete revisions results ' 'are "uri/revno" and deleted\n' 'secret results are "uri".', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/StringsWatchResult'}}, 'type': 'object'}, 'WatchSecretRevisionsExpiryChanges': {'description': 'WatchSecretRevisionsExpiryChanges ' 'sets up ' 'a ' 'watcher ' 'to ' 'notify ' 'of ' 'changes ' 'to ' 'secret ' 'revision ' 'expiry ' 'config.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/SecretTriggerWatchResult'}}, '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/SecretTriggerWatchResult'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(StringResults) async def CreateSecretURIs(self, count=None): ''' CreateSecretURIs creates new secret URIs. count : int Returns -> StringResults ''' if count is not None and not isinstance(count, int): raise Exception("Expected count to be a int, received: {}".format(type(count))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='CreateSecretURIs', version=1, params=_params) _params['count'] = count reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(StringResults) async def CreateSecrets(self, args=None): ''' CreateSecrets creates new secrets. args : typing.Sequence[~CreateSecretArg] Returns -> StringResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='CreateSecrets', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(SecretConsumerInfoResults) async def GetConsumerSecretsRevisionInfo(self, consumer_tag=None, uris=None): ''' GetConsumerSecretsRevisionInfo returns the latest secret revisions for the specified secrets. This facade method is used for remote watcher to get the latest secret revisions and labels for a secret changed hook. consumer_tag : str uris : typing.Sequence[str] Returns -> SecretConsumerInfoResults ''' if consumer_tag is not None and not isinstance(consumer_tag, (bytes, str)): raise Exception("Expected consumer_tag to be a str, received: {}".format(type(consumer_tag))) if uris is not None and not isinstance(uris, (bytes, str, list)): raise Exception("Expected uris to be a Sequence, received: {}".format(type(uris))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='GetConsumerSecretsRevisionInfo', version=1, params=_params) _params['consumer-tag'] = consumer_tag _params['uris'] = uris reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(SecretBackendConfigResults) async def GetSecretBackendConfig(self): ''' GetSecretBackendConfig gets the config needed to create a client to secret backends. Returns -> SecretBackendConfigResults ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='GetSecretBackendConfig', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(SecretContentResults) async def GetSecretContentInfo(self, args=None): ''' GetSecretContentInfo returns the secret values for the specified secrets. args : typing.Sequence[~GetSecretContentArg] Returns -> SecretContentResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='GetSecretContentInfo', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ListSecretResults) async def GetSecretMetadata(self): ''' GetSecretMetadata returns metadata for the caller's secrets. Returns -> ListSecretResults ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='GetSecretMetadata', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(SecretContentResults) async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): ''' GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. pending_delete : bool revisions : typing.Sequence[int] uri : str Returns -> SecretContentResults ''' if pending_delete is not None and not isinstance(pending_delete, bool): raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) if revisions is not None and not isinstance(revisions, (bytes, str, list)): raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) if uri is not None and not isinstance(uri, (bytes, str)): raise Exception("Expected uri to be a str, received: {}".format(type(uri))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='GetSecretRevisionContentInfo', version=1, params=_params) _params['pending-delete'] = pending_delete _params['revisions'] = revisions _params['uri'] = uri reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(SecretBackendConfig) async def GetSecretStoreConfig(self): ''' GetSecretStoreConfig is for 3.0.x agents. TODO(wallyworld) - remove when we auto upgrade migrated models. Returns -> SecretBackendConfig ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='GetSecretStoreConfig', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def RemoveSecrets(self, args=None): ''' RemoveSecrets removes the specified secrets. args : typing.Sequence[~DeleteSecretArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='RemoveSecrets', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def SecretsGrant(self, args=None): ''' SecretsGrant grants access to a secret for the specified subjects. args : typing.Sequence[~GrantRevokeSecretArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='SecretsGrant', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def SecretsRevoke(self, args=None): ''' SecretsRevoke revokes access to a secret for the specified subjects. args : typing.Sequence[~GrantRevokeSecretArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='SecretsRevoke', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def SecretsRotated(self, args=None): ''' SecretsRotated records when secrets were last rotated. args : typing.Sequence[~SecretRotatedArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='SecretsRotated', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def UpdateSecrets(self, args=None): ''' UpdateSecrets updates the specified secrets. args : typing.Sequence[~UpdateSecretArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='UpdateSecrets', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(StringsWatchResults) async def WatchConsumedSecretsChanges(self, entities=None): ''' WatchConsumedSecretsChanges sets up a watcher to notify of changes to secret revisions for the specified consumers. entities : typing.Sequence[~Entity] Returns -> StringsWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='WatchConsumedSecretsChanges', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(StringsWatchResult) async def WatchObsolete(self, entities=None): ''' WatchObsolete returns a watcher for notifying when: - a secret owned by the entity is deleted - a secret revision owed by the entity no longer has any consumers Obsolete revisions results are "uri/revno" and deleted secret results are "uri". entities : typing.Sequence[~Entity] Returns -> StringsWatchResult ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='WatchObsolete', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(SecretTriggerWatchResult) async def WatchSecretRevisionsExpiryChanges(self, entities=None): ''' WatchSecretRevisionsExpiryChanges sets up a watcher to notify of changes to secret revision expiry config. entities : typing.Sequence[~Entity] Returns -> SecretTriggerWatchResult ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='WatchSecretRevisionsExpiryChanges', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(SecretTriggerWatchResult) async def WatchSecretsRotationChanges(self, entities=None): ''' WatchSecretsRotationChanges sets up a watcher to notify of changes to secret rotation config. entities : typing.Sequence[~Entity] Returns -> SecretTriggerWatchResult ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='SecretsManager', request='WatchSecretsRotationChanges', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs]class SecretsRevisionWatcherFacade(Type): name = 'SecretsRevisionWatcher' 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'}, 'SecretRevisionChange': {'additionalProperties': False, 'properties': {'revision': {'type': 'integer'}, 'uri': {'type': 'string'}}, 'required': ['uri', 'revision'], 'type': 'object'}, 'SecretRevisionWatchResult': {'additionalProperties': False, 'properties': {'changes': {'items': {'$ref': '#/definitions/SecretRevisionChange'}, 'type': 'array'}, 'error': {'$ref': '#/definitions/Error'}, 'watcher-id': {'type': 'string'}}, 'required': ['watcher-id', 'changes'], 'type': 'object'}}, '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/SecretRevisionWatchResult'}}, 'type': 'object'}, 'Stop': {'description': 'Stop stops the watcher.', 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(SecretRevisionWatchResult) 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 -> SecretRevisionWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretsRevisionWatcher', request='Next', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Stop(self): ''' Stop stops the watcher. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretsRevisionWatcher', request='Stop', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] 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
[docs]class SecretsTriggerWatcherFacade(Type): name = 'SecretsTriggerWatcher' 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'}, 'SecretTriggerChange': {'additionalProperties': False, 'properties': {'next-trigger-time': {'format': 'date-time', 'type': 'string'}, 'revision': {'type': 'integer'}, 'uri': {'type': 'string'}}, 'required': ['uri', 'next-trigger-time'], 'type': 'object'}, 'SecretTriggerWatchResult': {'additionalProperties': False, 'properties': {'changes': {'items': {'$ref': '#/definitions/SecretTriggerChange'}, '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/SecretTriggerWatchResult'}}, 'type': 'object'}, 'Stop': {'description': 'Stop stops the watcher.', 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(SecretTriggerWatchResult) 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 -> SecretTriggerWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretsTriggerWatcher', request='Next', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Stop(self): ''' Stop stops the watcher. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='SecretsTriggerWatcher', request='Stop', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] 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
[docs]class StringsWatcherFacade(Type): name = 'StringsWatcher' version = 1 schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'StringsWatchResult': {'additionalProperties': False, 'properties': {'changes': {'items': {'type': 'string'}, 'type': 'array'}, 'error': {'$ref': '#/definitions/Error'}, 'watcher-id': {'type': 'string'}}, 'required': ['watcher-id'], 'type': 'object'}}, 'properties': {'Next': {'description': 'Next returns when a change has ' 'occurred to an entity of the\n' 'collection being watched since the ' 'most recent call to Next\n' 'or the Watch call that created the ' 'srvStringsWatcher.', 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, 'type': 'object'}, 'Stop': {'description': 'Stop stops the watcher.', 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(StringsWatchResult) async def Next(self): ''' Next returns when a change has occurred to an entity of the collection being watched since the most recent call to Next or the Watch call that created the srvStringsWatcher. Returns -> StringsWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='StringsWatcher', request='Next', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Stop(self): ''' Stop stops the watcher. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='StringsWatcher', request='Stop', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] 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
[docs]class UndertakerFacade(Type): name = 'Undertaker' 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'}, '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'}, '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'}, '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': {'CloudSpec': {'description': "CloudSpec returns the model's " 'cloud spec.', 'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/CloudSpecResults'}}, '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'}, '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'}, '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'}, 'WatchModel': {'description': 'WatchModel creates a watcher ' 'for the current model.', 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, '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'}
[docs] @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='Undertaker', request='CloudSpec', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @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='Undertaker', request='GetCloudSpec', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @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='Undertaker', request='ModelConfig', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(UndertakerModelInfoResult) async def ModelInfo(self): ''' ModelInfo returns information on the model needed by the undertaker worker. Returns -> UndertakerModelInfoResult ''' # map input types to rpc msg _params = dict() msg = dict(type='Undertaker', request='ModelInfo', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def ProcessDyingModel(self): ''' ProcessDyingModel checks if a dying model has any machines or applications. If there are none, the model's life is changed from dying to dead. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='Undertaker', request='ProcessDyingModel', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def RemoveModel(self): ''' RemoveModel removes any records of this model from Juju. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='Undertaker', request='RemoveModel', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def SetStatus(self, entities=None): ''' SetStatus sets the status of each given entity. entities : typing.Sequence[~EntityStatusArgs] Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Undertaker', request='SetStatus', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @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='Undertaker', request='WatchCloudSpecsChanges', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @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='Undertaker', request='WatchForModelConfigChanges', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResults) async def WatchModel(self): ''' WatchModel creates a watcher for the current model. Returns -> NotifyWatchResults ''' # map input types to rpc msg _params = dict() msg = dict(type='Undertaker', request='WatchModel', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResults) async def WatchModelResources(self): ''' WatchModelResources creates watchers for changes to the lifecycle of an model's machines and applications and storage. Returns -> NotifyWatchResults ''' # map input types to rpc msg _params = dict() msg = dict(type='Undertaker', request='WatchModelResources', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]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'}
[docs] @ReturnMapping(ErrorResults) async def AssignUnits(self, entities=None): ''' AssignUnits assigns the units with the given ids to the correct machine. The error results are returned in the same order as the given entities. entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='UnitAssigner', request='AssignUnits', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def SetAgentStatus(self, entities=None): ''' SetAgentStatus will set status for agents of Units passed in args, if one of the args is not an Unit it will fail. entities : typing.Sequence[~EntityStatusArgs] Returns -> ErrorResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='UnitAssigner', request='SetAgentStatus', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(StringsWatchResult) async def WatchUnitAssignments(self): ''' WatchUnitAssignments returns a strings watcher that is notified when new unit assignments are added to the db. Returns -> StringsWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='UnitAssigner', request='WatchUnitAssignments', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]class UpgraderFacade(Type): name = 'Upgrader' version = 1 schema = {'definitions': {'Binary': {'additionalProperties': False, 'properties': {'Arch': {'type': 'string'}, 'Build': {'type': 'integer'}, 'Major': {'type': 'integer'}, 'Minor': {'type': 'integer'}, 'Number': {'$ref': '#/definitions/Number'}, 'Patch': {'type': 'integer'}, 'Release': {'type': 'string'}, 'Tag': {'type': 'string'}}, 'required': ['Major', 'Minor', 'Tag', 'Patch', 'Build', 'Number', 'Release', 'Arch'], 'type': 'object'}, 'Entities': {'additionalProperties': False, 'properties': {'entities': {'items': {'$ref': '#/definitions/Entity'}, 'type': 'array'}}, 'required': ['entities'], 'type': 'object'}, 'EntitiesVersion': {'additionalProperties': False, 'properties': {'agent-tools': {'items': {'$ref': '#/definitions/EntityVersion'}, 'type': 'array'}}, 'required': ['agent-tools'], 'type': 'object'}, 'Entity': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}}, 'required': ['tag'], 'type': 'object'}, 'EntityVersion': {'additionalProperties': False, 'properties': {'tag': {'type': 'string'}, 'tools': {'$ref': '#/definitions/Version'}}, 'required': ['tag', 'tools'], 'type': 'object'}, 'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'ErrorResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}}, 'type': 'object'}, 'ErrorResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ErrorResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'NotifyWatchResult': {'additionalProperties': False, 'properties': {'NotifyWatcherId': {'type': 'string'}, 'error': {'$ref': '#/definitions/Error'}}, 'required': ['NotifyWatcherId'], 'type': 'object'}, 'NotifyWatchResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/NotifyWatchResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'Number': {'additionalProperties': False, 'properties': {'Build': {'type': 'integer'}, 'Major': {'type': 'integer'}, 'Minor': {'type': 'integer'}, 'Patch': {'type': 'integer'}, 'Tag': {'type': 'string'}}, 'required': ['Major', 'Minor', 'Tag', 'Patch', 'Build'], 'type': 'object'}, 'Tools': {'additionalProperties': False, 'properties': {'sha256': {'type': 'string'}, 'size': {'type': 'integer'}, 'url': {'type': 'string'}, 'version': {'$ref': '#/definitions/Binary'}}, 'required': ['version', 'url', 'size'], 'type': 'object'}, 'ToolsResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'tools': {'items': {'$ref': '#/definitions/Tools'}, 'type': 'array'}}, 'required': ['tools'], 'type': 'object'}, 'ToolsResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ToolsResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'Version': {'additionalProperties': False, 'properties': {'version': {'$ref': '#/definitions/Binary'}}, 'required': ['version'], 'type': 'object'}, 'VersionResult': {'additionalProperties': False, 'properties': {'error': {'$ref': '#/definitions/Error'}, 'version': {'$ref': '#/definitions/Number'}}, 'type': 'object'}, 'VersionResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/VersionResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}}, 'properties': {'DesiredVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/VersionResults'}}, 'type': 'object'}, 'SetTools': {'properties': {'Params': {'$ref': '#/definitions/EntitiesVersion'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'Tools': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/ToolsResults'}}, 'type': 'object'}, 'WatchAPIVersion': {'properties': {'Params': {'$ref': '#/definitions/Entities'}, 'Result': {'$ref': '#/definitions/NotifyWatchResults'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(VersionResults) async def DesiredVersion(self, entities=None): ''' entities : typing.Sequence[~Entity] Returns -> VersionResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Upgrader', request='DesiredVersion', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ErrorResults) async def SetTools(self, agent_tools=None): ''' agent_tools : typing.Sequence[~EntityVersion] Returns -> ErrorResults ''' if agent_tools is not None and not isinstance(agent_tools, (bytes, str, list)): raise Exception("Expected agent_tools to be a Sequence, received: {}".format(type(agent_tools))) # map input types to rpc msg _params = dict() msg = dict(type='Upgrader', request='SetTools', version=1, params=_params) _params['agent-tools'] = agent_tools reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ToolsResults) async def Tools(self, entities=None): ''' entities : typing.Sequence[~Entity] Returns -> ToolsResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Upgrader', request='Tools', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResults) async def WatchAPIVersion(self, entities=None): ''' entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) # map input types to rpc msg _params = dict() msg = dict(type='Upgrader', request='WatchAPIVersion', version=1, params=_params) _params['entities'] = entities reply = await self.rpc(msg) return reply
[docs]class UserSecretsDrainFacade(Type): name = 'UserSecretsDrain' version = 1 schema = {'definitions': {'ChangeSecretBackendArg': {'additionalProperties': False, 'properties': {'content': {'$ref': '#/definitions/SecretContentParams'}, 'revision': {'type': 'integer'}, 'uri': {'type': 'string'}}, 'required': ['uri', 'revision'], 'type': 'object'}, 'ChangeSecretBackendArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/ChangeSecretBackendArg'}, 'type': 'array'}}, 'required': ['args'], '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'}, 'GetSecretContentArg': {'additionalProperties': False, 'properties': {'label': {'type': 'string'}, 'peek': {'type': 'boolean'}, 'refresh': {'type': 'boolean'}, 'uri': {'type': 'string'}}, 'required': ['uri'], 'type': 'object'}, 'GetSecretContentArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/GetSecretContentArg'}, 'type': 'array'}}, 'required': ['args'], 'type': 'object'}, 'ListSecretResult': {'additionalProperties': False, 'properties': {'create-time': {'format': 'date-time', 'type': 'string'}, 'description': {'type': 'string'}, 'label': {'type': 'string'}, 'latest-expire-time': {'format': 'date-time', 'type': 'string'}, 'latest-revision': {'type': 'integer'}, 'next-rotate-time': {'format': 'date-time', 'type': 'string'}, 'owner-tag': {'type': 'string'}, 'revisions': {'items': {'$ref': '#/definitions/SecretRevision'}, 'type': 'array'}, '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', 'latest-revision', 'create-time', 'update-time', 'revisions'], 'type': 'object'}, 'ListSecretResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/ListSecretResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'NotifyWatchResult': {'additionalProperties': False, 'properties': {'NotifyWatcherId': {'type': 'string'}, 'error': {'$ref': '#/definitions/Error'}}, 'required': ['NotifyWatcherId'], 'type': 'object'}, 'SecretBackendArgs': {'additionalProperties': False, 'properties': {'backend-ids': {'items': {'type': 'string'}, 'type': 'array'}, 'for-drain': {'type': 'boolean'}}, 'required': ['for-drain', 'backend-ids'], 'type': 'object'}, 'SecretBackendConfig': {'additionalProperties': False, 'properties': {'params': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'type': {'type': 'string'}}, 'required': ['type'], 'type': 'object'}, 'SecretBackendConfigResult': {'additionalProperties': False, 'properties': {'config': {'$ref': '#/definitions/SecretBackendConfig'}, 'draining': {'type': 'boolean'}, 'model-controller': {'type': 'string'}, 'model-name': {'type': 'string'}, 'model-uuid': {'type': 'string'}}, 'required': ['model-controller', 'model-uuid', 'model-name', 'draining'], 'type': 'object'}, 'SecretBackendConfigResults': {'additionalProperties': False, 'properties': {'active-id': {'type': 'string'}, 'results': {'patternProperties': {'.*': {'$ref': '#/definitions/SecretBackendConfigResult'}}, 'type': 'object'}}, 'required': ['active-id'], 'type': 'object'}, 'SecretContentParams': {'additionalProperties': False, 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, 'type': 'object'}, 'value-ref': {'$ref': '#/definitions/SecretValueRef'}}, 'type': 'object'}, 'SecretContentResult': {'additionalProperties': False, 'properties': {'backend-config': {'$ref': '#/definitions/SecretBackendConfigResult'}, 'content': {'$ref': '#/definitions/SecretContentParams'}, 'error': {'$ref': '#/definitions/Error'}, 'latest-revision': {'type': 'integer'}}, 'required': ['content'], 'type': 'object'}, 'SecretContentResults': {'additionalProperties': False, 'properties': {'results': {'items': {'$ref': '#/definitions/SecretContentResult'}, 'type': 'array'}}, 'required': ['results'], 'type': 'object'}, 'SecretRevision': {'additionalProperties': False, 'properties': {'backend-name': {'type': 'string'}, 'create-time': {'format': 'date-time', 'type': 'string'}, 'expire-time': {'format': 'date-time', 'type': 'string'}, 'revision': {'type': 'integer'}, 'update-time': {'format': 'date-time', 'type': 'string'}, 'value-ref': {'$ref': '#/definitions/SecretValueRef'}}, 'required': ['revision'], 'type': 'object'}, 'SecretRevisionArg': {'additionalProperties': False, 'properties': {'pending-delete': {'type': 'boolean'}, 'revisions': {'items': {'type': 'integer'}, 'type': 'array'}, 'uri': {'type': 'string'}}, 'required': ['uri', 'revisions', 'pending-delete'], 'type': 'object'}, 'SecretValueRef': {'additionalProperties': False, 'properties': {'backend-id': {'type': 'string'}, 'revision-id': {'type': 'string'}}, 'required': ['backend-id', 'revision-id'], 'type': 'object'}, 'SecretValueResult': {'additionalProperties': False, 'properties': {'data': {'patternProperties': {'.*': {'type': 'string'}}, 'type': 'object'}, 'error': {'$ref': '#/definitions/Error'}}, 'type': 'object'}}, 'properties': {'ChangeSecretBackend': {'description': 'ChangeSecretBackend ' 'updates the backend ' 'for the specified ' 'secret after migration ' 'done.', 'properties': {'Params': {'$ref': '#/definitions/ChangeSecretBackendArgs'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'GetSecretBackendConfigs': {'description': 'GetSecretBackendConfigs ' 'gets the config ' 'needed to create a ' 'client to secret ' 'backends for the ' 'drain worker.', 'properties': {'Params': {'$ref': '#/definitions/SecretBackendArgs'}, 'Result': {'$ref': '#/definitions/SecretBackendConfigResults'}}, 'type': 'object'}, 'GetSecretContentInfo': {'description': 'GetSecretContentInfo ' 'returns the secret ' 'values for the ' 'specified secrets.', 'properties': {'Params': {'$ref': '#/definitions/GetSecretContentArgs'}, 'Result': {'$ref': '#/definitions/SecretContentResults'}}, 'type': 'object'}, 'GetSecretRevisionContentInfo': {'description': 'GetSecretRevisionContentInfo ' 'returns the ' 'secret values ' 'for the ' 'specified ' 'secret ' 'revisions.', 'properties': {'Params': {'$ref': '#/definitions/SecretRevisionArg'}, 'Result': {'$ref': '#/definitions/SecretContentResults'}}, 'type': 'object'}, 'GetSecretsToDrain': {'description': 'GetSecretsToDrain ' 'returns metadata for the ' 'secrets that need to be ' 'drained.', 'properties': {'Result': {'$ref': '#/definitions/ListSecretResults'}}, 'type': 'object'}, 'WatchSecretBackendChanged': {'description': 'WatchSecretBackendChanged ' 'sets up a ' 'watcher to ' 'notify of ' 'changes to the ' 'secret backend.', 'properties': {'Result': {'$ref': '#/definitions/NotifyWatchResult'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(ErrorResults) async def ChangeSecretBackend(self, args=None): ''' ChangeSecretBackend updates the backend for the specified secret after migration done. args : typing.Sequence[~ChangeSecretBackendArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='UserSecretsDrain', request='ChangeSecretBackend', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(SecretBackendConfigResults) async def GetSecretBackendConfigs(self, backend_ids=None, for_drain=None): ''' GetSecretBackendConfigs gets the config needed to create a client to secret backends for the drain worker. backend_ids : typing.Sequence[str] for_drain : bool Returns -> SecretBackendConfigResults ''' if backend_ids is not None and not isinstance(backend_ids, (bytes, str, list)): raise Exception("Expected backend_ids to be a Sequence, received: {}".format(type(backend_ids))) if for_drain is not None and not isinstance(for_drain, bool): raise Exception("Expected for_drain to be a bool, received: {}".format(type(for_drain))) # map input types to rpc msg _params = dict() msg = dict(type='UserSecretsDrain', request='GetSecretBackendConfigs', version=1, params=_params) _params['backend-ids'] = backend_ids _params['for-drain'] = for_drain reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(SecretContentResults) async def GetSecretContentInfo(self, args=None): ''' GetSecretContentInfo returns the secret values for the specified secrets. args : typing.Sequence[~GetSecretContentArg] Returns -> SecretContentResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='UserSecretsDrain', request='GetSecretContentInfo', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(SecretContentResults) async def GetSecretRevisionContentInfo(self, pending_delete=None, revisions=None, uri=None): ''' GetSecretRevisionContentInfo returns the secret values for the specified secret revisions. pending_delete : bool revisions : typing.Sequence[int] uri : str Returns -> SecretContentResults ''' if pending_delete is not None and not isinstance(pending_delete, bool): raise Exception("Expected pending_delete to be a bool, received: {}".format(type(pending_delete))) if revisions is not None and not isinstance(revisions, (bytes, str, list)): raise Exception("Expected revisions to be a Sequence, received: {}".format(type(revisions))) if uri is not None and not isinstance(uri, (bytes, str)): raise Exception("Expected uri to be a str, received: {}".format(type(uri))) # map input types to rpc msg _params = dict() msg = dict(type='UserSecretsDrain', request='GetSecretRevisionContentInfo', version=1, params=_params) _params['pending-delete'] = pending_delete _params['revisions'] = revisions _params['uri'] = uri reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(ListSecretResults) async def GetSecretsToDrain(self): ''' GetSecretsToDrain returns metadata for the secrets that need to be drained. Returns -> ListSecretResults ''' # map input types to rpc msg _params = dict() msg = dict(type='UserSecretsDrain', request='GetSecretsToDrain', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(NotifyWatchResult) async def WatchSecretBackendChanged(self): ''' WatchSecretBackendChanged sets up a watcher to notify of changes to the secret backend. Returns -> NotifyWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='UserSecretsDrain', request='WatchSecretBackendChanged', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]class UserSecretsManagerFacade(Type): name = 'UserSecretsManager' version = 1 schema = {'definitions': {'DeleteSecretArg': {'additionalProperties': False, 'properties': {'label': {'type': 'string'}, 'revisions': {'items': {'type': 'integer'}, 'type': 'array'}, 'uri': {'type': 'string'}}, 'required': ['uri', 'label'], 'type': 'object'}, 'DeleteSecretArgs': {'additionalProperties': False, 'properties': {'args': {'items': {'$ref': '#/definitions/DeleteSecretArg'}, 'type': 'array'}}, 'required': ['args'], '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': {'DeleteRevisions': {'description': 'DeleteRevisions deletes ' 'the specified revisions of ' 'the specified secret.', 'properties': {'Params': {'$ref': '#/definitions/DeleteSecretArgs'}, 'Result': {'$ref': '#/definitions/ErrorResults'}}, 'type': 'object'}, 'WatchRevisionsToPrune': {'description': 'WatchRevisionsToPrune ' 'returns a watcher ' 'for notifying when:\n' ' - a secret ' 'revision owned by ' 'the model no longer\n' ' has any ' 'consumers and should ' 'be pruned.', 'properties': {'Result': {'$ref': '#/definitions/StringsWatchResult'}}, 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(ErrorResults) async def DeleteRevisions(self, args=None): ''' DeleteRevisions deletes the specified revisions of the specified secret. args : typing.Sequence[~DeleteSecretArg] Returns -> ErrorResults ''' if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) # map input types to rpc msg _params = dict() msg = dict(type='UserSecretsManager', request='DeleteRevisions', version=1, params=_params) _params['args'] = args reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(StringsWatchResult) async def WatchRevisionsToPrune(self): ''' WatchRevisionsToPrune returns a watcher for notifying when: - a secret revision owned by the model no longer has any consumers and should be pruned. Returns -> StringsWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='UserSecretsManager', request='WatchRevisionsToPrune', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs]class VolumeAttachmentPlansWatcherFacade(Type): name = 'VolumeAttachmentPlansWatcher' version = 1 schema = {'definitions': {'Error': {'additionalProperties': False, 'properties': {'code': {'type': 'string'}, 'info': {'patternProperties': {'.*': {'additionalProperties': True, 'type': 'object'}}, 'type': 'object'}, 'message': {'type': 'string'}}, 'required': ['message', 'code'], 'type': 'object'}, 'MachineStorageId': {'additionalProperties': False, 'properties': {'attachment-tag': {'type': 'string'}, 'machine-tag': {'type': 'string'}}, 'required': ['machine-tag', 'attachment-tag'], 'type': 'object'}, 'MachineStorageIdsWatchResult': {'additionalProperties': False, 'properties': {'changes': {'items': {'$ref': '#/definitions/MachineStorageId'}, 'type': 'array'}, 'error': {'$ref': '#/definitions/Error'}, 'watcher-id': {'type': 'string'}}, 'required': ['watcher-id', 'changes'], 'type': 'object'}}, 'properties': {'Next': {'description': 'Next returns when a change has ' 'occurred to an entity of the\n' 'collection being watched since the ' 'most recent call to Next\n' 'or the Watch call that created the ' 'srvMachineStorageIdsWatcher.', 'properties': {'Result': {'$ref': '#/definitions/MachineStorageIdsWatchResult'}}, 'type': 'object'}, 'Stop': {'description': 'Stop stops the watcher.', 'type': 'object'}}, 'type': 'object'}
[docs] @ReturnMapping(MachineStorageIdsWatchResult) async def Next(self): ''' Next returns when a change has occurred to an entity of the collection being watched since the most recent call to Next or the Watch call that created the srvMachineStorageIdsWatcher. Returns -> MachineStorageIdsWatchResult ''' # map input types to rpc msg _params = dict() msg = dict(type='VolumeAttachmentPlansWatcher', request='Next', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] @ReturnMapping(None) async def Stop(self): ''' Stop stops the watcher. Returns -> None ''' # map input types to rpc msg _params = dict() msg = dict(type='VolumeAttachmentPlansWatcher', request='Stop', version=1, params=_params) reply = await self.rpc(msg) return reply
[docs] 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